query_id
stringlengths
32
32
query
stringlengths
7
29.6k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
4aaf731cf535a52ed67974d12cf96068
[120, 60, 40, 30, 24] / 2) without division
[ { "docid": "6262cf143deb45cbe6a899ad58499dbc", "score": "0.0", "text": "function multiply_arr_no_div(arr) {\n let new_arr = [];\n for (var i = 0; i < arr.length; i++) {\n let multiply = 1;\n for (var j = 0; j < arr.length; j++) {\n // multiply all items except items it self arr[i]\n if (i !== j) {\n multiply *= arr[j]\n }\n }\n new_arr[i] = multiply\n }\n return new_arr;\n}", "title": "" } ]
[ { "docid": "89592c124f02bb53e9a3e46a14b1b10c", "score": "0.64487517", "text": "function iWantToGet(ammountRequired) {\n // console.log(Math.floor(ammountRequired / 100) + \" \" + ammountRequired % 100)\n let avaleble = [100,50,20,10]\n let res = []\n\n if(ammountRequired > 0){\n for (let i = 0; i < avaleble.length; i++) {\n res[i] = Math.floor(ammountRequired / avaleble[i])\n ammountRequired = ammountRequired % avaleble[i]\n }\n }else{\n return -1\n }\n return res\n}", "title": "" }, { "docid": "5c479a84bb8d75e18c393b8268e954b1", "score": "0.63021517", "text": "function div (a){\n var newArray=[];\n var currentValue;\n for (var i=0; i<a.length; i++){\n currentValue = a[i]/2+5;\n if (currentValue===0){\n newArray[newArray.length]=20\n }\n else {\n newArray[newArray.length]=currentValue;\n }\n }\n return newArray;\n}", "title": "" }, { "docid": "2cbe3c85948478ccd71331bed6490d27", "score": "0.6186396", "text": "function halfValue(numbers) {\n let halvedA = [];\n for (let i = 0; i < numbers.length; i++){\n halvedA[i] = Math.ceil(numbers[i] / 2);\n }\n\n return halvedA;\n}", "title": "" }, { "docid": "29fb31b29b5ab0cad661dda01e9e0a3f", "score": "0.6175184", "text": "function eDivBy2(e) {\n const e_ = [];\n for (let i = 0; i < e.length; i++) {\n e_.push(0.5 * e[i]);\n }\n return e_;\n}", "title": "" }, { "docid": "35592e58510408f2ee135954279fb1a1", "score": "0.6128237", "text": "function divmod(x,y) {\n if (x < 0) {\n var x2=(Number(y)+Number(x))%y;\n if (abs(x) <= y) {\n return [int(Math.floor(x/y)), x2]\n } \n return [int(Math.ceil(x/y)), x2]\n } \n return list([int(Math.floor(x/y)), x.__class__.__mod__(x,y)])\n}", "title": "" }, { "docid": "0144ac73bd1898ba49d4d61de5839f28", "score": "0.61142313", "text": "function integerDiv(a, b){\n return (a - a % b) / b;\n}", "title": "" }, { "docid": "86b06ccd50d3ae5a6054849baaf4da24", "score": "0.60904497", "text": "function divValues(firstVal, secondVal) {\n\tvar result = 0;\n\tresult = firstVal / secondVal;\n\treturn result;\n}", "title": "" }, { "docid": "f5c55310b6ad59ea08a3183b5a79232c", "score": "0.6053853", "text": "function div(a,b){\r\n return a/b;\r\n}", "title": "" }, { "docid": "4dad170375deb697a74b51564f5af030", "score": "0.60288733", "text": "function divide (a, b) {\n return a/=b\n}", "title": "" }, { "docid": "ae773bcb0f367170c9c5722e1b44f415", "score": "0.60101557", "text": "function myFunction(arr) {\n const result =\n arr.reduce(\n (previousValue, currentValue) => previousValue + currentValue,\n 0\n ) / arr.length;\n return result;\n}", "title": "" }, { "docid": "718798cba8709830c9da88a82d3bcddb", "score": "0.6001742", "text": "function divmod(a, b) {\n var mod = a % b;\n return [(a - mod) / b, mod];\n }", "title": "" }, { "docid": "c394eea585d9320d2d1c94c41a2a1ebe", "score": "0.5998913", "text": "function divideElement(array){\n newArray = [];\n for(i = 0; i < array.length; i++){\n if (array[i] !== 0){\n newArray[i] = array[i] / 2 + 5;\n }\n else if (array[i] === 0){\n newArray[i] = 20\n }\n }\n return newArray\n}", "title": "" }, { "docid": "4262e0323426b3a2a2c965cfb12f1f06", "score": "0.59938496", "text": "function sc_quotient(x, y) {\n return parseInt(x / y);\n}", "title": "" }, { "docid": "4262e0323426b3a2a2c965cfb12f1f06", "score": "0.59938496", "text": "function sc_quotient(x, y) {\n return parseInt(x / y);\n}", "title": "" }, { "docid": "a7a54a0c03e87773dae0615da9ae4a66", "score": "0.5970194", "text": "function div(a,b){\r\n return a/b\r\n}", "title": "" }, { "docid": "d5c4d97ae881707ec4dc22edc7e1a6a8", "score": "0.5955876", "text": "function division ()\n{\n var final = cal.value.split('/');\n var a = Number(final[0]);\n var b = Number(final[1]);\n var result = a / b;\n cal.value = result;\n}", "title": "" }, { "docid": "c80787f27ec940bdff7e3f7d740f1377", "score": "0.59483993", "text": "function getMultiple(scr,sal)\n{\n\treturn Math.round( (scr/(sal*.001)) *10)/10;\n}", "title": "" }, { "docid": "d06e5bd45d38dbfa32519270d7a83708", "score": "0.5940228", "text": "function divide(arr){\n if(arr.length === 1){\n return arr[0]\n }else if(arr.length ===2){\n return merge(arr[0], arr[1])\n }\n let curHalf = parseInt(arr.length/2)\n \n let firstArray = arr.slice(0,curHalf);\n let secondArray = arr.slice(curHalf, arr.length);\n \n return merge(divide(firstArray), divide(secondArray));\n }", "title": "" }, { "docid": "c9ce6cbe8a0bbf41965c10a06cd48e41", "score": "0.5935485", "text": "function subVat(a){\n return a / (1+(25/100))\n}", "title": "" }, { "docid": "4646db36490faebf18a32e33f7bbdada", "score": "0.5929233", "text": "function division(){\n var dividir= 1;\n for(let i=0;i<arguments.length;i++){\n if (arguments[i]== 0) {\n return undefined;\n } else {\n dividir/=arguments[i];\n }\n }\n return dividir;\n}", "title": "" }, { "docid": "b41f90559bd9920c69716dcf77622652", "score": "0.5913715", "text": "static divide(dividend, divisor) {\n return dividend/divisor\n\n }", "title": "" }, { "docid": "ac3972812206b6c46d0cf086c54370e0", "score": "0.59108067", "text": "function cal2()\n{\n const b=3213/20;\n return b;\n}", "title": "" }, { "docid": "ec291a960bef234b4d2e5977d98ab0f2", "score": "0.5904357", "text": "divide(l, r) {\n let pil = l - 1;\n let piv = r;\n\n for (let sco = l; sco < piv; sco++)\n if (this.values[sco] < this.values[piv]) this.swap(++pil, sco);\n\n this.swap(++pil, piv);\n\n return pil;\n }", "title": "" }, { "docid": "7aa0a0dbac33352fdf7fff3ec6571785", "score": "0.5902056", "text": "function divides(number) {\n return number / 3\n}", "title": "" }, { "docid": "d7d7185e78e578a709166bf7865eca1c", "score": "0.5873893", "text": "function plusMinus(arr) {\n const ratioArray = arr.reduce((acc, next) => {\n if (next > 0)\n acc[0]++;\n if (next < 0)\n acc[1]++;\n if (next === 0)\n acc[2]++;\n return acc;\n }, [0, 0, 0]).map((ele) => (ele / arr.length).toPrecision(6));\n\n ratioArray.forEach(element => console.log(element));\n}", "title": "" }, { "docid": "2c08d9f954e5048fc9e701e5a17dafd2", "score": "0.584111", "text": "function calculateDivision(data, callback){\n var result =[];\n for(i=0; i<data.length; i++){\n if (data[i][1]){\n result[i]=data[i][0]/data[i][1];\n } else {\n result[i]=data[i][0]/1;\n }\n }\n callback(result);\n}", "title": "" }, { "docid": "3be8c0f46a3069339beea69aedc28cf4", "score": "0.58410937", "text": "function divide(firstNum, ...numbers) {\n return numbers.reduce((a, b) => a / b, firstNum);\n }", "title": "" }, { "docid": "f88762f05afd7cbc52a860b6d0227511", "score": "0.5839392", "text": "function b(a,b){return Math.round(a/b)*b}", "title": "" }, { "docid": "a51dd183331ce78431909ec1d8a23fc5", "score": "0.5839069", "text": "function fractionate(val, minVal, maxVal) {\n return (val - minVal) / (maxVal - minVal);\n }", "title": "" }, { "docid": "7aab800a3933b5e2e0f231dc5b20b6de", "score": "0.5839021", "text": "function fractionate(val, minVal, maxVal) {\n return (val - minVal) / (maxVal - minVal);\n}", "title": "" }, { "docid": "bc73ae743074cd566df64c861f6cc8ae", "score": "0.58384746", "text": "function stat(a, b) {\n return [\n a + b,\n (a + b) / 2,\n a - b\n ]\n}", "title": "" }, { "docid": "df1581929332dfea6b716249da2f6150", "score": "0.5832511", "text": "function Half(first, second){\n return first/second;\n}", "title": "" }, { "docid": "64ea17b0fe164466e71920f6a704cff7", "score": "0.57898283", "text": "equallyDivide() {\n let base = this.notesPerOctave, step = this.octaveSize.equals(Interval.octave) ? new ETInterval(1, base) : this.octaveSize.divide(base).asET(base);\n for (let i = 0; i < base; i++)\n this.map[i] = step.multiply(i);\n }", "title": "" }, { "docid": "502f274a4920b2db7df71b62f60d5d13", "score": "0.57854086", "text": "function divide(a, b) {\n\t// TODO return \n}", "title": "" }, { "docid": "2c26a415c3408b4884ee4376587e2dba", "score": "0.5784395", "text": "function average(l) {return l.reduce((a,b) => a + b, 0)/l.length;}", "title": "" }, { "docid": "358d0c769fe3d6fe1c0290d8ab269f52", "score": "0.57819104", "text": "_average (arr) {\n return arr.reduce((p, c) => p + c, 0) / arr.length\n }", "title": "" }, { "docid": "8b3e0c0a49c578c0abdf02bab40ab089", "score": "0.57722473", "text": "function normalize(xs){\r\n const max = xs.max(); // 76\r\n const min = xs.min();\r\n const denominator = max.sub(min);\r\n const numerator = xs.sub(min);\r\n return numerator.div(denominator);\r\n}", "title": "" }, { "docid": "a3586b9f77b0dea0cb8dfe3d481f500c", "score": "0.5770743", "text": "function calculateArray(arr) {\n\n var result = [];\n\n for (var i = 0; i < arr.length; i++) {\n\n result[i] = arr[i] / 2 + 5;\n\n if (result[i] === 0) {\n result[i] = 20\n }\n }\n\n return result;\n}", "title": "" }, { "docid": "8a8b4b24d61b6a7a5a9d3bbb51b8cd3a", "score": "0.57650864", "text": "calcBaths(val1, val2, amt, total) {\n let numbers = [0,0]\n numbers[0] = (amt - total*val2)/(val1-val2)\n numbers[1] = total - numbers[0]\n return numbers\n }", "title": "" }, { "docid": "22f9f591fae65d62971f56a88bb49749", "score": "0.57485104", "text": "function halveAll(numbers) {\n return map(numbers, function(element) {\n return element / 2;\n });\n}", "title": "" }, { "docid": "7e612bda71a493e3b53effcc92e8fcbf", "score": "0.5741111", "text": "function percentOf(firstNumber,secNumber){\n return firstNumber / secNumber *100\n}", "title": "" }, { "docid": "89a914de24e5d52adf102ebc693a1ef3", "score": "0.57370627", "text": "function getMiddlevalue(arr) {\n // console.log(arr.length); //всего 10 элементов\n // console.log(arr);\n // вывести среднее арифметическое\n // let average = arr.reduce((total, el) => total + el / arr.length, 0);\n // console.log(\"average\", average); //6.54\n // yзнать парное или не парное количество єлементов в массиве\n // в случае если массив с парным количеством элементов\n if (arr.length % 2 === 0) {\n // вывод длинны половины элементов\n console.log(arr.length / 2); //5\n // вывод индексов соседних элементов\n let prevElIdx = arr.length / 2 - 1; //4\n let nextElIdx = arr.length / 2; //5\n // значения элементов по индексу\n // console.log(\"prevElIdx\", prevElIdx, \"nextElIdx\", nextElIdx);\n // console.log(\"сумма 2 средних элементов :\", arr[prevElIdx] + arr[nextElIdx]);\n let sum = arr[prevElIdx] + arr[nextElIdx];\n let middleValue = sum / 2;\n return middleValue;\n }\n // в случае если массив с не парным количеством элементов\n if (arr.length % 2 !== 0) {\n // вывод длинны\n // console.log(arr.length);\n // // найти средний элемент в массиве, заокруглить до среднего элемента\n // console.log(Math.floor(arr.length / 2));\n let idx = Math.floor(arr.length / 2);\n return arr[idx];\n }\n}", "title": "" }, { "docid": "f4ebac5efda3d25b431cadc8c8696ba4", "score": "0.5732229", "text": "function divideTwoNumbers(dividend, divisor) {\n return dividend / divisor;\n}", "title": "" }, { "docid": "53fd90c3df41c44eca8bb705cf2a071b", "score": "0.57322115", "text": "function avg(arr) {\n return arr.reduce((p, c) => { return p + c }, 0) / arr.length\n}", "title": "" }, { "docid": "f38fc5418929c17816258bce4b2b7184", "score": "0.5728877", "text": "function calMod(a, b) {\n return a - (b * Math.floor(a / b));\n}", "title": "" }, { "docid": "a725814e5fe8196e85b8bd5d5db67f88", "score": "0.5722387", "text": "function divide(x,y)\n{\n\treturn x/y;\n\t\n}", "title": "" }, { "docid": "7b56a12f5fdb7488c7cc65e47e49fc10", "score": "0.57200426", "text": "getAverageRating(){\r\n const ratingsSum = this._ratings.reduce((currentSum, rating)=> currentSum + rating, 0);\r\n const lengthOfArray = this._ratings.length;\r\n return ratingsSum/lengthOfArray;\r\n}", "title": "" }, { "docid": "0a33054f1493607ceb1acea49bfcbf36", "score": "0.571251", "text": "function divide(x, y) {\n return x / y;\n}", "title": "" }, { "docid": "a1e24c9ffc28fcc44e78c312957487b2", "score": "0.5708651", "text": "function div(num1,num2)\n{\n return(num2/num1);\n}", "title": "" }, { "docid": "b185f0223a69f0cebfeb653f736d7b3b", "score": "0.5704427", "text": "function division(){\n var division = 48/3;\n document.getElementById(\"division\").innerHTML = \"48/3 = \" + division;\n}", "title": "" }, { "docid": "41300f53a134aea7d56187c2f853260f", "score": "0.5702634", "text": "function ave_value (total, one_number) {\n\nlet numbers = [2,4,5,7,11], //ave_value is 5.8\n result;\n\n result = numbers.reduce((total, one_number) => total + one_number, 0);\n result = result / numbers.length\n\nconsole.log(result);\n\n}", "title": "" }, { "docid": "0b4a7e781b2547d70355188329c8875b", "score": "0.5699183", "text": "function divide(a,b) { \n return a / b\n}", "title": "" }, { "docid": "cc2977ec385a6ecbd5eda4852ec4de41", "score": "0.5690154", "text": "function divide(a, b) {\n return a / b\n}", "title": "" }, { "docid": "ccf34fea6003affb6def55b8718a1e7f", "score": "0.5688484", "text": "function Div(num1, num2) {\n return num1 / num2;\n}", "title": "" }, { "docid": "5ac2667e4b32ef5be91837c4501cb719", "score": "0.5688445", "text": "function divideNumbers(firstNumber, secondNumber) {\n\tvar divNums = firstNumber / secondNumber;\n\treturn divNums;\n}", "title": "" }, { "docid": "d473537f1f2ad436347c4e95f61a5ae0", "score": "0.5685536", "text": "function divi(num1, num2){\n\tlet quotient= num1 / num2;\n\treturn quotient;\n}", "title": "" }, { "docid": "0dfcd56f16e85f3eaa3829652a0e6037", "score": "0.56834215", "text": "function divide(a, b) {\n return a/b;\n}", "title": "" }, { "docid": "ef63f78a12b9c199b908e1c0ceae86f0", "score": "0.56828314", "text": "function divideByTwo(num) {\r\n return num / 2;\r\n}", "title": "" }, { "docid": "1064279537f5cd3afe14df9d4ccd1184", "score": "0.56799763", "text": "function findProdDiv (arr) {\n\tvar allProduct = 1;\n\tvar productArr = [];\n\n\t// find the product of entire array\n\tfor (var i=0; i<arr.length; i++) {\n\t\tallProduct *= arr[i];\n\t}\n\n\tfor (var i=0; i<arr.length; i++) {\n\t\tproductArr.push(allProduct/arr[i]);\n\t}\n\n\tconsole.log(productArr);\n\n}", "title": "" }, { "docid": "d3a51d818bf981888f52653db67043b7", "score": "0.5669439", "text": "function div_(x, y) {\n return x / y;\n }", "title": "" }, { "docid": "a340d0ce8cefbe480876822b04642533", "score": "0.5669327", "text": "function cutInHalf (value) {\r\n return value / 2;\r\n}", "title": "" }, { "docid": "ede98d3ae8ee5c628a955b7eeb390fc2", "score": "0.5659841", "text": "function accDiv(arg1,arg2) {\n let t1=0,t2=0,r1,r2;\n try{t1=arg1.toString().split(\".\")[1].length}catch(e){}\n try{t2=arg2.toString().split(\".\")[1].length}catch(e){}\n r1=Math.Number(arg1.toString().replace(\".\",\"\"));\n r2=Math.Number(arg2.toString().replace(\".\",\"\"));\n return (r1/r2)*Math.pow(10,t2-t1);\n }", "title": "" }, { "docid": "0d22c07e95b209a055d5c7eee4a0d1e6", "score": "0.565791", "text": "function row_divider(accumulator, currentValue, currentIndex, array) {\n if (accumulator > 0) {\n return accumulator;\n }\n const multiples = array.filter(item => evenly_divides(currentValue, item));\n if (multiples.length > 0) {\n return multiples[0] / currentValue;\n } else {\n return 0;\n }\n}", "title": "" }, { "docid": "a446054b9ff68c0c03ca7e057c07cfcf", "score": "0.565393", "text": "function find_avg(arr){\n total=arr[0];\n for(var i=1; i<arr.length; i++){\n total += arr[i];\n }\n return (total/arr.length)\n}", "title": "" }, { "docid": "919e47c072a77c80a94424f7325bf590", "score": "0.5652733", "text": "function halveAll(numbers) {\n // your code is here\n return map(numbers, function(element, i){\n return (element / 2);\n });\n}", "title": "" }, { "docid": "ba46d82ed93edbfd83ba5c0e2d8b6037", "score": "0.56495786", "text": "function calculate(a, b) {\n return [\n a + b,\n (a + b) / 2,\n a - b\n ]\n}", "title": "" }, { "docid": "ae8132dbe1f98a83629b609d426596de", "score": "0.5645813", "text": "function percentage(anyNumbers){\n let reducedArr = anyNumbers.reduce(\n (sum, current) => sum + current);\n let newNumberArr = [];\n let result;\n for (let i = 0; i < anyNumbers.length; i++){\n let aNumber = anyNumbers[i];\n result = Math.round((aNumber / 20))\n }\n \n}", "title": "" }, { "docid": "fa9143de16fd1c65c127bd294bc7459a", "score": "0.56398547", "text": "function divide(numerator, denominator){\n var divide = function divide(numerator,denominator){\n return denominator ? gcd(denominator, numerator%denominator) : numerator;\n };\n divide = divide(numerator,denominator);\n return [numerator/divide, denominator/divide];\n}", "title": "" }, { "docid": "1f570ae291126fd1c1cb3f6de09a1d38", "score": "0.5636937", "text": "function modulo2(a, b)\n{\n return a-b * Math.floor(a/b);\n}", "title": "" }, { "docid": "4febf2f140a51f7a4c205209ab031ed8", "score": "0.56348735", "text": "function divide(a, b){\n return a / b;\n }", "title": "" }, { "docid": "bfa673011d6d0bcdf9899985c57eb877", "score": "0.563487", "text": "function ap(num, diff) {\n const a1 = diff;\n const n = Math.floor(num/diff);\n const aN = n*diff;\n return (n * (a1*aN))/2\n}", "title": "" }, { "docid": "e6c8d94ed371dd1fe676057d1a8ae699", "score": "0.5633022", "text": "function average(arr){\n var avBalance = _.reduce(arr, function(origin, num){\n return Number(origin) + Number(num);\n }, 0) / arr.length;\n return Math.floor(avBalance);\n}", "title": "" }, { "docid": "d1a0b90044b8169e139d4f176e512e8a", "score": "0.56286293", "text": "ThreeOfaKind(){\n return (((13*4)*(12*48)*(11*4))/2)/2598960\n }", "title": "" }, { "docid": "58c48b8b0fa7d86685963f1267592065", "score": "0.56271905", "text": "function divide(a, b) {\n return a / b;\n}", "title": "" }, { "docid": "8674aeb517944badd049dbc508560ea1", "score": "0.5616855", "text": "function DIVIDE (n, d) {\n return parseInt( (n) / (d) - (( (n) < 0 && (n) % (d) < 0 ) ? 1 : 0) );\n}", "title": "" }, { "docid": "ceca941687f7a3e708c82fa1b59e73c3", "score": "0.56105804", "text": "function divisao(a,b){\nreturn a.metodo() / b;\n}", "title": "" }, { "docid": "57c851d18249063fc592434cb063c657", "score": "0.56089616", "text": "getAverageRating(){\r\n let ratingsSum = this.rating.reduce((currentSum,rating) => currentSum + rating,0);\r\n const lengthOfArray = ratings.length;\r\n return ratingsSum/lengthOfArray;\r\n }", "title": "" }, { "docid": "16e152a3a83b32f7c21cef9545b530fd", "score": "0.5600727", "text": "function divide(a, b) {\n return a/b;\n }", "title": "" }, { "docid": "e23afdbc5f1c210a31ce8da62d9f6954", "score": "0.5596996", "text": "function divide(a, b) {\n var c = parseInt(elementsArray[a]) / parseInt(elementsArray[b]);\n elementsArray[a] = c.toString();\n elementsArray.splice(a + 1, 2);\n }", "title": "" }, { "docid": "98f8242f9dbcd6fe8dd9e66d035d293a", "score": "0.5585126", "text": "function average() {\n return arr.reduce((a, b) => a + b, 0)/arr.length;\n}", "title": "" }, { "docid": "6b321e18e6e72bcac374dab94a20d5d2", "score": "0.5573076", "text": "function divideAndStringed(x,y){\n\tvar result = Math.round(x/y), strRes = String(result),arrLength=0,arr=[];\n\tarrLength = strRes.length;\n\tfor(var i=0;i<arrLength;i++){\n\t\tarr.push(strRes[i]);\n\t}\n\treturn arr;\n}", "title": "" }, { "docid": "ed26ddfdb6ea6397f7a2cbedcdae7273", "score": "0.5570716", "text": "function dividebytwo(num){\n return num/2;\n}", "title": "" }, { "docid": "cb473cb9c9b2a3b4fc0c3909c72d6e70", "score": "0.5567296", "text": "f2(x) {return Math.round((600/(x+100)) + (21/6))}", "title": "" }, { "docid": "c3f89b10d04c0a88fe61bad93298b939", "score": "0.5562152", "text": "function divideTwo(ten, five) {\n return 10 / 5\n}", "title": "" }, { "docid": "72a8b3ea9b9e240fbdd149ea98fc25d7", "score": "0.5558587", "text": "function IntegerDiv(num1, num2) {\n return Math.floor(num1 / num2);\n}", "title": "" }, { "docid": "a9c9aa1964a7f1fc69c7ce459e136279", "score": "0.5554134", "text": "function div(distance,time) {\n var speed = distance/time;\n // return speed;\n\n console.log(speed)\n}", "title": "" }, { "docid": "0900d8491f656644052d96cbeaeebbf7", "score": "0.5542805", "text": "function pazymiuVidurkis() {\nlet x=(5+10+8+6+8)/5;\nconsole.log(x)\n}", "title": "" }, { "docid": "54b847cc3fe07568102e278b469fd499", "score": "0.5538875", "text": "function remainder(a, b) {\n return a/b;\n }", "title": "" }, { "docid": "96519a5a83d6586b857da561a5179190", "score": "0.5537279", "text": "function divide(number1, number2)\n{\n let divided = parseFloat(number1) / parseFloat(number2);\n return divided;\n}", "title": "" }, { "docid": "893280f11620167dac8d6d0d4af21399", "score": "0.55295837", "text": "function average(numbers){\n console.log(numbers);\n let start = 0;\n numbers.forEach(function(number) {\n console.log(number);\n start = start + number;\n\n });\n\n \n\n return start / numbers.length;\n}", "title": "" }, { "docid": "5304c18c162427205f3af3ab09b28b60", "score": "0.5525533", "text": "function processor(input) {\n input.split(' ').map((a)=>{return parseInt(a)})\n // var quotient = \n // var remainder = \n // return input\n}", "title": "" }, { "docid": "b563adc1e1e38e0f1013d810ab471a89", "score": "0.5520604", "text": "function products(arr) {\n let total = arr.reduce((a, b) => a * b);\n let products = [];\n arr.forEach(val => products.push(total/val));\n return products;\n}", "title": "" }, { "docid": "261dc20c9d7b9dc215f5b0187e622336", "score": "0.5519987", "text": "function getAverage(sum,count){\n return parseFloat(sum/count);\n}", "title": "" }, { "docid": "11c5e931e9cda9e16e21f2ef2763b92b", "score": "0.5519062", "text": "function ex_3_I(array){\n var somma = 0;\n\tvar media;\n\tvar numeri = 0;\n\tfor (var i = 0; i < array.length; i++) {\n\t\tsomma += array[i];\n\t\tnumeri++;\n\t};\n\treturn somma/numeri;\n}", "title": "" }, { "docid": "63449cbdafc910a56c1a8cce929e19df", "score": "0.5512601", "text": "getAverageRating(){\n let ratingsSum = this.ratings.reduce((currentSum, rating) => currentSum + rating, 0)/this._ratings.length;\n return ratingsSum;\n }", "title": "" }, { "docid": "ee9c9ed21dbadf994cd5f5f36c0c61b9", "score": "0.5510411", "text": "function mod$1(dividend,divisor){return(dividend%divisor+divisor)%divisor;}", "title": "" }, { "docid": "9221bf08bbf44eb7c757ad0e4f19a550", "score": "0.55094886", "text": "divide(num){\r\n return new Vector2(this.x / num, this.y / num);\r\n }", "title": "" }, { "docid": "2c8ba2c484f139fa4a0bd6d45df915a0", "score": "0.55073667", "text": "function sc_div(x) {\n if (arguments.length === 1)\n\treturn 1/x;\n else {\n\tvar res = x;\n\tfor (var i = 1; i < arguments.length; i++)\n\t res /= arguments[i];\n\treturn res;\n }\n}", "title": "" }, { "docid": "ba8f653f03d31292ca6809e29bc6b64c", "score": "0.550672", "text": "function mod(a, b) {\n return a - b * Math.floor(a / b);\n }", "title": "" }, { "docid": "ba8f653f03d31292ca6809e29bc6b64c", "score": "0.550672", "text": "function mod(a, b) {\n return a - b * Math.floor(a / b);\n }", "title": "" }, { "docid": "ba8f653f03d31292ca6809e29bc6b64c", "score": "0.550672", "text": "function mod(a, b) {\n return a - b * Math.floor(a / b);\n }", "title": "" } ]
7b2b2b683ba0bcbc6fd57ef2bd2f5521
Function that updates the wins and losses of the player.
[ { "docid": "ed986968da93f5a1367ab259edb8fbf2", "score": "0.0", "text": "function status1() {\n\n\n if(guest === computer) {\n wins++;\n $(\"#wins\").html(\"Wins: \" + wins);\n $('#status').html(\"You win!\");\n \n game = false;\n }\n\n else if(guest > computer) {\n losses++;\n $(\"#losses\").html(\"Losses:\" + losses);\n $(\"#status\").html(\"You lost.\");\n game = false;\n }\n\n\n\n\n\n}", "title": "" } ]
[ { "docid": "f081e878a5167bf33552892e4853052b", "score": "0.7647888", "text": "function updateWins() {\n\tdocument.querySelector(\"#wins\").innerHTML = \"Wins: \" + wins;\n}", "title": "" }, { "docid": "e05206ea0ecc9bbe4840b95a58562158", "score": "0.7599585", "text": "function winsAndLosses() {\n if (randomNum === playerTotal) {\n wins++;\n $('#number-of-wins').text(wins);\n alert('You Win! (╯°□°)╯︵ ┻━┻');\n reset();\n } else if (randomNum < playerTotal) {\n losses++;\n $('#number-of-losses').text(losses);\n alert('You lost! (╯°□°)╯︵ ┻━┻');\n reset();\n }\n }", "title": "" }, { "docid": "1eea60bbef44f37664739bc3b1adf32f", "score": "0.75904006", "text": "function update () {\n\t\t\t$(\".wins\").html(\"Wins: \" + wins); // displays wins to page\n\t\t\t$(\".losses\").html(\"Losses: \" + losses); // displays losses to page\n\t\t}", "title": "" }, { "docid": "7e7b05f2d8d4e0be5be07fcd547e21e2", "score": "0.7492855", "text": "function updateStats() {\n\tdocument.getElementById('wins').innerHTML = wins;\n\tdocument.getElementById('losses').innerHTML = losses;\n\tdocument.getElementById('gamesplayed').innerHTML = wins + losses;\n}", "title": "" }, { "docid": "58eeca1410b02e9ad38dda793616d225", "score": "0.7458887", "text": "update() {\n // On every win\n win();\n // If player goes outside\n this.outsideCanvas();\n }", "title": "" }, { "docid": "a6fa53d586c1098cb97382d1dde52751", "score": "0.74446094", "text": "function winsLosses() {\n if (scoreHolder === winningScore) {\n wins++;\n $(\"#win\").text(wins);\n reset();\n \n }\n\n else if (scoreHolder > winningScore){\n losses++;\n $(\"#loss\").text(losses);\n reset();\n }\n\n \n}", "title": "" }, { "docid": "d18d585a265fd1a83075f07d71bc87b5", "score": "0.7399422", "text": "function updatedScore(wins) {\n if (wins != null) {\n var msg = \"Your score is \" + wins;\n localBoard.drawMessage(msg, \"gold\");\n }\n }", "title": "" }, { "docid": "9804b5efc6bdb197dcf1ce4cbd1c6b35", "score": "0.73703605", "text": "function updateLoss() {\r\n\tgameState.losses ++;\r\n\tgameReset();\r\n\t$(\"#wins\").css(\"color\",\"black\")\r\n\t$(\"#losses\").css(\"color\",\"orange\")\r\n}", "title": "" }, { "docid": "c941f0f4ede6d571b41fdda7b2788114", "score": "0.7348406", "text": "function playerWins() {\n setGameState('playerWins');\n setRunRoundConfetti(true);\n increasePlayerScore();\n // Wait a moment before setting up the next round\n setTimeout(function () {\n setUpRoundN();\n }, 2000);\n }", "title": "" }, { "docid": "1272fd23f3bda60393f5ee325d5b4058", "score": "0.73263866", "text": "function updateGamesWon() {\n winsElement.innerHTML = `Wins: ${gamesWon}`;\n}", "title": "" }, { "docid": "bc7be13f673a974b6c9722237857067f", "score": "0.7305306", "text": "function winsAndLosses() {\n document.getElementById(\"winning\").innerHTML = \"You've won \" + win + \" times\";\n document.getElementById(\"losing\").innerHTML = \"You've lost \" + loss + \" times\";\n }", "title": "" }, { "docid": "550884c6dcaecd4d884c566ff360ecdd", "score": "0.72999084", "text": "function userWins() {\n userObject.wins++;\n databaseModify.update();\n userScreen.win();\n setTimeout(function() {\n game.newRound();\n }, 2000);\n }", "title": "" }, { "docid": "0b3654ec191b81876d0afcdd81c5e6d7", "score": "0.7261542", "text": "function updateGame(){\n\n if(totalScore === randomNumber){\n alert(\"WINNER!\");\n wins++;\n $(\"#wins\").html(wins);\n restartGame();\n }\n \n else if(totalScore > randomNumber){\n alert(\"LOSER!\");\n losses++;\n $(\"#losses\").html(losses);\n restartGame();\n }\n \n }", "title": "" }, { "docid": "7e5fee1800a105dda0ca43615e01679b", "score": "0.7237702", "text": "function decideWinner() {\n\tgameOver = true;\n\tcardOpacity();\n\tif (player1.score > 21 && player2.score > 21) {\n\t\ttextTitle.textContent = \"No one won!\";\n\t\tdrawSound.play();\n\t\tplayer1.draws++;\n\t\tplayer2.draws++;\n\t\tdocument.querySelector(\".player1-draws\").textContent = player1.draws;\n\t\tdocument.querySelector(\".player2-draws\").textContent = player2.draws;\n\t} else if (player1.score > 21) {\n\t\ttextTitle.textContent = \"Player 2 won!\";\n\t\tlossSound.play();\n\t\tplayer2.wins++;\n\t\tplayer1.losses++;\n\t\tdocument.querySelector(\".player1-losses\").textContent = player1.losses;\n\t\tdocument.querySelector(\".player2-wins\").textContent = player2.wins;\n\t} else if (player2.score > 21) {\n\t\ttextTitle.textContent = \"Player 1 won!\";\n\t\twinSound.play();\n\t\tplayer1.wins++;\n\t\tplayer2.losses++;\n\t\tdocument.querySelector(\".player1-wins\").textContent = player1.wins;\n\t\tdocument.querySelector(\".player2-losses\").textContent = player2.losses;\n\t} else {\n\t\tconst player1Complement = 21 - player1.score;\n\t\tconst player2Complement = 21 - player2.score;\n\t\tif (player1Complement < player2Complement) {\n\t\t\ttextTitle.textContent = \"Player 1 won!\";\n\t\t\twinSound.play();\n\t\t\tplayer1.wins++;\n\t\t\tplayer2.losses++;\n\t\t\tdocument.querySelector(\".player1-wins\").textContent = player1.wins;\n\t\t\tdocument.querySelector(\".player2-losses\").textContent = player2.losses;\n\t\t} else if (player2Complement < player1Complement) {\n\t\t\ttextTitle.textContent = \"Player 2 won!\";\n\t\t\tlossSound.play();\n\t\t\tplayer2.wins++;\n\t\t\tplayer1.losses++;\n\t\t\tdocument.querySelector(\".player1-losses\").textContent = player1.losses;\n\t\t\tdocument.querySelector(\".player2-wins\").textContent = player2.wins;\n\t\t} else {\n\t\t\ttextTitle.textContent = \"Draw\";\n\t\t\tdrawSound.play();\n\t\t\tplayer1.draws++;\n\t\t\tplayer2.draws++;\n\t\t\tdocument.querySelector(\".player1-draws\").textContent = player1.draws;\n\t\t\tdocument.querySelector(\".player2-draws\").textContent = player2.draws;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "08a25e5fe54ce2244cc2bfffe49ea0e7", "score": "0.7226009", "text": "function playerWins() {\n $(\"#message\").html(\"<p>Player wins!</p>\");\n gameStarted = false;\n resetGame = true;\n }", "title": "" }, { "docid": "0a43fc6b516c1b67637c4227cf885a13", "score": "0.7222161", "text": "update() {\n if (this.y < 0) {\n this.winMsg = true;\n this.y = 0;\n congratulations();\n }\n if (this.lives === 0) {\n this.lives = -1;\n this.lost = true;\n gameLost();\n }\n }", "title": "" }, { "docid": "ea7efb2d529bfa3b0e941ba662b4b17c", "score": "0.72131485", "text": "function update()\n {\n\n\n if(currentScore < targetScore) {\n $(\"#State\").text(\"Scoreboard\");\n }\n if (currentScore > targetScore) {\n losses++;\n $(\"#State\").text(\"You Lose!\")\n Start();\n\n }\n\n \n\n if (currentScore == targetScore) {\n wins++;\n $(\"#State\").text(\"You Win!\")\n Start();\n }\n\n \n}", "title": "" }, { "docid": "ed75602981685b586e7aa68962cb3c4f", "score": "0.72076297", "text": "function win() {\n wins = wins + 1;\n $('#wins').text(wins);\n resetTwo();\n reset();\n }", "title": "" }, { "docid": "2275c5e3765ccaae4367b3f671fbe4af", "score": "0.7205358", "text": "function __playerWon(player) {\n var playerScores = [], winningPlayer, lostPlayers = [];\n\n for (var i = 0; i < __players.length; i++) {\n var p = __players[i],\n playerScore = p.getScore();\n\n if (p === player) {\n playerScore++;\n }\n\n playerScores.push(playerScore);\n\n }\n\n //console.log()\n\n //__setGamePauseStatus(true);\n __resetGame(playerScores);\n\n for (var i = 0; i < __players.length; i++) {\n var p = __players[i];\n\n if (player.getName() === p.getName()) {\n winningPlayer = p;\n }\n else {\n lostPlayers.push(p);\n }\n\n p.setScore(playerScores[i]);\n }\n\n __eventCallbacks['gameWin'].call(__game, winningPlayer, lostPlayers);\n\n //__showTitleScreen();\n\n }", "title": "" }, { "docid": "df755881c89d35f53b209df38d07f037", "score": "0.7168518", "text": "function checkWinsLosses() {\n if (score === random) {\n wins++;\n $(\"#wins\").text(wins);\n reset();\n } else if (score > random) {\n losses++;\n $(\"#losses\").text(losses);\n reset();\n }\n }", "title": "" }, { "docid": "77c98b65a532b98abbcb5c186dad5a90", "score": "0.7155968", "text": "function playerWins() {\n\tdocument.getElementById('playerScore').textContent = '';\n\tdocument.getElementById(\"playerScore\").textContent += playerCurrentScore;\n}", "title": "" }, { "docid": "b504202f06d5d4d5e7159aab63c44b7d", "score": "0.7139558", "text": "function updateWin() {\r\n\taudioElement.setAttribute(\"src\", \"assets/sounds/chime.mp3\");\r\n\taudioElement.play();\r\n\tgameState.wins ++;\r\n\tgameReset();\r\n\t$(\"#wins\").css(\"color\",\"yellow\")\r\n\t$(\"#losses\").css(\"color\",\"black\")\r\n}", "title": "" }, { "docid": "7f8d3f50a72ddfa3bfe1768d00a09eaf", "score": "0.71289134", "text": "function checkWinOrLoss() {\n if (totalScore === randomNumToGuess) { // We have a winner\n wins++;\n initializeGame()\n }\n else if (totalScore > randomNumToGuess) { // We have a loser\n losses++;\n initializeGame();\n }\n else {\n updateUI;\n }\n }", "title": "" }, { "docid": "4214ef625b5ed5fd1fbd80eccea860af", "score": "0.7115732", "text": "function winOrLose() {\n if (randomNumber === userScore) {\n wins++;\n $(\"#wins\").text(\"Wins: \" + wins);\n // call reset function to reset values and random number\n reset();\n } else if (userScore > randomNumber){\n losses++;\n $(\"#losses\").text(\"Losses: \" + losses);\n // call reset function to reset values and random number\n reset();\n }\n }", "title": "" }, { "docid": "0f2f9c66b7dfe33d93a770352c936afe", "score": "0.7099145", "text": "function win() {\n winner.play();\n $(\"#outcome\").show().text(\"Winner!\")\n wins++;\n $(\"#wins\").text('Wins: ' + wins);\n gameReset();\n }", "title": "" }, { "docid": "d07f36115b72e28d1b204cc46f8e2c7c", "score": "0.70989823", "text": "function updateStats() {\r\n\tif(state.saved_player_wins + state.saved_pc_wins > 0){\r\n\t\t//User win percentage\r\n\t\tvar plWins = Math.round((state.saved_player_wins/(state.saved_player_wins + state.saved_pc_wins)) * 100);\r\n\t\t//AI win percentage\r\n\t\tvar pcWins = Math.round((state.saved_pc_wins/(state.saved_player_wins + state.saved_pc_wins)) * 100);\r\n\t\tvar winText = document.getElementById(\"svgTextP1V\");\r\n\t\twinText.textContent = plWins + \"%\";\r\n\t\tvar looseText = document.getElementById(\"svgTextP1L\");\r\n\t\tlooseText.textContent = 100 - plWins + \"%\";\r\n\t\tvar winTextPC = document.getElementById(\"svgTextP2V\");\r\n\t\twinTextPC.textContent = pcWins + \"%\";\r\n\t\tvar looseTextPC = document.getElementById(\"svgTextP2L\");\r\n\t\tlooseTextPC.textContent = 100 - pcWins + \"%\";\r\n\r\n\t\tvar circles = []\r\n\t\tsvgSCircles.forEach(element => {\r\n\t\t\tcircles.push(document.getElementById(element));\r\n\t\t});\r\n\r\n\t\t//Win feedback\r\n\t\tif(plWins > 70) { //Good win percentage\r\n\t\t\tcircles[0].setAttribute('stroke','#00DCA4');\r\n\t\t\tcircles[0].setAttribute('fill','#00DCA4');\r\n\t\t\tcircles[1].setAttribute('stroke','#00DCA4');\r\n\t\t\tcircles[1].setAttribute('fill','#00DCA4');\r\n\t\t\tcircles[2].setAttribute('stroke','red');\r\n\t\t\tcircles[2].setAttribute('fill','red');\r\n\t\t\tcircles[3].setAttribute('stroke','red');\r\n\t\t\tcircles[3].setAttribute('fill','red');\r\n\t\t}\r\n\t\telse if (plWins > 30 && plWins < 70) { //Mediocre win percentage\r\n\t\t\tcircles[0].setAttribute('stroke','#F1C40F');\r\n\t\t\tcircles[0].setAttribute('fill','#F1C40F');\r\n\t\t\tcircles[1].setAttribute('stroke','#F1C40F');\r\n\t\t\tcircles[1].setAttribute('fill','#F1C40F');\r\n\t\t\tcircles[2].setAttribute('stroke','#F1C40F');\r\n\t\t\tcircles[2].setAttribute('fill','#F1C40F');\r\n\t\t\tcircles[3].setAttribute('stroke','#F1C40F');\r\n\t\t\tcircles[3].setAttribute('fill','#F1C40F');\r\n\t\t}\r\n\t\telse { //Bad win percentage\r\n\t\t\tcircles[0].setAttribute('stroke','red');\r\n\t\t\tcircles[0].setAttribute('fill','red');\r\n\t\t\tcircles[1].setAttribute('stroke','red');\r\n\t\t\tcircles[1].setAttribute('fill','red');\r\n\t\t\tcircles[2].setAttribute('stroke','#00DCA4');\r\n\t\t\tcircles[2].setAttribute('fill','#00DCA4');\r\n\t\t\tcircles[3].setAttribute('stroke','#00DCA4');\r\n\t\t\tcircles[3].setAttribute('fill','#00DCA4');\r\n\t\t}\r\n\r\n\t\t//Setting the circles (games played) and squares (win records) states\r\n\t\tfor (let index = 0; index < svgTexts.length; index++) {\r\n\t\t\tvar text = document.getElementById(svgTexts[index]);\r\n\t\t\tif (!isMobile) text.style.fontSize= \"30px\";\r\n\t\t\tif (state.wins[index]!=null) {\r\n\t\t\t\tvar circ = document.getElementById(svgCircles[index]);\r\n\t\t\t\tcirc.setAttribute('fill',\"#d8d8d8\");\r\n\t\t\t\ttext.textContent = state.wins[index];\t\t\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\ttext.textContent = '';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t// updating the total timer\r\n\tvar time = document.getElementById(\"time\");\r\n\ttime.textContent = msToTime(state.accumulated_time);\r\n\r\n}", "title": "" }, { "docid": "d995f98fdf4228b835edcc1db7595806", "score": "0.70832765", "text": "function checkWinLoss(){\n\tif(playerCounter==numToGuess){\n\t\twins++; \n\t\t$(\"#wins\").html(wins); \n\t\tresetNumbers(); \n\t\tgenerateNumbers(); \n\t}else if(playerCounter>numToGuess){\n\t\tlosses++; \n\t\t$(\"#losses\").html(losses); \n\t\tresetNumbers(); \n\t\tgenerateNumbers(); \n\t}\n}", "title": "" }, { "docid": "1dc672b40acb6aa15ddfa2a421a4a049", "score": "0.70788383", "text": "function refreshWins() {\n\t\t$(\"#wins\").text(\"Wins: \" + wins)\n\t}", "title": "" }, { "docid": "d2c7af804d889ac131653eda01d844aa", "score": "0.70603806", "text": "function youWin(){\n\t\t$('#winOrLose').text(youWon);\n\t\tgamesWon++;\n\t\t$('#wins').text(gamesWon);\n\t\tnewGame();\n\t}", "title": "" }, { "docid": "ab951ccf2e779472ee17f7a9fbf1267d", "score": "0.70464796", "text": "function updatewins (){\n $(\"#wins\").text(wins);\n $(\"#current-score\").empty();\n }", "title": "" }, { "docid": "955cd60107a4159afbe3c793957f971c", "score": "0.70316035", "text": "function updateScore() {\n p1Score.innerHTML = `${player1.name} : ${player1.score}`;\n p2Score.innerHTML = `${player2.name} : ${player2.score}`;\n // announce final winner of the game\n if (player1.score === 5) {\n winnerAnnounced.innerHTML = '';\n winnerAnnounced.innerHTML = `You won the game`;\n winnerSound.play();\n displayWinnerBanner();\n }\n if (player2.score === 5) {\n winnerAnnounced.innerHTML = '';\n winnerAnnounced.innerHTML = `You lost the game`;\n loserSound.play();\n displayLoserBanner();\n } \n}", "title": "" }, { "docid": "900eb53a7ab8ace055619833fe92fc70", "score": "0.7011106", "text": "function youWin() {\n wins++;\n spanWins.innerHTML = wins;\n changeGameStatus.innerHTML = \"YOU WIN\";\n}", "title": "" }, { "docid": "10ea61d9479b31faca9f1e9ca63f475d", "score": "0.7011028", "text": "function processWin() {\n gamesWon++;\n updateGamesWon();\n updateGameResult(\n `YOU WON!...The letter was '${gameLetter.toUpperCase()}'.`);\n updateMessage(\"Congratulations! Let's go again.\");\n resetGame();\n}", "title": "" }, { "docid": "b0b4b7a8fcc0e657f77af42a75d8b787", "score": "0.7008373", "text": "function updater() {\n winsText.textContent = \"Wins: \" + wins;\n guessesLeftText.textContent = \"Guesses Left: \" + guessesLeft;\n lossesText.textContent = \"Losses: \" + losses;\n // introText.textContent = \"\";\n}", "title": "" }, { "docid": "691621f3e2c78669eeaee446573bbacc", "score": "0.699208", "text": "function win() {\n if(player.y <= 0){\n // Increase Score by 5\n score = score + 5;\n // Display score above canvas\n document.querySelector('.score').textContent = score;\n // Set player to intial location\n player.restart();\n // Increase Enemies speed after each win\n for (enemy of allEnemies){\n enemy.speed += 40;\n }\n };\n}", "title": "" }, { "docid": "72595f7f6d0e4fc4dcc93ac6f2d2de12", "score": "0.6976705", "text": "function updateScore (player, opponent){\n if(!isGameOver){\n player.score += 1;\n if(player.score >= winningScore && (player.score - 1) > opponent.score){\n isGameOver = true;\n player.display.classList.add('has-text-success')\n opponent.display.classList.add('has-text-danger')\n player.button.disabled = true;\n opponent.button.disabled = true;\n }\n player.display.innerText = player.score;\n }\n }", "title": "" }, { "docid": "36f034a51aabc29204b618c8ca7b8f21", "score": "0.69743437", "text": "function playerWins() {\n if (scoreOne === 5) {\n winner = winPlayerOne;\n fill(255, 51, 153);\n textSize(48);\n text(winner, width / 4, height / 2);\n setTimeout(endGame, 1500); // Wait 1.5 secons and calls endGame function\n\n } else if (scoreTwo === 5) {\n winner = winPlayerTwo;\n fill(255, 51, 153);\n textSize(48);\n text(winner, width / 4, height / 2);\n setTimeout(endGame, 1500); // Wait 1.5 secons and calls endGame function\n\n }\n}", "title": "" }, { "docid": "b52a4e5e33ca58d01e0e28372d701a71", "score": "0.6964829", "text": "function winLose() {\n\tif (totalScore === startScore) {\n\t\twins++;\n\t\t$('#wins').html(wins);\n\t\t$(\"#resultText\").html(\"YOU WIN. Play again?\");\n\t\t$('#playAgain').show();\n\n// User loses\n\t} else if (totalScore > startScore) {\n\t\tlosses++;\n\t\t$('#losses').html(losses);\n\t\t$(\"#resultText\").html(\"LOSER! Play again?\");\n\t\t$('#playAgain').show();\n\t}\n}", "title": "" }, { "docid": "a7698ef07dd973a0ff44c40e1d095d15", "score": "0.6959241", "text": "function won() {\n wins++;\n $(\".wins\").text(\"Wins: \" + wins);\n }", "title": "" }, { "docid": "32034fc590a82046320b793b4b074c3c", "score": "0.6951555", "text": "function winfunction() {\n if(currentscore == targetscore) {\n wins++;\n $(\"#windisplay\").html(\"Wins: \" + wins);\n $(\"#announcement\").html(\"You win!\");\n reset();\n }\n}", "title": "" }, { "docid": "b09f9d3bc89b81b84d7017430807be0c", "score": "0.6943243", "text": "function winGame() {\n $('#status').text(\"You win!\");\n wins++;\n displayWins();\n}", "title": "" }, { "docid": "5a748d873212bdc1c0f72dd1aa1f3a41", "score": "0.69390714", "text": "function gameOver(playerWins) {\n isGameOver = true;\n if (playerWins == true) {\n songWin.play();\n renderPlayerWins();\n } else {\n songLose.play();\n renderPlayerLoses();\n }\n}", "title": "" }, { "docid": "5caa078e79c5ebe4092a69966792bc17", "score": "0.6924512", "text": "function hasUserLost() {\n //check to see if the user has won\n if (guessesLeft == 0 ) {\n console.log(\"USER LOSES\");\n //user has won, increment wins\n losses++;\n //add image and audio HTML if you have time. \n resetGame();\n }\n\n}", "title": "" }, { "docid": "69e4a9358e5d4e4290a497745bdebeb9", "score": "0.6921626", "text": "function winner() {\n userWins++; //ups the win score by one\n $('#win').text(userWins); //updates the HTML with the win\n $('#winLossAlert').text(\"You Won!!!\") //update the HTML with a WIN message\n reset();\n }", "title": "" }, { "docid": "adedb8068365f6c1faf9123fb3417c38", "score": "0.69155544", "text": "function playerWin(){\n ++playerScore;\n roundResult.textContent = `You win!` ;\n scoreUpdate();\n return playerScore;\n}", "title": "" }, { "docid": "c33d7b46fe5641256b73690e040ecc55", "score": "0.69057316", "text": "updateGame(){\n //Update state of objectives\n this.isObjectiveTaken();\n //Update if game is over \n this.isOver();\n\n //check whether game is over\n if(!this.gameOver){\n //updates all players data\n this.updatePlayers();\n }\n }", "title": "" }, { "docid": "0c773fc618b91afb1640c52a17983f41", "score": "0.6897844", "text": "function updatePlayer() {\n player.update();\n player.draw();\n\n // game over\n if (player.y + player.height >= canvas.height) {\n gameOver();\n }\n }", "title": "" }, { "docid": "eb593d9f7dc4491d3f0ea16ecec6e503", "score": "0.68954253", "text": "function secondPlayerWins() {\r\n secondPlayerScore.innerHTML = parseInt(secondPlayerScore.innerHTML) + 1;\r\n gameIsWon = true;\r\n }", "title": "" }, { "docid": "b79b7eea64f5f6e874847d6af67bb7d6", "score": "0.687596", "text": "function winLossChecker(){\n if (userScore === targetScore)\n {\n winCount++;\n gameReset();\n }\n else if (userScore > targetScore){\n lossCount++;\n gameReset();\n }\n}", "title": "" }, { "docid": "ef88c3ee1f280288fa0b7c27112a67d6", "score": "0.68741894", "text": "function playerScored() {\n const player = getPlayer(this.id);\n player.score += 1;\n player.display.innerHTML = player.score;\n if (player.score >= winScore) {\n player.didWin = true;\n stopGame();\n }\n}", "title": "" }, { "docid": "c59fe7eae618a283405b9992f7e99dfb", "score": "0.6873758", "text": "function checkForWinner() {\n\n if (playerChoice === puterChoice) {\n result.innerText = \"tie\"\n } else if (playerChoice === \"scissors\" && puterChoice === \"paper\"\n || playerChoice === \"paper\" && puterChoice === \"rock\"\n || playerChoice === \"rock\" && puterChoice === \"scissors\") {\n playerScoreUpdate()\n result.innerText = \"you win\"\n } else {\n result.innerText = \"you lose\"\n puterScoreUpdate\n }\n}", "title": "" }, { "docid": "2c8448031915ae311fb54053374389b4", "score": "0.68727046", "text": "function checkWin(){\n if(playerScore===randomNumber){\n wins++\n $(\".wins\").text(wins);\n $(\".message\").text(\"You've got the POWER now!\");\n resetGame()\n }\n else{\n if(playerScore>randomNumber){\n losses++\n $(\".losses\").text(losses);\n $(\".message\").text(\"You suck, try again!\");\n resetGame()\n }\n }\n}", "title": "" }, { "docid": "ec603b21511ab559a0e87823bdc084b2", "score": "0.6853242", "text": "function updateWins () {\n\n var element = document.getElementById('winWord');\n element.textContent = winCount.wins; \n\n}", "title": "" }, { "docid": "854bf3205cf637e2f59daf8423248854", "score": "0.684257", "text": "function winMsg(player) {\n\twin = true;\n\n\tif (player == \"I\") {\n\t\tfirstPlayerScore = firstPlayerScore + 1;\n\t\t$('#firstPlayerScore').text(`Player 1: ${firstPlayerScore}`);\n\t\t$('.successmsg').text('**Congratulations, Player 1 have won**');\n\n} else {\n\n\t\tsecondPlayerScore = secondPlayerScore + 1;\n\t\t$('#secondPlayerScore').text(`Player 2: ${secondPlayerScore}`);\n\t $('.successmsg').text('**Congratulations, Player 2 have won**');\n\t}\nresetGame();\n}", "title": "" }, { "docid": "71fff0cdae26801819611ffb2432b3a9", "score": "0.68301874", "text": "function updateScore() {\n document.querySelector(\"#wins\").innerHTML = \"Score: \" + score;\n }", "title": "" }, { "docid": "e0be495b96e171c84acac9bd970aad67", "score": "0.68264383", "text": "function updateStats(outcome) {\n //outcome is an array of 2 boolean values\n if (outcome[0] && outcome[1]) {\n //this is a tie, so only update the games played for the player\n database.ref(\"/users/\" + user.uid).once(\"value\", function(flash) {\n var played = parseInt(flash.val().gamesPlayed);\n played++;\n database\n .ref(\"/users/\" + user.uid)\n .update({\n gamesPlayed: played\n })\n .catch(function(err) {\n console.log(\"ERROR -\" + err.code + \": \" + err.message);\n });\n });\n resetGame();\n return;\n }\n //if there is no tie, then update user stats\n if (player === 1) {\n if (outcome[0]) {\n //you are player 1 and you won\n database.ref(\"/users/\" + user.uid).once(\"value\", function(flash) {\n var played = parseInt(flash.val().gamesPlayed);\n played++;\n var win = parseInt(flash.val().wins);\n win++;\n database\n .ref(\"/users/\" + user.uid)\n .update({\n gamesPlayed: played,\n wins: win\n })\n .catch(function(err) {\n console.log(\"ERROR -\" + err.code + \": \" + err.message);\n });\n });\n } else {\n //you are player 1 and you lost\n database.ref(\"/users/\" + user.uid).once(\"value\", function(flash) {\n var played = parseInt(flash.val().gamesPlayed);\n played++;\n var loss = parseInt(flash.val().losses);\n loss++;\n database\n .ref(\"/users/\" + user.uid)\n .update({\n gamesPlayed: played,\n losses: loss\n })\n .catch(function(err) {\n console.log(\"ERROR -\" + err.code + \": \" + err.message);\n });\n });\n }\n }\n if (player === 2) {\n if (outcome[1]) {\n //you are player 2 and you won\n database.ref(\"/users/\" + user.uid).once(\"value\", function(flash) {\n var played = parseInt(flash.val().gamesPlayed);\n played++;\n var win = parseInt(flash.val().wins);\n win++;\n database\n .ref(\"/users/\" + user.uid)\n .update({\n gamesPlayed: played,\n wins: win\n })\n .catch(function(err) {\n console.log(\"ERROR -\" + err.code + \": \" + err.message);\n });\n });\n } else {\n //you are player 2 and you lost\n database.ref(\"/users/\" + user.uid).once(\"value\", function(flash) {\n var played = parseInt(flash.val().gamesPlayed);\n played++;\n var loss = parseInt(flash.val().losses);\n loss++;\n database\n .ref(\"/users/\" + user.uid)\n .update({\n gamesPlayed: played,\n losses: loss\n })\n .catch(function(err) {\n console.log(\"ERROR -\" + err.code + \": \" + err.message);\n });\n });\n }\n }\n resetGame();\n //read the database again and update your stats on the screen\n}", "title": "" }, { "docid": "cca73af5420f84eba989b08bc89e6f70", "score": "0.6822115", "text": "function win() {\n wins++;\n $(\"#wins\").text(\"Wins: \" + wins);\n reset();\n}", "title": "" }, { "docid": "e394833655111fc6983f15e74341b192", "score": "0.68192065", "text": "function getWinner(){\n if(scores.redPieceCount === 0){\n scores.winner = scores.player2;\n message.innerHTML = `Player 2 Wins!!`\n }else if(scores.blackPieceCount === 0){\n scores.winner = scores.player1;\n message.innerHTML = `Player 1 Wins!!`\n }\n}", "title": "" }, { "docid": "189aac39fc5e27d049472dcd9df09779", "score": "0.6816749", "text": "function checkWin() {\n if (userScore === numToMatch) {\n wins++;\n $(\"#wins\").text(\"Success: \" + wins);\n reset();\n } else if (userScore > numToMatch) {\n losses++\n $(\"#losses\").text(\"Fails: \" + losses);\n reset();\n }\n }", "title": "" }, { "docid": "5c90dd46d0e2fb5cbe98a8e6048643df", "score": "0.681065", "text": "function scoreCheck() { \n //If player has won the game, this runs\n if (playerScore === numGoal){ \n wins++;\n reset();\n $(\"#winlossNote\").html(\"You won!!!<br>\");\n //If player has reached lose condition, this runs\n } else if (playerScore > numGoal){ \n losses++;\n reset();\n $(\"#winlossNote\").html(\"You lost!!!<br>\");\n }\n //This updates html text4\n $(\"#scoreWin-text\").html(\" \" + wins);\n $(\"#scoreLoss-text\").html(\" \" + losses);\n}", "title": "" }, { "docid": "82bf64526c2dfe5d8ca2c7113eb8c121", "score": "0.6807223", "text": "function wins () {\n\n \tvar wins = playersTotalScore === randomNumber;\n \twins = wins + 1\n\n $(\"#wins\").text(\"wins++\");\n }", "title": "" }, { "docid": "2f3520835ee263d91207e5a3e128bacd", "score": "0.6805448", "text": "function update() {\n element.winsDoc.textContent = \"Wins: \" + score.win.toString();\n element.losesDoc.textContent = \"Losses: \" + score.lose.toString();\n element.guesses.textContent = \"Guesses Left: \" + score.letterGuess.toString();\n element.wordGuess.textContent = guessedWord;\n}", "title": "" }, { "docid": "8535863fe4fe5745892cca843ab0d39d", "score": "0.68032", "text": "function win() {\n alert(\"You won!!\");\n wins++\n $(\"#wins\").text(\"Wins: \" + wins);\n reset();\n }", "title": "" }, { "docid": "d51cf62a5408efcf7a1eb57903af0c92", "score": "0.67894757", "text": "function winner() {\n wins++;\n alert(\"You Win!\")\n $(\"span#wins\").text(\"Wins: \" + wins);\n resetW();\n }", "title": "" }, { "docid": "058a8960271c16fcfbb12cd6704ab866", "score": "0.6785865", "text": "displayWinner() {\n var winningPiece = game.isXTurn ? 'x' : 'o'\n if(game.singleplayer || game.vsAi)\n game.winner = winningPiece\n else\n {\n if(game.player === winningPiece)\n game.winner = game.username\n else\n game.winner = game.opponent\n }\n\n\n game.saveBoard()\n\n game.state.start('win')\n }", "title": "" }, { "docid": "2b6c87007fd604be7874ecdc4ca51738", "score": "0.6781958", "text": "function update() {\n\t\t\t\tplayer.update();\n\t\t\t\tcomputer.update(ball);\n\t\t\t\tball.update(player.paddle, computer.paddle);\n\t\t\t\tdocument.getElementById(\"pongScore\").innerHTML = \"Score = \" + score;\n\t\t\t}", "title": "" }, { "docid": "6ef10930edfd798c390d4de3dc81b5be", "score": "0.6775419", "text": "function updatePlayerLives() {\n playerLives = playerLives - 1;\n //play sad fog horn sound\n fogHorn.play();\n //display the new number of lives\n drawPlayerLives()\n //if the player has no more lives, make gameOver true\n if (playerLives < 1) {\n gameOver = true;\n }\n}", "title": "" }, { "docid": "70a37a32e67b8286531bddc6755f7155", "score": "0.6774707", "text": "function userWins(playerSelection) {\n userCurrentScore++;\n document.querySelector(\"h1\").textContent = `Current Leader: ${\n userCurrentScore >= computerCurrentScore ? \"You\" : \"Computer\"\n }`;\n document.querySelector(\n \"h2\"\n ).textContent = `You win! ${playerSelection} beats ${computerSelection}`;\n document.querySelector(\"h2\").classList.remove(\"loose\");\n document.querySelector(\"h2\").classList.add(\"win\");\n document.querySelector(\"h2\").classList.remove(\"invisible\");\n document.querySelector(\".refresh\").classList.remove(\"invisible\");\n document.querySelector(\".yourScore\").textContent = userCurrentScore;\n if (userCurrentScore == 5) {\n automate(\"nothing\");\n }\n}", "title": "" }, { "docid": "4b8cbe11ea7608a3f62fecde65da3451", "score": "0.67671585", "text": "function checkWinLoss() {\n\n // This runs when the number of matches is equal to the number of letters and the guesses remaining are more than zero\n if (numMatches === numLetters && numGuesses > 0) {\n \n // Wins are incremented, written to the page, and a new game is started\n console.log('WINNER');\n wins++;\n document.querySelector('#wins').innerHTML = 'Wins: ' + wins;\n // Play theme song when wins\n playThemeSong();\n beginGame();\n\n \n\n // This runs when the user has run out of guesses \n } else if (numGuesses === 0) {\n \n // Losses are incremented, written to the page, and a new game is started\n console.log('LOSER');\n losses++;\n document.querySelector('#losses').innerHTML = 'Losses: ' + losses;\n // Play loss audio\n playLossSong();\n beginGame();\n }\n}", "title": "" }, { "docid": "cdbc7324288498385f82e380c885f67b", "score": "0.6765297", "text": "function win() {\n wins++;\n startGame();\n}", "title": "" }, { "docid": "61f076ebdd3e6ccc1e7cc0385e0c36a6", "score": "0.67623496", "text": "function updateScoreDisplay(draw, won, lost, played) {\n $(\"#game_won\").html(\" \" + gameWon);\n $(\"#game_lost\").html(\" \" + gameLost);\n $(\"#game_draw\").html(\" \" + gameDraw);\n $(\"#game_played\").html(\" \" + gamePlayed);\n}", "title": "" }, { "docid": "086186434d851dead5ac20bed30ff829", "score": "0.6761621", "text": "function Loss (){\nif( guessesLeft === 0){\n losses++;\n gameRunning= false;\n loser.innerHTML = losses;\n document.getElementById(\"myAudio\").volume=0;\n\n}\nWin();\n }", "title": "" }, { "docid": "14a1e500d55e28b4bac275431424020c", "score": "0.6750449", "text": "function win(){\n userScore++\n userScore_span.innerHTML = userScore\n computerScore_span.innerHTML = computerScore\n console.log(gewonnen)\n document.getElementById(\"antwoord\").innerHTML = \"You Win!🔥\"\n}", "title": "" }, { "docid": "0876318d1591095e844d2190c7f7a284", "score": "0.67342037", "text": "function userWinOrLose() {\n if (result > randomNum) {\n losses++;\n console.log(\"user lost\");\n // alert(\"You lost! Try again.\");\n initializeGame();\n }\n\n if (result === randomNum) {\n wins++;\n console.log(\"user won\");\n // alert(\"You won! Great job. Best out of 5?\");\n initializeGame();\n }\n}", "title": "" }, { "docid": "43b7fe5b38710189ad7e9a62f32165d5", "score": "0.6726647", "text": "function updateScore(winner) {\n if (winner === 'human') {\n humanScore += 1;\n } else if (winner === 'computer'){\n computerScore += 1;\n }\n}", "title": "" }, { "docid": "38f2fa28c900836edb0cf853e915a5ff", "score": "0.6700603", "text": "function jollyGood() {\n $('#status').text('Jolly Good');\n wins++;\n $('#playerWins').text(wins);\n reset();\n }", "title": "" }, { "docid": "2693930886fc009889f91f73bbdcc5e0", "score": "0.6692516", "text": "function userWin(){\n RPS.gameState.userScore++;\n console.log(RPS.gameState.userScore);\n $(\"#userScore\").html(RPS.gameState.userScore);\n $(\"#outcome\").html(\"You win!\");\n}", "title": "" }, { "docid": "65670c160253eeca5123ac8bab931d8f", "score": "0.66882527", "text": "function updateScore(winner) {\n if (winner === 'human') {\n humanScore += 1;\n } else {\n computerScore += 1;\n }\n}", "title": "" }, { "docid": "b553d87d3f0bde6b7b5ebe4b9f391337", "score": "0.668251", "text": "function setScoreboard(win, OX) {\n if (win) {\n //Change the score based on who is the active player\n if (OX === \"O\"){\n document.getElementById(\"human-score\").innerHTML++;\n } else {\n document.getElementById(\"computer-score\").innerHTML++;\n }\n } else {\n //Increments the draw-score if nobody won\n document.getElementById(\"draw-score\").innerHTML++;\n }\n}", "title": "" }, { "docid": "a8ca27b1ec82ed36188ac73e314a451d", "score": "0.6681625", "text": "function yay() {\n wins++\n $(\"#lose_msg\").hide();\n $(\"#win_msg\").show();\n $('#wins').text(wins);\n\n resetGame();\n }", "title": "" }, { "docid": "54e1bfa8aaf7aac3362fec6f94777331", "score": "0.6675707", "text": "function updateScore (winner) {\n if (winner === 'human' ){\n humanScore++;\n } else if ( winner === 'computer' ){\n computerScore++;\n }\n}", "title": "" }, { "docid": "0ad6ad4026532849e9df9f1dde904ac6", "score": "0.66741323", "text": "function win() {\n alert(\"You won, smartypants.\");\n wins ++;\n $(\"#wins\").text(\"Wins: \" + wins);\n //See below re: repeating the \"Wins\" string\n console.log(\"you won\");\n resetGame();\n }", "title": "" }, { "docid": "523594abcc00ca51a94ca34dbe113f5a", "score": "0.667335", "text": "function updateClients(win, lose) {\n for (let i = 0; i < connections.length; i++) {\n if (lose) {\n connections[i].sendUTF(JSON.stringify(mine.returnArr(arr, width, height, true)));\n connections[i].sendUTF('l');\n } else if (win) {\n connections[i].sendUTF(JSON.stringify(mine.returnArr(arr, width, height, false)));\n connections[i].sendUTF('w');\n } else {\n connections[i].sendUTF(JSON.stringify(mine.returnArr(arr, width, height, false)));\n connections[i].sendUTF('s' + JSON.stringify(connectionScores));\n }\n }\n if (lose || win) {\n arr = mine.reset(arr, mines);\n for (let i = 0; i < connections.length; i++) {\n connectionScores[i] = 0;\n }\n }\n}", "title": "" }, { "docid": "ec8188774b7481af8e41c2347b32014e", "score": "0.6669731", "text": "function checkWin(){\n\t//ROW WIN CONDITIONS\nif (oneV === twoV && twoV === threeV && oneV === threeV) {\n\tconsole.log('WINNER');\n\twhoPlayerTemp = (whoPlayer+'Wins');\n\tconsole.log(whoPlayerTemp);\n\t\tif (whoPlayerTemp === \"playerOneWins\") {\n\t\tplayerOneWins += 1;\n\t\t} else {\n\t\t\tplayerTwoWins +=1;\n\t\t}\n\t} else if (fourV === fiveV && fourV === sixV && fiveV === sixV) {\n\tconsole.log('WINNER');\n\twhoPlayerTemp = (whoPlayer+'Wins');\n\t\tif (whoPlayerTemp === \"playerOneWins\") {\n\t\t\tplayerOneWins += 1;\n\t\t} else {\n\t\t\tplayerTwoWins +=1;\n\t\t}\n\t} else if (sevenV === eightV && sevenV === nineV && eightV === nineV) {\n\tconsole.log('WINNER');\n\twhoPlayerTemp = (whoPlayer+'Wins');\n\t\tif (whoPlayerTemp === \"playerOneWins\") {\n\t\t\tplayerOneWins += 1;\n\t\t} else {\n\t\t\tplayerTwoWins +=1;\n\t\t}\n\t//COLUMN WIN CONDITIONS\n\t} else if (oneV === fourV && oneV === sevenV && fourV === sevenV) {\n\tconsole.log('WINNER');\n\twhoPlayerTemp = (whoPlayer+'Wins');\n\t\tif (whoPlayerTemp === \"playerOneWins\") {\n\t\t\tplayerOneWins += 1;\n\t\t} else {\n\t\t\tplayerTwoWins +=1;\n\t\t}\n\t} else if (twoV === fiveV && twoV === eightV && fiveV === eightV) {\n\tconsole.log('WINNER');\n\twhoPlayerTemp = (whoPlayer+'Wins');\n\t\tif (whoPlayerTemp === \"playerOneWins\") {\n\t\t\tplayerOneWins += 1;\n\t\t} else {\n\t\t\tplayerTwoWins +=1;\n\t\t}\n\t} else if (threeV === sixV && threeV === nineV && sixV === nineV) {\n\tconsole.log('WINNER');\n\twhoPlayerTemp = (whoPlayer+'Wins');\n\t\tif (whoPlayerTemp === \"playerOneWins\") {\n\t\t\tplayerOneWins += 1;\n\t\t} else {\n\t\t\tplayerTwoWins +=1;\n\t\t}\n\t//CROSS WIN CONDITIONS\n\t} else if (oneV === fiveV && oneV === nineV && fiveV === nineV) {\n\tconsole.log('WINNER');\n\twhoPlayerTemp = (whoPlayer+'Wins');\n\t\tif (whoPlayerTemp === \"playerOneWins\") {\n\t\t\tplayerOneWins += 1;\n\t\t} else {\n\t\t\tplayerTwoWins +=1;\n\t\t}\n\t} else if (threeV === fiveV && threeV === sevenV && fiveV === sevenV) {\n\tconsole.log('WINNER');\n\twhoPlayerTemp = (whoPlayer+'Wins');\n\t\tif (whoPlayerTemp === \"playerOneWins\") {\n\t\t\tplayerOneWins += 1;\n\t\t} else {\n\t\t\tplayerTwoWins +=1;\n\t\t}\n\t}\n\t$('#p2Score').text(playerTwoWins);\n\t$('#p1Score').text(playerOneWins);\n\t// checkTie();\n\tbestOfFiveWinner();\n}", "title": "" }, { "docid": "ac3fd0c5b81e12971a2c46993612b447", "score": "0.66678745", "text": "function updateScores() {\r\n var scores = $('table#round-' + roundNumber + ' input[type=number]'),\r\n i = 0;\r\n scores.each(function() {\r\n var score = $(this),\r\n name = score.data('playername'),\r\n mu;\r\n for (i = 0; i < matchUps.length; i++) {\r\n if (matchUps[i].p1.name === name || matchUps[i].p2.name === name) {\r\n mu = matchUps[i];\r\n break;\r\n }\r\n }\r\n\r\n var amt = parseInt(score.val());\r\n if (!mu.score) {\r\n mu.score = [0, 0, 0];\r\n }\r\n\r\n if (score.hasClass('draws')) {\r\n mu.score[1] += amt;\r\n } else { //wins\r\n if (mu.p1.name === name) {\r\n mu.score[0] += amt;\r\n } else {\r\n mu.score[2] += amt;\r\n }\r\n }\r\n });\r\n for (i = 0; i < matchUps.length; i++) {\r\n var mu = matchUps[i],\r\n p1Wins = mu.score[0],\r\n p2Wins = mu.score[2];\r\n if (p1Wins > p2Wins) {\r\n mu.p1.wins++;\r\n mu.p2.losses++;\r\n } else if (p2Wins > p1Wins) {\r\n mu.p2.wins++;\r\n mu.p1.losses++;\r\n } else {\r\n mu.p1.draws++;\r\n mu.p2.draws++;\r\n }\r\n }\r\n\r\n scoresSaved = true;\r\n }", "title": "" }, { "docid": "6d095857f09b8622191ccc2457a02028", "score": "0.66653126", "text": "function updateWin() {\n\tpush();\n\t\ttranslate(screen.w/2,screen.h/2-cellwidth);\n\t\tfill(TEXTCOLOR);\n\t\tnoStroke();\n\t\ttextSize(cellwidth/2);\n\t\ttextAlign(CENTER,BOTTOM);\n\t\ttext(\"Congratulations, you won!\\n\",0,0);\n\t\ttextAlign(LEFT,TOP);\n\t\ttranslate(-cellwidth*2,0);\n\t\ttextSize(cellwidth/4);\n\t\tdisplayscores();\n\tpop();\n}", "title": "" }, { "docid": "14ce0cded083e30cd08ab7533db43e3c", "score": "0.6663375", "text": "function updateScore (winner) {\n if (winner === 'human') {\n humanScore += 1;\n }\n else {\n computerScore += 1;\n }\n}", "title": "" }, { "docid": "d0880729b6c67555a8a90a2d37044b2e", "score": "0.6656498", "text": "function checkWinner() {\n stopLoop();\n Game.powerUpCanvas.font = \"italic 36px calibri\";\n\n if (Game.players[1].score > Game.players[0].score) {\n Game.powerUpCanvas.fillStyle = \"Purple\";\n Game.powerUpCanvas.fillText(\"Purple player wins!\", 100, 250);\n }\n\n else if (Game.players[0].score > Game.players[1].score) {\n Game.powerUpCanvas.fillStyle = \"Green\";\n Game.powerUpCanvas.fillText(\"Green player wins!\", 500, 250);\n Game.players[0].srcX = 326;\n Game.players[0].srcY = 1182;\n }\n else if (Game.players[1].score === Game.players[0].score) {\n Game.powerUpCanvas.fillText(\"Draw!\", 390, 250);\n }\n}", "title": "" }, { "docid": "b7a77fdfefb771374f9bb2f3440924be", "score": "0.6650762", "text": "function update()\n{\n if (objects['bricks'].objects.length > 0)\n {\n // ATI: Has either player won yet?\n if (gPlayerScore1 < MAX_SCORE && gPlayerScore2 < MAX_SCORE)\n {\n // ATI: No. Analyze the state of the game.\n if (touchedFloor)\n {\n // ATI: Player # 2 scores a point because Player # 1 missed the ball.\n gPlayerScore2++;\n updatePlayer2Score(gPlayerScore2);\n\n // gameStates[currentGameState].running = false;\n // currentGameState = gameStates[currentGameState].transitions.reset;\n\n // AIT: Reset the touched ceiling variable.\n touchedFloor = false;\n\n //if (lives == 0)\n //{\n // $('#lose').fadeIn();\n // $('#overlay-small').fadeIn();\n //}\n }\n else if (touchedCeiling)\n {\n // ATI: Player # 1 scores a point because Player # 2 missed the ball.\n gPlayerScore1++;\n updatePlayer1Score(gPlayerScore1);\n\n // AIT: Reset the touched ceiling variable.\n touchedCeiling = false;\n }\n\n // ATI: If the game is still running keep the balls and paddle supdated.\n if (gameStates[currentGameState].running)\n {\n updateBalls();\n updatePaddles();\n }\n }\n else\n {\n gameStates[currentGameState].running = false;\n currentGameState = gameStates[currentGameState].transitions.lose;\n\n console.log(\"Game over.\");\n // console.log(lives);\n }\n } else\n {\n $('#win').fadeIn();\n }\n stats.update();\n}", "title": "" }, { "docid": "35268d76472f9922d427ac06002b48b8", "score": "0.6645937", "text": "function userWins(userPlay, computerPlay) {\n ++userScore;\n roundResultsText.textContent = `You win! ${userPlay} beats ${computerPlay}. \n Score: ${userScore}/5 win(s) ${computerScore}/5 loss(es).`;\n container.parentNode.append(roundResultsContainer);\n}", "title": "" }, { "docid": "672f224bb71e883b114af8494e90f653", "score": "0.6636219", "text": "function updatePlayerStatsInDatabase () {\n var allPlayers = getAllPlayersAliveOrDead()\n\n // If it's a 1v1, we update the ratings of each player, else don't update ratings\n var updateRatings = allPlayers.length === 2\n var winner = getAllPlayers()[0] // winner is the only one alive\n if (updateRatings) {\n var winnerData = {}\n for (var i = 0; i < dbPlayers.length; i++) {\n if (dbPlayers[i].displayName === winner.id) {\n winnerData = dbPlayers[i]\n }\n }\n\n var loserData = {}\n for (var i = 0; i < dbPlayers.length; i++) {\n if (dbPlayers[i].displayName !== winner.id) {\n loserData = dbPlayers[i]\n }\n }\n\n var winnerNewRating = eloCalc.getRatingIfWin(winnerData.rating, loserData.rating)\n var loserNewRating = eloCalc.getRatingIfLose(loserData.rating, winnerData.rating)\n }\n\n var gamesRef = dataBase.ref(`games/` + gameId.key)\n var usersRef = dataBase.ref(`users/`)\n\n // Update winner's wins, pearls, rating\n var query = usersRef.orderByChild('displayName').equalTo(winner.id)\n query.once('value', function (snapshot) {\n var users = snapshot.val()\n var userKeys = Object.keys(users)\n var winnerKey = userKeys[0]\n var winner = users[winnerKey]\n\n var winnerRef = dataBase.ref(`users/` + winnerKey)\n if (updateRatings) {\n winnerRef.update({wins: winner.wins + 1, pearls: winner.pearls + PEARLS_ON_WIN, rating: winnerNewRating})\n } else {\n winnerRef.update({wins: winner.wins + 1, pearls: winner.pearls + PEARLS_ON_WIN})\n }\n })\n\n // Update all losers' losses, pearls, rating\n var allPlayers = getAllPlayersAliveOrDead()\n for (var i = 0; i < allPlayers.length; i++) {\n // Update all losers in database\n if (allPlayers[i].id !== winner.id) {\n var id = allPlayers[i].id\n\n var query = usersRef.orderByChild('displayName').equalTo(id)\n query.once('value', function (snapshot) {\n var users = snapshot.val()\n var userKeys = Object.keys(users)\n var userKey = userKeys[0]\n var user = users[userKey]\n\n var loserRef = dataBase.ref(`users/` + userKey)\n\n if (updateRatings) {\n loserRef.update({losses: user.losses + 1, pearls: user.pearls + PEARLS_ON_LOSE, rating: loserNewRating})\n } else {\n loserRef.update({losses: user.losses + 1, pearls: user.pearls + PEARLS_ON_LOSE})\n }\n })\n }\n }\n }", "title": "" }, { "docid": "5f1699c071de7b2b5580171cee3a5cb0", "score": "0.6631348", "text": "function winLose() {\n\n if (luminousScore === collectorScore) {\n winCount++;\n $(\"#status\").text(luminousScore + \" Bling! You Won! Click any crystal to begin!\")\n startGame();\n } else if (luminousScore > collectorScore) {\n lossCount++;\n $(\"#status\").text(luminousScore + \"oops! To many, Click a any crystal to try again!\")\n startGame();\n }\n if (lossCount === 12) {\n alert(\"too many rounds lost. Let's try again, Shine on!\")\n restartGame();\n }\n}", "title": "" }, { "docid": "1e37ef0c6ead2336b0b5b00d35afa227", "score": "0.6628515", "text": "function updateScore() {\n if(computerScore >= 3){\n results.textContent = \"COMPUTER WINS!!!\";\n gameOver = true;\n } else if (playerScore >=3){\n results.textContent = \"YOU'RE WINNER!\";\n gameOver = true;\n }\n\n if(!gameOver){\n round++;\n }\n\n playerScoreText.textContent = \"PLAYER: \" + playerScore;\n computerScoreText.textContent = \"COMPUTER: \" + computerScore;\n roundText.textContent = \"ROUND \" + round;\n}", "title": "" }, { "docid": "ce6f481e9942254e23bd55b15cde7206", "score": "0.6627092", "text": "function winGame() {\n\t alert(\"You win! Play again!\");\n\t winCount = winCount + 1;\n\t $(\".wins\").text(\"Wins: \" + winCount);\n\t resetGame();\n\t}", "title": "" }, { "docid": "7e4fc4510a36adea47b36403c4ffb8eb", "score": "0.6624338", "text": "function updateScore(result) {\n // result one of \"won\" or \"tied\" or \"lost\"\n if (result === \"won\") {\n wins = wins + 1;\n document.getElementById(\"wins\").innerHTML = wins;\n }\n if (result === \"tied\") {\n ties = ties + 1;\n document.getElementById(\"ties\").innerHTML = ties;\n }\n if (result === \"lost\") {\n losses = losses + 1;\n document.getElementById(\"losses\").innerHTML = losses;\n }\n}", "title": "" }, { "docid": "41126e237a50dff95e5e12576cdc6d8a", "score": "0.6621036", "text": "function whoWon(){\n\n if ((playerOneChoice === \"Rock\") || (playerOneChoice === \"Paper\") || (playerOneChoice === \"Scissors\")) {\n\n // This logic determines the outcome of the game (win/loss/tie), and increments the appropriate counter.\n if ((playerOneChoice === \"Rock\") && (playerTwoChoice === \"Scissors\")) {\n playerOneWins++;\n playerTwoLosses++;\n $(\"#results\").html(playerOneName + \" wins!\");\n }\n else if ((playerOneChoice === \"Rock\") && (playerTwoChoice === \"Paper\")) {\n playerOneLosses++;\n playerTwoWin++;\n }\n else if ((playerOneChoice === \"Scissors\") && (playerTwoChoice === \"Rock\")) {\n playerOneLosses++;\n playerTwoWin++;\n }\n else if ((playerOneChoice === \"Scissors\") && (playerTwoChoice === \"Paper\")) {\n playerOneWins++;\n playerTwoLosses++;\n }\n else if ((playerOneChoice === \"Paper\") && (playerTwoChoice === \"Rock\")) {\n playerOneWins++;\n playerTwoLosses++;\n }\n else if ((playerOneChoice === \"Paper\") && (playerTwoChoice === \"Scissors\")) {\n playerOneLosses++;\n playerTwoWin++;\n }\n else if (playerOneChoice === playerTwoChoice) {\n ties++;\n }\n }\n\n }", "title": "" }, { "docid": "b9b7ce435501b13a45729692a9c3e722", "score": "0.6620012", "text": "checkWinner() {\n if (this.state.dealerScore > 21) {\n this.setState({\n // Set statistics\n playerWins: this.state.playerWins + 1,\n dealerBusts: this.state.dealerBusts + 1,\n // Set chips, 2 times chips in play if you win\n playerChips: this.state.playerChips + 2 * this.state.chipsInPlay,\n winAmount: this.state.chipsInPlay,\n chipsInPlay: 0,\n gameMessage: 'Dealer busts, you win!',\n });\n } else if (\n this.state.playerScore > this.state.dealerScore &&\n this.state.playerScore <= 21\n ) {\n this.setState({\n // Set statistics\n playerWins: this.state.playerWins + 1,\n // Set chips, 2 times chips in play if you win\n playerChips: this.state.playerChips + 2 * this.state.chipsInPlay,\n winAmount: this.state.chipsInPlay,\n chipsInPlay: 0,\n gameMessage: `You win!`,\n });\n } else if (this.state.playerScore === this.state.dealerScore) {\n this.setState({\n // Set statistics\n pushes: this.state.pushes + 1,\n // Set chips, return original chips in play if push\n playerChips: this.state.playerChips + this.state.chipsInPlay,\n chipsInPlay: 0,\n gameMessage: 'You pushed!',\n });\n } else {\n this.setState({\n // Set statistics\n dealerWins: this.state.dealerWins + 1,\n // Set chips\n chipsInPlay: 0,\n gameMessage: 'You lost!',\n });\n }\n }", "title": "" }, { "docid": "c5512efdc8ee7360e93944308505c32a", "score": "0.6618525", "text": "function winner() {\n win++;\n $('#wins-text').text(win);\n reset();\n random();\n }", "title": "" }, { "docid": "5fe49f1a257c606799ff5540b80260bc", "score": "0.66132325", "text": "function showWins() {\n document.getElementById(\"win\").innerHTML = wins;\n}", "title": "" }, { "docid": "1e6e7ac95469a1c954c3bcfee86e2d61", "score": "0.66044223", "text": "function getScoreToWin()\r\n{\r\n\tscoreToWin = -10;\r\n\tfor(var i = 0; i < worms.length; i++)\r\n\t{\r\n\t\tif(players[i])\r\n\t\t\tscoreToWin+=10;\r\n\t}\r\n}", "title": "" }, { "docid": "ab15c7e6b083ff5c596bdddea0b1e40e", "score": "0.6601273", "text": "function winner () {\n wins++;\n $(\"#wins\").text(wins);\n $(\"#message\").text(\"You Win!!!\");\n reset();\n }", "title": "" } ]
a13062a69d00a18b377318c3c52436e2
function to create and update serving slider pulled from NoUiSlider
[ { "docid": "eb5dcb36868013ef18513be0de02684e", "score": "0.7163097", "text": "function servingSlider() {\n var servingSlider = document.getElementById('serving-slider');\n\n noUiSlider.create(servingSlider, {\n start: [ 2, 30 ],\n connect: true,\n step: 1,\n range: {\n 'min': 2,\n 'max': 30\n }\n });\n\n var left = document.getElementById('serving-min');\n var right = document.getElementById('serving-max');\n var minValue = document.getElementById('serving-min-value');\n var maxValue = document.getElementById('serving-max-value');\n\n servingSlider.noUiSlider.on('update', function( values, handle ) {\n\n var value = values[handle];\n\n left.value = values[0];\n right.value = values[1];\n\n var setMin = parseInt(left.value);\n minValue.innerHTML = setMin + \" people\";\n \n var setMax = parseInt(right.value);\n maxValue.innerHTML = setMax + \" people\";\n });\n}", "title": "" } ]
[ { "docid": "0bf96397f810d71e90714f2f11d7e6e8", "score": "0.68118757", "text": "function update_slider_list() {\n\t\tvar select_slider_markup = '';\n\t\tvar slider = {};\n\t\tif ( jQ('.aurel-panel-slider').length > 0 ) {\n\t\t\tselect_slider_markup = '<option value=\"no-slider\">Do not display a slider</option>';\n\t\t\tjQ('.aurel-panel-slider').each(function() {\n\t\t\t\tselect_slider_markup += '<option value=\"' + jQ(this).find('.aurel-panel-slider-name').html() + '\">' + jQ(this).find('.aurel-panel-slider-name').html() + '</option>';\n\t\t\t});\n\t\t} else {\n\t\t\tselect_slider_markup = '<option value=\"no-slider\">No slider created yet</option>';\n\t\t}\n\t\tjQ('.ap-slider-selector').each(function() {\n\t\t\tvar select_val = jQ(this).val();\n\t\t\tjQ(this).html(select_slider_markup);\n\t\t\tjQ(this).val(select_val);\n\t\t});\n\t}", "title": "" }, { "docid": "8c5820d7c5831683ebc61e4802fbb703", "score": "0.67612594", "text": "function addSlidersToPage() {\r\n if (getQueryVariable(\"future\") == \"true\") {\r\n var presetValues = getQueryVariable(\"slider\").split(\";\");\r\n }\r\n\r\n\r\n var sliderElements = document.querySelectorAll(\"#sliderBarWrapper .sliderBar\");\r\n\r\n for (var i = 0; i < sliderElements.length; i++) {\r\n var slider = document.getElementById(sliderElements[i].id);\r\n\r\n if (i == (sliderElements.length - 1)) {\r\n var options = {\r\n start: [0.8],\r\n range: {\r\n 'min': 0.4,\r\n 'max': 1\r\n },\r\n pips: {\r\n mode: 'count',\r\n values: 7,\r\n density: 11,\r\n format: wNumb({\r\n decimals: 1\r\n }),\r\n stepped: true\r\n },\r\n step: 0.05,\r\n tooltips: [false],\r\n }\r\n } else {\r\n var options = {\r\n start: ((sliderElements[i].getAttribute(\"category\") == \"population\") ? [1] : [0]),\r\n range: {\r\n 'min': 0,\r\n 'max': 2\r\n },\r\n pips: {\r\n mode: 'count',\r\n values: 5,\r\n density: 6,\r\n stepped: true,\r\n format: {\r\n to: updatePips\r\n }\r\n },\r\n step: 1,\r\n tooltips: [false],\r\n }\r\n\r\n }\r\n\r\n noUiSlider.create(slider, options);\r\n\r\n if (presetValues && presetValues[i]) {\r\n slider.noUiSlider.set(presetValues[i]);\r\n }\r\n\r\n\r\n slider.noUiSlider.on(\"change\", function (values, handle) {\r\n onSliderChange();\r\n });\r\n }\r\n\r\n if (presetValues) {\r\n toggleDataSetting(document.querySelector(\".control[setting='future']\"));\r\n }\r\n}", "title": "" }, { "docid": "f97f39bebc1663ba6192cbd5952c09c2", "score": "0.64954245", "text": "function updateSliders() {\n p.select('#length').html(lengthSlider.value());\n p.select('#temperature').html(tempSlider.value());\n }", "title": "" }, { "docid": "4e1feb990e62ae10c083f3a60d43a165", "score": "0.6487998", "text": "function createSlider(key) {\n \n var type = globalStore.fieldInfo[key].type;\n \n // sliders for fields with defined ranges\n if(globalStore.fieldInfo[key].range && globalStore.fieldInfo[key].range.length) {\n $('#current-slider').empty().append('<div class=\"slider-container\" id=\"slider-container\">').show();\n $('#slider-container').empty().append('<div class=\"slider\" id=\"slide\">');\n \n if(type === 'int') {\n $(\"#slide\").slider({\n range: true,\n min: globalStore.fieldInfo[key].range[0],\n max: globalStore.fieldInfo[key].range[1],\n slide: function( event, ui ) {\n $('#current-value').val(\"[\" + ui.values[0] + \" TO \" + ui.values[1] + \"]\");\n }\n });\n }\n else {\n $(\"#slide\").slider({\n range: true,\n min: globalStore.fieldInfo[key].range[0] * 1000,\n max: globalStore.fieldInfo[key].range[1] * 1000,\n slide: function( event, ui ) {\n $('#current-value').val(\"[\" + (ui.values[0] / 1000) + \" TO \" + (ui.values[1] / 1000) + \"]\");\n }\n });\n }\n }\n \n // create slider for int types\n else if(type === 'int') {\n \n // loading placeholder\n $('#current-slider').empty().append('<div class=\"slider-container\" id=\"slider-container\"><div class=\"loading\"><img src=\"img/ajax-loader.gif\"/> Getting field statistics</div>').show();\n \n // request min/max from stats\n $.ajax({\n url: globalStore.baseURL + '/select',\n type: 'GET',\n dataType: 'json',\n \n data: {\n wt: 'json',\n q: '*:*',\n rows: 0,\n stats: true,\n \"stats.field\": key\n },\n \n key: key,\n \n success: function( r ) {\n globalStore.fieldInfo[this.key].range = [\n r.stats.stats_fields[this.key].min, \n r.stats.stats_fields[this.key].max\n ];\n \n $('#slider-container').empty().append('<div rel=\"' + type + '\" class=\"slider\" id=\"slide\">');\n $(\"#slide\").slider({\n range: true,\n min: globalStore.fieldInfo[this.key].range[0],\n max: globalStore.fieldInfo[this.key].range[1],\n slide: function( event, ui ) {\n $('#current-value').val(\"[\" + ui.values[0] + \" TO \" + ui.values[1] + \"]\");\n }\n });\n },\n \n error: function( xhr, status ) {\n console.log(\"Error\");\n }\n });\n }\n}", "title": "" }, { "docid": "770d691476e968b91074e91448943786", "score": "0.6396435", "text": "function createSlider()\n{\n $( \"#rollSlider\" ).slider({ min: 0, max: 360, change: rollChange, slide: rollChange});\n $( \"#tiltSlider\" ).slider({ min: 0, max: 90, change: tiltChange, slide: tiltChange});\n $( \"#distSlider\" ).slider({ min: 5, max: 30, change: distChange, slide: distChange});\n $( \"#lightDirectionSlider\" ).slider({ min: 0, max: 360, change: lightDirectionChange, slide: lightDirectionChange});\n $( \"#lightHeightSlider\" ).slider({ min: 0, max: 90, change: lightHeightChange , slide: lightHeightChange });\n $( \"#lightStrengthSlider\" ).slider({ min: 0, max: 100, change: lightStrengthChange , slide: lightStrengthChange });\n $( \"#lightDistanceSlider\" ).slider({ min:10, max: 100, change: lightDistanceChange , slide: lightDistanceChange });\n updateSlider();\n}", "title": "" }, { "docid": "66c5cde1640078b4bb073906bc0965f9", "score": "0.63423884", "text": "static fetchSlider(slider_id) {\n return this._fetchObject(this.SLIDERS_URL, slider_id);\n }", "title": "" }, { "docid": "a93e69b2d39d4e1f0f2201029429a9d6", "score": "0.63152635", "text": "function Slider () {\n\t\tthis.$slider = document.getElementById('slider');\t\t\t\t\t\t\n \t\tthis.$labels = document.querySelectorAll('.slider-labels li');\n\n \t\tthis._create();\t\t\t\n\t}", "title": "" }, { "docid": "3bd764cff740bdd38d1b9adc1bd2333e", "score": "0.6311241", "text": "function createSliders()\n{\n $('.slider').slider(\n {formater: formatVoltageTooltip, value: 0}\n ).on('slideStop', onVoltageSelected);\n\n loadCurrentDACSettings();\n}", "title": "" }, { "docid": "4fcfec8823b7d3d8ee4e2703352f82f4", "score": "0.62911326", "text": "function showSlider() {\n\tcreateP(\"Custom Slider\");\n\n\t// slider for cheat\n\tslider = createSlider(1, 10, 5);\n}", "title": "" }, { "docid": "915727fbe3664b85005ad5bc4328b582", "score": "0.6291115", "text": "function prepSlider() {\n var prepSlider = document.getElementById('prep-slider');\n\n noUiSlider.create(prepSlider, {\n start: [ 0, 60 ],\n connect: true,\n step: 1,\n range: {\n 'min': 0,\n 'max': 60\n }\n });\n\n var left = document.getElementById('prep-min');\n var right = document.getElementById('prep-max');\n var minValue = document.getElementById('prep-min-value');\n var maxValue = document.getElementById('prep-max-value');\n\n prepSlider.noUiSlider.on('update', function( values, handle ) {\n\n var value = values[handle];\n\n left.value = values[0];\n right.value = values[1];\n\n var setMin = parseInt(left.value);\n minValue.innerHTML = setMin + \" mins\";\n \n var setMax = parseInt(right.value);\n maxValue.innerHTML = setMax + \" mins\";\n });\n}", "title": "" }, { "docid": "49c090e3a43d88dfe441c0621f3c8b81", "score": "0.6245497", "text": "function setSlider(slider,num_set){\n $$(slider).define('value',num_set[0]);\n $$(slider).define('min',num_set[1]);\n $$(slider).define('max',num_set[2]);\n $$(slider).define('step',num_set[3]);\n $$(slider).render();\n }", "title": "" }, { "docid": "847c9551a643935a8daad0605e1fe26e", "score": "0.6229106", "text": "function initRange() {\n var html5Slider = document.getElementById('rangeSlider');\n ;\n var select = document.getElementById('range');\n noUiSlider.create(html5Slider, {\n start: 5,\n step: 1,\n\n range: {\n 'min': 1,\n 'max': 10\n }\n\n });\n\n\n html5Slider.noUiSlider.on('update', function () {\n $('#range').val(html5Slider.noUiSlider.get());\n });\n\n $('#range').change(function () {\n html5Slider.noUiSlider.set(select.value);\n\n })\n}", "title": "" }, { "docid": "ebd375caaef8698ea48d477d8f4b9071", "score": "0.6201618", "text": "function handleResponse(data){\n sliderDiv = sliderDiv.empty();\n sliderDiv = constructArticlesHTML(data);\n }", "title": "" }, { "docid": "f5c1dc22024be76a1e9b51c90e632b11", "score": "0.61817497", "text": "slides() {\n destroySlider();\n setupSlider();\n }", "title": "" }, { "docid": "9b237654c548cc8e12d419e2b451380f", "score": "0.6158563", "text": "function createSlider({label, min,max, defaultValue, step=1}) {\n\tSLIDERS[label] = mainP5.createSlider(min, max, defaultValue, step)\n\n\tlet controls = document.querySelector(\".controls\")\n\tlet holder = document.createElement(\"div\");\n\tholder.className = \"slider\"\n\tholder.innerHTML = label\n\n\t// Add things to the DOM\n\tcontrols.append(holder)\n\tholder.append(SLIDERS[label].elt)\n}", "title": "" }, { "docid": "e6cd0e11deb063c962f3868897b52dd1", "score": "0.61539316", "text": "function componentSlider() {\n classicSlider()\n detailSlider()\n}", "title": "" }, { "docid": "d3a2d431c8b689f5bcde8599fc291f5c", "score": "0.61254334", "text": "function createSlider() {\n $('#slider').slider({\n min : 0,\n max : 1,\n step : 0.05,\n value : 0.8,\n slide : function(event, ui) {\n map.overlayMapTypes.getAt(0).setOpacity(ui.value);\n }\n });\n}", "title": "" }, { "docid": "6d669912a9338d4c6f9ff1f5da59816b", "score": "0.61243314", "text": "function createSliders() {\n\n var currValue = [n1, n2, n3, n4];\n var strSliders = \"\";\n strSliders += \"<div id='sliderBox'>\";\n\n for (var i = 1; i <= 4; i++) {\n if (i === 1) {\n strSliders += \"<p>Multiplier range:</p>\";\n }\n if (i === 3) {\n strSliders += \"<p>Multiplicand range:</p>\";\n }\n\n strSliders += \"<p>-30<input type=range min=-30 max=30 value=\" + currValue[i - 1];\n strSliders += \" id=slider\" + i + \" step=1 onchange='outputUpdate(value,\" + i + \")'>30</p>\";\n strSliders += \"<p><div id='slide\" + i + \"'>\" + currValue[i - 1] + \"</div></p>\";\n }\n\n strSliders += \"<div class='buttons'><input type='button' onclick='clearPage()' value='RESET'></div>\";\n strSliders += \"</div>\";\n\n jQuery(\"#sliders\").html(strSliders);\n\n}", "title": "" }, { "docid": "7ddc000a6de1a26c73414dd6b1cf0267", "score": "0.61107403", "text": "initSlider() {\n\n //set a timer for the slider to run\n this.timer = this.initTimer()\n\n }", "title": "" }, { "docid": "6136e646dea7b6163c11d2fe3c9a0a95", "score": "0.61058784", "text": "function configureSlider(sliderIdentifier, numToDisplay, numToScroll) {\n\n console.log(`[SLIDER-SENSEI] configureSlider called for ${sliderIdentifier}`);\n\n var sliderObj = {\n \"identifier\": sliderIdentifier, // The unique ID for the slider\n \"numToDisplay\": numToDisplay, // Note: # of DOM nodes should be > than numToDisplay\n \"numToScroll\": numToScroll, // Note: Currently only supports one for now\n \"sliderLeftIndex\": 0, // Index for tracking slider's next movement to left \n \"sliderRightIndex\": -1, // Index for tracking slider's next movement to right \n \"viewPortWidth\": 1000, // Calculated by taking the container width\n \"sliderContentWidth\": 1000, // Calculated by taking the viewPortWidth / display number\n \"children\": [], // Store a reference to all slides as 'children' in the sliderObject\n }\n\n\n\n // Get a reference to the slider content using the identifier\n refForSliderContainer = getSliderContainerForSliderWithID(sliderObj.identifier);\n\n // Get all children sliders that presently exist\n let children = refForSliderContainer.find('.slider-content');\n \n // Duplicate the amount of children nodes if we don't have enough to comfortably wrap around\n if (children.length < numToDisplay * 2) {\n const content = refForSliderContainer.html();\n refForSliderContainer.append(content);\n\n // Update the reference so we now include the new additional children we just created\n children = refForSliderContainer.find('.slider-content');\n }\n\n sliderObj.children = children;\n\n // Get the viewport size so we can use this later for our calculations\n sliderObj.viewPortWidth = refForSliderContainer.width();\n\n // Determine the uniform width for each of the slider objects\n sliderObj.sliderContentWidth = sliderObj.viewPortWidth / sliderObj.numToDisplay;\n\n // Set initial value for the indices:\n\n sliderObj.sliderLeftIndex = 0;\n sliderObj.sliderRightIndex = sliderObj.numToDisplay - 1 \n\n\n // Place the first 'X' amount of slides into the appropriate position based off of numToDisplay\n // Remaining items should be sorted into a overflow zone. We'll choose to put far off in the - area\n const hiddenDisplayRegion = sliderObj.sliderContentWidth * -1;\n\n // Format target width string so we can use it\n const targetWidth = `${sliderObj.sliderContentWidth}px`;\n\n // Loop through all the children. Place the first children in the viewport, and the rest off screen.\n for (var i = 0; i < children.length; ++i) {\n const child = $(children[i]);\n const targetLeft = (i < numToDisplay)\n ? `${sliderObj.sliderContentWidth * i}px`\n : `${hiddenDisplayRegion}px`;\n\n child\n .css('width', targetWidth)\n .css('left', targetLeft);\n }\n\n return sliderObj;\n}", "title": "" }, { "docid": "ea69310eb40082c1bf9c3fc5d070816e", "score": "0.6059851", "text": "function createGraphSlider() {\n $( \"#slider > span\" ).each(function(i) {\n $( this ).empty().slider({\n value: userSliders[i],\n orientation: \"horizontal\",\n min: 1,\n max: maxSliders[i],\n animate: true,\n step: 1,\n slide: function( event, ui ) {\n $($( \"#slider > input\" ).get(i)).val( ui.value );\n userSliders[i] = ui.value;\n }\n });\n });\n}", "title": "" }, { "docid": "e5cf1df25558ac7f1f14fda1bc902553", "score": "0.6054815", "text": "function addSlider(){\r\n\r\n if ($('sliderarea')) {\r\n\r\n mochaSlide = new Slider($('sliderarea'), $('sliderknob'), {\r\n\r\n steps: 20,\r\n\r\n offset: 5,\r\n\r\n onChange: function(pos){\r\n\r\n $('updatevalue').setHTML(pos);\r\n\r\n document.mochaUI.options.cornerRadius = pos;\r\n\r\n $$('div.mocha').each(function(windowEl, i) {\r\n\r\n document.mochaUI.drawWindow(windowEl);\r\n\r\n });\r\n\r\n document.mochaUI.indexLevel++;\r\n\r\n }\r\n\r\n }).set(document.mochaUI.options.cornerRadius);\r\n\r\n }\r\n\r\n}", "title": "" }, { "docid": "6c3471ee2c6ca5bd5ea4969ccc1b2e96", "score": "0.6044209", "text": "function build_slider() {\n slider = document.getElementById(\"tensitySlider\");\n slider.value = figure_info['tensities'][0];\n slider.min = 0;\n slider.max = figure_info['num_tensities'] - 1;\n slider.oninput = function () {\n current_tensity = get_exact_std(this.value);\n flush();\n };\n var dis_str = get_exact_std(figure_info['tensities'][0]).toString();\n for (var t = 1; t < figure_info['tensities'].length; t++) {\n dis_str = dis_str + \", \" + get_exact_std(t).toString();\n }\n current_tensity = \"All of: \\n\" + dis_str;\n changeText(\"title_of_table\", rawData['web_info']['title']);\n changeText(\"introduction\", rawData['web_info']['introduction'], true);\n changeText(\"tensity\", current_tensity);\n changeText(\"relative_distance_button\", \"Show absolute value of distances\");\n\n document.getElementById('disable_color_button').innerHTML =\n \"Disable clustering\";\n changeText(\"finetune\", \"Fine-tuned\");\n changeText(\"update_date\", rawData['web_info']['update_date']);\n }", "title": "" }, { "docid": "b1c7ff4242f3cf0aecd777e6987771de", "score": "0.6021056", "text": "function addSliderHandle( options ){\n options.slider = _this;\n if (options.inclDataPercent)\n options.markerData = {\n 'data-base-slider-percent': _this.valueToPercent(options.value.value)\n };\n _this.handles[options.id] = ns.sliderHandle(options);\n }", "title": "" }, { "docid": "b1c7ff4242f3cf0aecd777e6987771de", "score": "0.6021056", "text": "function addSliderHandle( options ){\n options.slider = _this;\n if (options.inclDataPercent)\n options.markerData = {\n 'data-base-slider-percent': _this.valueToPercent(options.value.value)\n };\n _this.handles[options.id] = ns.sliderHandle(options);\n }", "title": "" }, { "docid": "ae85b2d60a089a2a423c2927e4bfe40d", "score": "0.60061586", "text": "function initializeSlider(){\n scope.sliders = scope.figure.widgets;\n var notSlider = [];\n for(var slider in scope.sliders){\n if(scope.sliders[slider].type == \"slider\"){\n scope.sliders[slider].value = scope.sliders[slider].default_value; // set default value\n scope.sliders[slider].options = {\n floor: scope.sliders[slider].min_value, \n ceil: scope.sliders[slider].max_value, \n step: scope.sliders[slider].steps_size, \n precision: 10 \n }; // set min value\n } else {\n notSlider.unshift(slider);\n }\n }\n for(var del in notSlider){\n scope.sliders.splice(notSlider[del], 1);\n }\n }", "title": "" }, { "docid": "d9f912a8aee63e68e178dd330ba26e20", "score": "0.5991746", "text": "function setupAccessSlider() {\n accessSlider = document.getElementById('accessSlider');\n noUiSlider.create(accessSlider, {\n start: [0, 10],\n connect: true,\n orientation: 'horizontal',\n tooltips: [false, false],\n step: 1,\n padding: 1,\n range: { 'min': 0, 'max': 10 },\n format: {\n to: (val) => new Date(val * 1000).toISOString(),\n from: (val) => val\n }\n });\n accessSlider.setAttribute('disabled', true);\n accessSlider.noUiSlider.on('change', () => {\n accessSlider.setAttribute('disabled', true);\n const [minTime, maxTime] = getSliderMinMaxValues();\n setTimeRangeLabels(minTime, maxTime);\n requestOptimizedStorageSetupPreview(minTime, maxTime);\n });\n}", "title": "" }, { "docid": "731ec1a0c7c9b4feba961599bb5426e9", "score": "0.59882337", "text": "function updateEpisodeSlider(sl) {\n $.get($SCRIPT_ROOT + '/changeDisplayEpisode',\n {\n episode: sl.value,\n session: session,\n })\n}", "title": "" }, { "docid": "c499e69f5b2d53feb48c2f380570195f", "score": "0.59816104", "text": "function updateSlidersAndDisplays(event){\n\tvar source = $(event.target || event.srcElement);\n\tvar meal = source.attr('meal');\n\tvar sliderIndex = source.attr('index');\n\tupdateServingDisplay(sliderIndex);\n\t//updateServingsFromChange(sliderIndex);\n\tupdateDisplayForMeal(meal);\n\tsource.attr('prevValue',source.val());\n}", "title": "" }, { "docid": "43586cded5e955e5777b492a1d582478", "score": "0.5945345", "text": "initDom(){\n if(!this.slider || !this.sliderWrapper){\n this.slider = create('div', {class:'slim-slides'})\n if (this.autoPlay) {\n this.slider.classList.add('autoplay');\n }\n this.sliderWrapper = create('div', {class:'slim-slider-wrapper'})\n this.slides.forEach( slide => {\n this.slider.appendChild(slide)\n })\n this.sliderWrapper.appendChild(this.slider)\n this.parent.appendChild(this.sliderWrapper)\n }\n this.slides[0].classList.add('active');\n this.parent.style.direction = this.options.dir;\n this.slides.forEach( (el, k) => {\n el.dataset.item = k;\n el.style.minWidth = `${this.itemWidth}px`;\n })\n }", "title": "" }, { "docid": "be7891a832ffdcba6551f5ef81cdad1a", "score": "0.59245425", "text": "function initSlider(slider, initMin, initMax, initStep, initValue, updateMethod)\r\n{\r\n $(slider).slider();\r\n $(slider).slider({ min: initMin });\r\n $(slider).slider({ max: initMax });\r\n $(slider).slider({ step: initStep });\r\n $(slider).slider({ value: initValue });\r\n $(slider).slider({\r\n slide: function(){ updateMethod();}\r\n });\r\n}", "title": "" }, { "docid": "6bb71df3573550ad23ec163011fb2a8b", "score": "0.5904396", "text": "function updateSliderUI() {\n let _xleft = 0;\n\n splits.forEach((split, index)=>{\n split.style('left', splits_values[index]-5+'px');\n })\n parts.forEach((part, index)=>{\n if(index === 2) {\n part.style('left', _xleft+'px')\n part.style('width', 320 - _xleft+'px');\n initial_ratio[index] = (320 - _xleft)/320\n } else {\n part.style('left', _xleft+'px')\n part.style('width', (splits_values[index]-_xleft)+'px');\n initial_ratio[index] = (splits_values[index]-_xleft)/320\n _xleft = splits_values[index];\n }\n })\n initial_ratio.forEach((r, index)=>{\n if(index === 0) span_grass.html(round((initial_ratio[0]/(initial_ratio[0]+initial_ratio[1]))*100));\n else if(index === 1) span_fish.html(round((initial_ratio[1]/(initial_ratio[0]+initial_ratio[1]))*100));\n else span_empty.html(round(initial_ratio[2]*100)+'%');\n })\n}", "title": "" }, { "docid": "12b0e4d178a4cee4b63688231ded31c3", "score": "0.58822566", "text": "function startSlider() {\n\tsetTimeout(function() {\n\t\t// Wait n milliseconds (sliderTimeDelay) then start the slider\n\t\tslides(0,info);\n\t},sliderTimeDelay);\n\t\n\t// Populate caption on load\n\t$('#slider-caption h4').text(info[0].title);\n\t$('#slider-caption p').text(info[0].desc);\n\t$('#slider-caption a').attr('href',info[0].link);\n\t\n\t// Add the image elements\n\tfor(var i=0;i<$.keyCount(info);i++) {\n\t\tvar start = parseInt(i*100)+'%';\n\t\tvar img = '<img src=\"img/slider-'+i+'.jpg\" id=\"slider-'+i+'\" style=\"left:'+start+'\" />';\n\t\t$('#slider').prepend(img);\n\t}\n}", "title": "" }, { "docid": "1dd67c2c1628b9ecb402e20e523371ad", "score": "0.58640325", "text": "static Slider() {}", "title": "" }, { "docid": "7674b86e85d4b11e2b5b0d0591dd627f", "score": "0.58406883", "text": "function placeSlider(){\n\t\t\n\t\t//g_objPanel\n\t\tvar gallerySize = g_functions.getElementSize(g_objWrapper);\n\t\t\n\t\tvar sliderWidth = gallerySize.width;\n\t\tvar sliderHeight = gallerySize.height;\n\t\tvar sliderTop = 0;\n\t\tvar sliderLeft = 0;\n\t\t\n\t\tif(g_objPanel){\n\t\t\t\n\t\t\tvar panelSize = g_objPanel.getSize();\n\t\t\t\t\t\t\n\t\t\tswitch(g_options.theme_panel_position){\n\t\t\t\tcase \"left\":\n\t\t\t\t\tsliderLeft = panelSize.right;\n\t\t\t\t\tsliderWidth = gallerySize.width - panelSize.right;\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\tcase \"right\":\n\t\t\t\t\tsliderWidth = panelSize.left;\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\tcase \"top\":\n\t\t\t\t\tsliderHeight = gallerySize.height - panelSize.bottom;\n\t\t\t\t\tsliderTop = panelSize.bottom;\n\t\t\t\tbreak;\n\t\t\t\tcase \"bottom\":\n\t\t\t\t\tsliderHeight = panelSize.top;\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\t\t\t\n\t\t}\n\t\t\t\t\n\t\tg_objSlider.setSize(sliderWidth, sliderHeight);\n\t\tg_objSlider.setPosition(sliderLeft, sliderTop);\n\t}", "title": "" }, { "docid": "08c8dc036f91423fd308fb4d79330340", "score": "0.584006", "text": "function setHtmlSlider(objParent){\n\t\t\n\t\tif(objParent)\n\t\t\tg_objWrapper = objParent;\n\t\t\n\t\t//get if the slide has controls\n\t\tvar loaderClass = getLoaderClass();\n\t\tvar galleryOptions = g_gallery.getOptions();\n\t\t\n\t\tvar html = \"<div class='ug-slider-wrapper'>\";\n\t\t\n\t\thtml += \"<div class='ug-slider-inner'>\";\n\t\thtml += getHtmlSlide(loaderClass,1);\n\t\thtml += getHtmlSlide(loaderClass,2);\n\t\thtml += getHtmlSlide(loaderClass,3);\n\t\t\t\t\n\t\thtml += \"</div>\";\t//end inner\n\t\t\n\t\t//----------------\n\t\t\t\t\n\t\t//add arrows\n\t\tif(g_options.slider_enable_arrows == true){\n\t\t\thtml += \"<div class='ug-slider-control ug-arrow-left ug-skin-\"+g_options.slider_arrows_skin+\"'></div>\";\n\t\t\thtml += \"<div class='ug-slider-control ug-arrow-right ug-skin-\"+g_options.slider_arrows_skin+\"'></div>\";\n\t\t}\n\t\t\n\t\t//add play button\n\t\tif(g_options.slider_enable_play_button == true){\n\t\t\thtml += \"<div class='ug-slider-control ug-button-play ug-skin-\"+g_options.slider_play_button_skin+\"'></div>\";\n\t\t}\n\t\t\n\t\t//add fullscreen button\n\t\tif(g_options.slider_enable_fullscreen_button == true){\n\t\t\thtml += \"<div class='ug-slider-control ug-button-fullscreen ug-skin-\"+g_options.slider_fullscreen_button_skin+\"'></div>\";\n\t\t}\n\t\t\n\t\t\n\t\thtml +=\t\"</div>\";\t//end slider\n\t\t\n\t\t\n\t\tg_objWrapper.append(html);\n\t\t\n\t\t//----------------\n\t\t\n\t\t//set objects\n\t\tg_objSlider = g_objWrapper.children(\".ug-slider-wrapper\");\n\t\tg_objInner = g_objSlider.children(\".ug-slider-inner\");\n\t\t\n\t\t\n\t\tg_objSlide1 = g_objInner.children(\".ug-slide1\");\n\t\tg_objSlide2 = g_objInner.children(\".ug-slide2\");\n\t\tg_objSlide3 = g_objInner.children(\".ug-slide3\");\n\t\t\n\t\t//set slides data\n\t\tg_objSlide1.data(\"slidenum\",1);\n\t\tg_objSlide2.data(\"slidenum\",2);\n\t\tg_objSlide3.data(\"slidenum\",3);\n\t\t\t\t\n\t\t//add bullets\n\t\tif(g_objBullets)\n\t\t\tg_objBullets.appendHTML(g_objSlider);\n\t\t\n\t\t//----------------\n\t\t\n\t\t//get arrows object\n\t\tif(g_options.slider_enable_arrows == true){\n\t\t\tg_objArrowLeft = g_objSlider.children(\".ug-arrow-left\");\n\t\t\tg_objArrowRight = g_objSlider.children(\".ug-arrow-right\");\n\t\t}\n\t\t\t\t\n\t\t//get play button\n\t\tif(g_options.slider_enable_play_button == true){\n\t\t\tg_objButtonPlay = g_objSlider.children(\".ug-button-play\");\n\t\t}\n\t\t\n\t\t//get fullscreen button\n\t\tif(g_options.slider_enable_fullscreen_button == true){\n\t\t\tg_objButtonFullscreen = g_objSlider.children(\".ug-button-fullscreen\");\n\t\t}\n\t\t\n\t\t\n\t\t//----------------\n\t\t\n\t\t//add progress indicator\n\t\tif(g_options.slider_enable_progress_indicator == true){\n\t\t\t\n\t\t\tg_objProgress = g_functions.initProgressIndicator(g_options.slider_progress_indicator_type, g_options, g_objSlider);\n\t\t\t\n\t\t\tvar finalType = g_objProgress.getType();\n\t\t\t\n\t\t\t//change options in case of type change\n\t\t\tif(finalType == \"bar\" && g_options.slider_progress_indicator_type == \"pie\"){\n\t\t\t\tg_options.slider_progress_indicator_type = \"bar\";\n\t\t\t\tg_options = jQuery.extend(g_options, g_defaultsProgressBar);\n\t\t\t}\t\n\t\t\t\n\t\t\tg_gallery.setProgressIndicator(g_objProgress);\n\t\t}\n\t\t\n\t\t//----------------\n\t\t\n\t\t//add text panel (hidden)\n\t\tif(g_options.slider_enable_text_panel == true){\n\t\t\t\n\t\t\t\tg_objTextPanel.appendHTML(g_objSlider);\n\t\t\t\t\t\t\t\t\n\t\t\t\t//hide panel saparatelly from the controls object\n\t\t\t\tif(g_options.slider_textpanel_always_on == false){\n\t\t\t\t\t\n\t\t\t\t\t//hide the panel\n\t\t\t\t\tvar panelElement = g_objTextPanel.getElement();\n\t\t\t\t\tpanelElement.hide().data(\"isHidden\", true);\n\t\n\t\t\t\t\tg_temp.isTextPanelSaparateHover = true;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t}\n\t\t\t\n\t\t//----------------\n\t\t\n\t\t//add zoom buttons panel:\n\t\tif(g_options.slider_enable_zoom_panel == true){\n\t\t\tg_objZoomPanel.appendHTML(g_objSlider);\n\t\t}\n\t\n\t\t\n\t\t//add video player\n\t\tg_objVideoPlayer.setHtml(g_objInner);\n\t}", "title": "" }, { "docid": "cdf8f2b23c1bf536ab7eef6954ef372e", "score": "0.5832854", "text": "addSliders() {\n var self = this;\n var gui = this.get('gui');\n\n // the sidebar 'dat-gui' controls\n var reconstructionControls = {\n index: 0,\n shape_components: 58,\n background_image: true\n };\n\n var length = this.get('faces').get('length');\n\n var index = gui.add(reconstructionControls, 'index', 0, length - 1);\n var shapeComponents = gui.add(reconstructionControls, 'shape_components', 0, 58);\n var background = gui.add(reconstructionControls, 'background_image');\n\n // on index change\n index.onChange(function(newValue) {\n // update the image_index, which is on the controller\n self.set('image_index', parseInt(newValue));\n self.sendAction('updateIndex', parseInt(newValue));\n });\n\n background.onChange(function(newValue) {\n self.sendAction('updateBackground', newValue);\n });\n\n shapeComponents.onChange(function(newValue) {\n self.sendAction('updateShapeComponents', newValue);\n });\n\n var shapeEigenValueControls = gui.addFolder('shape_eigen_values');\n\n /**\n * ShapeSlider callback function\n */\n var handleShapeSlidersCb = function(value) {\n var sliderObject = this;\n\n // slider index is the last character of the slider property string.\n var sliderCharacterIndex = sliderObject.property.length - 1;\n var sliderIndex = parseInt(sliderObject.property[sliderCharacterIndex]);\n\n self.sendAction('updateShapeEigenValues', sliderIndex, value);\n };\n\n var shapeEigenValues = this.get('shape_eigenvalues');\n\n shapeEigenValues.forEach(function(value, index) {\n reconstructionControls['shape_eigen_value_' + index] = value;\n var slider = shapeEigenValueControls.add(reconstructionControls, 'shape_eigen_value_' + index, 0.0, 10.0);\n\n slider.onChange(handleShapeSlidersCb);\n });\n\n console.log(gui.__controllers);\n }", "title": "" }, { "docid": "d13123c25ff4e9ec574d3351be884f18", "score": "0.58268094", "text": "function runSlider(){\n\t\t\n\t\tif(g_temp.isRunOnce == true)\n\t\t\treturn(false);\n\t\t\n\t\tg_temp.isRunOnce = true;\n\t\t\n\t\t//set background color\n\t if(g_options.slider_background_color){\t \t\t\n\t\t var bgColor = g_options.slider_background_color;\n\t\t \n\t\t if(g_options.slider_background_opacity != 1)\n\t\t\t bgColor = g_functions.convertHexToRGB(bgColor, g_options.slider_background_opacity);\n\t\t \n\t\t g_objSlider.css(\"background-color\", bgColor);\n\t \n\t }else if(g_options.slider_background_opacity != 1){\t//set opacity with default color\n\t\t\n\t\t bgColor = g_functions.convertHexToRGB(\"#000000\", g_options.slider_background_opacity);\n\t\t g_objSlider.css(\"background-color\", bgColor);\n\t \n\t }\n\t \n\t\t//init touch slider control\n\t\tif(g_options.slider_control_swipe == true){\n\t\t\tg_objTouchSlider = new UGTouchSliderControl();\n\t\t\tg_objTouchSlider.init(t, g_options);\n\t\t}\n\n\t\t//init zoom slider control\n\t\tif(g_options.slider_control_zoom == true){\n\t\t\tg_objZoomSlider = new UGZoomSliderControl();\n\t\t\tg_objZoomSlider.init(t, g_options);\n\t\t}\n\t\t\n\t\t//run the text panel\n\t\tif(g_objTextPanel)\n\t\t\tg_objTextPanel.run();\n\t\t\n\t\tinitEvents();\t\t\n\t}", "title": "" }, { "docid": "e83dbeeb6127a3950052ed9cad1ea81c", "score": "0.58102125", "text": "function setSliderListener(domain) {\n if (!localStorage.snoozeTime) {\n localStorage.snoozeTime = 10\n }\n var sites = JSON.parse(localStorage.sites)\n var slider = document.getElementById(\"snooze\");\n var label = document.getElementById(\"snoozeValue\");\n slider.value = localStorage.snoozeTime\n label.innerHTML = slider.value;\n\n slider.oninput = () => {\n snoozeValue.innerHTML = slider.value;\n localStorage.snoozeTime = slider.value;\n }\n}", "title": "" }, { "docid": "7041452cde5de8a03d5e327d0b58c421", "score": "0.58082384", "text": "function updateSliderHandles() {\n\n //update the slider handle\n svg.selectAll('.handle-circle, .touch-hidden-handle, .handle-dot, .handle-pulse')\n .attr('cx', function (d) { return d.x; })\n .attr('cy', function (d) { return d.y; });\n\n //update the slider label\n svg.selectAll('.handle-label')\n .attr('x', function (d) { return d.x })\n .attr('y', function (d) { return d.y + 2.5 })\n .text(function (d) { return d.value });\n\n //update the range arc\n var drawRangeArc = d3.svg.arc()\n .innerRadius(sliderOptions.radius - ((defaultOptions.trackWidth - sliderOptions.trackWidth)/2) - sliderOptions.trackWidth)\n .outerRadius(sliderOptions.radius - ((defaultOptions.trackWidth - sliderOptions.trackWidth)/2))\n .startAngle(0)\n .endAngle(function(d) { return d.handleAngle; });\n svg.selectAll('.slider-range-track').attr('d', drawRangeArc);\n\n }", "title": "" }, { "docid": "e31621f4ef3023231c5992f989a93991", "score": "0.57910854", "text": "function componentSwiper() {\n heroSlider()\n // trustUsSlider();\n}", "title": "" }, { "docid": "c1b0c91b173456d762044f0866a4a83d", "score": "0.57796395", "text": "function sliders() {\n if (isSliders) {\n fill(0);\n text('Trees: ' + treeSlider.value(), 150, windowHeight - 55);\n text('Symmetry: ' + symmetrySlider.value(), 330, windowHeight - 55);\n text('Height: x' + heightSlider.value(), 510, windowHeight - 55);\n }\n else {\n treeSlider = createSlider(1, maxTrees, 2, 1);\n treeSlider.position(150, windowHeight - 50);\n\n symmetrySlider = createSlider(-0.1, 0.1, 0, 0.025);\n symmetrySlider.position(330, windowHeight - 50);\n\n heightSlider = createSlider(0.5, 1.5, 1.2, 0.1);\n heightSlider.position(510, windowHeight - 50);\n\n isSliders = true;\n }\n}", "title": "" }, { "docid": "31a879c2bb9f74fcb16fe800ce74d86c", "score": "0.5774066", "text": "function initSlider() {\n // Create the slider in #sldFps\n $(\"#sldFps\").slider({\n range: \"min\", //Let the user only select one value\n value: fps, //Default valus is the current fps\n min: 0.1, //Minimum is 1\n max: 60, //Maximum is 30\n step: 0.1,\n \n //When the slider is changed..\n slide: function(event, ui) {\n //Update the text\n $(\"#txtFps\").val(ui.value);\n //Update the fps value\n fps = ui.value;\n }\n });\n //update the text\n $(\"#txtFps\").val($(\"#sldFps\").slider( \"value\" ));\n}", "title": "" }, { "docid": "b8342b6b183745bca82a63e4eb083812", "score": "0.57719606", "text": "function zn_ui_slider() {\n\n jQuery('.uislider').live().each(function () {\n\n var Othis = this; /*cache a copy of the this variable for use inside nested function*/\n\n var slide_value = jQuery(Othis).attr('rel');\n\n var slide_duration_min = jQuery(Othis).children('.min').html();\n\n var slide_duration_max = jQuery(Othis).children('.max').html();\n\n jQuery(this).slider({\n\n min: parseInt(slide_duration_min),\n\n max: parseInt(slide_duration_max),\n\n value: parseInt(slide_value),\n\n slide: function (event, ui) { /*get the id of this slider*/\n\n var id = $(this).attr(\"id\"); /*select the input box that has the same id as the slider within it and set it's value to the current slider value. */\n\n jQuery(Othis).next('input').val(ui.value);\n\n }\n\n });\n\n }); /*end UI Slider*/\n\n }", "title": "" }, { "docid": "e56606abc737f4ce12ddfbf43dc284fe", "score": "0.57589656", "text": "renderSlider() {\n $('#slider').roundSlider({\n sliderType: 'min-range',\n editableTooltip: false,\n radius: 120,\n value: this.props.room.brightness,\n circleShape: 'pie',\n startAngle: 315,\n width: 10,\n handleSize: '+12',\n showTooltip: true,\n disabled: !this.props.room.active,\n drag: args => this.props.lightControl(args.value),\n tooltipFormat: this.changeTooltip,\n });\n }", "title": "" }, { "docid": "9d5b4952e72f43ec161e15391865b0b7", "score": "0.5753766", "text": "function initSlider() {\n\tvar slideWidth = 0.9 * (100 / numberOfSlides);\n\tvar slidePadding = 0.05 * (100 / numberOfSlides);\n\tvar index = 0;\n\n\tslide.each( function() {\n\t\t$(this).attr('data-id', index);\n\t\t$(this).css( {\n\t\t\t'width' : slideWidth + '%', \n\t\t\t'padding-left' : slidePadding + '%',\n\t\t\t'padding-right' : slidePadding + '%',\n\t\t\t'left' : (100 / numberOfSlides) * index + '%'\n\t\t} );\n\t\tindex++;\n\t} );\n}", "title": "" }, { "docid": "9245355e5eaa68b4e2ba1126e211d378", "score": "0.57474804", "text": "function handleSliderChange() {\n video[this.name] = this.value;\n}", "title": "" }, { "docid": "75714e962ee57d2ec1f4f38b25e47517", "score": "0.5744275", "text": "static generateSlider(label, id, callback, value = 0.5, addonClasses = '') {\n const sliderContainerEl = Helper.createElement(\n `\n <div class=\"slider-container ${addonClasses}\">\n <label class=\"slider-label margin-right\">\n <span>${label}</span>\n </label>\n <input id=\"${id}\"\n title=\"Change ${label} Value\"\n class=\"slider margin-right\"\n type=\"range\"\n min=\"0\"\n max=\"1\"\n step=\"0.01\"\n value=\"${value}\">\n <button id=\"${id}-reset\"\n class=\"button slider-reset-button\">\n Reset\n </button>\n </div>\n `\n );\n\n const sliderEl = sliderContainerEl.querySelector(`#${id}`);\n sliderEl.addEventListener('input', callback);\n\n sliderContainerEl\n .querySelector(`#${id}-reset`)\n .addEventListener('click', (e) => {\n sliderEl.value = value;\n sliderEl.dispatchEvent(new Event('input'));\n });\n\n sliderContainerEl.sliderEl = sliderEl;\n\n return sliderContainerEl;\n }", "title": "" }, { "docid": "f1aed6795c6539cddd565806a4be76cb", "score": "0.5742695", "text": "function initRangeSlider() {\n var lowerprice = parseInt($$('#lower-price').attr('data-price')),\n upperprice = parseInt($$('#upper-price').attr('data-price')),\n priceSlider = document.getElementById('price-slider'),\n lowerValue = document.getElementById('lower-value'),\n upperValue = document.getElementById('upper-value'),\n lowerPrice = document.getElementById('lower-price'),\n upperPrice = document.getElementById('upper-price');\n\n noUiSlider.create(priceSlider, {\n connect: true,\n start: [lowerprice, upperprice],\n behaviour: 'drag',\n step: 100,\n range: {\n 'min': lowerprice,\n 'max': upperprice\n },\n format: ({\n to: function(value) {\n return value;\n },\n from: function(value) {\n return value;\n }\n })\n });\n\n function leftValue(handle) {\n return handle.parentElement.style.left;\n }\n\n priceSlider.noUiSlider.on('update', function(values, handle) {\n if (!handle) {\n lowerValue.innerHTML = parseInt(values[handle]);\n lowerPrice.setAttribute('value', values[handle]);\n } else {\n upperValue.innerHTML = parseInt(values[handle]);\n upperPrice.setAttribute('value', values[handle]);\n }\n });\n}", "title": "" }, { "docid": "b8e4e13ce06b99b0d21151069549010a", "score": "0.57242274", "text": "function initSlider() {\n\tslide.forEach(setImage);\n}", "title": "" }, { "docid": "98a00988cdbc70fb050b4fdac99de90e", "score": "0.5715937", "text": "function JQSliderCreate()\n {\n $(this)\n .removeClass('ui-corner-all ui-widget-content')\n .wrap('<div class=\"ui-slider-wrap\"></div>')\n .find('.slider-snow')\n .removeClass('ui-corner-all ui-state-default');\n }", "title": "" }, { "docid": "faeed13150882f8a1603e6c7d5e0fc7d", "score": "0.5711588", "text": "function _slider() {\n let config = {\n backgrounds:[\n {color:\"rgb(65, 117, 5)\",icon:\"img/grassWhite.svg\"},\n {color:\"rgb(74, 144, 226)\",icon:\"img/fishWhite.svg\"},\n {color:\"#a8dee9\"}//697787\n ],\n values:[0.3, 0.3, 0.4],\n }\n let _div = createDiv('');\n _div.class('slider');\n _div.style(\"color\", 'grey');\n\n _div.parent(para_container)\n \n for(let i=0; i<3; i++) {\n let _p = createDiv('');\n parts.push(_p)\n }\n\n let left_value = 0\n parts.forEach((part, i)=>{\n part.parent(_div);\n part.class('slider_part');\n part.style('width', initial_ratio[i]*320 +'px');\n part.style('background-color', config.backgrounds[i].color)\n if(i!==2) part.style(\"background-image\", \"url(\"+config.backgrounds[i].icon+\")\")\n part.style(\"left\", (320*left_value)+\"px\");\n left_value += initial_ratio[i]\n })\n\n let left_pos = initial_ratio[0]\n for(let i=0; i<2; i++) {\n let split = createDiv('');\n split.parent(_div);\n split.class('slider_split');\n splits.push(split);\n split.style(\"left\", (320*left_pos-5)+\"px\");\n splits_values.push(320*left_pos)\n left_pos+=initial_ratio[i+1];\n \n split.elt.addEventListener(\"mousedown\",(e)=>dragStart(e, i),true);\n split.elt.addEventListener(\"mouseup\",(e)=>updateBoard(),true);\n\n }\n document.body.addEventListener(\"mousemove\",(e)=>dragging(e),true);\n document.body.addEventListener(\"mouseup\",(e)=>dragEnd(e),true);\n return _div;\n}", "title": "" }, { "docid": "86560deae779a3de1e4d1e365c8f5ca0", "score": "0.57100356", "text": "function createPsizeSliders(){\n\n\tGUIParams.partsKeys.forEach(function(p,i){\n\t\tvar initialValue = parseFloat(GUIParams.PsizeMult[p]); //I don't *think* I need to update this in GUI; it's just the initial value that matters, right?\n\n\t\tvar sliderArgs = {\n\t\t\tstart: [initialValue], \n\t\t\tconnect: [true, false],\n\t\t\ttooltips: false,\n\t\t\tsteps: [0.0001],\n\t\t\trange: { //reset below\n\t\t\t\t'min': [0],\n\t\t\t\t'max': [initialValue]\n\t\t\t},\n\t\t\tformat: wNumb({\n\t\t\t\tdecimals: 4\n\t\t\t})\n\t\t}\n\n\t\tvar slider = document.getElementById(p+'_PSlider');\n\t\tvar text = [document.getElementById(p+'_PMaxT')];\n\t\tvar varToSet = [initialValue, \"PsizeMult\",p];\n\t\tvar varArgs = {'f':'setViewerParamByKey','v':varToSet};\n\n\t\tcreateSlider(slider, text, sliderArgs, varArgs);\n\n\t\t//reformat\n\t\tw = parseInt(d3.select('#'+p+'_PSlider').style('width').slice(0,-2));\n\t\td3.select('#'+p+'_PSlider').select('.noUi-base').style('width',w-10+\"px\");\n\t});\n\n}", "title": "" }, { "docid": "0d0d23bf9b9691426c17b243705bcd2c", "score": "0.5700343", "text": "function onDataLoaded() {\n $(\"#display-gmid\").html(client_id);\n $(\".content-select\").css(\"display\", \"none\");\n $(\".footer-gm\").removeClass(\"hidden\");\n\n $(\"#link-sharable\").val('http://ptu.will-step.com/?host=' + client_id);\n new Clipboard('.btn');\n\n $(\"#zoom-slider\").noUiSlider({\n start: [10] ,\n step: 1,\n connect: false,\n range: {\n min: 1,\n max: 20\n }\n });\n}", "title": "" }, { "docid": "77716872dce033361a5fb56bababa1de", "score": "0.5699892", "text": "function initSlider(params)\n{\n sliderParams = JSON.parse(params);\n var sliderName = sliderParams.name;\n //trace(\"initSlider(\"+sliderName+\") - callback:\"+sliderParams.callback);\n $( \"#\"+sliderName+\"-slider\" ).slider({\n range: \"min\",\n min: sliderParams.min,\n max: sliderParams.max,\n step: sliderParams.step,\n value: sliderParams.value,\n format: sliderParams.format,\n\n slide: function( event, ui ) {\n\n if (ui.value % 1 != 0) {\n $( \"#\"+sliderName+\"\" ).val( ui.value .toFixed(2) );\n }else{\n $( \"#\"+sliderName+\"\" ).val( ui.value );\n };\n \n if (sliderParams.callback){\n window[sliderParams.callback]();\n } \n //if (sliderParams.callback) $(sliderParams.callback).html(ui.value .toFixed(2) );\n }\n }); // end General slider\n\n $(\"#\"+sliderName).keyup(function(){\n updateSlider(sliderName);\n });\n updateSlider(sliderName);\n}", "title": "" }, { "docid": "8e06261e4aff0415b4fb8cbec88f3b75", "score": "0.5699244", "text": "function startSlider() {\n sliderIntervalID = setInterval(function () {\n nextSlide();\n }, set.slidePause);\n }", "title": "" }, { "docid": "8e06261e4aff0415b4fb8cbec88f3b75", "score": "0.5699244", "text": "function startSlider() {\n sliderIntervalID = setInterval(function () {\n nextSlide();\n }, set.slidePause);\n }", "title": "" }, { "docid": "abd73b1f87fa1c9fc1aea44a818d263e", "score": "0.5698945", "text": "function initSliderRange($target,bUpdate){\n var bUpdate = bUpdate || false;\n //consoleLog('initSlider');\n //consoleLog('$target.data() : ',$target.data());\n var $amountStart = $target.data('oAmountStart'),\n $amountEnd = $target.data('oAmountEnd'),\n $minField = $target.data('oMinField'),\n $maxField = $target.data('oMaxField');\n $target.noUiSlider({\n start: [ $target.data('fStart'), $target.data('fEnd') ],\n step: 1,\n margin: 1,\n range : {\n min: $target.data('fMin'),\n max: $target.data('fMax')\n },\n serialization: {\n format: {\n decimals: 0\n }\n }\n },bUpdate);\n $target.on({\n slide: function(){\n var aValues = $(this).val();\n $amountStart.html( aValues[ 0 ] );\n $amountEnd.html( aValues[ 1 ] );\n\n if ($minField != undefined && $minField.length) {\n $minField.val(aValues[ 0 ]);\n }\n if ($maxField != undefined && $maxField.length) {\n $maxField.val(aValues[ 1 ]);\n }\n }\n ,change: function(){\n if($(this).closest('#formResultsFilter').length){\n sTempFilter = $(this).attr('name');\n oResultsFilter.filterResults();\n }\n }\n });\n var aValues = $target.val();\n $amountStart.html( aValues[ 0 ] );\n $amountEnd.html( aValues[ 1 ] );\n}", "title": "" }, { "docid": "c7b0beee5fe83ccbd60b39a16eb5f99b", "score": "0.5691494", "text": "function cookingSlider() {\n var cookingSlider = document.getElementById('cooking-slider');\n\n noUiSlider.create(cookingSlider, {\n start: [ 0, 180 ],\n connect: true,\n step: 1,\n range: {\n 'min': 0,\n 'max': 180\n }\n });\n\n var left = document.getElementById('cooking-min');\n var right = document.getElementById('cooking-max');\n var minValue = document.getElementById('cooking-min-value');\n var maxValue = document.getElementById('cooking-max-value');\n\n cookingSlider.noUiSlider.on('update', function( values, handle ) {\n\n var value = values[handle];\n\n left.value = values[0];\n right.value = values[1];\n\n var setMin = parseInt(left.value);\n minValue.innerHTML = setMin + \" mins\";\n \n var setMax = parseInt(right.value);\n maxValue.innerHTML = setMax + \" mins\";\n });\n}", "title": "" }, { "docid": "17a4e7d4ef1b53c1c36bfc6fcdc82e68", "score": "0.56842643", "text": "function startSlider() {\n sliderIntervalID = setInterval(function() {\n nextSlide();\n }, set.slidePause);\n }", "title": "" }, { "docid": "6f0a41246afe99943a9e8d8141946f2a", "score": "0.5678416", "text": "createSaturationSlider(){\n let slider = document.createElement(\"INPUT\");\n slider.classList.add(\"slider\");\n slider.setAttribute(\"type\", \"range\");\n slider.setAttribute(\"title\", \"Saturation\");\n slider.setAttribute(\"id\", \"saturationSlider\");\n slider.setAttribute(\"min\", \"0\");\n slider.setAttribute(\"max\", \"100\");\n slider.setAttribute(\"step\", \"10\");\n this.headnode.appendChild(slider);\n slider.addEventListener(\"input\",this.sliderEventHandler.bind(this))\n }", "title": "" }, { "docid": "701cb3a2748f2ad6d41c5c765290944e", "score": "0.5676307", "text": "function loadSlider() {\r\n galleryThumbs = new Swiper('.gallery-thumbs1', {\r\n spaceBetween: 10,\r\n slidesPerView: 4,\r\n freeMode: true,\r\n watchSlidesVisibility: true,\r\n watchSlidesProgress: true,\r\n });\r\n\r\n mySwiper = new Swiper ('.gallery-top1', {\r\n // Optional parameters\r\n direction: 'horizontal',\r\n speed: 300,\r\n loop: true,\r\n\r\n autoplay: {\r\n delay: 9000,\r\n },\r\n\r\n autoHeight: true,\r\n\r\n // If we need pagination\r\n pagination: {\r\n el: '.swiper-pagination',\r\n clickable: true,\r\n },\r\n\r\n // Navigation arrows\r\n navigation: {\r\n nextEl: '.swiper-button-next',\r\n prevEl: '.swiper-button-prev',\r\n },\r\n\r\n // And if we need scrollbar\r\n scrollbar: {\r\n el: '.swiper-scrollbar',\r\n },\r\n //thumbs: {\r\n // swiper: galleryThumbs,\r\n // slideToClickedSlide: true,\r\n //}\r\n });\r\n\r\n //mySwiper.controller.control = galleryThumbs;\r\n //galleryThumbs.controller.control = galleryTop;\r\n}", "title": "" }, { "docid": "4312d64ec3f524023cda097e6f877690", "score": "0.567165", "text": "function initRange(slider) {\n // var minSlider = parseInt(slider.dataset['rangeMin']);\n // var maxSlider = parseInt(slider.dataset['rangeMax']);\n // var startSlider = parseInt(slider.dataset['rangeStart']);\n // var endSlider = parseInt(slider.dataset['rangeEnd']);\n\n var minSlider = parseInt($(slider).data('range-min'));\n var maxSlider = parseInt($(slider).data('range-max'));\n var startSlider = parseInt($(slider).data('range-start'));\n var endSlider = parseInt($(slider).data('range-end'));\n\n noUiSlider.create(slider, {\n start: [startSlider, maxSlider],\n\n connect: true,\n range: {\n min: minSlider,\n max: maxSlider\n },\n format: wNumb({ decimals: 0 })\n });\n}", "title": "" }, { "docid": "199f50c06637364c5607d4f9fe8033b5", "score": "0.5667292", "text": "renderSlider() {\n this.rangeSlider.render(this);\n this.rangeSlider.setSlider(this.startValue, this.endValue, true, this.tooltip.enable && this.tooltip.displayMode === 'Always');\n }", "title": "" }, { "docid": "5d9852c9fa82540f662ffa32cdcb4e82", "score": "0.56645936", "text": "mounted() {\n noUiSlider.create(this.$refs.slider, {\n start: [this.startMin, this.startMax],\n step: this.step,\n range: {\n 'min': this.min,\n 'max': this.max\n },\n connect: true,\n orientation: 'horizontal',\n pips: {\n mode: 'range',\n density: 10\n }\n });\n // triggered on end when handle is let go\n this.$refs.slider.noUiSlider.on('end', (values, handle) => {\n this.$emit('update:modelValue', _.map(values, Number));\n });\n }", "title": "" }, { "docid": "101697da2b1721ed8332697156fc414c", "score": "0.5650322", "text": "function updateSliderData(arr) {\r\n\tconst slider = (arr.length == 2) ? arr[0] : arr;\r\n\tconst filterName = slider.id.substring(slider.id.indexOf('_') + 1);\r\n\tconst labelValue = document.querySelector(`#value_${filterName}`);\r\n\r\n\tslider.min = filters[filterName].min;\r\n\tslider.max = filters[filterName].max;\r\n\tslider.value = filters[filterName].value;\r\n\tlabelValue.textContent = filters[filterName].value + filters[filterName].type;\r\n}", "title": "" }, { "docid": "61ee171793d91af6b555b2cc3d9cb774", "score": "0.5644033", "text": "function onSlider(e){\n sliderWidth = horizontalSlider.value;\n sliderHeight = verticalSlider.value;\n\n inputWidth.value = ~~((sliderWidth * WIDTH)/100);\n inputHeight.value = ~~((sliderHeight * HEIGHT)/100);\n }", "title": "" }, { "docid": "ff6ebecb19bd5c2109d54e8c67df7f64", "score": "0.5639947", "text": "function initSlider() {\n\n if($scope.sliderData && !$scope.sliderData.hasOwnProperty('value1')) {\n $scope.sliderData.value1 = sliderOptions.min;\n }\n if($scope.sliderData && !$scope.sliderData.hasOwnProperty('value2')) {\n $scope.sliderData.value2 = sliderOptions.min;\n }\n\n //setup the slider values\n sliderOptions.value = $scope.sliderData.value1;\n var angle = calculateRotationFromValue(sliderOptions.value);\n var handleLocation = calculateHandleLocationFromAngle(angle);\n\n //setup the second slider values\n sliderOptions.value2 = $scope.sliderData.value2;\n var angle2 = calculateRotationFromValue(sliderOptions.value2);\n var handleLocation2 = calculateHandleLocationFromAngle(angle2);\n\n //set the delta between the two sliders\n sliderValueDelta = $scope.sliderData.value2 - $scope.sliderData.value1;\n sliderAngleDelta = (2 * Math.PI) / (sliderOptions.max - sliderOptions.min) * parseInt(sliderValueDelta);\n \n return [\n {\n x: handleLocation.x,\n y: handleLocation.y,\n value: sliderOptions.value,\n handleAngle: angle,\n sliderIndex: 0\n },\n {\n x: handleLocation2.x,\n y: handleLocation2.y,\n value: sliderOptions.value2,\n handleAngle: angle2,\n sliderIndex: 1\n }\n ];\n }", "title": "" }, { "docid": "bb3ae98c79aeaa4fd3aba57fb75f183e", "score": "0.56382906", "text": "function updateSlider(timelineSlider){\n // Increment or decrement the slider towards the endDate\n if(endDate > timelineSlider.slider.value){\n timelineSlider.slider.value++;\n } else if (endDate < timelineSlider.slider.value){\n timelineSlider.slider.value--;\n }\n // Update everything with the new slider value\n updateLayerGroups(timelineSlider.slider.value);\n prevYear = timelineSlider.slider.value;\n updateLegend(timelineSlider.slider.value)\n\n // If we have not reached our end date yet, call this function again\n // with a 10 millisecond delay\n if(timelineSlider.slider.value != endDate){\n setTimeout(function(){updateSlider(timelineSlider)}, 10);\n }\n}", "title": "" }, { "docid": "57283a77935313106ce151617489c0df", "score": "0.5637241", "text": "function loadSlider() {\r\n\t\tdocument.getElementById(\"slider\").style.display = \"block\";\r\n\t\tdocument.getElementById(\"slider\").onchange = slide;\r\n\t\tdocument.getElementById(\"slider\").value = 0;\r\n\t}", "title": "" }, { "docid": "4f0d86527c01620be3e4d6999c6188ed", "score": "0.5636963", "text": "function RangeSlide(){\nconst slider = document.getElementById('sliderPrice');\nconst rangeMin = parseInt(slider.dataset.min);\nconst rangeMax = parseInt(slider.dataset.max);\nconst step = parseInt(slider.dataset.step);\nconst filterInputs = document.querySelectorAll('input.filter__input');\n\nnoUiSlider.create(slider, {\n start: [rangeMin, rangeMax],\n connect: true,\n step: step,\n range: {\n 'min': rangeMin,\n 'max': rangeMax\n },\n \n // make numbers whole\n format: {\n to: value => value,\n from: value => value\n }\n});\n\n// bind inputs with noUiSlider \nslider.noUiSlider.on('update', (values, handle) => { \n filterInputs[handle].value = values[handle]; \n});\n\nfilterInputs.forEach((input, indexInput) => { \n input.addEventListener('change', () => {\n slider.noUiSlider.setHandle(indexInput, input.value);\n })\n});\n}", "title": "" }, { "docid": "e0825ee81f3792c95cc0fe05d3ebd10c", "score": "0.5633979", "text": "_update() {\n const _this = this;\n\n let sliderBodyPos = _this._calcSliderBodyPos();\n\n this.svgEls.body.setAttribute(\"x\", sliderBodyPos.x);\n this.svgEls.body.setAttribute(\"y\", sliderBodyPos.y);\n this.svgEls.body.setAttribute(\"width\", _this.dims.bodyWidth);\n this.svgEls.body.setAttribute(\"height\", _this._calcSliderBodyHeight());\n this.svgEls.body.setAttribute(\"fill\", _this.o.sliderBodyColor);\n\n this.svgEls.overlay.setAttribute(\"x\", sliderBodyPos.x);\n this.svgEls.overlay.setAttribute(\"y\", sliderBodyPos.y);\n this.svgEls.overlay.setAttribute(\"width\", _this.dims.bodyWidth + _this.dims.handleWidth);\n this.svgEls.overlay.setAttribute(\"height\", _this._calcSliderBodyHeight());\n this.svgEls.overlay.setAttribute(\"fill\", \"transparent\");\n\n let sliderHandlePoints = _this._calcSliderHandlePoints();\n\n this.svgEls.handle.setAttribute(\"points\", sliderHandlePoints);\n this.svgEls.handle.setAttribute(\"fill\", _this.o.sliderHandleColor);\n }", "title": "" }, { "docid": "cc94e8b3d46ec868ecce93f482009392", "score": "0.563289", "text": "function onPanelMove(){\n\t\tplaceSlider();\n\t}", "title": "" }, { "docid": "d83bb4a8c3858e44b1a30fca402d4985", "score": "0.562215", "text": "initSlider() {\n this.interval = setTimeout(this.goToNextSlide.bind(this), this.time * 1000);\n }", "title": "" }, { "docid": "72e2ece8a28f448e77fcab5d3d0fcf89", "score": "0.56177515", "text": "function get() {\n var data = $$('slider_input').getValues();\n $$('insert_input').setValues(data);\n $$('insert_input').refresh()\n }", "title": "" }, { "docid": "33fd9e2366c8618a7dab470b3db24170", "score": "0.5607203", "text": "function handleSlider(slider) {\n slider.addEventListener(\"change\", function () {\n calculateRaster(parseInt(slider.value), document.getElementsByTagName('canvas')[0], document.getElementsByTagName('img')[0]);\n }, false);\n }", "title": "" }, { "docid": "df4728961fc16a587e87432b38dec722", "score": "0.5605453", "text": "static IntSlider() {}", "title": "" }, { "docid": "e30ccd8b7ddcb75c16d20be26ec19774", "score": "0.5602823", "text": "sliderSetup(x, y, min = 0, max = 1, defaultValue = 0.8, step = 0.1) {\r\n\t\tvar slider = createSlider(min, max, defaultValue, step);\r\n\t\tslider.position(x, y);\r\n\t\treturn slider;\r\n\t}", "title": "" }, { "docid": "23753c3db8e91703a7ab38529d6bb51b", "score": "0.5601056", "text": "function run(){\n $('.pwrSldr').each(function() {\n var $this = $(this);\n if(!$this.data('pwrSldr')){\n\n var pagination = 'none';\n var $container = $this.parents('.pwrSldr_container').first();\n\n if (client.hasTouch && client.isAndroidPre42){\n $container.css('width', exports.Juggernaut.utilities.getWidthOfSliderForScroll($container) + 'px');\n $container.parents('.module').first().addClass('pwrSldr-overflow-visible');\n pagination = 'scroll';\n }\n\n \n //instantiate slider\n $this.pwrSldr({\n 'pagination': pagination,\n //'onPageChange' : checkPg,\n //'onReady' : checkPg\n });\n }\n });\n }", "title": "" }, { "docid": "b46dc3c32adac098a8b04153ac5f2118", "score": "0.55974144", "text": "function onSliderChange() {\n // show spinner\n showSpinner(true)\n compute()\n}", "title": "" }, { "docid": "7d10ea6f8466c4da85ebe1a96bac7eac", "score": "0.55920416", "text": "function trx_addons_init_sliders(e, container) {\n\t\"use strict\";\n\n\t// Create Swiper Controllers\n\tif (container.find('.sc_slider_controller:not(.inited)').length > 0) {\n\t\tcontainer.find('.sc_slider_controller:not(.inited)')\n\t\t\t.each(function () {\n\t\t\t\t\"use strict\";\n\t\t\t\tvar controller = jQuery(this).addClass('inited');\n\t\t\t\tvar slider_id = controller.data('slider-id');\n\t\t\t\tif (!slider_id) return;\n\t\t\t\t\n\t\t\t\tvar controller_id = controller.attr('id');\n\t\t\t\tif (controller_id == undefined) {\n\t\t\t\t\tcontroller_id = 'sc_slider_controller_'+Math.random();\n\t\t\t\t\tcontroller_id = controller_id.replace('.', '');\n\t\t\t\t\tcontroller.attr('id', controller_id);\n\t\t\t\t}\n\n\t\t\t\tjQuery('#'+slider_id+' .slider_swiper').attr('data-controller', controller_id);\n\n\t\t\t\tvar controller_style = controller.data('style');\n\t\t\t\tvar controller_effect = controller.data('effect');\n\t\t\t\tvar controller_interval = controller.data('interval');\n\t\t\t\tvar controller_height = controller.data('height');\n\t\t\t\tvar controller_per_view = controller.data('slides-per-view');\n\t\t\t\tvar controller_space = controller.data('slides-space');\n\t\t\t\tvar controller_controls = controller.data('controls');\n\n\t\t\t\tvar controller_html = '';\n\t\t\t\tjQuery('#'+slider_id+' .swiper-slide')\n\t\t\t\t\t.each(function (idx) {\n\t\t\t\t\t\t\"use strict\";\n\t\t\t\t\t\tvar slide = jQuery(this);\n\t\t\t\t\t\tvar image = slide.data('image');\n\t\t\t\t\t\tvar title = slide.data('title');\n\t\t\t\t\t\tvar cats = slide.data('cats');\n\t\t\t\t\t\tvar date = slide.data('date');\n\t\t\t\t\t\tcontroller_html += '<div class=\"swiper-slide\"'\n\t\t\t\t\t\t\t\t\t\t\t\t+ ' style=\"'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ (image !== undefined ? 'background-image: url('+image+');' : '')\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+ '>'\n\t\t\t\t\t\t\t\t\t\t\t\t+ '<div class=\"sc_slider_controller_info\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ '<span class=\"sc_slider_controller_info_number\">'+(idx < 9 ? '0' : '')+(idx+1)+'</span>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ '<span class=\"sc_slider_controller_info_title\">'+title+'</span>'\n\t\t\t\t\t\t\t\t\t\t\t\t+ '</div>'\n\t\t\t\t\t\t\t\t\t\t\t+ '</div>';\n\t\t\t\t\t});\n\t\t\t\tcontroller.html('<div id=\"'+controller_id+'_outer\"'\n\t\t\t\t\t\t\t\t\t+ ' class=\"slider_swiper_outer slider_style_controller'\n\t\t\t\t\t\t\t\t\t\t\t\t+ ' slider_outer_' + (controller_controls == 1 ? 'controls slider_outer_controls_side' : 'nocontrols')\n\t\t\t\t\t\t\t\t\t\t\t\t+ ' slider_outer_nopagination'\n\t\t\t\t\t\t\t\t\t\t\t\t+ ' slider_outer_' + (controller_per_view==1 ? 'one' : 'multi')\n\t\t\t\t\t\t\t\t\t\t\t\t+ '\"'\n\t\t\t\t\t\t\t\t\t+ '>'\n\t\t\t\t\t\t\t\t\t\t+ '<div id=\"'+controller_id+'_swiper\"'\n\t\t\t\t\t\t\t\t\t\t\t+' class=\"slider_swiper swiper-slider-container'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ ' slider_' + (controller_controls == 1 ? 'controls slider_controls_side' : 'nocontrols')\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ ' slider_nopagination'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ ' slider_notitles'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ ' slider_noresize'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ ' slider_' + (controller_per_view==1 ? 'one' : 'multi')\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+ ' data-slides-min-width=\"100\"'\n\t\t\t\t\t\t\t\t\t\t\t+ ' data-controlled-slider=\"'+slider_id+'\"'\n\t\t\t\t\t\t\t\t\t\t\t+ (controller_effect !== undefined ? ' data-effect=\"' + controller_effect + '\"' : '')\n\t\t\t\t\t\t\t\t\t\t\t+ (controller_interval !== undefined ? ' data-interval=\"' + controller_interval + '\"' : '')\n\t\t\t\t\t\t\t\t\t\t\t+ (controller_per_view !== undefined ? ' data-slides-per-view=\"' + controller_per_view + '\"' : '')\n\t\t\t\t\t\t\t\t\t\t\t+ (controller_space !== undefined ? ' data-slides-space=\"' + controller_space + '\"' : '')\n\t\t\t\t\t\t\t\t\t\t\t+ (controller_height !== undefined ? ' style=\"height:'+controller_height+'\"' : '')\n\t\t\t\t\t\t\t\t\t\t+ '>'\n\t\t\t\t\t\t\t\t\t\t\t+ '<div class=\"swiper-wrapper\">'\n\t\t\t\t\t\t\t\t\t\t\t\t+ controller_html\n\t\t\t\t\t\t\t\t\t\t\t+ '</div>'\n\t\t\t\t\t\t\t\t\t\t+ '</div>'\n\t\t\t\t\t\t\t\t\t\t+ (controller_controls == 1\n\t\t\t\t\t\t\t\t\t\t\t? '<div class=\"slider_controls_wrap\"><a class=\"slider_prev swiper-button-prev\" href=\"#\"></a><a class=\"slider_next swiper-button-next\" href=\"#\"></a></div>'\n\t\t\t\t\t\t\t\t\t\t\t: ''\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t+ '</div>'\n\t\t\t\t);\n\t\t\t});\n\t}\n\t\t\t\t\n\n\t// Swiper Slider\n\tif (container.find('.slider_swiper:not(.inited)').length > 0) {\n\t\tcontainer.find('.slider_swiper:not(.inited)')\n\t\t\t.each(function () {\n\t\t\t\t\"use strict\";\n\n\t\t\t\t// If slider inside the invisible block - exit\n\t\t\t\tif (jQuery(this).parents('div:hidden,article:hidden').length > 0)\n\t\t\t\t\treturn;\n\t\t\t\t\n\t\t\t\t// Check attr id for slider. If not exists - generate it\n\t\t\t\tvar slider = jQuery(this);\n\t\t\t\tvar id = slider.attr('id');\n\t\t\t\tif (id == undefined) {\n\t\t\t\t\tid = 'swiper_'+Math.random();\n\t\t\t\t\tid = id.replace('.', '');\n\t\t\t\t\tslider.attr('id', id);\n\t\t\t\t}\n\t\t\t\tvar cont = slider.parent().hasClass('slider_swiper_outer') ? slider.parent().attr('id', id+'_outer') : slider;\n\t\t\t\tvar cont_id = cont.attr('id');\n\n\t\t\t\t// If this slider is controller for the other slider\n\t\t\t\tvar is_controller = slider.parents('.sc_slider_controller').length > 0;\n\t\t\t\tvar controller_id = slider.data('controller');\n\t\t\t\t\n\t\t\t\t// Enum all slides\n\t\t\t\tslider.find('.swiper-slide').each(function(idx) {\n\t\t\t\t\tjQuery(this).attr('data-slide-number', idx);\n\t\t\t\t});\n\n\t\t\t\t// Show slider, but make it invisible\n\t\t\t\tslider.css({\n\t\t\t\t\t'display': 'block',\n\t\t\t\t\t'opacity': 0\n\t\t\t\t\t})\n\t\t\t\t\t.addClass(id)\n\t\t\t\t\t.addClass('inited')\n\t\t\t\t\t.data('settings', {mode: 'horizontal'});\t\t// VC hook\n\n\t\t\t\t// Min width of the slides in swiper (used for validate slides_per_view on small screen)\n\t\t\t\tvar smw = slider.data('slides-min-width');\n\t\t\t\tif (smw == undefined) {\n\t\t\t\t\tsmw = 250;\n\t\t\t\t\tslider.attr('data-slides-min-width', smw);\n\t\t\t\t}\n\n\t\t\t\t// Validate Slides per view on small screen\n\t\t\t\tvar width = slider.width();\n\t\t\t\tif (width == 0) width = slider.parent().width();\n\t\t\t\tvar spv = slider.data('slides-per-view');\n\t\t\t\tif (spv == undefined) {\n\t\t\t\t\tspv = 1;\n\t\t\t\t\tslider.attr('data-slides-per-view', spv);\n\t\t\t\t}\n\t\t\t\tif (width / spv < smw) spv = Math.max(1, Math.floor(width / smw));\n\n\t\t\t\t// Space between slides\n\t\t\t\tvar space = slider.data('slides-space');\n\t\t\t\tif (space == undefined) space = 0;\n\t\t\t\t\n\t\t\t\t// Autoplay interval\n\t\t\t\tvar interval = slider.data('interval');\n\t\t\t\tif (isNaN(interval)) interval = 0;\n\t\t\t\t\t\n\t\t\t\tif (TRX_ADDONS_STORAGE['swipers'] === undefined) TRX_ADDONS_STORAGE['swipers'] = {};\n\n\t\t\t\tTRX_ADDONS_STORAGE['swipers'][id] = new Swiper('.'+id, {\n\t\t\t\t\tcalculateHeight: !slider.hasClass('slider_height_fixed'),\n\t\t\t\t\tresizeReInit: true,\n\t\t\t\t\tautoResize: true,\n\t\t\t\t effect: slider.data('effect') ? slider.data('effect') : 'slide',\n\t\t\t\t\tpagination: slider.hasClass('slider_pagination') ? '#'+cont_id+' .slider_pagination_wrap' : false,\n\t\t\t\t paginationClickable: slider.hasClass('slider_pagination') ? '#'+cont_id+' .slider_pagination_wrap' : false,\n\t\t\t\t paginationType: slider.hasClass('slider_pagination') && slider.data('pagination') ? slider.data('pagination') : 'bullets',\n\t\t\t nextButton: slider.hasClass('slider_controls') ? '#'+cont_id+' .slider_next' : false,\n\t\t\t prevButton: slider.hasClass('slider_controls') ? '#'+cont_id+' .slider_prev' : false,\n\t\t\t autoplay: slider.hasClass('slider_noautoplay') || interval==0\t? false : parseInt(interval),\n \t\t\tautoplayDisableOnInteraction: true,\n\t\t\t\t\tinitialSlide: 0,\n\t\t\t\t\tslidesPerView: spv,\n\t\t\t\t\tloopedSlides: spv,\n\t\t\t\t\tspaceBetween: space,\n\t\t\t\t\tspeed: 600,\n\t\t\t\t\tcenteredSlides: false,\t//is_controller,\n\t\t\t\t\tloop: true,\t\t\t\t//!is_controller\n\t\t\t\t\tgrabCursor: !is_controller,\n\t\t\t\t\tslideToClickedSlide: is_controller,\n\t\t\t\t\ttouchRatio: is_controller ? 0.2 : 1,\n\t\t\t\t\tonSlideChangeStart: function (swiper) {\n\t\t\t\t\t\t// Change outside title\n\t\t\t\t\t\tcont.find('.slider_titles_outside_wrap .active').removeClass('active').fadeOut();\n\t\t\t\t\t\t// Update controller or controlled slider\n\t\t\t\t\t\tvar controlled_slider = jQuery('#'+slider.data(is_controller ? 'controlled-slider' : 'controller')+' .slider_swiper');\n\t\t\t\t\t\tvar controlled_id = controlled_slider.attr('id');\n\t\t\t\t\t\tif (TRX_ADDONS_STORAGE['swipers'][controlled_id] && jQuery('#'+controlled_id).attr('data-busy')!=1) {\n\t\t\t\t\t\t\tslider.attr('data-busy', 1);\n\t\t\t\t\t\t\tsetTimeout(function() { slider.attr('data-busy', 0); }, 300);\n\t\t\t\t\t\t\tvar slide_number = jQuery(swiper.slides[swiper.activeIndex]).data('slide-number');\n\t\t\t\t\t\t\tvar slide_idx = controlled_slider.find('[data-slide-number=\"'+slide_number+'\"]').index();\n\t\t\t\t\t\t\tTRX_ADDONS_STORAGE['swipers'][controlled_id].slideTo(slide_idx);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tonSlideChangeEnd: function (swiper) {\n\t\t\t\t\t\t// Change outside title\n\t\t\t\t\t\tvar titles = cont.find('.slider_titles_outside_wrap .slide_info');\n\t\t\t\t\t\tif (titles.length==0) return;\n\t\t\t\t\t\t//titles.eq((swiper.activeIndex-1)%titles.length).addClass('active').fadeIn();\n\t\t\t\t\t\ttitles.eq(jQuery(swiper.slides[swiper.activeIndex]).data('slide-number')).addClass('active').fadeIn(300);\n\t\t\t\t\t\t// Remove video\n\t\t\t\t\t\tcont.find('.trx_addons_video_player.with_cover.video_play').removeClass('video_play').find('.video_embed').empty();\n\t\t\t\t\t\t// Unlock slider/controller\n\t\t\t\t\t\tslider.attr('data-busy', 0);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tslider.attr('data-busy', 1).animate({'opacity':1}, 'fast');\n\t\t\t\tsetTimeout(function() { slider.attr('data-busy', 0); }, 300);\n\t\t\t});\n\t}\n}", "title": "" }, { "docid": "dd33ca80e2557a8dd8171eda643df827", "score": "0.5571809", "text": "function main_slider(){\r\n if ( $('#main_slider').length ){\r\n $(\"#main_slider\").revolution({\r\n sliderType:\"standard\",\r\n sliderLayout:\"auto\",\r\n delay:4000,\r\n disableProgressBar:\"on\",\r\n navigation: {\r\n onHoverStop: 'off',\r\n touch:{\r\n touchenabled:\"on\"\r\n },\r\n arrows: {\r\n style:\"zeus\",\r\n enable:false,\r\n hide_onmobile:true,\r\n hide_under:992,\r\n hide_onleave:true,\r\n hide_delay:200,\r\n hide_delay_mobile:1200,\r\n tmp:'<div class=\"tp-title-wrap\"> \t<div class=\"tp-arr-imgholder\"></div> </div>',\r\n left: {\r\n h_align: \"left\",\r\n v_align: \"center\",\r\n h_offset: 50,\r\n v_offset: 0\r\n },\r\n right: {\r\n h_align: \"right\",\r\n v_align: \"center\",\r\n h_offset: 50,\r\n v_offset: 0\r\n }\r\n },\r\n },\r\n responsiveLevels:[4096,1199,992,767,480],\r\n // gridwidth:[1170,970,750,700,400],\r\n // gridheight:[800,800,550,550,500],\r\n lazyType:\"smart\",\r\n fallbacks: {\r\n simplifyAll:\"off\",\r\n nextSlideOnWindowFocus:\"off\",\r\n disableFocusListener:false,\r\n }\r\n })\r\n }\r\n }", "title": "" }, { "docid": "5050f23ef89a71e869d54f6c3111b845", "score": "0.555015", "text": "function updateSliderHandles(args){\n i = args[0]\n value = args[1]\n key = args[2]\n resetEnd = args[3]\n type = args[4]\n \n var this_parent = document.getElementById(key)\n\n setSliderHandle(i,value,this_parent,null,resetEnd,type);\n}", "title": "" }, { "docid": "9b0d92dbebad74f96b33cd52370e756a", "score": "0.55462956", "text": "function setupUi() {\n\n // VOLUME\n if (_data.volume.file.length > 0) {\n\n // update threshold slider\n jQuery('#threshold-volume').dragslider(\"option\", \"max\", volume.max);\n jQuery('#threshold-volume').dragslider(\"option\", \"min\", volume.min);\n jQuery('#threshold-volume').dragslider(\"option\", \"values\",\n [volume.min, volume.max]);\n\n // update window/level slider\n jQuery('#windowlevel-volume').dragslider(\"option\", \"max\", volume.max);\n jQuery('#windowlevel-volume').dragslider(\"option\", \"min\", volume.min);\n jQuery('#windowlevel-volume').dragslider(\"option\", \"values\",\n [volume.min, volume.max]);\n\n volume.windowHigh = volume.max;\n\n // update 3d opacity\n jQuery('#opacity-volume').slider(\"option\", \"value\", 20);\n volume.opacity = 0.2; // re-propagate\n volume.modified();\n\n // update 2d slice sliders\n var dim = volume.range;\n\n // ax\n jQuery(\"#blue_slider\").slider(\"option\", \"disabled\", false);\n jQuery(\"#blue_slider\").slider(\"option\", \"min\", 0);\n jQuery(\"#blue_slider\").slider(\"option\", \"max\", dim[2] - 1);\n jQuery(\"#blue_slider\").slider(\"option\", \"value\", volume.indexZ);\n\n // sag\n jQuery(\"#red_slider\").slider(\"option\", \"disabled\", false);\n jQuery(\"#red_slider\").slider(\"option\", \"min\", 0);\n jQuery(\"#red_slider\").slider(\"option\", \"max\", dim[0] - 1);\n jQuery(\"#red_slider\").slider(\"option\", \"value\", volume.indexX);\n\n // cor\n jQuery(\"#green_slider\").slider(\"option\", \"disabled\", false);\n jQuery(\"#green_slider\").slider(\"option\", \"min\", 0);\n jQuery(\"#green_slider\").slider(\"option\", \"max\", dim[1] - 1);\n jQuery(\"#green_slider\").slider(\"option\", \"value\", volume.indexY);\n\n\n jQuery('#volume .menu').removeClass('menuDisabled');\n\n } else {\n\n // no volume\n jQuery('#volume .menu').addClass('menuDisabled');\n jQuery(\"#blue_slider\").slider(\"option\", \"disabled\", true);\n jQuery(\"#red_slider\").slider(\"option\", \"disabled\", true);\n jQuery(\"#green_slider\").slider(\"option\", \"disabled\", true);\n\n }\n\n // CHANNEL\n if (_data.volume.file.length > 0 && hasChannels()>1 ) {\n // has rgb channels\n if(hasRGB()) {\n jQuery('#greenChannel').show();\n jQuery('#blueChannel').show();\n jQuery('#redChannel').show();\n jQuery(\"#channellevel\").slider(\"option\", \"disabled\", true);\n jQuery('#channellevel-label').hide();\n jQuery('#channellevel').hide();\n jQuery('#channellevel-btn').hide();\n } else {\n jQuery('#greenChannel').hide();\n jQuery('#blueChannel').hide();\n jQuery('#redChannel').hide();\n jQuery('#channellevel-label').show();\n jQuery('#channellevel').show();\n jQuery('#channellevel-btn').show();\n jQuery('#channellevel').slider(\"option\", \"disabled\", false);\n }\n\n jQuery('#channel .menu').removeClass('menuDisabled');\n\n } else {\n jQuery('#channel .menu').addClass('menuDisabled');\n }\n\n // LABELMAP\n if (_data.labelmap.file.length > 0) {\n\n jQuery('#labelmapSwitch').show();\n\n jQuery('#opacity-labelmap').slider(\"option\", \"value\", 40);\n volume.labelmap.opacity = 0.4; // re-propagate\n\n\n } else {\n\n // no labelmap\n jQuery('#labelmapSwitch').hide();\n\n }\n\n\n // MESH\n if (_data.mesh.file.length > 0) {\n\n jQuery('#opacity-mesh').slider(\"option\", \"value\", 100);\n mesh.opacity = 1.0; // re-propagate\n\n mesh.color = [1, 1, 1];\n\n jQuery('#mesh .menu').removeClass('menuDisabled');\n\n } else {\n\n // no mesh\n jQuery('#mesh .menu').addClass('menuDisabled');\n\n }\n\n // SCALARS\n if (_data.scalars.file.length > 0) {\n\n var combobox = document.getElementById(\"scalars-selector\");\n combobox.value = 'Scalars 1';\n\n jQuery(\"#threshold-scalars\").dragslider(\"option\", \"disabled\", false);\n jQuery(\"#threshold-scalars\").dragslider(\"option\", \"min\",\n mesh.scalars.min * 100);\n jQuery(\"#threshold-scalars\").dragslider(\"option\", \"max\",\n mesh.scalars.max * 100);\n jQuery(\"#threshold-scalars\").dragslider(\"option\", \"values\",\n [mesh.scalars.min * 100, mesh.scalars.max * 100]);\n\n } else {\n\n var combobox = document.getElementById(\"scalars-selector\");\n//MEI\n if(combobox) { \n combobox.disabled = true;\n }\n jQuery(\"#threshold-scalars\").dragslider(\"option\", \"disabled\", true);\n\n }\n\n // FIBERS\n if (_data.fibers.file.length > 0) {\n\n jQuery('#fibers .menu').removeClass('menuDisabled');\n\n jQuery(\"#threshold-fibers\").dragslider(\"option\", \"min\", fibers.scalars.min);\n jQuery(\"#threshold-fibers\").dragslider(\"option\", \"max\", fibers.scalars.max);\n jQuery(\"#threshold-fibers\").dragslider(\"option\", \"values\",\n [fibers.scalars.min, fibers.scalars.max]);\n\n } else {\n\n // no fibers\n jQuery('#fibers .menu').addClass('menuDisabled');\n\n }\n\n // store the renderer layout\n _current_3d_content = ren3d;\n _current_Ax_content = sliceAx;\n _current_Sag_content = sliceSag;\n _current_Cor_content = sliceCor;\n\n\n if (!_webgl_supported) {\n }\n\n//MEI\n // initialize_sharing();\n\n}", "title": "" }, { "docid": "798f1a2190588ecb7766ea54319122ab", "score": "0.5542583", "text": "function updateSlickSlider($slider, settings){\n\t\tif($slider.length && settings){\n\t\t\t$slider.slick('slickSetOption', settings, true);\n\t\t}\n\t}", "title": "" }, { "docid": "6f4bee574248a59d9406ac0becd44a74", "score": "0.554232", "text": "function initPriceSlider() {\n\tvar slider = $(\"#kendoSliderPrice\").kendoRangeSlider({\n change: rangeSliderOnChange,\n min: 0,\n max: 300,\n smallStep: 10,\n largeStep: 100,\n tickPlacement: \"both\"\n });\n \n _slider = $(\"#kendoSliderPrice\").getKendoRangeSlider();\n _slider.wrapper.css(\"width\", \"230px\");\n _slider.resize();\n}", "title": "" }, { "docid": "850a901556a200a702b11195c4fa80b2", "score": "0.5537855", "text": "function init_slider(){\n $(\"#difficulty-slider-range\").slider({\n range: true,\n min: 0,\n max: 100,\n values: [0,100], // Always set slider to full range\n slide: function(event, ui){\n // Fade out the regions on the slider that do not belong to the selected range\n _refadeSliderRegions();\n },\n stop: function(event, ui){\n // Fade out the regions on the slider that do not belong to the selected range\n _refadeSliderRegions();\n\n // Repopulate search results based on difficulty level filter\n repopulateSearchResults(ui, OC.resultCollectionView);\n }\n });\n\n // Insert faded region containers before the left slider and after the right slider. These are\n // brought to their faded stated using _refadeSliderRegions()\n $(\"<div/>\", {\n id: \"slider-prefade\"\n }).insertBefore(\".ui-slider-range\");\n $(\"<div/>\", {\n id: \"slider-postfade\"\n }).insertAfter(\".ui-slider-range\");\n }", "title": "" }, { "docid": "1822a72b9238c7ab1be66790da468850", "score": "0.55372924", "text": "function onSlider(val) {\n console.log(\"Slider changed: \", val)\n let sliceData = timeSliceData[val][1]\n console.log(\"slider: sliceData \", sliceData)\n currentTimeSliceIndex = val\n d3BindData(stationData, stationDataMap)\n}", "title": "" }, { "docid": "c05e16ee51dd1afd7005102e141b4473", "score": "0.5535777", "text": "function setSlider(width) {\n const animalSwiper = new Swiper('.animal-slider', {\n // Optional parameters\n slidesPerView: 1.5,\n centeredSlides: true,\n spaceBetween: 0,\n\n hashNavigation: {\n watchState: true,\n },\n \n // If we need pagination\n pagination: {\n el: '.swiper-pagination',\n },\n \n breakpoints: {\n 500: {\n slidesPerView: 3.5,\n centeredSlides: false\n }\n }\n });\n \n const blogSwiper = new Swiper('.blog-slider', {\n // Optional parameters\n slidesPerView: 1.25,\n centeredSlides: true,\n spaceBetween: 20,\n loop: false,\n\n hashNavigation: {\n watchState: true,\n },\n \n // If we need pagination\n pagination: {\n el: '.swiper-pagination',\n },\n \n breakpoints: {\n 500: {\n slidesPerView: 2.5,\n centeredSlides: false\n }\n }\n });\n\n const circleSwiper = new Swiper('.circle-slider', {\n // Optional parameters\n slidesPerView: 1.5,\n centeredSlides: true,\n spaceBetween: 30,\n loop: false,\n initialSlide: 1,\n \n // hashNavigation: {\n // watchState: true,\n // },\n \n // If we need pagination\n pagination: {\n el: '.swiper-pagination',\n },\n \n breakpoints: {\n 500: {\n initialSlide: 1,\n spaceBetween: 30\n },\n 768: {\n slidesPerView: 3,\n initialSlide: 0,\n centeredSlides: false,\n loop: false,\n spaceBetween: 0\n }\n }\n });\n\n // USP slider\n const uspSwiper = new Swiper(\".usp-slider\", {\n slidesPerView: 1,\n loop: true,\n spaceBetween: 0,\n effect: 'fade',\n fadeEffect: {\n crossFade: true\n },\n autoplay: {\n delay: 1500,\n },\n \n breakpoints: {\n 501: {\n slidesPerView: 5\n }\n }\n });\n\n const animalSlider = document.querySelector('.animal-slider');\n const blogSlider = document.querySelector('.blog-slider');\n const circleSlider = document.querySelector('.circle-slider');\n const uspSlider = document.querySelector('.usp-slider');\n\n if (width > 768) {\n animalSwiper.destroy();\n blogSwiper.destroy();\n circleSwiper.destroy();\n uspSwiper.destroy();\n\n animalSlider.classList.add('destroyed');\n blogSlider.classList.add('destroyed');\n circleSlider.classList.add('destroyed');\n uspSlider.classList.add('destroyed');\n } else if (width > 500) {\n uspSwiper.destroy();\n circleSwiper.destroy();\n uspSlider.classList.add('destroyed');\n circleSlider.classList.add('destroyed');\n } else {\n animalSwiper.init();\n blogSwiper.init();\n circleSwiper.init();\n uspSwiper.init();\n\n animalSlider.classList.remove('destroyed');\n blogSlider.classList.remove('destroyed');\n circleSlider.classList.remove('destroyed');\n uspSlider.classList.remove('destroyed');\n }\n\n // if (width > 500) {\n \n // blogSwiper.destroy();\n // circleSwiper.destroy();\n // uspSlider.destroy();\n\n // blogSlider.classList.add('destroyed');\n // circleSlider.classList.add('destroyed');\n // uspSlider.classList.add('destroyed');\n\n // } else if (width > 991) {\n\n // animalSwiper.destroy();\n // animalSlider.classList.remove('destroyed');\n\n // } else {\n\n // animalSwiper.init();\n // blogSwiper.init();\n // circleSwiper.init();\n // uspSlider.init();\n\n // animalSlider.classList.remove('destroyed');\n // blogSlider.classList.remove('destroyed');\n // circleSlider.classList.remove('destroyed');\n // uspSlider.classList.remove('destroyed');\n // }\n}", "title": "" }, { "docid": "5bb16f9d2b5de9625ae31f53393c7e9e", "score": "0.5534319", "text": "function setupUI()\n{\n textSize(12)\n\n velocitySlider = createSlider(0, 15, 3.4, 0.01)\n velocitySlider.style('width', str(sliderWidth) + 'px')\n velocitySlider.position(firstSliderX, sliderY)\n\n forceSlider = createSlider(0, 5, 0.1, 0.0001)\n forceSlider.style('width', str(sliderWidth) + 'px')\n forceSlider.position(firstSliderX + sliderWidth + sliderSpacing, sliderY)\n\n alignmentSlider = createSlider(0, 2, 1.48, 0.0001)\n alignmentSlider.style('width', str(sliderWidth) + 'px')\n alignmentSlider.position(firstSliderX + 2 * (sliderWidth + sliderSpacing), sliderY)\n\n separationSlider = createSlider(0, 5, 2.0, 0.0001)\n separationSlider.style('width', str(sliderWidth) + 'px')\n separationSlider.position(firstSliderX + 3 * (sliderWidth + sliderSpacing), sliderY)\n\n cohesionSlider = createSlider(0, 2, 1.71, 0.0001)\n cohesionSlider.style('width', str(sliderWidth) + 'px')\n cohesionSlider.position(firstSliderX + 4 * (sliderWidth + sliderSpacing), sliderY)\n\n radiusASlider = createSlider(0, 200, 120, 1)\n radiusASlider.style('width', str(sliderWidth) + 'px')\n radiusASlider.position(firstSliderX + 5 * (sliderWidth + sliderSpacing), sliderY)\n\n radiusSSlider = createSlider(0, 200, 90, 1)\n radiusSSlider.style('width', str(sliderWidth) + 'px')\n radiusSSlider.position(firstSliderX + 6 * (sliderWidth + sliderSpacing), sliderY)\n\n radiusCSlider = createSlider(0, 200, 150, 1)\n radiusCSlider.style('width', str(sliderWidth) + 'px')\n radiusCSlider.position(firstSliderX + 7 * (sliderWidth + sliderSpacing), sliderY)\n\n showRadiusCheckbox = createCheckbox('Display Radius', false)\n showRadiusCheckbox.position(firstSliderX + 8 * (sliderWidth + sliderSpacing), sliderY)\n showRadiusCheckbox.changed(showRadiusCheckboxEvent)\n\n\n}", "title": "" }, { "docid": "cdab4a465650e6c6750792e1619b5938", "score": "0.5534149", "text": "function Slider({ selector, range: [min, max], value, inverseStepSize }) {\n const sliderDom = document.querySelector(selector);\n sliderDom.setAttribute('min', min * inverseStepSize);\n sliderDom.setAttribute('max', max * inverseStepSize);\n sliderDom.setAttribute('value', value * inverseStepSize);\n return {\n type: 'slider',\n range: [min, max],\n inverseStepSize,\n dom: sliderDom,\n // this will fire given a current value\n attachEvent(f) {\n sliderDom.addEventListener('input', function () {\n const val = Number(sliderDom.value);\n f(val / inverseStepSize);\n });\n },\n };\n}", "title": "" }, { "docid": "cf55113e0072232c9f5edec0e531de02", "score": "0.55334896", "text": "function addSlider(sliderInfo, element, callback){\n\t// Append the div element\n\telement.append('<span class=\"ui-label\">' + sliderInfo.label + ': </span>'\n\t\t\t+ '<span class=\"slider-data\" id=\"' + sliderInfo.id + '-data\">' + sliderInfo.initial + '</span>'\n\t\t\t+ '<div id=\"' + sliderInfo.id+ '\"></div>');\n\t\n\t// Create a temp var for the slider element\n\tvar mySlider = $(\"#\" + sliderInfo.id);\n\n\t// Init the slider\n\tmySlider.slider({\n\t\torientation : \"horizontal\",\n\t\trange : \"min\",\n\t\tmax : sliderInfo.range[1],\n\t\tslide : function(event){\n\t\t\tcallback();\n\t\t\t$(\"#\" + sliderInfo.id + \"-data\").text($(\"#\" + sliderInfo.id).slider('value'));\n\t\t},\n\t\tvalue : sliderInfo.initial ? sliderInfo.initial : 0\n\t});\n\n\t// Change the color\n\tmySlider.children(\".ui-slider-range\").css(\"background\", sliderInfo.color);\n}", "title": "" }, { "docid": "c3d53d55a7fc599b963bc64a47b48162", "score": "0.5528858", "text": "function setupUi() {\n\n // VOLUME\n if (_data.volume.file.length > 0) {\n\n // update threshold slider\n jQuery('#threshold-volume').dragslider(\"option\", \"max\", volume.max);\n jQuery('#threshold-volume').dragslider(\"option\", \"min\", volume.min);\n jQuery('#threshold-volume').dragslider(\"option\", \"values\",\n [volume.min, volume.max]);\n\n // update window/level slider\n jQuery('#windowlevel-volume').dragslider(\"option\", \"max\", volume.max);\n jQuery('#windowlevel-volume').dragslider(\"option\", \"min\", volume.min);\n jQuery('#windowlevel-volume').dragslider(\"option\", \"values\",\n [volume.min, volume.max/2]);\n\n volume.windowHigh = volume.max/2;\n\n // update 3d opacity\n jQuery('#opacity-volume').slider(\"option\", \"value\", 20);\n volume.opacity = 0.2; // re-propagate\n volume.modified();\n\n // update 2d slice sliders\n var dim = volume.range;\n\n // ax\n jQuery(\"#blue_slider\").slider(\"option\", \"disabled\", false);\n jQuery(\"#blue_slider\").slider(\"option\", \"min\", 0);\n jQuery(\"#blue_slider\").slider(\"option\", \"max\", dim[2] - 1);\n jQuery(\"#blue_slider\").slider(\"option\", \"value\", volume.indexZ);\n\n // sag\n jQuery(\"#red_slider\").slider(\"option\", \"disabled\", false);\n jQuery(\"#red_slider\").slider(\"option\", \"min\", 0);\n jQuery(\"#red_slider\").slider(\"option\", \"max\", dim[0] - 1);\n jQuery(\"#red_slider\").slider(\"option\", \"value\", volume.indexX);\n\n // cor\n jQuery(\"#green_slider\").slider(\"option\", \"disabled\", false);\n jQuery(\"#green_slider\").slider(\"option\", \"min\", 0);\n jQuery(\"#green_slider\").slider(\"option\", \"max\", dim[1] - 1);\n jQuery(\"#green_slider\").slider(\"option\", \"value\", volume.indexY);\n\n\n jQuery('#volume .menu').removeClass('menuDisabled');\n\n } else {\n\n // no volume\n jQuery('#volume .menu').addClass('menuDisabled');\n jQuery(\"#blue_slider\").slider(\"option\", \"disabled\", true);\n jQuery(\"#red_slider\").slider(\"option\", \"disabled\", true);\n jQuery(\"#green_slider\").slider(\"option\", \"disabled\", true);\n\n }\n\n // LABELMAP\n if (_data.labelmap.file.length > 0) {\n\n jQuery('#labelmapSwitch').show();\n\n jQuery('#opacity-labelmap').slider(\"option\", \"value\", 40);\n volume.labelmap.opacity = 0.4; // re-propagate\n\n\n } else {\n\n // no labelmap\n jQuery('#labelmapSwitch').hide();\n\n }\n\n\n // MESH\n if (_data.mesh.file.length > 0) {\n\n jQuery('#opacity-mesh').slider(\"option\", \"value\", 100);\n mesh.opacity = 1.0; // re-propagate\n\n mesh.color = [1, 1, 1];\n\n jQuery('#mesh .menu').removeClass('menuDisabled');\n\n } else {\n\n // no mesh\n jQuery('#mesh .menu').addClass('menuDisabled');\n\n }\n\n // SCALARS\n if (_data.scalars.file.length > 0) {\n\n var combobox = document.getElementById(\"scalars-selector\");\n combobox.value = 'Scalars 1';\n\n jQuery(\"#threshold-scalars\").dragslider(\"option\", \"disabled\", false);\n jQuery(\"#threshold-scalars\").dragslider(\"option\", \"min\",\n mesh.scalars.min * 100);\n jQuery(\"#threshold-scalars\").dragslider(\"option\", \"max\",\n mesh.scalars.max * 100);\n jQuery(\"#threshold-scalars\").dragslider(\"option\", \"values\",\n [mesh.scalars.min * 100, mesh.scalars.max * 100]);\n\n } else {\n\n var combobox = document.getElementById(\"scalars-selector\");\n combobox.disabled = true;\n jQuery(\"#threshold-scalars\").dragslider(\"option\", \"disabled\", true);\n\n }\n\n // FIBERS\n if (_data.fibers.file.length > 0) {\n\n jQuery('#fibers .menu').removeClass('menuDisabled');\n\n jQuery(\"#threshold-fibers\").dragslider(\"option\", \"min\", fibers.scalars.min);\n jQuery(\"#threshold-fibers\").dragslider(\"option\", \"max\", fibers.scalars.max);\n jQuery(\"#threshold-fibers\").dragslider(\"option\", \"values\",\n [fibers.scalars.min, fibers.scalars.max]);\n\n } else {\n\n // no fibers\n jQuery('#fibers .menu').addClass('menuDisabled');\n\n }\n\n // store the renderer layout\n _current_3d_content = ren3d;\n _current_Ax_content = sliceAx;\n _current_Sag_content = sliceSag;\n _current_Cor_content = sliceCor;\n\n\n if (!_webgl_supported) {\n\n\n\n }\n\n initialize_sharing();\n\n\n}", "title": "" }, { "docid": "96c25b1d5a540085ce4793005dd6a8e8", "score": "0.5527894", "text": "updateSliderState(index) {\n this.observable.update((state) => ({\n ...state,\n sliderState: {\n currPage: index\n }\n }))\n }", "title": "" }, { "docid": "2101dc6c91f9c3a31242e7df541d3cb4", "score": "0.5525508", "text": "function displayDroneSlider() {\n $('.slick-slider').css('height', '0px');\n initDroneSlider();\n $('.slick-slider').css('height', '');\n}", "title": "" }, { "docid": "2101dc6c91f9c3a31242e7df541d3cb4", "score": "0.5525508", "text": "function displayDroneSlider() {\n $('.slick-slider').css('height', '0px');\n initDroneSlider();\n $('.slick-slider').css('height', '');\n}", "title": "" }, { "docid": "c4ebc193aa5d8352dcb3a3b4764ce306", "score": "0.55208546", "text": "function buildSlider(container) {\n //initialize container\n slider.$container = $(container);\n\n //create wrapper\n slider.$wrapper = $('<div id=\"' + guid + '\" class=\"slide-wrapper\"/>')\n .delegate('div.slide-box', 'hover', slideEvent)\n .delegate('div.slide-nav-control', 'click', navEvent)\n .appendTo(slider.$container);\n\n if (settings.thumbs.slideOn) slider.$wrapper.delegate('div.slide-thumb', settings.thumbs.slideOn, thumbEvent);\n\n //create slider box\n slider.$slider = $('<div class=\"slide-box\"/>').appendTo(slider.$wrapper);\n\n //create navigation\n slider.$nav = $('<div class=\"slide-nav\"/>').toggle(settings.navigation.visible).appendTo(slider.$slider);\n\n slider.$nav.append('<div class=\"slide-nav-control slide-nav-back\">&nbsp;</div>');\n slider.$nav.append('<div class=\"slide-nav-control slide-nav-pause\">&nbsp;</div>');\n slider.$nav.append('<div class=\"slide-nav-control slide-nav-forward\">&nbsp;</div>');\n\n //create timer\n slider.$timer = $('<canvas class=\"slide-timer\"/>').toggle(settings.timer.visible).appendTo(slider.$slider);\n slider.timer = new $.OmniSlide.timer(settings.transition.wait, settings.timer, moveSlide, slider.$timer[0]);\n\n //create thumbnail wrapper\n var $tWrap = $('<div class=\"slide-thumbs-wrapper\"/>').toggle(settings.thumbs.visible).appendTo(slider.$wrapper);\n\n //create slides and thumbs\n $.each(slides, function (i, slide) {\n //create slide\n var $slide = $('<div class=\"slide\"/>'),\n $thumb = $('<div class=\"slide-thumb\"/>');\n\n //add slide content\n if (slide.image)\n $slide.css('background-image', 'url(' + slide.image + ')');\n if (slide.content)\n $slide.append($('<div class=\"slide-content\">' + slide.content + '</div>'));\n if (slide.title)\n $slide.append($('<h1 class=\"slide-title\" style=\"display:none;\">' + slide.title + '</h1>'));\n if (slide.overlay)\n $slide.append($('<div class=\"slide-overlay\" style=\"display:none;\">' + slide.overlay + '</div>'));\n\n\n //add thumbnail\n $thumb.append('<img class=\"slide-thumb-image\" src=\"' + slide.thumb + '\" alt=\"\"/>');\n $thumb.append('<span class=\"slide-thumb-title\">' + slide.title + '</span>');\n\n slider.$thumbs = slider.$thumbs.add($thumb);\n slider.$slides = slider.$slides.add($slide.hide());\n });\n slider.$slides.appendTo(slider.$slider);\n slider.$thumbs.appendTo($tWrap);\n\n //add theme class\n slider.$wrapper.find('*').andSelf().addClass(settings.theme);\n }", "title": "" }, { "docid": "64ce9967cb40ed58f741ee4eee1a400b", "score": "0.5519838", "text": "function setSlider(slider, label, min, max, unitaMisura, inputMin, inputMax) {\n min = (min) ? min : 0;\n max = (max) ? max : 100000;\n unitaMisura = (unitaMisura) ? unitaMisura : \"\";\n\n //alert(\"Slider: \" + slider + \" => Min: \" + min + \" Max: \" + max);\n\n $(slider).slider({\n range: true,\n min: min,\n max: max,\n values: [$(inputMin).val(), $(inputMax).val()],\n create: function (event, ui) {\n //$(label).text(unitaMisura + \" \" + $(inputMin).val() + \" - \" + unitaMisura + \" \" + $(inputMax).val());\n $(label).text(unitaMisura);\n },\n slide: function (event, ui) {\n //$(label).text(unitaMisura + \" \" + ui.values[0] + \" - \" + unitaMisura + \" \" + ui.values[1]);\n $(inputMin).val(ui.values[0]);\n $(inputMax).val(ui.values[1]);\n }\n });\n}", "title": "" }, { "docid": "c3cb1693101e84375a4c37a09532288a", "score": "0.55162174", "text": "function initWhizzleSlider(whizzleSlider, initMin, initMax, initStep, initValue)\r\n{\r\n // NOTE THAT .slider IS A JQuery METHOD FOR THE CUSTOM\r\n // JQuery UI SLIDER COMPONENT\r\n whizzleSlider.slider();\r\n whizzleSlider.slider({ min: initMin });\r\n whizzleSlider.slider({ max: initMax });\r\n whizzleSlider.slider({ step: initStep });\r\n whizzleSlider.slider({ value: initValue }); \r\n}", "title": "" }, { "docid": "2e580f410419c64b7d0e58a7b8e92303", "score": "0.5511593", "text": "function makeslider(id, orientation, handler, min, max, value, step) \n{\n\tvar slider = document.createElement('input');\n\tslider.id = id;\n\tslider.type\t= \"range\";\n\tslider.min = min;\n\tslider.max = max;\n\tslider.value = value;\n\tslider.step = step;\n\n\tvar valId = \"v\"+id;\n\tvar textval = document.createElement('input');\n\ttextval.id = valId;\n\ttextval.type = \"text\";\n\ttextval.value = value;\n\ttextval.size = 6;\n \n\ttextval.onchange = function() { $(\"#\"+id).val(this.value); handler(this.value); };\n\tslider.onchange = function() { $(\"#\"+valId).val(this.value); handler(this.value); };\n\tslider.fTextValue = textval;\n\treturn slider;\n}", "title": "" } ]
4922c14349191dcf74b19020fa27e712
Elimina il messaggio aperto
[ { "docid": "5584124057c80249ae4fc9716e18ddae", "score": "0.5618131", "text": "function inboxDeleteOpenedMessage(){\n\tnavigator.notification.confirm('Il messaggio verrà cancellato.\\nSei sicuro?', function(button){\n if (button == 1) {\n var l_active_message = $('.inbox_list_container_box_active');\n\t\t if (l_active_message.length > 0) {\n\t\t var l_active_message_id = l_active_message[0].id.substring(25);\n\t\t \n\t\t if (_INBOX_MESSAGES['mid_' + l_active_message_id]) {\n\t\t \t/*\n\t\t if (!_INBOX_MESSAGES[l_active_message_id].body) {\n\t\t markMessagesAsRead([l_active_message_id]);\n\t\t }\n\t\t */\n\t\t deleteLocalMessages([l_active_message_id]);\n\t\t }\n\t\t \n\t\t //$('#inbox_msg_container').css('display', 'none');\n\t\t\t\tinboxCloseMsgView();\n\t\t l_active_message.remove();\n\t\t }\n }\n }, 'Cancellazione messaggio', 'Si,No');\n}", "title": "" } ]
[ { "docid": "6408efc7441e1e093cd0bd1b2a2e8c57", "score": "0.7371141", "text": "function clean (message) {\n if (message.length == 1){\n if (message[0].charAt(0) == config.prefix) \n message[0] = message[0].slice(1);\n\n } \n let cleanPerm = new Discord.RichEmbed()\n .setTitle(\"Réponse de la commande :\")\n .setColor(\"#bc0000\")\n .addField(\":x: Tu n'as pas le droit de suprimer des messages !\", \"👮 Bien essayer en tous cas.(Auto-destruction du message dans 20s.)\")\n message.delete().catch(O_o=>{});\n\n if (!message.channel.permissionsFor(message.author).hasPermission(\"MANAGE_MESSAGES\")) {\n message.channel.sendMessage(cleanPerm).then(message => {message.delete(12000)});\n console.log(\"Désolé, vous n'avez pas la permission d'exécuter la commande \\\"\"+message.content+\"\\\"\");\n return;\n }\n\n if (message.channel.type == 'text') {\n message.channel.fetchMessages()\n .then(messages => {\n message.channel.bulkDelete(messages);\n messagesDeleted = messages.array().length;\n\n let messageyes = new Discord.RichEmbed()\n .setTitle(\"Réponse de la commande :\")\n .setColor(\"#15f153\")\n .addField(\":white_check_mark: Suppression des messages réussie. Nombre total de messages supprimés:\", +messagesDeleted)\n //.addField(\":white_check_mark: Suppression des messages réussie. Nombre total de messages supprimés:\" +messagesDeleted \"!\", ${message.author})\n message.delete().catch(O_o=>{});\n\n\n message.channel.sendMessage(messageyes).then(message => {message.delete(6000)});\n console.log('Suppression des messages réussie. Nombre total de messages supprimés '+messagesDeleted)\n })\n .catch(err => {\n console.log('Erreur lors de la suppression en bloc');\n console.log(err);\n });\n }\n }", "title": "" }, { "docid": "249542008e2d1f099cdbd15c0beb27bb", "score": "0.66839856", "text": "function eliminaMessaggi() {\n\t\talertErrori.slideUp();\n\t\talertWarning.slideUp();\n\t\talertSuccess.slideUp();\n\t}", "title": "" }, { "docid": "ef549f11b14afa17e5a43f099261f873", "score": "0.66535425", "text": "removeMessage(index) {\n let conferma = confirm(\"Sei sicuro di voler cancellare il messaggio?\");\n if (conferma) {\n this.contacts[this.counter].messages.splice(index, 1);\n } else {\n this.contacts[this.counter].messages[index].visibility = \"none\";\n\n }\n }", "title": "" }, { "docid": "9505a30b21f4fd99ca50acc754e5235d", "score": "0.66041213", "text": "function clearMessages() {\n\n}", "title": "" }, { "docid": "5236c9945bf23e8489ba76323bd7a231", "score": "0.65189123", "text": "function remove(textToFilter) {\n let msgArray = message.toLowerCase().split(\" \");\n const index = msgArray.indexOf(textToFilter);\n if (index !== -1) {\n msgArray.splice(index, 1);\n return msgArray.join(\" \");\n }\n }", "title": "" }, { "docid": "d8ce1ca85ddc97330b805ec16093e819", "score": "0.6518417", "text": "clearMessages() {}", "title": "" }, { "docid": "89b92c234c16aa3ca1e7240012caf6ef", "score": "0.646342", "text": "deleteMessaggio(index){\n const eliminazioneDefinitiva = confirm(\"Elininare messagio?\");\n if(eliminazioneDefinitiva == true){\n this.messaggiEliminati.push(this.conversazione[index])\n this.conversazione.splice(index,1);\n // Chiudo dropdown\n this.show = null;\n }\n }", "title": "" }, { "docid": "54456e4d200bc7fbe85d8ecae9a4a87c", "score": "0.6457687", "text": "function removeMessage(){\r\n $(\"#message\").html(\"\");\r\n }", "title": "" }, { "docid": "e24d925807dda7f73cc9c3ce1407ed74", "score": "0.6439911", "text": "function hideMessage() {\n $converting.text(\"\");\n }", "title": "" }, { "docid": "ad333bf8332d4bcfb8297af367aa8b3c", "score": "0.6402105", "text": "function notificationClean (message){\n comicsNotification.innerText = \"\";\n comicsNotification.innerText = `${message}`;\n}", "title": "" }, { "docid": "9e3921d59bf3a3fd2a2bee9b132f36a8", "score": "0.63734514", "text": "function inviaMessaggio() {\n // creo una variabile per andare a leggere il contenuto della value del input, selezioni la classe di questo input e con .val(), vuoto all'interno mi permette di leggere quello che io scrivo\n var testoMessaggio = $('.message-user').val();\n // faccio un controllo per capire se la lunghezza di quello che sto scrivendo è diverso da zero, così cliccando sulla icona di invio non mi spunta nessuna casela del messaggio vuota\n // invece se la lunghezza è diversa da zero\n if (testoMessaggio.length != 0) {\n // creo una variabile per clonare il template del messaggio, cosi facendo vado a lavorare su quello specifico template\n var nuovoMessaggio = $('.template .message').clone();\n // con children selezione lo span con la classe .message-text e con .text vado a modificare il testo dello span sostuuendolo con la variabile testoMessaggio che leggerà dentro il mio valore del'input\n nuovoMessaggio.children('.message-text').text(testoMessaggio);\n // aggiungo la classe .sent che ha il float right, il background verde\n nuovoMessaggio.addClass('sent');\n // aggiungo questo messaggio al suo container con la funzione append\n $('.messages.active').append(nuovoMessaggio);\n // e infine vado a rempostare il valore del mio input con una stringa vuota\n $('.message-user').val('');\n\n // setTimeout(function() {\n // if ($('.messages').hasClass('active')) {\n // $('.header-right').find('p').text('Online');\n // } else {\n // $('.header-right').find('p').text();\n // }\n // }, 400)\n //\n // setTimeout(function() {\n // if ($('.messages').hasClass('active')) {\n // $('.header-right').find('p').text('Sta scrivendo...');\n // } else {\n // $('.header-right').find('p').text();\n // }\n // }, 1000);\n\n // imposto un timeout per la risposta del computer;\n setTimeout(rispostaComputer, 2000);\n // quando io scrivo nela chat, la chat attiva si posizione nella prima posizione\n $('.chat.active').prependTo('.container-chat');\n // vado a trovare nelle chat il messaggio che io ho scritto e lo vado a sostituire nel p\n $('.chat.active .name-message').find('p').text(testoMessaggio);\n // vado a selezionare lo span del tempo nel mio template e gli scrivo il tempo reale\n nuovoMessaggio.children('.message-time').text(tempoReale());\n // riporto il tempo reale sulla chat a sinistra al mio invio del messaggio\n $('.chat.active .clock').text(tempoReale());\n }\n}", "title": "" }, { "docid": "460417b11e5fd6e53789fdaeb2b4adee", "score": "0.63359714", "text": "limpiarMensaje() {\n const alert = document.querySelector(\".alert\");\n\n if (alert) {\n alert.remove();\n }\n }", "title": "" }, { "docid": "d13fad5c69ca1dfa9654ae2d489196a3", "score": "0.63166666", "text": "function inviaMessaggio(messaggioDigitato) {\r\n // Clono il template del messaggio\r\n var clonePTemplate = $('.template .with-dropdown').clone();\r\n // Aggiungo il messaggio digitato dall'utente al template\r\n clonePTemplate.prepend(messaggioDigitato);\r\n // Aggiungo l'ora attuale al messaggio\r\n clonePTemplate.children('.time').text(time());\r\n // Aggiungo la classe per la formattazione stilistica al messaggio\r\n clonePTemplate.addClass('sent');\r\n // Inserisco il messaggio completo nella finestra di chat attiva\r\n $('.chat .d-flex').append(clonePTemplate);\r\n // Imposto lo scroll automatico della finestra attiva per avere il focus sempre sull'ultimo messaggio inviato\r\n $('.chat .d-flex').scrollTop($('.chat .d-flex').prop('scrollHeight'));\r\n // Resetto la barra dell'input\r\n $('#writeMessage').val('');\r\n}", "title": "" }, { "docid": "c738f634e3768972b652ca46211ce3ba", "score": "0.63110816", "text": "function riceviMessaggio() {\r\n // Clono il template del messaggio\r\n var clonePTemplate = $('.template .with-dropdown').clone();\r\n // Creo il messaggio di risposta\r\n var message = ('Ok');\r\n // Aggiungo il messaggio al template\r\n clonePTemplate.prepend(message);\r\n // Aggiungo l'ora attuale al messaggio\r\n clonePTemplate.children('.time').text(time());\r\n // Aggiungo la classe per la formattazione stilistica al messaggio\r\n clonePTemplate.addClass('received');\r\n // Inserisco il messaggio completo nella finestra di chat attiva\r\n $('.chat .d-flex').append(clonePTemplate);\r\n // Imposto lo scroll automatico della finestra attiva per avere il focus sempre sull'ultimo messaggio ricevuto\r\n $('.chat .d-flex').scrollTop($('.chat .d-flex').prop('scrollHeight'));\r\n // Cambio l'orario dell'ultimo accesso nella barra account\r\n $('#contactView .details span').text('Ultimo accesso oggi alle ' + time());\r\n}", "title": "" }, { "docid": "6027aa7e721f927c877cfdd60ca21b4a", "score": "0.62920344", "text": "function clear_message_style()\n{\n\tvar frameDoc = get_frame();\n\t$(\".UD\", frameDoc).first().attr(\"style\", \"\");\n\t$(\".UB\", frameDoc).first().attr(\"style\", \"\");\n\t$(\".vh\", frameDoc).first().not(\".boomerang\").attr(\"style\", \"\");\n}", "title": "" }, { "docid": "657c8fe72e2c687f9a1f4b5f1acf0806", "score": "0.62834024", "text": "function risposta() {\n var listaRisposte = [\n \"If anyone asks where I am, I’ve left the country.\",\n \"If we’re both going crazy, then we’ll go crazy together, right?\",\n \"The campaign took two weeks to plan. How was I supposed to know it was going to take ten hours?\",\n \"Maybe you thought you were helping, but you weren’t. You hurt me, do you understand? What you did sucks.\",\n \"We’re not even in the game; we’re on the bench.\",\n \"Hey, if we’re both going crazy, we’ll go crazy together, right?\",\n \"Do you want to figure it out?\"\n ]\n\n var index = randomNumber(0,6);\n var testo = listaRisposte[index];\n\n // clono il template del messaggio\n var messaggio = $('.template .message').clone();\n\n //incollo tutti i dati estrapolati nel template clonato\n messaggio.find('.message-text').append(testo);\n messaggio.find('small').append(oraEsatta());\n messaggio.addClass('received');\n //incollo il template clonato messaggio riempito nel message box\n $('.messages-box.active').append(messaggio);\n\n //applico un'anteprima dell'ultimo msg + l'ora esatta invio\n //nella lista chat di sx come ultima interazione\n if (testo.length < 50){\n var previewText = testo;\n } else {\n var previewText = testo.substring(0,49) + '...';\n }\n\n $('.ct-box.active .last-msg').text(previewText);\n $('.ct-box.active small').text(oraEsatta());\n}", "title": "" }, { "docid": "ce4b5fbb859a9404cda80122cc558313", "score": "0.6268991", "text": "function prune() {\r\n // IDEA: Only delete messages sent by current user? Use other bot validation...\r\n message.channel.fetchMessages()\r\n .then(messages => {\r\n let message_array = messages.array();\r\n message_array.length = 10;\r\n message_array.map(msg => msg.delete().catch(console.log)); //.error\r\n })\r\n .catch(console.log); //.error\r\n }", "title": "" }, { "docid": "084e2d77a217ca6a30d816d16caf7d65", "score": "0.6253087", "text": "function clean(){//Esta funciòn busca el contenedor sobre el cual va a limpiar el elemnto, llamese PADRE \n\tvar container = document.getElementById(\"comment-appear\");\n\tcontainer.innerHTML = \"\";\n}", "title": "" }, { "docid": "fca3583964745407cb66883f549df2c3", "score": "0.6231326", "text": "cleanMessages() {\n this.alert.clearAll();\n }", "title": "" }, { "docid": "fca3583964745407cb66883f549df2c3", "score": "0.6231326", "text": "cleanMessages() {\n this.alert.clearAll();\n }", "title": "" }, { "docid": "e27228c5d7cb28f97081146484874c3c", "score": "0.62098414", "text": "cleanInputMsg() {\n this.newMsg = '';\n }", "title": "" }, { "docid": "c77f15c6498829d2341516390ada5954", "score": "0.6163845", "text": "function eliminarMensaje2() {\n document.getElementById('mostrar').innerHTML=\"\";\n document.getElementById('mensaje2').innerHTML=\"\";\n ocultarMensaje();\n }", "title": "" }, { "docid": "d86685714de6a1d83bc3202daf371936", "score": "0.6151801", "text": "function clearMessage() {\r\n var ele = b.g(_messageContainerId);\r\n if (ele === null) return;\r\n b.hide(ele);\r\n ele.innerHTML = \"\";\r\n _messageTimer = null;\r\n _messageContainerId = \"\";\r\n }", "title": "" }, { "docid": "7e15fe6a7ab71016589671a42ba73749", "score": "0.6142125", "text": "function destinatacioMsg(user){\n console.log(\"Cambiar destinatario: \"+user);\n let formDom = document.querySelector('#bar-msg')\n formDom.action = 'javascript:enviarMsg(\"'+ user + '\")';\n var node = document.querySelector('#historial-msg')\n while (node.firstChild) {\n node.removeChild(node.firstChild);\n }\n}", "title": "" }, { "docid": "01f0553aa1458bc2697ab051d65c7d00", "score": "0.613035", "text": "function clear_messages() {\n $('.messages').hide().html('').removeClass('info').removeClass('error').removeClass('mixed');\n}", "title": "" }, { "docid": "7f7a0f1a87798d0b030a5600364e1821", "score": "0.6098944", "text": "function cleanse(message) {\r\n var n = document.createElement(\"DIV\");\r\n n.innerText = message;\r\n return n.innerHTML;\r\n }", "title": "" }, { "docid": "2deef55bc50cc3a24ed6e6798f7c98d8", "score": "0.6087362", "text": "function aggiungiMessaggio() {\n var testo = $('#add-message').val();\n //check per inibire l'invio di msg vuoti\n if(testo != 0){\n //salvo il testo inviato e poi cancello l'input post invio\n // var testo = $('#add-message').val();\n $('#add-message').val('');\n\n //clono il template del messaggio\n var messaggio = $('.template .message').clone();\n\n // incollo i dati estrapolati nel template clonato\n messaggio.find('.message-text').append(testo);\n messaggio.find('small').append(oraEsatta());\n messaggio.addClass('sent');\n //incollo il template clonato messaggio riempito nel message box\n $('.messages-box.active').append(messaggio);\n\n //applico un'anteprima dell'ultimo msg + l'ora esatta invio\n //nella lista chat di sx come ultima interazione\n if (testo.length < 50){\n var previewText = testo;\n } else {\n var previewText = testo.substring(0,49) + '...';\n }\n\n $('.ct-box.active .last-msg').text(previewText);\n $('.ct-box.active small').text(oraEsatta());\n\n //dopo 1 secondo attiva la funzione risposta()\n setTimeout(risposta, 1000);\n }\n}", "title": "" }, { "docid": "3fce4d6d80a5fcac612c8c4af8c00638", "score": "0.6086034", "text": "function sup_message() {\n\tinit();\n\tsuppression_message(environnement.clef);\n}", "title": "" }, { "docid": "00a273cfb3f2baf2e3768ffd3d957fef", "score": "0.6072669", "text": "function removeMentions(msg)\n{\n\tconst mention = `<@${client.user.id}>`;\n\treturn msg.replace(new RegExp(mention, \"g\"), \"\");\n}", "title": "" }, { "docid": "421500b266a442692d6bb6559a371174", "score": "0.60654134", "text": "function remove_dm_field(elem, e) {\n\te.preventDefault();\n\t\n\t$(elem).parent('span').remove();\n\tvar dm_msg = new Array(\n\t\t'The second message would be sent 3 days after the target profile has followed you.',\n\t\t'The third message would be sent 7 days after the target profile has followed you.',\n\t\t'The fourth message would be sent 15 days after the target profile has followed you.'\n\t);\n\t$('.dm-msg').each(function(index, element) {\n $(element).text(dm_msg[index]);\n });\n}", "title": "" }, { "docid": "6c305947b82dcd80bcdc895a0540e957", "score": "0.6054849", "text": "function cleanup_messages() {\n // let's get rid of some of these DOM children so we don't have thousands hanging around\n var messages_children = messages_element.children();\n var messages_length = messages_children.length;\n if (messages_length > messages_before_culling) {\n var messages_to_remove = messages_length - messages_before_culling;\n for (var i = 0; i < messages_to_remove; i++) {\n messages_children[i].remove();\n }\n }\n}", "title": "" }, { "docid": "d8bd4319ad37a6d7d611adac9e1c320c", "score": "0.60467154", "text": "function removeDefaultColorMessage(){\n\tlet defaultMessage = document.querySelector(\"#defaultMessage\");\n\tdefaultMessage ? defaultMessage.remove() :'';\n}", "title": "" }, { "docid": "98282985cc30579c8f7e3347312d978d", "score": "0.6043563", "text": "function removeErrorMessage() {\n $('.aui-message').remove();\n }", "title": "" }, { "docid": "31bab52b4d8fee0cb07514e74d320583", "score": "0.6038866", "text": "function addCleansedMessageTo(paginationDiv) {\r\n\tvar cleansedMessage = document.createElement('div');\r\n\tcleansedMessage.id = \"cleansedMessage\";\r\n\tcleansedMessage.innerHTML = \"arındırıldı\";\r\n\tcleansedMessage.setAttribute(\"class\", \"cleansedMessage\");\r\n\tcleansedMessage.addEventListener(\"click\", function() {\r\n\t\tvar m = document.getElementById(\"cleansedMessage\");\r\n\t\tif (m.innerHTML == \"arındırıldı\") {\r\n\t\t\tvar blacks = document.getElementsByClassName(\"black\");\r\n\t\t\tfor (var i = blacks.length -1; i >= 0; --i) \r\n\t\t\t\tblacks[i].className = blacks[i].className.replace('black', 'white');\r\n\t\t\tm.innerHTML = \"arındırılmadı\";\r\n\t\t}\r\n\t\telse {\r\n\t\t\tvar whites = document.getElementsByClassName(\"white\");\r\n\t\t\tfor (var i = whites.length -1; i >=0 ; --i)\r\n\t\t\t\twhites[i].className = whites[i].className.replace('white', 'black');\r\n\t\t\tm.innerHTML = \"arındırıldı\";\r\n\t\t}\r\n\t}, false);\r\n\tpaginationDiv.appendChild(cleansedMessage);\r\n}", "title": "" }, { "docid": "73205d470928f76de2cf91d00300930d", "score": "0.60318935", "text": "function desenhaMensagem () {\n context.font = 'bold 14px serif';\n context.fillStyle = \"white\";\n //context.clearRect(txtMX, txtMY-15, tamX, tamY);\n context.fillRect(txtMX, txtMY-15, tamX, tamY);\n context.fillStyle = \"black\"; //\"white\";\n context.fillText(\" \" + mensagem, txtMX, txtMY);\n roundRect(context, txtMX, txtMY-15, tamX, tamY);\n }", "title": "" }, { "docid": "626625e28ea264c7bf60db1a3f8973d8", "score": "0.60305655", "text": "function inviaMessaggioDue() {\n risposta = $('.msg').val();\n if (risposta.length != 0) {\n // Chiamo la funzione per il calcolo dell'orario di invio del messaggio\n var orarioInvio = oraInvio();\n // Preparo le variabili da sostituire nel template\n var variabili = {\n 'testo': risposta,\n 'tempo': orarioInvio,\n 'direzione': 'spedito verde'\n };\n var nuovo_messaggio = template_function(variabili);\n // Clono il template del messaggio\n /*var nuovo_messaggio = $('.template .messaggio').clone();\n // Inserisco nello span corretto il testo del messaggio\n nuovo_messaggio.children('.messaggio-testo').text(risposta);\n // Inserisco nell'elemento small l'orario in cui viene inviato il messaggio\n nuovo_messaggio.children('.messaggio-tempo').text(orarioInvio);\n // Aggiungo le classi corrette al div messaggio\n nuovo_messaggio.addClass('spedito verde');\n */\n // Inserisco il messaggio all'interno del container\n $('.chat.attivo').append(nuovo_messaggio);\n // Risposta del pc coon scritto ok mandata dopo 1 secondo\n tempoRisposta();\n $('.msg').val('');\n\n // Fissiamo la scrollbar in basso nell'area messaggio\n }\n }", "title": "" }, { "docid": "93826c54afc835cb2d4f3a6c836b639e", "score": "0.6030385", "text": "function clearChatMessages() {\n chatMessages.html('');\n}", "title": "" }, { "docid": "9edc5f21969eeaf3e7fb54e0f915092b", "score": "0.6001066", "text": "function clearMessage() {\n userWarning.innerHTML = \"\";\n passWarning.innerHTML = \"\";\n accountNotify.innerHTML = \"\";\n}", "title": "" }, { "docid": "750964bb50755962bb140322c1549378", "score": "0.59993577", "text": "function clearChatMessages() {\n $('div[id^=\"chat-bubble-\"]').each(function(i, value) {\n value.remove();\n });\n $('div[id^=\"msg-detail-\"]').each(function(i, value) {\n value.remove();\n });\n}", "title": "" }, { "docid": "992e8122fccddb3403183ddb9b81102b", "score": "0.5979686", "text": "_deleteFormMessage(targetForm){\n const messageContainer = targetForm.querySelector(\".form__message__container\");\n while(messageContainer.firstChild){\n messageContainer.removeChild(messageContainer.firstChild);\n }\n \n }", "title": "" }, { "docid": "81e17d421ecdfe6f86ece7dc363baf40", "score": "0.59721994", "text": "function messageErreur(message){\n\t//--Effacement du message précédent\n\tvar noeud = document.getElementById('divMessageErreur');while (noeud.firstChild){noeud.removeChild(noeud.firstChild);}\n\t//--Création du texte\n\tdocument.getElementById('divMessageErreur').appendChild(document.createTextNode(message));\n\t//--Apparition de la div erreur\n\tdocument.getElementById('divMessageErreur').style.display = 'block';\n}", "title": "" }, { "docid": "3ef20b394bff5d961182d36f771f1ef8", "score": "0.59674853", "text": "function clearMessages() {\n const messagesElement = document.querySelector('#messages');\n while (messagesElement.hasChildNodes()) {\n messagesElement.removeChild(messagesElement.lastChild);\n }\n }", "title": "" }, { "docid": "114a54ee5d00387758a0b88812f78c1f", "score": "0.59608686", "text": "function getMessageComplement(obj){\n if (obj.text === 'entra na sala...') return 'entra na sala...';\n if (obj.text === 'sai da sala...') return 'sai da sala...';\n let placeholder = ' ';\n if (obj.type === 'private_message'){\n placeholder = 'reservadamente ';\n } \n const complement = \n `\n ${placeholder}para&nbsp;\n <span onclick='setTargetOnClick(this)' class=\"target\">${obj.to}</span>:&nbsp;\n ${obj.text}\n `\n return complement;\n}", "title": "" }, { "docid": "98557e9907a9c384820d96aad5a1da00", "score": "0.596082", "text": "function newMessage(){\n\tmessage.innerHTML = \"\";\n}", "title": "" }, { "docid": "69ea4e60bc48c41d386773598bbcfa8b", "score": "0.5936617", "text": "function eliminarMensaje1() {\n document.getElementById('mostrar').innerHTML=\"\";\n document.getElementById('mensaje1').innerHTML=\"\";\n ocultarMensaje()\n}", "title": "" }, { "docid": "ddee47e7242f913225da9aba1daeac93", "score": "0.59325165", "text": "function removeMessages()\n{\n\t\t// Forms related errors\n\t\tvar formErrMsg = document.getElementById(\"formMsg\");\n\t\tif(formErrMsg !== null)\n\t\t\tformErrMsg.remove();\n\n\t\t// Server related errors\n\t\tvar errMsg = document.getElementById(\"errMsg\");\n\t\tif(errMsg !== null)\n\t\t\terrMsg.remove();\n\t\n}", "title": "" }, { "docid": "adc23e330f850da5daba14530eea7b5d", "score": "0.5927123", "text": "function removeErrorMessages() {\n\tfor (var i=0; i<document.getElementsByTagName(\"P\").length; i++) {\n\t\tdocument.getElementsByTagName(\"P\")[i].innerHTML = \"\";\n\t}\n}", "title": "" }, { "docid": "e379d9c9240ca9cdb5c76c7a6602e167", "score": "0.59243464", "text": "function suppression_message(clef) {\n\t$.ajax({\n\t\ttype : \"GET\",\n\t\turl : \"/COQUART/DeleteCesStatut\",\n\t\tdata : \"clef=\" + clef,\n\t\tdataType : \"json\",\n\t\tsuccess : function() {\n\t\t\t$(\"#rep_sup_message\").html(\"Message supprime\");\n\t\t},\n\t\terror : function(XHR, testStatus, errorThrown) {\n\t\t\talert(XHR + \"\" + testStatus + \"\" + errorThrown);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "a8822ab3f1a60fd5ca079400365b8637", "score": "0.58990914", "text": "function clearMessage()\n{\n\tdisplayMessage('');\n}", "title": "" }, { "docid": "afff2c231c4c2cdd8f96bef5bf1624d9", "score": "0.58984274", "text": "masquer_erreur()\n {\n this.texte_erreur.text(\"\");\n this.div_erreur.css(\"display\", \"none\");\n }", "title": "" }, { "docid": "b99cb80ae53805ce10677bfc571033bc", "score": "0.5889675", "text": "function clearMessages() {\n setMessages({})\n setShow(false)\n }", "title": "" }, { "docid": "1ac0e935ee686a39a04612c3e34b9c35", "score": "0.5882635", "text": "discard() {\n if (this.discussAsReplying) {\n this.discussAsReplying.clearReplyingToMessage();\n }\n }", "title": "" }, { "docid": "58b85c382a351c538de4d10576099751", "score": "0.5878426", "text": "function rispostaRicevuta(){\r\n // creo la variabile che contiene il blocco html da stampare\r\n var messaggioRicevuto =$(\r\n \"<div class='messaggio ricevuto'>\" +\r\n \"<span class=\\\"testo-messaggio\\\"></span>\"+\r\n \"<span class=\\\"freccetta-info\\\"><i class=\\\"fas fa-chevron-down\\\"></i></span>\"+\r\n \"<span class=\\\"orario-messaggio\\\"></span>\" +\r\n \"<ul class='box-opzioni-messaggio'>\"+\r\n \"<li id='info-messaggio'>Info messaggio</li>\"+\r\n \"<li id='cancella-messaggio'>Cancella messaggio</li>\"+\r\n \"</ul>\"+\r\n \"</div>\");\r\n // richiamo la funzione globale per aquisire il tempo macchina\r\n time();\r\n // vado a modificare il contenuto del nuovo blocco html creato agendo sulle classi dei figli\r\n messaggioRicevuto.children(\".testo-messaggio\").text(\"ok\");\r\n messaggioRicevuto.children(\".orario-messaggio\").text(time);\r\n $(\".box-chat.active\").append(messaggioRicevuto);\r\n $(\"#ultimo-accesso\").text(\"Ultimo accesso oggi alle \" + time());\r\n}", "title": "" }, { "docid": "da2ee1898da48b69ff83ff6a37a55d15", "score": "0.58772594", "text": "function clearMessages() {\n $(\"#messages\").children().remove();\n}", "title": "" }, { "docid": "e8886850f8dafed868a3b7e71912ae3d", "score": "0.58717924", "text": "function cleanMessageInput () {\n $(\".message-text\").val('');\n }", "title": "" }, { "docid": "7fd75f5a5e6d4884dec963cfd6bf3df5", "score": "0.58606285", "text": "clearPinMessage() {\n if ( this.pinnedMsg ) {\n this.messageUI.removeChild( this.pinnedMsg );\n this.pinnedMsg = null;\n }\n }", "title": "" }, { "docid": "690f384bce766173d2d861a0fa2eb031", "score": "0.58605915", "text": "function riceviMessaggi() {\n var messaggioAuto = $('.messaggi-sinistra-template .messaggio-text-bianco-template').clone();\n messaggioAuto.children('.testo-messaggio').text('ciao');\n messaggioAuto.children('.orario').text(orario);\n $('.contenitore-messaggi.active').append(messaggioAuto);\n scroll();\n }", "title": "" }, { "docid": "62b8823c99a811368c6b9f96adbf60c5", "score": "0.5854303", "text": "function removeMessage() //Function to make sure after message is delivered it will reset to wait for next request response\n {\n setMessage(undefined)\n }", "title": "" }, { "docid": "abf87b5d2b7357d00856b0ddc7e15daa", "score": "0.5853183", "text": "function beautifyChatMessages() {\n var beautiful_chat_messages = [];\n var message = vm.chat_messages[0];\n var buffer = vm.chat_messages[0].message;\n\n for (var i = 1; i < vm.chat_messages.length; i++) {\n if (vm.chat_messages[i].user._id === message.user._id) {\n // append current message to the end of the previous message\n buffer += '\\n' + vm.chat_messages[i].message;\n } else {\n // on person change\n message.message = buffer;\n beautiful_chat_messages.push(message);\n message = vm.chat_messages[i];\n buffer = vm.chat_messages[i].message;\n }\n }\n\n if (buffer !== '') {\n message.message = buffer;\n beautiful_chat_messages.push(message);\n }\n vm.chat_messages = beautiful_chat_messages;\n }", "title": "" }, { "docid": "14a3a9b346a5f0d6e9501f98a9b6b705", "score": "0.5846173", "text": "function clearTrackedMessages() {\n trackedMessages.forEach(el => {\n el[0].classList.remove('tch-highlighted-message');\n if (trackBar)\n trackBar.removeChild(el[2]);\n });\n trackedMessages = [];\n trackedIndex = 0;\n}", "title": "" }, { "docid": "36cfbdb741351e17bdcf0d7b6e3bef35", "score": "0.58398485", "text": "function cerrarEmergente() {\n $('.ventanaMensaje').remove();\n}", "title": "" }, { "docid": "ddf4e25faee183088c91af7210282430", "score": "0.5835523", "text": "async function cleanCommand(currMsg) {\n currMsg = currMsg.slice(0, currMsg.indexOf(\" \"));\n if(currMsg[currMsg.length-1] === ';')\n currMsg = currMsg.substr(0, currMsg.length-1);\n return currMsg;\n}", "title": "" }, { "docid": "908d76d0699d4834997f4850f10591d5", "score": "0.5825885", "text": "function cleanAllMsg() {\n\t$(\"#successMsgId\").html(\"\");\n\t$('#deleteSuccessMsgId').html(\"\");\n\t$('#deleteSelectedSuccessMsgId').html(\"\");\n\t$('#groupName_err').html(\"\");\n\t$('#departmentNameId_err').html(\"\");\n}", "title": "" }, { "docid": "3e4f3aaab5cc984538c3404b1215c500", "score": "0.5821726", "text": "function inviaRispostaDue() {\n // Chiamo la funzione per il calcolo dell'orario di invio del messaggio\n var orarioRisposta = oraInvio();\n // Preparo le variabili da sostituire nel template\n var variabili = {\n 'testo': 'ok',\n 'tempo': orarioRisposta,\n 'direzione': 'ricevuto bianco'\n };\n var messaggio_risposta = template_function(variabili);\n /*// Clono il template del messaggio\n var messaggio_risposta = $('.template .messaggio').clone();\n // Inserisco nello span corretto il testo del messaggio\n messaggio_risposta.children('.messaggio-testo').text('ok');\n // Inserisco nell'elemento small l'orario in cui viene inviato il messaggio di risposta\n messaggio_risposta.children('.messaggio-tempo').text(orarioRisposta);\n // Aggiungo le classi corrette al div messaggio\n messaggio_risposta.addClass('ricevuto bianco');\n */\n // Inserisco il messaggio all'interno del container\n $('.chat.attivo').append(messaggio_risposta);\n // Imposto la scroll bar sempre al bottom nell'area messaggi\n $('.messaggi-main').scrollTop($('.messaggi-main').prop(\"scrollHeight\"));\n // Inserisco nell'elemento h4 dell'utente attivo i primi 50 caratteri dell'ultimo messaggio che ha ricevuto\n $('.utenti-lista-riga.attivo').children('.utenti-lista-msg').children('.utenti-lista-msg-testo').children('p').text(risposta.slice(0,80) + '...');\n // Inserisco nell'elemento small dell'utente attivo l'orario dell'ultimo messaggio che ha ricevuto\n $('.utenti-lista-riga.attivo').children('.utenti-lista-msg').children('.utenti-lista-msg-nome').children('small').text(orarioRisposta);\n // Inserisco nell'elemento small dell'utente attivo l'orario dell'ultimo accesso che ha ricevuto\n $('.messaggi-header-accesso').children('p').children('span').text(orarioRisposta);\n }", "title": "" }, { "docid": "0c826ede1f8834a8e4be3858706e05aa", "score": "0.5810176", "text": "function clearBody() {\n $('.email-message').hide();\n $('.message-info .line-1 span:last').text('');\n $('.message-info .line-2 span:last').text('');\n $('.message-info .line-3 span:last').text('');\n $('.message-body span').text('');\n selectedMessage = '';\n}", "title": "" }, { "docid": "8fd497632b2281089a3b14470b404fb3", "score": "0.5808754", "text": "function ClearMessages(type) {\n var messageSection = $('[data-section=\"messages\"]');\n\n var messageClass = '';\n switch (type) {\n case 'success':\n messageClass = '.alert-success';\n break;\n case 'error':\n messageClass = '.alert-danger';\n break;\n default:\n break;\n }\n\n messageSection.find('div.alert' + messageClass).empty().remove();\n }", "title": "" }, { "docid": "2c35ae6fcd9a595c95215f9bd629dabb", "score": "0.5804895", "text": "function clearMessages() {\r\n const messagesElement = document.querySelector('#messages');\r\n while (messagesElement.hasChildNodes()) {\r\n messagesElement.removeChild(messagesElement.lastChild);\r\n }\r\n}", "title": "" }, { "docid": "8909b385062c08afecacd3f7048c8135", "score": "0.57882714", "text": "function removeLogMessages(){\n while (logContainer.lastChild) {\n logContainer.removeChild(logContainer.lastChild);\n }\n }", "title": "" }, { "docid": "615ed0c1b53b2a11045005bb84dd3019", "score": "0.5782656", "text": "function cleanMessage(str) {\n if(str.indexOf(\":\") > -1) {\n return str.slice(str.indexOf(\":\") + 1);\n }\n else return str;\n}", "title": "" }, { "docid": "18077a3c1042a7a46e25efe5d7603ece", "score": "0.5772443", "text": "function inviaMessaggio (){\n\n //prendo dall'html il valore che l'utente ha inserito\n inputUtente=$(\".inputUtente input\").val();\n\n //GESTIONE HANDLEBARS\n //creo un oggetto, ciascun elemento ha la stessa designazione che gli ho dato all'interno delle\n // {{}} che sono nello script in HTML\n var oggettoMessaggioInviato = {\"classeMessaggio\": \"inviato\", \"testoMessaggio\": inputUtente, \"orarioMessaggio\": time}\n //modelloMessagio ho impostato che sia Handlebars.compile(fonte);\n var sostituisceInHTMLMessaggioCorrispondente = modelloMessaggio(oggettoMessaggioInviato);\n\n //SE l'input dell'utente non è vuoto\n if (inputUtente!==\"\"){\n //aggiungo con append (dunque senza sostituire eventuali elementi precedenti) l'input dell'utente con tutte le classi appropriate alla chat che è attiva\n $(\".chatBoard.active\").append(sostituisceInHTMLMessaggioCorrispondente);\n //azzero il campo input, così che riprenda il valore di placeholder\n inputUtente=$(\".inputUtente input\").val(\"\");\n //ripristino l'icona del microfono\n $('.invia i').removeClass('fa-paper-plane').addClass('fa-microphone');\n\n //mentre il mittende risponde indico in alto che lo sta facendo:\n $(\".statoENome span\").html(\"Sta scrivendo...\");\n\n //AGGIUNTA RISPOSTA, deve trascorrere 1 secondo dalla comparsa della risposta\n //quindi uso setTimeout e imposto 1000 secondi d'attesa\n setTimeout(riceviMessaggio, 1000);\n }\n //SE L'INPUT E' VUOTO MI LIMITO A RIPRISTINARE L'ICONA GIUSTA\n else {\n $('.invia i').removeClass('fa-paper-plane').addClass('fa-microphone');\n }\n }", "title": "" }, { "docid": "217b64b52008fd10bc6b5ad863d7e1dc", "score": "0.5772225", "text": "function vaciarChat() {\n $('.chatbot-mensajes').empty()\n}", "title": "" }, { "docid": "213b2882dc1b62facb790473ff2ee5c4", "score": "0.57721066", "text": "function flagFoulLanguage(item, msg)\n{\n\tletter = item.substring(0,1).toUpperCase()\n\tmsg.reply(`That is not appropriate language. Do not use the ${letter}-word in here.`)\n\t\t.then(sent => {sent.delete(deleteTime)})\n\t\t.then(sent => console.log(`Sent a reply to ${msg.author.username}`))\n\t\t.catch(console.error);\n\tmsg.delete()\n\tmsg.deleted = true\n}", "title": "" }, { "docid": "c616e133b9f1c4c1cc451fcae53ebed9", "score": "0.5770536", "text": "function deleteMessage(e) {\n const deletedMsg = e.target.dataset.key;\n\n sortedUniqueMessages.splice(deletedMsg, 1);\n dispatch({type: 'messages', payload: sortedUniqueMessages});\n }", "title": "" }, { "docid": "3f4008752f698f3242f20b76cf6e1f72", "score": "0.57645315", "text": "function formMessageReset() {\n if (!genericFormMessage.length) return;\n for (var i = 0; i < genericFormMessage.length; i++) {\n genericFormMessage[i].classList.add('hidden');\n wsutil.clearChild(genericFormMessage[i]);\n }\n}", "title": "" }, { "docid": "0a61143a9602c95484bfa6d45c5a2fa3", "score": "0.57609665", "text": "function clearMessages(){\n let messages = document.getElementById(\"messages\");\n while(messages.firstChild){\n messages.firstChild.remove();\n }\n}", "title": "" }, { "docid": "2c155e8b675419772be8342cf19675d2", "score": "0.57414013", "text": "function afficherMessage(TabListeMessage)\n{\n\tvar longLigneMax=117; //88\n\ttry \n\t{\n\t\tlabelMessage.text=\"\";\n\t\tfor (var i = 0; i < TabListeMessage[_PAGE_MESSAGES].length ; i++) \n\t\t{\n\t\t\tfor (var j=0; j<TabListeMessage[_PAGE_MESSAGES][i].length ; j+=longLigneMax)\n\t\t\t{\n\t\t\t\tvar message=TabListeMessage[_PAGE_MESSAGES][i].substring(j,j+longLigneMax);\n\t\t\t\tif(j==longLigneMax || TabListeMessage[_PAGE_MESSAGES][i].length<longLigneMax)\n\t\t\t\t{\n\t\t\t\t\tlabelMessage.text+=message;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tlabelMessage.text+=message;\n\t\t\t\t\tlabelMessage.text+=\"-\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tcatch(e){}\n}", "title": "" }, { "docid": "935d1577391cdd4a12f43392a385b2c6", "score": "0.57272285", "text": "function removeDisplayError() {\n\t$(\".message-box\").children(\"div.alert-red\").remove();\n}", "title": "" }, { "docid": "2d0872a735a7600895d5007ff7a6c61f", "score": "0.5714801", "text": "function pm_manage_video_form_clear_message() {\r\n\tpm_ajax_msg_div.html('').fadeOut('fast');\r\n}", "title": "" }, { "docid": "073ebc557acf35aed9f5b8c991fac4d2", "score": "0.5700138", "text": "commandMsg(tab) {\n tab = tab.filter(word => word !== tab[0]);\n this.setState({\n tempMessage : {\n channel: this.state.channelSelected,\n author: this.state.username,\n content: tab.filter(word => word !== tab[0]).join(' '),\n to: tab[0],\n chucho : 'yes'\n }\n });\n }", "title": "" }, { "docid": "bf19d78f7a4d4564f0f9416eb726491a", "score": "0.5696861", "text": "function removePreviousMessageBox() {\n var i_messageBoxToRemove = 0;\n i_messageBoxToRemove = i_messageBox - 1;\n\n if (i_messageBox > 1) {\n\n var removePreviousMessageBox = document.querySelector(\"#messageBox_\" + i_messageBoxToRemove);\n removePreviousMessageBox.parentNode.removeChild(removePreviousMessageBox);\n }\n}", "title": "" }, { "docid": "a3e31d63cfa0339bbe56059171cc7221", "score": "0.5694981", "text": "function deletemsg(id)\n{\n $.ajax({\n type: \"POST\",\n data: \"messageid=\"+id,\n url: \"python/deletemsg.wsgi\",\n success: function(msg){\n jQuery(this).parent().remove();\n }\n });\n \n\t$(\"#displayMessage_\"+id).css(\"display\",\"none\");\n}", "title": "" }, { "docid": "7e2a7c9c01ad92d27e9ce6cabe00ac62", "score": "0.56823975", "text": "function cleanRender(type) {\n const localMessages = document.querySelector(\".chatbot__localMessages\");\n const onlineMessages = document.querySelector(\".chatbot__onlineMessages\")\n switch (type) {\n case \"local\":\n localMessages.innerHTML = \"\";\n break;\n case \"online\":\n onlineMessages.innerHTML = \"\";\n break;\n }\n}", "title": "" }, { "docid": "de5221d7031d5acfc0d3ae12d8829146", "score": "0.5677947", "text": "function removeReplyWarning() {\n $('#reply_to_id').val('');\n $('#reply_warning').fadeOut();\n reply_to_user = null;\n reply_to_id = null;\n}", "title": "" }, { "docid": "7706f37c5cfd876e85fc2e3e88c18e3a", "score": "0.5672295", "text": "function clearChat() {\n $(\"outputField\").innerHTML = \"\";\n displayMessage(\"<a href='images/how-about-no-bear.jpg' target='_blank'>see chat history</a>\");\n $(\"inputField\").focus();\n }", "title": "" }, { "docid": "2ee8fc2c9f014ad100a34f6c51948835", "score": "0.56704026", "text": "function emoteFix(chat) {\n $('.message').each(function(){$(this).children('img:gt(4)').remove()});\n if (mainRoom.userMain.attributes.isModerator == false) {\n $('.message img[src=\"http://images2.wikia.nocookie.net/legomessageboards/images/0/0c/Yellow_X.png\"], .message img[src=\"http://images2.wikia.nocookie.net/legomessageboards/images/7/72/Red_X_Face.jpg\"]').remove();\n }\n}", "title": "" }, { "docid": "84e566bd6ab8f547d981e631ef937f92", "score": "0.5669309", "text": "function remove_stories(){\r\n\tvar messages = document.getElementsByClassName(\"UIStoryAttachment_Copy\");\r\n\tvar count = messages.length;\r\n\tfor (var i = count - 1; i >= 0; i--){\r\n\t\tvar msg = messages[i];\r\n\t\t\tfor (var j = 0; j < forbiden_strings.length; j++){\r\n\t\t\t\t//if msg guts matches forbiden given string\r\n\t\t\t\tif (msg.innerHTML.indexOf(forbiden_strings[j]) >= 0){\r\n\t\t\t\t\t//finds wrapper for given message\r\n\t\t\t\t\tvar msg_feedparent = msg.parentNode.parentNode.parentNode.parentNode;\r\n\t\t\t\t\t//removes wrapper mentioned above\r\n\t\t\t\t\t//msg_parparpar.removeChild(msg.parentNode.parentNode);\r\n\t\t\t\t\tmsg_feedparent.style.display='none';\r\n\t\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "00f7002998490c91808240fee5235169", "score": "0.5667619", "text": "function aide_modo (message) {\n\n if(message.author.bot) return;\n if(message.channel.type === \"dm\") return;\n\n let messageArray = message.content.split(\" \");\n let cmd = messageArray[0];\n let args = messageArray.slice(1);\n\n if (message.length == 1){\n if (message[0].charAt(0) == config.prefix) \n message[0] = message[0].slice(1);\n\n }\n\n let aide_modoPerm = new Discord.RichEmbed()\n .setTitle(\"Réponse de la commande :\")\n .setColor(\"#bc0000\")\n .addField(\":x: Tu n'as pas le droit de utilisé cette commande.\", \"👮 Bien essayer en tous cas.(Auto-destruction du message dans 20s.)\")\n message.delete().catch(O_o=>{});\n\n if (!message.channel.permissionsFor(message.author).hasPermission(\"MANAGE_MESSAGES\")) {\n message.channel.sendMessage(aide_modoPerm).then(message => {message.delete(12000)});\n console.log(\"Désolé, vous n'avez pas la permission d'exécuter la commande \\\"\"+message.content+\"\\\"\");\n return;\n }\n\n let aideembed = new Discord.RichEmbed()\n .setColor(\"#15f153\")\n //.setThumbnail(sicon)\n .addField(config.prefix +\"clean\", \"Suprime des messages en grande quantité.\")\n .addField(config.prefix +\"kick\", \"Kick un utilisateur // EX : !kick @nom_de_la_personne_a_kick raison.\")\n .addField(config.prefix +\"ban\", \"Ban un utilisateur // EX : !ban @nom_de_la_personne_a_ban raison.\")\n .addField(config.prefix +\"addrole_admin\", \"Donne un rôle à un membre. // EX : !addrole_admin @nom_de_la_personne_a_ban rôle (PAS DE MENTION POUR LE ROLE).\")\n .addField(config.prefix +\"delrole_admin\", \"Retire un rôle à un membre. // EX : !delrole_admin @nom_de_la_personne_a_ban rôle (PAS DE MENTION POUR LE ROLE).\")\n .addField(config.prefix +\"messageprivate\", \"Envoi un message privé à un membre. // EX : !messageprivate @nom_de_la_personne_a_ban message.\") \n\n message.channel.send(aideembed);\n\n return;\n\n}", "title": "" }, { "docid": "8663de9d9cbff328a2d6dce58a3b36ef", "score": "0.56665736", "text": "function clearMsgs(table) {\r\n\tfor (var i = 0; i < table.numOfPlayers; ++i) {\r\n\t\tchooseAction(i, \"\");\r\n\t\tchangeCardsText(i, \"\");\r\n\t}\r\n}", "title": "" }, { "docid": "380c07afecaa66e1b9ccbcb67aedc4df", "score": "0.56615806", "text": "clear() {this.chat_list.innerHTML = '';}", "title": "" }, { "docid": "227fcc6cd5b13f7bb4b8385c25d81e08", "score": "0.56605023", "text": "deleteMessage(index) {\n this.contacts[this.currentContact].messages.splice(index,1)\n }", "title": "" }, { "docid": "d422918b9273126703b40637e40aff27", "score": "0.5657445", "text": "deleteMessage(message) {\n const indexOfMessage = this.messages.indexOf(message);\n if(indexOfMessage > -1) {\n this.messages.splice(indexOfMessage, 1);\n }\n return this;\n }", "title": "" }, { "docid": "d1e328aaefd72afa2f62d63d9f1a061c", "score": "0.5654469", "text": "function clearWarnings(input) {\n if (input) {\n var warningElements = document.getElementsByClassName('warning-message-' + input);\n } else {\n var warningElements = document.getElementsByClassName('warning-message');\n }\n if (warningElements.length > 0) {\n while (warningElements.length > 0) {\n warningElements[0].parentNode.removeChild(warningElements[0]);\n }\n }\n }", "title": "" }, { "docid": "69be89367b9c564c0fd603aa0d0e9c0c", "score": "0.5646877", "text": "function sendNewMsg(msgText, direction, id){ // utilizzo id per identificare a quale chat appendere il messaggio. in questo modo la risposta automatica va nella chat giusta anche se durante il setTimeout ho cambiato la chat visualizzata\n\n if(direction == \"send\"){\n $(\"#new-msg\").val(\"\"); // svuoto il form solo se ho mandato un messaggio io. se arriva una risposta automatica no\n }\n\n var newMsg = $(\".template\").clone(); // clono il template del messaggi\n\n newMsg.addClass(direction).removeClass(\"template\"); // do classe send o received al div.template clonato prima. la classe contiene background color green. Rimuovo la classe template in modo che al prossimo messaggio non faccia il clone anche del nuovo messaggio. (clona tutti gli elementi con classe templates)\n\n newMsg.find(\".new-text\").text(msgText); // .find() trova nei discendenti del div.template quello con classe .new-text e lo sovrascrive col messaggio dell'utente\n\n // Inserimento orario corretto\n\n newMsg.find(\".time\").text(getTime); // utilizzo la funzione per stampare l'ora corretta\n\n $(\"#messages [data-id=\"+id+\"]\").append(newMsg); // con append il messaggio clonato e modificato viene inserito nell'html\n\n // stampo nell'elenco contatti l'ultimo messaggio mandato. cambio il colore a seconda che sia un messaggio mandato o ricevuto\n\n var contactLastMsg = $(\"#contact-list [data-id=\"+id+\"]\").find(\".last-msg\");\n\n contactLastMsg.text(msgText);\n\n if(direction == \"send\"){\n contactLastMsg.addClass(\"color-send\");\n } else {\n contactLastMsg.removeClass(\"color-send\");\n }\n}", "title": "" }, { "docid": "42e47f7d7fdf76444fd1690ae78dce19", "score": "0.563289", "text": "saveSentMessage({ messages, messageInfo }) {\n messages.splice(messages.indexOf(messageInfo), 1);\n }", "title": "" }, { "docid": "3af3548e9b9a6a4e0ce57903f010fe6d", "score": "0.56271255", "text": "function aggiungiMessaggio(event)\n{\nvar idCanaleAttivo = ottieniIDCanaleAttivo(); // Individua l'ID del canale attivo....\nvar idBloccoCanaleAttivo = ottieniIdBloccoAttivo(idCanaleAttivo); // ....per individuare l'ID del blocco del canale attivo.\n\n\t\t\t\t\t\t\t\t // Gestisci l'evento della pressione ENTER, appendendo il messaggio scritto\nvar nodoInput = document.getElementById(\"chat\");\n\nif (event.keyCode === 13 && nodoInput.value) \t\t\t // Se premi ENTER...\n {\n var tuttaLaChat = document.getElementById(idBloccoCanaleAttivo); // Individua il blocco del canale attivo grazie al suo ID\n var messaggio = nodoInput.value;\t\t\t\t // Ottieni il messaggio da appendere\n\n var nuovoMessaggio = document.createTextNode(messaggio);\t // Crea nodo col messaggio\n var spazio = document.createElement(\"br\");\n var nomeUtente = document.createTextNode(\"<\" + getNomeUtente() + \"> \");\n tuttaLaChat.appendChild(spazio);\n tuttaLaChat.appendChild(nomeUtente);\n tuttaLaChat.appendChild(nuovoMessaggio);\t\t\t // Appendi sia un \"/n\" sia il messaggio\n nodoInput.value=\"\";\t\t\t\t\t\t // Cancella ciò che è stato scritto nell'input bar\n var bloccoMessaggi = document.getElementById(\"bloccomessaggi\");\n bloccoMessaggi.scrollTop += 100;\t\t\t\t // Scrolla ad ogni messaggio inviato in modo da \"seguire\" i messaggi\n }\n}", "title": "" }, { "docid": "2fa29ecb86287213dc731e905f7a7785", "score": "0.5621215", "text": "function clearMessageBoard() {\n const messages = document.getElementsByClassName('indicator');\n\n for (let index = 0; index < messages.length; index += 1) {\n messages[index].style.display = 'none';\n }\n}", "title": "" }, { "docid": "9a441db641a08022ff85f3b3410a2a60", "score": "0.5612511", "text": "clearErrors() {\r\n\t\t\tthis.$el.children( '.uf-field-validation-message' ).remove();\r\n\t\t}", "title": "" }, { "docid": "c8c9a795f065ba36c85ceeec7e12e663", "score": "0.56058055", "text": "function removeHelp_msg() {\n help_msg.innerHTML = `<span></span>`;\n}", "title": "" }, { "docid": "051656dfe2e0fdf3b80955e97d1a85f2", "score": "0.5602632", "text": "function hideMessage () {\n\t\t$('#modal .msg').html(\"\");\n\t\t$('#modal').hide();\n\t}", "title": "" }, { "docid": "b6d59de983455f5e8c28bdd594b47ddf", "score": "0.55993533", "text": "function abortDeleteMessage(){\n minimise('deleteMessage');\n}", "title": "" } ]
a794e0170ddfe49f816454d51963fb62
Life Cycle Hook This function is Called immediately after a component is mounted. Setting state here will trigger rerendering.
[ { "docid": "571b711e8c75f46fa0e58fea97661be9", "score": "0.0", "text": "componentDidMount() {\n this.props.getEtudiants();\n }", "title": "" } ]
[ { "docid": "e7f5b479d2640b06e004f3d9713a7cf6", "score": "0.6761786", "text": "componentDidMount() {\r\n this.initState();\r\n }", "title": "" }, { "docid": "78395161b213733dd7c71ad41a702e8c", "score": "0.67454046", "text": "componentDidMount() {\n this.initializeState()\n }", "title": "" }, { "docid": "e192ccdedee7777a3599c636148d2ca1", "score": "0.6712635", "text": "componentWillMount() {\n this.componentStateSetup(this.props);\n }", "title": "" }, { "docid": "a7593b2029bc2617ca9c896dcbbd4ae4", "score": "0.6654775", "text": "componentWillMount(){\n\t\tthis.initializeState();\n\t}", "title": "" }, { "docid": "d3d55fc0aa50e77443d5178d9448c683", "score": "0.6632339", "text": "constructor(props) {\n super(props);\n this.state = {\n count: 0,\n };\n console.log(\"CONSTRUCTOR life cycle here\"); //mounting\n }", "title": "" }, { "docid": "e49e2a63afbeef638f1cae903c1e5f00", "score": "0.6626963", "text": "componentDidMount() {\n if (this.props.references) {\n this.updateStateReferences(this.props.references);\n }\n }", "title": "" }, { "docid": "c9296380b978136cb584f6962cdf612a", "score": "0.6588756", "text": "constructor(props) {\n \n \n super(props);\n \n this.setInitState();\n }", "title": "" }, { "docid": "9ddcdc58d824a41d9db5f115ca428a25", "score": "0.65526485", "text": "componentDidUpdate() {\n console.log('__UPDATE STATE__', this.state);\n }", "title": "" }, { "docid": "9ddcdc58d824a41d9db5f115ca428a25", "score": "0.65526485", "text": "componentDidUpdate() {\n console.log('__UPDATE STATE__', this.state);\n }", "title": "" }, { "docid": "82305c176d22d875ab5bf3d3153a5f72", "score": "0.6495072", "text": "componentDidUpdate(prevProps, prevState, snapshot) {\n if(!prevProps.show && this.props.show){\n this.setDefaultState();\n }\n }", "title": "" }, { "docid": "aba2ced250b3ca31ad51e9714db3751f", "score": "0.64915645", "text": "componentDidMount(){\r\n console.log(\"Mount state:\", this.state);\r\n }", "title": "" }, { "docid": "40f2242835b38fb30614e10eaa67637c", "score": "0.6487141", "text": "componentDidUpdate () {\n console.log('::::::STATE:::::::', this.state);\n }", "title": "" }, { "docid": "7e81b30550df7253d9c9e40066a90a06", "score": "0.646646", "text": "render() {\n console.log(\"LifecycleParent : Mount and Update Phase : render is called with state \", this.state)\n return (\n <>\n <h1 className=\"heading\"> LifecycleParent Methods</h1>\n <div className=\"centerContent\">\n <button onClick={this.changeState}>Click Me</button>\n </div>\n <LifecycleChild/>\n </>);\n }", "title": "" }, { "docid": "b4443f3f87bda519ad9dede7cda50d86", "score": "0.6455937", "text": "componentDidMount() {\n attachSharedState(this)\n }", "title": "" }, { "docid": "f91e90dd4c36172db784c1f5b45022ad", "score": "0.6420278", "text": "render() {\n console.log(\"lifecycle A render\");\n return (\n <div>\n <div>lifecycle A</div>\n <ReactLifeCycleUChild/>\n <button onClick = {this.changeState}>Change State</button>\n </div>\n );\n }", "title": "" }, { "docid": "a089c32a7748ec18ea7b88cab145950b", "score": "0.63987005", "text": "componentDidUpdate(){\r\n console.log(\"Update state:\", this.state);\r\n }", "title": "" }, { "docid": "2dad3d05d2d262d4f58fe88506d66cf4", "score": "0.6384125", "text": "constructor(...args){\n super(...args)\n this.shouldComponentUpdate=PureRenderMixin.shouldComponentUpdate\n this.state={\n isVisable:false\n }\n }", "title": "" }, { "docid": "7a815680eb0e9c264e3c949ea703e32b", "score": "0.6358149", "text": "componentDidUpdate() {\n const newState = this.calculateCorrdinates();\n if (!_.isEqual(newState, this.state)) {\n this.setState(newState);\n }\n }", "title": "" }, { "docid": "ba2450ec9d725966af15e56a17191a71", "score": "0.6345566", "text": "componentDidMount() {\n this.setState({ mounted: true });\n }", "title": "" }, { "docid": "ba2450ec9d725966af15e56a17191a71", "score": "0.6345566", "text": "componentDidMount() {\n this.setState({ mounted: true });\n }", "title": "" }, { "docid": "61b342af5a935dc2adffcef03075be29", "score": "0.6338623", "text": "constructor(props) {\n super(props)\n \n this.state = {\n name:'sana'\n }\n console.log('LifeCycleB Constructer')\n }", "title": "" }, { "docid": "0e85c726fcf49603982a9aefa8f03c27", "score": "0.6334723", "text": "constructor() {\n super();\n this.state = {\n\n }\n }", "title": "" }, { "docid": "d45a40c269e1811660c3546b45acf1da", "score": "0.63006586", "text": "componentWillMount() {\n if (!process.env.IS_BROWSER) return;\n appState.on('change', () => {\n this.setState(this.getState());\n });\n }", "title": "" }, { "docid": "0d6028e21084d735727f84b898c22082", "score": "0.6277951", "text": "componentDidMount(): void {\n this.setState({ mounted: true });\n }", "title": "" }, { "docid": "0cc558fcfb5a782467d89e5eca5ccf8e", "score": "0.6276356", "text": "constructor(){\n super()\n this.state = {\n isLoaded: false\n }\n }", "title": "" }, { "docid": "f59d508c2b7d8171e26c33e69c8eb3ae", "score": "0.6256382", "text": "constructor(props) {\n super(props);\n\n this.state = {\n\n name: \"Piyush\"\n }\n\n this.changeState = this.changeState.bind(this);\n console.log(\"LifecycleParent : Mount Phase : Constructor is called\");\n }", "title": "" }, { "docid": "b361b759de464f309bb87a3b2b2c9e2a", "score": "0.62436223", "text": "constructor(props) {\n super(props);\n //state declaration\n // even biding to component\n }", "title": "" }, { "docid": "b361b759de464f309bb87a3b2b2c9e2a", "score": "0.62436223", "text": "constructor(props) {\n super(props);\n //state declaration\n // even biding to component\n }", "title": "" }, { "docid": "4c89d8ac0440131ad268662ab2800cb5", "score": "0.62175393", "text": "componentDidUpdate (prevProps, prevState) {\n Object.freeze(this.state);\n if (super.componentDidUpdate) {\n super.componentDidUpdate(prevProps, prevState);\n }\n }", "title": "" }, { "docid": "3e832ff572ea8a840793d485ad025f9a", "score": "0.62064886", "text": "componentWillMount(){\n console.log('Before the component gets created');\n \n }", "title": "" }, { "docid": "7fc3674cf901a3a2eee95661e7bf74a6", "score": "0.6193974", "text": "setLoaded () {\n if (this._isMounted) {\n this.setState({ loaded: true }, this.props.onLoad)\n }\n }", "title": "" }, { "docid": "53b996b96591d97cecc354b31d51da38", "score": "0.6185371", "text": "constructor(props){\n super(props)\n this.state={\n\n }\n\n }", "title": "" }, { "docid": "843a66d778fb538bdb7658e0746f56f6", "score": "0.6167785", "text": "constructor(props){\n super(props);\n this.state = {\n\n }\n }", "title": "" }, { "docid": "843a66d778fb538bdb7658e0746f56f6", "score": "0.6167785", "text": "constructor(props){\n super(props);\n this.state = {\n\n }\n }", "title": "" }, { "docid": "c501a4cbadc2d209387f4bc18055f737", "score": "0.61542225", "text": "constructor(props) {\n super(props)\n\n this.state = {\n name: 'Ibrahim'\n }\n\n //log\n console.log(\"LifecycleB Mounting &&& Updating Lifecycle - constructor - First Method\")\n }", "title": "" }, { "docid": "893a4c8a6a8c0c748efc2ee6bac14871", "score": "0.61395466", "text": "function componentWillMount(){// Call this.constructor.gDSFP to support sub-classes.\nvar state=this.constructor.getDerivedStateFromProps(this.props,this.state);if(state!==null&&state!==undefined){this.setState(state);}}", "title": "" }, { "docid": "39896171b38cdb7f8d8210e4a3f71bf3", "score": "0.6138403", "text": "safeSetState(...args) {\n this._isMounted && this.setState(...args)\n }", "title": "" }, { "docid": "bc04da15815b24eab2995527fbec6ed4", "score": "0.6128646", "text": "componentDidUpdate(prevProps){\n if (this.props.value !== prevProps.value){\n console.log('componenet did mount!')\n this.setState({value:this.props.value})\n }\n }", "title": "" }, { "docid": "866abcd863c6480f9343d2dea2d7b196", "score": "0.6124328", "text": "constructor() {\r\n super();\r\n\r\n this.state = {};\r\n }", "title": "" }, { "docid": "548875b3fceb0db161754ff2bf5435a3", "score": "0.6124274", "text": "constructor(){\n super()\n this.state = {\n isLoaded : false\n }\n }", "title": "" }, { "docid": "f11b89520ace2e2b873ea2a1224761b0", "score": "0.61224663", "text": "componentDidMount() {\r\n this.recommendationsState();\r\n }", "title": "" }, { "docid": "f6ff66afca95ce250fa83ac76c48c9d5", "score": "0.6113687", "text": "componentDidMount(){\n this._isMounted = true\n }", "title": "" }, { "docid": "f5c089fcb986768bc30e7e29cfb7834d", "score": "0.6097515", "text": "constructor(props) {\n super(props)\n this.state = {\n\n }\n }", "title": "" }, { "docid": "f8d52dca1e977c3d4b1ce36367493ea1", "score": "0.60941494", "text": "constructor(props) {\n super(props);\n\n this.state = {\n name: \"\",\n };\n console.log(\"lifecycle A constructor\");\n }", "title": "" }, { "docid": "a1b2d6b210c9bd25dbb9d35329cf1dbb", "score": "0.6076556", "text": "constructor () {\n this._state = {}\n }", "title": "" }, { "docid": "ebf6330fabb6c369b967fa4b64d42bd6", "score": "0.6076055", "text": "componentDidMount() {\n this._isMounted = true;\n }", "title": "" }, { "docid": "a80ce07543c706ac0bbceb43e60761f8", "score": "0.6072047", "text": "componentDidMount() {\n this.forceUpdate();\n }", "title": "" }, { "docid": "ca54d7abdbeb652d996f3a901f9fb13e", "score": "0.60700047", "text": "componentDidMount() {\n\n managePortfolioData();\n setPortState(this.init_data); // Not react 0.13.x standard, but es6 introduced classes and I'm soooo version 0.14.x...\n\n this.forceUpdate();\n\n }", "title": "" }, { "docid": "050e6bea46ce4c627c84bd7f4e7d09bc", "score": "0.6063202", "text": "constructor(props){\n super(props)\n this.state={\n type:null,\n config:null,\n readyToRender:false\n }\n }", "title": "" }, { "docid": "6f5d8e63620a391793e57a34b44d933f", "score": "0.6058869", "text": "constructor(props) {\n super(props);\n this.state = {\n loaded: false,\n };\n }", "title": "" }, { "docid": "8620b282e6626504c68d87be7ad754bb", "score": "0.6053577", "text": "componentDidMount() {\n this._isMounted = true;\n }", "title": "" }, { "docid": "4ae332003cd5322d70f1502cdca8fd44", "score": "0.60483843", "text": "function OnStateUpdate(self, state)\n {\n set_view(self, state)\n }", "title": "" }, { "docid": "4ae332003cd5322d70f1502cdca8fd44", "score": "0.60483843", "text": "function OnStateUpdate(self, state)\n {\n set_view(self, state)\n }", "title": "" }, { "docid": "012c923645063ca4e8abb6d4f1955150", "score": "0.6046513", "text": "constructor(props){\n super(props);\n \n this.state = {\n name : 'Child'\n }\n console.log(\" LifeCycleB Constructor called \");\n }", "title": "" }, { "docid": "5c4e4e2d7dfb747f608a229c1e64aa53", "score": "0.6044729", "text": "componentDidMount() {\n this.setState({ isVisible: true });\n }", "title": "" }, { "docid": "060a5845641719a655d5db23b23cf009", "score": "0.60429823", "text": "constructor(props) {\n super(props)\n this.state = {\n //\n }\n }", "title": "" }, { "docid": "b0a24aa303b96eec43723340f2ca6566", "score": "0.6029606", "text": "constructor() {\n super();\n this.state = {};\n }", "title": "" }, { "docid": "1178b71b7d276a56dd9ebeffe75fd079", "score": "0.6028915", "text": "componentDidUpdate() {\n this.setDataState(this.props.data);\n }", "title": "" }, { "docid": "4a4c423d2cc8c817d07248a489a91bf5", "score": "0.60232085", "text": "constructor(props) {\n super(props);\n this.state = {\n\n };\n }", "title": "" }, { "docid": "3d6343a456f26a3ca8978be2f7ff7b2a", "score": "0.6021582", "text": "initialiseState (newState) {\n this.state = newState\n }", "title": "" }, { "docid": "7a4c6fe2e4700a1adf39f0e115e92479", "score": "0.6015963", "text": "componentDidUpdate(prevProps, prevState, snapshot) {\n this.setDefaultComponents();\n }", "title": "" }, { "docid": "5b683c4680c7c620e8738cb5a66b023d", "score": "0.6014636", "text": "constructor(props) {\n super(props);\n this.state = {\n };\n }", "title": "" }, { "docid": "37fbc28fcf7c341149615cd9f22bcbd7", "score": "0.6009445", "text": "componentDidMount() {\n\n\t\tthis.setState({ reload: false });\n\t}", "title": "" }, { "docid": "678c06115dd5a8c1889c975de7963615", "score": "0.6004175", "text": "componentDidUpdate(prevProps, prevState) {\n if (!objectEquals(prevState, this.state)) {\n this.props.onChangeState(this.state, () => {});\n }\n }", "title": "" }, { "docid": "47e27d418e04530321ca6ace31207b78", "score": "0.59998363", "text": "componentDidUpdate(){\n console.log(\"My component was just updated - it rerendered\");\n }", "title": "" }, { "docid": "b108d3fda6ab46f917a46dd2cfdaa327", "score": "0.5998057", "text": "componentDidMount() {\n this.forceUpdate();\n }", "title": "" }, { "docid": "5317b71780f7158bc1e937625fa4e53d", "score": "0.59966004", "text": "constructor(props){\n super(props);\n this.state =\n {\n visible: false\n }\n\n }", "title": "" }, { "docid": "aee6cdeb5d324e60e7a43c5b8a1382e9", "score": "0.5995489", "text": "componentWillMount() {\n //Setting state by calling function storeState() who is in component Store\n this.setState(storeState());\n //If state in Store will change we always get an updates by calling function subscribe ()\n subscribe(() => {\n this.setState(storeState());\n });\n }", "title": "" }, { "docid": "e8d6d0a5aea28e9265c3d60a8f694edf", "score": "0.59941757", "text": "componentWillMount(){\n console.log('Before component gets created')\n }", "title": "" }, { "docid": "397d7f92a7cadf2c8443ea0982b19fcc", "score": "0.5989227", "text": "onSetInitialState() {\n this.setState({ ..._getInitialState() });\n }", "title": "" }, { "docid": "7b10463f870141ff6ae5b97c6dee4a97", "score": "0.5984607", "text": "constructor(props) {\n super(props);\n this.state = {};\n }", "title": "" }, { "docid": "7b10463f870141ff6ae5b97c6dee4a97", "score": "0.5984607", "text": "constructor(props) {\n super(props);\n this.state = {};\n }", "title": "" }, { "docid": "7b10463f870141ff6ae5b97c6dee4a97", "score": "0.5984607", "text": "constructor(props) {\n super(props);\n this.state = {};\n }", "title": "" }, { "docid": "7b10463f870141ff6ae5b97c6dee4a97", "score": "0.5984607", "text": "constructor(props) {\n super(props);\n this.state = {};\n }", "title": "" }, { "docid": "413701877cbead12ef7758c5276a1a98", "score": "0.5982862", "text": "constructor(props){\n super(props)\n\n // 2. Set the Initial State\n this.state={\n title:'This is Lifecycle process',\n body:'Dummy'\n }\n\n }", "title": "" }, { "docid": "9a815311daa6cae84171e72e392549df", "score": "0.5976068", "text": "function onUpdate() {\n // Prevent duplicate fetches when first loaded.\n // Explanation: On server-side render, we already have __INITIAL_STATE__\n // So when the client side onUpdate kicks in, we do not need to fetch twice.\n // We set it to null so that every subsequent client-side navigation will\n // still trigger a fetch data.\n // Read more: https://github.com/choonkending/react-webpack-node/pull/203#discussion_r60839356\n if (window.__INITIAL_STATE__ !== null) {\n window.__INITIAL_STATE__ = null;\n window.__FT_OVERRIDES__ = null;\n return;\n }\n\n setFeatureOverrides({});\n\n const { components, params } = this.state;\n\n hashLinkScroll();\n\n // log page view to Google Analytics\n ga.pageview(window.location.pathname);\n\n preRenderMiddleware(store.dispatch, components, params);\n}", "title": "" }, { "docid": "512da7d5750a5aa85299b68d32aa4a49", "score": "0.5971454", "text": "constructor(props) {\n super(props);\n \n this.state = {\n };\n }", "title": "" }, { "docid": "512da7d5750a5aa85299b68d32aa4a49", "score": "0.5971454", "text": "constructor(props) {\n super(props);\n \n this.state = {\n };\n }", "title": "" }, { "docid": "512da7d5750a5aa85299b68d32aa4a49", "score": "0.5971454", "text": "constructor(props) {\n super(props);\n \n this.state = {\n };\n }", "title": "" }, { "docid": "512da7d5750a5aa85299b68d32aa4a49", "score": "0.5971454", "text": "constructor(props) {\n super(props);\n \n this.state = {\n };\n }", "title": "" }, { "docid": "512da7d5750a5aa85299b68d32aa4a49", "score": "0.5971454", "text": "constructor(props) {\n super(props);\n \n this.state = {\n };\n }", "title": "" }, { "docid": "d5240eaf22d9553de6bcc3112b248915", "score": "0.597065", "text": "function OnStateUpdate(self, state)\n {\n set_view(self, state);\n }", "title": "" }, { "docid": "9d8248bdb898f0d9f38972b0ac77a5bf", "score": "0.59694785", "text": "function componentWillMount() {\r\n // Call this.constructor.gDSFP to support sub-classes.\r\n var state = this.constructor.getDerivedStateFromProps(this.props, this.state);\r\n if (state !== null && state !== undefined) {\r\n this.setState(state);\r\n }\r\n}", "title": "" }, { "docid": "9d8248bdb898f0d9f38972b0ac77a5bf", "score": "0.59694785", "text": "function componentWillMount() {\r\n // Call this.constructor.gDSFP to support sub-classes.\r\n var state = this.constructor.getDerivedStateFromProps(this.props, this.state);\r\n if (state !== null && state !== undefined) {\r\n this.setState(state);\r\n }\r\n}", "title": "" }, { "docid": "8a9415029b18c089f38ba4162d9b9a76", "score": "0.5968692", "text": "componentWillMount() {\n this._loadInitialState().done();\n }", "title": "" }, { "docid": "59bc6f84f2e378056aa22deddc2367d7", "score": "0.59675676", "text": "constructor(props) {\r\n super(props);\r\n\r\n this.state = {};\r\n }", "title": "" }, { "docid": "0c84f36857006e451cddefbfb6b0ae64", "score": "0.5960468", "text": "componentDidMount() {\n this.updateComponent();\n }", "title": "" }, { "docid": "b2eca3e9d5e23efbc8e147caa8185632", "score": "0.59590364", "text": "constructor(props) {\n super(props)\n this.state = {}\n }", "title": "" }, { "docid": "fd77ba5dc027b9faf5adbda7f4b3ff8d", "score": "0.59563637", "text": "function componentWillMount() {\n // Call this.constructor.gDSFP to support sub-classes.\n var state = this.constructor.getDerivedStateFromProps(this.props, this.state);\n\n if (state !== null && state !== undefined) {\n this.setState(state);\n }\n}", "title": "" }, { "docid": "fd77ba5dc027b9faf5adbda7f4b3ff8d", "score": "0.59563637", "text": "function componentWillMount() {\n // Call this.constructor.gDSFP to support sub-classes.\n var state = this.constructor.getDerivedStateFromProps(this.props, this.state);\n\n if (state !== null && state !== undefined) {\n this.setState(state);\n }\n}", "title": "" }, { "docid": "fd77ba5dc027b9faf5adbda7f4b3ff8d", "score": "0.59563637", "text": "function componentWillMount() {\n // Call this.constructor.gDSFP to support sub-classes.\n var state = this.constructor.getDerivedStateFromProps(this.props, this.state);\n\n if (state !== null && state !== undefined) {\n this.setState(state);\n }\n}", "title": "" }, { "docid": "fd77ba5dc027b9faf5adbda7f4b3ff8d", "score": "0.59563637", "text": "function componentWillMount() {\n // Call this.constructor.gDSFP to support sub-classes.\n var state = this.constructor.getDerivedStateFromProps(this.props, this.state);\n\n if (state !== null && state !== undefined) {\n this.setState(state);\n }\n}", "title": "" }, { "docid": "fd77ba5dc027b9faf5adbda7f4b3ff8d", "score": "0.59563637", "text": "function componentWillMount() {\n // Call this.constructor.gDSFP to support sub-classes.\n var state = this.constructor.getDerivedStateFromProps(this.props, this.state);\n\n if (state !== null && state !== undefined) {\n this.setState(state);\n }\n}", "title": "" }, { "docid": "fd77ba5dc027b9faf5adbda7f4b3ff8d", "score": "0.59563637", "text": "function componentWillMount() {\n // Call this.constructor.gDSFP to support sub-classes.\n var state = this.constructor.getDerivedStateFromProps(this.props, this.state);\n\n if (state !== null && state !== undefined) {\n this.setState(state);\n }\n}", "title": "" }, { "docid": "fd77ba5dc027b9faf5adbda7f4b3ff8d", "score": "0.59563637", "text": "function componentWillMount() {\n // Call this.constructor.gDSFP to support sub-classes.\n var state = this.constructor.getDerivedStateFromProps(this.props, this.state);\n\n if (state !== null && state !== undefined) {\n this.setState(state);\n }\n}", "title": "" }, { "docid": "fd77ba5dc027b9faf5adbda7f4b3ff8d", "score": "0.59563637", "text": "function componentWillMount() {\n // Call this.constructor.gDSFP to support sub-classes.\n var state = this.constructor.getDerivedStateFromProps(this.props, this.state);\n\n if (state !== null && state !== undefined) {\n this.setState(state);\n }\n}", "title": "" }, { "docid": "fd77ba5dc027b9faf5adbda7f4b3ff8d", "score": "0.59563637", "text": "function componentWillMount() {\n // Call this.constructor.gDSFP to support sub-classes.\n var state = this.constructor.getDerivedStateFromProps(this.props, this.state);\n\n if (state !== null && state !== undefined) {\n this.setState(state);\n }\n}", "title": "" }, { "docid": "583b7ef5238116daf26c2637da3dfd32", "score": "0.5955505", "text": "componentDidUpdate(){\n console.log('My component was just updated - it rerendered');\n }", "title": "" }, { "docid": "62f2a55b2936537c7bfa262066034b17", "score": "0.59525365", "text": "function componentWillMount() {\r\n // Call this.constructor.gDSFP to support sub-classes.\r\n var state = this.constructor.getDerivedStateFromProps(this.props, this.state);\r\n if (state !== null && state !== undefined) {\r\n this.setState(state);\r\n }\r\n }", "title": "" }, { "docid": "15fa44648464aca82c97935bb1b53609", "score": "0.5948519", "text": "_stateChanged(state) {\r\n\r\n let props = this.getProps(state);\r\n //If dom destroy process is already running\r\n if(this._destroy) {\r\n this._setProps(props);\r\n return;\r\n }\r\n\r\n //Mark view is rerender if one of the rendere property is changed\r\n let rerender = false;\r\n this.primaryProps.forEach((prop) => {\r\n if(!rerender && props[prop] != this[prop]) {\r\n rerender = true;\r\n }\r\n });\r\n\r\n //Set properties\r\n this._setProps(props);\r\n\r\n //Rerender view only if one of the property value is changed for which dom should be rerender\r\n if(rerender) {\r\n this._destroy = true;\r\n this.updateComplete.then(() => {\r\n this._destroy = false;\r\n });\r\n }\r\n }", "title": "" }, { "docid": "b6937a38a6d12d6abe7d96d8b5aa8e7b", "score": "0.59467214", "text": "constructor(props) {\n super(props);\n\n this.state = {};\n }", "title": "" } ]
5c8521cd11066e0515c1cc86e29c0312
They say that only the name is long enough to attract attention. They also said that only a simple Kata will have someone to solve it. This is a sadly story. series 32: Count with your fingers Description John's each hand has five fingers(If you are surprised, please tell me how many fingers you have ;) Even more amazing is that when he was a child, he already had 5 fingers(one hand). At that time, he often to count the number by using his fingers. He counting number by this way: aThumb bIndex finger cMiddle finger dRing finger eLittle finger a b c d e H H H H H H H H H H U H H H H U H U U U 1 2 3 4 5 9 8 7 6 10 11 12 13 17 16 15 14 18 19 .. .. .. .. .. .. .. So the question is: when John counting to number n, which is the corresponding finger? Task Complete function whichFinger() that accepts an argument n You need to return a string between the name of five fingers: "Thumb", "Index finger", "Middle finger", "Ring finger", "Little finger"
[ { "docid": "ccdf8d1717439e490c4ca0f3c7e9ed48", "score": "0.7797212", "text": "function whichFinger(n){\n var hand = ['Thumb','Index finger','Middle finger','Ring finger','Little finger']\n while (n > 5) {\n n -= 4;\n hand = hand.reverse();\n }\n return hand[n - 1];\n}", "title": "" } ]
[ { "docid": "2844801f019ca75500334a9fe50bfa3e", "score": "0.6473948", "text": "function fingerCount(){\n if(fingers == 0){\n alert(\"Finally you get it--I am a computer! I don't have fingers.\"); //alert if variable fingers is equal to 0\n }else if (fingers == 10){\n alert(\"humans have 10 fingers--I am not a human!\"); //alert if variable fingers is equal to 10\n }else if (fingers > 10){\n alert(\"What are you thinking? You don't even have \" + fingers + \" fingers\");//alert if variable fingers is greater than 10\n }else if (fingers >= 1 && fingers <= 5){\n alert(\" I am trying to think of what animal has \" + fingers + \" fingers....regardless I am not that animal!\"); //alert if variable fingers is greater than 1 and less that 5\n }else if (fingers >5 && fingers < 10){\n alert( \"Okay \"+ userName + \" that answer is not correct try again!\"); //alert if variable fingers is greater than 5 and less than 10\n }\n\n}", "title": "" }, { "docid": "e81b0e5758f28b44ebe125268614a856", "score": "0.6317002", "text": "function rightHandTotal(fingers) {\n // convert string to an array of ints\n fingers = fingers.split('')\n .map(x => Number(x));\n\n let total = 0;\n // thumb counts as five\n if (fingers[0])\n total += 5;\n\n // add sum of the four other\n total += fingers\n .slice(1) \n .reduce((a, b) => a + b); \n\n return total;\n}", "title": "" }, { "docid": "59e1194a5011a85d8839b1c6cfd2060b", "score": "0.63095796", "text": "function fingerHash(i, finger){\n var hash = 'f' + i + ':';\n $.each(finger.direction, function(j, direction) {\n hash += direction.toFixed(1);\n });\n return hash;\n}", "title": "" }, { "docid": "541b0c328809a8fc6ec6d3980de64bfc", "score": "0.57765234", "text": "function get_dtmf_frequencies(number) {\r\n // your solution goes here\r\n // const row = list(697, 770, 852, 941);\r\n // const col = list(1209, 1336, 1477, 1633);\r\n // return (number >= 1 && number <= 9)\r\n // ? pair(list_ref(col, (number - 1) % 3),\r\n // list_ref(row, math_trunc((number - 0.1) / 3)))\r\n // : (number >= \"A\" && number <= \"D\")\r\n // ? pair(list_ref(col, 3), list_ref(row, number - \"A\"))\r\n // : number === \"*\"\r\n // ? pair(list_ref(col, 0), list_ref(row, 3))\r\n // : number === \"#\"\r\n // ? pair(list_ref(col, 2), list_ref(row, 3))\r\n // : pair(list_ref(col, 1), list_ref(row, 3));\r\n const dtmf = list(\r\n pair(941, 1336),\r\n pair(697, 1209),\r\n pair(697, 1336),\r\n pair(697, 1477),\r\n pair(770, 1209),\r\n pair(770, 1336),\r\n pair(770, 1477),\r\n pair(852, 1209),\r\n pair(852, 1336),\r\n pair(852, 1477),\r\n pair(941, 1209),\r\n pair(941, 1477),\r\n pair(697, 1633),\r\n pair(770, 1633),\r\n pair(852, 1633),\r\n pair(941, 1633));\r\n return list_ref(dtmf, number);\r\n}", "title": "" }, { "docid": "5aacf63003964e64d635d231537e4ea9", "score": "0.5628212", "text": "function HandleHand(hand) {\n\t//Grabs fingers\n\tvar fingers = hand.fingers;\n\t//Draws all five finger bones(1-4) at a time\n\n\t//Distal phalanges are bones.type = 3\n\tvar l = 3;\n\n\t//We know there are 4 bones in each finger\n\tfor (var j=0; j<4; j++){\n\t\t//All five bones of a type at a time\n\t\tfor(var k=0; k<fingers.length; k++){\n\t\t\t//Gets all bones of a finger\n\t\t\tvar bones = fingers[k].bones;\n\t\t\t//Draws finger\n\t\t\tHandleBone(bones[l]);\n\t\t}\n\t\tl--;\n\t}\n\n\t// for(var k=0; k<fingers.length; k++){\n\t// \t//Gets all bones of a finger\n\t// \tvar bones = fingers[k].bones;\n\t// \tconsole.log(fingers[k].type)\n\t// \tconsole.log(bones[l].type)\n\t// \t//Draws finger\n\t// \tHandleBone(bones[l]);\n\t// }\n\n}", "title": "" }, { "docid": "914f0a0719ba8bd953a5fda5a27aa67f", "score": "0.54634255", "text": "function unusualFive() {\n return 'fives'.length;\n}", "title": "" }, { "docid": "5c920d57b5df96ffb0db124cbaec4122", "score": "0.5428373", "text": "function compute(chord) {\r\n\tvar alteration = 0;\r\n\tvar base_position = 12;\r\n\tvar fondamental_value = 0;\r\n\tvar fondamental_name = \"\";\r\n\tvar final_chord = \"\";\r\n\tvar notes = [];\r\n\t\r\n\t//clean previous chord\r\n\tif (lastChord.length > 0) { clearKeyboard(lastChord) }\r\n\t\r\n\t//find if there is any alteration\r\n\tif ((chord.substr(1,1) == 'b') && (chord.substr(2,1) != '5')) {\r\n\t\talteration -= 1;\r\n\t} else if (chord.substr(1,1) == '#') {\r\n\t\talteration += 1;\r\n\t}\r\n\t\r\n\t//determine where to put the chord for better visibility\t\r\n\t//if 9th or 13th\r\n\t//if higher than F\r\n\r\n\t//Cb isn't supposed to be called\r\n\tfondamental_value = fondamental_value + keys[chord.substr(0,1)] + alteration;\r\n\t\r\n\t//affiche la fondamentale\r\n\t//drawNote(fondamental_value);\r\n\t\r\n\t//then case for each part\r\n\t//we can slice the fondamental\t\r\n\tif (alteration != 0) {\r\n\t\tfinal_chord = chord.substr(0,2);\r\n\t\tchord = chord.substr(2);\r\n\t} else {\r\n\t\tfinal_chord = chord.substr(0,1);\r\n\t\tchord = chord.substr(1);\r\n\t}\r\n\t\r\n\t//then the fat switch\r\n\t//add fonamental:\r\n\tnotes.push(fondamental_value);\r\n\tswitch (chord.substr(0,1)) {\r\n\tcase \"h\":\r\n\t\t//C halfdim / Cø / Cm7b5 -> \r\n\t\t//Accord dim + 7° mineure\r\n\t\t//fondamentale, tierce-, quinte-, septième-\r\n\t\tnotes.push(3);//tierce-\r\n\t\tnotes.push(6);//quinte-\r\n\t\tnotes.push(10);//septième-\r\n\t\tconsole.log(final_chord+\"half dim\");\r\n\t\tbreak;\r\n\t\r\n\tcase \"b\":\r\n\t\t//C b5\r\n\t\t// Cmajeur avec quinte dim\r\n\t\t//fondamentale, tierce, quinte-\r\n\t\tnotes.push(4);//tierce\r\n\t\tnotes.push(6);//quinte-\r\n\t\tconsole.log(final_chord+\"b5\");\r\n\t\tbreak;\r\n\t\r\n\tcase \"d\":\r\n\t\tnotes.push(3);//tierce-\r\n\t\tnotes.push(6);//quinte-\r\n\t\tif (chord.length == 3) {\r\n\t\t\t//Cdim\r\n\t\t\t//C majeur full diminué\r\n\t\t\t//fondamentale, tierce-, quinte-\r\n\t\t\tconsole.log(final_chord+\"dim\");\r\n\t\t} else {\r\n\t\t\t//Cdim7\r\n\t\t\t//C majeur7 full diminué\r\n\t\t\t//fondamentale, tierce-, quinte-, septième--\r\n\t\t\tnotes.push(9);//septième--\r\n\t\t\tconsole.log(final_chord+\"dim7\");\r\n\t\t}\r\n\t\tbreak;\r\n\t\t\r\n\tcase \"s\":\r\n\t\tif (chord.substr(3,1) == \"2\") {\r\n\t\t\t//Csus2\r\n\t\t\t//fondamentale,seconde,quinte\r\n\t\t\tnotes.push(2);//seconde\r\n\t\t\tnotes.push(7);//quinte\r\n\t\t\tconsole.log(final_chord+\"sus2\");\r\n\t\t} else {\r\n\t\t\t//Csus4\r\n\t\t\t//fondamentale,quarte,quinte\r\n\t\t\tnotes.push(5);//quarte\r\n\t\t\tnotes.push(7);//quinte\r\n\t\t\tconsole.log(final_chord+\"sus4\");\r\n\t\t}\r\n\t\tbreak;\r\n\t\t\r\n\tcase \"a\":\r\n\t\tif (chord.substr(0,3) == \"add\") {\r\n\t\t\t//Cadd9\r\n\t\t\t//Cmaj + 9th\r\n\t\t\t//fondalentale,tierce,quinte,neuvième\r\n\t\t\tnotes.push(4);//tierce\r\n\t\t\tnotes.push(7);//quinte\r\n\t\t\tnotes.push(14);//neuvième\r\n\t\t\tconsole.log(final_chord+\"add9\");\r\n\t\t} else {\r\n\t\t\t//Caug / C+\r\n\t\t\t//quinte augmentée\r\n\t\t\t//fondamentale,tierce,quinte+\r\n\t\t\tnotes.push(4);//tierce\r\n\t\t\tnotes.push(8);//quinte+\r\n\t\t\tconsole.log(final_chord+\"aug\");\r\n\t\t}\r\n\t\tbreak;\r\n\t\r\n case \"5\":\r\n\t\t//C5 PowerChord\r\n\t\t//Quinte doublée à l'octave\r\n\t\t//fondamentale, quinte, octave sup\r\n\t\tnotes.push(7);//quinte\r\n\t\tnotes.push(12);//octave\r\n console.log(final_chord+\"5 PowerChord\");\r\n break;\r\n\t\t\r\n case \"6\":\r\n if (chord.length == 1) {\r\n\t\t\t//C6\r\n\t\t\t//Accord majeur + sixte\r\n\t\t\t//fondamentale, tierce, quinte, sixte\r\n\t\t\tnotes.push(4);//tierce\r\n\t\t\tnotes.push(7);//quinte\r\n\t\t\tnotes.push(9);//sixte\r\n\t\t\tconsole.log(final_chord+\"6\");\r\n\t\t} else {\r\n\t\t\t//C69 ou C6/9\r\n\t\t\t//Accord majeur + sixte + neuvième\r\n\t\t\t//fondamentale, tierce, quinte, sixte, neuvième\r\n\t\t\tnotes.push(4);//tierce\r\n\t\t\tnotes.push(7);//quinte\r\n\t\t\tnotes.push(9);//sixte\r\n\t\t\tnotes.push(14);//neuvième\r\n\t\t\tconsole.log(final_chord+\"69\");\r\n\t\t}\r\n break;\r\n\t\t\r\n\tcase \"9\":\t\r\n\t\tif (chord.length == 1) {\r\n\t\t\t//C9\r\n\t\t\t//C + 7 + 9\r\n\t\t\t//fondamentale, tierce, quinte, septième-, neuvième\r\n\t\t\tconsole.log(final_chord+\"9\");\r\n\t\t\tnotes.push(4);//tierce\r\n\t\t\tnotes.push(7);//quinte\r\n\t\t\tnotes.push(10);//septième-\r\n\t\t\tnotes.push(14);//neuvième\r\n\t\t} else if (chord.substr(1,1) == \"b\") {\r\n\t\t\t//C9b5\r\n\t\t\t//Même qu'au dessus avec une quinte -\r\n\t\t\t//fondamentale, tierce, quinte-, septième-, neuvième\r\n\t\t\tnotes.push(4);//tierce\r\n\t\t\tnotes.push(6);//quinte-\r\n\t\t\tnotes.push(10);//septième-\r\n\t\t\tnotes.push(14);//neuvième\r\n\t\t\tconsole.log(final_chord+\"9b5\");\r\n\t\t} else if (chord.substr(1,1) == \"#\") {\r\n\t\t\t//C9#5\r\n\t\t\t//Même qu'au dessus avec une quinte+ sans 7TH\r\n\t\t\t//fondamentale, tierce, quinte+, neuvième\r\n\t\t\tnotes.push(4);//tierce\r\n\t\t\tnotes.push(8);//quinte+\r\n\t\t\tnotes.push(14);//neuvième\r\n\t\t\tconsole.log(final_chord+\"9#5\");\r\n\t\t} else {\r\n\t\t\t//C9sus4\r\n\t\t\tnotes.push(5);//quarte\r\n\t\t\tnotes.push(7);//quinte\r\n\t\t\tnotes.push(10);//septième-\r\n\t\t\tnotes.push(14);//neuvième\r\n\t\t\tconsole.log(final_chord+\"9sus4\");\r\n\t\t}\r\n\t\tbreak;\r\n\t\r\n case \"/\":\r\n //generate correct chords\r\n\t\t//rules 1:altered chords -> keep alteration related ie : Eb -> use keys_flats C# -> keys_sharps\r\n\t\t// 2:default-> if its C and F use keys_flats, for ABDEG use keys-sharps\r\n\t\t//generate 5 usual chords\r\n\t\t//C -> C/E, C/G, C/B, C/Bb, C/D\r\n\t\t//C -> C/+4, C+7, C+11, C+10, C+2 (previous octave so add -12) -> C/-8, C/-5, C/-1, C/-2, C/-10\r\n\t\tvar slashed = final_chord+\"/\";\r\n\t\tvar slashed2 = final_chord+\"/\";\r\n\t\tvar slashed3 = final_chord+\"/\";\r\n\t\tvar slashed4 = final_chord+\"/\";\r\n\t\tvar slashed5 = final_chord+\"/\";\r\n\t\tfondamental_value += 12;\r\n\t\t\r\n\t\tif ((alteration == -1) || (final_chord == \"C\") || (final_chord == \"F\")) {\r\n\t\t\t//use flats\r\n\t\t\tslashed += keys_flats[(fondamental_value+4)%12];\r\n\t\t\tslashed2 += keys_flats[(fondamental_value+7)%12];\r\n\t\t\tslashed3 += keys_flats[(fondamental_value+11)%12];\r\n\t\t\tslashed4 += keys_flats[(fondamental_value+10)%12];\r\n\t\t\tslashed5 += keys_flats[(fondamental_value+2)%12];\r\n\t\t} else {\r\n\t\t\t//use sharps\r\n\t\t\tslashed += keys_sharps[(fondamental_value+4)%12];\r\n\t\t\tslashed2 += keys_sharps[(fondamental_value+7)%12];\r\n\t\t\tslashed3 += keys_sharps[(fondamental_value+11)%12];\r\n\t\t\tslashed4 += keys_sharps[(fondamental_value+10)%12];\r\n\t\t\tslashed5 += keys_sharps[(fondamental_value+2)%12];\r\n\t\t}\r\n\t\t\r\n\t\tnotes.push(4);//tierce\r\n\t\tnotes.push(7);//quinte\r\n\t\t// TO FIX problem : C/B and C/Bb\r\n\t\t//console.log(final_chord+chord.substr(0,2), slashed, slashed2, slashed3, slashed4, slashed5);\r\n\t\tswitch (final_chord+(chord.substr(0,3))) {\r\n\t\t\tcase slashed:\r\n\t\t\t\t//tierce à la basse\r\n\t\t\t\tnotes.push(-8);\r\n\t\t\t\tconsole.log(slashed);\r\n\t\t\t\tbreak;\r\n\t\t\tcase slashed2:\r\n\t\t\t\t//quinte à la basse\r\n\t\t\t\tnotes.push(-5);\r\n\t\t\t\tconsole.log(slashed2);\r\n\t\t\t\tbreak;\r\n\t\t\tcase slashed3:\r\n\t\t\t\t//septième à la basse\r\n\t\t\t\tnotes.push(-1);\r\n\t\t\t\tconsole.log(slashed3);\r\n\t\t\t\tbreak;\r\n\t\t\tcase slashed4:\r\n\t\t\t\t//septième mineure à la basse\r\n\t\t\t\tnotes.push(-2);\r\n\t\t\t\tconsole.log(slashed4);\r\n\t\t\t\tbreak;\r\n\t\t\tcase slashed5:\r\n\t\t\t\t//seconde à la basse\r\n\t\t\t\tnotes.push(-10);\r\n\t\t\t\tconsole.log(slashed5);\r\n\t\t\t\tbreak;\r\n\t\t\tdefault :\r\n\t\t\t\tconsole.log(\"Unknown Slashed chord\");\r\n\t\t}\r\n break;\r\n\t\t\r\n case \"7\":\r\n //code block\r\n\t\tswitch (chord.substr(1,1)) {\r\n\t\t\tcase \"b\":\r\n\t\t\t\tnotes.push(4);//tierce\r\n\t\t\t\tnotes.push(10);//septième-\r\n\t\t\t\tif (chord.substr(2,1) == \"5\") {\r\n\t\t\t\t\t//C7b5\r\n\t\t\t\t\t//Accord Septième avec quinte dim\r\n\t\t\t\t\t//fondamentale, tierce, quinte-, septième-\r\n\t\t\t\t\tnotes.push(6);//quinte-\r\n\t\t\t\t\tconsole.log(final_chord+\"7b5\");\r\n\t\t\t\t} else {\r\n\t\t\t\t\t//C7b9\r\n\t\t\t\t\t//Accord Septième avec neuvième dim\r\n\t\t\t\t\t//fondamentale, tierce, quinte, septième-, neuvième-\r\n\t\t\t\t\tnotes.push(7);//quinte\r\n\t\t\t\t\tnotes.push(13);//neuvième-\r\n\t\t\t\t\tconsole.log(final_chord+\"7b9\");\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"#\":\r\n\t\t\t\tif (chord.substr(2,1) == \"5\") {\r\n\t\t\t\t\t//C7#5\r\n\t\t\t\t\t//Accord Septième avec quinte aug\r\n\t\t\t\t\t//fondamentale, tierce, quinte+, septième-\r\n\t\t\t\t\tnotes.push(4);//tierce\r\n\t\t\t\t\tnotes.push(8);//quinte+\r\n\t\t\t\t\tnotes.push(10);//septième-\r\n\t\t\t\t\tconsole.log(final_chord+\"7#5\");\r\n\t\t\t\t} else {\r\n\t\t\t\t\t//C7#9\r\n\t\t\t\t\t//Accord Septième avec neuvième aug\r\n\t\t\t\t\t//fondamentale, tierce, quinte, septième-, neuvième+\r\n\t\t\t\t\tnotes.push(4);//tierce\r\n\t\t\t\t\tnotes.push(7);//quinte\r\n\t\t\t\t\tnotes.push(10);//septième-\r\n\t\t\t\t\tnotes.push(15);//neuvième+\r\n\t\t\t\t\tconsole.log(final_chord+\"7#9\");\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"s\":\r\n\t\t\t\t//C7sus4\r\n\t\t\t\t//Accord Septième sans tierce avec quarte sup\r\n\t\t\t\t//fondamentale, quarte, quinte, septième-\r\n\t\t\t\tnotes.push(5);//quarte\r\n\t\t\t\tnotes.push(7);//quinte\r\n\t\t\t\tnotes.push(10);//septième-\r\n\t\t\t\tconsole.log(final_chord+\"7sus4\");\r\n\t\t\t\tbreak;\r\n\t\t\tdefault :\r\n\t\t\t\t//C7 FIX attention wrong chords sometimes C7BB9 => C7\r\n\t\t\t\t//Accord de septième de dominante\r\n\t\t\t\t//fondamentale, tierce, quinte, septième-\r\n\t\t\t\tnotes.push(4);//tierce\r\n\t\t\t\tnotes.push(7);//quinte\r\n\t\t\t\tnotes.push(10);//septième-\r\n\t\t\t\tconsole.log(final_chord+\"7\");\r\n\t\t}\r\n break;\r\n\t\r\n\tcase \"m\":\r\n switch (chord.substr(1,1)) {\r\n\t\t\tcase \"#\":\r\n\t\t\t\t//Cm#7 / CmM7\r\n\t\t\t\t//Accord de septième de dominante avec tierce mineure\r\n\t\t\t\t//fondamentale, tierce-, quinte, septième-\r\n\t\t\t\tnotes.push(3);//tierce-\r\n\t\t\t\tnotes.push(7);//quinte\r\n\t\t\t\tnotes.push(11);//septième\r\n\t\t\t\tconsole.log(final_chord+\"m#7\");\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"i\":\r\n\t\t\t\t//Cminor\r\n\t\t\t\t//fondamentale, tierce-, quinte\r\n\t\t\t\tnotes.push(3);//tierce-\r\n\t\t\t\tnotes.push(7);//quinte\r\n\t\t\t\tconsole.log(final_chord+\"minor\");\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"a\":\r\n\t\t\t\tnotes.push(4);//tierce\r\n\t\t\t\tnotes.push(7);//quinte\r\n\t\t\t\tswitch (chord.substr(3,1)) {\r\n\t\t\t\t\tcase \"7\":\r\n\t\t\t\t\t\t//Cmaj7 / CΔ\r\n\t\t\t\t\t\t//fondamentale, tierce, quinte, septième\r\n\t\t\t\t\t\tnotes.push(11);//septième\r\n\t\t\t\t\t\tconsole.log(final_chord+\"maj7\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"9\":\r\n\t\t\t\t\t\t//Cmaj9 / CΔ9\r\n\t\t\t\t\t\t//fondamentale, tierce, quinte, septième, neuvième\r\n\t\t\t\t\t\tnotes.push(11);//septième\r\n\t\t\t\t\t\tnotes.push(14);//neuvième\r\n\t\t\t\t\t\tconsole.log(final_chord+\"maj9\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"o\":\r\n\t\t\t\t\t\t//Cmajor\r\n\t\t\t\t\t\t//fondamentale, tierce, quinte\r\n\t\t\t\t\t\tconsole.log(final_chord+\"major\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault :\r\n\t\t\t\t\t\tconsole.log(\"Unknown Cmaj* chord\");\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"6\":\r\n\t\t\t\t//Cm6\r\n\t\t\t\t//Cminor + sixte\r\n\t\t\t\t//fondamentale, tierce-, quinte, sixte\r\n\t\t\t\tnotes.push(3);//tierce-\r\n\t\t\t\tnotes.push(7);//quinte\r\n\t\t\t\tnotes.push(9);//sixte\r\n\t\t\t\tconsole.log(final_chord+\"m6\");\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"7\":\r\n\t\t\t\tif (chord.substr(2,1) == \"b\") {\r\n\t\t\t\t\t//Cm7b5 / Cø // halfdim\r\n\t\t\t\t\t//Cm7 et quinte dim\r\n\t\t\t\t\t//fondamentale, tierce-, quinte-, septième-\r\n\t\t\t\t\tnotes.push(3);//tierce-\r\n\t\t\t\t\tnotes.push(6);//quinte-\r\n\t\t\t\t\tnotes.push(10);//septième-\r\n\t\t\t\t\tconsole.log(final_chord+\"m7b5\");\r\n\t\t\t\t} else {\r\n\t\t\t\t\t//Cm7\r\n\t\t\t\t\t//fondamentale, tierce-, quinte, septième-\r\n\t\t\t\t\tnotes.push(3);//tierce-\r\n\t\t\t\t\tnotes.push(7);//quinte\r\n\t\t\t\t\tnotes.push(10);//septième-\r\n\t\t\t\t\tconsole.log(final_chord+\"m7\");\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"9\":\r\n\t\t\t\t//Cm9\r\n\t\t\t\t//Cminor + 9\r\n\t\t\t\t////fondamentale, tierce-, quinte, septième-, neuvième\r\n\t\t\t\tnotes.push(3);//tierce-\r\n\t\t\t\tnotes.push(7);//quinte\r\n\t\t\t\tnotes.push(10);//septième-\r\n\t\t\t\tnotes.push(14);//neuvième\r\n\t\t\t\tconsole.log(final_chord+\"m9\");\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"1\":\r\n\t\t\t\t//Cm11\r\n\t\t\t\t//Cminor + 7 + 9 + 11\r\n\t\t\t\t////fondamentale, tierce-, quinte, septième-, neuvième, onzième\r\n\t\t\t\tnotes.push(3);//tierce-\r\n\t\t\t\tnotes.push(7);//quinte\r\n\t\t\t\tnotes.push(10);//septième-\r\n\t\t\t\tnotes.push(14);//neuvième\r\n\t\t\t\tnotes.push(17);//neuvième\r\n\t\t\t\tconsole.log(final_chord+\"m11\");\r\n\t\t\t\tbreak;\r\n\t\t\tdefault :\r\n\t\t\t\tconsole.log(\"Unknown Cm* chord\");\r\n\t\t}\r\n break;\r\n\t\r\n default:\r\n console.log(\"Unknown chord : \"+final_chord+chord);\r\n\t}\r\n\t\r\n\t//drawNote\r\n\tdrawNote(fondamental_value);\r\n\tfor\t(var index = 1; index < notes.length; index++) {\r\n\t\tdrawNote(fondamental_value+notes[index]);\r\n\t} \r\n\t\r\n\t//update last chord for easier erasing\r\n\tlastChord = notes;\r\n}", "title": "" }, { "docid": "bd9e9b97ef0f4bb7f8d9b2ac597fa142", "score": "0.53813773", "text": "function countingSheep(n) {\n if (n == 0) {\n return 'All sheep jumped over the fence'\n }\n return `${n}: Another sheep jumped over the fence ` + countingSheep(n - 1)\n}", "title": "" }, { "docid": "67de832fc699582e25f49f4d8bf53dea", "score": "0.53787154", "text": "function tellFortune(x, y, z, n) {\n return \"You will be a \" + n + \" in \" + z + \", and married to \" + y +\" with \" + x + \" kids.\"; \n}", "title": "" }, { "docid": "6e1cddca18bed58fafb7ef888cb3b0c3", "score": "0.5375161", "text": "function whoIsNext2(names, r) {\n let total = 0;\n let adder = 1;\n let answer = 0;\n while(total<r) {\n for(let i=0;i<names.lenth;i++) {\n total += adder;\n console.log(total);\n answer = i;\n if (total) break;\n }\n adder *= 2;\n }\n return names[answer];\n}", "title": "" }, { "docid": "0f9cecb058e5bfb3d15ea47b203af0a9", "score": "0.53450483", "text": "function detect_haf_tone(note){\r\n var returned = []\r\n if (note.hafTonesCheck === true) {\r\n $.each(note.id, function(i, l) {\r\n let log = Number(l[4]) + 1\r\n if (l.length == 6) {\r\n log = Number(l[4] + l[5]) + 1 // sdvig\r\n }\r\n returned.push(l[0] + l[1] + l[2] + l[3] + log)\r\n\r\n });\r\n }\r\n return returned;\r\n }", "title": "" }, { "docid": "60e7fab023aec92d97d6572da5e7fd8f", "score": "0.5334896", "text": "function HandleFinger(finger) {\n\t//Gets all the finger's bones\n\tvar bones = finger.bones;\n\t//Iterates over the bones in each finger\n\tfor (i=0; i<bones.length; i++){\n\t\tHandleBone(finger.bones[i]);\n\t}\t\n}", "title": "" }, { "docid": "e62aebec9909ac53cfe62d63e3526a05", "score": "0.52842796", "text": "function father2() {\n\tvar edad = age(getRandomNumber(0, 50));\n\n\tif (edad < 20)\n\n\t\treturn name(nombre) + \" \" + edad + \" Sure you're Tony Stark?\";\n\n\telse if ((21 <= edad) && (edad <= 50))\n\n\t\treturn name(nombre) + \" \" + edad + \" hi, you are Tony Stark\";\n\n\telse\n\t\treturn name(nombre) + \" anyone know what you are ;)\";\n}", "title": "" }, { "docid": "d021b9ac62191a5b113aba0280691ed8", "score": "0.5268989", "text": "function fnal()\r\n {\r\n let fmark = exam(75)+crsmark(40)\r\n console.log(fmark)\r\n \r\n }", "title": "" }, { "docid": "9acdbe820cf6462746221a9da33a7b54", "score": "0.5258852", "text": "function howMuchILoveYou(nbPetals) {\n let phrase = ['I love you',\n 'a little',\n 'a lot',\n 'passionately',\n 'madly',\n 'not at all'] \n return phrase[(nbPetals-1) % 6]\n}", "title": "" }, { "docid": "8ae25c4db8bc063b89c4ee8f91a92c17", "score": "0.5246144", "text": "function simpsonsIndex(forest){\n\tconst index = 1 - Object.entries([...forest.join(\"\")].reduce(\n\t\t(counts, emoji) => ({...counts, [emoji]: (counts[emoji] || 0) + 1}),\n\t\t{})).reduce(([top, bottom], [species, count]) => [top + (count * (count - 1)), bottom + count], [0, 0])\n\t\t.reduce((sumLilN,bigN) => sumLilN / (bigN * (bigN - 1)));\n\treturn index.toFixed(2);\n}", "title": "" }, { "docid": "0af238a05d521038f8c07cfaa4470f9f", "score": "0.52400464", "text": "function timesOfMostFreqChar() {\n // YOUR CODE HERE\n}", "title": "" }, { "docid": "7057819578df5ffff9e2281a79e4d78c", "score": "0.52249193", "text": "function fancyRide(l, fares) {\n let index = fares.length - 1;\n \n while(l*fares[index] > 20){\n index--;\n }\n return (\n index === 4 ? 'UberSUV' :\n index === 3 ? 'UberBlack' :\n index === 2 ? 'UberPlus' :\n index === 1 ? 'UberXL': 'UberX');\n}", "title": "" }, { "docid": "c953acd5874c167a64a27d4e57b2c00c", "score": "0.52241737", "text": "function get_key_name(key){\n loops = Math.floor(get_key_number(key) / note_names.length) + 4;\n return note_names[get_key_number(key) % note_names.length] + loops.toString();\n}", "title": "" }, { "docid": "54e1f1ddccaae269655cec4725254523", "score": "0.5199904", "text": "function task8(myNumber) {\n number = myNumber.toString();\n digit1 = number.charAt(number.length - 1);\n digit2 = number.charAt(number.length - 2);\n digit3 = number.charAt(number.length - 3);\n\n d1Name = '';\n d2Name = '';\n d3Name = '';\n\n //Regular naming for hungreds\n switch (digit3) {\n case '1': d3Name = 'One hundred'; break;\n case '2': d3Name = 'Two hundred'; break;\n case '3': d3Name = 'Three hundred'; break;\n case '4': d3Name = 'Four hundred'; break;\n case '5': d3Name = 'Five hundred'; break;\n case '6': d3Name = 'Six hundred'; break;\n case '7': d3Name = 'Seven hundred'; break;\n case '8': d3Name = 'Eight hundred'; break;\n case '9': d3Name = 'Nine hundred'; break;\n\n }\n //Regular naming for tens\n switch (digit2) {\n case '2': d2Name = 'twenty'; break;\n case '3': d2Name = 'thirty'; break;\n case '4': d2Name = 'fourty'; break;\n case '5': d2Name = 'fifty'; break;\n case '6': d2Name = 'sixty'; break;\n case '7': d2Name = 'seventy'; break;\n case '8': d2Name = 'eighty'; break;\n case '9': d2Name = 'ninety'; break;\n }\n //Regular naming for digits\n switch (digit1) {\n case '1': d1Name = 'one'; break;\n case '2': d1Name = 'two'; break;\n case '3': d1Name = 'three'; break;\n case '4': d1Name = 'four'; break;\n case '5': d1Name = 'five'; break;\n case '6': d1Name = 'six'; break;\n case '7': d1Name = 'seven'; break;\n case '8': d1Name = 'eight'; break;\n case '9': d1Name = 'nine'; break;\n }\n //Special conditions\n if (myNumber === 0) {\n d1name = 'Zero';\n console.log(d1Name);\n }\n\n if (digit2 === '1') {\n d2Name = d1Name;\n d1Name = 'teen';\n switch (digit1) {\n case '3': d2Name = 'thir'; break;\n case '5': d2Name = 'fif'; break;\n case '8': d2Name = 'eigh'; break;\n }\n if (digit1 === '0') {\n d2Name = 'ten';\n d1Name = '';\n }\n if (digit1 === '1') {\n d2Name = 'eleven';\n d1Name = '';\n }\n if (digit1 === '2') {\n d2Name = 'twelve';\n d1Name = '';\n }\n }\n if (myNumber <= 999 && myNumber > 0) {\n\n if (myNumber <= 99) {\n if (myNumber <= 9) {\n d1Name = d1Name.charAt(0).toUpperCase() + d1Name.slice(1);\n console.log(d1Name);\n }\n else {\n d2Name = d2Name.charAt(0).toUpperCase() + d2Name.slice(1);\n\n if (digit2 === '1') {\n console.log(d2Name + d1Name);\n }\n else {\n console.log(d2Name + ' ' + d1Name);\n }\n }\n }\n else {\n if (digit1 === '0' && digit2 === '0') {\n console.log(d3Name);\n }\n else if ((digit2 === '0' && digit1 !== '0') || d1Name === 'teen') {\n console.log(d3Name + ' and ' + d2Name + d1Name);\n }\n else {\n console.log(d3Name + ' and ' + d2Name + ' ' + d1Name);\n }\n }\n }\n else {\n console.log('try with number 0 - 100');\n }\n}", "title": "" }, { "docid": "5e246be92a1f001eee3bda974cc09d89", "score": "0.5183057", "text": "function getNote(frequency){\n\t//print(frequency);\n\n\t//comparision float difference to account for quartertones and artifacts\n\tvar compfloat = .465;\n\n\n\t//brings value to an absolute fundamental\n\twhile(frequency > 31.735){\n\t\tfrequency = frequency/2;\n\t}\n\n for(var i = 0; i < fundFreqs.length; i++){\n var minval = fundFreqs[i]-compfloat;\n var maxval = fundFreqs[i]+compfloat;\n if(between(frequency, minval, maxval)){\n\t\t\t\t//get the indexed pitch value against the matched index\n\t\t\t\tvar pitch = pitches[i];\n\t\t\t\t//print(pitch);\n\t\t\t\treturn pitch;\n\n\t\t\t}\n\t\t\t//if we reach the end of the fundfrequency array, restart the loop with a larger comparative range\n\t\t\tif(i == fundFreqs.length - 1){\n\t\t\t\ti = 0;\n\t\t\t\tcompfloat = compfloat+.005;\n\t\t\t}\n\t\t}\n\n\t//SHOULD NOT REACH\n\treturn \"error\";\n}", "title": "" }, { "docid": "0640e79b742ad63be56f6cb1b6dee665", "score": "0.51710206", "text": "function mostFrequentLetter(string){\n\n}", "title": "" }, { "docid": "5eaa2cea32f1749efe56be2feb25eb5c", "score": "0.5170804", "text": "function howMuchILoveYou(nbPetals) {\nvar petals = nbPetals % 6;\nif(nbPetals % 6 === 0){\nreturn \"not at all\";\n}\nif(nbPetals <= 7) {\n if(nbPetals === 1 || nbPetals % 7 === 0) {\n return \"I love you\";\n }\n else if(nbPetals % 6 === 0) {\n return \"not at all\";\n }\n else if(nbPetals % 2 === 0) {\n return \"a little\";\n }\n else if(nbPetals % 3 === 0) {\n return \"a lot\";\n }\n else if(nbPetals % 4 === 0) {\n return \"passionately\";\n }\n else if(nbPetals % 5 === 0) {\n return \"madly\";\n }\n}\nelse {\n if(petals === 1 || petals % 7 === 0) {\n return \"I love you\";\n }\n else if(petals % 6 === 0) {\n return \"not at all\";\n }\n else if(petals % 4 === 0) {\n return \"passionately\";\n }\n else if(petals % 2 === 0) {\n return \"a little\";\n }\n else if(petals % 3 === 0) {\n return \"a lot\";\n }\n else if(petals % 5 === 0) {\n return \"madly\";\n }\n}\n}", "title": "" }, { "docid": "d349171936a2f237c798c719fea6474d", "score": "0.5162962", "text": "function main() {\n //console.log('#1 - count sheep');\n //countSheep(5);\n\n //console.log('#2 - Array Doubler');\n //let arr = [10,5,3,4];\n //console.log(double_all(arr));\n\n //console.log('#3 - Reverse String');\n //console.log(reverseString(\"tauhida\"));\n\n //console.log('#4 - nth Triangular Number');\n //console.log(triangle(5));\n\n //console.log('#5 - String Splitter');\n //console.log(split('1/21/2018', '/'));\n\n //console.log('#6 - Binary Representation');\n //console.log(convertToBinary(25));\n\n //console.log('#7 - Anagrams');\n //printAnagram(\"east\");\n\n //console.log('#8 - animalHierarchy');\n //console.log(traverse(animalHierarchy, null));\n\n //console.log('#9 - Factorial');\n //console.log(factorial(5)); //120\n\n //console.log('#10 - Fibonacci');\n //console.log(fibonacci(7));\n\n console.log('#11 - Organization Chart');\n console.log(traverseA(organization));\n //console.log(traverseB(organization));\n\n }", "title": "" }, { "docid": "77f8f138bab31d995bc15aa5b5a7119e", "score": "0.51589316", "text": "function countLetters(input) {\n var answers = {};\n function checkTriples(input){\n answers[\"Consecutive Triples\"] = [];\n console.log(\"=== checking for Consecutive Triples ===\");\n var inputString = input;\n var inputArray = inputString.split(\"\");\n while (inputArray.length > 0){ //checks triples\n var firstLetter = inputArray.shift();\n var tripleLetters = firstLetter+firstLetter+firstLetter;\n if (inputString.indexOf(tripleLetters) !== -1){\n console.log(firstLetter + \" IS A TRIPLE\");\n answers[\"Consecutive Triples\"].push(firstLetter);\n inputArray = inputString.split(tripleLetters);\n } else {\n console.log(firstLetter + \" does not consecutively appear 3 times.\");\n }\n inputString = inputArray.join(\"\");\n }\n if (answers[\"Consecutive Triples\"] !== undefined){\n console.log(\"Letters appearing 3 times consecutively: \" + answers[\"Consecutive Triples\"]);\n } else {\n console.log(\"Did not find any letters that appeared 3 times consecutively.\");\n }\n }\n function checkFives(input){\n answers[\"Five Occurrences\"] = [];\n console.log(\"=== checking for five occurrences ===\");\n var inputArray = input.split(\"\");\n var sortedArray = inputArray.sort();\n var sortedString = sortedArray.join(\"\");\n while(sortedString.length > 0) {\n var firstLetter = sortedString.charAt(0);\n var fiveLetters = firstLetter + firstLetter + firstLetter + firstLetter + firstLetter;\n if (sortedString.indexOf(fiveLetters) !== -1) {\n console.log(firstLetter + \" APPEARED 5 TIMES\");\n answers[\"Five Occurrences\"].push(firstLetter);\n sortedArray = sortedString.split(fiveLetters);\n } else {\n console.log(firstLetter + \" does not appear 5 times.\");\n while (firstLetter === sortedString.charAt(1)){\n sortedString = sortedString.slice(1);\n }\n sortedArray = sortedString.split(firstLetter);\n // sortedString = sortedString.slice(1);\n // sortedArray = sortedString.split(\"\");\n }\n sortedString = sortedArray.join(\"\");\n }\n if (answers[\"Five Occurrences\"] !== undefined){\n console.log(\"Letters appearing 5 times: \", answers[\"Five Occurrences\"]);\n } else {\n console.log(\"Did not find any letters that appeared 5 times.\");\n }\n }\n checkTriples(input);\n checkFives(input);\n return answers;\n}", "title": "" }, { "docid": "c94bf0503aa92c81aeb597f9a775bf4e", "score": "0.514273", "text": "function getTh(number){\n\tswitch(number.charAt(number.length-1)){\n\t\tcase \"1\":return \"st\";\n\t\tcase \"2\":return \"nd\";\n\t\tcase \"3\":return \"rd\";\n\t\tdefault:return \"th\";\n\t}\n}", "title": "" }, { "docid": "88c87e4f0ad49d5de017c38f45cedf5f", "score": "0.5140196", "text": "function fname() {\r\n return this.num + this.suit + \".gif\";\r\n}", "title": "" }, { "docid": "abb12b10c8c602a77b0b807671507143", "score": "0.51208645", "text": "function getCardName(card) {\n //if card point = 1 -> ace, 1-10 -> number value, 11 jack, 12 queen, 13 king\n if (card.point === 1) {\n return \"ace\";\n } else if (card.point <= 10) {\n return card.point;\n } else if (card.point === 11) {\n return \"jack\";\n } else if (card.point === 12) {\n return \"queen\";\n } else if (card.point === 13) {\n return \"king\";\n }\n}", "title": "" }, { "docid": "42ea9ce1c5e8d2ce32f616bd51663228", "score": "0.5119189", "text": "function challengeTheFlameWind(shrineName){\n return randomArrayElement(['flame', 'wind']) + \" \" + randomArrayElement(COMMON_NOUNS)\n}", "title": "" }, { "docid": "5a2be13a5a3dd4cad706e400c50cfd48", "score": "0.511604", "text": "function getFingerprint(_x7) {\n var _again = true;\n\n _function: while (_again) {\n var str = _x7;\n _loop = i = _ret2 = undefined;\n _again = false;\n\n var _loop = function () {\n var fingerprintRegex = fingerprintRegexs[i];\n var result = fingerprintRegex.exec(str);\n fingerprintRegex.lastIndex = 0;\n\n if (result && !_badFingerprintsJs.badFingerprints.includes(result[1]) && !_badFingerprintsJs.badSubstrings.find(function (badSubstring) {\n return result[1].includes(badSubstring);\n })) {\n return {\n v: result[1]\n };\n }\n if (result) {} else {}\n };\n\n for (var i = 0; i < fingerprintRegexs.length; i++) {\n var _ret2 = _loop();\n\n if (typeof _ret2 === 'object') return _ret2.v;\n }\n // This is pretty ugly but getting fingerprints is assumed to be used only when preprocessing and\n // in a live environment.\n if (str.length > 8) {\n // Remove first and last char\n _x7 = str.slice(1, -1);\n _again = true;\n continue _function;\n }\n // console.warn('Warning: Could not determine a good fingerprint for:', str);\n return '';\n }\n }", "title": "" }, { "docid": "0b82cf93ac75a0b50c1c93aa73fdb7f4", "score": "0.51034623", "text": "function GetNumberType(name) {\n switch (name) {\n case \"sodatank\":\n case \"gaugetank\":\n case \"acidtank\":\n case \"sodastotank\":\n case \"waterstotank\":\n case \"danti\":\n case \"acidstotank\":\n case \"jar\":\n case \"reactor\":\n case \"fupeitank\":\n case \"mixtank\":\n return \"1\";\n break;\n case \"handvalve1\":\n case \"handvalve2\":\n case \"dropvalve\":\n case \"switchvalve\":\n case \"convert11\":\n case \"convert12\":\n case \"convert13\":\n case \"convert14\":\n case \"convert21\":\n case \"convert22\":\n case \"convert23\":\n case \"convert24\":\n case \"line11\":\n case \"line12\":\n case \"pump\":\n case \"elect\":\n case \"tem_sensor\":\n case \"ph_sensor\":\n case \"gravity_sensor\":\n case \"ele_sensor\":\n case \"alarm\":\n return \"2\";\n break;\n default:\n return \"0\";\n break;\n }\n}", "title": "" }, { "docid": "4af816c2e75b1baea23b7bff9f21ac92", "score": "0.5102826", "text": "function handCheck(hand) {\n console.log(hand);\n var cardValue = \"\";\n for (let card = 0; card < hand.length; card++) {\n cardValue = hand[card].slice(0, hand[card].lastIndexOf(\" \") + 1);\n typeCount[cardTypes.indexOf(cardValue)]++;\n }\n //console.log(typeCount);\n if (royalFlushCheck(hand) === true) {\n return \"Royal flush!\";\n }\n if (straightFlushCheck(hand) === true) {\n return \"Straight flush\";\n }\n if (fourOfAKindCheck() === true) {\n return \"Four of a kind\";\n }\n if (fullHouseCheck() === true) {\n return \"Full house\";\n }\n if (flushCheck(hand) === true) {\n return \"Flush\";\n }\n if (straightCheck() === true) {\n return \"Straight\";\n }\n if (threeOfAKindCheck() === true) {\n return \"Three of a kind\";\n }\n if (twoPairCheck() === true) {\n return \"Two pair\";\n }\n if (pairCheck() !== false) {\n return pairCheck();\n }\n return highCard();\n }", "title": "" }, { "docid": "c8c2263eea032474ec15e63799f388fe", "score": "0.5101236", "text": "function number2words(n) {\n\n var names = ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten',\n 'eleven', 'twevel', 'thirteen', 'fourteen', 'fifteen', 'sixteen',\n 'seventeen', 'eighteen', 'nineteen'\n ]; // 1-19\n\n var tens = ['twenty', 'thirty', 'forty', 'fifty', 'sixty', 'seventy', 'eighty', 'ninety'];\n\n if (n <= 19) {\n return names[n];\n }\n if (n < 100 && n > 19) {\n\n }\n\n function tensDigit(a) {\n\n // twenty-four\n }\n\n}", "title": "" }, { "docid": "c6b1285ad71dbe7b166a17ccad001e88", "score": "0.50934154", "text": "function famousFizzBuzz(number){\r\n\tif(number%3 == 0 && number % 5 == 0)\r\n\t\treturn 'FizzBuzz';\r\n\tif(number%3 ==0 )\r\n\t\treturn 'Fizz'\r\n\tif(number%5 ==0 )\r\n\t\treturn 'Buzz'\r\n\telse\r\n\t return 'Neither! Try another number';\r\n\t// console.log('Enter a number');\r\n\t// var userInput = readLine();\r\n\t// console.log(userInput); Doesn't work, need to check - readLine() specific to spiderMonkey, Firefox\r\n}", "title": "" }, { "docid": "147e337ea9b9491eb1d5ba75dd8a57a7", "score": "0.5091557", "text": "bestHand() {\n // let result = \"NOT WORKING: RECHECK\";\n\n // this is exceuted in order of the top poker hand on wiki.\n if (this.containsRoyalFlush()) {\n result = \"Royal Flush\";\n } else if (this.containsStraightFlush()) {\n result = \"Straight Flush\";\n } else if (this.containsFourOfAKind()) {\n result = \"Four of a Kind\";\n } else if (this.containsFullHouse()) {\n result = \"Full House\";\n } else if (this.containsFlush()) {\n result = \"Flush\";\n } else if (this.containsStraight()) {\n result = \"Straight\";\n } else if (this.containsThreeOfAKind()) {\n result = \"Three of a Kind\";\n } else if (this.containsTwoPair()) {\n result = \"Two Pair\";\n } else if (this.containsPair()) {\n result = \"Pair\";\n }\n else {\n result = this.highCard();\n }\n return result;\n }", "title": "" }, { "docid": "df265246544f9c075367d179d417b8e0", "score": "0.5087992", "text": "function strangerToFriend(str) {\n let familiarity = {}\n let friends = [];\n let acquaintances = [];\n let splitFam = str.split(' ');\n for(let i = 0; i < splitFam.length; i++) {\n if(!familiarity[splitFam[i]]) {\n familiarity[splitFam[i]] = 1;\n } else {\n familiarity[splitFam[i]] += 1;\n }\n }\n for(const familiar in familiarity) {\n if(familiarity[familiar] >= 5){\n friends.push(familiar);\n } else if (familiarity[familiar] >= 3) {\n acquaintances.push(familiar);\n }\n }\n// return([friends, acquaintances]);\n return(`Friends: ${friends.join(', ')}; Aquaintances: ${acquaintances.join(', ')}`);\n}", "title": "" }, { "docid": "428bbfc19b85a35e1436c303f083aa99", "score": "0.50772905", "text": "function frequency(str) {\n if (str == \"hallmark\") {\n return 1;\n } else if (str == \"typical\") {\n return 2;\n } else if (str == \"occasional\") {\n return 3;\n } else if (str == \"rare\") {\n return 4;\n } else if (str != \"\") {\n return 5;\n }\n return 6;\n }", "title": "" }, { "docid": "68ad429ac8cfd63ffb5d5f3a8696d516", "score": "0.5076243", "text": "function factorial(num) {\r\n\tif(num ===0 || num === 1) {\r\n\t\treturn 1\r\n\t}\r\n\t\r\n\tfor(var i = num -1 ; i--) {\r\n\t\tvar a = (i * (i-1));\r\n\t\treturn a*(i)\r\n\r\n\t}\r\n\r\n\treturn (\"whats up\")\r\n}\r\n\r\n// Suggested solution on freeCodeCamp\r\nfunction factorialize(num) {\r\n if (num === 0 || num === 1)\r\n return 1;\r\n for (var i = num - 1; i >= 1; i--) {\r\n num *= i;\r\n }\r\n return num;\r\n}\r\n\r\n// \"num*= i\" is equivalient to \"num = num * i\", thus over-writing the value of num to be the end caluclated number after each iteration\r\n// Colt's solution does not require an if function, by setting min variable for i to begin from 2\r\n\r\n\r\n// Write a function kebabToSnake() which takes a single kebab-cased string argument and returns the snake_cased version\r\nfunction kebabToSnake(input) {\r\n\tvar output = input.replace(/-/g, \"_\");\r\n\treturn output;\r\n}", "title": "" }, { "docid": "24b059d913ea07040850a022b359bca3", "score": "0.5070386", "text": "function tinyFriend(friendsName){\n var tinyFind = friendsName[0].length;\n for(var i=0; i<friendsName.length; i++){\n if(friendsName[i].length<tinyFind){\n var smallFrnd = friendsName[i];\n }\n }\n console.log(smallFrnd);\n }", "title": "" }, { "docid": "3c8a7ab9d1919885db9c622d7f40ffef", "score": "0.5061753", "text": "function featured(n) {\n if (n > 999999987) { return 'No featured number higher than input'; }\n\n var current = n;\n\n current = nextMultiple7(current);\n\n while (current % 2 === 0 || !isUnique(String(current).split(''))) {\n current = nextMultiple7(current);\n }\n\n return current;\n}", "title": "" }, { "docid": "5bc3130fa7ed5419ad24421ff9d4f9a1", "score": "0.5060886", "text": "function rollFortune(arg) {\n var answers = ['大吉 - A great blessing.',\n '中吉 - A medium blessing.',\n '小吉 - A small blessing.',\n '吉 - A normal blessing.',\n '半吉 - A half blessing.',\n '末吉 - Good luck will come to you in the future.',\n '末小吉 - A tiny bit of luck will come to you in the future.',\n '凶 - A curse.',\n '小凶 - A small curse.',\n '半凶 - A half curse.',\n '末凶 - You shall be visited by a curse in the future.',\n '大凶 - A terrible curse.']\n var seedrandom = require('seedrandom');\n var rng = seedrandom( Number(arg[0]), { entropy: true } );\n return answers[Math.floor(rng()*answers.length)];\n}", "title": "" }, { "docid": "1d137df45c1f7224d997d055e5021394", "score": "0.5059731", "text": "function singer_lengh(artist_name, index) {\n var artist_lengh = artist_name[index];\n return artist_lengh.length;\n}", "title": "" }, { "docid": "126390c95bdd0f2b3357d110ce84f6b8", "score": "0.5049924", "text": "function AlanAnnoyingKid(input){\n\t//Even Alan's kid hates hardcoders.\n const kid = input.split(' ').splice(2);\n const alan = kid.join(' ').replace('.', ''); \n \n if( alan.includes(\"didn't\")){\n const verb = kid[1];\n return \"I don't think you \"+ alan + ' today, I think you did ' + verb + ' it!' ;\n }\n else {\n var foo = kid[0].replace('ed', '');\n return \"I don't think you \"+ alan + \" today, I think you didn't \" + foo + ' at all!' ;\n }\n\t\t}", "title": "" }, { "docid": "509957b5e71a11ae0a6b5ac3cbd892d7", "score": "0.50436944", "text": "function howMuchILoveYou(n) {\n const arr = ['I love you', 'a little','a lot', \n 'passionately','madly','not at all']\n return arr[(n-1)%6]\n}", "title": "" }, { "docid": "f5e313c8d116d5004e985d8ac9b6f2ed", "score": "0.5035278", "text": "function countingSheep(num) {\n\tif (num === 0) {\n\t\treturn;\n\t}\n\tconsole.log(num);\n\tcountingSheep(num - 1) + 'Another Sheep Jumps Over the Fence';\n}", "title": "" }, { "docid": "c26326ebcc9b8214a7850304bea137af", "score": "0.50348526", "text": "function tellFortune (numOfchilden, partner, location, jobTitle){\n var x = jobTitle;\n var y = location;\n var z = partner;\n var n = numOfchilden;\n return console.log('You will be a', x, 'in', y, 'and married to ', z,'with', n, 'kids.');\n}", "title": "" }, { "docid": "010748a3385ffb35d75cf7d426efce29", "score": "0.50322175", "text": "function howManyLightsabersDoYouOwn(name) {\n return name === 'Zach' ? 18 : 0;\n}", "title": "" }, { "docid": "ebe74e872792cfb32f534e076ce18774", "score": "0.5031529", "text": "function getBook(name,parts){\n parts=(typeof parts==='undefined' || !parts)?false:true;\n name=name.replace('.','').toUpperCase();\n switch(name.charAt(0)){\n case '1': //First\n return getBook123(name.replace(/^1\\s*/,''),1,parts);\n case '2': //Second\n return getBook123(name.replace(/^2\\s*/,''),2,parts);\n case '3': //3 John NT[24]\n return parts?[NT,'3 John']:NT['3 John'];//getBook123(name.replace(/[^\\s]+\\s+/,''),3);\n case 'A':\n if(name.charAt(1)==='C')//Acts NT[4]\n return parts?[NT,'Acts']:NT['Acts'];\n else //Amos OT[29]\n return parts?[OT,'Amos']:OT['Amos'];\n case 'C': //Colossians NT[11]\n return parts?[NT,'Col.']:NT['Col.'];\n case 'D':\n if(name.charAt(2)==='N'||name.charAt(1)==='N')//Daniel OT[26]\n return parts?[OT,'Dan.']:OT['Dan.'];\n else //Deuteronomy OT[4]\n return parts?[OT,'Deut.']:OT['Deut.'];\n case 'E':\n switch(name.charAt(1)){\n case 'C': //Ecclesiastes OT[20]\n return parts?[OT,'Eccl.']:OT['Eccl.'];\n case 'P': //Ephesians NT[9]\n return parts?[NT,'Eph.']:NT['Eph.'];\n case 'S': //Esther OT[16]\n return parts?[OT,'Esth.']:OT['Esth.'];\n case 'X': //Exodus OT[1]\n return parts?[OT,'Exo.']:OT['Exo.'];\n case 'Z':\n if(name.charAt(2)==='R')//Ezra OT[14]\n return parts?[OT,'Ezra']:OT['Ezra'];\n else //Ezekiel OT[25]\n return parts?[OT,'Ezek.']:OT['Ezek.'];\n }\n case 'F': //First\n return getBook123(name.replace(/[^\\s]+\\s+/,''),1,parts);\n case 'G':\n if(name.charAt(1)==='A')//Galatians NT[8]\n return parts?[NT,'Gal.']:NT['Gal.'];\n else //Genesis OT[0]\n return parts?[OT,'Gen.']:OT['Gen.'];\n case 'H':\n if(name.charAt(1)==='E')//Hebrews NT[18]\n return parts?[NT,'Heb.']:NT['Heb.'];\n else if(name.charAt(1)==='O')//Hosea OT[27]\n return parts?[OT,'Hosea']:OT['Hosea'];\n else if(name.charAt(2)==='B'||name.charAt(1)==='B')//Habakkuk OT[34]\n return parts?[OT,'Hab.']:OT['Hab.'];\n else //Haggai OT[36]\n return parts?[OT,'Hag.']:OT['Hag.'];\n case 'I': //Isaiah OT[22]\n return parts?[OT,'Isa.']:OT['Isa.'];\n case 'J':\n switch(name.charAt(1)){\n case 'A': //James NT[19]\n return parts?[NT,'James']:NT['James'];\n case 'B': //Jb\\\\. Job OT[17]\n return parts?[OT,'Job']:OT['Job'];\n case 'D': //Jds\\\\. Judges OT[6]\n return parts?[OT,'Judg.']:OT['Judg.'];\n case 'E': //Jeremiah OT[23]\n return parts?[OT,'Jer.']:OT['Jer.'];\n case 'L': //Jl\\\\. Joel OT[29]\n return parts?[OT,'Joel']:OT['Joel'];\n case 'N': //Jn\\\\. John NT[3]\n return parts?[NT,'John']:NT['John'];\n case 'O':\n switch(name.charAt(2)){\n case 'B': //Job OT[17]\n return parts?[OT,'Job']:OT['Job'];\n case 'E': //Joel OT[29]\n return parts?[OT,'Joel']:OT['Joel'];\n case 'H': //John NT[3]\n return parts?[NT,'John']:NT['John'];\n case 'N': //Jonah OT[31]\n return parts?[OT,'Jonah']:OT['Jonah'];\n default: //Joshua OT[5]\n return parts?[OT,'Josh.']:OT['Josh.'];\n }\n case 'U':\n if(name.charAt(3)==='E')//Jude NT[25]\n return parts?[NT,'Jude']:NT['Jude'];\n else //Judges OT[6]\n return parts?[OT,'Judg.']:OT['Judg.'];\n }\n case 'L':\n if(name.charAt(1)==='A')//Lamentations OT[24]\n return parts?[OT,'Lam.']:OT['Lam.'];\n else if(name.charAt(2)==='K'||name.charAt(1)==='K')//Luke NT[2]\n return parts?[NT,'Luke']:NT['Luke'];\n else //Leviticus OT[2]\n return parts?[OT,'Lev.']:OT['Lev.'];\n case 'M':\n if(name.charAt(1)==='I')//Micah OT[32]\n return parts?[OT,'Micah']:OT['Micah'];\n else if(name.charAt(2)==='L')//Malachi OT[38]\n return parts?[OT,'Mal.']:OT['Mal.'];\n else if(name.charAt(2)==='T'||name.charAt(1)==='T')//Matthew NT[0]\n return parts?[NT,'Matt.']:NT['Matt.'];\n else //Mark NT[1]\n return parts?[NT,'Mark']:NT['Mark'];\n case 'N':\n if(name.charAt(1)==='E')//Nehemiah OT[15]\n return parts?[OT,'Neh.']:OT['Neh.'];\n else if(name.charAt(1)==='A')//Nahum OT[33]\n return parts?[OT,'Nahum']:OT['Nahum'];\n else //Numbers OT[3]\n return parts?[OT,'Num.']:OT['Num.'];\n case 'O': //Obadiah OT[30]\n return parts?[OT,'Oba.']:OT['Oba.'];\n case 'P':\n if(name.charAt(1)==='H'){\n if(name.charAt(5)==='M'||name.charAt(3)==='M')//Philemon NT[17]\n return parts?[NT,'Philem.']:NT['Philem.'];\n else //Philippians NT[10]\n return parts?[NT,'Phil.']:NT['Phil.'];\n } else if(name.charAt(1)==='R')//Proverbs OT[19]\n return parts?[OT,'Prov.']:OT['Prov.'];\n else //Psalms OT[18]\n return parts?[OT,'Psa.']:OT['Psa.'];\n case 'R':\n if(name.charAt(1)==='O') //Romans NT[5]\n return parts?[NT,'Rom.']:NT['Rom.'];\n else if(name.charAt(1)==='U') //Ruth OT[7]\n return parts?[OT,'Ruth']:OT['Ruth'];\n else //Revelation NT[26]\n return parts?[NT,'Rev.']:NT['Rev.'];\n case 'S':\n if(name.charAt(1)==='E')//Second\n return getBook123(name.replace(/^Second\\s*/i,''),2,parts);\n else //Song of Songs OT[21]\n return parts?[OT,'S.S.']:OT['S.S.'];\n case 'T':\n if(name.charAt(1)==='H') //Third John NT[24]\n return parts?[NT,'3 John']:NT['3 John'];//getBook123(name.replace(/[^\\s]+\\s+/,''),3);\n else //Titus NT[16]\n return parts?[NT,'Titus']:NT['Titus'];\n case 'Z':\n if(name.charAt(2)==='C') //Zechariah OT[37]\n return parts?[OT,'Zech.']:OT['Zech.'];\n else //Zephaniah OT[35]\n return parts?[OT,'Zeph.']:OT['Zeph.'];\n }\n}", "title": "" }, { "docid": "9b7dd7a7561ef57026635d33ad137302", "score": "0.5029805", "text": "function challenge(n){\n return '############ Challenge ' + n + ' ############'\n}", "title": "" }, { "docid": "b95af1b6db85966342db73a8fd4ed5c6", "score": "0.502913", "text": "function russianRoulette(num) {\n let counter = 0;\n return () => {\n counter++;\n if (counter < num) return 'click';\n else {\n if (counter === num) return 'bang';\n else return ' reload to play again';\n }\n };\n}", "title": "" }, { "docid": "daa39788151340a91339a8ab1f64564f", "score": "0.5027686", "text": "function scoreInUniversty(number) {\r\n if (number >= 95) {\r\n return 'A';\r\n } else if (number >= 85) {\r\n return 'B';\r\n } else if (number >= 70) {\r\n return 'C';\r\n } else if (number >= 50) {\r\n return 'D';\r\n } else {\r\n return 'F';\r\n }\r\n}", "title": "" }, { "docid": "d7ff97252af2f1e7c06e5e7031fb3207", "score": "0.50234765", "text": "function get_tone_distance(note) {\n note = note.toUpperCase();\n match = note_scifnot.exec(note);\n return note_array.indexOf(match[1]) + 1 + (7 * parseInt(match[2]));\n}", "title": "" }, { "docid": "f40c023bada9156b5f797e99e82f8264", "score": "0.50201976", "text": "function howManyLightsabersDoYouOwn(name) {\n return name === \"Zach\" ? 18 : 0\n}", "title": "" }, { "docid": "f81a3c4f14be923f2dc01d1e479981db", "score": "0.50119597", "text": "function whichPair(cards) {\n\tvar newList = [];\n\tvar pairs = {};\n\tvar finalDict = {};\n\tvar numOfCards = 1;\n\tvar fourOfaKind = 0;\n\tvar threeOfaKind = 0;\n\tvar pair = 0;\n\tvar pairList = sortCards(cards);\n\tvar comp;\n\tvar returnValue;\n\tvar extraValue;\n\tvar answer;\n\tvar i = 0;\n\n\t// Find the values that are associate to the points\n\tfor (i = 0; i < pairList.length; i++) {\n\t\tnewList.push(values[pairList[i]]);\n\t}\n\n\tfor (i = 0; i < newList.length; i++) {\n\t\t// If the next value is the current value, then skip\n\t\tif (comp == newList[i]) {\n\t\t\tcontinue;\n\t\t}\n\t\tcomp = newList[i];\n\t\t// Look through the list and see if the value appears again\n\t\tfor (var j = i; j < (newList.length-1); j++) {\n\t\t\tif (comp == newList[j+1]) {\n\t\t\t\tnumOfCards++;\n\t\t\t}\n\t\t}\n\t\t// If there are multiple card values, then store it inside the dictionary\n\t\tif (numOfCards > 1) {\n\t\t\tpairs[comp] = numOfCards;\n\t\t}\n\t\tnumOfCards = 1;\n\t}\n\n\tvar keyList = Object.keys(pairs);\n\tfor (i = 0; i < keyList.length; i++) {\n\t\tswitch(pairs[keyList[i]]) {\n\t\t\tcase 4:\n\t\t\t\tfourOfaKind++;\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tthreeOfaKind++;\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tpair++;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tif(fourOfaKind == 1) {\n\t\treturnValue = findValue(pairs,keyList,4);\n\t\tanswer = \"four of a kind of \" + returnValue;\n\t\treturn answer;\n\t}\n\telse if(threeOfaKind == 1 && pair >= 1) {\n\t\treturnValue = findValue(pairs,keyList,3);\n\t\textraValue = findValue(pairs,keyList,2);\n\t\tanswer = \"Full House with \" + returnValue + \" and \" + extraValue;\n\t\treturn answer;\n\t}\n\telse if(threeOfaKind >= 1) {\n\t\treturnValue = findValue(pairs,keyList,3);\n\t\tanswer = \"three of a kind of \" + returnValue;\n\t\treturn answer;\n\t}\n\telse if(pair > 1) {\n\t\treturnValue = findValue(pairs,keyList,2);\n\t\textraValue = findValue(pairs,keyList,2,returnValue);\n\t\tanswer = \"two pair with \" + returnValue + \" and \" + extraValue;\n\t\treturn answer;\n\t}\n\telse if(pair == 1) {\n\t\treturnValue = findValue(pairs,keyList,2);\n\t\tanswer = \"It is a pair of \" + returnValue;\n\t\treturn answer;\n\t}\n\n}", "title": "" }, { "docid": "63cad948f3478a1b2b59198e17d57076", "score": "0.5010861", "text": "function whichFlush(cards) {\n\tvar flushList = sortCards(cards);\n\tvar isRoyal = 0;\n\tvar i;\n\n\t// If values match the beginning values\n\tfor(i = 0; i < 5; i++) {\n\t\tif (flushList[i] == i) {\n\t\t\tisRoyal++;\n\t\t}\n\t}\n\n\tif (isRoyal > 4){\n\t\treturn \"Royal Flush\";\n\t}\n\telse {\n\t\treturn \"Straight Flush\";\n\t}\n}", "title": "" }, { "docid": "9ec568b86895ba240020848722162c23", "score": "0.500272", "text": "function reverseHash(number) {\n\n var originalNumber = number;\n var letters = [\"a\", \"c\", \"d\", \"e\", \"g\", \"i\", \"l\", \"m\", \"n\", \"o\", \"p\",\n \"r\", \"s\", \"t\", \"u\", \"w\"]; // our letter\n var number_count = []; // array to hold the number checkpoints \n var originalstring = ''; // string we will build/rebuild\n\n for (var i = 0; i < 6; i++) { // loop through dividing our starting number by 37\n number = (number / 37); // this will generate marks we can subtract from to find the letters\n number_count.push(number); // put our numbers in our array to use later\n }\n\n var firstLetterIndex = number - 259; // subtract to find the index of the first letter\n firstLetterIndex = Math.round(firstLetterIndex); // round off\n originalstring += letters[firstLetterIndex]; // rebuild our string\n number = Math.round(number); // round off\n\n var counter = 4;\n for (var j = 0; j < 5; j++){ //loop through and build the main part of our string\n\n number = number * 37;\n var letterIndex = number_count[counter] - number; //generate index of our letter\n letterIndex = Math.round(letterIndex);\n originalstring += letters[letterIndex]; //get the letter\n //number += letterIndex;\n number = Math.round(number) + letterIndex; //round and add so we can get to the next number check point\n counter--; //move the counter\n }\n\n number = number * 37;\n var LastLetterIndex = originalNumber - number; //generate index of last letter\n LastLetterIndex = Math.round(LastLetterIndex); //get the last letter\n originalstring += letters[LastLetterIndex]; // finish building our string\n\n console.log(originalstring);\n console.log(number + LastLetterIndex);\n}", "title": "" }, { "docid": "a412b60009199554eefe68089ab6c0d9", "score": "0.50001025", "text": "function fizzy(num) {\n if (num % 3 === 0 && num % 5 === 0) {\n return \"FizzBuzz\";\n } else if (num % 3 === 0) {\n return \"Fizz\";\n } else if (num % 5 === 0) {\n return \"Buzz\";\n } else return num;\n}", "title": "" }, { "docid": "08d35fb959250f182076519cdb9fa3c5", "score": "0.49969324", "text": "function countSheep(num){\n let s = ''\n for(let i = 1; i <= num; i++){\n s = s + i + ' sheep...'\n }\n return s\n}", "title": "" }, { "docid": "0d20592c9ec1934a483245b5f632011f", "score": "0.4991123", "text": "function nameToNote(name) {\n // letter accidental -? number\n let groups = /^([ABCDEFG])(#|##|B|BB|S|SS)?(-)?([0-9]+)$/.exec(name.toUpperCase().trim());\n\n try {\n return letter_nums[groups[1]] + // semitone offset of note without accidental\n (groups[2] ? accidental_offsets[groups[2]] : 0) + // semitone offset of accidental\n (groups[3] ? -12 : 12) * (parseInt(groups[4])) + 12; // octave offset of note\n } catch (e) {\n throw new Error(\"Invalid note\");\n }\n }", "title": "" }, { "docid": "08d527c21798561957eaef8a1b72927a", "score": "0.49855503", "text": "function hoopCount (n) {\n return n>=10 ? \"Great, now move on to tricks\" : \"Keep at it until you get it\"\n}", "title": "" }, { "docid": "d6baa36ba6aeeafe6d5075d27fd53384", "score": "0.49792022", "text": "function goToLunch(student){\n // Instruction go here.\n console.log(student + \", walk around desk\");\n console.log(student + \", turn right\");\n console.log(student + \", walk 10 paces\");\n console.log(student + \", grab door handle\");\n console.log(student + \", turn handle\");\n console.log(student + \", walk out door\");\n return student.toUpperCase();\n}", "title": "" }, { "docid": "f6c5705cb7dffa48144d692e0c4d033d", "score": "0.4977283", "text": "function recognize(sketch) {\r\n let lastStroke = sketchSurface.activeSRLStroke;\r\n \r\n if (lastStroke) { // Segments and places substrokes into sketch.substrokes\r\n //let substrokes = recognizers.Segment(lastStroke);\r\n //for (let i = 0; i < substrokes.length; i++) {\r\n sketch.addStroke(lastStroke);\r\n //}\r\n }\r\n\r\n\r\n // this function calls $1 algorithm for template matching\r\n var name = 'default';\r\n var score = 0.0;\r\n var ms = 0.0;\r\n var dr = new DollarRecognizer();\r\n name = dr.Recognize(lastStroke.getPoints(),true);\r\n //console.log(name);\r\n return name;\r\n\r\n\r\n\r\n\r\n //dr.AddGesture('arrow2',lastStroke.getPoints());\r\n\r\n /*var pdr = new PDollarRecognizer();\r\n var ans = pdr.Recognize(lastStroke.getPoints());\r\n console.log(ans);*/\r\n\r\n\r\n // Example of how you can create a shape\r\n /*\r\n let shape = new Sketch.Shape();\r\n shape.setInterpretation('circle');\r\n for (let id of substrokeIds) {\r\n shape.addSubElement(sketch.substrokes[id]);\r\n delete sketch.substrokes[id]; // Removes from sketch.substrokes if you want to use sketch.substrokes as a holder for unrecognized substrokes\r\n }\r\n */\r\n \r\n // Example of how you can change the color/size of strokes and make them unerasable given the shapeId\r\n /*\r\n let shapeId = undefined;\r\n for (let substroke of sketch.shapes[shapeId].strokes) {\r\n let paperPath = sketchSurface.srlToPaper[substroke.parent];\r\n paperPath.erasable = false;\r\n paperPath.strokeColor = 'orange';\r\n paperPath.strokeWidth = 2;\r\n }\r\n */\r\n}", "title": "" }, { "docid": "39fec1171905552c97d838456b17a3c7", "score": "0.49723592", "text": "function TargetNameToFrequency(noteName) {\n for (let note in notes.target) {\n if (noteName === note) {\n return notes.target[note];\n }\n }\n}", "title": "" }, { "docid": "c7abbf1f575339f41fe57e5e2ef69876", "score": "0.49680495", "text": "function sayit (number) {\n\tvar word = \"\";\n\tvar numLength = number.toString().length;\n\tvar myArr = [];\n\tmyArr = (number).toString().split(\"\").map(Number);\n\tif (number < 20) {\n\t\tword = num(number);\n\t}\n\telse if (number < 100) {\n\t\tword = (prefix(myArr[0]) + \"-\" + num(myArr[1]));\n\t}\n\telse if (number < 1000) {\n\t\tif (myArr[1] == 1) {\n\t\t\tvar teen = (\"\" + myArr[1] + myArr[2]);\n\t\t\tteen = Number(teen);\n\t\t\tword = (num(myArr[0]) + \"-hundred \" + num(teen));\n\t\t}\n\t\telse {\n\t\t\tword = (num(myArr[0]) + \"-hundred \" + prefix(myArr[1]) + \" \" + num(myArr[2]));\n\t\t}\n\t}\n\telse {\n\t\tword = \"comming soon!\";\n\t}\n\treturn word;\n\tfunction prefix (number) {\n\t\tvar word = \"\";\n\t\tswitch (number) {\n\t\t\tcase 2:\n\t\t\t\tword = \"twenty\";\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tword = \"thirty\";\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\tword = \"fourty\";\n\t\t\t\tbreak;\n\t\t\tcase 5:\n\t\t\t\tword = \"fifty\";\n\t\t\t\tbreak;\n\t\t\tcase 6:\n\t\t\t\tword = \"sixty\";\n\t\t\t\tbreak;\n\t\t\tcase 7:\n\t\t\t\tword = \"seventy\";\n\t\t\t\tbreak;\n\t\t\tcase 8:\n\t\t\t\tword = \"eighty\";\n\t\t\t\tbreak;\n\t\t\tcase 9:\n\t\t\t\tword = \"ninety\";\n\t\t\t\tbreak;\n\t\t}\n\t\treturn word;\n\t}\n\tfunction num (number) {\n\t\tvar word = \"\";\n\t\tswitch (number) {\n\t\t\tcase 0:\n\t\t\t\tword = \"\";\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tword = \"one\";\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tword = \"two\";\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tword = \"three\";\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\tword = \"four\";\n\t\t\t\tbreak;\n\t\t\tcase 5:\n\t\t\t\tword = \"five\";\n\t\t\t\tbreak;\n\t\t\tcase 6:\n\t\t\t\tword = \"six\";\n\t\t\t\tbreak;\n\t\t\tcase 7:\n\t\t\t\tword = \"seven\";\n\t\t\t\tbreak;\n\t\t\tcase 8:\n\t\t\t\tword = \"eight\";\n\t\t\t\tbreak;\n\t\t\tcase 9:\n\t\t\t\tword = \"nine\";\n\t\t\t\tbreak;\n\t\t\tcase 10:\n\t\t\t\tword = \"ten\";\n\t\t\t\tbreak;\n\t\t\tcase 11:\n\t\t\t\tword = \"eleven\";\n\t\t\t\tbreak;\n\t\t\tcase 12:\n\t\t\t\tword = \"twelve\";\n\t\t\t\tbreak;\n\t\t\tcase 13:\n\t\t\t\tword = \"thirteen\";\n\t\t\t\tbreak;\n\t\t\tcase 14:\n\t\t\t\tword = \"fourteen\";\n\t\t\t\tbreak;\n\t\t\tcase 15:\n\t\t\t\tword = \"fifteen\";\n\t\t\t\tbreak;\n\t\t\tcase 16:\n\t\t\t\tword = \"sixteen\";\n\t\t\t\tbreak;\n\t\t\tcase 17:\n\t\t\t\tword = \"seventeen\";\n\t\t\t\tbreak;\n\t\t\tcase 18:\n\t\t\t\tword = \"eighteen\";\n\t\t\t\tbreak;\n\t\t\tcase 19:\n\t\t\t\tword = \"nineteen\";\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tword = \"hmmm I don't seem to know that number\";\n\t\t\t\tbreak;\n\t\t\t\t\t }\n\t\treturn word;\n\t}\n}", "title": "" }, { "docid": "77ab208518b5f9f52b87d35ed377f933", "score": "0.4956547", "text": "function countSheep(number) {\n if (number === 0) {\n console.log('All sheep jumped over the fence')\n } else {\n console.log(`${number}: Another sheep jumps over the fence`)\n countSheep(number - 1)\n }\n}", "title": "" }, { "docid": "726b2cb433c9b3d1e8a8a6eee4f98af0", "score": "0.49500847", "text": "function cardName(number) {\r\n var suit = cardSuit(number);\r\n switch (number%13) {\r\n case 0: return 'Ace of ' + suit;\r\n case 10: return 'Jack of ' + suit;\r\n case 11: return 'Queen of ' + suit;\r\n case 12: return 'King of ' + suit;\r\n default: return (number%13)+1 + ' of ' + suit;\r\n }\r\n}", "title": "" }, { "docid": "56e227a4ce06658d9329bbb0b71107c5", "score": "0.49446166", "text": "function hoopCount(n) {\n return n >= 10\n ? \"Great, now move on to tricks\"\n : \"Keep at it until you get it\";\n}", "title": "" }, { "docid": "788fc3c8857e3941189968b1cb55249a", "score": "0.49444413", "text": "function getHighCard(hand) {\n let handNumbers = hand.map( card => numbers.indexOf(card.split(\"\")[0]));\n return handNumbers.sort((a, b) => b - a)[0];\n}", "title": "" }, { "docid": "7ca42b5de79e626aa63b274bdf4232d5", "score": "0.49308103", "text": "function hoopCount (n) {\n return (n < 10) ? 'Keep at it until you get it' : 'Great, now move on to tricks';\n}", "title": "" }, { "docid": "3a12e653fdfeab3a868e566d62461924", "score": "0.49195066", "text": "function getFirstName(num){\n var firstNames = [\"Joe\",\"Mary\",\"Sue\",\"Jose\",\"Brad\",\"John\",\"Kate\",\"Malik\",\"Bianca\",\"Jason\"];\n return firstNames[num];\n}", "title": "" }, { "docid": "5fc2c6f096cae22e090b3a2fdf48f2fe", "score": "0.4919131", "text": "function calculateShot(beer, num) {\n var abv = beer.abv;\n var size = 12;\n var numofstdrinks = (abv/100)*size*2*num;\n var toPut = Math.floor(numofstdrinks * 100) / 100;\n $(\"#result-font\").html(\"You have had <strong><span id='drink-count'>\" +toPut+\"</span></strong> Standard Drinks</h3>\");\n return numofstdrinks;\n}", "title": "" }, { "docid": "bdeac1396d83ee7507124708f4a55fdb", "score": "0.49141207", "text": "function handValue (hands) {\nlet card = 0\nlet hand = 0\nfor (var i = 0; i < hands.length; i++) {\n if (hands[i] === \"K\" || hands[i] === \"J\" || hands[i] === \"Q\") {\n card = 10\n hand += card\n } else if (hands[i] === \"A\") {\n card = 11\n hand += card\n } else {\n hand = hand + parseInt(hands[i])\n } if (hand > 21) {\n hand -= 10 \n }\n}\nconsole.log(hand);\n return hand;\n}", "title": "" }, { "docid": "3e5913d6d396318a268f0f91e7197c12", "score": "0.49124", "text": "function matchHouses(step) {\r\n\tif (step === 0) {\r\n\t\treturn 0;\r\n\t} else if(Math.sign(step) === -1) {\r\n\t\treturn \"\";\r\n\t}\r\n\tvar result = (5 * step) + 1;\r\n\treturn result;\r\n}", "title": "" }, { "docid": "e06093a8e8a89565c037d1d2b47efec0", "score": "0.49009228", "text": "function keybase_key_fingerprint(fingerprint) {\n var output = '';\n\n if (fingerprint.length != 40 || !fingerprint) {\n return output;\n }\n\n var pos = fingerprint.length - 16;\n\n for (pos; pos < fingerprint.length; pos += 4) {\n output += fingerprint.substring(pos, pos + 4).toUpperCase() + ' ';\n }\n\n return output;\n }", "title": "" }, { "docid": "b2831a76d7ca17629c3e8610c6bd91ae", "score": "0.48963067", "text": "function howManySheep(n){\n let count = n\n while (count > 0){\n console.log(`Another sheep jumped over the fence`)\n count --\n }\n return 'All sheep jumped'\n \n }", "title": "" }, { "docid": "aa984d958146c0488aa96166f7dd3fcd", "score": "0.48943046", "text": "function giikerTwist(i, giikerState) {\n var twists = [\"B\", \"D\", \"L\", \"U\", \"R\", \"F\"];\n var twist = giikerState[32 + i * 2] - 1;\n var amount = giikerState[32 + 1 + i * 2];\n return twists[twist] + (amount == 2 ? \"2\" : amount == 3 ? \"'\" : \"\");\n}", "title": "" }, { "docid": "20b209dabed84e0a4055724228c53930", "score": "0.4893895", "text": "function noteFromPitch(frequency) {\r\n\r\n\tif (frequency >= 328 && frequency <= 334){\r\n\t\treturn \"E4\";\r\n\t} else if (frequency >= 246 && frequency <= 251){\r\n\t\treturn \"B\";\r\n\t} else if (frequency >= 185 && frequency <= 198){\r\n\t\treturn \"G\";\r\n\t} else if (frequency >= 144 && frequency <= 149){\r\n\t\treturn \"D\";\r\n\t} else if (frequency >= 106 && frequency <= 111){ \r\n\t\treturn \"A\";\r\n\t} else if (frequency >= 81 && frequency <= 83){\r\n\t} else {\r\n\t\treturn \"~\";\r\n\t}\r\n}", "title": "" }, { "docid": "e21caa44559cc0a4733bb815ed741d3b", "score": "0.48930737", "text": "function findFamous(know, n) {\n if (n <= 0) {\n return -1;\n }\n // Run a tournament to figure out who wins.\n // Loop invariant: winner is the only person who could be famous.\n let winner = 0;\n for (let challenger = 1; challenger < n; challenger++) {\n if (know(winner, challenger)) {\n // winner cannot be famous. challenger could be.\n winner = challenger;\n } else {\n // winner could be famous. challenger could not be.\n }\n }\n\n // Now check if winner actually is famous.\n for (let other = 0; other < n; other++) {\n if (other === winner) {\n continue;\n }\n if (know(winner, other) || !know(other, winner)) {\n // winner is not famous, so nobody can be\n return -1;\n }\n }\n return winner;\n}", "title": "" }, { "docid": "55f83d97804c2e89dcf3576872686470", "score": "0.48874444", "text": "function rentalCar(n,a){\n\tif (a>=21){\n\t\treturn \"Have fun driving \"+n;\n\t}return 'You cannot have the keys '+n;\n}", "title": "" }, { "docid": "683c5e8ced2990c97db89523e9b12c65", "score": "0.4885312", "text": "function nameNumber(num) {\n\t// function returns the name of any number (less than 1000)\n\tvar units, teens, tens, name;\n\n\tunits = {0: \"\", 1: \"one\", 2: \"two\", 3: \"three\", 4: \"four\", 5: \"five\",\n\t\t\t6: \"six\", 7: \"seven\", 8: \"eight\", 9: \"nine\"};\n\n\tteens = {10: \"ten\", 11: \"eleven\", 12: \"twelve\", 13: \"thirteen\",\n\t\t\t14: \"fourteen\", 15: \"fifteen\", 16: \"sixteen\", 17: \"seventeen\",\n\t\t\t18: \"eighteen\", 19: \"nineteen\"};\n\n\ttens = {1: \"ten\", 2: \"twenty\", 3: \"thirty\", 4: \"forty\", 5: \"fifty\",\n\t\t\t6: \"sixty\", 7: \"seventy\", 8: \"eighty\", 9: \"ninety\"};\n\n\tfunction makeTwoDigitNum(num) {\n\t\t// make a two-digit number or appendage\n\t\tvar name = \"\";\n\t\tif (num < 20) {\n\t\t\tname = teens[num]; // recognize teens\n\t\t} else if (num < 100) {\n\t\t\tnum = String(num);\n\t\t\tname = tens[num[0]]; // sth like twenty ...\n\t\t\tif (num[1] !== \"0\") {\n\t\t\t\tname += \"-\" + units[num[1]]; // ... -two\n\t\t\t}\n\t\t}\n\t\treturn name;\n\t}\n\n\tfunction makeThreeDigitNum(num) {\n\t\t// make a three-digit number or appendage\n\t\tvar name, numString;\n\t\tnumString = String(num);\n\t\tname = units[numString[0]] + \" hundred\";\n\t\tif (numString[1] === \"0\") {\n\t\t\tif (numString[2] !== \"0\") {\n\t\t\t\tname += \" and \" + units[numString[2]];\n\t\t\t} else {\n\t\t\t\tname += \"\";\n\t\t\t}\n\t\t} else {\n\t\t\t// slice two digits of the three\n\t\t\tnum = Number(numString.substring(1));\n\t\t\tname += \" and \" + makeTwoDigitNum(num); // and get two-digit name\n\t\t}\n\t\treturn name;\n\t}\n\n\t// main body\n\tif (num === 0) {\n\t\tname = \"zero\";\n\t} else if (num < 10) {\n\t\tname = units[num]; // returns the value in the units key-value pair\n\t} else if (num < 100) {\n\t\tname = makeTwoDigitNum(num);\n\t} else if (num < 1000) {\n\t\tname = makeThreeDigitNum(num);\n\t} else if (num === 1000) {\n\t\tname = \"one thousand\";\n\t}\n\treturn name;\n}", "title": "" }, { "docid": "854a576d8c26b8f808831e5baa297c24", "score": "0.4881581", "text": "function carinesUglyYeti() {\n var namePicked = getRandomElement(names)\n\n if (namePicked === \"THE\") {\n // Format title as \"The Adjective Animal\"\n return namePicked + \" \" + getAdjsAndAnimals();\n\n } else if (randomNumber([0,1,2,3,4,5,6,7,8,9]) % 2 == 0 || namePicked == \"MOM\" || namePicked == \"DAD\") {\n // Format title as \"Name's Adjective Animal\"\n return namePicked + \"'s \" + getAdjsAndAnimals();\n\n } else {\n // Format the title as \"Name The Adjective Animal\"\n return namePicked + \" \" + \" the \" + getAdjsAndAnimals();\n }\n}", "title": "" }, { "docid": "d108dcb1cd1cbc4e73297d9e541278bf", "score": "0.48803923", "text": "function countSheep(num) {\n if (num === 0) {\n return;\n }\n console.log(num + ' - Another sheep jump over the fence');\n return countSheep(num - 1);\n}", "title": "" }, { "docid": "19cd61dbfbf710fadc99e79c2504778c", "score": "0.48795485", "text": "function energyFAV(d){\n\tlet result = d.num_fav;\n\tfor (let i=0;i<d.num_replies;i++){\n\t\tresult += energyFAV(d.replies[i]);\n\t}\n\treturn result;\n}", "title": "" }, { "docid": "6c9f08b72983c4f19ef13c365fddc915", "score": "0.4874615", "text": "function cardSuit(number) { return SUITS[Math.floor((number-1)/13)]; }", "title": "" }, { "docid": "786036257fdd32559d8e924c20b058c7", "score": "0.48738602", "text": "function revealLetter(){\n var temp = \"\";\n var count = 0;\n console.log(answer);\n console.log(key);\n for(var x =0;x < answer.length;x++){\n if(answer[x] == '_' && count == 0){\n temp += key[x];\n count ++;\n }else{\n temp += answer[x];\n }\n }\n answer = temp;\n emitTitle(answer); \n\n}", "title": "" }, { "docid": "1d2dc8d86b7a7c3326146ea91c32ce09", "score": "0.48727745", "text": "function viralAdvertising(n){\r\n var likes=0\r\n var people=5\r\n for(var i=1;i<=n;i++){\r\n likes=likes+Math.floor(people/2);\r\n people=Math.floor((people/2))*3\r\n }\r\n return likes\r\n \r\n }", "title": "" }, { "docid": "39fdb33836ac3fcc2485354df6cfd082", "score": "0.48725522", "text": "function get_icon(a) {\n var letter = \"\"\n switch (a) {\n case \"desert eagle\":\n letter = \"A\"\n break\n case \"dual berettas\":\n letter = \"B\"\n break\n case \"five seven\":\n letter = \"E\"\n break\n case \"glock 18\":\n letter = \"C\"\n break\n case \"ak 47\":\n letter = \"W\"\n break\n case \"aug\":\n letter = \"U\"\n break\n case \"awp\":\n letter = \"Z\"\n break\n case \"famas\":\n letter = \"R\"\n break\n case \"m249\":\n letter = \"g\"\n break\n case \"g3sg1\":\n letter = \"X\"\n break\n case \"galil ar\":\n letter = \"Q\"\n break\n case \"m4a4\":\n letter = \"S\"\n break\n case \"m4a1 s\":\n letter = \"T\"\n break\n case \"mac 10\":\n letter = \"K\"\n break\n case \"p2000\":\n letter = \"E\"\n break\n case \"mp5 sd\":\n letter = \"N\"\n break\n case \"ump 45\":\n letter = \"L\"\n break\n case \"xm1014\":\n letter = \"b\"\n break\n case \"pp bizon\":\n letter = \"M\"\n break\n case \"mag 7\":\n letter = \"d\"\n break\n case \"negev\":\n letter = \"f\"\n break\n case \"sawed off\":\n letter = \"c\"\n break\n case \"tec 9\":\n letter = \"H\"\n break\n case \"zeus x27\":\n letter = \"h\"\n break\n case \"p250\":\n letter = \"F\"\n break\n case \"mp7\":\n letter = \"N\"\n break\n case \"mp9\":\n letter = \"O\"\n break\n case \"nova\":\n letter = \"e\"\n break\n case \"p90\":\n letter = \"P\"\n break\n case \"scar 20\":\n letter = \"Y\"\n break\n case \"sg 553\":\n letter = \"V\"\n break\n case \"ssg 08\":\n letter = \"a\"\n break\n case \"knife\":\n letter = \"1\"\n break\n case \"flashbang\":\n letter = \"i\"\n break\n case \"high explosive grenade\":\n letter = \"j\"\n break\n case \"smoke grenade\":\n letter = \"k\"\n break\n case \"molotov\":\n letter = \"l\"\n break\n case \"decoy grenade\":\n letter = \"m\"\n break\n case \"incendiary grenade\":\n letter = \"n\"\n break\n case \"c4 explosive\":\n letter = \"o\"\n break\n case \"usp s\":\n letter = \"G\"\n break\n case \"cz75 auto\":\n letter = \"I\"\n break\n case \"r8 revolver\":\n letter = \"J\"\n break\n\n case \"bayonet\":\n letter = \"1\"\n break\n case \"flip knife\":\n letter = \"2\"\n break\n case \"gut knife\":\n letter = \"3\"\n break\n case \"karambit\":\n letter = \"4\"\n break\n case \"m9 bayonet\":\n letter = \"5\"\n break\n case \"huntsman knife\":\n letter = \"6\"\n break\n case \"bowie knife\":\n letter = \"7\"\n break\n case \"butterfly knife\":\n letter = \"8\"\n break\n case \"shadow daggers\":\n letter = \"9\"\n break\n case \"falchion knife\":\n letter = \"0\"\n break\n case \"ursus knife\":case \"navaja knife\":case \"stiletto knife\":case \"skeleton knife\":case \"nomad knife\":case \"survival knife\":case \"paracord knife\":case \"classic knife\":case \"talon knife\":\n letter = \"1\"\n break\n default:\n letter = \"\"\n break\n }\n return letter\n}", "title": "" }, { "docid": "4620e9f681d38eb4a0eefb6e0ca3a513", "score": "0.48712534", "text": "function spell() {\n return \"Lumos Maxima\";\n}", "title": "" }, { "docid": "059de51ee70eb5281ec515000a673823", "score": "0.4868976", "text": "function getHighFlush(hand) {\n\n let handNumbers = hand.map( card => numbers.indexOf(card.split(\"\")[0]));\n sorted = handNumbers.sort((a, b) => a - b);\n\n // check for A,2,3,4,5\n if (sorted[4] == 12 && sorted[0] == 0 && sorted[3] == 3) {\n return sorted[3];\n }\n\n return sorted[4];\n}", "title": "" }, { "docid": "3fdbd160ad78011a51838d3343e7e1df", "score": "0.48651996", "text": "function solution_1 (tasks, n) {\n\n // STEP 1: CREATE A SORTED FREQUENCY ARRAY (length 26) OF THE TASKS (letters) - NOTE: we only care about the frequencies, not the letters\n const freq = tasks\n .reduce((arr, task) => {\n ++arr[task.charCodeAt(0) - 'A'.charCodeAt(0)]; // 'A' --> 0, 'B' --> 1, ... , 'Z' --> 25\n return arr;\n }, Array(26).fill(0)) // unused letters must store 0\n .sort((a, b) => a - b); // sort in increasing order\n\n let i = 25;\n while (i >= 0 && freq[i] === freq[25]) --i; // find the index 1 below the leftmost position that is equal to the highest frequency (can be -1 if all 26 letters have equal frequency)\n\n return Math.max(\n (freq[25] - 1) * (n + 1) + (25 - i), // if highest freq is `x`, then there are `x - 1` segments that are each `n + 1` in length (counting fence + 1 post), plus # of posts w/ max freq\n tasks.length, // even if there is no idle time, the lowest possible result is equal to `tasks.length`\n );\n}", "title": "" }, { "docid": "9a602e27ef36c173d077dc69f05ce314", "score": "0.4861475", "text": "function giveHint() {\n\tvar zeroOrOne = Math.round(Math.random())\n\tvar digit = winningNumber.toString()[zeroOrOne]\n\tdocument.getElementById(\"action\").innerHTML = \"The number contains the number \" + digit\n}", "title": "" }, { "docid": "0061bec4597681277e87d87511d7c26d", "score": "0.48546743", "text": "function getTitle(litness) {\n litness = Math.ceil(litness * 8);\n switch (litness) {\n case 8:\n return \"Turnt AF\";\n case 7:\n return \"Pretty Lit\";\n case 6:\n return \"Definitely Lit\";\n case 5:\n return \"Low Key Lit\";\n case 4:\n return \"Low Key\";\n case 3:\n return \"J Chillin\";\n case 2:\n return \"Not Lit\";\n case 1:\n return \"Sadboy\";\n }\n}", "title": "" }, { "docid": "2d560269a0ffb5efca40db42aa205543", "score": "0.48524448", "text": "function e189753() { return 'dick'; }", "title": "" }, { "docid": "03f2b3b7321b819e91c29ed0d10a0f4a", "score": "0.4851803", "text": "function countSheep(number) {\n console.log(number);\n if (number === 0) {\n // Put your base case here\n return 'I fell asleep';\n } else {\n console.log(\"Another sheep jumps over the fence.\");\n // Define the variable newNumber as \n // 1 less than the input variable number\n var newNumber = number - 1;\n // Recursively call the function\n // with newNumber as the parameter\n return countSheep(newNumber);\n }\n}", "title": "" }, { "docid": "2d5da3a2c91cfabde2871c951d77c6ed", "score": "0.48509502", "text": "function countSheep(number) {\n if (number === 0) {\n console.log = \"All Sheeps jumped over the fence\";\n } else {\n console.log(\"Anthor sheep jumps over the fence\");\n var newNumber = number - 1;\n countSheep(newNumber);\n }\n}", "title": "" }, { "docid": "c62ca9f41691c796a729d25e1f579ada", "score": "0.48482516", "text": "function handscore(face, suit) {\n\t \tlet v, i, o, s = 1<<face[0]|1<<face[1]|1<<face[2]|1<<face[3]|1<<face[4], score;\n\t \tfor (i=-1, v=o=0; i<5; i++, o=Math.pow(2,face[i]*4)) v += o*((v/o&15)+1);\n\t \tv = v % 15 - ((s/(s&-s) == 31) || (s == 0x403c) ? 3 : 1);\n\t \tv -= (suit[0] == (suit[1]|suit[2]|suit[3]|suit[4])) * ((s == 0x7c00) ? -5 : 1);\n\t \tscore = [8,9,5,6,1,2,3,10,4,7];\n\t \treturn score[v];\n\t}", "title": "" }, { "docid": "461bd4f71986d9d3357a793c50295d5c", "score": "0.48448998", "text": "triplet(hand, count, index) {\n if (count[index] >= 3) {\n const match = hand.filter((tile) => tile % 40 === index);\n if (count[index] === 4) match.pop();\n count[index] -= 3;\n if (match.includes(undefined)) debugger;\n return match;\n }\n }", "title": "" }, { "docid": "353ebe029ce910fc5a9e050e7e8af52c", "score": "0.48409843", "text": "function sharedDNA(person, fromFather, fromMother){\r\n if(person.name == 'Pauwels van Haverbeke'){\r\n return 1\r\n }\r\n else{\r\n return (fromFather + fromMother) / 2\r\n }\r\n }", "title": "" }, { "docid": "30874011339662995208e25626d0e225", "score": "0.48396334", "text": "function numberLetterCounts(limit) {\n const dictionary = {\n 0: '',\n 1: 'one',\n 2: 'two',\n 3: 'three',\n 4: 'four',\n 5: 'five',\n 6: 'six',\n 7: 'seven',\n 8: 'eight',\n 9: 'nine',\n 10: 'ten',\n 11: 'eleven',\n 12: 'twelve',\n 13: 'thirteen',\n 14: 'fourteen',\n 15: 'fifteen',\n 16: 'sixteen',\n 17: 'seventeen',\n 18: 'eighteen',\n 19: 'nineteen',\n 20: 'twenty',\n 30: 'thirty',\n 40: 'forty',\n 50: 'fifty',\n 60: 'sixty',\n 70: 'seventy',\n 80: 'eighty',\n 90: 'ninety',\n 1000: 'onethousand'\n };\n let numString = '';\n function convertToString(num) {\n if (dictionary[num]) {\n return dictionary[num];\n } else {\n const hundreds = Math.floor(num / 100);\n const tens = Math.floor((num / 10) % 10) * 10;\n const remainder = num % 10;\n let tempStr = '';\n if (hundreds === 0) {\n tempStr += dictionary[tens] + dictionary[remainder];\n } else {\n tempStr += dictionary[hundreds] + 'hundred';\n if (tens !== 0 || remainder !== 0) {\n tempStr += 'and';\n }\n if (tens < 20) {\n const lessThanTwenty = tens + remainder;\n tempStr += dictionary[lessThanTwenty];\n } else {\n tempStr += dictionary[tens] + dictionary[remainder];\n }\n }\n return tempStr;\n }\n }\n for (let i = 1; i <= limit; i++) {\n numString += convertToString(i);\n }\n return numString.length;\n}", "title": "" }, { "docid": "0bfcdb5655b02105df04893ae227eccd", "score": "0.4838708", "text": "function playPass(s, n) {\n const alphabet = [\n \"a\",\n \"b\",\n \"c\",\n \"d\",\n \"e\",\n \"f\",\n \"g\",\n \"h\",\n \"i\",\n \"j\",\n \"k\",\n \"l\",\n \"m\",\n \"n\",\n \"o\",\n \"p\",\n \"q\",\n \"r\",\n \"s\",\n \"t\",\n \"u\",\n \"v\",\n \"w\",\n \"x\",\n \"y\",\n \"z\",\n ];\n const arr = s.toLowerCase().split(\"\");\n for (let i = 0; i < arr.length; i++) {\n if (alphabet.includes(arr[i])) {\n if (alphabet.indexOf(arr[i]) + n > 25) {\n arr[i] = alphabet[alphabet.indexOf(arr[i]) + n - 26];\n } else {\n arr[i] = alphabet[alphabet.indexOf(arr[i]) + n];\n }\n if (i % 2 === 0) {\n arr[i] = arr[i].toUpperCase();\n }\n } else if (Number.isInteger(+arr[i]) && arr[i] !== \" \") {\n arr[i] = (9 - +arr[i]).toString();\n }\n }\n return arr.reverse().join(\"\");\n}", "title": "" } ]
cbaf20f61e8743d728d990168d07e138
Generate a New Titanium Project
[ { "docid": "cb423767b54aa1a84cb6ec7427dcac57", "score": "0.6546035", "text": "function createTiApp(name, id, url, dir, callback){\n\n var platform = generatePlatformOptions();\n if(platform.length>0){\n\n console.log('----- CREATING TITANIUM APP -----');\n var ticmd = util.format('ti create -f --no-prompt --log-level info -n \"%s\" --id %s -u %s -d %s -p %s',name, id, url, dir, platform);\n\n executeCommand(ticmd, function(){\n console.log('----- TITANIUM APP CREATED -----')\n if(callback){\n callback();\n }\n });\n }\n else{\n console.error('You have not specified any platforms in the settings for Ti Atom');\n }\n\n\n}", "title": "" } ]
[ { "docid": "34ddd1afdfdc8834ecb6f57d7f2cc123", "score": "0.7329862", "text": "function createapp(){\n var project = getProjectInfo()\n createTiApp(project.appname, atom.config.get(\"ti-atom.id\"), atom.config.get(\"ti-atom.url\"), project.dirname);\n}", "title": "" }, { "docid": "c45a3f83150384ba5518fbaa1dd60523", "score": "0.68472624", "text": "function newProject() {\n setupMode(\"new\");\n }", "title": "" }, { "docid": "e9ef1ac27ded26ac9a33e402cae65e52", "score": "0.67067873", "text": "function createalloyapp(){\n var project = getProjectInfo()\n createTiApp(project.appname, atom.config.get(\"ti-atom.id\"), atom.config.get(\"ti-atom.url\"), project.dirname, function(){\n addAlloy(project.project);\n });\n\n}", "title": "" }, { "docid": "67c9a7b2d6846c0fcb0fd464b916dcf8", "score": "0.65607035", "text": "function creat_new_ui_project(){\n\n Uiproject_Add(2,\"p2\",\"ui_proj_2_desc\");\n\n}", "title": "" }, { "docid": "9b23e6eb4f4a42f71485d38011dabcc2", "score": "0.65322894", "text": "function new_project_creation() {\n inquirer.prompt(new_project).then(answers => {\n console.log(chalk.yellow.bgRed.bold('Summary of the project'));\n jsome(answers);\n summary(answers);\n })\n ;\n}", "title": "" }, { "docid": "608b256dcceab8fc2534f1d00241338d", "score": "0.6431461", "text": "function createProject() {\n TaskService.CreateProjectModal();\n }", "title": "" }, { "docid": "5847e19d41b8636bb61a313cb3912367", "score": "0.6367405", "text": "function createAppProject(args, projectType, name, targetDir, cb) {\n var _APP_PROJECT_CONFIG$p = APP_PROJECT_CONFIG[projectType].dependencies,\n dependencies = _APP_PROJECT_CONFIG$p === undefined ? [] : _APP_PROJECT_CONFIG$p;\n\n if (dependencies.length !== 0) {\n var library = projectType.split('-')[0];\n if (args[library]) {\n dependencies = dependencies.map(function (pkg) {\n return `${pkg}@${args[library]}`;\n });\n }\n }\n var templateDir = _path2.default.join(__dirname, `../templates/${projectType}`);\n var templateVars = { name, nwbVersion: NWB_VERSION };\n (0, _runSeries2.default)([function (cb) {\n return copyTemplate(templateDir, targetDir, templateVars, cb);\n }, function (cb) {\n return (0, _utils.install)(dependencies, { cwd: targetDir, save: true }, cb);\n }, function (cb) {\n return initGit(args, targetDir, cb);\n }], cb);\n}", "title": "" }, { "docid": "321af2141735602e6e3c20b6ca16f6d6", "score": "0.63598615", "text": "function createProject() {\r\n ProjectService.CreateProject();\r\n }", "title": "" }, { "docid": "f4b09afa09fb9c114ca2d02c0271b029", "score": "0.616692", "text": "function projects() {\n inquirer.prompt(project_creation).then(answers => {\n if (answers.project_type === 'Automatic'\n ) {\n // new_project_creation_cdh();\n create_project_automatically();\n\n }\n else {\n new_project_creation();\n\n }\n });\n}", "title": "" }, { "docid": "50b3e91d0b7b182c05bfbd86d9950754", "score": "0.60716707", "text": "function generate_mock_project(index, priority) {\n\tvar prj = {\"name\":\"Project - \" + index, \n\t\t\t \"priority\":priority,\n\t\t\t \"num_tasks\":Math.floor(Math.random()*51), \n\t\t\t \"id\":index};\n\treturn prj;\n}", "title": "" }, { "docid": "a090aaed1f22c70276fa654249f76229", "score": "0.6027147", "text": "function createDefaultProject() {\n execSync(`npx react-native init ${PROJ}`);\n}", "title": "" }, { "docid": "ccba534c950605b388b7be04d9d16c84", "score": "0.5998541", "text": "function Create(Cloud, manager) {\n CliManager = manager;\n\n var me = this;\n\n this._cmd = CliManager.getCMD();\n this._command = CliManager.getArgv( CliManager.ARGV.RAW );\n this.credentials = Cloud.loadCredentials();\n\n if(!this.credentials){\n util.errorLog(\"You have to log in first, see 'cocoonjs cloud'. \");\n return;\n }\n\n this.api = new CocoonJSCloud.API(this.credentials);\n\n if(!this._command[1]){\n util.errorLog(\"At least the dir must be provided to create new project. See `cocoonjs help`.\");\n process.exit(1);\n }\n\n util.log(\"creating a new project at\", this._command[2]);\n\n var CreateLib = CliManager.getCordovaLib(this._command[1]);\n if(!CreateLib){\n util.errorLog(\"Cannot find 'cocoonjs create' library.\"); // This should never happen lol wut\n }\n\n /**\n * Arguments passed to \"$ cocoonjs create ...\"\n * @type {{path: *, package: *, name: *}}\n */\n var commandList = {\n path : this._command[2],\n package : this._command[3],\n name : this._command[4]\n };\n\n async.waterfall([\n function(callback){\n if(!commandList.path){\n me.getPrompt(commandList, 'path', 'Local path to your new CocoonJS project (absolute path)', callback);\n }else{\n callback(null);\n }\n },\n function(callback){\n if(!commandList.package){\n me.getPrompt(commandList, 'package', 'Package (reverse domain style, e.g. com.ludei.test)', callback);\n }else{\n callback(null);\n }\n },\n function(callback){\n if(!commandList.name){\n me.getPrompt(commandList, 'name', 'The name of your app', callback);\n }else{\n callback(null);\n }\n }\n ], function (err) {\n if(err){\n throw new Error(err);\n }\n\n var customArgv = [\"create\", commandList.path, commandList.package, commandList.name];\n var copyFrom = CliManager.getArgv(CliManager.ARGV.RAW)['copy-from'];\n if(copyFrom){\n customArgv.push(\"--copy-from=\" + copyFrom);\n }\n\n CliManager.setCustomArgv(customArgv);\n CliManager.toogleCustomArgv(true);\n\n // Executes '$ cocoonjs create {/path/} {package} {name}'\n new CreateLib(CliManager, function(stdout, stderr, statusCode){\n if(statusCode !== 0){\n util.errorLog(stderr);\n return;\n }\n util.log(stdout);\n // Disable custom 'argv' so future operations\n // will use the original argv.\n CliManager.toogleCustomArgv(false);\n // Create the project in the cloud service\n me.createCloudProject(CliManager, customArgv);\n });\n });\n\n}", "title": "" }, { "docid": "40d366b3adc69ba670161c908002782c", "score": "0.59757787", "text": "function newProject() {\n var chooser = document.getElementById('fileDialog');\n chooser.onchange = function (evt) {\n Cats.IDE.addProject(this.value);\n };\n chooser.click();\n }", "title": "" }, { "docid": "6024b3d951ce9d3380743c7111523bb3", "score": "0.5956834", "text": "async function create (projectName, options) {\n console.log(projectName, options)\n const cwd = process.cwd(); // 获取当前命令执行时的工作目录\n const targetDir = path.join(cwd,projectName); // 目标目录\n console.log(targetDir)\n}", "title": "" }, { "docid": "f12c050753fe0850e454736315fcc939", "score": "0.5956409", "text": "function createProjectManagement() {\n for (var j = 0; j < projectManagementArr.length; j++) {\n new ProjectManagement(projectManagementArr[j][0], projectManagementArr[j][1], projectManagementArr[j][2], projectManagementArr[j][3], projectManagementArr[j][4]);\n }\n}", "title": "" }, { "docid": "443d5dc0b4e66233089022861b09d80f", "score": "0.5935971", "text": "function creationUI () {\r \r // VALUES\r // ARCHITECTURAL VALUES\r \r activeSubPoject = app.project.activeItem;\r updateProject = false;\r \r // IMPORT PRESETS NAMES\r importPresetNames();\r \r // FUNCTIONS\r \r function newUniqueID () {\r var date = new Date(Date(0));\r var time = date.getTime();\r sP_ID = time;\r \r } \r \r newUniqueID ();\r\r function activeSubProjectSettings () {\r \r sP_projectNumber = projectNumberEditText.text;\r sP_creativeTitle = creativeArtworkEditText.text;\r sP_location = locationEditText.text;\r sP_compWidth = activeSubPoject.width;\r sP_compHeight = activeSubPoject.height;\r sP_compLength = activeSubPoject.duration;\r sP_pixel = 1;\r sP_FPS =activeSubPoject.frameRate;\r \r sP_name = (sP_projectNumber + \"-\" + sP_location + \"-\" + sP_creativeTitle + \"-\" + sP_compLength + \"s\" + \"-\" + sP_compWidth+ \"x\" + sP_compHeight) \r }\r \r // BUILD INTERFACE\r\r var buildScriptInput = new Window (\"palette\", \"Project Info\");\r buildScriptInput.graphics.backgroundColor = buildScriptInput.graphics.newBrush (buildScriptInput.graphics.BrushType.SOLID_COLOR, [1,1,1]); // BACKGROUND COLOUR\r buildScriptInput.margins = [20,20,20,20];\r buildScriptInput.alignChildren = \"left\";\r var header = buildScriptInput.add (\"image\", undefined, File (\"/Applications/Adobe After Effects CS5/Scripts/ScriptUI Panels/easyjet_003/header.jpg\"));\r var projectNumberLine = buildScriptInput.add (\"group\");\r var projectNumberStaticText = projectNumberLine.add (\"statictext\", undefined, \"Project Number\");\r var projectNumberEditText = projectNumberLine.add (\"edittext\", [0,0,327,18], \"EASV0XXX\");\r var creativeArtworkLine = buildScriptInput.add (\"group\");\r var creativeArtworkStaticText = creativeArtworkLine.add (\"statictext\", undefined, \"Creative Artwork\");\r var creativeArtworkEditText = creativeArtworkLine.add (\"edittext\", [0,0,322,18], \"dadTime\");\r var locationLine = buildScriptInput.add (\"group\");\r var locationStaticText = locationLine.add (\"statictext\", undefined, \"Location\");\r var locationEditText = locationLine.add (\"edittext\", [0,0,372,18], \"Edinburgh\");\r \r var buildScriptInputNew = buildScriptInput.add(\"group\"); \r var buildScriptInputNewDropDown = buildScriptInputNew.add (\"dropdownlist\", [0,0,440,20], presetsNamesArray);\r buildScriptInputNewDropDown.selection = 0;\r\r projectNumberLine.margins = [0,10,0,0];\r projectNumberStaticText.graphics.font = ScriptUI.newFont (\"easyJet Rounded Book\", \"Bold\",14); // FONT\r projectNumberStaticText.graphics.foregroundColor = buildScriptInput.graphics.newPen (buildScriptInput.graphics.PenType.SOLID_COLOR, eJDark,1); // FONT COLOUR\r projectNumberEditText.graphics.font = ScriptUI.newFont (\"easyJet Rounded Book\", \"Bold\",14); // FONT\r projectNumberEditText.graphics.foregroundColor = buildScriptInput.graphics.newPen (buildScriptInput.graphics.PenType.SOLID_COLOR, eJDark,1); // FONT COLOUR\r creativeArtworkLine.margins = [0,10,0,0];\r creativeArtworkStaticText.graphics.font = ScriptUI.newFont (\"easyJet Rounded Book\", \"Bold\",14); // FONT\r creativeArtworkStaticText.graphics.foregroundColor = buildScriptInput.graphics.newPen (buildScriptInput.graphics.PenType.SOLID_COLOR, eJDark,1); // FONT COLOUR\r creativeArtworkEditText.graphics.font = ScriptUI.newFont (\"easyJet Rounded Book\", \"Bold\",14); // FONT\r creativeArtworkEditText.graphics.foregroundColor = buildScriptInput.graphics.newPen (buildScriptInput.graphics.PenType.SOLID_COLOR, eJDark,1); // FONT COLOUR\r locationLine.margins = [0,10,0,0];\r locationStaticText.graphics.font = ScriptUI.newFont (\"easyJet Rounded Book\", \"Bold\",14); // FONT\r locationStaticText.graphics.foregroundColor = buildScriptInput.graphics.newPen (buildScriptInput.graphics.PenType.SOLID_COLOR, eJDark,1); // FONT COLOUR\r locationEditText.graphics.font = ScriptUI.newFont (\"easyJet Rounded Book\", \"Bold\",14); // FONT\r locationEditText.graphics.foregroundColor = buildScriptInput.graphics.newPen (buildScriptInput.graphics.PenType.SOLID_COLOR, eJDark,1); // FONT COLOUR\r\r var projectDetectedDataBundle = buildScriptInput.add (\"group\", undefined, \"Detected Data\");\r\r if (activeSubPoject == null) {\r var projectDetectedData = projectDetectedDataBundle.add (\"group\");\r var projectDetectedDataTitle = projectDetectedData.add (\"statictext\", undefined, (\"Please Open Composition to Run\"+\" \"+\" \"+\" \"+\" \"+\" \"+\" \"+\" \"+\" \"+\" \"+\" \"+\" \"+\" \"+\" \"));\r var compWidthStaticText = projectDetectedData.add (\"statictext\", undefined, (\". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . \"));\r var compHeightStaticText = projectDetectedData.add (\"statictext\", undefined, (\". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . \"));\r var compLengthStaticText = projectDetectedData.add (\"statictext\", undefined, (\". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . \"));\r var uniqueIdentifier = projectDetectedData.add (\"statictext\", undefined, (\"ID: \" + sP_ID)); \r projectDetectedDataTitle.graphics.foregroundColor = buildScriptInput.graphics.newPen (buildScriptInput.graphics.PenType.SOLID_COLOR, [1,0,0],1); // FONT COLOUR\r compWidthStaticText.graphics.foregroundColor = buildScriptInput.graphics.newPen (buildScriptInput.graphics.PenType.SOLID_COLOR, [1,1,1],1); // FONT COLOUR\r compHeightStaticText.graphics.foregroundColor = buildScriptInput.graphics.newPen (buildScriptInput.graphics.PenType.SOLID_COLOR, [1,1,1],1); // FONT COLOUR\r compLengthStaticText.graphics.foregroundColor = buildScriptInput.graphics.newPen (buildScriptInput.graphics.PenType.SOLID_COLOR, [1,1,1],1); // FONT COLOUR\r uniqueIdentifier.graphics.foregroundColor = buildScriptInput.graphics.newPen (buildScriptInput.graphics.PenType.SOLID_COLOR, [0.5,0.5,0.5],1); // FONT COLOUR\r \r } else {\r var projectDetectedData = projectDetectedDataBundle.add (\"group\");\r var projectDetectedDataTitle = projectDetectedData.add (\"statictext\", undefined, (\"Detected Data: From Your Composition\"+\" \"+\" \"+\" \"+\" \"+\" \"+\" \"+\" \"+\" \"+\" \"+\" \"+\" \"+\" \"));\r var compWidthStaticText = projectDetectedData.add (\"statictext\", undefined, (\"Width: \" + activeSubPoject.width + \"px\"));\r var compHeightStaticText = projectDetectedData.add (\"statictext\", undefined, (\"Height: \" + activeSubPoject.height + \"px\"));\r var compLengthStaticText = projectDetectedData.add (\"statictext\", undefined, (\"Length: \" + activeSubPoject.duration + \" seconds\"));\r var uniqueIdentifier = projectDetectedData.add (\"statictext\", undefined, (\"ID: \" + sP_ID));\r projectDetectedDataTitle.graphics.foregroundColor = buildScriptInput.graphics.newPen (buildScriptInput.graphics.PenType.SOLID_COLOR, [0.5,0.5,0.5],1); // FONT COLOUR\r compWidthStaticText.graphics.foregroundColor = buildScriptInput.graphics.newPen (buildScriptInput.graphics.PenType.SOLID_COLOR, [0.5,0.5,0.5],1); // FONT COLOUR\r compHeightStaticText.graphics.foregroundColor = buildScriptInput.graphics.newPen (buildScriptInput.graphics.PenType.SOLID_COLOR, [0.5,0.5,0.5],1); // FONT COLOUR\r compLengthStaticText.graphics.foregroundColor = buildScriptInput.graphics.newPen (buildScriptInput.graphics.PenType.SOLID_COLOR, [0.5,0.5,0.5],1); // FONT COLOUR\r uniqueIdentifier.graphics.foregroundColor = buildScriptInput.graphics.newPen (buildScriptInput.graphics.PenType.SOLID_COLOR, [0.5,0.5,0.5],1); // FONT COLOUR\r };\r \r projectDetectedData.orientation =\"column\";\r projectDetectedData.alignChildren = \"left\";\r \r projectDetectedDataTitle.graphics.font = ScriptUI.newFont (\"easyJet Rounded Book\", \"Bold\",14); // FONT\r compWidthStaticText.graphics.font = ScriptUI.newFont (\"easyJet Rounded Book\", \"Bold\",14); // FONT\r compHeightStaticText.graphics.font = ScriptUI.newFont (\"easyJet Rounded Book\", \"Bold\",14); // FONT\r compLengthStaticText.graphics.font = ScriptUI.newFont (\"easyJet Rounded Book\", \"Bold\",14); // FONT\r uniqueIdentifier.graphics.font = ScriptUI.newFont (\"easyJet Rounded Book\", \"Bold\",14); // FONT\r \r var confirmBuildScriptInput = buildScriptInput.add (\"group\");\r refreshDataButton = confirmBuildScriptInput.add (\"button\",undefined, \"Refresh\");\r cancelBuildScriptInputButton = confirmBuildScriptInput.add (\"button\",undefined, \"Cancel\");\r confirmBuildScriptInputButton = confirmBuildScriptInput.add (\"button\", undefined, \"OK\");\r \r confirmBuildScriptInput.margins = [180,00,0,0];\r \r confirmBuildScriptInputButton.onClick = function () {\r activeSubPoject = app.project.activeItem;\r selectedPreset = buildScriptInputNewDropDown.selection.index;\r if (activeSubPoject == null) {\r alert(\"Open a composition Bitch.. I told you once!\");\r }else if (newProject = true){\r coreDatabaseActiveIndex = 0;\r pluginArrayPosition = 0;\r activeSubProjectItem = 0;\r activeSubProjectSettings(); \r buildScriptInput.close();\r importPresetsNewProject();\r \r \r }else if (newProject = false){\r activeSubProjectSettings(); \r alert(\"SEND TO VERIFICATION - UNDER CONSTRUCTION\");\r \r }else { \r alert(\"Error - confirmBuildScriptInputButton.onClick: \\r New Project VAR is not set\");\r };\r \r };\r cancelBuildScriptInputButton.onClick = function () {\r errorControlA ();\r buildScriptInput.close();\r };\r refreshDataButton.onClick = function () {\r activeSubPoject = app.project.activeItem;\r \r \r if (activeSubPoject == null) {\r\r projectDetectedDataTitle.text = (\"Please Open Composition to Run\");\r compWidthStaticText.text = (\". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . \");\r compHeightStaticText.text = (\". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . \");\r compLengthStaticText.text = (\". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . \");\r uniqueIdentifier.text = (\"ID: \" + sP_ID); \r projectDetectedDataTitle.graphics.foregroundColor = buildScriptInput.graphics.newPen (buildScriptInput.graphics.PenType.SOLID_COLOR, [1,0,0],1); // FONT COLOUR\r compWidthStaticText.graphics.foregroundColor = buildScriptInput.graphics.newPen (buildScriptInput.graphics.PenType.SOLID_COLOR, [1,1,1],1); // FONT COLOUR\r compHeightStaticText.graphics.foregroundColor = buildScriptInput.graphics.newPen (buildScriptInput.graphics.PenType.SOLID_COLOR, [1,1,1],1); // FONT COLOUR\r compLengthStaticText.graphics.foregroundColor = buildScriptInput.graphics.newPen (buildScriptInput.graphics.PenType.SOLID_COLOR, [1,1,1],1); // FONT COLOUR\r uniqueIdentifier.graphics.foregroundColor = buildScriptInput.graphics.newPen (buildScriptInput.graphics.PenType.SOLID_COLOR, [0.5,0.5,0.5],1); // FONT COLOUR\r } else {\r\r projectDetectedDataTitle.text = (\"Detected Data: From Your Composition\");\r compWidthStaticText.text = (\"Width: \" + activeSubPoject.width + \"px\");\r compHeightStaticText.text = (\"Height: \" + activeSubPoject.height + \"px\");\r compLengthStaticText.text = (\"Length: \" + activeSubPoject.duration + \" seconds\");\r uniqueIdentifier.text = (\"ID: \" + sP_ID);\r projectDetectedDataTitle.graphics.foregroundColor = buildScriptInput.graphics.newPen (buildScriptInput.graphics.PenType.SOLID_COLOR, [0.5,0.5,0.5],1); // FONT COLOUR\r compWidthStaticText.graphics.foregroundColor = buildScriptInput.graphics.newPen (buildScriptInput.graphics.PenType.SOLID_COLOR, [0.5,0.5,0.5],1); // FONT COLOUR\r compHeightStaticText.graphics.foregroundColor = buildScriptInput.graphics.newPen (buildScriptInput.graphics.PenType.SOLID_COLOR, [0.5,0.5,0.5],1); // FONT COLOUR\r compLengthStaticText.graphics.foregroundColor = buildScriptInput.graphics.newPen (buildScriptInput.graphics.PenType.SOLID_COLOR, [0.5,0.5,0.5],1); // FONT COLOUR\r uniqueIdentifier.graphics.foregroundColor = buildScriptInput.graphics.newPen (buildScriptInput.graphics.PenType.SOLID_COLOR, [0.5,0.5,0.5],1); // FONT COLOUR\r }; \r \r };\r \r \r \r \r \r buildScriptInput.show ();\r \r}", "title": "" }, { "docid": "1a2979330a57aeb82fb900ba7d67db16", "score": "0.5933989", "text": "function createProject(projectName, projectRoot)\n{\n return Project.create({\n projectRoot : projectRoot,\n projectName : projectName\n });\n}", "title": "" }, { "docid": "7cd7499b4d34d0d0ea5be2a155f0e54b", "score": "0.59308124", "text": "async run() {\n const progress = this.__spinner();\n const files = await glob(\n [this.templatePath('**/*'), `!${this.templatePath('scripts')}`],\n { directories: false }\n );\n\n const templatePrefix = this.templatePath();\n const rootPrefix = config.root();\n\n progress.tick('initializing new project');\n await pMap(files, async (source) => {\n const destination = _.replace(source, templatePrefix, rootPrefix);\n if (await exist(destination)) {\n return;\n }\n\n await copy(source, destination);\n });\n\n await this.addScripts();\n\n await this.setPackageFiles();\n progress.success('norska project initialized');\n\n await this.enableNetlify();\n }", "title": "" }, { "docid": "86d8a5fec706ce193ad878a9f8c250aa", "score": "0.59156543", "text": "function createProjectBuilder()\n{\n return new ProjectBuilder();\n}", "title": "" }, { "docid": "0dafe9695ba6a6eb8761be0cc35e2c40", "score": "0.5895301", "text": "function generateProjectName() {\n return 'my-nexus-app-' + Math.random().toString().slice(2);\n}", "title": "" }, { "docid": "1da190ea3376de418f01297d18a8b0c1", "score": "0.58863044", "text": "function createTmpProject(testname, id, callback) {\n if (typeof testname !== 'string') throw new Error('testname must be a string');\n\n testname = 'tm2-' + testname;\n\n var key = testname + '-' + id;\n var lib = id.indexOf('tmsource') === 0 ? libs.source : libs.style;\n\n // Return path to tmp project if set in cache.\n if (tests[key]) return callback(null, tests[key].id, tests[key]);\n\n lib.info(id, function(err, info) {\n if (err) return callback(err);\n\n // no source applies a local source\n if (!info.source){\n info.source = 'tmsource://' + path.join(__dirname, 'fixtures-localsource');\n }\n\n // Make relative paths absolute.\n if (info.Layer) info.Layer = info.Layer.map(function(l) {\n if (!l.Datasource) return l;\n if (!l.Datasource.file) return l;\n if (tm.absolute(l.Datasource.file)) return l;\n l.Datasource.file = tm.join(tm.parse(id).dirname, l.Datasource.file);\n return l;\n });\n\n var tmpdir = path.join(tmp, testname + '-' + Math.random().toString(36).split('.').pop());\n tests[key] = info;\n info.id = tm.parse(id).protocol + '//' + tmpdir;\n lib.save(info, function(err) {\n if (err) return callback(err);\n fs.stat(tmpdir, function(err, stat) {\n if (err) return callback(err);\n return callback(null, info.id, info);\n });\n });\n });\n}", "title": "" }, { "docid": "6947d9b96f0a0dccc8928e86c364e0e4", "score": "0.5820705", "text": "project () {\n return new Promise((resolve) => {\n // If you want to extend this project function, insert new prompts into `this.prompts.project`,\n // which will update the questions asked and the `answers` variable.\n // You can also call super.project().then((data)=>{}) in the subclass to do more actions after\n // the initial project has been created.\n inquirer.prompt(this.prompts.project).then((answers) => {\n answers.framework = this.frameworkName;\n // Format the name of the project\n const projectName = _.kebabCase(answers.name);\n let projectDirectory = `./${answers.name}/`;\n\n if (answers.name === path.basename(path.resolve('./'))) {\n // scaffold into current folder\n projectDirectory = `./`;\n }\n\n // Create tasks array\n const tasks = new Listr([\n {\n // Create new directory\n title: `Create file tree for ${projectName}`,\n task: () => this.buildDefaultFileTree(projectDirectory),\n }, {\n title: 'Create project from template',\n task: () => {\n this.buildFilesFromTemplate(path.join(this.templateFolder, 'new-project'), projectDirectory, answers)\n .then(this.pageWithInfo({ name: 'Home' }, projectDirectory))\n .then(() => {\n // If the subclass implements the 'injectRouter' method\n if (typeof this.injectRouter === 'function') {\n this.injectRouter(path.join(projectDirectory, this.fileTree.root.src.dir, '/routes.js'), 'Home', 'Home', '');\n }\n });\n },\n },\n ]);\n\n // Run npm install if selection chosen\n if (answers.npm) {\n tasks.add({\n title: 'Npm install',\n task: () => execa('npm', ['install'], { cwd: path.resolve(projectDirectory) }),\n });\n }\n\n // Run the tasks\n tasks.run().then(() => {\n // Allow the subclass to extend the parent functionality\n resolve({ answers, name: projectName });\n }).catch(err => Logger.logError(err));\n });\n })\n }", "title": "" }, { "docid": "d14845d49d18e430ff36a74926c0c5c6", "score": "0.57722056", "text": "async createProject(project) {\n return this.model.create(project);\n }", "title": "" }, { "docid": "952cd3adc831334bca8a879ab2bd1fcc", "score": "0.5757464", "text": "function newProjectHandler() {\n }", "title": "" }, { "docid": "d582cac04d037e0d1805bbc209e352bc", "score": "0.5742565", "text": "createNewProject() {\n // create project and add a default construct\n const project = this.props.projectCreate();\n // add a construct to the new project\n const block = this.props.blockCreate({ projectId: project.id });\n const projectWithConstruct = this.props.projectAddConstruct(project.id, block.id, true);\n const rollup = new Rollup({\n project: projectWithConstruct,\n blocks: {\n [block.id]: block,\n },\n });\n\n //save this to the instanceMap as cached version, so that when projectSave(), will skip until the user has actually made changes\n //do this outside the actions because we do some mutations after the project + construct are created (i.e., add the construct)\n instanceMap.saveRollup(rollup);\n\n this.props.focusConstruct(block.id);\n this.props.projectOpen(project.id);\n\n return rollup;\n }", "title": "" }, { "docid": "85d4185273cc192498b1d6e76285bb76", "score": "0.5711398", "text": "function initProject() {\n\t\tdist = 'D:\\\\dev';\n\t\tvar dirname = dist;\n\t\tif(!fs.existsSync(dirname)) {\n\t\t\tfs.mkdir(dirname, (data) => {\n\t\t\t\tit.next();\n\t\t\t});\n\t\t}else {\n\t\t\tit.next();\n\t\t}\n\t\t\n\t\treturn dirname;\n\t}", "title": "" }, { "docid": "3e9ec63c83fb49c4dfbcfd221cfeb2e9", "score": "0.567684", "text": "constructor() {\n super(\"project\", \"Project template install command\");\n this._addOption(\"lite\", \"Lite version of the framework\", \"boolean\", \"l\", false);\n this._addOption(\"force\", \"Force the project creation\", \"boolean\", \"f\", false);\n this._addOption(\"version\", \"The version you want to install (without the v prefix)\", \"string\", \"v\", \"latest\");\n\n this.tempPath = \"\";\n this.outputFolder = \"\";\n }", "title": "" }, { "docid": "adb6483a52f38af1f1360183747e746a", "score": "0.5672257", "text": "_setNewProjectInfo() {\n var thumbnailElement = this._thumbnailElement;\n this._newProjectInfo = {\n projectProfile: this._groupedButtonElement.getSelectedButton().text(),\n workSpacePath: this._projectPathInputElement.path,\n projectName: this._projectNameInputElement.getModel().getText(),\n projectPath: path.join(this._projectPathInputElement.path, this._projectNameInputElement.getModel().getText()),\n templatePath: thumbnailElement.templatePath,\n pathToLibs: thumbnailElement.packagePath + path.sep + 'libs',\n libsToInclude: thumbnailElement.libraries,\n useExistingWindow: this._useExisingWindowElement.checked\n };\n }", "title": "" }, { "docid": "6214a388afe8e7d74eff7c3d6b9c2b07", "score": "0.5670329", "text": "function Project() {\n }", "title": "" }, { "docid": "7f5bed1b5761f101759b82b37275be7e", "score": "0.5653826", "text": "build() {\n output.info('');\n output.success('****************************************');\n output.info('');\n\n // Copy the template files.\n output.warning('Generating the template...');\n File.makeDir(this.directory);\n File.copy(`${__dirname}/templates`, this.directory);\n output.success(`HTML skeleton has been placed to ${this.directory}.`);\n\n // Open the copied file in Google Chrome.\n opn(`${this.directory}/index.html`, { wait: false });\n\n output.info('');\n output.success('****************************************');\n output.info('');\n }", "title": "" }, { "docid": "97bac0846f97817018b31eb161da151c", "score": "0.5645633", "text": "async function Create(name) {\n const slug = ChangeCase.snakeCase((name));\n console.log(`\\nCreating project ${name} in folder ${slug}`);\n\n if (shell.test('-d', slug) || shell.test('-e', slug)) {\n console.log(colors.red(\"Error: Destination folder exists\"));\n end();\n }\n\n await shell.mkdir(slug);\n await shell.cd(slug);\n await shell.exec(`npm init --yes`, {silent:true});\n await shell.exec(`yarn add hookedjs`, {silent:true});\n await shell.exec(`rsync -r node_modules/hookedjs/boilerplate/ .`); // use rsync b/c it will also copy hiddens\n\n // Reset the package.json meta\n let packageJson = await JSON.parse(fs.readFileSync(\"./package.json\"));\n packageJson.name = ChangeCase.paramCase(name);\n packageJson.author = ChangeCase.paramCase(name);\n packageJson.description = \"A project started with HookedJS\";\n packageJson.version = \"0.0.1\";\n fs.writeFileSync(\"package.json\", JSON.stringify(packageJson, ls));\n\n await shell.exec(`yarn install`, {silent:true});\n\n\n console.log(colors.rainbow(\"\\nCongratulations!\"));\n console.log(`New Project created in ${slug}. To get start, \\`cd ${slug}; yarn dev\\``);\n\n end();\n}", "title": "" }, { "docid": "2c9c4dc06b0f5e881583567bf9241df5", "score": "0.56366354", "text": "async function createAProjectResource() {\n const subscriptionId = \"0de7f055-dbea-498d-8e9e-da287eedca90\";\n const resourceGroupName = \"VS-Example-Group\";\n const rootResourceName = \"ExampleAccount\";\n const resourceName = \"ExampleProject\";\n const body = {\n name: \"ExampleProject\",\n type: \"Microsoft.VisualStudio/account/project\",\n id: \"/subscriptions/0de7f055-dbea-498d-8e9e-da287eedca90/resourceGroups/VS-Example-Group/providers/Microsoft.VisualStudio/account/ExampleAccount/project/ExampleProject\",\n location: \"Central US\",\n properties: {\n processTemplateId: \"6B724908-EF14-45CF-84F8-768B5384DA45\",\n versionControlOption: \"Git\",\n },\n tags: {},\n };\n const credential = new DefaultAzureCredential();\n const client = new VisualStudioResourceProviderClient(credential, subscriptionId);\n const result = await client.projects.beginCreateAndWait(\n resourceGroupName,\n rootResourceName,\n resourceName,\n body\n );\n console.log(result);\n}", "title": "" }, { "docid": "3c967f768ca46c911632215e48d98d07", "score": "0.5625882", "text": "async function create(project) {\n const project_id = await db(\"projects\").insert(project);\n \n const newProject = {\n project_id: project_id,\n project_name: project.project_name,\n project_description: project.project_description,\n project_completed: project.project_completed === 1 ? true : false,\n };\n\n return newProject;\n}", "title": "" }, { "docid": "dd81c65fd8355ccbbd24c3768c6706ba", "score": "0.56116176", "text": "function GeneratorProject(type) {\n var projectTypePath = path.join(__dirname, 'projects', type);\n var defaultProjectName = 'angularity-project';\n\n if (!fs.existsSync(projectTypePath)) {\n console.error('Error there does not seem to be a project with the name', type);\n }\n\n return {\n /**\n * The project type is the folder name of the generator project.\n * Eg: es5-minimal\n */\n projectType : type,\n /**\n * The absolute path to the generator project template.\n */\n projectTypePath: projectTypePath,\n /**\n * The project name used by the generator to populate the config files, destination etc.\n */\n projectName : defaultProjectName,\n /**\n * The absolute path the the generator project's template folder.\n */\n templatePath : path.join(__dirname, 'projects', type, 'template'),\n /**\n * The generator project's destination path.\n */\n destination : path.join(String(process.cwd()), defaultProjectName),\n\n projectConfig: configDefaults.projectConfig,\n\n /**\n * Set the main project name and update the destination path.\n * @param name\n */\n setProjectName: function (name) {\n this.projectName = name;\n this.destination = path.join(String(process.cwd()), name);\n },\n\n /**\n * Based on the current GeneratorProject object,\n * recursively copy all the project's files to the project's destination.\n */\n copyProjectTemplateFiles: function () {\n util.cpR(this.templatePath, this.destination, true);\n },\n\n /**\n * Based on the current GeneratorProject object,\n * create an Angularity Project Config and determine the destination automatically.\n * @param override\n */\n createAngularityProjectConfig: function (override) {\n if (typeof override !== 'undefined') {\n this.projectConfig = _.merge(this.projectConfig, override);\n }\n util.createAngularityProjectConfig(this.destination, this.projectConfig);\n }\n };\n}", "title": "" }, { "docid": "26da6a839b01b067c4f9a82c0aaca061", "score": "0.5593401", "text": "function Create() {\r\n /**\r\n * Module's namespace\r\n * @type {string}\r\n */\r\n this.nameSpace = '';\r\n /**\r\n * Temporary directory for managing the creation of\r\n * files.\r\n * @type {string}\r\n */\r\n this.tmpDir = './.apln/tmp';\r\n /**\r\n * Appland destination directories.\r\n * @type {Object}\r\n */\r\n this.appland = {\r\n 'src': './src/module-',\r\n 'srcTest': './src-test/module-',\r\n 'sass': './src/assets/sass',\r\n 'build': './_build/module-'\r\n };\r\n /**\r\n * Port to launch module\r\n * @type {number}\r\n */\r\n this.launchPort = 9010;\r\n /**\r\n * Apln cli home directory.\r\n * @type {*}\r\n */\r\n this.PATH_APLN_HOME = path.resolve(__dirname, '../..');\r\n /**\r\n * Appland module's skeleton source files locations.\r\n * @type {Object}\r\n */\r\n this.scaffold = {\r\n 'src': path.normalize(this.PATH_APLN_HOME + '/.skel/src/module-'),\r\n 'srcTest': path.normalize(this.PATH_APLN_HOME + '/.skel/src-test/module-'),\r\n 'sass': path.normalize(this.PATH_APLN_HOME + '/.skel/src/assets/sass/'),\r\n 'build': path.normalize(this.PATH_APLN_HOME + '/.skel/_build/module-')\r\n };\r\n}", "title": "" }, { "docid": "0868c165112d466881ec457fd7034dd4", "score": "0.55607957", "text": "function createTemplate(){\n\t\t\tvar vraTemplate = new File (desktop+\"\"+mdMenu+\"_import_default template.txt\") \n\t\t\tvraTemplate.encoding = \"UTF8\";\n\t\t\tvraTemplate.open (\"w\", \"TEXT\", \"ttxt\");\t\n\t\t\t// Loop through array of headers (properties) and write them to the .txt file\n\t\t\tfor (var L1 = 0; L1 < fieldsArr.length; L1++) vraTemplate.write (fieldsArr[L1].Label + \"\\t\");\n\t\t\t// Close the file \"\"+mdMenu+\"_import_template.txt\"\n\t\t\tvraTemplate.close();\n\t\t\tWindow.alert (\"A new file named:\\n\\n\"+mdMenu+\"_import_default template.txt\\n\\nhas been created on your desktop\", \"Success!\")\n\t\t\t}", "title": "" }, { "docid": "690f59a34127d52aeb390b0c023ea497", "score": "0.5557137", "text": "function insertProjFolder(id, project_file, snippet, midi_files, sample_files){ }", "title": "" }, { "docid": "8fa5495741ce52d570e1e9d641959b53", "score": "0.5523156", "text": "function createProject(name) {\n //name = prompt(\"Project name?\");\n name = document.getElementById('project-name').value;\n projects[name] = [];\n //count++;\n console.table(projects);\n appendProject(name);\n}", "title": "" }, { "docid": "ffc78eac26ebb3527fc92fe77b917fca", "score": "0.5465784", "text": "function writeFreshProjectToProjectDirectory() {\n writePackageJson(projectConfig.activeComponentKit);\n writeIndexFile(currentComponentKit.entryFilePath);\n copyFilesToProjectDirectory(currentComponentKit.files);\n}", "title": "" }, { "docid": "af17a718f7101e739208364a737c6279", "score": "0.5464159", "text": "function createProjects () {\n console.log('Processing projects.')\n\n var data = fs.readFileSync('./dist/_data/projects.csv', 'utf8')\n\n // Clean the projects folder first\n fs.emptyDirSync('./dist/_projects')\n\n var projects = Papa.parse(data, {'header': true}).data\n\n // create the files\n for (var i = 0; i <= projects.length - 1; i++) {\n var content = ''\n\n content = '---\\n'\n\n content += 'layout: item\\n'\n content += 'body_class: item\\n'\n\n content += 'title: ' + projects[i]['PROJECT NAME'] + '\\n'\n content += 'origin: ' + projects[i]['ORIGIN COUNTRY'] + '\\n'\n content += 'countries: ' + projects[i]['COUNTRIES WHERE DEPLOYED'] + '\\n'\n content += 'category: ' + projects[i]['SECTOR'] + '\\n'\n content += 'site_url: ' + projects[i]['PROJECT WEBSITE'] + '\\n'\n content += 'github_url: ' + projects[i]['PROJECT GITHUB REPO'] + '\\n'\n content += 'related: ' + projects[i]['RELATED PROJECTS'] + '\\n'\n content += 'organisations: ' + projects[i]['ORGANISATIONS'] + '\\n'\n content += 'description: >\\n ' + projects[i]['PROJECT DESCRIPTION'].replace('\\n', '\\n ') + '\\n'\n\n content += '---\\n'\n\n fs.outputFileSync('./dist/_projects/' + utils.slugify(projects[i]['PROJECT NAME']) + '.md', content)\n }\n\n console.log('Finished processing ' + projects.length + ' projects.')\n}", "title": "" }, { "docid": "23ea6c914dd23f5f8b1af05212be1c68", "score": "0.5455801", "text": "function generateTeam () {\n const generateContent = generateHTML(teamMemberArray);\n // create a function to write README file\n fs.writeFile('index.html', generateContent, (err) =>\n err? console.log(err) : console.log('Successfully created an index.html file!')\n )\n}", "title": "" }, { "docid": "ce95b83ae6a5ad45ece0be713005ca12", "score": "0.5435112", "text": "function createRt() {\r\n\t//hideNewRtTool();\r\n\tresetRtDetail();\r\n\tshowRtDetailsTool();\r\n\tenableEditRtDetail(\"\");\r\n\tenableMap();\r\n}", "title": "" }, { "docid": "f01a5d8c6c52f5095fe802d731363684", "score": "0.5426931", "text": "async function CreateDev(name, gitRepo) {\n const slug = ChangeCase.snakeCase((name));\n console.log(`\\nCreating project ${name} in folder ${slug}`);\n\n if (shell.test('-d', slug) || shell.test('-e', slug)) {\n console.log(colors.red(\"Error: Destination folder exists\"));\n end();\n }\n\n await shell.exec(`git clone ${gitRepo} ${slug}`);\n await shell.cd(slug);\n await shell.exec(`yarn`);\n await shell.exec(`yarn`, {cwd: \"boilerplate\"});\n await shell.exec(`rm project && ln -s boilerplate project`);\n await shell.exec(`rm -rf hookedjs && ln -s ../../ hookedjs`, {cwd: \"boilerplate/node_modules\"});\n\n console.log(colors.rainbow(\"\\nCongratulations!\"));\n console.log(`New Project created in ${slug}. To get start, \\`cd ${slug}/boilerplate; yarn dev\\``);\n\n end();\n}", "title": "" }, { "docid": "1fca6d9337d9e9fd6927bb050a27c178", "score": "0.5404434", "text": "function main() {\n generateBuildFile()\n}", "title": "" }, { "docid": "bb89e20f0174144a29cb6764afdbb222", "score": "0.53988546", "text": "async function createProject(e) {\n e.preventDefault();\n try {\n setError('');\n setLoading(true);\n await setDoc(doc(db, 'proyectos', projectRef.current.value), {\n Name: projectRef.current.value,\n Description: 'proyecto de prueba creado desde la APP',\n Status: 'Signed',\n });\n } catch {\n setError('Failed to create a new project');\n }\n projectRef.current.value = '';\n setLoading(false);\n }", "title": "" }, { "docid": "d0ff556a536cd36d070aaf897934e22f", "score": "0.5388", "text": "createNewProject(xhr_response)\n\t{\n\t\tconsole.log('----- createNewProject -----', xhr_response);\n\t\t// inserts new row at the bottom and hides form\n\t\tthis.createProjectRow(xhr_response);\n\t\tthis.hideForm();\n\t}", "title": "" }, { "docid": "6e33565c35a9cbd4c84a7216a1a587fa", "score": "0.53860104", "text": "function handleCommand() {\n\n\tlogger.info(moduleName, '==============================Creat Web Project start!');\n\n // Create Web project by templates\n\t// New an 'FileContoller' instance\n\t// Execute App generation by steps\n\tvar File = new FileController();\n\tFile.showAllTemplates()\n\t\t.then(File.inputDirOfApp)\n\t\t.then(File.updateOutputPath)\n\t\t.then(File.generateApp)\n\t\t.catch(function (err) {\n\n\t\t\t// Show message when an error happen\n\t\t\tif (err) {\n\t\t\t\tlogger.debug(moduleName, err);\n\t\t\t}\n\t\t\tvar errMsg = 'Create Web Project failed!';\n\t\t\tcommon.showMsgOnWindow(common.ENUM_WINMSG_LEVEL.ERROR, errMsg);\n\t\t\tlogger.error(moduleName, errMsg);\n\t\t});\n\n}", "title": "" }, { "docid": "629d89df7e182a27f1249a7d26e926c4", "score": "0.5384089", "text": "function create() {\n\t\t// Code here ...\n\t}", "title": "" }, { "docid": "9865bbea8f771699385c45cfd13b7297", "score": "0.5373726", "text": "function createTask()\r\n{\r\n\t//store project name value\r\n\tlet projectName = document.getElementById(\"project-name\").value;\r\n\r\n\t//store task details value\r\n\tlet taskDetails = document.getElementById(\"task-name\").value;\r\n\r\n\t//create a new task object with project name and task details values. \r\n\tlet taskObject = new task(projectName, taskDetails);\r\n\r\n\t//return the task object\r\n\treturn taskObject\r\n}", "title": "" }, { "docid": "d996d3545a309897ae703571953152d7", "score": "0.5351129", "text": "function createModuleProject(args, projectType, name, targetDir, cb) {\n var _MODULE_PROJECT_CONFI = MODULE_PROJECT_CONFIG[projectType],\n _MODULE_PROJECT_CONFI2 = _MODULE_PROJECT_CONFI.devDependencies,\n devDependencies = _MODULE_PROJECT_CONFI2 === undefined ? [] : _MODULE_PROJECT_CONFI2,\n _MODULE_PROJECT_CONFI3 = _MODULE_PROJECT_CONFI.externals,\n externals = _MODULE_PROJECT_CONFI3 === undefined ? {} : _MODULE_PROJECT_CONFI3;\n\n getNpmModulePrefs(args, function (err, prefs) {\n if (err) return cb(err);\n var umd = prefs.umd,\n esModules = prefs.esModules;\n\n var templateDir = _path2.default.join(__dirname, `../templates/${projectType}`);\n var templateVars = {\n name,\n esModules,\n esModulesPackageConfig: esModules ? '\\n \"module\": \"es/index.js\",' : '',\n nwbVersion: NWB_VERSION\n };\n var nwbConfig = {\n type: projectType,\n npm: {\n esModules,\n umd: umd ? { global: umd, externals } : false\n }\n };\n\n // CBA making this part generic until it's needed\n if (projectType === _constants.REACT_COMPONENT) {\n if (args.react) {\n devDependencies = devDependencies.map(function (pkg) {\n return `${pkg}@${args.react}`;\n });\n templateVars.reactPeerVersion = `^${args.react}`; // YOLO\n } else {\n // TODO Get from npm so we don't have to manually update on major releases\n templateVars.reactPeerVersion = '15.x';\n }\n }\n\n (0, _runSeries2.default)([function (cb) {\n return copyTemplate(templateDir, targetDir, templateVars, cb);\n }, function (cb) {\n return writeConfigFile(targetDir, nwbConfig, cb);\n }, function (cb) {\n return (0, _utils.install)(devDependencies, { cwd: targetDir, save: true, dev: true }, cb);\n }, function (cb) {\n return initGit(args, targetDir, cb);\n }], cb);\n });\n}", "title": "" }, { "docid": "50917f38045e486b338bd54246509bdc", "score": "0.5344941", "text": "function newProjectDialog(reuse) {\n// function newProjectDialog() {\n try { \n app.playbackDisplayDialogs = DialogModes.ALL;\n \n initExportInfo(exportInfo);\n // alert(reuse)\n //Only reuse if reset is false\n if(reuse){\n // Use last set items\n // look for last used params via Photoshop registry, getCustomOptions will throw if none exist\n try {\n var d = app.getCustomOptions(\"d69fc733-75b4-4d5c-ae8a-c6d6f9a899aa\");\n descriptorToObject(exportInfo, d, strMessage, postProcessExportInfo);\n // descriptorToObject(exportInfo, d, strMessage);\n } catch (e) {\n // it\"s ok if we don\"t have any options, continue with defaults\n }\n // see if I am getting descriptor parameters\n descriptorToObject(exportInfo, app.playbackParameters, strMessage, postProcessExportInfo);\n // descriptorToObject(exportInfo, app.playbackParameters, strMessage);\n }\n\n // initExportInfo(exportInfo);\n if (DialogModes.ALL == app.playbackDisplayDialogs) {\n if (cancelButtonID == settingDialog(exportInfo)) {\n // alert(settingDialog(exportInfo))\n return \"cancel\"; // quit, returning \"cancel\" (dont localize) makes the actions palette not record our script\n }\n }\n app.playbackDisplayDialogs = DialogModes.ALL;\n // if (exportInfo.renameLayer == newNameStr) {\n // alert(alertNameStr)\n // return\n // }\n \n // if (exportInfo.allLayers){\n // applyToAllLayers(allLayers);\n // } else {\n // frameRename(exportInfo.renameLayer);\n // }\n if(exportInfo){\n var extensionPath = $.fileName.split('/').slice(0, -2).join('/') + '/';\n var presetFilePath = new File(extensionPath + '/docPreset.json');\n // setupDocFromSettings(exportInfo)\n\n presetFilePath.open(\"w\");\n presetFilePath.write(JSON.stringify(exportInfo));\n presetFilePath.close();\n // alert(presetFilePath)\n presetFilePath.open('r');\n var contentDocPreset = presetFilePath.read(); //shows JSON structure\n presetFilePath.close();\n\n // Not used\n // var settings = [\"docName\",\"docWidth\",\"docHeight\",\"docColorMode\",\"docColorModeIndex\",\"docICC\",\"docBitD\",\"docDPI\",\"projectBgColor\",\"projectBgColorIndex\",\"tmlnDuration\",\"tmlnFps\", \"fpsPreset\",\"splitTmln\",\"splitTmlnIndex\",\"addTimeRef\"]\n // var readPreset = JSON.parse(contentDocPreset);\n // var priorPreset = [];\n // var colorsHSB = [];\n // for (x in readPreset) {\n // if (x === \"projectBgColor\" ){\n // // alert(readPreset[x].length)\n // for(y in readPreset[x]) {\n // // alert(x)\n // // alert(y)\n // colorsHSB.push(readPreset[x][y])\n // }\n // // alert(colorsHSB.length)\n // //alert(colorsHSB.slice(0,3))\n // }\n // // alert(x) //returns keys\n // // alert(readPreset[x]) //returns value of keys\n // // priorPreset.split(',').slice(0, -1).join(',');\n // // colorsHSB.split(',');\n // } \n // alert(priorPreset)\n // alert(priorPreset[1])\n }\n // alert(colorsHSB)\n setupDocFromSettings(readPreset)\n\n // Use last set items\n var d = objectToDescriptor(exportInfo, strMessage, preProcessExportInfo);\n // var d = objectToDescriptor(exportInfo, strMessage);\n app.putCustomOptions(\"d69fc733-75b4-4d5c-ae8a-c6d6f9a899aa\", d);\n\n var dd = objectToDescriptor(exportInfo, strMessage);\n app.playbackParameters = dd;\n\n app.playbackDisplayDialogs = DialogModes.ALL;\n\n } catch (e) {\n if (DialogModes.NO != app.playbackDisplayDialogs) {\n alert(e);\n }\n return \"cancel\"; // quit, returning \"cancel\" (dont localize) makes the actions palette not record our script\n }\n}", "title": "" }, { "docid": "0b583da6805c11e4d273b1f953479043", "score": "0.5343855", "text": "async function generateProject(widgetConfig, deploymentConfig, options = {}) {\n const { openUrl } = options;\n const openUrlParsed = openUrl ? new URL(openUrl) : null;\n if (openUrlParsed) {\n openUrlParsed.searchParams.append(OVERRIDE_PORT_KEY, String(OVERRIDE_DEFAULT_PORT));\n }\n const name = displayNameToName(widgetConfig.displayName);\n const serverSettings = {\n port: OVERRIDE_DEFAULT_PORT,\n open: openUrlParsed ? openUrlParsed.toString() : true,\n };\n const renderTemplate = async (file) => {\n const isTemplate = file.endsWith(templateSuffix);\n const encoding = file.endsWith(\".ttf\") ? \"binary\" : \"utf8\";\n let fileData = await fs.promises.readFile(file, { encoding });\n if (isTemplate) {\n fileData = mustache__default[\"default\"].render(fileData, {\n name,\n displayName: widgetConfig.displayName,\n config: JSON.stringify(Object.assign(Object.assign({}, widgetConfig), { name }), null, \"\\t\"),\n configDeploy: JSON.stringify(deploymentConfig, null, \"\\t\"),\n serverSettings: JSON.stringify(serverSettings, null, \"\\t\"),\n });\n }\n let relativePath = file;\n if (__dirname.includes(\"\\\\\")) {\n relativePath = relativePath.replace(/\\//g, \"\\\\\");\n }\n relativePath = relativePath\n .replace(path.join(__dirname, \"templates\", \"_shared\"), \"\")\n .replace(path.join(__dirname, \"templates\", widgetConfig.technology), \"\")\n .replace(templateSuffix, \"\");\n const newFilePath = path.join(process.cwd(), widgetFolderName(name), relativePath);\n const dir = path.parse(newFilePath).dir;\n await fs.promises.mkdir(dir, { recursive: true });\n await fs.promises.writeFile(newFilePath, fileData, { encoding });\n };\n const templates = await getTemplates(widgetConfig.technology);\n for (const file of Object.values(templates)) {\n await renderTemplate(file);\n }\n return;\n}", "title": "" }, { "docid": "61c40ff49cd0489d3ab39cc83624a5c5", "score": "0.5342966", "text": "function projectLevelBuild () {\r \r // CREATES DATABASES\r \r //ARCHITECTURAL VARIABLES\r newProject = true;\r \r // DEFAULT DATABASE - STORED IN SCRIPT UI FOLDER\r var storedCoreData = File (scriptDirectory + \"structural_test_004_coreDatabase.xml\");\r var storedPresetsData = File (scriptDirectory + \"structural_test_004_presetsDatabase.xml\");\r var storedVersionData = File (scriptDirectory + \"structural_test_004_versionDatabase.xml\");\r \r //BUILDS NEW DATABASE\r var newCoreData = new File(projectPath+\"/\"+projectName+\"_\"+\"coreDatabase\"+\"_\"+scriptName+\".xml\");\r var newPresetsData = new File(projectPath+\"/\"+projectName+\"_\"+\"presetsDatabase\"+\"_\"+scriptName+\".xml\");\r var newVersionData = new File(projectPath+\"/\"+projectName+\"_\"+\"versionDatabase\"+\"_\"+scriptName+\".xml\");\r \r // IMPORTS DEFAULT CORE DATA\r storedCoreData.open('r');\r var storedCoreDataContent = storedCoreData.read();\r storedCoreData.close();\r \r newCoreData.open('w');\r newCoreData.write(storedCoreDataContent);\r newCoreData.close();\r \r // IMPORTS DEFAULT PRESETS DATA\r storedPresetsData.open('r');\r var storedPresetsDataContent = storedPresetsData.read();\r storedPresetsData.close();\r \r newPresetsData.open('w');\r newPresetsData.write(storedPresetsDataContent);\r newPresetsData.close(); \r \r // IMPORTS DEFAULT VERSION DATA\r storedVersionData.open('r');\r var storedVersionDataContent = storedVersionData.read();\r storedVersionData.close();\r \r newVersionData.open('w');\r newVersionData.write(storedVersionDataContent);\r newVersionData.close(); \r \r //SETS VERSION SETTINGS\r projectVersionNumber = scriptVersionNumber;\r scriptVersionValid = \"Valid\";\r\r creationUI ();\r \r}", "title": "" }, { "docid": "7fa40d8829a67386496dd3adf2292d6a", "score": "0.53076124", "text": "function completeImport()\n\t{\n\t\t// give user option to import ipad project\n\t\tif (options.type == 'mobile')\n\t\t{\n\t\t\tif (Projects.hasIPad)\n\t\t\t{\n\t\t\t\tvar answer = confirm('You are importing a mobile project. Click OK to continue or click Cancel to import this as an iPad project.');\n\t\t\t\tif (answer==false)\n\t\t\t\t{\n\t\t\t\t\toptions.type = 'ipad';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Preserve the original runtime version if possible. If not, use the first available runtime.\n\t\tif (options.runtime === undefined || versions.indexOf(options.runtime) == -1)\n\t\t\toptions.runtime = versions[0];\n\n\t\tProjects.createProject(options);\n\t\t//Titanium.Analytics.featureEvent('project.import',options);\n\t\tTiDev.setConsoleMessage('Your project has been imported', 2000);\n\t\t\n\t}", "title": "" }, { "docid": "c160b648299f850856d635d0d52c37b4", "score": "0.5307572", "text": "create(req, resp, next) {\n projetos.create(req, resp, next);\n }", "title": "" }, { "docid": "9612014195267c9e0ee13d6e344b3e1b", "score": "0.53048426", "text": "function _nonChromeCreateProject(files) {\n return _zipFileUploadCreateProject(files);\n }", "title": "" }, { "docid": "f514f35f30623c4b3cb86f41dec24150", "score": "0.53026783", "text": "function createProject(req, res, next) {\n\n var projectName = req.body.projectName.trim();\n\n // if Project Name is too long, cancel the action.\n if (projectName.length > 100) {\n req.flash('error_msg', 'Project Name too long!');\n return next();\n }\n\n // If the new name is empty, cancel the action.\n if(projectName.length == 0) {\n req.flash('error_msg', \"Project Name can't be empty!\");\n return next();\n }\n\n // If everything is ok, proceed!\n\n // Create the default Task Type\n var defaultTaskType = new TaskType({\n name: \"Default\",\n color: \"#a7c8fa\"\n });\n\n TaskType.createTaskType(defaultTaskType, function(err, taskType){\n if(err) throw err;\n });\n\n var tasks;\n var users;\n var taskgroups;\n\n var newProject = new Project({\n name: projectName,\n description: req.body.projectDescription,\n owner: req.user._id,\n tasktypes: defaultTaskType._id,\n tasks: tasks,\n users: users,\n taskgroups: taskgroups,\n status: \"active\",\n created: {\n date: new moment().format(\"DD/MM/YY\"),\n time: new moment().format(\"HH:mm:ss\")\n }\n });\n\n Project.createProject(newProject, function(err, project){\n\t\tif(err) throw err;\n req.project = project;\n })\n\n // Create Log entry\n var newLog = new Log({\n project: newProject._id,\n owner: req.user._id,\n created: {\n date: new moment().format(\"DD/MM/YY\"),\n time: new moment().format(\"HH:mm:ss\")\n },\n action: {\n category: \"Project\",\n method: \"Create\"\n }\n });\n\n // Save the log entry\n Log.createLog(newLog, function(err, log){\n if (err) throw err;\n });\n\n req.flash('success_msg', 'Project Created');\n return next();\n}", "title": "" }, { "docid": "bf19131af4f1c0c4ed9f70b801fd6373", "score": "0.529145", "text": "function createStructure(l3rdName){\n\t\n\n\t// Create new folder with name\n\tprjFolder=app.project.items.addFolder(l3rdName);\n\t\n\t// Create and add subfolders to main Folder\n\trenderFolder=app.project.items.addFolder(\"1.RenderComp\");\n\trenderFolder.parentFolder=prjFolder;\n\teditFolder=app.project.items.addFolder(\"2.EditComps\");\n\teditFolder.parentFolder=prjFolder;\n\tpreFolder=app.project.items.addFolder(\"3.PreComps\");\n\tpreFolder.parentFolder=prjFolder;\n\t\n\n\t//Copy MasterComp and Move to Folder\n\tl3rdComp= findComp(\"MASTER_L3rd\");\n\tl3rdComp=l3rdComp.duplicate();\n\tl3rdComp.name=l3rdName+\"_render\";\n\tl3rdComp.parentFolder=renderFolder;\n\tl3rdComp.openInViewer();\n\t//Copy FootageComp\n\tvar bgComp= findComp(\"FOOTAGE_L3rd\");\n\tbgComp=bgComp.duplicate();\n\tbgComp.name=l3rdName+\"_bgfootage\";\n\tbgComp.parentFolder=editFolder;\n\n\t\n\tvar bgLayer=addCompToComp(bgComp,l3rdComp,0);\n\tbgLayer.moveToEnd();\n\n\t\n\n}", "title": "" }, { "docid": "c7c1fc50372281132aad70346c13e3ec", "score": "0.5282543", "text": "function newFile() {\n if (!Cats.IDE.project) {\n alert(\"Please open a project first.\");\n return;\n }\n Cats.IDE.editorTabView.addEditor(new Cats.Gui.Editor.SourceEditor(), { row: 0, column: 0 });\n }", "title": "" }, { "docid": "c1e0acd15711885a9be2e7b303f726ab", "score": "0.5253893", "text": "function newWindow(filename) {\n var window = Titanium.UI.createWindow({ // create window\n backgroundColor:'white',\n navBarHidden:true,\n url:'/ui/common/'+filename\n });\n window.open();\n}", "title": "" }, { "docid": "9bbac7abd0220c029ce3ee3220328b90", "score": "0.525089", "text": "function createPage(str) {\n const team = generator.teamPage(str);\n fs.writeFile(\"./dist/index.html\", team, (err) => {\n err ? console.error(err) : console.log(\"Success!\");\n })\n}", "title": "" }, { "docid": "7202dac14011d030540d85e5f8843d15", "score": "0.5241998", "text": "function createNewAPITemplates() {\n\tvar extensions = fs.readFileSync(\"./samples/extensions.yaml\", \"utf8\");\n\t\n\tvar soap = fs.readFileSync(\"./templates/soap.yaml\", \"utf8\");\n\tvar newSoap = soap + os.EOL + os.EOL + extensions;\n\tfs.writeFileSync(\"./\" + FLOWTESTOUTPUT + \"/soap.yaml\", newSoap, \"utf8\");\n\n\tvar rest = fs.readFileSync(\"./templates/rest.yaml\", \"utf8\");\n\tvar newRest = rest + os.EOL + os.EOL + extensions;\n\tfs.writeFileSync(\"./\" + FLOWTESTOUTPUT + \"/rest.yaml\", newRest, \"utf8\");\n\t\n\tvar restSwagger = fs.readFileSync(\"./templates/restSwagger.yaml\", \"utf8\");\n\tvar newRestSwagger = restSwagger + os.EOL + os.EOL + extensions;\n\tfs.writeFileSync(\"./\" + FLOWTESTOUTPUT + \"/restSwagger.yaml\", newRestSwagger, \"utf8\");\n\t\n}", "title": "" }, { "docid": "ab03e5706f03cf570bcaf4413a7f234c", "score": "0.52369165", "text": "function generateAllCoreFiles() {\n \n //home\n createFile('index.html', createHTML('page_home', 'WFDF Development - Home', 'homepage'));\n \n //projects json\n createFile('projects/projects.json', JSON.stringify(sheet2Json('Projects')));\n \n //Projects page\n createFile('projects.html', createHTML('page_projects', 'WFDF Development - Projects', 'utility-page'));\n\n //resources json\n createFile('resources/resources.json', JSON.stringify(sheet2Json('Resources')));\n \n //Resources page\n createFile('resources.html', createHTML('page_resources', 'WFDF Development - Projects', 'utility-page'));\n \n //Privacy policy\n createFile('privacy-policy.html', createUtilityPageHTML(printVal(privacyPolicyFileID), 'Privacy Policy - WFDF Development'));\n \n //resources json\n createFile('certificates/certificates.json', JSON.stringify(sheet2Json('Certificates')));\n \n //Certificates\n createFile('certificates.html', createHTML('page_certificates', 'Skill Certificates - WFDF Development', 'utility-page'));\n \n //Terms\n createFile('terms-of-use.html', createUtilityPageHTML(printVal(termsOfUseFileID), 'Terms of use - WFDF Development'));\n \n //wfdf programs\n createFile('wfdf-development-programs.html', createUtilityPageHTML(printVal(wfdfProgramsFileID), 'WFDF Development Programs - WFDF Development') );\n\n}", "title": "" }, { "docid": "be4e3ce730181e48597752d50af1dfa4", "score": "0.52295715", "text": "async function build({ projectName }) {\n try {\n let cwd = process.cwd();\n let dist = path.resolve(cwd, projectName);\n await fse.copy(path.resolve(__dirname, \"../project_template\"), dist);\n let r = await fse.readFile(dist + \"/package.json\",'utf-8');\n await fse.writeFile(\n dist + \"/package.json\",\n r.replace(/vue-element-base/g, projectName)\n );\n\n console.log(chalk.green(\"√ 项目初始化成功\"));\n } catch (err) {\n console.error(err);\n process.exit(1);\n }\n}", "title": "" }, { "docid": "5ce3df2f003f8df349a03135342ff187", "score": "0.5204142", "text": "function build(){\n\t//Concatinating and minifying all common js files and libraries\n\tfileUtils.concatJs({\n\t\tsrc:[\n\t\t\tWORKPATH+\"assets/js/jquery.js\",\t\t\t\n\t\t\tWORKPATH+\"assets/js/bootstrap.js\",\t\t\t\n\t\t\tWORKPATH+\"assets/js/modalBox.js\",\n\t\t\tWORKPATH+\"assets/js/contextMenu.js\",\n\t\t\tWORKPATH+\"assets/js/base.js\"\n\t\t],\n\t\tdest:BUILDPATH+\"assets/js/base.js\",\n\t\tminify:globalSetting.minify\n\t},\n\t//to copy other js files and minify them(page specifi js files)\n\t{\n\t\tsrc:[\n\t\t\tWORKPATH+\"assets/js/home.js\",\n\t\t],\n\t\tdest:BUILDPATH+\"assets/js/home.js\",\n\t\tminify:globalSetting.minify\n\t},\n\t//for other project page\n\t{\n\t\tsrc:[\n\t\t\tWORKPATH+\"assets/js/projects.js\",\n\t\t],\n\t\tdest:BUILDPATH+\"assets/js/projects.js\",\n\t\tminify:globalSetting.minify\n\t});\n\t\n\t\n\n\n\n\tvar projectsData= JSON.parse(fileUtils.getData(WORKPATH+\"data/projects.json\"));\n\t\n\t//to create layouts\n\t//create index page\n\tlayoutUtil.compile({\n\t\t\tlayout:{\n\t\t\t\t\tbody:WORKPATH+\"home.html\",\n\t\t\t\t\tpageScripts:WORKPATH+\"includes/homeScript.html\",\n\t\t\t\t},\n\t\t\ttemplateData:{\n\t\t\t\ttitle:\"Demo project\",\n\t\t\t\tactive:\"Home\",\n\t\t\t\tpageCss:\"assets/css/home.css\"\n\t\t\t},\n\t\t\tsrc :WORKPATH+\"layout.html\",\n\t\t\tdest:BUILDPATH+\"index.html\",\n\t\t\textend: \"baseLayout\"\n\t\t},\n\t//create projects page\n\t\t{\n\t\t\tlayout:{\n\t\t\t\t\tbody:WORKPATH+\"projects.html\",\n\t\t\t\t\tpageScripts:WORKPATH+\"includes/homeScript.html\",\n\t\t\t\t},\n\t\t\ttemplateData:{\n\t\t\t\ttitle:\"Other projects\",\n\t\t\t\tprojects:projectsData.projects,\n\t\t\t\tactive:\"Other\",\n\t\t\t\tpageCss:\"assets/css/project.css\"\n\t\t\t},\n\t\t\tsrc :WORKPATH+\"layout.html\",\n\t\t\tdest:BUILDPATH+\"project.html\",\n\t\t\textend: \"baseLayout\"\n\t\t},\t\t\n\t//create page1\n\t\t{\n\t\t\tlayout:{\n\t\t\t\t\tbody:WORKPATH+\"page1.html\"\n\t\t\t\t},\n\t\t\ttemplateData:{\n\t\t\t\ttitle:\"Demo page\",\n\t\t\t\tactive:\"Page1\"\n\t\t\t},\n\t\t\tsrc :WORKPATH+\"layout.html\",\n\t\t\tdest:BUILDPATH+\"page1.html\",\n\t\t\textend: \"baseLayout\"\n\t\t},\t\t\n\t//create page2\n\t\t{\n\t\t\tlayout:{\n\t\t\t\t\tbody:WORKPATH+\"page2.html\"\n\t\t\t\t},\n\t\t\ttemplateData:{\n\t\t\t\ttitle:\"Demo page2\",\n\t\t\t\tactive:\"Page2\"\n\t\t\t},\n\t\t\tsrc :WORKPATH+\"layout.html\",\n\t\t\tdest:BUILDPATH+\"page2.html\",\n\t\t\textend: \"baseLayout\"\n\t\t});\n\t\n\n\t//function to copy file\n\t//function to copy all images \n\t\n\tfileUtils.copy({\n\t\t\tsrcFolder:WORKPATH+\"assets/images\",\n\t\t\tdestFolder:BUILDPATH+\"assets/images\"\n\t\t});\n\t\n\n\t\n\t//to create css files from less files\n\tlessUtils.compile(\n\t\t//compile common less to css\n\t\t{\n\t\t\tsrc:WORKPATH+\"assets/less/base.less\",\n\t\t\tdest:BUILDPATH+\"assets/css/base.css\",\n\t\t\tminify:globalSetting.minify\n\t\t},\n\t\t//compile page specific less to css\n\t\t{\n\t\t\tsrc:WORKPATH+\"assets/less/home.less\",\n\t\t\tdest:BUILDPATH+\"assets/css/home.css\",\n\t\t\tminify:globalSetting.minify\n\t\t},\n\t\t{\n\t\t\tsrc:WORKPATH+\"assets/less/project.less\",\n\t\t\tdest:BUILDPATH+\"assets/css/project.css\",\n\t\t\tminify:globalSetting.minify\n\t\t}\n\t\t);\n\t\n}", "title": "" }, { "docid": "1d19721b3756cfd79eac2b494176b9d6", "score": "0.5204142", "text": "async generate() {\n await this.generateReadmeFile();\n if (this.profile.levelNumber === 1) {\n await this.generatePlayerCodeFile();\n }\n }", "title": "" }, { "docid": "7cac9de727ee43829e1cd6f6cf7e5f0e", "score": "0.5202177", "text": "function createSandbox(options) {\n if (!options.appName) {\n console.log('Oops! You forgot to provide a project name.')\n return console.log(\n ` ${chalk.green('create-new-app <project-name> --sandbox')}`,\n )\n }\n\n createProjectDirectory(options)\n fs.copySync(dir('./files/sandbox'), options.appDir)\n}", "title": "" }, { "docid": "acb2b259675b172aa27c6f33ac0756e5", "score": "0.51926434", "text": "async function main() {\n projects.forEach(async project => {\n await prisma\n .createProject({\n title: project.title,\n imageURL: project.imageURL,\n description: project.description,\n learning_objectives: project.learning_objectives,\n subjects: { set: project.subjects },\n tags: { set: project.tags },\n grades: { set: project.grades }\n })\n .then(res => {\n console.log(res);\n })\n .catch(e => console.error(e.result));\n });\n}", "title": "" }, { "docid": "fdb54bf19e69b497ae14233dbd96db26", "score": "0.5188909", "text": "function makeInitPage(title){\n\n\tvar win = Ti.UI.createWindow({\n\t\ttitle:title,\n\t\tbackgroundColor:'white'\n\t});\n\tvar theHTML;\n\tvar h;\n\tvar raceId;\n\tvar raceName;\n\tvar scratchPicked;\n\t\n\tpicker = createScratchSheetPicker(win);\n\tpicker.addEventListener('change',function(e) {\n \tscratchPicked = e.row;\n\t});\n\t\n\t//create a delete button, so we can delete scratch sheets\n\tvar buttonDeleteScratch = Ti.UI.createButton({\n\t\theight:44,\n\t\twidth:400,\n\t\ttitle:L('Delete Scratch Sheet'),\n\t\ttop:400,\n\t\tleft : 10\n\t});\n\tbuttonDeleteScratch.addEventListener('click', function() {\n\t\t//see if we can find a scratchSheet locally...\n\t\tif (scratchPicked.getTitle() != 'Create New Scratch sheet') {\n\t\t\tvar scratchFile = Ti.Filesystem.getFile(Titanium.Filesystem.resourcesDirectory, scratchPicked.getTitle());\n\t\t\tscratchFile.deleteFile();\n\t\t\t\n\t\t\t//redraw the picker with the new list of files\n\t\t\twin.remove(picker);\n\t\t\tpicker = createScratchSheetPicker(win);\n\t\t\tpicker.addEventListener('change',function(e) {\n\t\t \tscratchPicked = e.row;\n\t\t\t});\n\t\t\twin.add(picker);\n\t\t}\n\t});\n\tvar buttonLoadScratch = Ti.UI.createButton({\n\t\theight:44,\n\t\twidth:400,\n\t\ttitle:L('Load Scratch Sheet'),\n\t\ttop:330,\n\t\tleft : 10\n\t});\n\tbuttonLoadScratch.addEventListener('click', function() {\n\t\t//see if we can find a scratchSheet locally...\n\t\tif (scratchPicked.getTitle() != 'Create New Scratch sheet') {\n\t\t\t//var scratchFile = Ti.Filesystem.getFile(Titanium.Filesystem.resourcesDirectory, raceName + '_'+ raceId +'_scratchSheet.txt');\n\t\t\tvar scratchFile = Ti.Filesystem.getFile(Titanium.Filesystem.resourcesDirectory, scratchPicked.getTitle());\n\n\t\t\tTi.API.info(scratchFile);\n\t\t\tvar contents = scratchFile.read();\n\t\t}\n\t\tif (typeof contents != 'undefined') {\n\t\t\t\n\t\t\tjson = JSON.parse(contents.text);\n\t\t\tvar jsonOut = {};\n\t\t\tjsonOut.regattaName = raceName;\n\t\t\tjsonOut.boats = json.boats;\n\t\t\tscratchListView = makeScratchSheetView(jsonOut);\n\t\t\twin2.add(scratchListView);\n\n\t\t\tmakeStartPage();\n\t\t} else {\n\t\t\n\t\tc = Titanium.Network.createHTTPClient();\n\t\turl = 'http://www.regattaman.com/scratch.php?yr=2013&race_id=' + raceId;\n\t\tTi.API.info('url = ' + url);\n\n\t c.open('GET', url);\n\t c.onload = function()\n\t\t\t{\n\t\t\t //label1.text= this.responseText;\n\t\t\t theHTML=this.responseText;\n\t\t\t //parse out the scratch sheet, then build the json file to be read by the scratchSheet window\n\t\t\t /**\n\t\t\t * The HTML looks like this :\n\t\t\t * <table class = scratch ...>\n\t\t\t * <tr> \n\t\t\t * <td class=fleet1 ....> -- This is a new fleet\n\t\t\t * </tr>\n\t\t\t * <tr> -- New Boat Data\n\t\t\t * \t <td> -- fleet\n\t\t\t * \t <td> -- skipper\n\t\t\t * \t <td> -- boat name\n\t\t\t * \t <td> -- yacht club\n\t\t\t * \t <td> -- sail number\n\t\t\t * \t <td> -- boat type\n\t\t\t * \t <td> -- Rating\n\t\t\t * \t <td> -- race rating\n\t\t\t * \t <td> -- cruise rating\n\t\t\t * \t <td> -- R/C\n\t\t\t * </tr>\n\t\t\t * <tr> -- New boat\n\t\t\t * \t <tr> -- New Boat\n\t\t\t * <tr class=fleet1> -- New Fleet\n\t\t\t */\n\t\t\t //Ti.API.info(theHTML);\n\n\t\t\t Ti.include('htmlparser.js');\n\t\t\t Ti.include('soupselect.js');\n\n\t\t\t var select = soupselect.select;\n\t\t\t\tvar handler = new htmlparser.DefaultHandler(function(err, dom) {\n\t\t\t\t\tif (err) {\n\t\t\t\t\t\talert('Error: ' + err);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t/*\n\t\t\t\t\t\tvar img = select(dom, 'img');\n\t\t\t\t \n\t\t\t\t\t\timg.forEach(function(img) {\n\t\t\t\t\t\t\talert('src: ' + img.attribs.src);\n\t\t\t\t\t\t});\n\t\t\t\t\t\t*/\n\t\t\t\t\t\t//get the th elements, that'll tell us how many columns there are\n\t\t\t\t\t\t//there are two <th> elements, one for the row, one for the sorter link\n\t\t\t\t\t\tvar columns = select(dom, 'th');\n\t\t\t\t\t\tnumCol = columns.length/2;\n\t\t\t\t\t\tTi.API.info('Found ' + numCol + ' columns');\n\t\t\t\t\t\t\n\t\t\t\t \t\t//get all the TDs into an array\n\t\t\t\t\t\tvar rows = select(dom, 'td');\n\t\t\t\t\t\tvar i = 0;\n\t\t\t\t \t\tvar boats = new Array();\n\t\t\t\t \t\tvar myBoat = {}; \n\t\t\t\t \t\t\n\t\t\t\t \t\tcol = 1;\n\t\t\t\t\t\twhile (rows.length > 0){\n\t\t\t\t\t\t\trow = rows.shift();\n\t\t\t\t\t\t\tif (typeof row.children != 'undefined'){\n\t\t\t\t\t\t\t\trowData = row.children[0].data;\n\t\t\t\t\t\t\t\tswitch (col) {\n\t\t\t\t\t\t\t\t\tcase 1 :\n\t\t\t\t\t\t\t\t\t\t//build a new boat, and store it's fleet\n\t\t\t\t\t\t\t\t\t\tmyBoat = {};\n\t\t\t\t\t\t\t\t\t\tmyBoat.fleet = rowData;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase 2 :\n\t\t\t\t\t\t\t\t\t\tmyBoat.skipper = rowData;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase 3 :\n\t\t\t\t\t\t\t\t\t\tmyBoat.name = rowData;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase 4 :\n\t\t\t\t\t\t\t\t\t\tmyBoat.town = rowData;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase 5 :\n\t\t\t\t\t\t\t\t\t\tmyBoat.sailNumber = rowData;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase 6 :\n\t\t\t\t\t\t\t\t\t\tmyBoat.boatType = rowData;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase 7 :\n\t\t\t\t\t\t\t\t\t\tmyBoat.rating = rowData;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase 8 :\n\t\t\t\t\t\t\t\t\t\tmyBoat.raceRating = rowData;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase 9:\n\t\t\t\t\t\t\t\t\t\tmyBoat.cruiseRating = rowData;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase 10:\n\t\t\t\t\t\t\t\t\t\tmyBoat.r_c = rowData;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tdefault :\n\t\t\t\t\t\t\t\t\t//if there are more than 10 columns, just add an array of extra data\n\t\t\t\t\t\t\t\t\t//might need this, who knows\n\t\t\t\t\t\t\t\t\t\tif (typeof myBoat.extra == 'undefined'){\n\t\t\t\t\t\t\t\t\t\t\tmyBoat.extra = new Array();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tmyBoat.extra.push(rowData);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//Ti.API.info('Data = ' +rowData);\n\t\t\t\t\t\t\t} \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//go to the next column, or next boat\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (col < numCol){\n\t\t\t\t\t\t\t\tcol ++;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t//and add the boat to the list of boats\n\t\t\t\t\t\t\t\tboats.push(myBoat);\n\t\t\t\t\t\t\t\tcol = 1;\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\tTi.API.info('All Boats = ' + JSON.stringify(boats));\n\t\t\t\t\t\tvar jsonOut = {};\n\t\t\t\t\t\tjsonOut.regattaName = raceName;\n\t\t\t\t\t\tjsonOut.boats = boats;\n\t\t\t\t\t\tTi.API.info('jSon = ' + JSON.stringify(jsonOut));\n\n\t\t\t\t\t\tscratchListView = makeScratchSheetView(jsonOut);\n\t\t\t\t\t\twin2.add(scratchListView);\n\n\t\t\t\t\t\tmakeStartPage();\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar f = Ti.Filesystem.getFile(Titanium.Filesystem.resourcesDirectory, raceName + '_'+ raceId +'_scratchSheet.txt');\n\t\t\t\t\t\tif(!f.write(JSON.stringify(jsonOut))) {\n\t\t\t\t\t\t\tTi.API.info(\"could not write string to file.\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tTi.API.info(\"Wrote a file with \" + f.size + \" at \" + f.resolve());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tvar parser = new htmlparser.Parser(handler);\n\t\t\t\tparser.parseComplete(theHTML);\n\n\t\t\t};\n\t\tc.send();\n\t} //end of if for fileget\n\t});\n\t\n\tvar raceIdField = Ti.UI.createTextField({\n\t borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED,\n\t hintText: 'race Id',\n\t color: '#336699',\n\t top: 50, left: 150,\n\t width: 150, height: 20,\n\t});\n\tvar raceIdLabel = Titanium.UI.createLabel({\n\t text:L('Race Id'),\n\t left: 10 ,top : 50,\n\t});\n\traceIdField.addEventListener('change', function(data) {\n\t\tif (isNaN(Number(data.source.value))){\n\t\t\tdata.source.value = 0;\n\t\t}\n\t\traceId = data.source.value;\n\t});\n\n\tvar raceNameField = Ti.UI.createTextField({\n\t borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED,\n\t hintText: 'Race Name',\n\t color: '#336699',\n\t top: 10, left: 150,\n\t width: 150, height: 20,\n\t});\n\tvar raceNameLabel = Titanium.UI.createLabel({\n\t text:L('Race Name'),\n\t left: 10 ,top : 10,\n\t});\n\t\n\tvar pickLabel = Titanium.UI.createLabel({\n\t text:L('Pick a stored Scratch Sheet'),\n\t left: 10 ,top : 90,\n\t});\n\traceNameField.addEventListener('change', function(data) {\n\n\t\traceName = data.source.value;\n\t});\n\n //var dom = Titanium.XML.parseString(theHTML);\n win.add(picker);\n win.add(pickLabel);\n win.add(buttonLoadScratch);\n win.add(buttonDeleteScratch);\n\twin.add(raceIdField);\n\twin.add(raceIdLabel);\n\twin.add(raceNameField);\n\twin.add(raceNameLabel);\n \n return win;\n}", "title": "" }, { "docid": "afb9c0e8b86be969318da101851835cd", "score": "0.51706463", "text": "function plGenerate(done) {\n return run('php pattern-lab/core/console --generate').exec();\n done();\n}", "title": "" }, { "docid": "1f7c30bcc54b87d013e119b8d56ece06", "score": "0.51541054", "text": "function createProject(e) {\r\n var stuff = {\r\n projectName: $(\"#projectName\").val(),\r\n facilityName: $(\"#facilityName\").val(),\r\n plan: App.pp.RtpPlanYear,\r\n sponsorOrganizationId: $(\"#availableSponsors\").val(),\r\n cycleid: App.pp.CurrentCycleId\r\n },\r\n sstuff;\r\n\r\n sstuff = JSON.stringify(stuff, null, 2);\r\n\r\n App.postit('/api/RtpProjectItem', {\r\n data: sstuff,\r\n success: function (data) {\r\n var redirectActionUrl = App.env.applicationPath\r\n + '/RtpProject/' + App.pp.RtpPlanYear\r\n + '/Info/' + data\r\n + '?message=' + encodeURIComponent('Project created successfully.');\r\n alert('A new RTP Project has been created with ID ' + data);\r\n location.assign(redirectActionUrl);\r\n }\r\n });\r\n }", "title": "" }, { "docid": "73c328ee42176a89cd56f19aae76b882", "score": "0.5146121", "text": "function run () {\n\n // check if template is local\n if (isLocalPath(template)) {\n const templatePath = getTemplatePath(template)\n if (exists(templatePath)) {\n generate(name, templatePath, to, program, config, err => {\n if (err) logger.fatal(err)\n console.log()\n logger.success('初始化\"%s\"模板成功。', name)\n })\n } else {\n logger.fatal('缓存模板\"%s\"未找到。', template)\n }\n } else {\n\n\n downloadAndGenerate(`direct:${config.repository.url}${program.branch ? `#${program.branch}` : ''}`)\n }\n}", "title": "" }, { "docid": "d96432b367d634113219ef176b27596e", "score": "0.5125305", "text": "function _chromeCreateProject(files) {\n if (files.length > 1 || (files.length === 1 && !aux.isZipFile(files[0].file))) {\n // multiple files or single html file\n return _multiFileUploadCreateProject(files);\n } else {\n return _zipFileUploadCreateProject(files);\n }\n }", "title": "" }, { "docid": "a1141afc829411f9a0c4225373850100", "score": "0.51198685", "text": "writing() {\n // This will not match in callback of\n // getBuild so store it here.\n var _this = this;\n var done = this.async();\n app.getBuild(this, function (e, result) {\n var build = _this.templatePath(result);\n\n if (_this.type === `custom`) {\n build = path.join(_this.customFolder, result);\n }\n \n var args = {\n pat: _this.pat,\n tfs: _this.tfs,\n buildJson: build,\n queue: _this.queue,\n target: _this.target,\n appName: _this.applicationName,\n project: _this.applicationName,\n };\n\n if (util.isDocker(_this.target)) {\n args.dockerHost = _this.dockerHost;\n args.dockerRegistry = _this.dockerRegistry;\n args.dockerRegistryId = _this.dockerRegistryId;\n }\n else if (util.isKubernetes(_this.target)) {\n args.kubeEndpoint = _this.kubeEndpoint;\n args.serviceEndpoint = _this.serviceEndpoint;\n args.azureRegistryName = _this.azureRegistryName;\n args.azureRegistryResourceGroup = _this.azureRegistryResourceGroup;\n args.azureSubId = _this.azureSubId;\n args.kubeName = _this.kubeName;\n args.kubeResourceGroup = _this.kubeResourceGroup;\n }\n\n app.run(args, _this, done);\n });\n }", "title": "" }, { "docid": "3a3df0a8311f4e2beada7845fbeb84e7", "score": "0.51166624", "text": "configuring() {\n this.copyTemplate('./app.json', `${this.options.projectname}/app.json`)\n this.copyTemplate('./app.wxss', `${this.options.projectname}/app.wxss`)\n this.copyTemplate('./app.js', `${this.options.projectname}/app.js`)\n this.copyTemplate('./sitemap.json', `${this.options.projectname}/sitemap.json`)\n this.copyTemplate('./utils', `${this.options.projectname}/utils`)\n this.copyTemplate('./vendor', `${this.options.projectname}/vendor`)\n this.copyTemplate('./pages', `${this.options.projectname}/pages`)\n this.fs.copyTpl(this.templatePath('./project.config.json'), this.destinationPath(`${this.options.projectname}/project.config.json`), { projectName: this.options.projectname });\n }", "title": "" }, { "docid": "8eadc8b0eeb5b2d3a59b418999e84850", "score": "0.5107615", "text": "function createProjectPill(projectObj) {\n let listItem = document.createElement('a');\n listItem.classList = \"list-item mdc-list-item\";\n listItem.textContent = projectObj.title;\n listItem.dataset.id = projectObj.id;\n listItem.dataset.eventFor = \"projects-data\"; //for events use\n listItem.dataset.eventType = \"view-project\";\n if (projectObj.isCurrentlyViewed) {\n listItem.classList.add(\"mdc-list-item--activated\");\n }\n\n listItem.addEventListener('click', controller);\n\n listItem.appendChild(createDeleteBtn(projectObj.id, \"project\"));\n return listItem;\n }", "title": "" }, { "docid": "a845c947cc83916b4156ee221df82d8f", "score": "0.51054674", "text": "function create() {}", "title": "" }, { "docid": "6a733c1aad846ceda02a6b37b038f528", "score": "0.5103513", "text": "function createFile() {\n if (projectType == \"Basic\") {\n internalReference = idAgency + \"-\" + padToFour(orderNumber) + \"-\" + padToTwo(version) + \"-\" + padToTwo(revision);\n createListItem(projectId, internalReference, documentType, description, dateCreated, diffusionDate, externalReference, localization, form, status, orderNumber);\n } else if (projectType == \"Full\") {\n internalReference = documentType + \"-\" + padToFour(projectCode) + \"-\" + padToTwo(avenant) + \"-\" + idAgency + \"-\" + padToFour(orderNumber) + \"-\" + padToTwo(version) + \"-\" + padToTwo(revision);\n createListItem(projectId, internalReference, documentType, description, dateCreated, diffusionDate, externalReference, localization, form, status, orderNumber);\n //Internal Reference as Full Without Project \n } else {\n internalReference = documentType + \"-\" + idAgency + \"-\" + padToFour(orderNumber) + \"-\" + padToTwo(version) + \"-\" + padToTwo(revision);\n createListItem(projectId, internalReference, documentType, description, dateCreated, diffusionDate, externalReference, localization, form, status, orderNumber);\n }\n }", "title": "" }, { "docid": "f49f196cae7ee2b81939ec7fd8719c1f", "score": "0.50962675", "text": "function newProjectForm(fields){\n elementCreator('submit','button', projectForm, 'Save')\n let submit = document.getElementById('submit');\n submit.setAttribute('type','submit');\n\n elementCreator('Cancel', 'p', projectForm, 'Cancel','cancel');\n createDropDown('priority',priorities, projectForm);\n \n for (let i = 0; i<fields.length; i++) {\n let label = document.createElement('label');\n label.setAttribute('for',fields[i]);\n label.textContent = fields[i];\n projectForm.appendChild(label);\n let input = document.createElement('input');\n //input.value = 'Example Value';\n input.setAttribute('type', 'text');\n input.setAttribute('name', fields[i]);\n input.required = true;\n projectForm.appendChild(input);\n } \n}", "title": "" }, { "docid": "b49f26b327f8558306dfacb712372a66", "score": "0.50943846", "text": "function createBaseFile() {\n\tGLib.file_set_contents(filePath,BASE_CONTENT+BASE_TASKS);\n}", "title": "" }, { "docid": "efb1d1408a4e0ef6c284a83f28a05565", "score": "0.50683826", "text": "@action StartNewEntry(ProjectId){\n\n const NewEntryId = this.parent.entryStore.AddEntryProject(ProjectId);\n this.entryId = NewEntryId;\n this.parent.projectStore.currentProjectId = ProjectId;\n this.switchEntry(true);\n\n }", "title": "" }, { "docid": "c529c40a4f9c0942ae6791e3fd0726a0", "score": "0.5067427", "text": "function runTask() {\n program\n .option('-p, --package', 'Just add a package.json into your project.')\n .on('--help', function() {\n console.log(' ' + 'Examples:');\n console.log(' $', 'quick init Initialize a package');\n console.log(' $', 'quick init -p Add a package.json into your project');\n console.log('');\n })\n .parse(process.argv);\n\n if (!emptyDir(process.cwd()) && !program.package) {\n console.warn(color.yellow('Existing files here, please run init command in an empty folder!'));\n return;\n }\n\n console.log('Creating a package: ');\n\n inquirer.prompt([{\n message: 'Package name',\n name: 'name',\n default: path.basename(process.cwd()),\n validate: function(input) {\n var done = this.async();\n if (!NAME_REGEX.test(input)) {\n console.warn(color.red('Must be only lowercase letters, numbers, dashes or dots, and start with lowercase letter.'));\n return;\n }\n done(true);\n }\n }, {\n message: 'Version',\n name: 'version',\n default: '0.0.1',\n validate: function(input) {\n var done = this.async();\n if (!semver.valid(input)) {\n console.warn(color.red('Must be a valid semantic version.'));\n return;\n }\n done(true);\n }\n }, {\n message: 'Description',\n name: 'description'\n }, {\n message: 'Author',\n name: 'author',\n default: require('whoami')\n }], function(answers) {\n answers.varName = answers.name.replace(/\\-(\\w)/g, function(all, letter) {\n return letter.toUpperCase();\n });\n //answers.yuanUrl = 'http://spmjs.io';\n\n if (program.package) {\n vfs.src(path.join(templatepath, 'package.json'))\n .pipe(gulpTemplate(answers))\n .pipe(vfs.dest('./'))\n .on('end', function() {\n console.log(color.green('Initialize a package.json Succeccfully!'));\n });\n return;\n }\n vfs.src(['!.git/**','**'], {\n cwd:templatepath,\n dot: true\n })\n .pipe(gulpTemplate(answers))\n .pipe(vfs.dest('./'))\n .on('end', function() {\n /*fs.renameSync('./.gitignore', './.gitignore');\n fs.renameSync('./.travis.yml', './.travis.yml');*/\n console.log(color.green('\\nInitialize a package Succeccfully!\\n'));\n });\n });\n }", "title": "" }, { "docid": "eb8d7d55f218627da88c2e88a07a7e54", "score": "0.50657254", "text": "function create2DTemplate() { // KinectToPin Template Setup for UI Panels\n\n //start script\n\tapp.beginUndoGroup(\"Create 2D Template\");\n\n\t// create project if necessary\n\tvar proj = app.project;\n\tif(!proj) proj = app.newProject();\n\n\t// create new comp named 'my comp'\n\tvar compW = 1920; // comp width\n\tvar compH = 1080; // comp height\n\tvar compL = 15; // comp length (seconds)\n\tvar compRate = 24; // comp frame rate\n\tvar compBG = [0/255,0/255,0/255]; // comp background color\n\tvar myItemCollection = app.project.items;\n\tvar myComp = myItemCollection.addComp('KinectToPin 2D Template',compW,compH,1,compL,compRate);\n\tmyComp.bgColor = compBG;\n\t\n\t// add mocap source layer\n\tvar mocap = myComp.layers.addSolid([0, 0, 0], \"mocap\", 640, 480, 1);\n\tmocap.guideLayer = true;\n mocap.threeDLayer = true;\n\t//mocap.locked = true;\n\tmocap.property(\"position\").setValue([960,540]);\n mocap.property(\"anchorPoint\").setValue([0,0]);\n\tmocap.property(\"opacity\").setValue(0);\n\t\n\t// array of all points KinectToPin tracks\n\tvar trackpoint = jointNamesMaster;\n\t\n\t\n\t\t\t// create source point control and control null for each\n\t\t\tfor (var i = 0; i <= 14; i++){ \n\n\t\t\t\t// add source point\n\t\t\t\tvar pointname = trackpoint[i];\n\t\t\t\tvar myEffect = mocap.property(\"Effects\").addProperty(\"Point Control\");\n\t\t\t\tmyEffect.name = pointname;\n\t\t\t\tvar p = mocap.property(\"Effects\")(pointname)(\"Point\");\n\t\t\t\tp.expression = \n \"pin = smooth(.2,5); \\r\" +\n \"sW = thisLayer.width; \\r\" +\n \"dW = thisComp.width; \\r\" +\n \"sH = thisLayer.height; \\r\" +\n \"dH = thisComp.height; \\r\" +\n \"[pin[0]*(dW/sW)-(.5*dW), pin[1]*(dH/sH)-(.5*dH)];\";\n\n\t\t\t}\n\n\t\t\tfor (var j = 14; j >= 0; j--){ \n\t\t\t\t// add control null\n\t\t\t\tvar pointname = trackpoint[j];\n\t\t\t\tvar solid = myComp.layers.addSolid([1.0, 0, 0], pointname, 50, 50, 1);\n\t\t\t\tsolid.guideLayer = true;\n\t\t\t\tsolid.property(\"opacity\").setValue(33);\n solid.property(\"position\").setValue([0,0]);\n solid.property(\"anchorPoint\").setValue([0,0]);\n\t\t\t\tvar p = solid.property(\"position\");\n\t\t\t\tvar expression = \n\t//~~~~~~~~~~~~~expression here~~~~~~~~~~~~~~~\n \"pin = thisLayer.name;\\r\" +\n \"master_source = thisComp.layer(\\\"mocap\\\");\\r\" +\n \"source_point = master_source.effect(pin)(\\\"Point\\\");\\r\" +\n \"point = master_source.toComp(source_point);\\r\" +\n \"point + value\\r\"; \n\t//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\t\t\t\tp.expression = expression;\n\t\n\t\t\t}\n\t\n\t\n //add skeleton visualizer\n var skeleviz = myComp.layers.addSolid([0, 0, 0], \"Skeleton Visualizer\", 1920, 1080, 1);\n skeleviz.guideLayer = true;\n skeleviz.locked = true;\n skeleviz.property(\"opacity\").setValue(50);\n var myPreset = File(ffxpath);\n skeleviz.applyPreset(myPreset); \n \n app.endUndoGroup();\n } //end script", "title": "" }, { "docid": "206666b421eabb00cd4279166e064252", "score": "0.5065098", "text": "createProjectFolders(createProjectInfo) {\n let environmentNames = createProjectInfo.environments;\n logger.info(\"creating pipeline %s, with environments: %s\", this.projectFolder, environmentNames.join(\", \"));\n this.__createProjectFolders();\n this.createProjectSettings(createProjectInfo);\n this.createEnvironments(environmentNames);\n }", "title": "" }, { "docid": "d50e104ee135e477a465763e0fe59bda", "score": "0.50635576", "text": "function getNewProjectName(callback) {\n 'use strict';\n\n var message = 'Step ' + step + ': Set the project shortcut! This will be used to rename the ' +\n '\\nTYPO3 \"gm7_sitepackage\" extension path and has impact on \\npathes within your ' +\n 'Patternlab Setup, JS and SCSS Files!\\n',\n promptOptions,\n regExNewName = new RegExp(oldProjectName + '_sitepackage', 'g');\n\n process.stdout.write('\\n');\n process.stdout.write(chalk.blue.bold(message));\n\n // options for user prompt\n promptOptions = {\n properties: {\n name: {\n pattern: /\\b\\w[a-z,0-9]{2,5}\\b/,\n description: chalk.yellow('New Project Shortcut (whitout \"_sitepackage\"):'),\n message: chalk.red('Shortcut must be only letters and numbers, lowercase and has 2 to 5 characters'),\n required: true\n }\n }\n };\n\n // start prompt process\n prompt.start();\n\n // Get project name properties from the user\n prompt.get(promptOptions, function(err, result) {\n var userInput = result.name;\n newProjectName = userInput.toLowerCase();\n\n // replace options for path replacement (gm7_sitepackage --> [user Input]_sitepackage)\n replace({\n files: [\n './03-internals/gulp/config/dirs_typo3.json',\n './patternlab-config.json',\n './02-patternlab/source/**/*.json',\n './02-patternlab/source/**/*.mustache',\n './01-src/javascript/**/*.js',\n './01-src/javascript-core/**/*.js',\n './01-src/stylesheets/**/*.scss'\n ],\n replace: regExNewName,\n with: newProjectName + '_sitepackage',\n\n //Specify if empty/invalid file paths are allowed, defaults to false.\n //If set to true these paths will fail silently and no error will be thrown.\n allowEmptyPaths: true\n\n }, function(error, changedFiles) {\n\n if (error) {\n return console.error('Error occurred:', error);\n //process.stdout.write(chalk.red('\\nNO files modified (\\\"gm7_sitepackage\\\" not found!)'));\n }\n\n // display what was changed after a small delay\n setTimeout(function() {\n // process write what files are changed (where path replacement took place)\n process.stdout.write(chalk.green('\\nModified files:'));\n process.stdout.write(chalk.green('\\n' + changedFiles.join(',\\n')));\n process.stdout.write(chalk.green('\\n\\n'));\n\n callback();\n }, 1500);\n });\n });\n}", "title": "" }, { "docid": "b3ae5e1173bf10648dad11cdc53033ff", "score": "0.50589764", "text": "function AddFilesToCSharpProject1(oProj, strProjectName, strProjectPath, InfFile, AddItemFile)\n{\n try\n {\n dte.SuppressUI = false;\n var projItems;\n if(AddItemFile)\n projItems = oProj;\n else\n projItems = oProj.ProjectItems;\n\n var strTemplatePath = wizard.FindSymbol(\"TEMPLATES_PATH\");\n\n var strTpl = \"\";\n var strName = \"\";\n var strDependent = \"\";\n\n // if( Not a web project )\n if(strProjectPath.charAt(strProjectPath.length - 1) != \"\\\\\")\n strProjectPath += \"\\\\\"; \n\n var strTextStream = InfFile.OpenAsTextStream(1, -2);\n \n while (!strTextStream.AtEndOfStream)\n {\n // Look to see if there is a dependency on another object. The inf\n // file will show as:\n //\n // MasterObjectFileName;DependentObjectFileName\n strTpl = strTextStream.ReadLine();\n if (strTpl != \"\")\n {\n var sc = strTpl.indexOf(\";\");\n if (sc >= 0) \n {\n strName = strTpl.substr(0,sc);\n if(sc < strTpl.length)\n {\n strDependent = strTpl.substr(sc+1);\n }\n else \n {\n strDependent = \"\";\n }\n }\n else\n {\n strName = strTpl;\n strDependent = \"\";\n }\n\n var strTarget = \"\";\n var strFile = \"\";\n strTarget = GetTargetName(strName, strProjectName);\n\n var fso;\n fso = new ActiveXObject(\"Scripting.FileSystemObject\");\n var TemporaryFolder = 2;\n var tfolder = fso.GetSpecialFolder(TemporaryFolder);\n var strTempFolder = fso.GetAbsolutePathName(tfolder.Path);\n\n var strFile = strTempFolder + \"\\\\\" + fso.GetTempName();\n\n var strClassName = strTarget.split(\".\");\n wizard.AddSymbol(\"SAFE_CLASS_NAME\", strClassName[0]);\n wizard.AddSymbol(\"SAFE_ITEM_NAME\", strClassName[0]);\n\n var strTemplate = strTemplatePath + \"\\\\\" + strName;\n var bCopyOnly = false;\n var strExt = strName.substr(strName.lastIndexOf(\".\"));\n if(strExt==\".bmp\" || strExt==\".ico\" || strExt==\".gif\" || strExt==\".rtf\" || strExt==\".css\")\n bCopyOnly = true;\n wizard.RenderTemplate(strTemplate, strFile, bCopyOnly, true);\n\n var projfile = projItems.AddFromTemplate(strFile, strTarget);\n SafeDeleteFile(fso, strFile);\n \n if(projfile)\n {\n SetFileProperties(projfile, strName);\n if (strDependent != \"\") \n {\n // There is a dependent file. Add this to the projfile we just added\n var strDependentTarget = GetTargetName(strDependent, strProjectName);\n \n strTemplate = strTemplatePath + \"\\\\\" + strDependent;\n strFile = strTempFolder + \"\\\\\" + fso.GetTempName();\n strExt = strDependent.substr(strDependent.lastIndexOf(\".\"));\n if(strExt==\".bmp\" || strExt==\".ico\" || strExt==\".gif\" || strExt==\".rtf\" || strExt==\".css\")\n bCopyOnly = true;\n else\n bCopyOnly = false;\n wizard.RenderTemplate(strTemplate, strFile, bCopyOnly, true);\n \n var dependentItem = projfile.ProjectItems.AddFromTemplate(strFile, strDependentTarget);\n SafeDeleteFile(fso, strFile);\n }\n }\n\n var bOpen = false;\n if(AddItemFile)\n bOpen = true;\n else if (DoOpenFile(strTarget))\n bOpen = true;\n\n if(bOpen)\n {\n var window = projfile.Open(vsViewKindPrimary);\n window.visible = true;\n }\n }\n }\n strTextStream.Close();\n }\n catch(e)\n {\n strTextStream.Close();\n throw e;\n }\n}", "title": "" }, { "docid": "916136d8f024f8c972723786e517cae8", "score": "0.5057298", "text": "function create3DTemplate() { // KinectToPin Template Setup for UI Panels\n\n //start script\n\tapp.beginUndoGroup(\"Create 3D Template\");\n\n if(parseFloat(app.version) >= 10.5){\n\n\t// create project if necessary\n\tvar proj = app.project;\n\tif(!proj) proj = app.newProject();\n \n\t// create new comp named 'my comp'\n\tvar compW = 1920; // comp width\n\tvar compH = 1080; // comp height\n\tvar compL = 15; // comp length (seconds)\n\tvar compRate = 24; // comp frame rate\n\tvar compBG = [0/255,0/255,0/255]; // comp background color\n\tvar myItemCollection = app.project.items;\n\tvar myComp = myItemCollection.addComp('KinectToPin 3D Template',compW,compH,1,compL,compRate);\n\tmyComp.bgColor = compBG;\n\t\n \n\t// add mocap source layer\n\tvar mocap = myComp.layers.addSolid([0, 0, 0], \"mocap\", 640, 480, 1);\n\tmocap.guideLayer = true;\n mocap.threeDLayer = true;\n\tmocap.property(\"position\").setValue([960,540]); \n\tmocap.property(\"opacity\").setValue(0);\n mocap.property(\"anchorPoint\").setValue([0,0]);\n mocap.label = 6;\n\t\n\t// array of all points KinectToPin tracks\n\tvar trackpoint = jointNamesMaster;\n\t\n\t\n\t\t\t// create source point control and control null for each\n\t\t\tfor (var i = 0; i <= 14; ++i){ \n\n\t\t\t\t// add source point\n\t\t\t\tvar pointname = trackpoint[i];\n\t\t\t\tvar myEffect = mocap.property(\"Effects\").addProperty(\"3D Point Control\");\n\t\t\t\tmyEffect.name = pointname;\n\t\t\t\tvar p = mocap.property(\"Effects\")(pointname)(\"3D Point\");\n\t\t\t\tp.expression = \"pin = smooth(.2,5); \\r\" + \n \"sW = thisLayer.width; \\r\" + \n \"dW = thisComp.width; \\r\" + \n \"sH = thisLayer.height; \\r\" + \n \"dH = thisComp.height; \\r\" + \n \"[pin[0]*(dW/sW)-(.5*dW), pin[1]*(dH/sH)-(.5*dH),linear(pin[2],0,200,0,2000)-1500];\";\n\t\t\t}\n\n\t\t\tfor (var j=14; j >= 0; j--){\n\t\t\t\t// add control null\n\t\t\t\tvar pointname = trackpoint[j];\n\t\t\t\tvar solid = myComp.layers.addSolid([1.0, 0, 0], pointname, 50, 50, 1);\n\t\t\t\tsolid.guideLayer = true;\n solid.threeDLayer = true;\n\t\t\t\tsolid.property(\"opacity\").setValue(33);\n solid.property(\"anchorPoint\").setValue([0,0]);\n\t\t\t\tvar p = solid.property(\"position\");\n\t\t\t\tvar expression = \n\t//~~~~~~~~~~~~~expression here~~~~~~~~~~~~~~~\n \"pin = thisLayer.name; \\r\" + \n \"master_source = thisComp.layer(\\\"mocap\\\"); \\r\" + \n \"source_point = master_source.effect(pin)(\\\"3D Point\\\"); \\r\" + \n \"point = master_source.toComp(source_point); \\r\" + \n \"point + value\";\n\t//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\t\t\t\tp.expression = expression;\n p.setValue([0,0,0]);\n\t\n\t}\n\t\n\n \n //add control camera\n var compcam = myComp.layers.addCamera(\"KinectToPin Camera\", [960,540]); \n compcam.property(\"position\").setValue([960,540,-1500]);\n\n \n // Auto-scale Z on mocap layer\n var autoZ = mocap.property(\"position\");\n autoZ.expression = \n \"mocap = thisLayer; \\r\" +\n \"try{cam = thisComp.activeCamera;}catch(err){ cam = mocap }; \\r\" +\n \"torso = mocap.effect(\\\"torso\\\")(\\\"3D Point\\\"); \\r\" +\n \"tW = mocap.toWorld(torso); \\r\" +\n \"fW = cam.fromWorld(tW); \\r\" +\n \"[value[0],value[1],value[2]+(1500-fW[2])*2]\"; \n\n //add skeleton visualizer\n var skeleviz = myComp.layers.addSolid([0, 0, 0], \"Skeleton Visualizer\", 1920, 1080, 1);\n skeleviz.guideLayer = true;\n skeleviz.locked = true;\n skeleviz.property(\"opacity\").setValue(50);\n var myPreset = File(ffxpath);\n skeleviz.applyPreset(myPreset);\n \n \n } else {\n // Alert users of incompatibility with older versions of AE\n alert(\"Sorry, this feature only works with CS5.5 and higher.\");\n }\n \n\tapp.endUndoGroup();\n } //end script", "title": "" }, { "docid": "a19c2dab1bf69e1374a437efd9d26eef", "score": "0.5053244", "text": "_updateProject() {\n const projectJsonFile = path.resolve(this.outputFolder, \"package.json\");\n const projectJson = JSON.parse(fs.readFileSync(projectJsonFile));\n projectJson.name = this.projectFolder;\n const userInfo = os.userInfo();\n projectJson.author = `${userInfo.username} <${userInfo}@localhost>`;\n\n fs.writeFileSync(projectJsonFile, JSON.stringify(projectJson, null, 2));\n }", "title": "" }, { "docid": "12a153fd9deb8c752c397af2474dd5fc", "score": "0.504906", "text": "create(){\n\t\t// Nothing to do\n\t}", "title": "" }, { "docid": "b21497168150cd9e30f1c541beae09ea", "score": "0.5045708", "text": "function run () {\n // check if template is local\n downloadAndGenerate('xiemeng/creat-vue-activity')\n}", "title": "" }, { "docid": "760a0da407457c7ebdb2c8fc7eee37e9", "score": "0.5044084", "text": "function createObject (desc, lang, gitURL, isDev) {\n let project = {\n description: desc,\n language: lang,\n gitUrl: gitURL,\n development: isDev,\n\n printRepo: function() {\n console.log(gitURL);\n },\n\n isJavaScript: function() {\n\n return lang === \"JavaScript\";\n \n },\n isDevelopment: function(){\n if (isDev) {\n console.log(\"Project is in development\")\n }\n else {\n console.log(\"Project is not in development\");\n }\n }\n }\n return project;\n}", "title": "" }, { "docid": "33489b16c29164abbca2e6bbc7316681", "score": "0.50414723", "text": "static get description () {\n return 'Create a package.json file'\n }", "title": "" }, { "docid": "e9552e0f97bb3086476d0e66c5ea8446", "score": "0.5037574", "text": "static create(model) {\n return internal.instancehelpers.createElement(model, WebUIProjectSettingsPart);\n }", "title": "" }, { "docid": "24f6553dded8c9ce6a34ec32e002ccdb", "score": "0.5031923", "text": "async function createDirectoryContents (templatePath, newProjectPath) {\n//const createDirectoryContents = async (templatePath, newProjectPath) => {\n const filesToCreate = fs.readdirSync(templatePath);\n\t\n filesToCreate.forEach(file => {\n const origFilePath = `${templatePath}/${file}`;\n \n // get stats about the current file\n const stats = fs.statSync(origFilePath);\n\n if (stats.isFile()) {\n const contents = fs.readFileSync(origFilePath, 'utf8');\n\t \n\t // Rename\n\t if (file === '.npmignore') file = '.gitignore';\n \n const writePath = `${CURR_DIR}/${newProjectPath}/${file}`;\n fs.writeFileSync(writePath, contents, 'utf8');\n } else if (stats.isDirectory()) {\n fs.mkdirSync(`${CURR_DIR}/${newProjectPath}/${file}`);\n \n // recursive call\n createDirectoryContents(`${templatePath}/${file}`, `${newProjectPath}/${file}`);\n }\n });\n}", "title": "" }, { "docid": "b11ea7233fb20b1917cef2a845008cf6", "score": "0.503041", "text": "function createTaskCardProject(project, serviceObj = {}, lblOverride) {\n // create elements\n const container = document.querySelector('#projects-container');\n const taskCard = document.createElement('DIV');\n const taskCardCloseContainer = document.createElement('DIV');\n const taskCardClose = document.createElement('I');\n const progressBarContainer = document.createElement('DIV');\n const progressBar = document.createElement('DIV');\n const progressBarFill = document.createElement('DIV');\n const taskCardHeader = document.createElement('H3');\n const textNode = document.createTextNode(`${project.projectName}`);\n let progressBarWidth = 0;\n let progressBarColor = '';\n function calcProgressWidth() {\n let totalTasks = project.tasks.length;\n let checked = 0;\n for (const task of project.tasks) {\n if (task.checked == 'true') {\n checked++;\n }\n }\n let checkedTasks = checked;\n\n progressBarWidth = (checkedTasks / totalTasks).toFixed(2) * 100;\n }\n function calcProgressColor() {\n if (progressBarWidth < 33) progressBarColor = 'red';\n else if (progressBarWidth >= 33 && progressBarWidth < 67)\n progressBarColor = 'yellow';\n else if (progressBarWidth >= 67) progressBarColor = 'green';\n }\n calcProgressWidth();\n calcProgressColor();\n\n // add css classes and attributes to elements\n taskCard.classList.add('task-card', 'task-card-project');\n taskCard.id =\n Object.keys(serviceObj).length !== 0\n ? `pro${serviceObj.projectsIdCounter}`\n : `${lblOverride}`;\n taskCardCloseContainer.classList.add('task-card__delete-container');\n taskCardClose.classList.add('fa', 'fa-times', 'task-card__delete');\n taskCardClose.setAttribute('aria-hidden', 'true');\n taskCardHeader.classList.add('task-card__header', 'project-header');\n progressBarContainer.classList.add('task-card__progress-bar-container');\n progressBar.classList.add('progress-bar');\n progressBarFill.classList.add('progress-bar-fill');\n // PB needs to change dynamically based on % of items checked and name of object\n progressBarFill.style.width = `${progressBarWidth}%`;\n progressBarFill.style.backgroundColor = `${progressBarColor}`;\n // Appending children and rendering to DOM\n taskCard.appendChild(taskCardCloseContainer);\n taskCardCloseContainer.appendChild(taskCardClose);\n taskCard.appendChild(taskCardHeader);\n taskCardHeader.appendChild(textNode);\n taskCard.appendChild(progressBarContainer);\n progressBarContainer.appendChild(progressBar);\n progressBar.appendChild(progressBarFill);\n progressBarContainer.appendChild(progressBar);\n\n container.insertBefore(taskCard, container.firstChild);\n}", "title": "" }, { "docid": "8b98bba5d89001f129123b2a6400f432", "score": "0.5019166", "text": "function createUrn(name, type, parent, project, stack) {\n let parentPrefix;\n if (parent) {\n let parentUrn;\n if (Resource.isInstance(parent)) {\n parentUrn = parent.urn;\n }\n else {\n parentUrn = output_1.output(parent);\n }\n parentPrefix = parentUrn.apply(parentUrnString => parentUrnString.substring(0, parentUrnString.lastIndexOf(\"::\")) + \"$\");\n }\n else {\n parentPrefix = output_1.output(`urn:pulumi:${stack || settings_1.getStack()}::${project || settings_1.getProject()}::`);\n }\n return output_1.interpolate `${parentPrefix}${type}::${name}`;\n}", "title": "" }, { "docid": "89aaaa2ce25d5f75698f607fc9fca045", "score": "0.5014205", "text": "function pCreate() {\n settings();\n pConditions();\n pGen();\n return pResult;\n}", "title": "" }, { "docid": "bb2afd7897208472fa986fa390b697dc", "score": "0.501148", "text": "function run () {\n downloadAndGenerate('ksc-fx/pcadmin-c-cli-template-webpack', tmp)\n}", "title": "" }, { "docid": "11c16f98b3bb9c5cd823d0fe92c1b478", "score": "0.5010054", "text": "function addTemplatesButtonClicked() {\n\t$.downloadForms = Alloy.createController('downloadForms');\n}", "title": "" }, { "docid": "83b099a8084903157468a454310bb059", "score": "0.50037307", "text": "function buildProjectObject(saveObject)\n {\n var projectObject =\n {\n name: saveObject.projectName,\n taskList: [saveObject.taskName],\n frozen: false\n };\n return projectObject;\n }", "title": "" } ]
9c1d1cee114cee615d2350c4e54d87df
seperate function for Player two so boyh players do not share same randomized number
[ { "docid": "13b2f27479ba19a48e5ef7ee42b9242c", "score": "0.60942096", "text": "function isShipInRangeHPlayerTwo(boat) {\n n = Math.floor(Math.random() * 64);\n let c = n % 8;\n if (c + 2 >= 8) {\n isShipInRangeHPlayerTwo(boat);\n } else {\n placeHorizontalPlayerTwo(n, boat);\n }\n}", "title": "" } ]
[ { "docid": "53565e1e20d68cf0fcd3fe43d53b5238", "score": "0.7095769", "text": "willCooperateWithPlayer(playerId) {\n return Math.floor(Math.random() * 100) % 2 == 0;\n }", "title": "" }, { "docid": "fff5121ecd292bb794756ee232f2784d", "score": "0.7057502", "text": "function generate_nextplayerID(){\n //Generate the next player ID\n var rand =Math.floor(Math.random()*3);\n while(rand == currentPlayer){\n rand =Math.floor(Math.random()*3);\n }\n nextPlayer = rand;\n}", "title": "" }, { "docid": "2c5154b738ba72a584b3c567e70021a8", "score": "0.6836601", "text": "function randomStarter() {\r\n randomPlayer = Math.floor(Math.random() * 2 + 1);\r\n if (randomPlayer === 1) {\r\n setUpPlayer1();\r\n } else {\r\n setUpPlayer2();\r\n }\r\n}", "title": "" }, { "docid": "8705165689248b856dd15a98da7c0f11", "score": "0.6645845", "text": "function getPlayerPick() {\n player.pick = (Math.floor((Math.random()*10) + 1));;\n console.log(\"You picked \" + player.pick);\n\n}", "title": "" }, { "docid": "8705165689248b856dd15a98da7c0f11", "score": "0.6645845", "text": "function getPlayerPick() {\n player.pick = (Math.floor((Math.random()*10) + 1));;\n console.log(\"You picked \" + player.pick);\n\n}", "title": "" }, { "docid": "b466a3e528dd1dba23755c4056d26785", "score": "0.65706444", "text": "function choosePlayer() {\n\n\t\tif(Math.floor( Math.random() * 2) === 0 ){\n\t\t\treturn 'x';\n\t\t}else{\n\t\t\treturn 'o';\n\t\t}\n\n\t}", "title": "" }, { "docid": "be8f6f9cf5d637105b7eec7b7a20af9e", "score": "0.65321213", "text": "function replaceRandom(p) {\n let toRep = floor(random(0, startPlayers));\n players[toRep] = p;\n}", "title": "" }, { "docid": "40cd989e6f8c736612f5b4dd958ca827", "score": "0.65213484", "text": "function setRandomPlayerColor() {\n // randomly select a number from 0 to 6\n // the number will be used as an index for determining which color in the array\n player1Color = COLORS[int(random(0, 7))];\n player2Color = COLORS[int(random(0, 7))];\n // if the player strokes are the same, repeat randomly selecting a different number for player2\n while (player2Color === player1Color) {\n player2Color = COLORS[int(random(0, 7))];\n }\n}", "title": "" }, { "docid": "5bd68e6d6b230d14c89418004a792c36", "score": "0.65196216", "text": "function randomPlayer() {\n\tvar x = Math.floor(Math.random() * 10)\n\tif (x % 2 == 0) {\n\t\tsetTimeout(\"cpuTurn()\", 500);\n\t}\n\telse {\n\t\treturn;\n\t}\n}", "title": "" }, { "docid": "78121c260985316e8d5d1893eb5876e9", "score": "0.6510996", "text": "function randomNumber() {\n \n //EXECUTE IN INTERVAL\n \n state.timer = setInterval(\n function () {\n \n //SAVE THA LAST RANDOM NUMBER GENERATED\n state.lastRandomNumber=state.randomNumber;\n state.lastRandomPlayerId=`player${state.lastRandomNumber+1}`;\n\n //GENERATE ROUNDED RANDOM NUMBER BETWEEN 0 AND ALL THE PLAYERS\n let number = Math.floor(Math.random() * players.length);\n \n //IF THE PLAYER ARE DEAD DONT USE THE RANDOM NUMBER\n if (!players[number].dead && state.run) {\n state.randomNumber = number;\n state.radomPlayerId = `player${number+1}`\n \n\n //CALL CHANGE STYLE PLAYER FUNCTION\n changeStylePlayer()\n }\n }\n , state.time);\n \n \n \n}", "title": "" }, { "docid": "60d75478aabae5d9708c38292c64aa0a", "score": "0.6497111", "text": "function randomNumber(){\n\t\t\t\t\t\treturn Math.floor(Math.random() * doubledCards.length);\n\t\t\t\t\t}", "title": "" }, { "docid": "00a31bdc7d73e0b14a65d147d2d78237", "score": "0.64941925", "text": "coin_flip_mp(p1_name, p2_name) {\n const c = random(1,2);\n\n switch(c) {\n case 1: // Player 1 duluan\n Game.players.push(new Player(p1_name));\n Game.players.push(new Player(p2_name));\n break;\n\n case 2: // Player 2 duluan\n Game.players.push(new Player(p2_name));\n Game.players.push(new Player(p1_name));\n break;\n }\n\n Game.players[0].set_enemy(Game.players[1]);\n Game.players[1].set_enemy(Game.players[0]);\n\n console.log(`${Game.players[0].p_name} bergerak duluan!`);\n press_enter_to_continue();\n console.log(`\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n`);\n }", "title": "" }, { "docid": "c06a60f7fcd82a85ad0a420217c3446e", "score": "0.6479789", "text": "function getRand(){\n return friends2[Math.floor((Math.random()*friends2.length))]\n}", "title": "" }, { "docid": "8322f9f8110071d59b9000aed56f63c2", "score": "0.64529496", "text": "function randomPlayer() {\n\n /*\n Creating function to pick a random player to start\n I got Math.floor Math.random method for getting a randomized number from:\n https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random\n */\n var randNum = Math.floor(Math.random() * 2);\n\n // Selecting either General or Diplomat to start after 50/50 chance determined\n if (randNum === 0) {\n playerTurn = \"General\";\n } else {\n playerTurn = \"Diplomat\";\n }\n}", "title": "" }, { "docid": "803e95e55f40b675bf984a14e2108b15", "score": "0.64370596", "text": "privateShuffleTurn() {\n // Start shuffle after all players end their turn.\n if ((this.playerEndOfTurnOne.length + this.playerEndOfTurnTwo.length) === this.playerAmount) {\n let firstTeam = Math.round(Math.random()); // Increase randomness by having 2 different algorithms.\n if (firstTeam === 0) {\n this.privateInterleavePlayers(() => { // Increase randomness by randomly pick a player in a turn-finished array.\n if (this.playerEndOfTurnOne.length > 0) this.world.players.push(this.playerEndOfTurnOne.splice(Math.floor(Math.random()*this.playerEndOfTurnOne.length), 1)[0]);\n if (this.playerEndOfTurnTwo.length > 0) this.world.players.push(this.playerEndOfTurnTwo.splice(Math.floor(Math.random()*this.playerEndOfTurnTwo.length), 1)[0]);\n })\n } else {\n this.privateInterleavePlayers(() => {\n if (this.playerEndOfTurnTwo.length > 0) this.world.players.push(this.playerEndOfTurnTwo.splice(Math.floor(Math.random()*this.playerEndOfTurnTwo.length), 1)[0]);\n if (this.playerEndOfTurnOne.length > 0) this.world.players.push(this.playerEndOfTurnOne.splice(Math.floor(Math.random()*this.playerEndOfTurnOne.length), 1)[0]);\n })\n }\n this.world.players.splice(0, this.playerAmount);\n } else {\n this.world.currentPlayer.team === 0\n ? this.playerEndOfTurnOne.push(this.world.currentPlayer)\n : this.playerEndOfTurnTwo.push(this.world.currentPlayer);\n console.log(this.world.currentPlayer.team, \"playerNo,\", this.world.currentPlayer.playerNo);\n }\n }", "title": "" }, { "docid": "3c2385394efa0f9ee14e6046316088ba", "score": "0.64213496", "text": "generateUniquePlayerKey() {\r\n return (Math.random() + 1).toString(36).substring(2,10);\r\n }", "title": "" }, { "docid": "a97f9a9ab4a1c295700eccd9ef1e6f72", "score": "0.64178604", "text": "playerOneMove() {\n let min = Math.ceil(31);\n let max = Math.floor(33);\n return console.log(Math.floor(Math.random() * (max - min)) + min);\n }", "title": "" }, { "docid": "81a4c7c37244b9b7b477514c47594a4f", "score": "0.63952065", "text": "function randomPlayer() {\n let playerSelect = Math.round(Math.random());\n if (playerSelect === 0) {\n player = 'O';\n } else {\n player = 'X';\n }\n}", "title": "" }, { "docid": "cada7c3c7c3b48cc84461ab6c6c6af7d", "score": "0.63533497", "text": "function randomPlayer(players) {\n return players[Math.floor(Math.random() * players.length)]\n}", "title": "" }, { "docid": "e839e6befdfe2e2fa733628f1e5c503c", "score": "0.6351418", "text": "getPlayer (marbleId) {\n return marbleId % this.scores.length\n }", "title": "" }, { "docid": "eccccb6512e3e32a10692790a2ed8e6c", "score": "0.63105595", "text": "function firstPlayer() {\n\tvar randomNumber = Math.random();\n\tif (randomNumber < 0.5) {\n\t\treturn \"x\";\n\t} else {\n\t\treturn \"o\";\n\t}\n\treturn firstPlayer;\n}", "title": "" }, { "docid": "6279a210b19405d98be66c34a900d997", "score": "0.6310216", "text": "function game() {\n\t\n\tcounter = 0;\n\t$('#playersscore').text(counter);\n\n\tfunction grandMasterRandom(min,max) {\n\t\treturn Math.floor(Math.random()*(max-min+1)+min);\n\t}\n\n\tvar displayNumber = grandMasterRandom(19,120);\n\n\t$('#guessThisNumber').text(displayNumber);\n\n}", "title": "" }, { "docid": "bd97162aec73e59922987018db587f0f", "score": "0.6296367", "text": "function comenzar() {\n\teleccionMaquina = Math.floor(Math.random() * (3 + 1));\n}", "title": "" }, { "docid": "2bf57831ca9596055c73cc84537f62ed", "score": "0.62867", "text": "function taperAdversaire(){\r\n\r\n coup = Math.floor((Math.random() * 4) + 1) ;\r\n\r\n}", "title": "" }, { "docid": "d97e9f63a0dceff55cd37856e81fe391", "score": "0.62862736", "text": "function checkJackPot() {\n /* compare two random values */\n var jackPotTry = Math.floor(Math.random() * 31 + 1);\n var jackPotWin = Math.floor(Math.random() * 31 + 1);\n if (jackPotTry == jackPotWin) {\n win.play();\n alert(\"You Won the $\" + jackpot + \" Jackpot!!\");\n playerMoney += jackpot;\n jackpot = 1000;\n }\n}", "title": "" }, { "docid": "3cf2befaa941b259acebfe636f3d2aba", "score": "0.6282528", "text": "function playRoulette() {\n var amount = players.length;\n spinning = true;\n $(\".players > div\").css({color: \"inherit\"});\n var chosen = Math.floor(Math.random() * amount) + 1;\n var rotation = (360 / amount) * (chosen - 1) + 360 * 7 - current_rotation;\n current_rotation = (360 / amount) * (chosen - 1);\n pointer.transition({rotate: \"+=\" + rotation + \"deg\"}, 6000, \"easeOutCirc\",\n function() {\n spinning = false;\n $(\"#player\" + chosen).css({color: \"white\"});\n });\n\n }", "title": "" }, { "docid": "9e85c7cb828c7a2d3a1a94174a324c92", "score": "0.6282358", "text": "function choosePlayer() {\n\tvar avaliable = [];\n\tfor (p of playerList) {\n\t\tif (!p.gone) {\n\t\t\tavaliable.push(playerList.indexOf(p));\n\t\t}\n\t}\n\tvar randPlayer = Math.floor(Math.random() * avaliable.length);\n\tplayerList[randPlayer].gone = true;\n\tplayerGone += 1;\n\treturn avaliable[randPlayer];\n}", "title": "" }, { "docid": "0f10d496179b3803b6de3c760ef2586a", "score": "0.6250154", "text": "function OnShufflePlayersPressed()\n{\n\t// Shuffle the team assignments of any players which are assigned to a team, \n\t// this will not assign any players to a team which are currently unassigned. \n\t// This will also not attempt to keep players in a party on the same team.\n\tGame.ShufflePlayerTeamAssignments();\n}", "title": "" }, { "docid": "dc83d44d63e997c7caf283e0f4d0672b", "score": "0.6249514", "text": "function generateWinningNumber(){\n\treturn Math.floor(Math.random()*101); \n}", "title": "" }, { "docid": "b9d88670e6a4398fcbb14a89dbcbdfc1", "score": "0.62433326", "text": "mutate () { \n const cloneDna = [...this.dna];\n // const currentDna = this.dna;\n const randomi = Math.floor(Math.random() * 15);\n const randomPartDna = cloneDna[randomi];\n let randombase = returnRandBase();\n\n while(randombase){\n\t if(randombase != randomPartDna){\n\t break;\n }\n randombase = returnRandBase();\n }\n \n cloneDna[randomi] = randombase;\n return cloneDna;\n }", "title": "" }, { "docid": "fc8df82d677f9302d12566257abc88d2", "score": "0.6238091", "text": "function getRandomNumber() \n {\n return Math.floor(Math.random() * (2 - 1 + 1)) + 1\n }", "title": "" }, { "docid": "b915c3c4778fd28ae0c30175de589a72", "score": "0.62120014", "text": "function sharedCode() {\n\n return randCode() + randCode();\n\n }", "title": "" }, { "docid": "28f62a5ab947b1dde7a889a4254b3be1", "score": "0.6205669", "text": "generatePokemonID() {\n return Math.floor(Math.random() * (802 - 1 + 1) + 1); // return Math.random() * (max - min) + min\n }", "title": "" }, { "docid": "a3f6c56c9590200190b366cbc2b88fed", "score": "0.6178871", "text": "function C101_KinbakuClub_SlaveTwin_RandomBondage() {\n\tif (PlayerHasInventory(\"Cuffs\") || PlayerHasInventory(\"Rope\") || PlayerHasInventory(\"Armbinder\") || PlayerHasInventory(\"BallGag\") || PlayerHasInventory(\"TapeGag\") || PlayerHasInventory(\"ClothGag\")) {\n\t\tPlayerRandomBondage();\n\t\tCurrentTime = CurrentTime + 60000;\n\t\tC101_KinbakuClub_SlaveTwin_JustBoundOrGagged = true;\n\t} else {\n\t\tOverridenIntroText = GetText(\"GetSomeItems\");\n\t\tC101_KinbakuClub_SlaveTwin_CurrentStage = 20;\n\t}\n}", "title": "" }, { "docid": "0688763e4fc58f56d8dfb00c312c5ef2", "score": "0.6178423", "text": "function game() {\n//random number generator for picking infinitive\nnumPick = Math.round(Math.random()*41);\n \n//random number generator for picking infinitive\nnumPicker = Math.round(Math.random()*5);\n\n//return values \nreturn numPicker;\nreturn numPick;\n}", "title": "" }, { "docid": "0688763e4fc58f56d8dfb00c312c5ef2", "score": "0.6178423", "text": "function game() {\n//random number generator for picking infinitive\nnumPick = Math.round(Math.random()*41);\n \n//random number generator for picking infinitive\nnumPicker = Math.round(Math.random()*5);\n\n//return values \nreturn numPicker;\nreturn numPick;\n}", "title": "" }, { "docid": "0688763e4fc58f56d8dfb00c312c5ef2", "score": "0.6178423", "text": "function game() {\n//random number generator for picking infinitive\nnumPick = Math.round(Math.random()*41);\n \n//random number generator for picking infinitive\nnumPicker = Math.round(Math.random()*5);\n\n//return values \nreturn numPicker;\nreturn numPick;\n}", "title": "" }, { "docid": "07a0bfb69ab9b1f9945bfa05cef58248", "score": "0.6177259", "text": "function random(){\n const randomArray = allplayers.map( (aplayer) => {\n return{...aplayer, score:aplayer.score=Math.round(Math.random()*100)}\n }\n\n )\n set_players(randomArray);\n}", "title": "" }, { "docid": "b367d2ebe7b3b67777a73e35e0d5297a", "score": "0.61730385", "text": "function randomInteger(a, b) {\n return Math.floor((b - a + 1) * Math.random()) + a;\n }", "title": "" }, { "docid": "81443a9a89f847b757648ca21857d085", "score": "0.61673665", "text": "function isShipInRangeVPlayerTwo(boat) {\n n = Math.floor(Math.random() * 48);\n let c = n % 8;\n if (c + 16 >= 56) {\n isShipInRangeVPlayerTwo(boat);\n } else {\n placeVerticalPlayerTwo(n, boat);\n }\n}", "title": "" }, { "docid": "4500b50aae5ac6fd1fb57ab67e3bdef1", "score": "0.6166524", "text": "function newRock(){\nrx=Math.random()*(x1);\nif(rx<x1/2)\n{\n rx=r;\n}\nelse{\n rx=x1-r;\n}\nry=Math.random()*(y1/2);\nif(ry<r)\n{\n ry=r;\n}}", "title": "" }, { "docid": "1c353c1edb6c4cea3047f66dd9b28f95", "score": "0.6163169", "text": "function generatewinningNumber(){\n\treturn Math.floor(Math.random() * 100) + 1;\n}", "title": "" }, { "docid": "9e43c4029f9525d902abccdc77428fe7", "score": "0.6157822", "text": "function generateComputerNubmer() {\n for (var i = 19; i <= 120; i++) {\n computerNumberChoices.push(i);\n }\n\n numberToMatch = computerNumberChoices[Math.floor(Math.random() * computerNumberChoices.length)];\n $(\"#numberToMatch\").html(numberToMatch);\n }", "title": "" }, { "docid": "21e449cf093ef03391d288bf21ec1c52", "score": "0.61417943", "text": "random() {\n return Math.random() * 2 - 1;\n }", "title": "" }, { "docid": "6e83a895b4e4c71510fd3286d8b8f5e3", "score": "0.6137454", "text": "function generateWinningNumber(){\n\treturn Math.floor(Math.random()*100);\n}", "title": "" }, { "docid": "71cb53760a91e526020957e13ae59329", "score": "0.613422", "text": "function smallBlind() {\n bet(nextPlayer(), minimum/2);\n}", "title": "" }, { "docid": "be727c0289baac56e96e2850ebc3cabb", "score": "0.61286783", "text": "function flipCoin(){\n\treturn Math.floor(Math.random() * 2);\n}", "title": "" }, { "docid": "d7888ebb2947ee26f6710220717e5547", "score": "0.6127932", "text": "function fight(player1, player2) {\n if(Math.random() < .5) {\n return player1;\n } else {\n return player2; // return means we are going to send player2 back \n // to the code that called the function\n }\n }", "title": "" }, { "docid": "7023046cd8f9162e1cfb16645b80cbd3", "score": "0.61258626", "text": "function inning(){\n return Math.floor(Math.random() *3) \n}", "title": "" }, { "docid": "07d1dab730d1063fd3decbe7e2dbc708", "score": "0.6119287", "text": "coin_flip_sp() {\n const c = random(1,2);\n\n switch(c) {\n case 1: // Player duluan\n Game.players.push(p1 = new Player('Anda'));\n Game.players.push(ai = new Player('Lawan'));\n break;\n\n case 2: // AI duluan\n Game.players.push(ai = new Player('Lawan'));\n Game.players.push(p1 = new Player('Anda'));\n break;\n }\n\n p1.set_enemy(ai);\n ai.set_enemy(p1);\n\n ai.isAI = true;\n\n console.log(`${Game.players[0].p_name} bergerak duluan!`);\n press_enter_to_continue();\n console.log(`\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n`);\n }", "title": "" }, { "docid": "ea5e682efba27bbbef8be18b31181d03", "score": "0.61151016", "text": "function cardSwapper() {\n //get 2 exclusive random integers from front and back halves of the deck\n randomIndexFirst = getRandomIntInclusive(0, 25);\n randomIndexSecond = getRandomIntInclusive(26, 51);\n tempCard = deck[randomIndexFirst];\n tempCard2 = deck[randomIndexSecond];\n deck[randomIndexFirst] = tempCard2;\n deck[randomIndexSecond] = tempCard;\n}", "title": "" }, { "docid": "9f0fec0af03d83d81c24c796cf3dc334", "score": "0.61093825", "text": "function getNumber() {\n //var secNum = 0;\nsecNum = Math.floor((Math.random() * 100) + 1);\n//alert(\" random number \" + secNum);\n// difference = Math.abs(userData - secNum);//alert(difference);\n}", "title": "" }, { "docid": "6a5e72b5899d8c4f7890cc412020c8fe", "score": "0.60909474", "text": "changePlayer() {\n this.currentPlayer = (this.currentPlayer % 2) + 1;\n }", "title": "" }, { "docid": "50d7c0fdd7ee680e64473fb3fbde5370", "score": "0.6086011", "text": "randomizeNumerToMatch() {\n this.numberToMatch = Math.floor(Math.random() * (120 - 18) + 18);\n $(\"#number_to_match\").text(this.numberToMatch);\n }", "title": "" }, { "docid": "939da54a56b0092cd9d7d2edc2307a4a", "score": "0.60831255", "text": "function getOpponentPick() {\n opponent.pick = (Math.floor((Math.random()*10) + 1));;\n console.log(\"Your opponent picked \" + opponent.pick);\n}", "title": "" }, { "docid": "939da54a56b0092cd9d7d2edc2307a4a", "score": "0.60831255", "text": "function getOpponentPick() {\n opponent.pick = (Math.floor((Math.random()*10) + 1));;\n console.log(\"Your opponent picked \" + opponent.pick);\n}", "title": "" }, { "docid": "5531512007668eae3b913aaffa0d893d", "score": "0.6081742", "text": "function generateRandom(a,b){\n\nreturn Math.floor((Math.random() * a) + b);\n}", "title": "" }, { "docid": "239f9d6bebb3fd9c908686f82775d4a9", "score": "0.6078451", "text": "randomize() { }", "title": "" }, { "docid": "e9e9d54e30a8ea4a22a5c5fa20f2361f", "score": "0.6069102", "text": "function getGeneraRandom(a,b) \n{\n return Math.random() *((a-b) + b);\n}", "title": "" }, { "docid": "9151c6ab8775b9f890adf0a7f84ce965", "score": "0.60660166", "text": "randomNum() { return Math.random() * (this.max - this.min) + this.min }", "title": "" }, { "docid": "688b61ced153db7ee62dff55c943fc7d", "score": "0.60630757", "text": "function gains(){\n let gainsRandom = Math.floor(Math.random() * 2);\n if (gainsRandom === 0){\n hiker.inventory.push('Sling Shot')\n } else if (gainsRandom === 1){\n hiker.inventory.push('Hiking Stick')\n }\n}", "title": "" }, { "docid": "9c9ef53c14b56e6e2d28952f363995fa", "score": "0.6057363", "text": "function getRandTileNotLastPlayers() {\n var indexRand, tileRand;\n\n do {\n //get a random index within the tiles remaining array\n indexRand = Math.floor(Math.random() * tilesRemaining.length); //random number from 0 to tilesRemaining.length-1\n\n //get the tile position contained in that random element \n tileRand = tilesRemaining[indexRand];\n\n } while ((tileRand == player1LastTile) || (tileRand == player1SecondLastTile)); \n //while the tile you generate is one of the ones the other player just turned (and therefore didn't make a match), \n //keep generating another random tile \n\n return tileRand;\n}", "title": "" }, { "docid": "f81050c1bc562f7559c06f2906e3c57e", "score": "0.60535455", "text": "function createTanks(currPlayer,otherPlayer){\n currPlayer.setpy(terrainY[currPlayer.getpx]-20);\n otherPlayer.setpy(terrainY[currPlayer.getpx]-20);\n}", "title": "" }, { "docid": "ee98a9fd7729b313f688b71831e5349b", "score": "0.60521346", "text": "function checkJackPot() {\n // compare two random values \n var jackPotTry = Math.floor(Math.random() * 51 + 1);\n var jackPotWin = Math.floor(Math.random() * 51 + 1);\n if (jackPotTry == jackPotWin) {\n alert(\"You Won the $\" + jackpot + \" Jackpot!!\");\n playerMoney += jackpot;\n jackpot = 1000;\n }\n}", "title": "" }, { "docid": "90fa51a5cbbf0427138cb3f55aac628f", "score": "0.6051974", "text": "function generateOnce () {\r\n //Generate Random Number \r\n\t\t let ranPrize = Math.random(); \r\n\t\t \r\n\t\t if (ranPrize < 0.7) {\r\n\t\t\t\tplayAgain += 1; \r\n\t\t\t\tdocument.getElementById('playAgains').innerHTML = playAgain; \r\n\t\t } else if (ranPrize < 0.71) {\r\n\t\t\t\tfreeCoffee += 1;\r\n\t\t\t document.getElementById('freeCoffees').innerHTML = freeCoffee;\r\n\t\t } else if (ranPrize < 0.72) {\r\n\t\t\t freeDonut += 1; \r\n\t\t\t document.getElementById('freeDonuts').innerHTML = freeDonut; \r\n\t\t } else {\r\n\t\t\t\tgrandPrize += 1; \r\n\t\t\t\tdocument.getElementById('grandPrizes').innerHTML = grandPrize; \r\n\t\t}\r\n }", "title": "" }, { "docid": "1c67bc76d490644a87f225fba76fa1e8", "score": "0.60503876", "text": "function generateOnce () {\r\n //Generate Random Number \r\n\t\t let ranPrize = Math.random(); \r\n\t\t \r\n\t\t if (ranPrize < 0.15) {\r\n\t\t\t\tplayAgain += 1; \r\n\t\t\t\tdocument.getElementById('playAgains').innerHTML = playAgain; \r\n\t\t } else if (ranPrize < 0.55) {\r\n\t\t\t\tfreeCoffee += 1;\r\n\t\t\t document.getElementById('freeCoffees').innerHTML = freeCoffee;\r\n\t\t } else if (ranPrize < 0.95) {\r\n\t\t\t freeDonut += 1; \r\n\t\t\t document.getElementById('freeDonuts').innerHTML = freeDonut; \r\n\t\t } else {\r\n\t\t\t\tgrandPrize += 1; \r\n\t\t\t\tdocument.getElementById('grandPrizes').innerHTML = grandPrize; \r\n\t\t}\r\n }", "title": "" }, { "docid": "838ccd4c46ec8bbbad88c9ed64e11b75", "score": "0.60487247", "text": "function advRandomInt(num1, num2) { return parseInt(Math.random()*(num2-num1))+num1; }", "title": "" }, { "docid": "838ccd4c46ec8bbbad88c9ed64e11b75", "score": "0.60487247", "text": "function advRandomInt(num1, num2) { return parseInt(Math.random()*(num2-num1))+num1; }", "title": "" }, { "docid": "e8b1f7e5287cf700addcdde1818a2d4b", "score": "0.604236", "text": "function checkJackPot() {\n /* compare two random values */\n var jackPotTry = Math.floor(Math.random() * 51 + 1);\n var jackPotWin = 27; //Magic number\n if (jackPotTry == jackPotWin) {\n alert(\"You Won the $\" + jackpot + \" Jackpot!!\");\n playerMoney += jackpot;\n jackpot = 5000;\n\n \n }\n}", "title": "" }, { "docid": "56d07718764f1dee40b024b7729f4c5a", "score": "0.6038668", "text": "function newPlayer() {\n var newName = text;\n text = 0;\n var playerIDs = createGuid();\n var player = {\n playerName: newName,\n playerID: playerIDs,\n playerBoard: ['#B1_' + playerIDs, '#B2_' + playerIDs, '#B3_' + playerIDs, '#B4_' + playerIDs, '#B5_' + playerIDs,\n '#I1_' + playerIDs, '#I2_' + playerIDs, '#I3_' + playerIDs, '#I4_' + playerIDs, '#I5_' + playerIDs,\n '#N1_' + playerIDs, '#N2_' + playerIDs, '#N3_' + playerIDs, '#N4_' + playerIDs, '#N5_' + playerIDs,\n '#G1_' + playerIDs, '#G2_' + playerIDs, '#G3_' + playerIDs, '#G4_' + playerIDs, '#G5_' + playerIDs,\n '#O1_' + playerIDs, '#O2_' + playerIDs, '#O3_' + playerIDs, '#O4_' + playerIDs, '#O5_' + playerIDs,\n ],\n playerMini: ['#mini1_' + playerIDs, '#mini6_' + playerIDs, '#mini11_' + playerIDs, '#mini16_' + playerIDs, '#mini21_' + playerIDs,\n '#mini2_' + playerIDs, '#mini7_' + playerIDs, '#mini12_' + playerIDs, '#mini17_' + playerIDs, '#mini22_' + playerIDs,\n '#mini3_' + playerIDs, '#mini8_' + playerIDs, '#mini13_' + playerIDs, '#mini18_' + playerIDs, '#mini23_' + playerIDs,\n '#mini4_' + playerIDs, '#mini9_' + playerIDs, '#mini14_' + playerIDs, '#mini19_' + playerIDs, '#mini24_' + playerIDs,\n '#mini5_' + playerIDs, '#mini10_' + playerIDs, '#mini15_' + playerIDs, '#mini20_' + playerIDs, '#mini25_' + playerIDs\n ],\n playerBool: [false, false, false, false, false,\n false, false, false, false, false,\n false, false, true, false, false,\n false, false, false, false, false,\n false, false, false, false, false\n ],\n playerAll: [],\n playerWin: false,\n playerNumWins: 0,\n playerBody: \"white\",\n playerLine: \"black\",\n playerFont: \"gray\",\n playerShade: \"red\"\n }\n var user = ich.user(player);\n var userBoard = ich.userBoard(player);\n var leaderBoard = ich.leaderBoard(player);\n genBoard(player.playerBoard, player.playerAll);\n $(\"#Opponents\").append(user);\n $(\"#boards\").append(userBoard);\n $(\"#leaders\").append(leaderBoard);\n playerArray[playerArray.length] = player;\n start = true;\n if (beginning === true) {\n colorLoad();\n beginning = false;\n } else {\n setLine(playerArray[0].playerLine);\n setFont(playerArray[0].playerFont);\n setShade(playerArray[0].playerShade);\n }\n}", "title": "" }, { "docid": "17b76f2db90734fe3afef2708b6608d5", "score": "0.6031218", "text": "function checkJackPot() {\n /* compare two random values */\n var jackPotTry = Math.floor(Math.random() * 51 + 1);\n var jackPotWin = Math.floor(Math.random() * 51 + 1);\n if (jackPotTry == jackPotWin) {\n alert(\"You Won the $\" + jackpot + \" Jackpot!!\");\n playerMoney += jackpot;\n jackpot = 1000;\n }\n}", "title": "" }, { "docid": "17b76f2db90734fe3afef2708b6608d5", "score": "0.6031218", "text": "function checkJackPot() {\n /* compare two random values */\n var jackPotTry = Math.floor(Math.random() * 51 + 1);\n var jackPotWin = Math.floor(Math.random() * 51 + 1);\n if (jackPotTry == jackPotWin) {\n alert(\"You Won the $\" + jackpot + \" Jackpot!!\");\n playerMoney += jackpot;\n jackpot = 1000;\n }\n}", "title": "" }, { "docid": "01e461358d0c92cabc6986f2d9a926a0", "score": "0.6029118", "text": "function randomNumber(a, b) {\n return Math.floor(Math.random() * a) + b;\n }", "title": "" }, { "docid": "e195b3e1126022a01034052400f4ff93", "score": "0.60278165", "text": "breed(partner) {\n switch (Math.floor(Math.random() * 3)) {\n case 0:\n return this.crossover(partner);\n case 1:\n return this.randomCrossover(partner);\n case 2:\n return this.partialSwapCrossover(partner);\n }\n }", "title": "" }, { "docid": "d4d7d947760c0ff2941acec069019425", "score": "0.60238", "text": "function randomizeVelocitySynced()\n{\n\tdrawBackground();\n\tplayer.xVelocity = Math.random() * 10;\n\tplayer.yVelocity = Math.random() * 10;\n\tplayer2.xVelocity = \tplayer.xVelocity ;\n\tplayer2.yVelocity = \tplayer.yVelocity;\n\tplayer3.xVelocity = \tplayer.xVelocity ;\n\tplayer3.yVelocity = \tplayer.yVelocity;\n\tplayer4.xVelocity = \tplayer.xVelocity ;\n\tplayer4.yVelocity = \tplayer.yVelocity;\n\n}", "title": "" }, { "docid": "35729436ae69015698677e5f230adeaa", "score": "0.60221344", "text": "function computerPlay () {\n return (Math.floor(Math.random()*3) + 1);\n}", "title": "" }, { "docid": "7866e529134524f2de1c81cf4f0d410a", "score": "0.6020341", "text": "function bigBlind() {\n bet(nextPlayer(), minimum);\n}", "title": "" }, { "docid": "14372ba041693729ba01a1d8ba0b9b77", "score": "0.6019973", "text": "function random(a, b) {\n\tif (typeof b == \"undefined\") {\n\t\ta = a || 2;\n\t\treturn Math.floor(Math.random() * a);\n\t} else {\n\t\treturn Math.floor(Math.random() * (b - a + 1)) + a;\n\t}\n}", "title": "" }, { "docid": "fa04a75c5ddcff96d46254e23d5e4447", "score": "0.6019752", "text": "function checkJackPot() {\n /* compare two random values */\n var jackPotTry = Math.floor(Math.random() * 51 + 1);\n var jackPotWin = Math.floor(Math.random() * 51 + 1);\n if (jackPotTry == jackPotWin) {\n alert(\"You Won the $\" + jackpot + \" Jackpot!!\");\n playerCreditAmount += jackpot;\n jackpot = 1000;\n }\n }", "title": "" }, { "docid": "4019dbda91f6f172b532ef87d99c5f9d", "score": "0.6017685", "text": "function randomNumberGenerator() {\n\t\tvar randomNumber = Math.floor((Math.random() * 100) + 1);\n\t\tsecretNumber = randomNumber;\n\t\treturn randomNumber;\n\t}", "title": "" }, { "docid": "ef84ee8dbc8665e9b37fb47c90f6e271", "score": "0.60156643", "text": "function getrandomNumbers(){\n\t\n\t// linker Fuss\n\tvar random = Math.random() * 4;\n\tlinker_Fuss = Math.ceil(random);\n\t// rechter_Fuss\n\tvar random = Math.random() * 4;\n\trechter_Fuss = Math.ceil(random);\n\t// linke Hand\n\tvar random = Math.random() * 4;\n\tlinke_Hand = Math.ceil(random);\n\t// rechte_Hand\n\tvar random = Math.random() * 4;\n\trechte_Hand = Math.ceil(random);\n}", "title": "" }, { "docid": "f188638292faf4c94568de2b08899b1c", "score": "0.60135156", "text": "function generateOnce () {\r\n //Generate Random Number \r\n\t\t let ranPrize = Math.random(); \r\n\t\t \r\n\t\t if (ranPrize < 0.7) {\r\n\t\t\t\tplayAgain += 1; \r\n\t\t\t\tdocument.getElementById('playAgains').innerHTML = playAgain; \r\n\t\t } else if (ranPrize < 0.8) {\r\n\t\t\t\tfreeCoffee += 1;\r\n\t\t\t document.getElementById('freeCoffees').innerHTML = freeCoffee;\r\n\t\t } else if (ranPrize < 0.9) {\r\n\t\t\t freeDonut += 1; \r\n\t\t\t document.getElementById('freeDonuts').innerHTML = freeDonut; \r\n\t\t } else {\r\n\t\t\t\tgrandPrize += 1; \r\n\t\t\t\tdocument.getElementById('grandPrizes').innerHTML = grandPrize; \r\n\t\t}\r\n }", "title": "" }, { "docid": "0a26594b8aee85928cff61f7cbc09ea0", "score": "0.6013437", "text": "function rand(){\n\treturn Math.random() * 2.0 - 1.0;\n}", "title": "" }, { "docid": "2fbd81aba7615f60d2ae461a8a05731b", "score": "0.60060054", "text": "function = randomize() {\n\trandomizer = Math.random();\n\tif (randomizer < 0.34) {\n\t\tcompChoice = 'rock';\n\t} else if(randomizer <= 0.67) {\n\t\tcompChoice = 'paper';\n\t} else {\n\t\tcompChoice = 'scissors';\n\t}\n\toutput = compare(playerChoice, compChoice);\n\tjunction(output);\n}", "title": "" }, { "docid": "db76794b8b46c74484accff968094502", "score": "0.6004418", "text": "function randomPair() {\n friends = [geo, ace, marco];\n randNum = Math.floor((Math.random() * 3) + 1) - 1;\n return friends[randNum];\n}", "title": "" }, { "docid": "b313236a4669ca328ecfb81fa4d70ab1", "score": "0.5998472", "text": "function generateWinningNumber(){\n winningNumber = Math.floor(Math.random() * 100 + 1);\n}", "title": "" }, { "docid": "d0a6e6d9ccc9f820af738d7e7fbae35e", "score": "0.5997109", "text": "function shuffle(players) {\r\n\t\t\t var i, j, temp;\r\n\t\t\t for (i = players.length - 1; i > 0; i--) {\r\n\t\t\t j = Math.floor(Math.random() * (i + 1));\r\n\t\t\t temp = players[i];\r\n\t\t\t players[i] = players[j];\r\n\t\t\t players[j] = temp;\r\n\t\t\t }\r\n\t\t\t return players;\r\n\t\t\t}", "title": "" }, { "docid": "bea435bb3fd61dd12c3fbbda7d98251d", "score": "0.59956783", "text": "function randomNumber() {\n \n setInterval( function () {\n let number = Math.floor(Math.random() * players.length);\n\n if (!players[number].dead&&state.run) {\n state.randomNumber = number;\n console.log(state.randomNumber)\n changeStylePlayer()\n }\n }, 200);\n \n}", "title": "" }, { "docid": "6cdff58b47ef31269d92039aef61328c", "score": "0.5994772", "text": "function calculateRandomPlayPoints () { //expected points earned by picking A or B randomly\n\n\t\t\trandomPoints = [];\n\t\t\tfor (var i = 0; i < game.maxturn; i++) {\n\t\t\t\trandomPoints[i] = .5*pDry[i]*game.discrete.payoutAdry + .5*pWet[i]*game.discrete.payoutAwet +\n\t\t\t\t .5*pDry[i]*game.discrete.payoutBdry + .5*pWet[i]*game.discrete.payoutBwet;\n\t\t\t}\n\n\t\t\tfor (var i = 0; i < game.maxturn; i++) {\n\t\t\t\tgame.discrete.bonusOneTotal += parseInt(randomPoints[i]);\n\t\t\t}\n\n\t\t\treturn game.discrete.bonusOneTotal;\n\t\t}", "title": "" }, { "docid": "a77c20b27f55fd61c519c05a17e4bb6e", "score": "0.59942144", "text": "function randomNumber(para){\r\n var number1 = Math.floor(Math.random()*para);\r\n var number2 = Math.floor(Math.random()*para);\r\n if(number1 === number2){\r\n randomNumber(para);\r\n } else { \r\n pair1 = numbers[number1];\r\n pair2 = numbers[number2]; \r\n numbers.splice(number1,1);\r\n if(number2 == 0){\r\n numbers.splice(0,1);\r\n } else if ( number1 > number2) {\r\n numbers.splice(number2,1);\r\n } else {\r\n number2--;\r\n numbers.splice(number2,1);\r\n }\r\n } \r\n }", "title": "" }, { "docid": "b6dbb2a8c5352758fe303e99f246ee2f", "score": "0.5983122", "text": "function who_will_survive() {\n var st1 = Math.floor(Math.random() * 1001);\n var st2 = Math.floor(Math.random() * 1001);\n $(\".st1\").val(st1)\n $(\".st2\").val(st2)\n \n st1 = st1 % 3;\n st2 = st2 % 3;\n if (st1 == 0 && st1 == 1 || st1 == 1 && st2 == 0) {\n console.log(st1, st2)\n $(\".winner\").css(\"color\", \"green\")\n $(\".winner\").html(\"HUMAN SURVIVES\");\n return false;\n }\n if (st1 == 1 && st1 == 2 || st1 == 2 && st2 == 1) {\n console.log(st1, st2)\n $(\".winner\").css(\"color\", \"green\")\n $(\".winner\").html(\"COCKROACH SURVIVES\");\n return false;\n }\n if (st1 == 2 && st1 == 0 || st1 == 0 && st2 == 2) {\n console.log(st1, st2)\n $(\".winner\").css(\"color\", \"green\")\n $(\".winner\").html(\"NUCLEAR BOMB SURVIVES\");\n return false;\n }\n if (st1 == st2) {\n console.log(st1, st2)\n $(\".winner\").css(\"color\", \"red\")\n $(\".winner\").html(\"TIE\");\n return false;\n }\n }", "title": "" }, { "docid": "8fd00f0f42a5cef814d3a7b5309ef6a2", "score": "0.59793246", "text": "function resetGame() {\n playerNum = 0;\n\n numToMatch = Math.floor(Math.random() * 101 + 19);\n \n console.log(\"Number to Match: \" + numToMatch);\n \n $(\"#random-number\").text(numToMatch);\n\n gem1 = Math.floor(Math.random() * 12 + 1);\n gem2 = Math.floor(Math.random() * 12 + 1);\n gem3 = Math.floor(Math.random() * 12 + 1);\n gem4 = Math.floor(Math.random() * 12 + 1);\n\n $(\"#number-guessed\").text(playerNum);\n}", "title": "" }, { "docid": "ccdf3e47b3e7908563f2ceb2d8f93651", "score": "0.5974858", "text": "function enemyAttackBlock(){\n\t\treturn Math.floor(Math.random() * 2);\n\t}", "title": "" }, { "docid": "9f4b3d6522234b046854f33d6ac946b6", "score": "0.5973584", "text": "function changePlayer() {\n //if the value of place is equal to \"player1\" switch it to \"player2\", else if the value is \"player2\" turn it back to \"player1\" and increment the holder variable by 1\n}", "title": "" }, { "docid": "685dae90e6a53815257d4e2d01bccf60", "score": "0.5968509", "text": "function generateWinningNumber(){\n\t// add code here\n\twinningNumber = Math.floor(Math.random()*100);\n\treturn winningNumber ;\n}", "title": "" }, { "docid": "1f1082a2cf8f76026d5f60bf88dbf888", "score": "0.59665364", "text": "function generateWinningNumber(){\n\t// add code here\n return Math.floor(Math.random() * 100);\n}", "title": "" }, { "docid": "4fc3eaf09174ca22697a1527e257110e", "score": "0.59620905", "text": "function randTorps(){\n\n //math.random generate raqndom number bt 0 & 1\n // math.floor round inton an integer\n\n return Math.floor(Math.random() *3);\n}", "title": "" }, { "docid": "519881c5d29a464d09e345800f1e3fa8", "score": "0.5958152", "text": "function resetTwo() {\n randomNumber = Math.floor(Math.random() * ((120 - 19) + 1) + 19);\n $('#randNum').html(randomNumber);\n amethyst = Math.floor(Math.random() * 12) + 1;\n emld = Math.floor(Math.random() * 12) + 1;\n ruby = Math.floor(Math.random() * 12) + 1;\n sapphire = Math.floor(Math.random() * 12) + 1;\n }", "title": "" }, { "docid": "d9eba21be0ba11a105df6af359323290", "score": "0.5956836", "text": "function randoGen(){\n\t\trandoNumber = Math.floor((Math.random()*upperLimit) + lowerLimit);\n\t\tconsole.log(randoNumber);\n\t\t$(\"#random-number\").text(randoNumber);\n\t\t$(\"#wins .panel-body\").text(totalWins);\n\t\t$(\"#losses .panel-body\").text(totalLosses);\n\n\t}", "title": "" }, { "docid": "31af9c211c42fa92e95f3aa20c9ed688", "score": "0.5954141", "text": "function randomStrategy(player, board) {\n let lms = legalMoves(player, board)\n return lms[Math.floor(Math.random()*lms.length)];\n}", "title": "" } ]
e8eb3a9b9aea42e514ee89be22ecae1e
send new emptey ingredient id to ingredientChanged
[ { "docid": "c10f07a57397b84f35a66a69fd6838eb", "score": "0.6619134", "text": "function addIngredient(evt){\n evt.preventDefault()\n props.onRecipeUpdated(props.id, {\n ...recipeBody,\n uniqueIngredient: recipeBody.uniqueIngredient + 1,\n ingredients: {\n ...recipeBody.ingredients,\n ['ingredient-' + recipeBody.uniqueIngredient]: undefined\n },\n })\n }", "title": "" } ]
[ { "docid": "b8d46a19450e04781ad8392775edaf89", "score": "0.76831925", "text": "function ingredientChanged(ingredientId, updatedIngredient){\n updateIngredients({\n ...recipeBody.ingredients,\n [ingredientId]: updatedIngredient\n })\n }", "title": "" }, { "docid": "0e5dfa7b9adcd4c9ceefa849a49926c8", "score": "0.6304884", "text": "async handleUpdate(myIngredients) {\n // let {myIngredients} = this.state\n let saveIngredients = [];\n for (let i = 0; i < myIngredients.length; i++) {\n if (myIngredients[i]) {\n saveIngredients.push(myIngredients[i])\n }\n }\n let res = await axios.put('/api/ingredients/manageList', { ingredient: saveIngredients })\n if (res.data[0].ingredient && res.data[0].ingredient.length > 0) {\n this.setState({ myIngredients: res.data[0].ingredient })\n }\n await swal('your saved ingredients list has been updated')\n }", "title": "" }, { "docid": "4478aca3aba41ad2b5a937cf1457c026", "score": "0.62893796", "text": "addToRecipe(event) {\n const id = event.target.name; // eg, if the item calling this has a name that is an id\n this.setState({\n // key: new value based on existing state or not\n })\n }", "title": "" }, { "docid": "3993e14ffd60abaefde1d8b3183b856c", "score": "0.62590563", "text": "function recipeChanged(evt){\n evt.preventDefault()\n props.onRecipeUpdated(props.id, {\n ...recipeBody,\n [evt.target.name]: evt.target.value\n })\n }", "title": "" }, { "docid": "935a5af3530b54fe2f6fb674e896625c", "score": "0.6169618", "text": "async deleteIng(e){ \n\n // Find existing recipe by id\n const foundObj = this.getIngById(e.target.dataset.id)\n\n if (foundObj) {\n // Find index of recipe to remove\n const index = this.ingredients.findIndex(obj => obj.id === foundObj.id)\n\n // Remove recipe and save it, in case error later\n const savedResource = this.ingredients.splice(index, 1)\n \n // Optimistically render new list\n this.renderIngredients()\n \n // Try updating server recipe\n try{\n const resp = await this.adapter.deleteIngredient(foundObj.id)\n\n // Alert user of success\n this.handleAlert({\n type: \"success\",\n msg: `${savedResource[0].name} deleted`\n }) \n }catch(err){\n // If failure, rerender list without db call, keeping resource in same array location\n this.ingredients[index] = savedResource\n this.ingredients = this.ingredients.flat() \n this.renderIngredients()\n this.handleError(err)\n }\n }else{\n this.handleError({\n type: \"danger\",\n msg: \"Ingredient was not found\"\n })\n }\n }", "title": "" }, { "docid": "cd6db51f79c2e3e1ff355df169b6e00d", "score": "0.6094779", "text": "function postIngredients(recipeId) {\n add.ingredientsList.map(ingredient => {\n ingredient.recipe_id = recipeId;\n AddRecipeService.submitIngredient(ingredient).then(response => {\n console.log('Successfully added ingredient:', response);\n });\n });\n add.ingredientsList = [];\n }", "title": "" }, { "docid": "99141f5104c785a46c040525f016b9ce", "score": "0.6011667", "text": "_onIdChanged(event) {\n event.stopPropagation();\n const id = $(makePropertyIdSelector(cred.spec.propertyLabel.id)).val();\n this.controller.notifyItemIdModified(id);\n this.controller.notifyStoreUndo();\n }", "title": "" }, { "docid": "5fcf1a4c669508cc6cb77cc39839015d", "score": "0.5965224", "text": "handleChange(ingredient) {\n if (this.state.finalIngredients.indexOf(ingredient) === -1) {\n this.state.finalIngredients.push(ingredient);\n } else {\n var index = this.state.finalIngredients.indexOf(ingredient);\n this.state.finalIngredients.splice(index, 1);\n }\n }", "title": "" }, { "docid": "49bd0e3ae95d3772eb469be4ded6806a", "score": "0.5950482", "text": "handleEventAddRecipeToShoppingList(event) {\n if (logger.isOn() && (100 <= logger.level()) && (100 >= logger.minlevel())) console.log(\"Handling event - Add Recipe to Shopping List\");\n /*\n collect the recipe Id attribute from the event\n */\n\n let recipeId = event.target.getAttribute(\"recipe-id\");\n let recipe = this.controller.getRecipeFromLastSearchResultsById(recipeId);\n\n\n this.controller.addRecipeIngredientsToShoppingList(recipe);\n // this app will be notified when the application state changes\n this.showNotification(\"Shopping List\", `Added ingredients from ${recipe.name} to shopping list.`);\n }", "title": "" }, { "docid": "33b70d8d067b9e8cd9826e098549cdf7", "score": "0.58974844", "text": "function handleRecipeChange(id, recipe) {\n const newRecipes = [...recipes]\n const index = newRecipes.findIndex(r => r.id === id)\n newRecipes[index] = recipe\n setRecipes(newRecipes)\n }", "title": "" }, { "docid": "7f827f5d0604434f463ecb3fe565abc0", "score": "0.58281064", "text": "sendQuantityTicked(indexFood, quantityFood){ /*recibe dos parametros: indice de la orden y la cantidad de alimentos*/\n this.breakfasts.forEach((element, id) => {\n if(indexFood === id){\n this.breakfasts[id].quantity = quantityFood; \n }\n }); /*funcion para cada uno de los elementos, verifica si el indice que recibe corresponde al indice del arreglo */\n }", "title": "" }, { "docid": "28128017fd4369b337ded5bd119fee15", "score": "0.5777177", "text": "function updateIngredients(updatedIngredients) {\n props.onRecipeUpdated(props.id, {\n ...recipeBody,\n ingredients: updatedIngredients,\n })\n }", "title": "" }, { "docid": "8066567578992cd0a98ca8702f403a73", "score": "0.5756633", "text": "function add_ingredient_create_update(ingredient,quantity,unit) {\n\tvar countIngredients = document.getElementById(\"count_ingredients_input\").value;\n\tcountIngredients++;\n\tvar countIngredients = document.getElementById(\"count_ingredients_input\").value = countIngredients;\n\n\tvar ingredientDiv = document.createElement(\"div\");\n\tingredientDiv.setAttribute(\"class\", \"ingredient\")\n\tingredientDiv.setAttribute(\"id\", \"div_ingredient_\" + countIngredients);\n\n\tvar ingredientInput = document.createElement(\"input\");\n\tingredientInput.setAttribute(\"type\", \"text\");\n\tingredientInput.setAttribute(\"id\", \"input_ingredient_\" + countIngredients);\n\tingredientInput.setAttribute(\"name\", \"ingredient_input\");\n\tingredientInput.setAttribute(\"value\", ingredient);\n\tingredientInput.setAttribute(\"class\", \"ingredient_input\");\n\tingredientInput.setAttribute(\"onclick\", \"deleteHintValueIngredient(\"\n\t\t\t+ \"input_ingredient_\" + countIngredients + \")\");\n\tingredientInput.setAttribute(\"onblur\", \"setHintValueIngredient(\"\n\t\t\t+ \"input_ingredient_\" + countIngredients + \")\");\n\tingredientInput.setAttribute(\"list\", \"suggestionsIngredients\");\n\n\tvar quantityInput = document.createElement(\"input\");\n\tquantityInput.setAttribute(\"type\", \"text\");\n\tquantityInput.setAttribute(\"id\", \"quantity_input_\" + countIngredients);\n\tquantityInput.setAttribute(\"name\", \"quantity_input\");\n\tquantityInput.setAttribute(\"value\", quantity);\n\tquantityInput.setAttribute(\"class\", \"quantity_input\");\n\tquantityInput.setAttribute(\"onclick\", \"deleteHintValueQuantity(\"\n\t\t\t+ \"quantity_input_\" + countIngredients + \")\");\n\tquantityInput.setAttribute(\"onblur\", \"setHintValueQuantity(\"\n\t\t\t+ \"quantity_input_\" + countIngredients + \")\");\n\n\tvar unitsInput = document.createElement(\"input\");\n\tunitsInput.setAttribute(\"type\", \"text\");\n\tunitsInput.setAttribute(\"id\", \"unit_input_\" + countIngredients);\n\tunitsInput.setAttribute(\"name\", \"units_input\");\n\tunitsInput.setAttribute(\"value\", unit);\n\tunitsInput.setAttribute(\"class\", \"unit_input\");\n\tunitsInput.setAttribute(\"onclick\", \"deleteHintValueUnits(\" + \"unit_input_\"\n\t\t\t+ countIngredients + \")\");\n\tunitsInput.setAttribute(\"onblur\", \"setHintValueUnits(\" + \"unit_input_\"\n\t\t\t+ countIngredients + \")\");\n\tunitsInput.setAttribute(\"list\", \"suggestionsUnits\");\n\n\tvar deleteButton = document.createElement(\"button\");\n\tdeleteButton.setAttribute(\"id\", \"delete_button_\" + countIngredients);\n\tdeleteButton.setAttribute(\"onclick\", \"delete_ingredient(div_ingredient_\"\n\t\t\t+ countIngredients + \")\");\n\tdeleteButton.innerHTML = \"-\";\n\tdeleteButton.setAttribute(\"class\", \"delete_button\");\n\t\n\tvar hiddenIngredientInput = document.createElement(\"input\");\n\thiddenIngredientInput.setAttribute(\"type\", \"hidden\");\n\thiddenIngredientInput.setAttribute(\"id\", \"hidden_input_ingredient_\" + countIngredients);\n\thiddenIngredientInput.setAttribute(\"name\", \"hidden_ingredient_input\");\n\thiddenIngredientInput.setAttribute(\"value\", ingredient);\n\thiddenIngredientInput.setAttribute(\"class\", \"hidden\");\n\n\tingredientDiv.appendChild(ingredientInput);\n\tingredientDiv.appendChild(quantityInput);\n\tingredientDiv.appendChild(unitsInput);\n\tingredientDiv.appendChild(deleteButton);\n\tingredientDiv.appendChild(hiddenIngredientInput);\n\n\tdocument.getElementById(\"ingredients\").appendChild(ingredientDiv);\n}", "title": "" }, { "docid": "d18ef90603e06475111b7b3ca8291c29", "score": "0.5731808", "text": "function editFoods(event) {\n const element = event.target;\n const elementId = element.parentElement.id;\n const interaction = JSON.stringify(element.classList);\n if (interaction.includes('button-delete-food')) {\n const foodsUpdated = foods.filter(food => food.id != elementId);\n foods = foodsUpdated;\n displayEditableFoods();\n verifyAmountOfFoods();\n }\n if (interaction.includes('input-rename-food')) {\n const inputRenameFood = document.querySelectorAll('.input-rename-food');\n for (let i = 0; i < inputRenameFood.length; i++) {\n inputRenameFood[i].addEventListener('input', () => {\n const foodUpdated = event.target.value;\n foods.find(food => {\n if (food.id == elementId) food.food = foodUpdated;\n });\n });\n }\n }\n}", "title": "" }, { "docid": "d4456d84a9afeb19dfce2955030d5d7c", "score": "0.5728553", "text": "function addIngredient() {\n $scope.recipe.ingredients.push({});\n }", "title": "" }, { "docid": "5e1bc27dbe6dafa0f7e2be904e21f5f7", "score": "0.5707269", "text": "submitEdit(newRecipe, oldRecipe) {\n //console.log(\"newRecipe\"); \n this.props.editRecipe(newRecipe);\n }", "title": "" }, { "docid": "471cd9e76e5549a1d203f8572c6d4e1f", "score": "0.5705229", "text": "updateIngredient(key, value) {\n if (this._ingredients.has(key)) {\n const currentAmount = this._ingredients.get(key);\n this._ingredients.set(key, value + currentAmount);\n }\n else {\n this._ingredients.set(key, value);\n }\n }", "title": "" }, { "docid": "f6fd9683522852de7c413217e0bb5c85", "score": "0.56861407", "text": "updateSelectedTile(event) { \n this.selectedBoatId = event.detail.boatId;\n this.sendMessageService(this.selectedBoatId);\n }", "title": "" }, { "docid": "b3bf0768529bbaa2dc575136127bb267", "score": "0.5676038", "text": "handleDoughInputChange (event) {\n const { ingredients_in_basket } = this.props\n let is_dough_in_basket = false\n ingredients_in_basket.forEach((instance, index) => {\n if (instance.is_dough) {\n this.props.updateDoughInBasket(event, instance.id)\n is_dough_in_basket = true\n }\n })\n if (!is_dough_in_basket) {\n this.props.addDoughToBasket(event)\n }\n }", "title": "" }, { "docid": "faf9a385981e9d0290d5d39fb5b8beff", "score": "0.5675071", "text": "restaurarInventarioDelProducto(state, item){\n const producto = state.productos.find(producto => producto.id === item.id)\n producto.inventario += item.cantidad;\n }", "title": "" }, { "docid": "a30b7971abb091127e1b7043cd0445d3", "score": "0.5668697", "text": "updateSelectedTile(event) {\n this.selectedBoatId=event.detail.boatId;\n this.sendMessageService(this.selectedBoatId);\n }", "title": "" }, { "docid": "034fa563f5d237c45e941cd1ede56d84", "score": "0.56520534", "text": "editRecipe(newRecipeName, newIngredientNames, newIngredientQuantities, newRecipeDescription, position) {\n // combine ingredient names and quantities together\n let newIngredients = [];\n let ingredient = {};\n\n for (let i = 0; i < newIngredientNames.length; i++) {\n ingredient = {\n 'name': newIngredientNames[i],\n 'quantity': newIngredientQuantities[i]\n }\n newIngredients.push(ingredient);\n ingredient = {};\n }\n\n editLSRecipe(this.key, newRecipeName, newIngredients, newRecipeDescription, position);\n }", "title": "" }, { "docid": "2d7a6a92af8e560decfca30c8bdf9622", "score": "0.5640168", "text": "handleIncQuantity(){\n this.updateQuantity(1);\n }", "title": "" }, { "docid": "b6b8e97d746e4936c157cf9b58fec78b", "score": "0.56393975", "text": "function updateDevoured(event) {\n\t\tevent.stopPropagation();\n\t\tvar id = $(this).data(\"id\");\n\t\tconsole.log(\"updating devoured at id \", id);\n\t\t$.ajax({\n\t\t\tmethod: \"PUT\",\n\t\t\turl: \"/api/burgers/\" + id\n\t\t}).done(() => {\n\t\t\tlocation.reload();\n\t\t});\n\t}", "title": "" }, { "docid": "fa3ce20a49ae06b9ef7480fe31edd37f", "score": "0.5621631", "text": "function itemReturned(event) {\n event.preventDefault();\n var id = $(this).data(\"trans\");\n console.log(id);\n $.ajax(\"/api/update/\" + id, {\n type: \"PUT\"\n }).then(\n function() {\n console.log(\"updated id \", id);\n // Reload the page to get the updated list\n location.reload();\n });\n }", "title": "" }, { "docid": "32e73975d6bfc08708addd238905d95a", "score": "0.56096035", "text": "function qteInventaireChange(evt)\r\n{\r\n\tvar $inputNum = $(evt.target);\r\n\tvar nomObjet = $inputNum.data(\"nomobjet\");\r\n\tvar nomPiece = $inputNum.data(\"nompiece\");\r\n\tvar objetsInventaire = inventaire.inventoryItems;\r\n\tvar nb = parseInt($inputNum.val(), 10);\r\n\tif (!isNaN(nb))\r\n\t{\r\n\t\tsetInventaire(objetsInventaire, nomObjet, nomPiece, nb);\r\n\t}\r\n}", "title": "" }, { "docid": "e254a8a6f95f3f3c0291a8e2f273d960", "score": "0.5593114", "text": "submit(data) {\n const { name, ingredient } = data;\n Ingredients.insert({ name, ingredient }, this.insertCallback);\n }", "title": "" }, { "docid": "a5f098ea925b64df65fcb70e437c1c62", "score": "0.55863094", "text": "function handleAdd() {\n if (!formFilled()) { // if the form is not filled, return\n return;\n } \n\n const newElement = isSeasoning\n ? new Seasoning({\n name: formData.formIngredientName,\n spoonacularName: null,\n imageURL: null,\n firestoreID: formData.formIngredientID,\n })\n : new Ingredient({\n name: formData.formIngredientName,\n spoonacularName: null,\n type: formData.formIngredientType,\n expirationDate: formData.formIngredientExp.getTime(),\n quantity: {\n amount: formData.formIngredientAmount,\n unit: formData.formIngredientUnit,\n },\n imageURL: null,\n firestoreID: formData.formIngredientID,\n });\n \n const name = formData.formIngredientName;\n\n if (typeof formData.formIngredientIndex === 'number') { // editing ingredient\n // query Spoonacular to set the ingredient's Spoonacular name\n searchIngredient(name).then(({ spoonacularName, imageURL }) => {\n if (typeof spoonacularName !== 'undefined') {\n newElement.spoonacularName = spoonacularName;\n newElement.imageURL = imageURL;\n }\n return updateUserIngredient(newElement);\n })\n .then(() => getAllUserIngredients()) // refresh the fridge\n .then((userIngredients) => setFridge(userIngredients))\n .catch((err) => console.error(err));\n } else { // adding new ingredient\n // query Spoonacular to set the ingredient's Spoonacular name\n searchIngredient(name).then(({ spoonacularName, imageURL }) => {\n if (typeof spoonacularName !== 'undefined') {\n newElement.spoonacularName = spoonacularName;\n newElement.imageURL = imageURL;\n }\n return addUserIngredient(newElement);\n }).then((docRef) => { // set the firestore ID to be the document ID\n newElement.firestoreID = docRef.id;\n return getAllUserIngredients(); // refresh the fridge\n })\n .then((userIngredients) => setFridge(userIngredients))\n .catch((err) => console.error(err));\n }\n }", "title": "" }, { "docid": "6c1b1647073fddb9b0050ff0c38efa20", "score": "0.5582883", "text": "function updatePup(e) { \n dogid = e.target.id\n dog = showMeThatDoggo(dogid).then(newdog => { theReupdate(newdog)})\n}", "title": "" }, { "docid": "64528e28d0a75b25cff8be9a7dcb63fb", "score": "0.55811566", "text": "function addAnotherIngredientInputFieldHandler(event) {\n // don't fully understand why this line is needed\n // triggers the `submitNewDrinkFormHandler` function without this line\n // has something to do with event propagation\n event.preventDefault();\n \n // creating a copy of the new drink form data's ingredients array\n const ingredientsNewArr = [...newDrinkFormData.ingredients, ''];\n\n // setter function to set the new state\n setNewDrinkFormData({\n ...newDrinkFormData,\n ingredients: ingredientsNewArr\n });\n }", "title": "" }, { "docid": "7993f9f7af6d226aa4b9d1f3280fc8e4", "score": "0.55727196", "text": "add(ingredientName, quantity = 1) {\n\n // Check if the ingredient is already in igredients, if it isn't add it to favorites\n let item = this.getItem(ingredientName)\n\n if (!item) {\n this.items.push({\n id: ingredientName,\n quantity: quantity\n });\n } \n else{\n item.quantity += quantity;\n }\n this.update();\n }", "title": "" }, { "docid": "b9ca616751b96d9d61f0de1c7eab3c47", "score": "0.55543596", "text": "onChange()\n {\n this._localID++;\n }", "title": "" }, { "docid": "4959a9f35f60e3f9bce4808cf32e51ae", "score": "0.5550782", "text": "function delete_existing_ingredient(event) {\n // target the ingredient to be deleted\n ingredient_to_delete = event.target.getAttribute(\"data-ingredient-id\");\n document.getElementById(ingredient_to_delete).remove();\n event.target.remove();\n}", "title": "" }, { "docid": "466517031b3cdeddbacacf45f7e85c37", "score": "0.55502236", "text": "function handleRemove() {\n if (typeof formData.formIngredientIndex === 'number') {\n let ingredientToRemove = fridge[formData.formIngredientIndex];\n removeUserIngredient(ingredientToRemove)\n .then(() => getAllUserIngredients()) // refreshes the fridge\n .then((userIngredients) => setFridge(userIngredients))\n .catch(err => console.error(err));\n }\n }", "title": "" }, { "docid": "fd07c968dd00befff34cc5a1f03d37d2", "score": "0.55424225", "text": "updated(event) {}", "title": "" }, { "docid": "907e853c05640f36fe795f837321f988", "score": "0.5541714", "text": "editSingleMeal(req, res) {\n let requestId = req.params.id;\n const requestIndex = meals.findIndex(searchMeal => searchMeal.id === parseInt(requestId, radix));\n if (requestIndex === -1) {\n res.status(404).send('The meal with the given ID was not found.');\n } else {\n meals[requestIndex].name = req.body.name;\n }\n return res.status(200).json({ success: 'Meal updated successfully', status: 200 });\n }", "title": "" }, { "docid": "03e091fb8f6e4cee0f5a6b8ce12f23ed", "score": "0.5541055", "text": "function deleteIngredient(ingredientID){\n const updatedIngredients = recipeBody.ingredients\n delete updatedIngredients[ingredientID]\n updateIngredients(updatedIngredients)\n }", "title": "" }, { "docid": "88de307a14e8529852c11fd1799408a9", "score": "0.5529912", "text": "onSave(e) {\n var index = this.props.inventory.indexOf(this.props.product);\n this.props.inventory[index].title = this.state.title;\n this.props.inventory[index].body = this.state.body;\n this.setState({[e.target.id]: false});\n }", "title": "" }, { "docid": "6b9195453364e1be9443f20a546c8a9b", "score": "0.5525574", "text": "setItemQuantity(id, e) {\n var quantity = e.target.value;\n var items = this.state.items;\n items[id].quantity = quantity;\n this.setState({ items })\n }", "title": "" }, { "docid": "864296770cd94ff74f227324f54b85af", "score": "0.55254036", "text": "function addIngredient(){\r\n createIngredientList();\r\n}", "title": "" }, { "docid": "1639413ad6e7fe6561256d18d28fe895", "score": "0.5521216", "text": "function updateRecipeIngredients(id, t) {\n return new Promise(function(resolved, rejected) {\n result = Promise.map(ingredients, function(ingredient) {\n return index.RecipeIngredient.update({\n IngredientID: ingredient.ingredientId,\n MeasureID: ingredient.measureId,\n Amount: ingredient.amount\n }, {where: {RecipeID: id}},\n {transaction: t})\n })\n if(result) {\n resolved(result); \n } else {\n rejected('No recipe ingredients exist for that recipe.');\n }\n });\n }", "title": "" }, { "docid": "38ec49b17a14c322ff1b4b0ea5b34ec5", "score": "0.55052453", "text": "update() {\n localStorage.setItem('ingredient', JSON.stringify(this.items))\n }", "title": "" }, { "docid": "6af5296ba663813cc904747a13f80e89", "score": "0.55017805", "text": "gatherValToEdit(index, reciepeName, ingredients) {\n this.refs.index.value = index;\n this.refs.edit1.value = reciepeName;\n this.refs.edit2.value = ingredients.join(',');\n }", "title": "" }, { "docid": "7efbdb2398afd84b6c98fdb88fb48552", "score": "0.5489693", "text": "updateNewRecipe(recipeName, ingredients) {\n this.setState({\n newestRecipe: {\n recipeName: recipeName,\n ingredients: ingredients\n }\n });\n }", "title": "" }, { "docid": "c7ba679106810939b7a3197c25095582", "score": "0.54887414", "text": "function updateRecipe(req, res, next){\n const ingredient_id = req.body.ingredient_id;\n const quantity = req.body.quantity || null;\n const unit = req.body.unit || null;\n db.any('INSERT INTO recipe_ingredients (recipe_id, ingredient_id, quantity, unit) VALUES ($1, $2, $3, $4)',\n [parseInt(req.params.id), parseInt(ingredient_id), quantity, unit])\n .then(function (data) {\n res.status(200)\n .json({\n status: 'success',\n data: data,\n message: 'Ingredient added to the recipe.'\n });\n })\n .catch(function (err) {\n return next(err);\n });\n}", "title": "" }, { "docid": "7ecce01d4588973512ab9791ec63b09b", "score": "0.5485009", "text": "function add_selected_ingredient(id, name)\n{\n\tvar ing_ids = document.getElementById('ing_ids');\n\tvar ids = ing_ids.value.split(',');\n\tfor(var i in ids)\n\t{\n\t\tif(ids[i] == id)\n\t\t\treturn;\n\t}\n\ting_ids.value += id + ',';\n\t\n\tvar div = document.getElementById('selected_ing');\n\tvar new_div = document.createElement('div');\n\tnew_div.innerHTML = name;\n\tnew_div.setAttribute('class', 'sel_ing');\n\tnew_div.setAttribute('id', 'ing'+id);\n\t\n\tvar del_link = document.createElement('a');\n\tdel_link.setAttribute('class', 'del_ing');\n\tdel_link.setAttribute('href', '#');\n\tdel_link.setAttribute('onclick', 'remove_ingredient('+id+')');\n\tdel_link.innerHTML = ' X';\n\tnew_div.appendChild(del_link);\n\tdiv.appendChild(new_div);\n}", "title": "" }, { "docid": "46881b2a8cff0cc104ced5817e0e560b", "score": "0.547479", "text": "function onInventoryIdSubmit() {\n console.log(vm.inventoryId);\n vm.inventoryId = '';\n }", "title": "" }, { "docid": "352165a34e62d389dfbf88b3818c8984", "score": "0.5436979", "text": "function _saveMeal() {\n $http.put(\"/api/meals/\" + $routeParams.id + \".json\", $scope.toJson());\n socket.emit('updatedMeal', $scope.meal);\n }", "title": "" }, { "docid": "b3b83420a1c65f3b9f2f4fe0d0fd584f", "score": "0.54341733", "text": "handleEventRemoveIngredientFromShoppingList(event) {\n if (logger.isOn() && (100 <= logger.level()) && (100 >= logger.minlevel())) console.log(\"Handling event - Remove Ingredient from Shopping List\");\n let ingredient = event.target.getAttribute(\"ingredient\"); // GET FROM the document element via the event\n\n this.controller.removeIngredientFromShoppingList(ingredient);\n // this app will be notified when the application state changes\n }", "title": "" }, { "docid": "0cdad3633ca864f8384b7b972fa2d08e", "score": "0.5417083", "text": "function addIngredient(x) {\n x.ginger = \"1 pinch\";\n return x;\n}", "title": "" }, { "docid": "b9a3346fc160f3ccbfa8ab3bf7241f1b", "score": "0.54134715", "text": "updateProduct(req, res) {\r\n if(!req.body.allergens)req.body.allergens={};\r\n db.products\r\n .update(req.body, { where: { id: req.params.id } })\r\n .then(product => {\r\n req.flash(\"success\", \"Produit modifié avec succès\");\r\n res.redirect(`/admin/produits/editer/${req.params.id}`);\r\n });\r\n }", "title": "" }, { "docid": "fef315d08fe63846bc558a2403d00286", "score": "0.5399799", "text": "notify(event) {\n\t\tthis.indoorBikeData.notify(event);\n\t}", "title": "" }, { "docid": "29254bebfbed902b60faf465b2071c2c", "score": "0.5397351", "text": "updateCurrentRecipeName(recipeName,currentIndex){\n let recipes = this.state.recipes;\n recipes[currentIndex] = {recipeName: recipeName, ingredients: recipes[currentIndex].ingredients, howToCookIt: recipes[currentIndex].howToCookIt }\n this.setState(recipes); \n this.saveData(this.state.recipes);\n\n }", "title": "" }, { "docid": "e1f8ad503d92078a766848f0f33a2026", "score": "0.539088", "text": "onAddAnswer() {\n const id = uniqid();\n // Update complete item to keep redux store simple\n this.props.onSave({\n option: this.props.option.name,\n question: this.props.questionItem.question,\n answerMapping: [\n ...this.props.questionItem.answerMapping,\n { id: id, answer: '', value: '' }\n ],\n productId: this.props.productId\n });\n }", "title": "" }, { "docid": "3b47fa9fd17358a9af6c3b67ca61a128", "score": "0.53852487", "text": "function addNewIngredient(e){\n\tvar modalContent = $(e).parent().parent();\n\tvar ingredientTypeId = modalContent.find(\"select\").val();\n\tvar ingredientName = modalContent.find(\"input\").val().trim();\n\tif(ingredientTypeId == 0 || ingredientName == \"\"){\n\t\t$(\"#ingredientAlert\").show();\n\t}\n\telse{\n\t\t$(\"#ingredientAlert\").hide();\n\t\tvar url = $.find(\"base\")[0].href;\n\t\t$.ajax({\n\t\t\turl: url + \"addnewingredient/\",\n\t\t\ttype: \"Post\",\n\t\t\tdata: {csrfmiddlewaretoken: $('input[name=\"csrfmiddlewaretoken\"]').val(), ingredient_type_id: ingredientTypeId, ingredient_name: ingredientName},\n\t\t\tsuccess: function(result){\n\t\t\t\t// Parse the necessary info from the result\n\t\t\t\tvar ingredientId = result.split(\";\")[0];\n\t\t\t\tvar ingredientName = result.split(\";\")[1];\n\t\t\t\tvar ingredientTypeName = result.split(\";\")[2];\n\n\t\t\t\t// Find the drop down that the ingredient belongs to\n\t\t\t\tvar ingredientTypeDiv = $.find(\"div[data-ingredient-type='\" + ingredientTypeName + \"']\");\n\t\t\t\tvar ingredientTypeDropDown = $(ingredientTypeDiv).find(\"select\");\n\t\t\t\tvar ingredientOption = new Option(ingredientName, ingredientId);// \"<select value='\" + ingredientId + \"'>\" + ingredientName + \"</select>\";\n\t\t\t\t\n\t\t\t\t// Add ingredient to drop down and select it\n\t\t\t\tingredientTypeDropDown.append(ingredientOption);\n\t\t\t\tingredientTypeDropDown.val(ingredientId);\n\t\t\t\t$('#addIngredientModal').modal('toggle');\n\t\t\t\t\n\t\t\t\t// Reset the inputs on the modal\n\t\t\t\tvar modalContent = $(e).parent().parent();\n\t\t\t\tmodalContent.find(\"select\").val(0);\n\t\t\t\tmodalContent.find(\"input\").val(\"\");\n\t\t\t\t\n\t\t\t}\n\t\t});\n\t}\n}", "title": "" }, { "docid": "352904be918b68733fa7c9b7640f0c56", "score": "0.5382187", "text": "changeMealServings(event, type,day) {\n var calendar = this.state.calendar\n if (calendar[type][day].ingredients) {\n\n // Iterate through each ingredient\n calendar[type][day].ingredients = calendar[type][day].ingredients.map(ingredient => {\n if (ingredient[\"num\"] != -1) { // If the ingredient has a number, convert the number to match the new servings\n ingredient[\"num\"] = (ingredient[\"num\"] / calendar[type][day].servings) * parseInt(event.target.value)\n }\n return ingredient\n })\n\n calendar[type][day].servings = event.target.value\n }\n this.setState({calendar: calendar, \"calendarJSX\": this.getCalendar(calendar)})\n }", "title": "" }, { "docid": "dd5f732d7cebb62777266aa6e5746161", "score": "0.5372715", "text": "rigChanged(rig) {\n this.setState({\n rig_id: rig.rig_id\n })\n }", "title": "" }, { "docid": "d7caa0b27dca44395a6495d16e254a22", "score": "0.5371556", "text": "function handleIngridientChange(e) {\n setNewIngridient(e.target.value);\n }", "title": "" }, { "docid": "b8fc49cce371dde0ca8587f241713768", "score": "0.53601927", "text": "function selectKobold(event) {\r\n event.stopPropagation();\r\n let idReference = this.id.match(/\\d+/);\r\n idReference = idReference[0] - 1; //don't forget, index starts at 0!\r\n console.log(idReference);\r\n playerStatus.tempId = this.id;\r\n console.log(`Clicked ${this.id}! tempID is ${playerStatus.tempId}.`);\r\n console.log(`My name is ${playerStatus.koboldList[idReference].name} and I am at locations ${playerStatus.koboldList[idReference].presentLocation}!`);\r\n}", "title": "" }, { "docid": "ab8753f09adaf1481c43bab25cccd663", "score": "0.5357849", "text": "function updateRecipe(){\n let recipeName = window.document.getElementById('recipeTitle').value;\n let favorited = true;\n let createdExternally = false;\n let collectedIngredients = collectIngredients();\n let createdAt = result[\"date\"];\n let createdDescription = window.document.getElementById('recipeDescription').value;\n let recipeID = result[\"id\"];\n let bild = result[\"thumbnail\"]\n let recipe = {id: recipeID, title:recipeName, href: \"TODO\", ingredients: collectedIngredients, description:createdDescription, thumbnail:bild , fav:favorited, extern: createdExternally, date:createdAt};\n\n databaseConnection.update(recipe);\n\n window.alert(\"Das Rezept wurde erfolgreich überarbeitet!\");\n }", "title": "" }, { "docid": "fecc5f9336211c7323e7869734865d04", "score": "0.5356993", "text": "function handleRecipeEdit () {\n console.log('handle edit recipe function was invoked');\n window.location.href = `/add?recipe_id=${this.value}`;\n }", "title": "" }, { "docid": "f475fe8ea002c7a9ee6621ca656d92a7", "score": "0.53469443", "text": "updateIngredients(ingredients, currentIndex) {\n // prendre une copie d'etat pour eviter mutation lors de notre ajout.\n let recipes = this.state.recipes.slice();\n recipes[currentIndex] = { recipeName: recipes[currentIndex].recipeName, ingredients: ingredients };\n localStorage.setItem('recipes', JSON.stringify(recipes));\n // afficher l'etat\n this.setState({ recipes });\n }", "title": "" }, { "docid": "dd1d0ceb134fa6e7881c3d6b66174fbb", "score": "0.5342433", "text": "handleShoppingListChange(arrayOfIngredientStrings) {\n logger.log(\"Handling shopping list change for display\", 1);\n logger.log(arrayOfIngredientStrings);\n }", "title": "" }, { "docid": "764a928158ff85b165d757db8340e418", "score": "0.53393316", "text": "onAdd(e) {\n e.preventDefault();\n alert(\"Shoe has been updated\"); //alert for new show updated\n\n const newShoe = { //setting values to const\n name: this.state.Name,\n brand: this.state.Brand,\n price: this.state.Price,\n image: this.state.Image,\n _id: this.state._id\n }\n\n //Put request for the ID\n axios.put('http://localhost:4000/api/shoes/' + this.state._id, newShoe,)\n .then(res => {\n console.log(res.data)\n })\n .catch((error) => {\n console.log(error);\n })\n }", "title": "" }, { "docid": "26fb25edb0edc3c0272e83f4aeb61c5c", "score": "0.5330962", "text": "saveConfirmedItems() {\n service\n .confirmRiderItems(this.state.oldItems)\n .then(() => this.returnToEvent())\n .catch(error => console.error(error));\n }", "title": "" }, { "docid": "8f70deabad18c16b7dd5d82e3b4ea556", "score": "0.5328605", "text": "getIngById(id){\n return this.ingredients.find(obj => obj.id == id)\n }", "title": "" }, { "docid": "7310ea1c1661efdf7332c137ee67f0e5", "score": "0.53280467", "text": "deduct(key, value) {\n const updatedAmount = this._ingredients.get(key) - value;\n this._ingredients.set(key, updatedAmount);\n }", "title": "" }, { "docid": "339b50a16d188b84600b5d16c81cce0d", "score": "0.53245777", "text": "updateFood() {\n var quant = parseInt(this.state.quantityText.trim());\n\n FoodRecipe.updateFood(this.state.idText, {\n name: this.state.nameText,\n quantity: quant,\n category: this.state.categoryText,\n type: this.state.typeText\n });\n\n FoodRecipe.loadAllRecipes((arr) => {\n for(var i = 0; i < arr.length; i++) {\n for(var j = 0; j < arr[i].ingredients.length; j++) {\n if(arr[i].ingredients[j].foodId === this.state.idText) {\n arr[i].ingredients[j] = {\n foodId: arr[i].ingredients[j].foodId,\n foodName: arr[i].ingredients[j].foodName,\n quantity: quant\n };\n FoodRecipe.updateRecipe(arr[i].key, arr[i].ingredients);\n }\n }\n }\n\n this.setState({\n nameText: '',\n quantityText: '',\n categoryText: '',\n typeText: '',\n idText: ''\n });\n }, (err) => {});\n\n this.setState({ openDetailDialog: false });\n }", "title": "" }, { "docid": "e078e8f72d30010601c43dc707c4788e", "score": "0.5324488", "text": "function onClick_btAjouterModifierEtudiant(idEtudiant) {\n\t// On determine l'url du controleur a appeler, ainsi que la methode HTTP\n\tvar url = 'etudiant';\n\tvar method = 'POST';\n\tif (idEtudiant !== null) {\n\t\turl += '/' + idEtudiant;\n\t\tmethod = 'PUT';\n\t}\n\t\n\tdocument.getElementById('btAjouterModifierEtudiant').onclick = function() {\n\t\t// Appel de POST etudiant ou PUT etudiant/{identifiant} - Exemple2EtudiantController::create(Etudiant) ou Exemple2EtudiantController::update(String, Etudiant)\n\t\tvar etudiant = {\n\t\t\tnom: document.getElementById('inputNomAjoutModification').value, \n\t\t\tprenom: document.getElementById('inputPrenomAjoutModification').value, \n\t\t\tgroupeTP: {\n\t\t\t\tidentifiant: document.getElementById('inputGroupeTPAjoutModification').value\n\t\t\t}\n\t\t};\n\t\tfetch(url, {\n\t\t\tmethod: method, \n\t\t\t// Corps de la requete : un objet JSON \"Etudiant\"\n\t\t\tbody: JSON.stringify(etudiant), \n\t\t\theaders: {\n\t\t\t\t\"Content-Type\": \"application/json\"\n\t\t\t}\n\t\t}).then(\n\t\t\t// Traitement de la reponse du controller\n\t\t\tfunction(response) {\n\t\t\t\t// 1ere etape : envoi de la reponse au format JSON vers la 2eme etape\n\t\t\t\treturn response.json();\n\t\t\t}\n\t\t).then(\n\t\t\t// 2eme etape : reception de la reponse au format JSON\n\t\t\tfunction(response) {\n\t\t\t\tif (!response.erreur) {\n\t\t\t\t\t// Mise a jour des listes des etudiants\n\t\t\t\t\tmajListesEtudiants();\n\t\t\t\t\t\n\t\t\t\t\t// Affichage d'un message de confirmation de creation\n\t\t\t\t\tif (idEtudiant !== null) {\n\t\t\t\t\t\talert('L\\'etudiant a ete modifie avec succes.');\n\t\t\t\t\t} else {\n\t\t\t\t\t\talert('L\\'etudiant a ete ajoute avec succes. Il a l\\'identifiant \\'' + response.identifiant +'\\'');\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// On masque le formulaire\n\t\t\t\t\thideFormulaireCreationModification();\n\t\t\t\t} else {\n\t\t\t\t\talert(response.erreur);\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n}", "title": "" }, { "docid": "184e0700ffa1b698a4b27bd867385d8d", "score": "0.53132856", "text": "stockerId(e) {\n this.setState({id: e.target.value});\n }", "title": "" }, { "docid": "e3ed4c0e806571b9f6da755abfa1c7e5", "score": "0.52988386", "text": "editSingleOrder(req, res) {\n let requestId = req.params.id;\n const requestIndex = orders.findIndex(singleOrder => singleOrder.id === parseInt(requestId, radix));\n if (requestIndex === -1) {\n res.status(404).send('The meal with the given ID was not found.');\n } else {\n orders[requestIndex].meal = req.body.meal;\n orders[requestIndex].quantity = req.body.quantity;\n }\n return res.status(200).json({ success: 'Order updated successfully', status: 200 });\n }", "title": "" }, { "docid": "c6106d1548c1ccf56acff8fd7426dff2", "score": "0.52938735", "text": "handleDelete(ingredient) {\n let deleteIngredient = this.state.myIngredients\n deleteIngredient.splice(deleteIngredient.indexOf(ingredient), 1)\n this.setState({ myIngredients: deleteIngredient })\n }", "title": "" }, { "docid": "194877884ce8b32fe5785305bdc099e0", "score": "0.5280678", "text": "async function addRecipeIngredient(recipeId, ingredient) {\n const config = {\n headers: {\n \"Content-Type\": \"application/json\",\n },\n };\n\n try {\n const res = await axios.post(`/api/v1/recipes/${recipeId}`, ingredient, config);\n dispatch({\n type: \"ADD_RECIPE_INGREDIENT\",\n payload: [recipeId, res.data.data.ingredient],\n });\n } catch (error) {\n dispatch({\n type: \"RECIPE_ERROR\",\n payload: error,\n });\n }\n }", "title": "" }, { "docid": "741a27ce8a4800c6bc29687f7ee8e1ee", "score": "0.5279865", "text": "function modificar(event,id){\n const aux = productos.find( productos => productos.id === id);\n aux.cantidad = event.target.value;\n sessionStorage.setItem(id, event.target.value );\n}", "title": "" }, { "docid": "885e4e9b7e0485bcd5a12dbf87d9aabb", "score": "0.5278415", "text": "editRecipeClickHandler(recipe) {\n this.setState({\n isRecipeEditMode: true,\n toEditData: recipe,\n });\n }", "title": "" }, { "docid": "ea51c81b5cdbe0660052d10aabde8c42", "score": "0.5275143", "text": "add(id){\n // tim xem co mat hang naof co id nhu v khong\n var item = this.items.find(item => item.id==id);\n if(item){// neu co thi se tang so luong len\n item.qty++;\n this.saveToLoCalStorage();\n }else{ // neu khong co thi ta sex tai 1 sp tren ipa ve va luu vao gio hang\n $http.get(`/rest/products/${id}`).then(resp => {\n resp.data.qty =1;\n this.items.push(resp.data);\n this.saveToLoCalStorage();\n })\n }\n }", "title": "" }, { "docid": "807364f7044880e216a51fbab0d7ed42", "score": "0.527014", "text": "function processStockChange(id, oldQuantity, addQuantity){\n var newStock = parseInt(oldQuantity) + parseInt(addQuantity);\n var query = \"UPDATE products SET stock_quantity = ? WHERE item_id = ?\";\n var query = connection.query(query, [newStock, id], function(err,res){\n if(err) throw err;\n // * Once the update goes through, show the customer the total cost of their purchase.\n console.log(\"You have added \"+ addQuantity + \" to product \" + id);\n console.log(\" \");\n managerPrompt();\n });\n}", "title": "" }, { "docid": "7d2b2fd0f249c599b567d360e6ccdf72", "score": "0.52685016", "text": "function updateGig(id, newArtist, newCity, newVenue, newGigDate, newGigTime) {\n\n const data = {\n\n artist: newArtist.value,\n city: newCity.value,\n venue: newVenue.value,\n gigDate: newGigDate.value,\n gigTime: newGigTime.value\n }\n}", "title": "" }, { "docid": "2c72222e4fe1ae0f3fe383bb4c7454ff", "score": "0.5267952", "text": "set productId(value) {\n this._productId = value;\n // Me traigo el objeto completo \n //comparando lo que viene del evento con lo que esta en la data\n this.product = bikes.find(bike => bike.fields.Id.value === value);\n }", "title": "" }, { "docid": "6318e16f29e44eca5e76fe70002bdcee", "score": "0.5260662", "text": "handleChange(e) {\n e.persist();\n const update = { [e.target.id]: e.target.value };\n this.setState(update, () => {\n if (e.target.id !== 'newTag') {\n this.props.handleChange(update);\n }\n });\n }", "title": "" }, { "docid": "a29e22c5f5974443a75ba9f172469008", "score": "0.5260042", "text": "function amountChanged(data) {\n\tconsole.log(\"This is the id: \" + data.id);\n\tchangePlayerAmount(data.id, data.chips,\"raise\");\n\tthis.emit(\"change amount\",{username: data.id, chips: data.chips});\n\tthis.broadcast.emit(\"change amount\",{username: data.id, chips: data.chips});\n}", "title": "" }, { "docid": "eca3801d0ccbf7a6668fbc1413623a31", "score": "0.5259612", "text": "handleEventRemoveRecipeFromFavourites(event) {\n if (logger.isOn() && (100 <= logger.level()) && (100 >= logger.minlevel())) console.log(\"Handling event - Remove Recipe from Favourites List\");\n let recipeId = event.target.getAttribute(\"recipe-id\");\n if (logger.isOn() && (100 <= logger.level()) && (100 >= logger.minlevel())) console.log(\"Removing recipes with id \" + recipeId);\n\n let recipe = this.controller.getRecipeFromFavouritesById(recipeId);\n this.controller.removeRecipeFromFavouriteRecipesById(recipeId);\n // this app will be notified when the application state changes and will see a call to handleFavouriteRecipesChange (ABOVE)\n this.showNotification(\"Favourite Recipes\", `Removed ${recipe.name} from favourites.`,\"danger\");\n }", "title": "" }, { "docid": "db6e9295ecf1dc0244c7de8492c5bbaf", "score": "0.5253163", "text": "handleRecipeName(e) {\n const value = e.target.value;\n this.setState({\n addName: value,\n nameModified: true\n });\n }", "title": "" }, { "docid": "04732d327de7eb0abdf7be1923e78658", "score": "0.5250618", "text": "function updateIngredients(data) {\n\n\treturn db('recipes_ingredients')\n\t\t.where({\n\t\t\trecipe_id: data.recipe_id,\n\t\t\tingredient_id: data.ingredient_id\n\t\t})\n\t\t.update(data)\n}", "title": "" }, { "docid": "6a00f691e17d65118a6295cdebdf5195", "score": "0.5247794", "text": "addMessage(noti) {\n setNotis([{ ...noti, id: uuid() }, ...notis]);\n }", "title": "" }, { "docid": "141dcff438fa4a6371059b4bd3c2c0a5", "score": "0.52403396", "text": "exchangeID(oldID, newID) {\n let item = this.getItemByID(oldID);\n if (item) {\n item.setID(newID);\n this.id2Item.remove(oldID);\n this.id2Item.put(newID, item);\n this._fireDataChanged();\n } else {\n console.log(\"ID \" + oldID + \" wurde nicht ausgetauscht gegen \" + newID);\n return false;\n }\n }", "title": "" }, { "docid": "4564c0f9cad0aab0aacc4257f93ee4fb", "score": "0.523734", "text": "handleItemChange(e){\n const goods_id=e.currentTarget.dataset.id;\n console.log(goods_id);\n let {cart}=this.data;\n let index=cart.findIndex(v=>v.goods_id===goods_id);\n cart[index].checked=!cart[index].checked;\n this.setCart(cart);\n }", "title": "" }, { "docid": "4c5eafd977aa0779d06a0e45b1150d2e", "score": "0.52257204", "text": "function saveButtonHandler(){\n let ingredients = [];\n\n // Get the burger names\n let t_name = $(\"#burger-name\").val().trim();\n\n // Assemble selected ingredients\n for(let t_ingredient of $(\".burger-option.active\")){\n ingredients.push($(t_ingredient).text().trim());\n }\n\n // Update the db with either a new burger or updating the currently viewed one\n if(currentBurgerId != 0){\n $.ajax(\"/api-burger/update/\" + currentBurgerId, {\n method: \"POST\",\n data: {\n burgerName: t_name,\n ingredients: ingredients\n }\n });\n }\n else{\n $.ajax(\"/api-burger/post\",{\n method: \"POST\",\n data: {\n burgerName: t_name,\n ingredients: ingredients\n }\n }).then(arg_response => currentBurgerId = arg_response.insertId);\n }\n}", "title": "" }, { "docid": "5f65cf317d5bdc703e79d6e3ece0a888", "score": "0.52122706", "text": "function deleteIngredient(index) {\n $scope.recipe.ingredients.splice(index, 1);\n }", "title": "" }, { "docid": "eb721391a6123482b36e188d28451cfb", "score": "0.5211757", "text": "handleEdit() {\n /**\n * Edit event.\n *\n * @event edit\n * @type {string}\n */\n this.$emit('edit', this.detailsData.id);\n }", "title": "" }, { "docid": "ddf48384c4f663140ce79b7feee064ab", "score": "0.5203679", "text": "thingsChange(id, editedObject) {\n return fetch(`http://localhost:8088/interests/${id}`, {\n method: \"PATCH\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(editedObject)\n })\n }", "title": "" }, { "docid": "25eb90f4f81fe6a1d3b0d25cad772567", "score": "0.51944435", "text": "function attachQuantityChange()\n{\n\t// Change Item Quantity\n\t$order.on( 'change', 'select', function(e){\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\t\t\n\t\torderItems[ e.currentTarget.dataset.id ] = e.currentTarget.value;\n\n\t\tupdateOrder();\n\t\t\n\t} );\n}", "title": "" }, { "docid": "fe6c378b5c4e03d6bcad576a9a2866d6", "score": "0.51895785", "text": "emitChangeListener() {\n Bullet.trigger(ReservationConstants.EVENT_CHANGE);\n }", "title": "" }, { "docid": "aa0dd4be23101c6f0ec775f4e0bb55a0", "score": "0.5184714", "text": "onWishlistChanged(newWishList){\n this.setState({onWishList: ds.itemOnWlist(this.props.product)});\n }", "title": "" }, { "docid": "ecc0b678cbc6a02f28e059a9174a5785", "score": "0.517569", "text": "function selectGig(e) {\n setGigId(e.target.id);\n }", "title": "" }, { "docid": "c7d49cc9441294b0636230d19e91bac2", "score": "0.5172715", "text": "updateList(type, event) {\n let val = event.target.value;\n let num = event.target.name.slice(-1);\n if (type === \"Ingredient\") {\n let array = this.state.ingredients;\n array[num - 1] = val;\n this.setState({ ingredients: array });\n } else {\n let array = this.state.steps;\n array[num - 1] = val;\n this.setState({ steps: array });\n }\n }", "title": "" }, { "docid": "101a4646cfb05f020eb7dee530cb8c99", "score": "0.5171411", "text": "storeChanged() {}", "title": "" }, { "docid": "101a4646cfb05f020eb7dee530cb8c99", "score": "0.5171411", "text": "storeChanged() {}", "title": "" }, { "docid": "abc0f4ae717d0334a8f60683718c0109", "score": "0.5167468", "text": "saveEdit(e) {\n var newVal = e.target.value;\n // console.log(e.target.value);\n //this.setState({editMode: false});\n this.props.editItem(this.props.item.id, newVal);\n\n }", "title": "" }, { "docid": "2740305611899be6fc3a1de5a60030c5", "score": "0.5166984", "text": "geneTextChanged(event, newValue) {\n console.log(\"New gene text entered: \" + newValue);\n this.props.appState.currentGeneListStr = newValue;\n }", "title": "" } ]
39424805c574aeb8db963a69fbffdeac
XXX: this is destructive it modifies tree nodes.
[ { "docid": "4a35847cc062fdc897302071c3d00c4f", "score": "0.0", "text": "function sequencesize(statements) {\n var prev = null, last = statements.length - 1;\n if (last) statements = statements.reduce(function(a, cur, i){\n if (prev instanceof AST_SimpleStatement\n && cur instanceof AST_SimpleStatement) {\n var seq = make_node(AST_Seq, prev, {\n first: prev.body,\n second: cur.body\n });\n prev.body = seq;\n }\n else if (i == last\n && cur instanceof AST_Exit && cur.value\n && a.length == 1 && prev instanceof AST_SimpleStatement) {\n // it only makes sense to do this transformation\n // if the AST gets to a single statement.\n var seq = make_node(AST_Seq, prev, {\n first: prev.body,\n second: cur.value\n });\n cur.value = seq;\n return [ cur ];\n }\n else {\n a.push(cur);\n prev = cur;\n }\n return a;\n }, []);\n return statements;\n }", "title": "" } ]
[ { "docid": "210e3574034b667b1bd21ff50e9e6eec", "score": "0.6963827", "text": "function updateTree() {\n $elem.simpleTree('swapNodes', history.getValues());\n }", "title": "" }, { "docid": "7110d9bb2973fff473d20697744aec4b", "score": "0.6900025", "text": "function treeSetValue(tree,value){tree.node.value=value;treeUpdateParents(tree);}", "title": "" }, { "docid": "81a85fbc32311e7b3ba13d01266f1e2b", "score": "0.6827408", "text": "function TreePostProcessing(node) {\n RemoveNestedRows(node);\n MatchFences(node);\n FixSubSup(node);\n}", "title": "" }, { "docid": "3c28524555baf34b172dce1428b08fea", "score": "0.67388445", "text": "_replaceWith(node) {\n if (this.parent) {\n if (this == this.parent.left) {\n this.parent.left = node\n }\n else if (this == this.parent.right) {\n this.parent.right = node\n }\n if (node) {\n node.parent = this.parent\n }\n }\n else {\n if (node) {\n this.key = node.key\n this.value = node.value\n this.left = node.left\n this.right = node.right\n }\n else {\n this.key = null\n this.value = null\n this.left = null\n this.right = null\n }\n }\n }", "title": "" }, { "docid": "dc43c6cfb1b7d9d46a5b94f47ad7bea1", "score": "0.6721471", "text": "_replaceWith(node) {\n // if the current node has a parent, aka, it's not the root, execute this block\n if (this.parent) {\n // if this current node is the parent's left child, execute this block\n if (this == this.parent.left) {\n // set the parent's left pointer to the new node\n this.parent.left = node;\n }\n // if the current node is the parent's right child, execute this block\n else if (this == this.parent.right) {\n // set the parent's right pointer to the new node\n this.parent.right = node;\n }\n\n // if a node was passed into the function, set the node parent to the parent of the current node.\n if (node) {\n node.parent = this.parent;\n }\n }\n // otherwise, if the current node doesn't have a parent, meaning that it's the root, execute this block\n else {\n // if a node was passed into the function, execute this block\n if (node) {\n // here, we reset the key, value, left, and right values to the values of the node.\n this.key = node.key;\n this.value = node.value;\n this.left = node.left;\n this.right = node.right;\n }\n // if a node wasn't passed into the function, execute this block\n else {\n // if there is no node to replace the node we are removing with, just set everything to null\n this.key = null;\n this.value = null;\n this.left = null;\n this.right = null;\n }\n }\n }", "title": "" }, { "docid": "c5693652ede7e9a53c19c3be44bc6b5c", "score": "0.66692257", "text": "_replaceWith(node) {\n if (this.parent) {\n if (this == this.parent.left) {\n this.parent.left = node;\n }\n else if (this == this.parent.right) {\n this.parent.right = node;\n }\n\n if (node) {\n node.parent = this.parent;\n }\n }\n else {\n if (node) {\n this.key = node.key;\n this.value = node.value;\n this.left = node.left;\n this.right = node.right;\n }\n else {\n this.key = null;\n this.value = null;\n this.left = null;\n this.right = null;\n }\n }\n }", "title": "" }, { "docid": "7054f510d4fa62e06bd9e7f52ecec003", "score": "0.6637996", "text": "function update() {\n\t var newTree = render();\n\n\t rootNode = (0, _virtualDom.patch)(rootNode, (0, _virtualDom.diff)(tree, newTree));\n\t tree = newTree;\n\t }", "title": "" }, { "docid": "bcdd0bddef744b3bd1ceb768d35a1bea", "score": "0.6565185", "text": "updateNode(node) {\n //first remove old node\n //console.log(this.getNode(node.id.split('_')[1]))\n this.getNode(node.id.split('node_')[1]).deleteNode();\n //clear old parent's childs if old parent info is exist\n if (node.old_parent !== undefined && node.old_parent.id !== 0) {\n this.nodeList[node.old_parent.value].childs = this.nodeList[node.old_parent.value].childs.filter(x => {\n return x !== node.id;\n });\n //if child count is 0 then remove minus icon\n if (this.nodeList[node.old_parent.value].childs.length === 0) {\n document.getElementById('i_' + node.old_parent.id).style.display = 'none';\n }\n }\n //draw new node with childs\n let set = (data) => {\n this.drawNode(data);\n let childs = data.getChilds();\n if (childs.length > 0) {\n for (let i = 0; i < childs.length; i++) {\n set(childs[i]);\n }\n\n }\n }\n set(node);\n\n //log\n this.log('Node is created (' + node.id + ')');\n //return node\n return node;\n }", "title": "" }, { "docid": "38a1ff0a80d09344c13073f7d5c45e56", "score": "0.65379965", "text": "function updateTree(new_json){\n root = new_json\n root.x0 = height / 2\n root.y0 = 0\n\n // root.children.forEach(collapse)\n update(root)\n}", "title": "" }, { "docid": "5bc4380e16e4130969f7d220a176b151", "score": "0.6476257", "text": "function nodeclick(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else {\n d.children = d._children;\n d._children = null;\n }\n update(d);\n }", "title": "" }, { "docid": "670e712c5ae22b226db6b0df52e47862", "score": "0.64121294", "text": "_buildTree() {\n // Empty the node\n this._node.innerHTML = '';\n\n // Then re-build the tree\n this._node.appendChild(this.treeNodeForView(this._view));\n }", "title": "" }, { "docid": "cd0c71b0108998772ee75ed5464f0700", "score": "0.63573706", "text": "remove(val){ \n // root is re-initialized with a root of a modified tree. \n this.root = this.removeNode(this.root, val); \n }", "title": "" }, { "docid": "3adaf8e6843b3935a3490f2797c71660", "score": "0.6353502", "text": "function nodeclick(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else {\n d.children = d._children;\n d._children = null;\n }\n update(d);\n }", "title": "" }, { "docid": "63ae88d031d500d13ca6bd7c9fbafcc4", "score": "0.63360506", "text": "setTree(relativePath,newTree){if(pathIsEmpty(relativePath)){return newTree;}else{const front=pathGetFront(relativePath);const child=this.children.get(front)||new ImmutableTree(null);const newChild=child.setTree(pathPopFront(relativePath),newTree);let newChildren;if(newChild.isEmpty()){newChildren=this.children.remove(front);}else{newChildren=this.children.insert(front,newChild);}return new ImmutableTree(this.value,newChildren);}}", "title": "" }, { "docid": "0477aa18f036473c07f103220a431a3e", "score": "0.6329982", "text": "function toggleNode(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else {\n d.children = d._children;\n d._children = null;\n }\n}", "title": "" }, { "docid": "131da4325833cc21ef8a4b7a02ec045c", "score": "0.6329048", "text": "_changedNode(){\n\n if (this.root.autoMerklify)\n this._refreshHash(true);\n }", "title": "" }, { "docid": "940bca95bcbf29e820eb4232a2ffa579", "score": "0.630433", "text": "resetNodeOpacities() {\n var defaultTextOpacity = this.getDefaultTextOpacity();\n this.node.each((n) => {\n n.nopacity = this.nodeLinkDefaultOpacity;\n n.topacity = defaultTextOpacity;\n });\n }", "title": "" }, { "docid": "6be656287ffa6e30b82c54819253f738", "score": "0.6292603", "text": "function update_tree() {\n // crude way of finding root right now. as there is no way to change the root yet\n //remove all cards\n\n // empty svg_holder\n removeAllChildNodes(svg_holder);\n\n // empty tree container.\n removeAllChildNodes(tree_container);\n\n // add back the svg_holder?\n tree_container.append(svg_holder);\n\n \n\n // unset some properties determined in build_tree\n for( let person of PERSON_ARRAY) {\n person.hasCard = false;\n person.cardHolder = undefined;\n person.branchLevel = undefined;\n person.cardNumber = undefined;\n person.sibling_div = undefined;\n }\n\n // find person with assignedRoot value and pass to build tree\n for( let person of PERSON_ARRAY) {\n if(person.assignedRoot) {\n build_tree(person);\n }\n }\n console.log('UPDATED TREE - ', PERSON_ARRAY, RELATION_ARRAY);\n}", "title": "" }, { "docid": "298f7c5bf26254cf992b00cd202d2043", "score": "0.62743646", "text": "updateNodesState() {\n const attrs = this.getChartState()\n // Store new root by converting flat data to hierarchy\n attrs.root = d3\n .stratify()\n .id(({ nodeId }) => nodeId)\n .parentId(({ parentNodeId }) => parentNodeId)(attrs.data)\n\n // Store positions, where children appear during their enter animation\n attrs.root.x0 = 0\n attrs.root.y0 = 0\n\n // Store all nodes in flat format (although, now we can browse parent, see depth e.t.c. )\n attrs.allNodes = attrs.layouts.treemap(attrs.root).descendants()\n\n // Store direct and total descendants count\n attrs.allNodes.forEach((d) => {\n Object.assign(d.data, {\n directSubordinates: d.children ? d.children.length : 0,\n totalSubordinates: d.descendants().length - 1\n })\n })\n\n // Expand all nodes first\n attrs.root.children.forEach(this.expand)\n\n // Then collapse them all\n attrs.root.children.forEach((d) => this.collapse(d))\n\n // Then only expand nodes, which have expanded proprty set to true\n attrs.root.children.forEach((ch) => this.expandSomeNodes(ch))\n\n // Redraw Graphs\n this.update(attrs.root)\n }", "title": "" }, { "docid": "458b223ef7c9f550a9741c254dabde77", "score": "0.6263508", "text": "function update(node) {\n f(node);\n node.children.forEach(update);\n }", "title": "" }, { "docid": "bb9edd806b87479ef1609ab777cea624", "score": "0.6228811", "text": "function updateTree(rootNode){\n calculatingRightSide = true;\n //calculate a new layout for the tree\n tree(rootNode);\n //convert coordinates of all nodes for radial layout\n calculateCoordinates(rootNode);\n\n // add all the nodes from the tree as circles to the svg node Group\n var nodes = rightSvgNodeGroup.selectAll(\"g\").data(rootNode.descendants(), function(d){return d.data.properties.id});\n updateRightSvgNodes(nodes);\n\n //get all the nodes that have been added to the tree\n var newNodes = nodes.enter().append(\"g\");\n createNewRightSvgNodes(newNodes);\n \n //remove nodes that aren't supposed to be shown anymore\n nodes.exit().remove();\n\n // add all the links from the tree to the svg link group\n var links = rightSvgLinkGroup.selectAll(\"path\").data(rootNode.links(), function(d){return d.target.data.properties.id});\n updateRightSvgLinks(links);\n var newLinks = links.enter().append(\"path\");\n createNewRightSvgLinks(newLinks);\n //remove links that don't have a target anymore\n links.exit().remove();\n\n //backup the current positions for animations\n nodes.each(function(d){\n d.x0 = d.x;\n d.y0 = d.y;\n });\n\n newNodes.each(function(d){\n d.x0 = d.x;\n d.y0 = d.y;\n });\n}", "title": "" }, { "docid": "f75b053321229340de1ed68ccd52c948", "score": "0.62264013", "text": "function flipSubtree(node){\r\n\t\r\n\r\n\tvar temp = node.children[0];\r\n\tnode.children[0] = node.children[1];\r\n\tnode.children[1] = temp;\r\n\t//console.log(\"Flipped\", node);\r\n\tvar animate = resetZoom();\r\n\tplanTrees();\r\n\trenderTrees(null, animate);\r\n\r\n}", "title": "" }, { "docid": "e7d3a06a1553eec2f65863cd8ba792f8", "score": "0.6209814", "text": "clearTree() {\n // ******* TODO: PART VII *******\n\n d3.selectAll('.link').classed('selected', false);\n d3.selectAll('.node text').classed('selectedLabel', false);\n }", "title": "" }, { "docid": "0a11e28e8a81359cc709c02f9dc68282", "score": "0.62036926", "text": "function TreeUpdate() {\n // alert(\"in TreeUpdate()\");\n\n var doc = this.document;\n\n // traverse the Nodes using depth-first search\n for (var inode = 1; inode < this.opened.length; inode++) {\n var element = doc.getElementById(\"node\"+inode);\n\n // unhide the row\n element.style.display = null;\n\n // hide the row if one of its parents has .opened=0\n var jnode = this.parent[inode];\n while (jnode != 0) {\n if (this.opened[jnode] == 0) {\n element.style.display = \"none\";\n break;\n }\n\n jnode = this.parent[jnode];\n }\n\n // if the current Node has children, set up appropriate event handler to expand/collapse\n if (this.child[inode] > 0) {\n if (this.opened[inode] == 0) {\n var myElem = doc.getElementById(\"node\"+inode+\"col1\");\n var This = this;\n\n myElem.firstChild.nodeValue = \"+\";\n myElem.onclick = function () {\n var thisNode = this.id.substring(4);\n thisNode = thisNode.substring(0,thisNode.length-4);\n This.expand(thisNode);\n };\n\n } else {\n var myElem = doc.getElementById(\"node\"+inode+\"col1\");\n var This = this;\n\n myElem.firstChild.nodeValue = \"-\";\n myElem.onclick = function () {\n var thisNode = this.id.substring(4);\n thisNode = thisNode.substring(0,thisNode.length-4);\n This.contract(thisNode);\n };\n }\n }\n\n if (this.click[inode] !== null) {\n var myElem = doc.getElementById(\"node\"+inode+\"col2\");\n myElem.onclick = this.click[inode];\n }\n\n // set the class of the properties\n if (this.nprop[inode] >= 1) {\n var myElem = doc.getElementById(\"node\"+inode+\"col3\");\n myElem.onclick = this.cbck1[inode];\n\n if (this.prop1[inode] == \"Viz\") {\n if (this.valu1[inode] == \"off\") {\n myElem.setAttribute(\"class\", \"fakelinkoff\");\n if (this.gprim[inode] != \"\") {\n g.sceneGraph[this.gprim[inode]].attrs &= ~g.plotAttrs.ON;\n g.sceneUpd = 1;\n }\n } else {\n myElem.setAttribute(\"class\", \"fakelinkon\");\n if (this.gprim[inode] != \"\") {\n g.sceneGraph[this.gprim[inode]].attrs |= g.plotAttrs.ON;\n g.sceneUpd = 1;\n }\n }\n }\n }\n\n if (this.nprop[inode] >= 2) {\n var myElem = doc.getElementById(\"node\"+inode+\"col4\");\n myElem.onclick = this.cbck2[inode];\n\n if (this.prop2[inode] == \"Grd\") {\n if (this.valu2[ inode] == \"off\") {\n myElem.setAttribute(\"class\", \"fakelinkoff\");\n\n if (this.gprim[inode] != \"\") {\n g.sceneGraph[this.gprim[inode]].attrs &= ~g.plotAttrs.LINES;\n g.sceneGraph[this.gprim[inode]].attrs &= ~g.plotAttrs.POINTS;\n g.sceneUpd = 1;\n }\n } else {\n myElem.setAttribute(\"class\", \"fakelinkon\");\n\n if (this.gprim[inode] != \"\") {\n g.sceneGraph[this.gprim[inode]].attrs |= g.plotAttrs.LINES;\n g.sceneGraph[this.gprim[inode]].attrs |= g.plotAttrs.POINTS;\n g.sceneUpd = 1;\n }\n }\n }\n }\n\n if (this.nprop[inode] >= 3) {\n var myElem = doc.getElementById(\"node\"+inode+\"col5\");\n myElem.onclick = this.cbck3[inode];\n\n if (this.prop3[inode] == \"Trn\") {\n if (this.valu3[ inode] == \"off\") {\n myElem.setAttribute(\"class\", \"fakelinkoff\");\n\n if (this.gprim[inode] != \"\") {\n g.sceneGraph[this.gprim[inode]].attrs &= ~g.plotAttrs.TRANSPARENT;\n g.sceneUpd = 1;\n }\n } else {\n myElem.setAttribute(\"class\", \"fakelinkon\");\n\n if (this.gprim[inode] != \"\") {\n g.sceneGraph[this.gprim[inode]].attrs |= g.plotAttrs.TRANSPARENT;\n g.sceneUpd = 1;\n }\n }\n } else if (this.prop3[inode] == \"Ori\") {\n if (this.valu3[ inode] == \"off\") {\n myElem.setAttribute(\"class\", \"fakelinkoff\");\n\n if (this.gprim[inode] != \"\") {\n g.sceneGraph[this.gprim[inode]].attrs &= ~g.plotAttrs.ORIENTATION;\n g.sceneUpd = 1;\n }\n } else {\n myElem.setAttribute(\"class\", \"fakelinkon\");\n\n if (this.gprim[inode] != \"\") {\n g.sceneGraph[this.gprim[inode]].attrs |= g.plotAttrs.ORIENTATION;\n g.sceneUpd = 1;\n }\n }\n }\n }\n }\n}", "title": "" }, { "docid": "ae5473534bc73db12c47106335ff3416", "score": "0.6198702", "text": "function replaceInTree(newStx, path) {\n if (path.length === 0) {\n return newStx;\n }\n var parentIdx = path.pop();\n var parentStx = path.pop();\n var parentCopy = Object.create(Object.getPrototypeOf(parentStx[parentIdx]));\n for (var key in parentStx[parentIdx]) {\n if (parentStx[parentIdx].hasOwnProperty(key)) {\n parentCopy[key] = parentStx[parentIdx][key];\n }\n }\n parentCopy.token = _.clone(parentCopy.token);\n parentCopy.token.inner = newStx;\n var newParentStx = _(parentStx).toArray();\n newParentStx[parentIdx] = parentCopy;\n return replaceInTree(newParentStx, path);\n }", "title": "" }, { "docid": "6d010f839de03b56134fd6fa5ada8a79", "score": "0.61841536", "text": "moveTo(newParent, index = __classPrivateFieldGet(newParent, _children).length) {\r\n this.assertNotStale('call', 'moveTo');\r\n // Note: the below assertions are there to leave the design space open.\r\n // Just because I can't think of a useful meaning for these operations right now doesn't mean there isn't one\r\n // Assert this node is not root\r\n if (!__classPrivateFieldGet(this, _parent)) {\r\n throw new Error('Attempted to move a TreeNode out of root position');\r\n }\r\n // Assert newParent is not this node or a descendant of this node\r\n let current = newParent;\r\n while (current) {\r\n if (current === this)\r\n throw new Error('Attempted to move a TreeNode into itself or a descendant');\r\n current = __classPrivateFieldGet(current, _parent);\r\n }\r\n const oldParent = __classPrivateFieldGet(this, _parent);\r\n const oldParentReplacement = oldParent.clone();\r\n __classPrivateFieldSet(oldParentReplacement, _children, Object.freeze(__classPrivateFieldGet(oldParentReplacement, _children).filter(child => child !== this)));\r\n oldParent.replaceSelf(oldParentReplacement);\r\n // todo: figure out how to stop replaceSelf from running redundantly after it reaches oldParent and newParent's common ancestor\r\n const newParentReplacement = newParent.clone();\r\n const newParentChildren = __classPrivateFieldGet(newParentReplacement, _children).slice();\r\n newParentChildren.splice(index, 0, this); // hey future me: this may be a deoptimization point to watch out for\r\n Object.freeze(newParentChildren);\r\n __classPrivateFieldSet(newParentReplacement, _children, newParentChildren);\r\n newParent.replaceSelf(newParentReplacement);\r\n this.dispatch('immutabletree.movenode');\r\n return this;\r\n }", "title": "" }, { "docid": "0831fd662fee361f46fed1de0c6c72f5", "score": "0.61767447", "text": "function treeUpdateParents(tree){if(tree.parent!==null){treeUpdateChild(tree.parent,tree.name,tree);}}", "title": "" }, { "docid": "5ec6c13afdd02dd1a0214700f89b60ec", "score": "0.6164103", "text": "function put_to_nodes(node, obj) {\n var leaf = isleaf(node, obj);\n if( leaf && leaf.leaf )\n node.l.push(obj);\n else if( leaf.childnode )\n put(leaf.childnode, obj);\n else\n return;\n }", "title": "" }, { "docid": "63f1c18e0cc1ec1152b943ca104bd9a3", "score": "0.615302", "text": "pruneTree() {\n this.pruneCounter++;\n const pruneNumber = this.pruneCounter;\n this.pruneNode(this.tree.tree, null, pruneNumber);\n }", "title": "" }, { "docid": "a35db88872606b6222539f241840fe22", "score": "0.61457294", "text": "function setEventOnNode(element) {\n if (element.children) {\n element._children = element.children;\n element.children = null;\n } else {\n element.children = element._children;\n element._children = null;\n }\n update(element);\n}", "title": "" }, { "docid": "72a396e9ccd991ac1525cc575fcf260a", "score": "0.61318123", "text": "resetPathNode(){\n this.currentNode = 0;\n }", "title": "" }, { "docid": "8ec7ce52cf30c066bdaaa544c341a2df", "score": "0.61128795", "text": "function put_to_nodes(node, obj) {\n var leaf = isleaf(node, obj);\n if( leaf )\n node.l.push(obj);\n else if( leaf.childnode )\n put(leaf.childnode, obj);\n else\n return;\n }", "title": "" }, { "docid": "eec302b235d423af787e9a560293f4f3", "score": "0.6083883", "text": "function newValue(node) {\n if(node === null) {\n return null\n }\n if (node.value % 3 === 0 && node.value % 5 === 0) {\n new Node ('fizzbuzz')\n // node.value = 'fizzbuzz'\n }\n if(node.value % 3 === 0) {\n // newTree.insert('fizz')\n new Node ('fizz')\n // node.value = 'fizz'\n } \n if (node.value % 5 === 0) {\n new Node ('buzz')\n // node.left = new Node ('buzz')\n // node.value = 'buzz'\n } \n if(node.value % 3 !== 0 && node.value % 5 !==0) {\n new Node(node.value.toString())\n }\n}", "title": "" }, { "docid": "ae48b3d2d39bebe8d31d1e75e138b46b", "score": "0.60705316", "text": "replaceSelf(myReplacement) {\r\n if (__classPrivateFieldGet(this, _tree).nodeWillUpdate) {\r\n __classPrivateFieldSet(myReplacement, _data, __classPrivateFieldGet(this, _tree).nodeWillUpdate(__classPrivateFieldGet(myReplacement, _data), __classPrivateFieldGet(myReplacement, _children), __classPrivateFieldGet(this, _children)));\r\n }\r\n for (const child of __classPrivateFieldGet(this, _children)) {\r\n __classPrivateFieldSet(child, _parent, myReplacement);\r\n }\r\n if (__classPrivateFieldGet(this, _parent)) {\r\n const parentReplacement = __classPrivateFieldGet(this, _parent).clone();\r\n __classPrivateFieldSet(parentReplacement, _children, Object.freeze(__classPrivateFieldGet(parentReplacement, _children).map(child => child === this ? myReplacement : child)));\r\n __classPrivateFieldGet(this, _parent).replaceSelf(parentReplacement);\r\n }\r\n else {\r\n __classPrivateFieldGet(this, _tree)._changeRoot(myReplacement, IS_INTERNAL);\r\n }\r\n __classPrivateFieldSet(this, _isStale, true);\r\n }", "title": "" }, { "docid": "7cd66050805922bf0c43123bca88fb53", "score": "0.60695815", "text": "resetNodes() {\n this._nodeMap = {};\n this._touchLastUpdate();\n }", "title": "" }, { "docid": "16a8915daf491590c94f73c9a4e60f26", "score": "0.6062303", "text": "function writeTreeResetTree_(writeTree){writeTree.visibleWrites=writeTreeLayerTree_(writeTree.allWrites,writeTreeDefaultFilter_,newEmptyPath());if(writeTree.allWrites.length>0){writeTree.lastWriteId=writeTree.allWrites[writeTree.allWrites.length-1].writeId;}else{writeTree.lastWriteId=-1;}}", "title": "" }, { "docid": "3e06b7c2d23ff8506cbf65dbddb66b2b", "score": "0.60584974", "text": "function restoreTree(node) {\n var child, next;\n\n\tswitch ( node.nodeType ) {\n\t\tcase 1:\n if (node.tagName === 'IMG') {\n /* Replace image with another strange one */\n // console.log('Found image');\n restoreImage(node);\n } // Element\n\t\tcase 9: // Document\n\t\tcase 11: // Document fragment\n child = node.firstChild;\n\t\t\twhile ( child )\n\t\t\t{\n\t\t\t\tnext = child.nextSibling;\n\t\t\t\trestoreTree(child);\n\t\t\t\tchild = next;\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 3: // Text node\n\t\t\trestoreText(node);\n\t\t\tbreak;\n\t}\n}", "title": "" }, { "docid": "ffb651e8f0bb513a30c27fba5edf9a1b", "score": "0.60545766", "text": "function treeSetValue(tree, value) {\r\n tree.node.value = value;\r\n treeUpdateParents(tree);\r\n}", "title": "" }, { "docid": "d62e622d8150bf8743ecf20c6977a4eb", "score": "0.6050651", "text": "function igtree_updatePostField(treeName, nodeId, oldNodeId) {\n var formControl = igtree_getElementById(treeName);\n if(formControl == null)\n return;\n var treeState = formControl.value;\n \n\n if((oldNodeId != null) && treeState.search(oldNodeId + \":Clck<%;\") >= 0) {\n\t\t treeState = treeState.replace(oldNodeId + \":Clck<%;\", nodeId + \":Clck<%;\");\n }\n else\n treeState += nodeId + \":Clck<%;\";\n formControl.value = treeState; \n\n }", "title": "" }, { "docid": "8ec282d32a10b37b48ce22f15f1e00e0", "score": "0.60459876", "text": "function refreshHierarchy() {\n this._rootNode = null;\n }", "title": "" }, { "docid": "daa1f45d93d4b3a051f0bb72af9dac1f", "score": "0.6043056", "text": "clearTree() {\n // ******* TODO: PART VII *******\n d3.select('#tree')\n .selectAll('.selectedLabel')\n .classed('selectedLabel', false);\n\n d3.select('#tree')\n .selectAll('.selected')\n .classed('selected', false);\n \n }", "title": "" }, { "docid": "ffaa1db898246a2d174dcdd353712ff2", "score": "0.60397065", "text": "updateChildrenNodes(children) {\n const outlet = this._getNodeOutlet();\n if (children) {\n this._children = children;\n }\n if (outlet && this._children) {\n const viewContainer = outlet.viewContainer;\n this._tree.renderNodeChanges(this._children, this._dataDiffer, viewContainer, this._data);\n }\n else {\n // Reset the data differ if there's no children nodes displayed\n this._dataDiffer.diff([]);\n }\n }", "title": "" }, { "docid": "a1c976a3c4dd66ad4d07181296789134", "score": "0.6023591", "text": "function update(source){\n\n //compute the tree layout\n\n var nodes = tree.nodes(root).reverse(),\n links = tree.links(nodes);\n\n //normalise for fixed depth\n\n nodes.forEach(function(d){d.y = d.depth * 180;})\n\n console.log(nodes)\n console.log(links)\n\n // Update the nodes…\n var node = svg.selectAll(\"g.node\")\n\t .data(nodes, function(d) { return d.id || (d.id = ++i); });\n\n // Enter any new nodes at the parent's previous position.\n var nodeEnter = node.enter().append(\"g\")\n\t .attr(\"class\", \"node\")\n\t .attr(\"transform\", function(d) { return \"translate(\" + source.y0 + \",\" + source.x0 + \")\"; })\n\t .on(\"click\", click);\n\n nodeEnter.append(\"circle\")\n\t .attr(\"r\", 1e-6)\n\t .style(\"fill\", function(d) { return d._children ? \"lightsteelblue\" : \"#fff\"; });\n\n nodeEnter.append(\"text\")\n\t .attr(\"x\", function(d) { return d.children || d._children ? -13 : 13; })\n\t .attr(\"dy\", \".35em\")\n\t .attr(\"text-anchor\", function(d) { return d.children || d._children ? \"end\" : \"start\"; })\n\t .text(function(d) { return d.name; })\n\t .style(\"fill-opacity\", 1e-6);\n\n // Transition nodes to their new position.\n var nodeUpdate = node.transition()\n\t .duration(duration)\n\t .attr(\"transform\", function(d) { return \"translate(\" + d.y + \",\" + d.x + \")\"; });\n\n nodeUpdate.select(\"circle\")\n\t .attr(\"r\", 10)\n\t .style(\"fill\", function(d) { return d._children ? \"lightsteelblue\" : \"#fff\"; });\n\n nodeUpdate.select(\"text\")\n\t .style(\"fill-opacity\", 1);\n\n // Transition exiting nodes to the parent's new position.\n var nodeExit = node.exit().transition()\n\t .duration(duration)\n\t .attr(\"transform\", function(d) { return \"translate(\" + source.y + \",\" + source.x + \")\"; })\n\t .remove();\n\n nodeExit.select(\"circle\")\n\t .attr(\"r\", 1e-6);\n\n nodeExit.select(\"text\")\n\t .style(\"fill-opacity\", 1e-6);\n\n // Update the links…\n var link = svg.selectAll(\"path.link\")\n\t .data(links, function(d) { return d.target.id; });\n\n // Enter any new links at the parent's previous position.\n link.enter().insert(\"path\", \"g\")\n\t .attr(\"class\", \"link\")\n\t .attr(\"d\", function(d) {\n\t\tvar o = {x: source.x0, y: source.y0};\n\t\treturn diagonal({source: o, target: o});\n\t });\n\n // Transition links to their new position.\n link.transition()\n\t .duration(duration)\n\t .attr(\"d\", diagonal);\n\n // Transition exiting nodes to the parent's new position.\n link.exit().transition()\n\t .duration(duration)\n\t .attr(\"d\", function(d) {\n\t\tvar o = {x: source.x, y: source.y};\n\t\treturn diagonal({source: o, target: o});\n\t })\n\t .remove();\n\n // Stash the old positions for transition.\n nodes.forEach(function(d) {\n\td.x0 = d.x;\n\td.y0 = d.y;\n });\n}", "title": "" }, { "docid": "8ae599cd6d124b367baca44206175245", "score": "0.6017246", "text": "updateTree() {\n this.quadTree.clear();\n this.quadTree.insert(this.players);\n }", "title": "" }, { "docid": "f9d3b39824397a49e272584946b8931a", "score": "0.60028917", "text": "function updateChildren (newNode, oldNode) {\n if (!newNode.childNodes || !oldNode.childNodes) return\n\n var newLength = newNode.childNodes.length\n var oldLength = oldNode.childNodes.length\n var length = Math.max(oldLength, newLength)\n\n var iNew = 0\n var iOld = 0\n for (var i = 0; i < length; i++, iNew++, iOld++) {\n var newChildNode = newNode.childNodes[iNew]\n var oldChildNode = oldNode.childNodes[iOld]\n var retChildNode = walk(newChildNode, oldChildNode)\n if (!retChildNode) {\n if (oldChildNode) {\n oldNode.removeChild(oldChildNode)\n iOld--\n }\n } else if (!oldChildNode) {\n if (retChildNode) {\n oldNode.appendChild(retChildNode)\n iNew--\n }\n } else if (retChildNode !== oldChildNode) {\n oldNode.replaceChild(retChildNode, oldChildNode)\n iNew--\n }\n }\n}", "title": "" }, { "docid": "85cc33525a816451e3118c7f8f88dd6b", "score": "0.59916943", "text": "remove(data){\n if(!data){\n return;\n }\n // root is re-initialized with \n // root of a modified tree. \n this.root=this.removeNode(this.root,data);\n }", "title": "" }, { "docid": "05656154691117c709b1cf33a986e2f0", "score": "0.5990563", "text": "function recollectNodeTree(node, unmountOnly) {\n \t// @TODO: Need to make a call on whether Preact should remove nodes not created by itself.\n \t// Currently it *does* remove them. Discussion: https://github.com/developit/preact/issues/39\n \t//if (!node[ATTR_KEY]) return;\n\n \tvar attrs = node[ATTR_KEY];\n \tif (attrs) hook(attrs, 'ref', null);\n\n \tvar component = node._component;\n \tif (component) {\n \t\tunmountComponent(node, component);\n \t} else {\n \t\tif (!unmountOnly) {\n \t\t\tif (getNodeType(node) !== 1) {\n \t\t\t\tvar p = node.parentNode;\n \t\t\t\tif (p) p.removeChild(node);\n \t\t\t\treturn;\n \t\t\t}\n\n \t\t\tcollectNode(node);\n \t\t}\n\n \t\tvar c = node.childNodes;\n \t\tif (c && c.length) {\n \t\t\tremoveOrphanedChildren(node, c, unmountOnly);\n \t\t}\n \t}\n }", "title": "" }, { "docid": "825f61492b11afbeef6b0ac929b0b089", "score": "0.598793", "text": "updateChildren() {\r\n this.iterateChildren(this.updateChild);\r\n }", "title": "" }, { "docid": "e68251587b6d8ab8fe9b15310c2e3c7c", "score": "0.59766877", "text": "function updateTree(newtext)\r\n{\r\n getObject(treeInputID).value = newtext;\r\n return;\r\n}", "title": "" }, { "docid": "44ed15f74f91f26220791d8ee4ea0ebe", "score": "0.5968659", "text": "function recollectNodeTree(node, unmountOnly) {\n\t// @TODO: Need to make a call on whether Preact should remove nodes not created by itself.\n\t// Currently it *does* remove them. Discussion: https://github.com/developit/preact/issues/39\n\t//if (!node[ATTR_KEY]) return;\n\n\tvar component = node._component;\n\tif (component) {\n\t\tunmountComponent(component, !unmountOnly);\n\t}\n\telse {\n\t\tif (node[ATTR_KEY] && node[ATTR_KEY].ref) { node[ATTR_KEY].ref(null); }\n\n\t\tif (!unmountOnly) {\n\t\t\tcollectNode(node);\n\t\t}\n\n\t\tif (node.childNodes && node.childNodes.length) {\n\t\t\tremoveOrphanedChildren(node.childNodes, unmountOnly);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "5930c78b9d7ee3ff36cac480be5a0f2b", "score": "0.59646595", "text": "clearTree() {\r\n // ******* TODO: PART VII *******\r\n d3.select(\"#tree\")\r\n .selectAll(\"path.selected\")\r\n .classed(\"selected\",false);\r\n\r\n // You only need two lines of code for this! No loops! \r\n }", "title": "" }, { "docid": "707b6146dd7b1310038635ae09046fb7", "score": "0.5962536", "text": "function removeNode() {\n node = selectedNode;\n if(node.parent.left == node){\n node.parent.left = null;\n } else {\n node.parent.right = null;\n }\n draw()\n}", "title": "" }, { "docid": "7e0239ee56339e5f7b3f836ad43b0d4f", "score": "0.59415716", "text": "onChildNodesUpdate() {\n // Node unomunted\n if (!this.pageId || !this.nodeId) return;\n\n // child nodes update\n const childNodes = filterNodes(this.domNode, DOM_SUB_TREE_LEVEL - 1, this);\n if (checkDiffChildNodes(childNodes, this.data.childNodes)) {\n this.setData({\n childNodes: dealWithLeafAndSimple(childNodes, this.onChildNodesUpdate),\n });\n }\n\n // dispatch child update\n const childNodeStack = [].concat(childNodes);\n let childNode = childNodeStack.pop();\n while (childNode) {\n if (childNode.type === 'element' && !childNode.isImage && !childNode.isLeaf && !childNode.isSimple && !childNode.useTemplate) {\n childNode.domNode.$$trigger('$$childNodesUpdate');\n }\n\n if (childNode.childNodes && childNode.childNodes.length) childNode.childNodes.forEach(subChildNode => childNodeStack.push(subChildNode));\n childNode = childNodeStack.pop();\n }\n }", "title": "" }, { "docid": "7625f500d709cbb83c11c10669dc61c5", "score": "0.5934059", "text": "function update(root, computed_node_width=0) {\n\n // Current height of the tree (cannot use height because it isn't recomputed when we rename children -> _children)\n var max_depth = 1\n root.each(d => {\n if (d.children){\n max_depth = d.depth > max_depth ? d.depth : max_depth;\n }\n });\n\n if (computed_node_width != 0) {\n computed_node_width += 30;\n // Re-compute SVG size depending on the generated tree\n var newWidth = Math.max((max_depth + 1) * computed_node_width, node_width);\n // Update height\n // node_height is the height of a node, node_height * 10 is the minimum so the root node isn't behind the lookyloo icon\n var newHeight = Math.max(root.descendants().reverse().length * node_height, 10 * node_height);\n tree.size([newHeight, newWidth])\n\n // Set background based on the computed width and height\n var background = main_svg.insert('rect', ':first-child')\n .attr('y', 0)\n // FIXME: + 200 doesn't make much sense...\n .attr('width', newWidth + margin.right + margin.left + 200)\n .attr('height', newHeight + margin.top + margin.bottom)\n .style('fill', \"url(#backstripes)\");\n\n // Update size\n d3.select(\"body svg\")\n // FIXME: + 200 doesn't make much sense...\n .attr(\"width\", newWidth + margin.right + margin.left + 200)\n .attr(\"height\", newHeight + margin.top + margin.bottom)\n\n // Update pattern\n main_svg.selectAll('pattern')\n .attr('width', computed_node_width * 2)\n pattern.selectAll('rect')\n .attr('width', computed_node_width)\n\n }\n\n // Assigns the x and y position for the nodes\n var treemap = tree(root);\n\n // Compute the new tree layout. => Note: Need d.x & d.y\n var nodes = treemap.descendants(),\n links = treemap.descendants().slice(1);\n\n // ****************** Nodes section ***************************\n\n // Update the nodes...\n const tree_nodes = node_container.selectAll('g.node')\n .data(nodes, node => node.data.uuid);\n\n tree_nodes.join(\n // Enter any new modes at the parent's previous position.\n enter => {\n var node_group = enter.append('g')\n .attr('class', 'node')\n .attr(\"id\", d => 'node_' + d.data.uuid)\n .attr(\"transform\", \"translate(\" + root.y0 + \",\" + root.x0 + \")\")\n\n node_group\n // Add Circle for the nodes\n .append('circle')\n .attr('class', 'node')\n .attr('r', 1e-6)\n .style(\"fill\", d => d._children ? \"lightsteelblue\" : \"#fff\")\n .on('click', click);\n\n var node_data = node_group\n .append('svg')\n .attr('class', 'node_data')\n .attr('x', 0)\n .attr('y', -30);\n\n node_data.append('rect')\n .attr(\"rx\", 6)\n .attr(\"ry\", 6)\n .attr('x', 12)\n .attr('y', 0)\n .style(\"opacity\", \"0.5\")\n .attr(\"stroke\", d => {\n if (d.data.http_content){\n return \"red\";\n }\n return \"black\";\n })\n .attr('stroke-opacity', \"0.8\")\n .attr(\"stroke-width\", d => {\n if (d.data.http_content){\n return \"4\";\n }\n return \"2\";\n })\n .attr(\"stroke-linecap\", \"round\")\n .attr(\"fill\", \"white\");\n\n // Set Hostname text\n node_data\n .append(d => text_entry(15, 5, hostnode_click, d));\n // Set list of icons\n node_data\n .append(d => icon_list(17, 35, d));\n\n\n node_group.select('.node_data').each(function(p, j){\n // set position of icons based of their length\n var cur_icon_list_len = 0;\n d3.select(this).selectAll('.icon').each(function(p, j){\n d3.select(this).attr('x', cur_icon_list_len);\n cur_icon_list_len += d3.select(this).node().getBBox().width;\n });\n\n\n // Rectangle around the domain name & icons\n var selected_node_bbox = d3.select(this).node().getBBox();\n d3.select(this).select('rect')\n .attr('height', selected_node_bbox.height + 15)\n .attr('width', selected_node_bbox.width + 50);\n\n // Set the width for all the nodes\n var selected_node_bbox = d3.select(this).node().getBBox(); // Required, as the node width need to include the rectangle\n node_width = node_width > selected_node_bbox.width ? node_width : selected_node_bbox.width;\n\n });\n return node_group;\n },\n update => update,\n exit => exit\n .transition(t)\n // Remove any exiting nodes\n .attr(\"transform\", node => \"translate(\" + node.y0 + \",\" + node.x0 + \")\")\n // On exit reduce the node circles size to 0\n .attr('r', 1e-6)\n // On exit reduce the opacity of text labels\n .style('fill-opacity', 1e-6)\n .remove()\n ).call(node => {\n node\n // Transition to the proper position for the node\n .attr(\"transform\", node => \"translate(\" + node.y + \",\" + node.x + \")\")\n // Update the node attributes and style\n .select('circle.node')\n .attr('r', 10)\n .style(\"fill\", node => node._children ? \"lightsteelblue\" : \"#fff\")\n .attr('cursor', 'pointer');\n\n });\n\n nodes.forEach(d => {\n // Store the old positions for transition.\n d.x0 = d.x;\n d.y0 = d.y;\n });\n\n\n\n // ****************** links section ***************************\n\n // Update the links...\n const link = node_container.selectAll('path.link')\n .data(links, d => d.id);\n\n link.join(\n enter => enter\n // Enter any new links at the parent's previous position.\n .insert('path', \"g\")\n .attr(\"class\", \"link\")\n .attr('d', d => {\n var o = {x: d.x0, y: d.y0}\n return diagonal(o, o)\n }),\n update => update,\n exit => exit\n .call(exit => exit\n .attr('d', d => {\n var o = {x: d.x0, y: d.y0}\n return diagonal(o, o)\n })\n .remove()\n )\n ).call(link => link\n .attr('d', d => diagonal(d, d.parent))\n );\n\n // Creates a curved (diagonal) path from parent to the child nodes\n function diagonal(s, d) {\n\n path = `M ${s.y} ${s.x}\n C ${(s.y + d.y) / 2} ${s.x},\n ${(s.y + d.y) / 2} ${d.x},\n ${d.y} ${d.x}`\n\n return path\n }\n\n // Toggle children on click.\n function click(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n }\n else {\n d.children = d._children;\n d._children = null;\n }\n // Call update on the whole Tree\n update(d.ancestors().reverse()[0]);\n }\n\n if (computed_node_width === 0) {\n update(root, node_width)\n }\n}", "title": "" }, { "docid": "78065a756e29339d35bc4ee31247e96e", "score": "0.59238255", "text": "function _fillNoSiblingInfo() {\n\t\t\t_fillNoSiblingInfoHelper(vm.tree);\n\t\t}", "title": "" }, { "docid": "9f317863b8d120149d94a2fd825bc031", "score": "0.59186745", "text": "_removeNode(node) {\n if (node.left === null && node.right === null) {\n this._replaceNodeInParent(node, null);\n }\n else if (node.right === null) {\n this._replaceNodeInParent(node, node.left);\n }\n else if (node.left === null) {\n this._replaceNodeInParent(node, node.right);\n }\n else {\n const balance = node.getBalance();\n let replacement;\n let temp = null;\n if (balance > 0) {\n if (node.left.right === null) {\n replacement = node.left;\n replacement.right = node.right;\n temp = replacement;\n }\n else {\n replacement = node.left.right;\n while (replacement.right !== null) {\n replacement = replacement.right;\n }\n if (replacement.parent) {\n replacement.parent.right = replacement.left;\n temp = replacement.parent;\n replacement.left = node.left;\n replacement.right = node.right;\n }\n }\n }\n else if (node.right.left === null) {\n replacement = node.right;\n replacement.left = node.left;\n temp = replacement;\n }\n else {\n replacement = node.right.left;\n while (replacement.left !== null) {\n replacement = replacement.left;\n }\n if (replacement.parent) {\n replacement.parent.left = replacement.right;\n temp = replacement.parent;\n replacement.left = node.left;\n replacement.right = node.right;\n }\n }\n if (node.parent !== null) {\n if (node.isLeftChild()) {\n node.parent.left = replacement;\n }\n else {\n node.parent.right = replacement;\n }\n }\n else {\n this._setRoot(replacement);\n }\n if (temp) {\n this._rebalance(temp);\n }\n }\n node.dispose();\n }", "title": "" }, { "docid": "4c0a9173059411c9df98391eee55f31e", "score": "0.59181666", "text": "function updateChildren (newNode, oldNode) {\n // if (DEBUG) {\n // console.log(\n // 'updateChildren\\nold\\n %s\\nnew\\n %s',\n // oldNode && oldNode.outerHTML,\n // newNode && newNode.outerHTML\n // )\n // }\n var oldChild, newChild, morphed, oldMatch\n\n // The offset is only ever increased, and used for [i - offset] in the loop\n var offset = 0\n\n for (var i = 0; ; i++) {\n oldChild = oldNode.childNodes[i]\n newChild = newNode.childNodes[i - offset]\n // if (DEBUG) {\n // console.log(\n // '===\\n- old\\n %s\\n- new\\n %s',\n // oldChild && oldChild.outerHTML,\n // newChild && newChild.outerHTML\n // )\n // }\n // Both nodes are empty, do nothing\n if (!oldChild && !newChild) {\n break\n\n // There is no new child, remove old\n } else if (!newChild) {\n oldNode.removeChild(oldChild)\n i--\n\n // There is no old child, add new\n } else if (!oldChild) {\n oldNode.appendChild(newChild)\n offset++\n\n // Both nodes are the same, morph\n } else if (same(newChild, oldChild)) {\n morphed = walk(newChild, oldChild)\n if (morphed !== oldChild) {\n oldNode.replaceChild(morphed, oldChild)\n offset++\n }\n\n // Both nodes do not share an ID or a placeholder, try reorder\n } else {\n oldMatch = null\n\n // Try and find a similar node somewhere in the tree\n for (var j = i; j < oldNode.childNodes.length; j++) {\n if (same(oldNode.childNodes[j], newChild)) {\n oldMatch = oldNode.childNodes[j]\n break\n }\n }\n\n // If there was a node with the same ID or placeholder in the old list\n if (oldMatch) {\n morphed = walk(newChild, oldMatch)\n if (morphed !== oldMatch) offset++\n oldNode.insertBefore(morphed, oldChild)\n\n // It's safe to morph two nodes in-place if neither has an ID\n } else if (!newChild.id && !oldChild.id) {\n morphed = walk(newChild, oldChild)\n if (morphed !== oldChild) {\n oldNode.replaceChild(morphed, oldChild)\n offset++\n }\n\n // Insert the node at the index if we couldn't morph or find a matching node\n } else {\n oldNode.insertBefore(newChild, oldChild)\n offset++\n }\n }\n }\n}", "title": "" }, { "docid": "072926885d24a95c3acf15731fd16ae7", "score": "0.5917597", "text": "reset() {\n this.children.forEach(child => {\n child.reset();\n });\n }", "title": "" }, { "docid": "6b8dced67ef8dcef60d26c16a129ce22", "score": "0.59128714", "text": "function preprocess_tree(node, concat_names, depth) {\n\tnode.full_name = depth==0 ? node.name : concat_names+'.'+node.name;\n\tnode.depth = depth+1;\n\tif(node.depth == 1)\n\t\tnode.box = {ll:[0,0], ur:[1,1]};\n\n\tif('children' in node) {\n\t\tnode.is_leaf = false;\n\t\tnode.value = 0;\n\t\tfor(var c = 0; c < node.children.length; c++) {\n\t\t\tnode.children[c].parent = node;\n\t\t\tpreprocess_tree(node.children[c], node.full_name, node.depth);\n\t\t}\n\t}\n\telse {\n\t\tnode.is_leaf = true;\n\t\tnode.value = +node.value;\n\t\tnode.children = [];\n\t}\n}", "title": "" }, { "docid": "2122c2da3d178adc3742a397f7c31934", "score": "0.59113216", "text": "function clicken(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else {\n d.children = d._children;\n d._children = null;\n }\n updateen(d);\n }", "title": "" }, { "docid": "ea76e28bae866a340f463a08687a7377", "score": "0.5909264", "text": "replaceWith(newNode) {\n if (newNode != null) {\n newNode.parent = this.parent;\n }\n if (this.parent != null) {\n var left = false\n var right = false\n if (this != null && this.parent.leftChild != null) {\n if (this.value == this.parent.leftChild.value) {\n left = true\n }\n }\n if (this != null && this.parent.rightChild != null) {\n if (this.value == this.parent.rightChild.value) {\n right = true\n }\n }\n if (this == this.parent.leftChild || left) {\n this.parent.leftChild = newNode;\n this.parent = null\n } else if (this == this.parent.rightChild || right) {\n this.parent.rightChild = newNode;\n this.parent = null;\n }\n }\n return newNode;\n }", "title": "" }, { "docid": "5e978a371b8c3e2374f928ecddae53e9", "score": "0.59089655", "text": "function resetTree(tree) {\n tree.children.forEach(child => {\n if (child.type === \"Group\") {\n resetTree(child)\n child.remove(...child.children);\n } else if (child.type === \"Mesh\") {\n child.geometry.dispose()\n }\n })\n}", "title": "" }, { "docid": "62a050b889e8537cff9e81d9f39cd070", "score": "0.58953184", "text": "constructor() {\n this._tree={};\n this._size=0;\n this._modCount=0;\n }", "title": "" }, { "docid": "d9a2fa6eca05eb731621e707563003f0", "score": "0.58932567", "text": "updateGeneralNode(node, newStatus) {\n if (node.status < newStatus) {\n node.status = newStatus;\n }\n\n }", "title": "" }, { "docid": "e6daf4fba66bcffcc76d821f8439ff78", "score": "0.58894217", "text": "function replaceNode(change) {\n change.prev.node.parentNode.replaceChild(change.next.build(), change.prev.node);\n collectTasks('onmount', change.next);\n collectTasks('onunmount', change.prev);\n }", "title": "" }, { "docid": "c35495d987c005815db718606b13afc0", "score": "0.5875234", "text": "setNodes(nodes) {\n this.$emit('on-nodes-update', nodes.slice().sort((a, b) => {\n if (a.depth < b.depth) {\n if (b.parent) return a.x - b.parent.x;\n } else if (a.depth > b.depth) {\n if (a.parent) return a.parent.x - b.x;\n }\n return a.x - b.x;\n }))\n }", "title": "" }, { "docid": "a67ae3cc4269461b04910772683910a3", "score": "0.5864399", "text": "function fixtree( dnode, curtree ) {\n\n // if dnode.parent == null then dnode is the new root\n if ( dnode.parent == null ) {\n\tcurtree.rbRoot = dnode;\n\treturn;\n }\n\n // if sibling is RED, swap parent and sib colors and rotate parent\n // first, set snode to the sibling node\n var snode = (dnode.parent.left != dnode) ? dnode.parent.left : dnode.parent.right;\n\n if ( (snode != null) && (snode.color == RED) ) {\n\tdnode.parent.color = RED;\n\tsnode.color = BLACK;\n\tif ( dnode.parent.left == dnode ) {\n\t l_rotate( dnode.parent, curtree );\n\t} else {\n\t r_rotate( dnode.parent, curtree );\n\t}\n\t// after rotation, dnode probably has a new sibling\n\tsnode = (dnode.parent.left != dnode) ? dnode.parent.left : dnode.parent.right;\n }\n\n // if parent, sib and sib's kids are black: mark sib as RED and re-examine the parent?\n if ( ( dnode.parent.color == BLACK ) && ( snode.color == BLACK ) && \n\t (( snode.left == null) || (snode.left.color == BLACK )) && \n\t (( snode.right == null) || (snode.right.color == BLACK )) ) {\n\t snode.color = RED;\n\t // re-examine\n\t fixtree( dnode.parent, curtree );\n\t return;\n } \n\n // if sib and sib's kids are BLACK but the parent is RED, switch colors of \n // parent and sib\n if ( (dnode.parent.color == RED) && (snode.color == BLACK) && \n\t ((snode.left == null) || (snode.left.color == BLACK)) && \n\t ((snode.right == null) || (snode.right.color == BLACK)) ) {\n\tsnode.color = RED;\n\tdnode.parent.color = BLACK;\n\treturn;\n }\n\n // sib is BLACK, its left child is RED and its right child is BLACK AND \n // dnode is the left child of its parent.\n if ( snode.color == BLACK ) {\n\tif (( dnode.parent.left == dnode) && \n\t ((snode.right == null) || (snode.right.color == BLACK)) && \n\t ((snode.left != null) && (snode.left.color == RED)) ) {\n\t snode.color = RED;\n\t snode.left.color = BLACK;\n\t snode = r_rotate( snode, curtree );\n\t} else if (( dnode.parent.right == dnode) && \n\t\t ((snode.left == null) || (snode.left.color == BLACK)) && \n\t\t ((snode.right != null) &&(snode.right.color == RED)) ) { \n\t snode.color = RED;\n\t snode.right.color = BLACK;\n\t snode = l_rotate( snode, curtree );\n\t}\n }\n\n snode.color = dnode.parent.color;\n dnode.parent.color = BLACK;\n\n if (dnode == dnode.parent.left) {\n\tsnode.right.color = BLACK;\n\tl_rotate( dnode.parent, curtree );\n } else {\n\tsnode.left.color = BLACK;\n\tr_rotate( dnode.parent, curtree );\n }\n}", "title": "" }, { "docid": "fb383d30706347b45bdd4ec9cc453a49", "score": "0.58576447", "text": "postOrder(node) {\n if(node != null) {\n this.preOrder(node.leftChild);\n this.preOrder(node.rightChild);``\n console.log(node.object + ' ' + node.id);\n }\n }", "title": "" }, { "docid": "b76bd0fa7f617590b7791835a66cf1b0", "score": "0.5855753", "text": "function Tree() {\n\n Tree.prototype.addNode = function (node, val) {\n\n arrayOfTreeNode.push(val);\n\n if (treeRoot === null) {\n treeRoot = new Node(val);\n return;\n }\n\n else if (node === null) {\n\n return new Node(val);\n }\n\n else if (val > node.value) {\n node.right = Tree.prototype.addNode(node.right, val)\n }\n\n else if (val < node.value) {\n node.left = Tree.prototype.addNode(node.left, val)\n }\n\n return node;\n\n }\n\n Tree.prototype.printInorder = function (node) {\n if (node === null)\n return;\n Tree.prototype.printInorder(node.left);\n console.log(node.value);\n Tree.prototype.printInorder(node.right)\n }\n\n Tree.prototype.removeNode = function (node, val, LoR) {\n\n if (treeRoot.value == val && treeRoot.left == null && treeRoot.right == null) {\n treeRoot = null;\n return;\n }\n\n\n if (node == null) {\n return;\n }\n\n if (node.value == val) {\n\n if (node.left == null && node.right == null) {\n preOfCurrent[LoR] = null;\n }\n\n else if (node.left != null && node.right == null) {\n preOfCurrent[LoR] = node.left\n }\n\n else if (node.left == null && node.right != null) {\n preOfCurrent[LoR] = node.right\n }\n\n else {\n for (let i = node.right; i != null; i = i.left) {\n\n\n if (node.right.left == null) {\n preOfCurrent = node\n }\n\n if (i.left == null) {\n\n node.value = i.value;\n\n if (preOfCurrent == node) {\n Tree.prototype.removeNode(i, i.value, \"right\");\n }\n\n else {\n Tree.prototype.removeNode(i, i.value, \"left\");\n }\n\n\n }\n\n preOfCurrent = i;\n }\n }\n\n nodeFind = true;\n return;\n }\n\n if (!nodeFind) {\n preOfCurrent = node;\n Tree.prototype.removeNode(node.left, val, \"left\")\n }\n\n if (!nodeFind) {\n preOfCurrent = node;\n Tree.prototype.removeNode(node.right, val, \"right\")\n }\n }\n}", "title": "" }, { "docid": "c218af45943c9a52b2c5a937c29b0fda", "score": "0.5855403", "text": "function click(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else {\n d.children = d._children;\n d._children = null;\n }\n update_nodes(d);\n }", "title": "" }, { "docid": "8c24d88d8dd62ff07e1fab6cbcc147b3", "score": "0.58495456", "text": "function changedDescendants(old, cur, offset, f) {\n var oldSize = old.childCount, curSize = cur.childCount;\n outer: for (var i = 0, j = 0; i < curSize; i++) {\n var child = cur.child(i);\n for (var scan = j, e = Math.min(oldSize, i + 3); scan < e; scan++) {\n if (old.child(scan) == child) {\n j = scan + 1;\n offset += child.nodeSize;\n continue outer\n }\n }\n f(child, offset);\n if (j < oldSize && old.child(j).sameMarkup(child))\n { changedDescendants(old.child(j), child, offset + 1, f); }\n else\n { child.nodesBetween(0, child.content.size, f, offset + 1); }\n offset += child.nodeSize;\n }\n }", "title": "" }, { "docid": "a1a3567463ab22e40f65c23341627fcd", "score": "0.58444303", "text": "mutateDeep(parts, updatedNode){\n \tconst nodeAddress = parts.pop();\n \t// need to visit even further\n \tif( parts.length ){\n \t\tconst [chIdx, aIdx] = nodeAddress.split(':');\n \t\tconst ownerNode = aIdx?this.children[chIdx][aIdx]:this.children[chIdx];\n \t\tupdatedNode = ownerNode.updateDeep(parts, updatedNode);\n \t}\n\n \treturn this.cloneNode({\n \t\t[nodeAddress]: updatedNode\n \t});\n }", "title": "" }, { "docid": "e19069c37897078ec587b1c943e25877", "score": "0.58437973", "text": "_removeNode(node) {\n if (node.left === null && node.right === null) {\n this._replaceNodeInParent(node, null);\n }\n else if (node.right === null) {\n this._replaceNodeInParent(node, node.left);\n }\n else if (node.left === null) {\n this._replaceNodeInParent(node, node.right);\n }\n else {\n const balance = node.getBalance();\n let replacement;\n let temp = null;\n if (balance > 0) {\n if (node.left.right === null) {\n replacement = node.left;\n replacement.right = node.right;\n temp = replacement;\n }\n else {\n replacement = node.left.right;\n while (replacement.right !== null) {\n replacement = replacement.right;\n }\n if (replacement.parent) {\n replacement.parent.right = replacement.left;\n temp = replacement.parent;\n replacement.left = node.left;\n replacement.right = node.right;\n }\n }\n }\n else if (node.right.left === null) {\n replacement = node.right;\n replacement.left = node.left;\n temp = replacement;\n }\n else {\n replacement = node.right.left;\n while (replacement.left !== null) {\n replacement = replacement.left;\n }\n if (replacement.parent) {\n replacement.parent.left = replacement.right;\n temp = replacement.parent;\n replacement.left = node.left;\n replacement.right = node.right;\n }\n }\n if (node.parent !== null) {\n if (node.isLeftChild()) {\n node.parent.left = replacement;\n }\n else {\n node.parent.right = replacement;\n }\n }\n else {\n this._setRoot(replacement);\n }\n if (temp) {\n this._rebalance(temp);\n }\n }\n node.dispose();\n }", "title": "" }, { "docid": "f9ebf2145cf904320e9b3ef90bbef60e", "score": "0.583967", "text": "function transferNode(change) {\n change.next.node = change.prev.node;\n }", "title": "" }, { "docid": "b3bc6d6bfda43702c75e5b1f2a92e5dc", "score": "0.5839207", "text": "function diffNode(prev, next, path) {\n\t var replaceNode = Actions.replaceNode;\n\t var setAttribute = Actions.setAttribute;\n\t var sameNode = Actions.sameNode;\n\t var removeNode = Actions.removeNode;\n\t var updateThunk = Actions.updateThunk;\n\n\t // No left node to compare it to\n\t // TODO: This should just return a createNode action\n\n\t if ((0, _isUndefined2.default)(prev)) {\n\t throw new Error('Left node must not be null or undefined');\n\t }\n\n\t // Bail out and skip updating this whole sub-tree\n\t if (prev === next) {\n\t return [sameNode()];\n\t }\n\n\t // Remove\n\t if (!(0, _isUndefined2.default)(prev) && (0, _isUndefined2.default)(next)) {\n\t return [removeNode(prev)];\n\t }\n\n\t // Replace with empty\n\t if (!(0, _isNull2.default)(prev) && (0, _isNull2.default)(next) || (0, _isNull2.default)(prev) && !(0, _isNull2.default)(next)) {\n\t return [replaceNode(prev, next, path)];\n\t }\n\n\t // Replace\n\t if (prev.type !== next.type) {\n\t return [replaceNode(prev, next, path)];\n\t }\n\n\t // Native\n\t if ((0, _element.isNative)(next)) {\n\t if (prev.tagName !== next.tagName) {\n\t return [replaceNode(prev, next, path)];\n\t }\n\t var changes = diffAttributes(prev, next);\n\t changes.push(diffChildren(prev, next, path));\n\t return changes;\n\t }\n\n\t // Text\n\t if ((0, _element.isText)(next)) {\n\t var _changes = [];\n\t if (prev.nodeValue !== next.nodeValue) {\n\t _changes.push(setAttribute('nodeValue', next.nodeValue, prev.nodeValue));\n\t }\n\t return _changes;\n\t }\n\n\t // Thunk\n\t if ((0, _element.isThunk)(next)) {\n\t var _changes2 = [];\n\t if ((0, _element.isSameThunk)(prev, next)) {\n\t _changes2.push(updateThunk(prev, next, path));\n\t } else {\n\t _changes2.push(replaceNode(prev, next, path));\n\t }\n\t return _changes2;\n\t }\n\n\t // Empty\n\t if ((0, _element.isEmpty)(next)) {\n\t return [];\n\t }\n\n\t return [];\n\t}", "title": "" }, { "docid": "6d7ed84a6f2922891f65874daefd1e8f", "score": "0.5829619", "text": "async clearTree(){\n\n await this._clearDeletedElements();\n return super.clearTree();\n\n }", "title": "" }, { "docid": "2bbf43bc7e4887b95f5c97ee78bba3b0", "score": "0.5827005", "text": "function removeKeepChildren(node) {\n var $node = $(node);\n $node.contents().each(function () {\n $(this).insertBefore($node);\n });\n $node.remove();\n }", "title": "" }, { "docid": "d81114c02cf3dcaf863feb2968144548", "score": "0.5826851", "text": "function update_dom(toplevelNode, nodes, relations) {\n var i, parent, child;\n // TODO: rewrite this to move stuff all in one go... possible? necessary?\n\n // move all children to their proper parents\n for (i = 0; i < relations.length; i++) {\n if (relations[i].relation === 'parent') {\n parent = relations[i].parent;\n child = relations[i].child;\n if (child.parentNode !== parent) {\n parent.appendChild(child);\n }\n }\n }\n\n // arrange siblings in proper order\n // truly terrible... BUBBLE SORT\n var unsorted = true;\n while (unsorted) {\n unsorted = false;\n for (i = 0; i < relations.length; i++) {\n if (relations[i].relation === 'neighbor') {\n var left = relations[i].left, right = relations[i].right;\n\n if (! nodeEq(left.nextSibling, right)) {\n left.parentNode.insertBefore(left, right);\n unsorted = true;\n }\n }\n }\n }\n\n // Finally, remove nodes that shouldn't be attached anymore.\n var nodesPlus = nodes.concat([toplevelNode]);\n preorder(toplevelNode, function(aNode, continueTraversalDown) {\n if (aNode.jsworldOpaque) {\n if (! isMemq(aNode, nodesPlus)) {\n aNode.parentNode.removeChild(aNode);\n }\n } else {\n if (! isMemq(aNode, nodesPlus)) {\n aNode.parentNode.removeChild(aNode);\n } else {\n continueTraversalDown();\n }\n }\n });\n\n refresh_node_values(nodes);\n }", "title": "" }, { "docid": "d81114c02cf3dcaf863feb2968144548", "score": "0.5826851", "text": "function update_dom(toplevelNode, nodes, relations) {\n var i, parent, child;\n // TODO: rewrite this to move stuff all in one go... possible? necessary?\n\n // move all children to their proper parents\n for (i = 0; i < relations.length; i++) {\n if (relations[i].relation === 'parent') {\n parent = relations[i].parent;\n child = relations[i].child;\n if (child.parentNode !== parent) {\n parent.appendChild(child);\n }\n }\n }\n\n // arrange siblings in proper order\n // truly terrible... BUBBLE SORT\n var unsorted = true;\n while (unsorted) {\n unsorted = false;\n for (i = 0; i < relations.length; i++) {\n if (relations[i].relation === 'neighbor') {\n var left = relations[i].left, right = relations[i].right;\n\n if (! nodeEq(left.nextSibling, right)) {\n left.parentNode.insertBefore(left, right);\n unsorted = true;\n }\n }\n }\n }\n\n // Finally, remove nodes that shouldn't be attached anymore.\n var nodesPlus = nodes.concat([toplevelNode]);\n preorder(toplevelNode, function(aNode, continueTraversalDown) {\n if (aNode.jsworldOpaque) {\n if (! isMemq(aNode, nodesPlus)) {\n aNode.parentNode.removeChild(aNode);\n }\n } else {\n if (! isMemq(aNode, nodesPlus)) {\n aNode.parentNode.removeChild(aNode);\n } else {\n continueTraversalDown();\n }\n }\n });\n\n refresh_node_values(nodes);\n }", "title": "" }, { "docid": "626d773be4cb8c36d27e55358d7c31cb", "score": "0.5823594", "text": "function raiseNode(t) {\n d3.select(t.parentNode).each(function () {\n this.parentNode.appendChild(this);\n });\n nodeMap.get(idString(nodeData)).children.forEach(function (c) {\n d3.select(\"[id='\" + c.edge.id + \"']\").each(function () {\n this.parentNode.appendChild(this);\n })\n });\n }", "title": "" }, { "docid": "291805ea603f558753b4458caacece8c", "score": "0.5823276", "text": "function unfixChildren(node) {\n edges = sys.getEdgesFrom(node);\n if (edges && edges.length > 0) {\n $.each(edges, function(i, edge) {\n var child = edge.target;\n child.fixed = false;\n unfixChildren(child);\n });\n }\n}", "title": "" }, { "docid": "8d712c926107bc67b89a5ab4b4a28982", "score": "0.5800664", "text": "remove() {\r\n this.assertNotStale('call', 'remove');\r\n if (__classPrivateFieldGet(this, _parent)) {\r\n const parentReplacement = __classPrivateFieldGet(this, _parent).clone();\r\n __classPrivateFieldSet(parentReplacement, _children, Object.freeze(__classPrivateFieldGet(parentReplacement, _children).filter(child => child !== this)));\r\n __classPrivateFieldGet(this, _parent).replaceSelf(parentReplacement);\r\n }\r\n else {\r\n __classPrivateFieldGet(this, _tree)._changeRoot(null, IS_INTERNAL);\r\n }\r\n __classPrivateFieldSet(this, _isStale, true);\r\n // todo: recursively mark children as stale?\r\n this.dispatch('immutabletree.removenode');\r\n return this;\r\n }", "title": "" }, { "docid": "7ccd65084598a863efa4198ad8e9c289", "score": "0.5800119", "text": "function updateTree(data){\n var container = document.getElementById('tree-container');\n container.innerHTML = data;\n}", "title": "" }, { "docid": "00e2be51704564697c87bb8d8380acfb", "score": "0.5797817", "text": "function updateRtree(item, replace) {\n\t _krCache.rtree.remove(item, function isEql(a, b) {\n\t return a.data.id === b.data.id;\n\t });\n\n\t if (replace) {\n\t _krCache.rtree.insert(item);\n\t }\n\t}", "title": "" }, { "docid": "d84429885deb70e451174484500bd1ee", "score": "0.5797281", "text": "function diffNode(prev, next, path) {\n\t var replaceNode = Actions.replaceNode;\n\t var setAttribute = Actions.setAttribute;\n\t var sameNode = Actions.sameNode;\n\t var removeNode = Actions.removeNode;\n\t var updateThunk = Actions.updateThunk;\n\n\t // No left node to compare it to\n\t // TODO: This should just return a createNode action\n\n\t if ((0, _isUndefined2.default)(prev)) {\n\t throw new Error('Left node must not be null or undefined');\n\t }\n\n\t // Bail out and skip updating this whole sub-tree\n\t if (prev === next) {\n\t return [sameNode()];\n\t }\n\n\t // Remove\n\t if (!(0, _isUndefined2.default)(prev) && (0, _isUndefined2.default)(next)) {\n\t return [removeNode(prev)];\n\t }\n\n\t // Replace with empty\n\t if (!(0, _isNull2.default)(prev) && (0, _isNull2.default)(next) || (0, _isNull2.default)(prev) && !(0, _isNull2.default)(next)) {\n\t return [replaceNode(prev, next, path)];\n\t }\n\n\t // Replace\n\t if (prev.type !== next.type) {\n\t return [replaceNode(prev, next, path)];\n\t }\n\n\t // Native\n\t if ((0, _element.isNative)(next)) {\n\t if (prev.tagName !== next.tagName) {\n\t return [replaceNode(prev, next, path)];\n\t }\n\t var changes = diffAttributes(prev, next);\n\t changes.push(diffChildren(prev, next, path));\n\t return changes;\n\t }\n\n\t // Text\n\t if ((0, _element.isText)(next)) {\n\t var changes = [];\n\t if (prev.nodeValue !== next.nodeValue) {\n\t changes.push(setAttribute('nodeValue', next.nodeValue, prev.nodeValue));\n\t }\n\t return changes;\n\t }\n\n\t // Thunk\n\t if ((0, _element.isThunk)(next)) {\n\t var changes = [];\n\t if ((0, _element.isSameThunk)(prev, next)) {\n\t changes.push(updateThunk(prev, next, path));\n\t } else {\n\t changes.push(replaceNode(prev, next, path));\n\t }\n\t return changes;\n\t }\n\n\t // Empty\n\t if ((0, _element.isEmpty)(next)) {\n\t return [];\n\t }\n\n\t return [];\n\t}", "title": "" }, { "docid": "a9fe0d037dae2c478e64e809d5c8c01c", "score": "0.57961315", "text": "setTree(tree){\n \n this.tree = tree;\n \n }", "title": "" }, { "docid": "769a00c42cda6f6ccce02690aa5ef52f", "score": "0.579577", "text": "updateNodeLink (name, node) {\n const newnode = this.copy()\n newnode.removeNodeLink(name)\n newnode.addNodeLink(name, node)\n return newnode\n }", "title": "" }, { "docid": "4b910a706dc7686b83544ba6ae3504f7", "score": "0.57940763", "text": "parseTree() {\n const recurse = node => {\n this.removeAllListeners(node);\n this.applyListeners(node);\n this.bindAttributes(node);\n this.saveIDReference(node);\n\n Array.from(node.children).forEach(recurse);\n };\n\n recurse(this.shadowRoot);\n }", "title": "" }, { "docid": "707e9ccbcaf5cbb64e20a2597fe041ce", "score": "0.5793331", "text": "function clear(node) {\n if (node.type === 0 /* Branch */) {\n (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__.each)(node.children, clear);\n node.children.length = 0;\n node.sizes.length = 0;\n node.items.length = 0;\n }\n else {\n node.items.length = 0;\n node.next = null;\n node.prev = null;\n }\n }", "title": "" }, { "docid": "9ac23e951e5d41b8277b3bf7a67b99e0", "score": "0.5789721", "text": "function update_dom(toplevelNode, nodes, relations) {\n var i, parent, child;\n // TODO: rewrite this to move stuff all in one go... possible? necessary?\n\n // move all children to their proper parents\n for (i = 0; i < relations.length; i++) {\n if (relations[i].relation === 'parent') {\n parent = relations[i].parent;\n child = relations[i].child;\n if (child.parentNode !== parent) {\n parent.appendChild(child);\n }\n }\n }\n\n // arrange siblings in proper order\n // truly terrible... BUBBLE SORT\n var unsorted = true;\n while (unsorted) {\n unsorted = false;\n for (i = 0; i < relations.length; i++) {\n if (relations[i].relation === 'neighbor') {\n var left = relations[i].left, right = relations[i].right;\n\n if (! nodeEq(left.nextSibling, right)) {\n left.parentNode.insertBefore(left, right);\n unsorted = true;\n }\n }\n }\n }\n\n // Finally, remove nodes that shouldn't be attached anymore.\n var nodesPlus = nodes.concat([toplevelNode]);\n preorder(toplevelNode, function(aNode, continueTraversalDown) {\n if (aNode.jsworldOpaque) {\n if (! isMemq(aNode, nodesPlus)) {\n aNode.parentNode.removeChild(aNode);\n }\n } else {\n if (! isMemq(aNode, nodesPlus)) {\n aNode.parentNode.removeChild(aNode);\n } else {\n continueTraversalDown();\n }\n }\n });\n\n refresh_node_values(nodes);\n }", "title": "" }, { "docid": "16f2a8b9d46deb0dda1fbc3f72a10876", "score": "0.5789688", "text": "function NodeHandle(RootNode, t){\nwith(RootNode.Info)\nif(hasChildNodes())\nif(firstChild.Settings)\nreplaceChild(RootNode.Container, firstChild);\nelse\nfirstChild.childNodes[1].firstChild.Type - t.Type || removeChild(firstChild);\nelse\nappendChild(RootNode.Container);\nRootNode.Container.Data.replaceChild(t, RootNode.Container.Data.firstChild);\n}", "title": "" }, { "docid": "3d889eabd6ae9fd3586c5999542c33e0", "score": "0.5788481", "text": "function walkAll(nodes){\n var result = null\n for (var i=0;i<nodes.length;i++){\n var childNode = nodes[i]\n if (childNode.type === 'EmptyStatement') continue\n var result = walk(childNode)\n if (result === 'remove'){\n nodes.splice(i--, 1)\n }\n }\n }", "title": "" }, { "docid": "d667cd142d1524ae2aa9bb890c86829f", "score": "0.5786126", "text": "_replaceNodeInParent(node, replacement) {\n if (node.parent !== null) {\n if (node.isLeftChild()) {\n node.parent.left = replacement;\n }\n else {\n node.parent.right = replacement;\n }\n this._rebalance(node.parent);\n }\n else {\n this._setRoot(replacement);\n }\n }", "title": "" }, { "docid": "416e258afe35c073f726225939295636", "score": "0.5784758", "text": "function clear(node) {\n if (node.type === 0 /* Branch */) {\n algorithm_1.each(node.children, clear);\n node.children.length = 0;\n node.sizes.length = 0;\n node.items.length = 0;\n }\n else {\n node.items.length = 0;\n node.next = null;\n node.prev = null;\n }\n }", "title": "" }, { "docid": "565c7267487fd73d510a40f4dc75108a", "score": "0.5783647", "text": "_updateChildNodes(container, children) {\n let composed = tree.Composed.getChildNodes(container);\n let splices = calculateSplices(children, composed);\n // process removals\n for (let i=0, d=0, s; (i<splices.length) && (s=splices[i]); i++) {\n for (let j=0, n; (j < s.removed.length) && (n=s.removed[j]); j++) {\n // check if the node is still where we expect it is before trying\n // to remove it; this can happen if we move a node and\n // then schedule its previous host for distribution resulting in\n // the node being removed here.\n if (tree.Composed.getParentNode(n) === container) {\n tree.Composed.removeChild(container, n);\n }\n composed.splice(s.index + d, 1);\n }\n d -= s.addedCount;\n }\n // process adds\n for (let i=0, s, next; (i<splices.length) && (s=splices[i]); i++) { //eslint-disable-line no-redeclare\n next = composed[s.index];\n for (let j=s.index, n; j < s.index + s.addedCount; j++) {\n n = children[j];\n tree.Composed.insertBefore(container, n, next);\n // TODO(sorvell): is this splice strictly needed?\n composed.splice(j, 0, n);\n }\n }\n }", "title": "" }, { "docid": "2de28f18a3ab45ad63d8fae822288748", "score": "0.57797736", "text": "resetNode()\n {\n this.setState({isShortestPath: false, isVisited: false});\n }", "title": "" }, { "docid": "ad037e0f7c3c37fedc56558d4018ecdc", "score": "0.577911", "text": "_composeTree() {\n this._updateChildNodes(this.host, this._composeNode(this.host));\n let p$ = this._insertionPoints || [];\n for (let i=0, l=p$.length, p, parent; (i<l) && (p=p$[i]); i++) {\n parent = tree.Logical.getParentNode(p);\n if ((parent !== this.host) && (parent !== this)) {\n this._updateChildNodes(parent, this._composeNode(parent));\n }\n }\n }", "title": "" }, { "docid": "a1afae0f3daf5b24ea6addc5504023e5", "score": "0.5776879", "text": "function resetNode(obj) {\n let css = {opacity: 1, stroke: \"black\", fill: \"grey\"};\n applyStyles(obj.core.node, css);\n obj.core.node.setAttribute(\"r\", 5);\n}", "title": "" }, { "docid": "7f7d90c336c2cd9e75dbc389cf72357d", "score": "0.57671136", "text": "function changedDescendants(old, cur, offset, f) {\n var oldSize = old.childCount, curSize = cur.childCount;\n outer: for (var i = 0, j = 0; i < curSize; i++) {\n var child = cur.child(i);\n for (var scan = j, e = Math.min(oldSize, i + 3); scan < e; scan++) {\n if (old.child(scan) == child) {\n j = scan + 1;\n offset += child.nodeSize;\n continue outer\n }\n }\n f(child, offset);\n if (j < oldSize && old.child(j).sameMarkup(child))\n { changedDescendants(old.child(j), child, offset + 1, f); }\n else\n { child.nodesBetween(0, child.content.size, f, offset + 1); }\n offset += child.nodeSize;\n }\n}", "title": "" }, { "docid": "7780151a7a8c1ceb0f88ef9ee3646f73", "score": "0.57649565", "text": "function NukeNode(nid) {\n var node = self.Node(nid);\n if (node.children) {\n for (var n = 0; n < node.children.length; ++n)\n NukeNode(node.children[n]);\n }\n if (self._cloneSource) {\n self._node[nid] = null; // If cloned, shadow deletion.\n } else {\n delete self._node[nid]; // Otherwise, delete it outright.\n }\n self._length--;\n }", "title": "" }, { "docid": "9e132521a359f0f8bddf2b8656865e12", "score": "0.57649016", "text": "function patch(node) {\n if (!node.position) {\n node.position = {};\n }\n}", "title": "" } ]
095683048169f69eebfde24eec09c392
Creates a 0xAARRGGBB from values / Overdrive is not permitted, so values over 255 (0xff) will get clipped.
[ { "docid": "4774b26251e76bde65169922730b16cd", "score": "0.50510806", "text": "function makecol(r,g,b,a)\n{\n\ta = typeof a !== 'undefined' ? a : 255;\n\treturn (a<<24)|((r&0xff)<<16)|((g&0xff)<<8)|((b&0xff));\n}", "title": "" } ]
[ { "docid": "07d006a8a2a3d0becd96046419dcdce6", "score": "0.56806916", "text": "function rgb(r, g, b) \n{ return 'rgb('+clamp(Math.round(r),0,255)+', '+clamp(Math.round(g),0,255)+', '+clamp(Math.round(b),0,255)+')';}", "title": "" }, { "docid": "07d006a8a2a3d0becd96046419dcdce6", "score": "0.56806916", "text": "function rgb(r, g, b) \n{ return 'rgb('+clamp(Math.round(r),0,255)+', '+clamp(Math.round(g),0,255)+', '+clamp(Math.round(b),0,255)+')';}", "title": "" }, { "docid": "5a39284391e0a26731a00f5c12288dab", "score": "0.54928297", "text": "function rgb(r, g, b) \n{ \n\treturn 'rgb('+clamp(Math.round(r),0,255)+', '+clamp(Math.round(g),0,255)+', '+clamp(Math.round(b),0,255)+')';\n}", "title": "" }, { "docid": "5a39284391e0a26731a00f5c12288dab", "score": "0.54928297", "text": "function rgb(r, g, b) \n{ \n\treturn 'rgb('+clamp(Math.round(r),0,255)+', '+clamp(Math.round(g),0,255)+', '+clamp(Math.round(b),0,255)+')';\n}", "title": "" }, { "docid": "e52c75f0f999f5403140a37d7983308b", "score": "0.54847604", "text": "_clamped() {\n const {\n _a,\n _b,\n _c\n } = this.rgb();\n const {\n max,\n min,\n round\n } = Math;\n\n const format = v => max(0, min(round(v), 255));\n\n return [_a, _b, _c].map(format);\n }", "title": "" }, { "docid": "ec1206806206ed335186b76e9339422b", "score": "0.5458534", "text": "function changeRange100To255( val ){\n\t\tvar converted = ( val * 255 ) / 100;\n\t\treturn Math.floor( converted );\n\t}", "title": "" }, { "docid": "175020697f785be1e9987e6c31ba5dad", "score": "0.5403268", "text": "function generateARgbValue(){\n let rValue = Math.floor(Math.random() * 256);\n let gValue = Math.floor(Math.random() * 256);\n let bValue = Math.floor(Math.random() * 256);\n \n let rgbValue = `rgb(${rValue},${gValue},${bValue})`;\n\n return rgbValue; \n}", "title": "" }, { "docid": "07e7c8e41112223aa577d0ebbf7e8203", "score": "0.5379761", "text": "constructor(red, green, blue, alpha) {\n if (red < 0 || red > 255 || green < 0 || green > 255 || blue < 0 || blue > 255 || alpha < 0 || alpha > 1) {\n throw new RangeError(\"Out of range numbers\");\n }\n this.red = red;\n this.green = green;\n this.blue = blue;\n this.alpha = alpha;\n }", "title": "" }, { "docid": "a26b36fa19644863535deca5e3e5acf4", "score": "0.5373358", "text": "static RANGE_2_G() { return 0b00; }", "title": "" }, { "docid": "d0db5d5ce91671e0da99cef209045c53", "score": "0.5349633", "text": "function limitToRGB(val) {\n\tvar min = 0;\n\tvar max = 255;\n\tif (val >> max) debugLog(val + \" is higher than 255, so it's been limited to RGB Color Space\");\n\treturn val < min ? min : (val > max ? max : val);\n}", "title": "" }, { "docid": "ec6d72bbe9350fbca676a4c5fbc47ab2", "score": "0.5319924", "text": "function createPixels() {\n return new Array(8).fill(0x00000000)\n}", "title": "" }, { "docid": "1b33fe583ae2c847626280eba919c2d5", "score": "0.52464986", "text": "function makergb(r,g,b,a){\r\n var rgbString = \"rgba(\"+r+\",\"+g+\",\"+b+\",\"+a+\")\";\r\n return rgbString\r\n}", "title": "" }, { "docid": "54854dcf25667537ac32d0179813b69c", "score": "0.5176941", "text": "function makeRGBA(ignore, r, g, b) {\n return \"rgba(\" + parseInt(r, 16) + \",\" + parseInt(g, 16) + \",\" + parseInt(b, 16) + \",1)\";\n }", "title": "" }, { "docid": "76437596f5f94a464757c4abd20b8351", "score": "0.51724845", "text": "function clampTo8(i) { return i < 0 ? 0 : (i > 255 ? 255 : i); }", "title": "" }, { "docid": "095c04ddcb8b1af8529ae01ec953b833", "score": "0.51717776", "text": "function checkRGBBoundary(val) {\n if (val < 0) {\n return 0;\n } else if (val > 255) {\n return 255;\n } else {\n return val;\n }\n }", "title": "" }, { "docid": "0efb083e764aa29490f40f862b4aafb4", "score": "0.5167279", "text": "function rgb(r,g,b) {\n let hex = '';\n [r,g,b].forEach( num => {\n if(num === 0 || num < 0) {\n hex += '00'\n } else if(num > 255) {\n num = 255;;\n hex += num.toString(16).toUpperCase()\n } else if(num !== 0 && num < 16) {\n hex += '0' + num.toString(16).toUpperCase()\n }\n else {\n hex += num.toString(16).toUpperCase()\n }\n })\n return hex;\n }", "title": "" }, { "docid": "d1ba38fba38551c5f74dc7cc84b2aad1", "score": "0.51285964", "text": "function RgbaColor (r, g, b, a) {\n\n if (arguments.length === 1) {\n // hexadecimal input #112233\n b = parseInt(r.substr(5, 2), 16);\n g = parseInt(r.substr(3, 2), 16);\n r = parseInt(r.substr(1, 2), 16);\n a = 1;\n } else if (arguments.length === 3) {\n a = 1;\n }\n this.range = function (value, limit) {\n return (value < 0 ? 0 : (value > limit ? limit : value));\n };\n\n this.red = this.range(r, 255);\n this.green = this.range(g, 255);\n this.blue = this.range(b, 255);\n this.alpha = this.range(a, 1);\n\n this.validateColors = function() {\n this.red = this.range(r, 255);\n this.green = this.range(g, 255);\n this.blue = this.range(b, 255);\n alpha = this.range(a, 1);\n };\n\n this.getRed = function () {\n return this.red;\n };\n\n this.setRed = function (r) {\n this.red = this.range(r, 255);\n };\n\n this.getGreen = function () {\n return this.green;\n };\n\n this.setGreen = function (g) {\n this.green = this.range(g, 255);\n };\n\n this.getBlue = function () {\n return this.blue;\n };\n\n this.setBlue = function (b) {\n this.blue = this.range(b, 255);\n };\n\n this.getAlpha = function () {\n return this.alpha;\n };\n\n this.setAlpha = function (a) {\n this.alpha = this.range(a, 1);\n };\n\n this.getRgbaColor = function () {\n return 'rgba(' + this.red + ', ' + this.green + ', ' + this.blue + ', ' + this.alpha + ')';\n };\n\n this.getRgbColor = function () {\n return 'rgb(' + this.red + ', ' + this,green + ', ' + this.blue + ')';\n };\n\n this.getHexColor = function () {\n return '#' + this.red.toString(16) + this.green.toString(16) + this.blue.toString(16);\n };\n}", "title": "" }, { "docid": "ddbebb3587d55d0cc78f9b7a56eda844", "score": "0.51244843", "text": "convertColor(val) {\n if (!val) {\n return 'rgba(0,0,0,0)';\n }\n return tinycolor(val).toRgbString();\n }", "title": "" }, { "docid": "89562307c8f2640159d2df032aab1aa4", "score": "0.5114613", "text": "function RgbaColor() {\n\t this.R = 0;\n\t this.G = 0;\n\t this.B = 0;\n\t this.A = RgbaColor.maxComponent; // Default to fully opaque.\n\t }", "title": "" }, { "docid": "a5dea5281f940d2df3569e1f2d2c9961", "score": "0.51139665", "text": "function clamp(value) {\n\treturn Math.max(0, Math.min(Math.floor(value), 255))\n}", "title": "" }, { "docid": "6b325360ceea510d6cd4c299f09dbcf2", "score": "0.5109195", "text": "function rgb(r, g, b){\n if(r > 255){\n r = 255;\n }\n if(g > 255){\n g = 255;\n }\n if(b > 255){\n b = 255;\n }\n\n if(r < 0){\n r = 0;\n }\n if(g < 0){\n g = 0;\n }\n if(b < 0){\n b = 0;\n }\n r = Math.floor(r);\n g = Math.floor(g);\n b = Math.floor(b);\n return [\"rgb(\",r,\",\",g,\",\",b,\")\"].join(\"\");\n}", "title": "" }, { "docid": "3764717e67da7a6cf4f9e58464d398fd", "score": "0.50882256", "text": "toString(): string {\n const transformRgb = (value: number) => Math.round(value * 255 / this.a);\n const rgb = [this.r, this.g, this.b].map(transformRgb);\n return `rgba(${rgb.concat(this.a).join(',')})`;\n }", "title": "" }, { "docid": "12eef7ad1bdd2011270f04e550546fc5", "score": "0.5084486", "text": "function convertTimeToRGB(value, type){\n var max_val = type === 'hr' ? 12 : 60;\n return value * 255 / max_val;\n}", "title": "" }, { "docid": "e97720c3367d476f729400ffb652fa2e", "score": "0.50821185", "text": "function hex8(val) {\n\t\tvar n = val & 0xFF,\n\t\t str = n.toString(16).toUpperCase();\n\n\t\twhile (str.length < 2) {\n\t\t\tstr = \"0\" + str;\n\t\t}return str;\n\t}", "title": "" }, { "docid": "8070da29b0dddaa1180c330bc7a06540", "score": "0.5066795", "text": "function RgbaColor() {\n this.R = 0;\n this.G = 0;\n this.B = 0;\n this.A = RgbaColor.maxComponent; // Default to fully opaque.\n }", "title": "" }, { "docid": "4be84606dc76485e6c8f1fc2303cfc7d", "score": "0.5060195", "text": "function intToARGB(i) {\n var h = ((i >> 24) & 0xFF).toString(16) +\n ((i >> 16) & 0xFF).toString(16) +\n ((i >> 8) & 0xFF).toString(16) +\n (i & 0xFF).toString(16);\n return h.substring(0, 6);\n }", "title": "" }, { "docid": "7d9e4239dbaf3ab2875618687555f7c2", "score": "0.5054769", "text": "function rgba(r, g, b, a){\n return \"rgb(\"+r+\",\"+g+\",\"+b+\",\"+ ( a != null ? a : 1 ) +\")\";\n}", "title": "" }, { "docid": "32de12f794d5557b47485f9766b60d09", "score": "0.5006764", "text": "function _dec_to_rgb(value) {\r\n var hex_string = \"\";\r\n for (var hexpair = 0; hexpair < 3; hexpair++) {\r\n var myByte = value & 0xFF; // get low byte\r\n value >>= 8; // drop low byte\r\n var nybble2 = myByte & 0x0F; // get low nybble (4 bits)\r\n var nybble1 = (myByte >> 4) & 0x0F; // get high nybble\r\n hex_string += nybble1.toString(16); // convert nybble to hex\r\n hex_string += nybble2.toString(16); // convert nybble to hex\r\n }\r\n return hex_string.toUpperCase();\r\n}", "title": "" }, { "docid": "7dc4edb61864f62b6a1d90df2f99a977", "score": "0.4997395", "text": "function clamp(val) {\n\tif (val < 0) {\n\t\treturn 0;\n\t}\n\tif (val > 255) {\n\t\treturn 255;\n\t}\n\treturn val;\n}", "title": "" }, { "docid": "6bf5dff55106d37570afaec1a96d40be", "score": "0.49958497", "text": "function rgbToRRGGBB(rgb) {\r\n //rgb(0, 0, 0)\r\n //rgba(0, 0, 0, 0)\r\n var r, g, b;\r\n var values = rgb.split(\",\");\r\n if (values.length == 3 && values[0].length > 4 && values[0].substr(0, 4) == \"rgb(\") {\r\n r = decimalToTwoDigitHex(values[0].substr(4));\r\n g = decimalToTwoDigitHex(values[1]);\r\n b = decimalToTwoDigitHex(values[2].substr(0, values[2].length - 1));\r\n console.log(\"r:\" + r + \", g: \" + g + \", b: \" + b);\r\n if (r == null || g == null || b == null) {\r\n return null;\r\n }\r\n return \"#\" + r + g + b;\r\n } else if (rgb == \"rgba(0, 0, 0, 0)\") {\r\n return \"transparent\";\r\n } else {\r\n return rgb;\r\n }\r\n}", "title": "" }, { "docid": "6fb426ef0e8e2eec79d82862fd171c58", "score": "0.49794492", "text": "function rgb(r, g, b) {\r\n\tconst checkNumber = (number) => {\r\n\t\tif (number > 255) {\r\n\t\t\treturn 'FF';\r\n\t\t} else if (number < 0) {\r\n\t\t\treturn '00';\r\n\t\t} else if (number < 16) {\r\n\t\t\treturn '0' + number.toString(16).toUpperCase();\r\n\t\t} else {\r\n\t\t\treturn number.toString(16).toUpperCase();\r\n\t\t}\r\n\t};\r\n\treturn checkNumber(r) + checkNumber(g) + checkNumber(b);\r\n}", "title": "" }, { "docid": "755be65b84f91eb63ac000c49882ccd2", "score": "0.49628824", "text": "function writeRGB(valR, valG, valB){\n\treturn \"rgb(\" + valR + \", \" + valG + \", \" + valB + \")\";\n}", "title": "" }, { "docid": "61938d2f83fddec3e6beefb764e0dbb3", "score": "0.49537486", "text": "function intToARGB(i) {\n var hex = ((i>>24)&0xFF).toString(16) +\n ((i>>16)&0xFF).toString(16) +\n ((i>>8)&0xFF).toString(16) +\n (i&0xFF).toString(16);\n // Sometimes the string returned will be too short so we\n // add zeros to pad it out, which later get removed if\n // the length is greater than six.\n hex += '000000';\n return hex.substring(0, 6);\n}", "title": "" }, { "docid": "61938d2f83fddec3e6beefb764e0dbb3", "score": "0.49537486", "text": "function intToARGB(i) {\n var hex = ((i>>24)&0xFF).toString(16) +\n ((i>>16)&0xFF).toString(16) +\n ((i>>8)&0xFF).toString(16) +\n (i&0xFF).toString(16);\n // Sometimes the string returned will be too short so we\n // add zeros to pad it out, which later get removed if\n // the length is greater than six.\n hex += '000000';\n return hex.substring(0, 6);\n}", "title": "" }, { "docid": "085b9fb265299ef43f4bdec6a85b023e", "score": "0.49204567", "text": "function rgbaToArgbHex(r,g,b,a){var hex=[pad2(convertDecimalToHex(a)),pad2(mathRound(r).toString(16)),pad2(mathRound(g).toString(16)),pad2(mathRound(b).toString(16))];return hex.join(\"\");}// `equals`", "title": "" }, { "docid": "085b9fb265299ef43f4bdec6a85b023e", "score": "0.49204567", "text": "function rgbaToArgbHex(r,g,b,a){var hex=[pad2(convertDecimalToHex(a)),pad2(mathRound(r).toString(16)),pad2(mathRound(g).toString(16)),pad2(mathRound(b).toString(16))];return hex.join(\"\");}// `equals`", "title": "" }, { "docid": "085b9fb265299ef43f4bdec6a85b023e", "score": "0.49204567", "text": "function rgbaToArgbHex(r,g,b,a){var hex=[pad2(convertDecimalToHex(a)),pad2(mathRound(r).toString(16)),pad2(mathRound(g).toString(16)),pad2(mathRound(b).toString(16))];return hex.join(\"\");}// `equals`", "title": "" }, { "docid": "118d6430966fff179b80be7283ea85d8", "score": "0.4917151", "text": "function keepInBounds(num) {\nreturn ((num > 255) ? 255\n :(num < 0) ? 0\n :num);\n}", "title": "" }, { "docid": "e4500311a87adc5421222d2a720681cf", "score": "0.49135256", "text": "function glyph8(values, size) {\n var red = [255, 0, 0];\n var green = [0, 255, 0];\n var blue = [0, 0, 255];\n var white = [255, 255, 255];\n var colors = [red, green, blue, white, red, green, blue, white];\n stroke(0);\n fill(0);\n rect(0, 0, size, size);\n for(var i=0; i<8; i++) {\n stroke(colors[i]);\n fill(colors[i]);\n offsety = i * size / 8;\n offsetx = (size * values[i]) / 100;\n rect(0, offsety, offsetx, size/8);\n }\n}", "title": "" }, { "docid": "8879a0e3f4e927b17e01b523c7b3fc37", "score": "0.4912032", "text": "function rgb(r, g, b){\n let output = \"\";\n for ( let input of arguments) {\n if (input > 255) {input = 255;}\n if (input < 0) {input = 0;}\n let x = input.toString(16).toUpperCase();\n if (x.length === 1) {x = \"0\" + x}\n output += x;\n }\n return output;\n}", "title": "" }, { "docid": "87b55c83d95e2baf866bff5d7c8e7a92", "score": "0.4909783", "text": "function valueToPattern(value){\n let pattern = []\n for(let i=0;i<4;i++){\n let p = { r:0,g:0,b:0,a:255 }\n p.r = value & 4 ? 255 : 0 // red\n p.g = value & 2 ? 255 : 0 // green\n p.b = value & 1 ? 255 : 0 // blue\n pattern.push(p)\n value = value >> 3\n }\n return pattern \n}", "title": "" }, { "docid": "b35256e81295b15b8b31e231537addd7", "score": "0.49029437", "text": "function BF3ArrayToRGB(values) {\n return 'rgb(' + values.join(', ') + ')';\n}", "title": "" }, { "docid": "88da2c9f077fed215d2435d4312e77fd", "score": "0.4902388", "text": "function rgbStr(a) {return \"rgb(\" + a.r + \",\" + a.g + \",\" + a.b + \")\";}", "title": "" }, { "docid": "4fd16a9bf85e1bc035123fc29cac9731", "score": "0.4887995", "text": "function rgbBri(a) {return 0.2126*parseInt(a.r) + 0.7152*parseInt(a.g) + 0.0722*parseInt(a.b);}", "title": "" }, { "docid": "81f483c20443fcf92c3b559534778562", "score": "0.4886315", "text": "function rgb(r,g,b) {\n return 'rgb(' + [(r||0),(g||0),(b||0)].join(',') + ')';\n}", "title": "" }, { "docid": "a5395f1235af762d3894e360b606c7db", "score": "0.48735702", "text": "function num0x_to_sharp_string(val){\n\tvar str = val.toString(16);\n\tstr = '000000' + str;\n\tstr = str.substr(-6);\n\treturn '#' + str;\n}", "title": "" }, { "docid": "5a10fc85477a4f0b0f9b7636a77ffbaa", "score": "0.48709697", "text": "toRgbString() {\n const r = Math.round(this.r);\n const g = Math.round(this.g);\n const b = Math.round(this.b);\n return this.a === 1 ? `rgb(${r}, ${g}, ${b})` : `rgba(${r}, ${g}, ${b}, ${this.roundA})`;\n }", "title": "" }, { "docid": "3ee06eb62f4b4664cab225b2556c18fd", "score": "0.48707524", "text": "function generateRgbValue(arr) {\n\tvar rgbString = arr.join(', ');\n\treturn `rgb(${rgbString})`;\n}", "title": "" }, { "docid": "125b9be13acbc2bab96d80cf268b254c", "score": "0.4867251", "text": "function BlobColouring(dest, width, height, labels) {\n\tvar max = rect.width * rect.height;\n\tvar colors = [];\n\n\tvar maxcolors = Array.max(labels);\n\tvar maxcolors2 = maxcolors/2;\n\n\t// Create a simple color scale (I could do this in two loops but I'm lazy)\n\tfor (var i = 0; i <= maxcolors; i++) {\n\t\tvar r = i <= maxcolors2 ? 1 - (i / maxcolors2) : 0;\n\t\tvar g = i <= maxcolors2 ? i / maxcolors2 : 1 - ((i-maxcolors2) / maxcolors2);\n\t\tvar b = i <= maxcolors2 ? 0 : ((i-maxcolors2) / maxcolors2);\n\n\t\tcolors[i] = [r * 255, g * 255, b * 255];\n\t}\n\n\tvar offset = max - 1;\n\tvar destOffset = offset * 4;\n\tdo {\n\t\tvar l = labels[offset];\n\n\t\tvar color = l > 0 ? colors[ l ] : [0,0,0];\n\t\tdest[destOffset ] = color[0];\n\t\tdest[destOffset + 1] = color[1];\n\t\tdest[destOffset + 2] = color[2];\n\t\tdest[destOffset + 3] = 0xff; // Alpha\n\n\t\tdestOffset-=4;\n\n\t} while(offset--);\n\n}", "title": "" }, { "docid": "405f8847a8b54e8e407845a544f577c2", "score": "0.48526484", "text": "function createMask() {\n return crypto.getRandomValues(new Uint8Array(4));\n}", "title": "" }, { "docid": "2cf68eeeeeb5d442b598f74065809f9d", "score": "0.48211107", "text": "function genrgb() {\n var rgb = \"rgb\" + \"(\" + Math.floor(Math.random() * 255) + \", \" + Math.floor(Math.random() * 255);\n rgb = rgb + \", \" + Math.floor(Math.random() * 255) + \")\"\n return rgb;\n}", "title": "" }, { "docid": "7a36bad61aa9139fefae912c0f3331bb", "score": "0.4811633", "text": "function rgbToAEColor(rgbArray){\n var r = rgbArray[0]; var g = rgbArray[1]; var b = rgbArray[2];\n return [r/255,g/255,b/255];\n} // End rgbToAEColor() function", "title": "" }, { "docid": "f15f8e4a7a2ebd8203dc5833d7502e5d", "score": "0.48042312", "text": "function rgba(r,g,b,a) {\n return {\n r,\n g,\n b,\n a: a || 1\n }\n}", "title": "" }, { "docid": "5421d646cc596e541f836e68a44fb59c", "score": "0.4803417", "text": "function limit_alpha(){\n var d = get_gui_values_as_object();\n if (limit_alpha_number <3){ limit_alpha_number += 1; }else{ limit_alpha_number = 0; }\n var min_alpha_start; var max_alpha_start;\n var min_alpha_end; var max_alpha_end;\n var name;\n var x = limit_alpha_number;\n if (x==0){ min_alpha_start = 0; max_alpha_start = 255; min_alpha_end = 0; max_alpha_end = 255; name = \"alpha: start 0...255 end 0...255\" ;}\n else if (x==1){ min_alpha_start = 0; max_alpha_start = 127; min_alpha_end = 127; max_alpha_end = 255; name = \"alpha: start 0...127 end 127...255\" ;}\n else if (x==2){ min_alpha_start = 127; max_alpha_start = 255; min_alpha_end = 0; max_alpha_end = 127; name = \"alpha: start 127...255 end 0...127\" ;}\n else if (x==3){ min_alpha_start = 255; max_alpha_start = 255; min_alpha_end = 255; max_alpha_end = 255; name = \"alpha: start 255...255 end 255...255\" ;}\n \n d[\"alpha_start_min\"]=min_alpha_start;\n d[\"alpha_start_max\"]=max_alpha_start;\n d[\"alpha_end_min\"]=min_alpha_end;\n d[\"alpha_end_max\"]=max_alpha_end;\n // console.log(d);\n write_values(d);\n showme(name);\n}", "title": "" }, { "docid": "fdf1de2e0657e53de65f1182bac6b513", "score": "0.48020458", "text": "function blendColorValues(a, b)\n{\n c = new Array(((a[0] + b[0])/4) % 240, ((a[1] + b[1])/4) % 240, ((a[2]+b[2])/4) % 240);\n return c;\n}", "title": "" }, { "docid": "65f0abde9ac8555db6c4e41afd70ad0f", "score": "0.47993922", "text": "function fullColorString(clr, a) {\n return \"#\" + ((Math.ceil(a * 255) + 256).toString(16).substr(1, 2) +\n clr.toString().substr(1, 6)).toUpperCase();\n}", "title": "" }, { "docid": "62b9cd48f25153fd745a68d461c1275e", "score": "0.47993866", "text": "function rgb(r, g, b) {\n // complete this function\n let hexNum = [\"A\", \"B\", \"C\", \"D\", \"E\", \"F\"];\n let hexValue = \"\";\n let rgb = [r, g, b];\n rgb.forEach((n) => {\n if (n <= 0) hexValue += \"00\";\n else if (n >= 255) hexValue += \"FF\";\n else {\n let number = n / 16;\n let firstDigit = Math.floor(number);\n let secondDigit = (number - firstDigit) * 16;\n let firstNumber =\n firstDigit > 9\n ? hexNum[firstDigit - 10]\n : Math.floor(firstDigit).toString();\n let secondNumber =\n secondDigit > 9\n ? hexNum[secondDigit - 10]\n : Math.floor(secondDigit).toString();\n hexValue += firstNumber + secondNumber;\n }\n });\n console.log(hexValue);\n}", "title": "" }, { "docid": "2e2c83daa87c71c709233ae862846e85", "score": "0.478953", "text": "function packColour(r, g, b, a) {\n return (r<<24|g<<16|b<<8|a);\n }", "title": "" }, { "docid": "3f7242aee9c5ae8e21b321e3ccec3b70", "score": "0.4783422", "text": "function rgb(r, g, b){\n let str = '';\n\n for (let i = 0; i < arguments.length; i++) {\n if (arguments[i] < 0) {\n arguments[i] = 0;\n } else if (arguments[i] > 255) {\n arguments[i] = 255;\n }\n\n if (String(arguments[i]).length === 1) {\n str += '0' + arguments[i].toString(16);\n } else {\n str += arguments[i].toString(16);\n }\n }\n\n return str.toUpperCase();\n}", "title": "" }, { "docid": "5dbac8d9676c7463412739b49d334081", "score": "0.47829974", "text": "function fillBufferFormatVector() {\n\n let bufferFormat = [gfx.mojom.BufferFormat.RGBA_8888,\n gfx.mojom.BufferFormat.RGBA_8888,\n gfx.mojom.BufferFormat.RGBA_8888,\n gfx.mojom.BufferFormat.RGBA_8888,\n gfx.mojom.BufferFormat.RGBA_8888,\n gfx.mojom.BufferFormat.RGBA_8888];\n return bufferFormat;\n}", "title": "" }, { "docid": "293bf6b3a94d5094b448be11ae1e5ed9", "score": "0.4780674", "text": "function createRgbString () {\n\trgbString = 'RGB(';\n\tfor (var i = 0; 2 >= i; i++) {\n\t\trandomColor = Math.floor((Math.random() * 255) );\n\t\trgbString += randomColor;\n\t\tif (i !== 2){\n\t\t\trgbString += ', ';\n\t\t}else {\n\t\t\trgbString += ')'\n\t\t}\n\t}\n\treturn rgbString;\n}", "title": "" }, { "docid": "3c93f00600b47bcd970351eb36da3c8b", "score": "0.47778615", "text": "chroma_tmp(val) {\n this._chroma_tmp = val;\n return this;\n }", "title": "" }, { "docid": "eeeb5a86aba217a14968c8d54e6af366", "score": "0.4774424", "text": "function rgba(r, g, b, a) {\n r = Math.round(r)\n g = Math.round(g)\n b = Math.round(b)\n\n if (r < 0) {\n r = 0\n } else if (r > 255) {\n r = 255\n }\n if (g < 0) {\n g = 0\n } else if (g > 255) {\n g = 255\n }\n if (b < 0) {\n b = 0\n } else if (b > 255) {\n b = 255\n }\n if (a < 0) {\n a = 0\n } else if (a > 1) {\n a = 1\n }\n\n return `rgba(${r},${g},${b},${a})`\n }", "title": "" }, { "docid": "866242b0483e5e2407a13e02289ed423", "score": "0.47732207", "text": "innerRGB() {\n return `${this.r}, ${this.g}, ${this.b}`\n }", "title": "" }, { "docid": "0d3ea8e7eaeb789d516a866865879e9c", "score": "0.47675467", "text": "function rgbToHex(r, g, b, allow3Char) {\n\n\t var hex = [pad2(mathRound(r).toString(16)), pad2(mathRound(g).toString(16)), pad2(mathRound(b).toString(16))];\n\n\t // Return a 3 character hex if possible\n\t if (allow3Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1)) {\n\t return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);\n\t }\n\n\t return hex.join(\"\");\n\t }", "title": "" }, { "docid": "76c9c1356fcda92af6884e716b3edfa9", "score": "0.47652814", "text": "function rgbaToHex(r,g,b,a,allow4Char){var hex=[pad2(mathRound(r).toString(16)),pad2(mathRound(g).toString(16)),pad2(mathRound(b).toString(16)),pad2(convertDecimalToHex(a))];// Return a 4 character hex if possible\nif(allow4Char&&hex[0].charAt(0)==hex[0].charAt(1)&&hex[1].charAt(0)==hex[1].charAt(1)&&hex[2].charAt(0)==hex[2].charAt(1)&&hex[3].charAt(0)==hex[3].charAt(1)){return hex[0].charAt(0)+hex[1].charAt(0)+hex[2].charAt(0)+hex[3].charAt(0);}return hex.join(\"\");}// `rgbaToArgbHex`", "title": "" }, { "docid": "76c9c1356fcda92af6884e716b3edfa9", "score": "0.47652814", "text": "function rgbaToHex(r,g,b,a,allow4Char){var hex=[pad2(mathRound(r).toString(16)),pad2(mathRound(g).toString(16)),pad2(mathRound(b).toString(16)),pad2(convertDecimalToHex(a))];// Return a 4 character hex if possible\nif(allow4Char&&hex[0].charAt(0)==hex[0].charAt(1)&&hex[1].charAt(0)==hex[1].charAt(1)&&hex[2].charAt(0)==hex[2].charAt(1)&&hex[3].charAt(0)==hex[3].charAt(1)){return hex[0].charAt(0)+hex[1].charAt(0)+hex[2].charAt(0)+hex[3].charAt(0);}return hex.join(\"\");}// `rgbaToArgbHex`", "title": "" }, { "docid": "76c9c1356fcda92af6884e716b3edfa9", "score": "0.47652814", "text": "function rgbaToHex(r,g,b,a,allow4Char){var hex=[pad2(mathRound(r).toString(16)),pad2(mathRound(g).toString(16)),pad2(mathRound(b).toString(16)),pad2(convertDecimalToHex(a))];// Return a 4 character hex if possible\nif(allow4Char&&hex[0].charAt(0)==hex[0].charAt(1)&&hex[1].charAt(0)==hex[1].charAt(1)&&hex[2].charAt(0)==hex[2].charAt(1)&&hex[3].charAt(0)==hex[3].charAt(1)){return hex[0].charAt(0)+hex[1].charAt(0)+hex[2].charAt(0)+hex[3].charAt(0);}return hex.join(\"\");}// `rgbaToArgbHex`", "title": "" }, { "docid": "b90649ce106f9a4f96de6d3b3e4f317d", "score": "0.4760788", "text": "function rgbaToHex(r, g, b, a, allow4Char) {\n var hex = [\n pad2(Math.round(r).toString(16)),\n pad2(Math.round(g).toString(16)),\n pad2(Math.round(b).toString(16)),\n pad2(convertDecimalToHex(a)),\n ];\n // Return a 4 character hex if possible\n if (allow4Char &&\n hex[0].startsWith(hex[0].charAt(1)) &&\n hex[1].startsWith(hex[1].charAt(1)) &&\n hex[2].startsWith(hex[2].charAt(1)) &&\n hex[3].startsWith(hex[3].charAt(1))) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);\n }\n return hex.join('');\n }", "title": "" }, { "docid": "8425d2727bd3e7f5ec5f518fe179cc10", "score": "0.47578558", "text": "function rgbToFillStyle(channels)\n{\n return \"rgb(\" + channels[0] + \",\" + channels[1] + \",\" + channels[2] + \")\";\n}", "title": "" }, { "docid": "0c06b2cb0a70a6068af2dc3ea585f5e8", "score": "0.47515956", "text": "function rgbaToArgbHex(r, g, b, a) {\n var hex = [pad2(convertDecimalToHex(a)), pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16))];\n return hex.join(\"\");\n }", "title": "" }, { "docid": "031268f763ca6b9c1ec4b08248018556", "score": "0.47385207", "text": "function rgbaToHex(r, g, b, a, allow4Char) {\n var hex = [pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16)), pad2(convertDecimalToHex(a))];\n\n // Return a 4 character hex if possible\n if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);\n }\n return hex.join(\"\");\n }", "title": "" }, { "docid": "9549e414e26afcf316b38d4261eaa651", "score": "0.4736183", "text": "function rgbaToHex(r, g, b, a) {\n\n\t var hex = [\n\t pad2(convertDecimalToHex(a)),\n\t pad2(mathRound(r).toString(16)),\n\t pad2(mathRound(g).toString(16)),\n\t pad2(mathRound(b).toString(16))\n\t ];\n\n\t return hex.join(\"\");\n\t }", "title": "" }, { "docid": "9a973d738452c4798347b6d2b2666430", "score": "0.473594", "text": "function get1to255() {\n var arr = [];\n for (var i = 1;i<=255;i++) {\n arr.push(i);\n }\n return arr;\n}", "title": "" }, { "docid": "954bf3a884ba4e1d7126d2e54e31bc99", "score": "0.47329885", "text": "function rndClr(){\nreturn Math.ceil(Math.random() * 255);\n}", "title": "" }, { "docid": "b3687eca1c26e3b48b48b16da481b050", "score": "0.47316268", "text": "function rgbToHex(r, g, b, allow3Char) {\n var hex = [\n pad2(Math.round(r).toString(16)),\n pad2(Math.round(g).toString(16)),\n pad2(Math.round(b).toString(16)),\n ];\n // Return a 3 character hex if possible\n if (allow3Char &&\n hex[0].startsWith(hex[0].charAt(1)) &&\n hex[1].startsWith(hex[1].charAt(1)) &&\n hex[2].startsWith(hex[2].charAt(1))) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);\n }\n return hex.join('');\n }", "title": "" }, { "docid": "e1eb7ca2d1a4fb567961972d5e1af2e5", "score": "0.4730303", "text": "normalize8 (array) {\n return new Uint8ClampedArray(this.normalize(array, -0.5, 255.5))\n }", "title": "" }, { "docid": "adf4f8c8915a8d0fab3e6b41c86d7aa3", "score": "0.47292912", "text": "function $RGB(r, g, b){\n\treturn new Color([r, g, b], 'rgb');\n}", "title": "" }, { "docid": "ad104699875ffe5a1cecbcf59b371034", "score": "0.47271308", "text": "function rgbaToHex(r, g, b, a, allow4Char) {\n var hex = [\n pad2(Math.round(r).toString(16)),\n pad2(Math.round(g).toString(16)),\n pad2(Math.round(b).toString(16)),\n pad2(convertDecimalToHex(a)),\n ];\n // Return a 4 character hex if possible\n if (allow4Char &&\n hex[0].startsWith(hex[0].charAt(1)) &&\n hex[1].startsWith(hex[1].charAt(1)) &&\n hex[2].startsWith(hex[2].charAt(1)) &&\n hex[3].startsWith(hex[3].charAt(1))) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);\n }\n return hex.join('');\n}", "title": "" }, { "docid": "1dcc1224ac9d717f000bb04dcb2f5f15", "score": "0.47271064", "text": "function createRGB() {\r\n console.log(\"createRGB is firing\");\r\n // declare hexColor, set it equal to '#' at start (all hex colors need this)\r\n let rColor = '';\r\n let gColor = '';\r\n let bColor = '';\r\n\r\n // get random numbers between 0 and 255\r\n rColor += getRandomNumber();\r\n gColor += getRandomNumber();\r\n bColor += getRandomNumber();\r\n\r\n // combine RGB values\r\n let myRGBColor = 'rgb(' + rColor + ', ' + gColor + ', ' +\r\n bColor + ')';\r\n\r\n return myRGBColor;\r\n}", "title": "" }, { "docid": "f26f242657d4caf085f547e3e73539d0", "score": "0.47240058", "text": "function rgbToHex(r,g,b,allow3Char){var hex=[pad2(mathRound(r).toString(16)),pad2(mathRound(g).toString(16)),pad2(mathRound(b).toString(16))];// Return a 3 character hex if possible\nif(allow3Char&&hex[0].charAt(0)==hex[0].charAt(1)&&hex[1].charAt(0)==hex[1].charAt(1)&&hex[2].charAt(0)==hex[2].charAt(1)){return hex[0].charAt(0)+hex[1].charAt(0)+hex[2].charAt(0);}return hex.join(\"\");}// `rgbaToHex`", "title": "" }, { "docid": "f26f242657d4caf085f547e3e73539d0", "score": "0.47240058", "text": "function rgbToHex(r,g,b,allow3Char){var hex=[pad2(mathRound(r).toString(16)),pad2(mathRound(g).toString(16)),pad2(mathRound(b).toString(16))];// Return a 3 character hex if possible\nif(allow3Char&&hex[0].charAt(0)==hex[0].charAt(1)&&hex[1].charAt(0)==hex[1].charAt(1)&&hex[2].charAt(0)==hex[2].charAt(1)){return hex[0].charAt(0)+hex[1].charAt(0)+hex[2].charAt(0);}return hex.join(\"\");}// `rgbaToHex`", "title": "" }, { "docid": "f26f242657d4caf085f547e3e73539d0", "score": "0.47240058", "text": "function rgbToHex(r,g,b,allow3Char){var hex=[pad2(mathRound(r).toString(16)),pad2(mathRound(g).toString(16)),pad2(mathRound(b).toString(16))];// Return a 3 character hex if possible\nif(allow3Char&&hex[0].charAt(0)==hex[0].charAt(1)&&hex[1].charAt(0)==hex[1].charAt(1)&&hex[2].charAt(0)==hex[2].charAt(1)){return hex[0].charAt(0)+hex[1].charAt(0)+hex[2].charAt(0);}return hex.join(\"\");}// `rgbaToHex`", "title": "" }, { "docid": "8586a0ffc64b66c56183ff5f882b96ae", "score": "0.47235495", "text": "function rgbaToHex(r, g, b, a) {\n\n\t var hex = [pad2(convertDecimalToHex(a)), pad2(mathRound(r).toString(16)), pad2(mathRound(g).toString(16)), pad2(mathRound(b).toString(16))];\n\n\t return hex.join(\"\");\n\t }", "title": "" }, { "docid": "122b879a5fcaf3a0c00fd44275c3e73b", "score": "0.47218105", "text": "function rgbaToHex(r, g, b, a, allow4Char) {\n\n var hex = [\n pad2(mathRound(r).toString(16)),\n pad2(mathRound(g).toString(16)),\n pad2(mathRound(b).toString(16)),\n pad2(convertDecimalToHex(a))\n ];\n\n // Return a 4 character hex if possible\n if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);\n }\n\n return hex.join(\"\");\n}", "title": "" }, { "docid": "122b879a5fcaf3a0c00fd44275c3e73b", "score": "0.47218105", "text": "function rgbaToHex(r, g, b, a, allow4Char) {\n\n var hex = [\n pad2(mathRound(r).toString(16)),\n pad2(mathRound(g).toString(16)),\n pad2(mathRound(b).toString(16)),\n pad2(convertDecimalToHex(a))\n ];\n\n // Return a 4 character hex if possible\n if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);\n }\n\n return hex.join(\"\");\n}", "title": "" }, { "docid": "122b879a5fcaf3a0c00fd44275c3e73b", "score": "0.47218105", "text": "function rgbaToHex(r, g, b, a, allow4Char) {\n\n var hex = [\n pad2(mathRound(r).toString(16)),\n pad2(mathRound(g).toString(16)),\n pad2(mathRound(b).toString(16)),\n pad2(convertDecimalToHex(a))\n ];\n\n // Return a 4 character hex if possible\n if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);\n }\n\n return hex.join(\"\");\n}", "title": "" }, { "docid": "122b879a5fcaf3a0c00fd44275c3e73b", "score": "0.47218105", "text": "function rgbaToHex(r, g, b, a, allow4Char) {\n\n var hex = [\n pad2(mathRound(r).toString(16)),\n pad2(mathRound(g).toString(16)),\n pad2(mathRound(b).toString(16)),\n pad2(convertDecimalToHex(a))\n ];\n\n // Return a 4 character hex if possible\n if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);\n }\n\n return hex.join(\"\");\n}", "title": "" }, { "docid": "122b879a5fcaf3a0c00fd44275c3e73b", "score": "0.47218105", "text": "function rgbaToHex(r, g, b, a, allow4Char) {\n\n var hex = [\n pad2(mathRound(r).toString(16)),\n pad2(mathRound(g).toString(16)),\n pad2(mathRound(b).toString(16)),\n pad2(convertDecimalToHex(a))\n ];\n\n // Return a 4 character hex if possible\n if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);\n }\n\n return hex.join(\"\");\n}", "title": "" }, { "docid": "122b879a5fcaf3a0c00fd44275c3e73b", "score": "0.47218105", "text": "function rgbaToHex(r, g, b, a, allow4Char) {\n\n var hex = [\n pad2(mathRound(r).toString(16)),\n pad2(mathRound(g).toString(16)),\n pad2(mathRound(b).toString(16)),\n pad2(convertDecimalToHex(a))\n ];\n\n // Return a 4 character hex if possible\n if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);\n }\n\n return hex.join(\"\");\n}", "title": "" }, { "docid": "122b879a5fcaf3a0c00fd44275c3e73b", "score": "0.47218105", "text": "function rgbaToHex(r, g, b, a, allow4Char) {\n\n var hex = [\n pad2(mathRound(r).toString(16)),\n pad2(mathRound(g).toString(16)),\n pad2(mathRound(b).toString(16)),\n pad2(convertDecimalToHex(a))\n ];\n\n // Return a 4 character hex if possible\n if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);\n }\n\n return hex.join(\"\");\n}", "title": "" }, { "docid": "122b879a5fcaf3a0c00fd44275c3e73b", "score": "0.47218105", "text": "function rgbaToHex(r, g, b, a, allow4Char) {\n\n var hex = [\n pad2(mathRound(r).toString(16)),\n pad2(mathRound(g).toString(16)),\n pad2(mathRound(b).toString(16)),\n pad2(convertDecimalToHex(a))\n ];\n\n // Return a 4 character hex if possible\n if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);\n }\n\n return hex.join(\"\");\n}", "title": "" }, { "docid": "122b879a5fcaf3a0c00fd44275c3e73b", "score": "0.47218105", "text": "function rgbaToHex(r, g, b, a, allow4Char) {\n\n var hex = [\n pad2(mathRound(r).toString(16)),\n pad2(mathRound(g).toString(16)),\n pad2(mathRound(b).toString(16)),\n pad2(convertDecimalToHex(a))\n ];\n\n // Return a 4 character hex if possible\n if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);\n }\n\n return hex.join(\"\");\n}", "title": "" }, { "docid": "122b879a5fcaf3a0c00fd44275c3e73b", "score": "0.47218105", "text": "function rgbaToHex(r, g, b, a, allow4Char) {\n\n var hex = [\n pad2(mathRound(r).toString(16)),\n pad2(mathRound(g).toString(16)),\n pad2(mathRound(b).toString(16)),\n pad2(convertDecimalToHex(a))\n ];\n\n // Return a 4 character hex if possible\n if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);\n }\n\n return hex.join(\"\");\n}", "title": "" }, { "docid": "122b879a5fcaf3a0c00fd44275c3e73b", "score": "0.47218105", "text": "function rgbaToHex(r, g, b, a, allow4Char) {\n\n var hex = [\n pad2(mathRound(r).toString(16)),\n pad2(mathRound(g).toString(16)),\n pad2(mathRound(b).toString(16)),\n pad2(convertDecimalToHex(a))\n ];\n\n // Return a 4 character hex if possible\n if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);\n }\n\n return hex.join(\"\");\n}", "title": "" }, { "docid": "122b879a5fcaf3a0c00fd44275c3e73b", "score": "0.47218105", "text": "function rgbaToHex(r, g, b, a, allow4Char) {\n\n var hex = [\n pad2(mathRound(r).toString(16)),\n pad2(mathRound(g).toString(16)),\n pad2(mathRound(b).toString(16)),\n pad2(convertDecimalToHex(a))\n ];\n\n // Return a 4 character hex if possible\n if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);\n }\n\n return hex.join(\"\");\n}", "title": "" }, { "docid": "122b879a5fcaf3a0c00fd44275c3e73b", "score": "0.47218105", "text": "function rgbaToHex(r, g, b, a, allow4Char) {\n\n var hex = [\n pad2(mathRound(r).toString(16)),\n pad2(mathRound(g).toString(16)),\n pad2(mathRound(b).toString(16)),\n pad2(convertDecimalToHex(a))\n ];\n\n // Return a 4 character hex if possible\n if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);\n }\n\n return hex.join(\"\");\n}", "title": "" }, { "docid": "122b879a5fcaf3a0c00fd44275c3e73b", "score": "0.47218105", "text": "function rgbaToHex(r, g, b, a, allow4Char) {\n\n var hex = [\n pad2(mathRound(r).toString(16)),\n pad2(mathRound(g).toString(16)),\n pad2(mathRound(b).toString(16)),\n pad2(convertDecimalToHex(a))\n ];\n\n // Return a 4 character hex if possible\n if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);\n }\n\n return hex.join(\"\");\n}", "title": "" }, { "docid": "122b879a5fcaf3a0c00fd44275c3e73b", "score": "0.47218105", "text": "function rgbaToHex(r, g, b, a, allow4Char) {\n\n var hex = [\n pad2(mathRound(r).toString(16)),\n pad2(mathRound(g).toString(16)),\n pad2(mathRound(b).toString(16)),\n pad2(convertDecimalToHex(a))\n ];\n\n // Return a 4 character hex if possible\n if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);\n }\n\n return hex.join(\"\");\n}", "title": "" }, { "docid": "122b879a5fcaf3a0c00fd44275c3e73b", "score": "0.47218105", "text": "function rgbaToHex(r, g, b, a, allow4Char) {\n\n var hex = [\n pad2(mathRound(r).toString(16)),\n pad2(mathRound(g).toString(16)),\n pad2(mathRound(b).toString(16)),\n pad2(convertDecimalToHex(a))\n ];\n\n // Return a 4 character hex if possible\n if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);\n }\n\n return hex.join(\"\");\n}", "title": "" } ]
e285d1525d2a5a7998e3db38d3f5e7ed
DigitClassifier constructor, mirrors that of a NeuralNetwork, except output count is always
[ { "docid": "a93964b9778ee083839f3f686001a741", "score": "0.7888375", "text": "function DigitClassifier(inputCount, layers) {\r\n if (layers === void 0) { layers = []; }\r\n this.outputCount = layers.length > 0 ? layers[layers.length - 1].neuronCount : inputCount;\r\n this.neuralNetwork = new NeuralNetwork_1.NeuralNetwork(inputCount, layers);\r\n }", "title": "" } ]
[ { "docid": "67da17cc1dd5c8f3106a70764c4b8ad6", "score": "0.6347335", "text": "constructor(n,c) {\n this.weights = new Array (n);\n for (let i = 0; i < this.weights.length; i++) {\n this.weights[i] = random(-1, 1);\n }\n\n // this.inputs = [i0, i1];\n this.c = c; // learning rate/constant\n }", "title": "" }, { "docid": "7be6244a5ba346f5f8982c25f4989817", "score": "0.63443035", "text": "constructor(numberOfNeuronsInInputLayer, numberOfNeuronsInHiddenLayers, numberOfNeuronsInOutputLayer) {\n super(numberOfNeuronsInInputLayer, numberOfNeuronsInHiddenLayers, numberOfNeuronsInOutputLayer);\n\n //-------------------------------------------------------------------------------------------------\n // Hyper-parameters\n\n // the maximum number of learning examples the net uses when learning.\n this.maxLearningBatchSize = 100;\n\n //-------------------------------------------------------------------------------------------------\n // Internal variables\n\n // What the net learns from, input values paired with output values.\n this.learningExamples = [];\n }", "title": "" }, { "docid": "615837823eee3d30bf09c64057940b8a", "score": "0.6181976", "text": "constructor(numberOfNeuronsInInputLayer, numberOfNeuronsInHiddenLayers, numberOfNeuronsInOutputLayer) {\n // Hyper-parameters\n\n // The activation function that's applied to the hidden neurons.\n this.neuronActivation = Neuralt.Activations.LeakyReLU;\n\n // The activation function that's applied to the output neurons.\n this.outputNeuronActivation = Neuralt.Activations.LeakyReLU;\n\n //-------------------------------------------------------------------------------------------------\n // Internal variables\n\n // Two-dimensional array of neuron layers and neurons.\n this.neurons = [[]];\n\n // Total number of parameters in the whole neural network.\n this.numberOfParameters = 0;\n\n //-------------------------------------------------------------------------------------------------\n // Construct neural network\n\n // Input layer\n for (let a = 0; a < numberOfNeuronsInInputLayer; a++) {\n this.neurons[0].push(new Neuralt.InputNeuron());\n }\n\n // Hidden layers and output layer\n for (let a = 0; a < numberOfNeuronsInHiddenLayers.length + 1; a++) {\n this.neurons.push([]);\n let isOutputLayer = (a == numberOfNeuronsInHiddenLayers.length);\n for (let b = 0; b < (isOutputLayer ? numberOfNeuronsInOutputLayer : numberOfNeuronsInHiddenLayers[a]); b++) {\n this.neurons[this.neurons.length - 1].push(new Neuralt.Neuron(this.neurons[this.neurons.length - 2], isOutputLayer, this));\n }\n this.numberOfParameters += (this.neurons[a].length + 1) * this.neurons[a + 1].length;\n }\n }", "title": "" }, { "docid": "f86d7926c8d6e9ea124abca1ba54518d", "score": "0.6158026", "text": "constructor(a, b, c) { \n // a: number of input nodes - or another neural network object (in that case, we don't need to specify b and c)\n // b: list of number of hidden nodes in each layer (as many array elements, as many hidden layers there are)\n // c: number of output nodes \n if (a instanceof NeuralNetwork) {\n this.input_nodes = a.input_nodes;\n \n this.hidden_nodes = []; \n for (let i = 0; i < a.hidden_nodes.length; i++)\n this.hidden_nodes.push(a.hidden_nodes[i]);\n\n this.output_nodes = a.output_nodes;\n\n this.weights_ih = a.weights_ih.copy();\n this.weights_hidden = [];\n for (let i = 0; i < a.weights_hidden.length; i++)\n this.weights_hidden[i] = a.weights_hidden[i].copy();\n this.weights_ho = a.weights_ho.copy();\n\n this.bias_hidden = [];\n for (let i = 0; i < a.bias_hidden.length; i++)\n this.bias_hidden[i] = a.bias_hidden[i].copy();\n this.bias_o = a.bias_o.copy();\n }\n else {\n this.input_nodes = a;\n this.hidden_nodes = [];\n for (let i = 0; i < b.length; i++)\n this.hidden_nodes.push(b[i]);\n this.output_nodes = c;\n\n this.weights_ih = new Matrix(this.hidden_nodes[0], this.input_nodes);\n this.weights_hidden = [];\n for (let i = 0; i < this.hidden_nodes.length - 1; i++) {\n this.weights_hidden[i] = new Matrix(this.hidden_nodes[i+1], this.hidden_nodes[i]);\n this.weights_hidden[i].randomize();\n }\n this.weights_ho = new Matrix(this.output_nodes, this.hidden_nodes[this.hidden_nodes.length - 1]);\n this.weights_ih.randomize();\n this.weights_ho.randomize();\n\n this.bias_hidden = [];\n for (let i = 0; i < b.length; i++) {\n this.bias_hidden[i] = new Matrix(this.hidden_nodes[i], 1);\n this.bias_hidden[i].randomize();\n }\n\n this.bias_o = new Matrix(this.output_nodes, 1);\n this.bias_o.randomize();\n }\n\n // TODO: copy these as well\n this.setLearningRate();\n this.setActivationFunction();\n }", "title": "" }, { "docid": "f5ea676efb69fdd1363f060140e1ce85", "score": "0.6149677", "text": "constructor(in_nodes, hid_nodes, out_nodes) {\r\n if (in_nodes instanceof NeuralNetwork) {\r\n let a = in_nodes;\r\n this.input_nodes = a.input_nodes;\r\n this.hidden_nodes = a.hidden_nodes;\r\n this.output_nodes = a.output_nodes;\r\n\r\n this.weights_ih = a.weights_ih.copy();\r\n this.weights_ho = a.weights_ho.copy();\r\n\r\n this.bias_h = a.bias_h.copy();\r\n this.bias_o = a.bias_o.copy();\r\n } else {\r\n this.input_nodes = in_nodes;\r\n this.hidden_nodes = hid_nodes;\r\n this.output_nodes = out_nodes;\r\n\r\n this.weights_ih = new Matrix(this.hidden_nodes, this.input_nodes);\r\n this.weights_ho = new Matrix(this.output_nodes, this.hidden_nodes);\r\n this.weights_ih.randomize();\r\n this.weights_ho.randomize();\r\n\r\n this.bias_h = new Matrix(this.hidden_nodes, 1);\r\n this.bias_o = new Matrix(this.output_nodes, 1);\r\n this.bias_h.randomize();\r\n this.bias_o.randomize();\r\n }\r\n\r\n // TODO: copy these as well\r\n this.setLearningRate();\r\n this.setActivationFunction();\r\n\r\n\r\n }", "title": "" }, { "docid": "e77f86c767f59e1326911b7338fc5447", "score": "0.59965986", "text": "constructor(inputSize, hiddenSizes, outputSize, learnRate = null, momentum = null) {\n // error check\n if (!Number.isInteger(inputSize)) {\n throw new Error(\"inputSize is not an integer\");\n }\n if (!Array.isArray(hiddenSizes)) {\n throw new Error(\"hiddenSizes is not an array\");\n }\n if (!Number.isInteger(outputSize)) {\n throw new Error(\"outputSize is not an integer\");\n }\n if (learnRate !== null && typeof learnRate !== 'number') {\n throw new Error(\"learnRate is not null and not a number\");\n }\n if (learnRate !== null && typeof momentum !== 'number') {\n throw new Error(\"learnRate is not null and not a number\");\n }\n\n // constructor for 0 arguments\n if (arguments.length === 0) {\n this.learnRate = 0;\n this.momentum = 0;\n this.inputLayer = []; // list of Neurons\n this.hiddenLayers = [ [/* Neuron */ ] ]; // list of lists of Neurons\n this.outputLayer = []; // list of Neurons\n\n }\n // construtor with 5 arguments\n else {\n this.learnRate = learnRate === null ? 0.4 : learnRate;\n this.momentum = momentum === null ? 0.9 : momentum;\n this.inputLayer = []; // list of Neurons\n this.hiddenLayers = [ [/* Neuron */ ] ]; // list of lists of Neurons\n this.outputLayer = []; // list of Neurons\n\n for (var i = 0; i < inputSize; i++) {\n this.inputLayer.push(new Neuron());\n }\n\n var firstHiddenLayer = [];\n for (var i = 0; i < hiddenSizes[0]; i++) {\n firstHiddenLayer.push(new Neuron(this.inputLayer));\n }\n\n this.hiddenLayers.push(firstHiddenLayer);\n\n for (var i = 1; i < hiddenSizes.length; i++) {\n var hiddenLayer = []; // list of Neurons\n for (var j = 0; j < hiddenSizes[i]; j++) {\n hiddenLayer.push(new Neuron(this.hiddenLayers[i - 1]));\n }\n this.hiddenLayers.push(hiddenLayer);\n }\n\n for (var i = 0; i < outputSize; i++) {\n // TODO: can we assume hiddenLayers will always have at least one element in the array?\n var lastIndex = this.hiddenLayers.length - 1;\n this.outputLayer.push(new Neuron(this.hiddenLayers[lastIndex]));\n }\n }\n\n\n }", "title": "" }, { "docid": "e10325c38fc9eb7912c123925e221647", "score": "0.58770126", "text": "constructor(a, b, c) {\n // Copy an existing NN.\n if (a instanceof NeuralNetwork && !b) {\n this.input_nodes = a.input_nodes;\n this.hidden_nodes = a.hidden_nodes;\n this.output_nodes = a.output_nodes;\n\n this.weights_ih = a.weights_ih.copy();\n this.weights_ho = a.weights_ho.copy();\n\n this.bias_h = a.bias_h.copy();\n this.bias_o = a.bias_o.copy();\n\n this.setLearningRate(a.learning_rate);\n this.setActivationFunction(a.activation_function);\n } else if (a instanceof NeuralNetwork && b instanceof NeuralNetwork) {\n // Crossover with 2 parents.\n this.input_nodes = a.input_nodes;\n this.hidden_nodes = a.hidden_nodes;\n this.output_nodes = a.output_nodes;\n\n this.weights_ih = new Matrix(this.hidden_nodes, this.input_nodes);\n this.weights_ho = new Matrix(this.output_nodes, this.hidden_nodes);\n this.bias_h = new Matrix(this.hidden_nodes, 1);\n this.bias_o = new Matrix(this.output_nodes, 1);\n\n switch (c) {\n case \"1\":\n // 1 point crossover.\n this.onePointCrossover(a, b);\n break;\n case \"2\":\n // 2 point crossover.\n this.twoPointCrossover(a, b);\n break;\n default:\n // Uniform crossover.\n this.uniformCrossover(a, b);\n }\n\n if (random(1) < 0.5) {\n this.setLearningRate(a.learning_rate);\n } else {\n this.setLearningRate(b.learning_rate);\n }\n\n if (random(1) < 0.5) {\n this.setActivationFunction(a.activation_function);\n } else {\n this.setActivationFunction(b.activation_function);\n }\n this.setLearningRate(a.learning_rate);\n this.setActivationFunction(a.activation_function);\n } else {\n // New NN.\n this.input_nodes = a;\n this.hidden_nodes = b;\n this.output_nodes = c;\n\n this.weights_ih = new Matrix(this.hidden_nodes, this.input_nodes);\n this.weights_ho = new Matrix(this.output_nodes, this.hidden_nodes);\n this.weights_ih.randomize();\n this.weights_ho.randomize();\n\n this.bias_h = new Matrix(this.hidden_nodes, 1);\n this.bias_o = new Matrix(this.output_nodes, 1);\n this.bias_h.randomize();\n this.bias_o.randomize();\n\n this.setLearningRate();\n this.setActivationFunction();\n }\n }", "title": "" }, { "docid": "4f1869ea5804677833b0cfe2b12d12bc", "score": "0.5850702", "text": "function Network() {\n\n\t// Initialize layers\n\tthis.inputLayer = new Layer();\n\tthis.hiddenLayer1 = new Layer();\n\tthis.hiddenLayer2 = new Layer();\n\tthis.outputLayer = new Layer();\n\tthis.inputLayer.initialize(784, 16, LayerType.INPUT);\n\tthis.hiddenLayer1.initialize(16, 16, LayerType.HIDDEN);\n\tthis.hiddenLayer2.initialize(16, 10, LayerType.HIDDEN);\n\tthis.outputLayer.initialize(10, 0, LayerType.OUTPUT);\n\n\n\t/**\n\t* Accepts an input and propagates it forward through the network\n\t* @param inputs: An array containing the input values for the input layer\n\t* @return: An array containing the output values of the output layer\n\t*/\n\tthis.input = function(inputs) {\n\n\t\t// Activate the layers\n\t\tthis.inputLayer.activate(inputs, 0);\n\t\tthis.hiddenLayer1.activate(0, this.inputLayer);\n\t\tthis.hiddenLayer2.activate(0, this.hiddenLayer1);\n\t\tthis.outputLayer.activate(0, this.hiddenLayer2);\n\n\t\t// Return the output\n\t\tvar result = [];\n\t\tfor(var i = 0; i < this.outputLayer.neurons.length; i++) {\n\t\t\tresult.push(this.outputLayer.neurons[i].activation);\n\t\t}\n\t\treturn result;\n\t}\n\n\n\t/**\n\t* Gets the network's prediction for an input drawing\n\t* @param inputPixels: The 2D array of input pixels\n\t* @return: The network's prediction, confidence, and output values\n\t*/\n\tthis.getPrediction = function(inputPixels) {\n\t\t\n\t\t// The result object\n\t\tvar result = {\n\t\t\tdigit: 0,\n\t\t\tconfidence: 0,\n\t\t\toutputs: 0\n\t\t};\n\n\t\t// Get output from network\n\t\tvar out = this.input(inputPixels);\n\n\t\t// Get the network's prediction\n\t\tvar digit = 0;\n\t\tvar maxActivation = 0;\n\t for(var j = 0; j < 10; j++) {\n\t if(out[j] > maxActivation) {\n\t digit = j;\n\t maxActivation = out[j];\n\t }\n\t }\n\t result.digit = digit;\n\t result.confidence = maxActivation;\n\t result.outputs = out;\n\t \n\t return result;\n\t}\n}", "title": "" }, { "docid": "e5f63ddb458f35c28d0997f11e73ee60", "score": "0.58344924", "text": "constructor() {\n this.neurons = [];\n }", "title": "" }, { "docid": "3b39da577169c6c9427fd4a6d93a739d", "score": "0.5735028", "text": "async classify(inputString, limit = 10) {\n\n if (DEBUG) {\n console.log(inputString.match(/.{1,64}/g).join('\\n'));\n }\n\n if (this.session === null) {\n this.session = new InferenceSession();\n await this.session.loadModel(ONNX_FILE);\n }\n\n const inputArray = new Float32Array(inputString.split('').map(digit => (digit === '1' ? 1 : 0)));\n\n const inputTensor = new Tensor(inputArray, 'float32', [1, 1, 64, 64]);\n\n const outputMap = await this.session.run([inputTensor]);\n\n const rawValues = Array.from(outputMap.values())[0].data;\n\n // Trim off any \"nothing\" labels. They are all at the end of this.labels.\n // They are added as padding during training and the client is not interested in them.\n const nothingOut = ((_e, i) => (!(this.labels[i].startsWith('nothing'))));\n\n const trimmedValues = rawValues.filter(nothingOut);\n const trimmedLabels = this.labels.filter(nothingOut);\n\n // Implementation detail with this particular network- we need to compute softmax\n const exponents = trimmedValues.map(Math.exp);\n const exponentSum = exponents.reduce((acc, e) => acc + e, 0);\n const softmax = exponents.map(e => e / exponentSum);\n\n const valueByLabel = trimmedLabels.reduce((acc, e, i) => {\n acc[e] = softmax[i];\n return acc;\n }, {});\n\n const sortedLabels = trimmedLabels.sort((e1, e2) => valueByLabel[e2] - valueByLabel[e1]);\n // Return top ten\n const tags = sortedLabels.slice(0, limit).map((label => ({ label, value: valueByLabel[label] })));\n\n // Reassemble valueByLabel but sort the keys in descending value order\n const sortedValueByLabel = sortedLabels.reduce((acc, label) => {\n acc[label] = valueByLabel[label];\n return acc;\n }, {});\n\n const returnValue = { valueByLabel: sortedValueByLabel, tags };\n if (DEBUG) {\n console.log(`Classifier result: ${sortedLabels[0]}`);\n console.dir(returnValue);\n }\n return returnValue;\n }", "title": "" }, { "docid": "7c14dfca1743956c614bb42441a9cf31", "score": "0.5689527", "text": "function initialiser(){\n for(var i=0; i<nb_nodes; i++) {\n ensemble.add(i);\n }\n}", "title": "" }, { "docid": "b1f37d3e06be7cef8c60c36aa24af4d2", "score": "0.56801647", "text": "constructor(){\n // this.layerNumber=0;\n this.neurons=[];\n var n = new Neuron();\n this.addNeuron(n);\n// this.setLayerBias(Math.random() * 2 - 1);\n// this.setLayerBias(0);\n// console.log(\"LAYER BIAS\" + this.layerBias)\n }", "title": "" }, { "docid": "b2d96939d8005ec96191dadd53a6b968", "score": "0.5594205", "text": "constructor(params) {\n this.id = params.id;\n this.upper_length = params.upper_length;\n this.upper_width = params.upper_width;\n this.lower_length = params.lower_length;\n this.lower_width = params.lower_width;\n this.score = 0;\n this.fitness = 0;\n this.parents = [];\n this.colors = [];\n this.params = params;\n this.brain = new NeuralNetwork(4, 100, 2);\n \n\n this.init();\n }", "title": "" }, { "docid": "3457421b9550dbd902489da2a84e59b8", "score": "0.55736315", "text": "constructor(digits) {\n this.digits = digits;\n }", "title": "" }, { "docid": "3457421b9550dbd902489da2a84e59b8", "score": "0.55736315", "text": "constructor(digits) {\n this.digits = digits;\n }", "title": "" }, { "docid": "112144205f7a542e6c57ca160253162d", "score": "0.5566941", "text": "constructor() {\n /**\n * @type {Layer}\n */\n this.inputLayer;\n\n /**\n * @type {Layer[]}\n */\n this.hiddenLayers;\n\n /**\n * @type {Layer}\n */\n this.outputLayer;\n\n /** Represents the impact of errors over the back propagation */\n this.learningRate = 0.0001;\n\n /** Init parameters */\n this.initParams = [];\n\n /**\n * An array containing a reference to each layer of the network\n * @type {Layer[]}\n */\n this.layers = [];\n\n\n /**\n * The accuracy of the current nn\n * @type {Number}\n */\n this.currentAccuracy = 0;\n\n /**\n * The accuracy of the loaded nn settings\n * @type {Number}\n */\n this.saveAccuracy = 0;\n\n /**\n * The accuracy of the loaded nn settings\n * @type {Number}\n */\n this.randomRange = 10;\n\n }", "title": "" }, { "docid": "273360f407476929e5b0022fc7016a88", "score": "0.54981", "text": "trainNetwork(){\n\n for(var i = 0; i < neuralNet.trainingImages.length; i++){\n\n this.prepareTrainingSample(neuralNet.trainingImages[i]);\n neuralNet.feedForwardCycle();\n neuralNet.backpropagationCycle();\n console.log(this.findOutputNode());\n this.displayCurrentOutput(this.findOutputNode());\n }\n console.log(neuralNet);\n }", "title": "" }, { "docid": "8955e44f2fd64bd0ad13d3a2774e51f3", "score": "0.5488425", "text": "constructor(numberOfInputs, numberOfNeuronsInHiddenLayers, numberOfActions) {\n super(numberOfInputs, numberOfNeuronsInHiddenLayers, numberOfActions);\n\n //-------------------------------------------------------------------------------------------------\n // Hyper-parameters\n\n // How much of its previous experience it remembers\n // every time it gets new feedback.\n this.maxLearningBatchSize = 25;\n\n // How much the quality of the action after a certain action changes\n // the quality of that certain action.\n this.discountFactor = 0.99;\n\n // The maximum number of experiences it can remember.\n this.memoryLength = 100000;\n\n // The minimum probability of random actions.\n this.minExploration = 0.01;\n\n // The maximum probability of random actions.\n this.maxExploration = 1;\n\n // How much the probability of random actions decreases over time.\n this.explorationFactor = 0.995;\n\n // How much experiences that it can learn from more are prioritized.\n this.experiencePrioritization = 0.4;\n\n // Minimum prioritization of an experience.\n this.minExperiencePrioritization = 0.1;\n\n // How fast the decaying feedback average changes.\n this.averageFeedbackDecay = 0.999;\n\n // How often the target network is updated.\n this.targetNetworkUpdateFrequency = 20;\n\n //-------------------------------------------------------------------------------------------------\n // Internal variables\n\n // A decaying average of the feedback it gets.\n this.averageFeedback = undefined;\n\n this.updateCount = 0;\n\n // The number of outputs/action values the neural network generates.\n this.numberOfActions = numberOfActions;\n\n // The current probability of random actions.\n this.explorationRate = this.maxExploration;\n\n // New experience since the last time it got feedback.\n this.experienceSinceFeedback = [];\n\n // This is what it learns from. These experiences are stored automatically\n // when you give it feedback. It's a sum tree, to be able to efficiently\n // select experiences from a distribution, when prioritizing them.\n this.experience = [[0], []];\n\n // A neural network that is copied from this primary neural network every\n // targetNetworkUpdateFrequency update. It's used when calculating the target\n // outputs for this nn. This makes learning more stable, since the target\n // outputs don't always shift towards the current outputs (+ reward).\n this.targetNetwork = new Neuralt.NeuralNetwork(numberOfInputs, numberOfNeuronsInHiddenLayers, numberOfActions);\n }", "title": "" }, { "docid": "dda801c9fdc2a84328e0b73731dee522", "score": "0.5443255", "text": "function SimplePerceptronClassifier(learningRate_, numIterationsGD_) {\n this.learningRate_ = learningRate_;\n this.numIterationsGD_ = numIterationsGD_;\n }", "title": "" }, { "docid": "1f894e1c4f3170c35fa97c9740faf257", "score": "0.54277843", "text": "constructor (n, c) {\n this.weights = Array.from({length: n}, () => random(-1, 1));\n this.c = c;\n this.decay = 0.999;\n }", "title": "" }, { "docid": "f2162cd43e0f545f7ec70107b83a4871", "score": "0.54173106", "text": "function Neuron(numberOfInputs, isInputNeuron_, outputVal_) {\n if (isInputNeuron_ === void 0) { isInputNeuron_ = false; }\n if (outputVal_ === void 0) { outputVal_ = Math.random(); }\n this.isInputNeuron_ = isInputNeuron_;\n this.outputVal_ = outputVal_;\n this.weights_ = [];\n if (!this.isInputNeuron_)\n this.derivedOutputVal_ = Math.random();\n // The last weight is the constant summand, the threshold\n for (var i_1 = 0; i_1 <= numberOfInputs; ++i_1)\n this.weights_.push(Math.random());\n }", "title": "" }, { "docid": "9898ab0e6ae7aeedfc006b5970aa29bf", "score": "0.5383853", "text": "function Neuron() {\n\tthis.error = 0;\n\tthis.weightedSum = 0;\n\tthis.activation = 0;\n\tthis.bias = Math.random() * .2 - .1;\n\tthis.biasGradient = 0;\n}", "title": "" }, { "docid": "b4eed381236c5ad288a9eaf165ae5220", "score": "0.5366111", "text": "function train () {\n let values = training_data[training_index].split(','); // Grab a row from CSV\n let inputs = []; // Input array for the network\n for (let i = 1; i < values.length; i++)\n inputs[i - 1] = map (Number(values[i]), 0, 255, 0, 0.99) + 0.01; // Not so great to use input of 0 so add 0.01\n let targets = [];\n for (let i = 0; i < output_nodes; i++) // Everything is by default wrong\n targets[i] = 0.01;\n let label = Number(values[0]) // The first spot is the class\n targets[label] = 0.99; // So it should be 0.99\n neural_network.train(inputs, targets);\n training_index++;\n if (training_index == training_data.length) {\n training_index = 0;\n epochs++;\n }\n return inputs; // Return the inputs to draw them\n}", "title": "" }, { "docid": "62a49f72dbd7f4448d7e9e5ddf7fb3ae", "score": "0.53627235", "text": "function Layer(N, maker)\n{\n var that = this;\n\n // Constructor A\n\n if (N == null) { N = 0; }\n if (N < 0) { N = 0; }\n\n if (maker == null) { maker = ProcNeuron; }\n\n that.neurons = [];\n\n // Methods\n\n that.addNeuron = function(neuron)\n {\n that.neurons.push(neuron);\n return(neuron);\n };\n\n function makeNeuronByMaker(maker)\n {\n if (maker.makeNeuron != null) { return maker.makeNeuron(); }\n return new maker; // legacy mode, maker just a function\n }\n\n that.addNeurons = function(N, maker)\n {\n if (N <= 0) { return; }\n for (var i = 0; i < N; i++)\n {\n var theNeuron = makeNeuronByMaker(maker);\n that.addNeuron(theNeuron);\n }\n }\n\n that.addInputAll = function(inputLayer)\n {\n for (var i = 0; i < that.neurons.length; i++)\n {\n var neuron = dynamicCastProcNeuron(that.neurons[i]);\n if (neuron != null)\n {\n neuron.addInputAll(inputLayer.neurons);\n }\n }\n\n return(that);\n }\n\n // Constructor B\n\n that.addNeurons(N, maker);\n}", "title": "" }, { "docid": "59077955ab65dd1457b65ad76e1f412e", "score": "0.53517455", "text": "constructor(layers = [])\n {\n this.inputSize = layers[0];\n this.layers = [];\n\n let first = true;\n let lastLayer = 0;\n\n for (let layer of layers)\n {\n let l = [];\n\n for (let i = 0; i < layer; ++i)\n {\n l.push(new MLPNode(0, (first ? 0 : lastLayer)));\n }\n\n this.layers.push(l);\n\n first = false;\n lastLayer = layer;\n }\n }", "title": "" }, { "docid": "172a1f3c6a320f52a01c72663bc38faa", "score": "0.5344561", "text": "sendToNeuralNetTraining(pixelDensity) {\n var imageType = document.getElementById('trainingImageType');\n\n var trainingOutput = [];\n\n for(var i = 0; i < 10; i++){\n trainingOutput.push(0);\n }\n\n console.log(parseInt(imageType.value));\n trainingOutput[parseInt(imageType.value)] = 1;\n\n var trainingSample = [pixelDensity, trainingOutput];\n neuralNet.trainingImages.push(trainingSample);\n console.log(neuralNet.trainingImages);\n }", "title": "" }, { "docid": "9b31533d0453e5fdbc8d97df9303e2a9", "score": "0.5297089", "text": "function Layer() {\n\t\n\t/**\n\t* An array of Neuron objects that represent the neurons in this layer\n\t*/\n\tthis.neurons = [];\n\n\t/**\n\t* A 2D matrix that represents the weights between the neurons in this layer\n\t* and the next. It has the form weights[j][k], where j is a neuron\n\t* in the next layer, and k is a neuron in this layer, meaning that weights[j][k].value\n\t* is the value of the weight between the two neurons.\n\t*/\n\tthis.weights = [];\n\n\t/**\n\t* The type of layer this is. Possible values are input, hidden, and output\n\t*/\n\tthis.layerType;\n\n\n\t/**\n\t* Initializes the layer by creating neurons and assigning random weights & biases to them\n\t* @param size: The number of neurons in this layer\n\t* @param sizeNext: The number of neurons in the next layer\n\t* @param layerType: The LayerType enum specifying the type of layer (input, hidden, output)\n\t*/\n\tthis.initialize = function(size, sizeNext, layerType) {\n\t\t\n\t\t// Set layer type\n\t\tthis.layerType = layerType;\n\n\t\t// Create neurons\n\t\tfor(var i = 0; i < size; i++) {\n\t\t\tthis.neurons[i] = new Neuron();\n\t\t}\n\n\t\t/**\n\t\t* We only create weights for input and hidden layers. Output layers have no need\n\t\t* for weights since weights represent connections between neurons in this layer\n\t\t* and neurons in the next layer.\n\t\t*/\n\t\tif(this.layerType != LayerType.OUTPUT) {\n\t\t\tfor(var i = 0; i < sizeNext; i++) {\n\t\t\t\tthis.weights[i] = [];\n\t\t\t\tfor(var j = 0; j < size; j++) {\n\t\t\t\t\tthis.weights[i][j] = new Weight();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\n\t/**\n\t* Activates the neurons in this layer. The weighted sum and activation are calculated\n\t* and stored at each neuron, as they are needed now during forward propagation and\n\t* also later for backpropagation.\n\t* @param input: An array representing the inputs (only used for input layer)\n\t* @param prevLayer: The previous layer (used for all other layers)\n\t*/\n\tthis.activate = function(input, prevLayer) {\n\t\t\n\t\t/**\n\t\t* For input layer neurons, the weighted sum is simply the given input value.\n\t\t* We don't need to do any special calculations for it. The activation is done the\n\t\t* same was as other layers (sigmoid).\n\t\t*/\n\t\tif(this.layerType == LayerType.INPUT) {\n\t\t\tfor(var i = 0; i < input.length; i++) {\n\t\t\t\tthis.neurons[i].weightedSum = input[i];\n\t\t\t\tthis.neurons[i].activation = sigmoid(input[i]); // Equation 2\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t\n\t\t/**\n\t\t* For hidden and output layers, the weighted sum of a neuron is computed by multiplying the\n\t\t* activation of each neuron in the previous layer with its corresponding weight to the neuron.\n\t\t* The activation of each neuron is then calculated by applying the activation function (sigmoid) to \n\t\t* the weighted sum of that neuron.\n\t\t*/\n\t\tfor(var i = 0; i < this.neurons.length; i++) {\n\t\t\tthis.neurons[i].weightedSum = 0;\n\n\t\t\t// Equation 1\n\t\t\tfor(var j = 0; j < prevLayer.neurons.length; j++) {\n\t\t\t\tthis.neurons[i].weightedSum += prevLayer.neurons[j].activation * prevLayer.weights[i][j].value;\n\t\t\t}\n\n\t\t\t// Equation 2\n\t\t\tthis.neurons[i].activation = sigmoid(this.neurons[i].weightedSum + this.neurons[i].bias);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "5d6e8ad745f3ded206201b598d4cf7ff", "score": "0.5271252", "text": "constructor(inputs, outputs, hidden_layer_array, weights, bias)\n {\n\n hidden_layer_array.push(outputs);\n\n this.output_nodes = outputs;\n this.inputs_nodes = inputs;\n\n\n // Synaptic_Matrix.print(this.input_nodes);\n\n\n this.hidden = hidden_layer_array.length;\n\n let col = this.inputs_nodes;\n\n this.weights = [];\n\n if (weights === undefined)\n {\n for (let i = 0; i < hidden_layer_array.length; i++)\n {\n let row = hidden_layer_array[i];\n\n let weighted_array = new Synaptic_Matrix(row, col);\n weighted_array.randomize();\n\n this.weights.push(weighted_array);\n col = row;\n }\n }\n\n else\n {\n for (let i = 0; i < hidden_layer_array.length; i++)\n {\n let row = hidden_layer_array[i];\n\n let weighted_array = weights[i];\n\n this.weights.push(weighted_array);\n col = row;\n }\n\n // Synaptic_Matrix.print(this.weights[i]);\n }\n\n\n this.bias = [];\n\n if (bias === undefined)\n {\n for (let i = 0; i < hidden_layer_array.length; i++)\n {\n let layer_bias = new Synaptic_Matrix(hidden_layer_array[i], 1);\n layer_bias.randomize();\n\n this.bias.push(layer_bias);\n\n // Synaptic_Matrix.print(this.bias[i]);\n }\n }\n else\n {\n for (let i = 0; i < hidden_layer_array.length; i++)\n {\n let layer_bias = bias[i];\n\n this.bias.push(layer_bias);\n\n // Synaptic_Matrix.print(this.bias[i]);\n }\n }\n\n this.learning_rate = 0.1;\n }", "title": "" }, { "docid": "20f5bcdec5d45a8c04d953a201a38876", "score": "0.5251029", "text": "constructor()\n {\n this.training_dataset = [[[1, 0, 0, 0, 0], [1, 1, 1, 1, 1, 1, 0, 0]], [[0, 1, 0, 0, 0], [1, 1, 0, 0, 1, 0, 0, 0]], [[0, 0, 1, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 1, 0], [1,0,1,0,0,0,1,0]], [[0, 0, 0, 0, 1], [1, 0, 1, 0, 0, 1, 0, 0]],[[1,1,0,0,0],[1,0,1,1,1,1,0,0]],[[1,0,1,0,0],[1,1,0,1,1,1,0,1]]\n ];\n }", "title": "" }, { "docid": "23bf6cb3c339a1c85e60871bdeaf5b64", "score": "0.5236426", "text": "constructor(inputs, hiddenLayers, outputs) {\n this.layers = []; //Each element is a vector corresponding to the in/output\n //i.e. layers[0] is the inputs\n this.consts = []; //Each element is a vector corresponding to the\n //constants at the layer of the same index\n this.weights = []; //Each element is a matrix corresponding to the weights\n //of connections from the layer at the same index and\n //the next layer\n //i.e. weights[0] corresponds to the weights from\n // layers[0] to layers[1]\n\n //Set up inputs\n this.layers.push(new Matrix(inputs, 1, 1));\n //Set up hidden layers (we are using He initialization of weights)\n if (Array.isArray(hiddenLayers)) {\n for (let i = 0; i < hiddenLayers.length; i++) {\n this.layers.push(new Matrix(hiddenLayers[i], 1));\n this.consts.push(new Matrix(hiddenLayers[i], 1, 0));\n this.weights.push(new Matrix(this.layers[i+1].size(),\n this.layers[i].size())\n .randomize(2, Math.sqrt(2/this.layers[i].size())));\n }\n } else if (hiddenLayers > 0) {\n this.layers.push(new Matrix(hiddenLayers, 1));\n this.consts.push(new Matrix(hiddenLayers, 1, 0));\n this.weights.push(new Matrix(this.layers[1].size(),\n this.layers[0].size())\n .randomize(2, Math.sqrt(2/this.layers[0].size())));\n }\n //Set up outputs\n this.layers.push(new Matrix(outputs, 1));\n this.consts.push(new Matrix(outputs, 1, 0));\n let last = this.layers.length-1;\n this.weights.push(new Matrix(this.layers[last].size(),\n this.layers[last-1].size())\n .randomize(2, Math.sqrt(2/this.layers[last-1].size())));\n }", "title": "" }, { "docid": "77d7b45258e249d9e74eb5dbc93dbe82", "score": "0.5216377", "text": "function GenerateModel() {\n // 15 Input Nodes , 10 Nodes in hidden layer , 1 output\n model = new brain.NeuralNetwork({\n learningRate: 0.1,\n hiddenLayers: [10],\n activation: 'sigmoid',\n });\n}", "title": "" }, { "docid": "a6ff92d15c7e755691aab8777d06d798", "score": "0.5201143", "text": "nb_samples(val) {\n this._nb_samples = val;\n return this;\n }", "title": "" }, { "docid": "a6ff92d15c7e755691aab8777d06d798", "score": "0.5201143", "text": "nb_samples(val) {\n this._nb_samples = val;\n return this;\n }", "title": "" }, { "docid": "46bc9c8dc306f3b89f6b8fef76a31c2d", "score": "0.5199119", "text": "constructor(i_nodes, h_nodes, o_nodes){\n this.i_nodes = i_nodes;\n this.h_nodes = h_nodes;\n this.o_nodes = o_nodes;\n\n this.bias_ih = new Matrix(this.h_nodes,1); //Uma coluna de Nós\n this.bias_ih.randomize(); //Gera valores aleatorios a matrix\n this.bias_ho = new Matrix(this.o_nodes,1); //Uma coluna de Nós\n this.bias_ho.randomize();\n\n //this.bias_ih.print(); //Exibe os BIAS da entrada ao oculto\n //this.bias_ho.print(); //Exibe o BIAS do oculto a saida\n\n\n //Criando os pesos/arestas da Rede, cada linha equivale ao nós seguintes\n //e cada coluna equivale aos pesos\n this.weights_ih = new Matrix(this.h_nodes, this.i_nodes); \n this.weights_ih.randomize();\n\n this.weights_ho = new Matrix(this.o_nodes, this.h_nodes);\n this.weights_ho.randomize();\n\n this.learning_rate = 0.1; //10% de Aprendizado\n\n }", "title": "" }, { "docid": "8e8ada75512f7e26e6781a495882c85a", "score": "0.51954836", "text": "buildLayers(){\r\n this.layers = []\r\n this.topology.forEach(layer => this.layers.push([]))\r\n \r\n this.topology.forEach((layerSize, iLayer) => {\r\n let layer = this.layers[iLayer],\r\n prevLayer = this.layers[iLayer - 1] || undefined,\r\n nextLayer = this.layers[iLayer + 1] || undefined\r\n \r\n for (let i of Array(layerSize).keys()){\r\n layer.push(new Neuron(prevLayer, nextLayer, layer, \"\"+iLayer+i))\r\n }\r\n \r\n let neuronBias = new Neuron(prevLayer, nextLayer, layer, \"\"+iLayer+(layer.length) )\r\n neuronBias.isBias = true\r\n neuronBias.outputVal = 1\r\n \r\n layer.push(neuronBias)\r\n })\r\n \r\n this.layers\r\n .slice(0,this.layers.length - 1)\r\n .forEach(layer => {\r\n layer.forEach(neuron => neuron.buildConnections())\r\n })\r\n }", "title": "" }, { "docid": "b0fc4f3f432054f0a1da45dd920c4d45", "score": "0.5133957", "text": "function communityRepresentation() {\n\nfunction convertToBinaryArray(coordinates) {\n\n\"use strict\";\n var coordInBinary = coordiates.toString(2); \n \n if(coordInBinary.length > 7) {\n return [1,1,1,1,1,1,1,1];\n\n }\n \n while(coordInBinary.length < 7) { \n coordInBinary = \"0\" + coordInBinary;\n }\n \n // Convert string to array\n return coordInBinary.split(\"\").map(function(i) {\n return parseInt(i); }\n );\n}\n\nvar predictr = new synaptic.Architect.Perceptron(\n\n/* Remember to change numbers of neurons. */\n 7, \n 3,\n 3, \n 0\n);\n\nvar trainingData = [];\n\nvar i;\n\nvar input;\n\nvar output;\n\n/* Add training data here. */\ninput = [0,0,0,0,0,0,0,1];\noutput = [1];\n \n trainingData.push({\n input: input,\n output: output\n });\n}", "title": "" }, { "docid": "9f2d7bcd614160fc05e20a5c38bd4668", "score": "0.5128408", "text": "function init(){\n network = [];\n netindex = new Int32Array(256);\n bias = new Int32Array(networkSize);\n freq = new Int32Array(networkSize);\n radpower = new Int32Array(networkSize >> 3);\n\n for(let i = 0; i < networkSize; i++){\n const v = (i << (netbiasshift + 8)) / networkSize;\n network[i] = new Float64Array([v, v, v, 0]);\n freq[i] = intbias / networkSize;\n bias[i] = 0;\n }\n }", "title": "" }, { "docid": "af17a744e20e4b70b272d6fce9e966b4", "score": "0.5112443", "text": "function Network(){\n\tthis.model = null;\n\t//Creates the model\n\tthis.getModel = function() {\n\t\txs = tf.input({shape: [20, 10, 2]});\n\t\tx = tf.layers.flatten({}).apply(xs);\n\t\tx = tf.layers.dense({units:190, activation:'relu', kernelInitializer:'randomUniform'}).apply(x);\n\t\t//x = tf.layers.dropout({rate: 0.1}).apply(x);\n\t\tx = tf.layers.dense({units:150, activation:'relu', kernelInitializer:'randomUniform'}).apply(x);\n\t\t//x = tf.layers.dropout({rate: 0.1}).apply(x);\n\t\tx = tf.layers.dense({units:100, activation:'relu', kernelInitializer:'randomUniform'}).apply(x);\n\t\t//x = tf.layers.dropout({rate: 0.1}).apply(x);\n\t\tx = tf.layers.dense({units:80, activation:'relu', kernelInitializer:'randomUniform'}).apply(x);\n\t\t//x = tf.layers.dropout({rate: 0.1}).apply(x);\n\t\tx = tf.layers.dense({units:60, activation:'relu', kernelInitializer:'randomUniform'}).apply(x);\n\t\t//x = tf.layers.dropout({rate: 0.1}).apply(x);\n\t\tx = tf.layers.dense({units:40, activation:'relu', kernelInitializer:'randomUniform'}).apply(x);\n\t\t//x = tf.layers.dropout({rate: 0.1}).apply(x);\n\t\tx = tf.layers.dense({units:20, activation:'relu', kernelInitializer:'randomUniform'}).apply(x);\n\t\t//x = tf.layers.dropout({rate: 0.1}).apply(x);\n\t\tx = tf.layers.dense({units:10, activation:'relu', kernelInitializer:'randomUniform'}).apply(x);\n\t\t//x = tf.layers.dropout({rate: 0.1}).apply(x);\n\t\tx = tf.layers.dense({units:4, activation:'softmax'}).apply(x);\n\t\tmasks = tf.input({shape: [4]});\n\t\tpredictions = tf.layers.multiply().apply([x,masks]);\n\t\t\n\t\tmodel = tf.model({inputs:[xs,masks], outputs:predictions});\n\t\t\n\t\treturn model;\n\t}\n\tthis.model = this.getModel();\n\t\n\t//Runs the training\n\t//Takes inputs, targets, and masks for training\n\tthis.train = async function(xs, ys, masks){\n\t\t\n\t\tconst optimizer = 'adam';\n\t\t\n\t\tthis.model.compile({\n\t\t\toptimizer,\n\t\t\tloss: 'categoricalCrossentropy',\n\t\t\tmetrics: ['accuracy'],\n\t\t});\n\t\t\n\t\tconst batchSize = 50;\n\t\t\n\t\tconst trainEpochs = 1;\n\t\t\n\t\tlet trainBatchCount = 0;\n\t\t\n\t\tconst totalNumBatches =\n\t\t\tMath.ceil(xs.length / batchSize) *\n\t\t\ttrainEpochs;\n\t\tawait this.model.fit([tf.tensor(xs), tf.tensor(masks)], tf.tensor(ys), {\n\t\t\tbatchSize,\n\t\t\tepochs: trainEpochs,\n\t\t\tshuffle : true,\n\t\t\tcallbacks: {\n\t\t\t\tonBatchEnd: async (batch, logs) => {\n\t\t\t\t\ttrainBatchCount++;\n\t\t\t\t\tlet training = document.getElementById(\"training\");\n\t\t\t\t\ttraining.textContent = \"Training: \"+Math.floor(((trainBatchCount)/totalNumBatches) * 100) + ' %';\n\t\t\t\t\tlet loss = document.getElementById(\"Loss\");\n\t\t\t\t\tloss.textContent = \"Loss: \"+(logs.loss).toFixed(9);\n\t\t\t\t\tlet acc = document.getElementById(\"Acc\");\n\t\t\t\t\tacc.textContent = \"Acc: \"+(logs.loss).toFixed(9);\n\t\t\t\t\tawait tf.nextFrame();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\t\n\t//Run the neural network on the input to get an output\n\t//Takes an input, an array (a squashed matrix with a vector stuck on the end)\n\t//\tof the tetris grid, and shape position and type, etc.\n\t//Returns an array of four, with values telling the preference for each possible move\n\tthis.predict = function(input) {\n\t\treturn tf.tidy(() => {\n\t\t\tlet output = this.model.predict([tf.tensor([input]), tf.tensor([[1,1,1,1]]) ]);\n\t\t\toutput = Array.from(output.dataSync())\n\t\t\treturn output;\n\t\t});\n\t}\n}", "title": "" }, { "docid": "7153dd703fc342c3ebf0e93706157d55", "score": "0.5092524", "text": "function classify() {\n // Get the total number of labels from knnClassifier\n const numLabels = knnClassifier.getNumLabels();\n if (numLabels <= 0) {\n console.error(\"There is no examples in any label\");\n return;\n }\n // Convert poses results to a 2d array [[score0, x0, y0],...,[score16, x16, y16]]\n const poseArray = poses[0].pose.keypoints.map(p => [p.score, p.position.x, p.position.y]);\n\n // Use knnClassifier to classify which label do these features belong to\n // You can pass in a callback function `gotResults` to knnClassifier.classify function\n knnClassifier.classify(poseArray, gotResults);\n}", "title": "" }, { "docid": "56ad0b7f398cf8c52342655a01e00ba1", "score": "0.504496", "text": "function TrainingData( input, output ){\n\tthis.input = input;\n\tthis.output = output;\n}", "title": "" }, { "docid": "551fbb621895e96bcd5599618bf62854", "score": "0.5020696", "text": "train() {\n // it's possible that we'll never come across appropriate values for m and b\n for (let i = 0; i < this.options.iterations; i++) {\n this.gradientDescent()\n }\n }", "title": "" }, { "docid": "1853400961f11dfdfd84ffad515c182f", "score": "0.5017579", "text": "addNeuron(n) {\n this.neurons.push(n);\n }", "title": "" }, { "docid": "8850584cedfa637672b0fb795e6769bf", "score": "0.50062555", "text": "constructor(inputs, outputs, options) {\n super();\n if (inputs === true) {\n // reloading model\n this.coefficients = _mlMatrix.Matrix.columnVector(outputs.coefficients);\n this.order = outputs.order;\n if (outputs.r) {\n this.r = outputs.r;\n this.r2 = outputs.r2;\n }\n if (outputs.chi2) {\n this.chi2 = outputs.chi2;\n }\n } else {\n options = Object.assign({}, defaultOptions, options);\n this.order = options.order;\n this.coefficients = [];\n this.X = inputs;\n this.y = outputs;\n\n this.train(this.X, this.y, options);\n }\n }", "title": "" }, { "docid": "f7505687f035dbca42b85824ac22ad4e", "score": "0.4954053", "text": "constructor(inputSize, hiddenSize, outputSize, bias = 1) {\r\n this.inputSize = inputSize;\r\n this.hiddenSize = hiddenSize;\r\n this.outputSize = outputSize;\r\n this.bias = bias;\r\n\r\n // Weights\r\n this.w1 = nj.random([this.inputSize + 1, this.hiddenSize]).multiply(2).subtract(1);\r\n this.w2 = nj.random([this.hiddenSize, this.outputSize]).multiply(2).subtract(1);\r\n\r\n }", "title": "" }, { "docid": "9ee4b462d597059a901222ba28ca8502", "score": "0.4929215", "text": "Copy() {\n return new NeuralNetwork(this);\n }", "title": "" }, { "docid": "340ec54021f7072861b873570316d6a1", "score": "0.4922178", "text": "function addData(v, className) {\n const logits = ml5Features.infer(v);\n knn.addExample(logits, className);\n const totalImage = knn.getCount();\n imageCounter1.innerText = `${totalImage[0] ? totalImage[0] : 0}/ minimum 10`;\n imageCounter2.innerText = `${totalImage[1] ? totalImage[1] : 0}/ minimum 10`;\n}", "title": "" }, { "docid": "72dfafdf60d1c2387e76d57d9f6fd2f7", "score": "0.49092922", "text": "function countKNN() {\n var cat = [[0,'Iris-setosa'],[0,'Iris-versicolor'],[0,'Iris-virginica']]; //define possible class and counter\n //var counter = [0,0,0]; //counter for k \n var k = 5; //define nearest neighbor \n var correct = 0; //for count the accuracy \n for(var i = 0; i < alldata2.length; i++) {\n\n //initialize \n for(var x = 0; x < cat.length; x++) {\n cat[x][0] = 0;\n }\n\n console.log(i);\n for(var j = 0; j < alldata.length; j++) {\n var totalEuc = 0; \n \n for(var x = 0; x < dimension-1; x++) {\n if(x == 99) { //data w/ nominal type ! \n if(alldata2[i][x] == alldata[j][x]) {\n totalEuc = totalEuc + 0; \n //console.log(\"yey sama\");\n } else {\n totalEuc = totalEuc + 2;\n //console.log(\"yey beda\");\n }\n \n } else {\n totalEuc = totalEuc + Math.pow(alldata2[i][x]-alldata[j][x],2);\n }\n }\n\n var fixEuc = Math.sqrt(totalEuc);\n alldata[j][dimension] = fixEuc;\n //console.log(fixEuc);\n }\n\n console.log(\"AFTER SORT\");\n //sort ascending by euclidean distance value \n alldata.sort(function(a,b) {\n return a[dimension] - b[dimension];\n });\n\n // for(var x = 0; x < alldata.length; x++) {\n // console.log(alldata[x][dimension]);\n // }\n \n //count detected class\n for(var x = 0; x < k; x++) {\n for(var y = 0; y < cat.length; y++) {\n console.log(alldata[x][dimension-1]);\n if(alldata[x][dimension-1] == cat[y][1]) {\n cat[y][0]++;\n } \n }\n }\n\n //sort detected class descending\n cat.sort(function(a,b) {\n return b[0] - a[0];\n });\n\n //check if prediction = actual condition\n if(alldata2[i][dimension-1] == cat[0][1]) {\n correct++;\n }\n }\n\n //count the accuracy\n var accuracy = correct / alldata2.length * 100; \n console.log(accuracy);\n}", "title": "" }, { "docid": "e8d67235311b132661d17af7e6d7f8b0", "score": "0.4899106", "text": "constructor(features, labels, options) {\n // and initial set up of our class (traditionally) w/ feature set, labels, and relevant options for running this algo\n // we're assuming that when features and labels are passed in, that they will already be tensorflow tensors\n this.features = features\n this.labels = labels\n // and we'll also process the options\n this.options = Object.assign(\n {\n // here we can add default values - to make sure there's always a value provided for crucial components\n learningRate: 0.1,\n // specify maximum number of times we want to run our GDesc algo\n iterations: 1000\n },\n options\n )\n\n // create initial guesses for m & b\n this.m = 0\n this.b = 0\n }", "title": "" }, { "docid": "73910bd1809b38a3dc312634cd624ae6", "score": "0.48884767", "text": "function train(allInputs){\n shuffle(allInputs, true);\n for(let i = 0; i < allInputs.length; i++){\n let input = allInputs[i];\n // print(input);\n\n //Taking labels from JSON\n let bladeStartIndex = trainLabel.pixelIndices[i].BladeStart/(width * width);\n let bladeEndIndex = trainLabel.pixelIndices[i].BladeEnd/(width * width);\n\n\n let targets = [];\n targets.push(bladeStartIndex);\n targets.push(bladeEndIndex);\n\n nn.train(input, targets);\n // canvasImage.updatePixels();\n }\n}", "title": "" }, { "docid": "26315ee38ebaae71e23d92af110123d2", "score": "0.48859575", "text": "function Layer() {\n this.units=0;\n this.output;\n this.err;\n this.weight;\n this.dweight;\n}", "title": "" }, { "docid": "13b44c3646d9dfca5eeb2fd53ad76b80", "score": "0.4871208", "text": "function classify() {\n // Get the total number of labels from knnClassifier\n const numLabels = knnClassifier.getNumLabels();\n if (numLabels <= 0) {\n console.error('There are no examples in any label');\n return;\n }\n // check if we have data returned from handpose\n console.log(predictions[0]);\n if (predictions[0] != undefined) {\n const prediction = predictions[0].scaledMesh;\n // Use knnClassifier to classify which label do these features belong to\n // You can pass in a callback function `gotResults` to knnClassifier.classify function\n knnClassifier.classify(prediction, gotResults);\n } else {\n loopBroken = true;\n }\n}", "title": "" }, { "docid": "48cc9ae063260e450af55dbf0c9908bc", "score": "0.48692808", "text": "function Villein(id, n){\n\t\t// Create the canvas\n\t\tthis.canvas = $(id).append('<canvas width=200 height=200 class=\"villein-digit\"></canvas>').children(\".villein-digit\")[0];\n\n\t\t// Create context\n\t\tthis.context = this.canvas.getContext(\"2d\");\n\n\t\t// Create the internal digit structure\n\t\tthis.connections = [];\n\n\t\t// Sets digit\n\t\tthis.setDigit = function(num){\n\t\t\t\t// Find number in base four, convert it to array\n\t\t\t\tnum = (\"\"+_.toFour(num)).split(\"\");\n\n\t\t\t\t// Clear the canvas\n\t\t\t\tthis.context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n\n\t\t\t\t// Determine the spaces inbetween dots\n\t\t\t\tvar step = this.canvas.height/4;\n\n\t\t\t\t// Draw the circles and record their locations\n\t\t\t\tfor (var x = 0; x < 5; x++){\n\t\t\t\t\t\tfor (var y = 0; y < 5; y++){\n\t\t\t\t\t\t\t\t// Draw the circle\n\t\t\t\t\t\t\t\tthis.context.beginPath();\n\t\t\t\t\t\t\t\tthis.context.arc(x*step, y*step, 15, 0, Math.PI*2);\n\t\t\t\t\t\t\t\tthis.context.fillStyle = \"#4d91ff\";\n\t\t\t\t\t\t\t\tthis.context.fill();\n\t\t\t\t\t\t\t\tthis.context.closePath();\n\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Find the line length\n\t\t\t\tvar length = this.canvas.width/4;\n\n\t\t\t\t// Temporary variables\n\t\t\t\tvar loc, line;\n\n\t\t\t\t// For jQuery\n\t\t\t\tvar self = this;\n\n\t\t\t\t// Reverse digits for computational ease\n\t\t\t\tnum.reverse();\n\n\t\t\t\t// For each digit, draw the connections\n\t\t\t\t$.each(num, function(i, digit){\n\t\t\t\t\t\t// Convert the digit string into number\n\t\t\t\t\t\tdigit *= 1;\n\n\t\t\t\t\t\t// Find the location of the digit\n\t\t\t\t\t\tloc = _.digitLocations[i];\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Find the digit pattern\n\t\t\t\t\t\tpattern = _.structures[digit - 1];\n\n\t\t\t\t\t\t// Draw a line for each connection\n\t\t\t\t\t\t$.each(pattern, function(j, direction){\n\t\t\t\t\t\t\t\tstart = {\n\t\t\t\t\t\t\t\t\t\tx : loc[0]*length,\n\t\t\t\t\t\t\t\t\t\ty : loc[1]*length\n\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t\tend = {\n\t\t\t\t\t\t\t\t\t\tx : start.x + direction[0]*length,\n\t\t\t\t\t\t\t\t\t\ty : start.y + direction[1]*length\n\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t\t// Draw the line\n\t\t\t\t\t\t\t\tself.context.beginPath();\n\t\t\t\t\t\t\t\tself.context.moveTo(start.x, start.y);\n\t\t\t\t\t\t\t\tself.context.lineTo(end.x, end.y);\n\t\t\t\t\t\t\t\tself.context.strokeStyle = \"#4d91ff\";\n\t\t\t\t\t\t\t\tself.context.lineWidth = 10;\n\t\t\t\t\t\t\t\tself.context.stroke();\n\t\t\t\t\t\t\t\tself.context.closePath();\n\n\t\t\t\t\t\t});\n\t\t\t\t});\n\t\t}\n\n\t\t// Set the digit to number provided\n\t\tthis.setDigit(n);\n\t\t\t\t\n\t\t// Return the object so that we can call it\n\t\treturn this;\n}", "title": "" }, { "docid": "b7f2f19f5362542efe6f63cf0d09f80e", "score": "0.48667717", "text": "copy() {\r\n return new NeuralNetwork(this);\r\n }", "title": "" }, { "docid": "41299321f301cc265f36d8fabaf9475b", "score": "0.4864525", "text": "function NeuQuant(networkSize){\n /**\n * Constants\n */\n const ncycles = 100; // number of learning cycles\n const maxnetpos = networkSize - 1;\n\n // defs for freq and bias\n const netbiasshift = 4; // bias for colour values\n const intbiasshift = 16; // bias for fractions\n const intbias = (1 << intbiasshift);\n const gammashift = 10;\n const betashift = 10;\n const beta = (intbias >> betashift); /* beta = 1/1024 */\n const betagamma = (intbias << (gammashift - betashift));\n\n // defs for decreasing radius factor\n const initrad = (networkSize >> 3); // for 256 cols, radius starts\n const radiusbiasshift = 6; // at 32.0 biased by 6 bits\n const radiusbias = (1 << radiusbiasshift);\n const initradius = (initrad * radiusbias); //and decreases by a\n const radiusdec = 30; // factor of 1/30 each cycle\n\n // defs for decreasing alpha factor\n const alphabiasshift = 10; // alpha starts at 1.0\n const initalpha = (1 << alphabiasshift);\n\n /* radbias and alpharadbias used for radpower calculation */\n const radbiasshift = 8;\n const radbias = (1 << radbiasshift);\n const alpharadbshift = (alphabiasshift + radbiasshift);\n const alpharadbias = (1 << alpharadbshift);\n \n \n /**\n * Variables initialized by init\n */\n let network; // int[netsize][4]\n let netindex; // for network lookup - really 256\n\n // bias and freq arrays for learning\n let bias;\n let freq;\n let radpower;\n\n /*\n Private Method: init\n sets up arrays\n */\n function init(){\n network = [];\n netindex = new Int32Array(256);\n bias = new Int32Array(networkSize);\n freq = new Int32Array(networkSize);\n radpower = new Int32Array(networkSize >> 3);\n\n for(let i = 0; i < networkSize; i++){\n const v = (i << (netbiasshift + 8)) / networkSize;\n network[i] = new Float64Array([v, v, v, 0]);\n freq[i] = intbias / networkSize;\n bias[i] = 0;\n }\n }\n\n /*\n Private Method: unbiasnet\n unbiases network to give byte values 0..255 and record position i to prepare for sort\n */\n function unbiasnet(){\n for(let i = 0; i < networkSize; i++){\n network[i][0] >>= netbiasshift;\n network[i][1] >>= netbiasshift;\n network[i][2] >>= netbiasshift;\n network[i][3] = i; // record color number\n }\n }\n\n /*\n Private Method: altersingle\n moves neuron *i* towards biased (b,g,r) by factor *alpha*\n */\n function altersingle(alpha, i, b, g, r){\n network[i][0] -= (alpha * (network[i][0] - b)) / initalpha;\n network[i][1] -= (alpha * (network[i][1] - g)) / initalpha;\n network[i][2] -= (alpha * (network[i][2] - r)) / initalpha;\n }\n\n /*\n Private Method: alterneigh\n moves neurons in *radius* around index *i* towards biased (b,g,r) by factor *alpha*\n */\n function alterneigh(radius, i, b, g, r) {\n const lo = Math.abs(i - radius);\n const hi = Math.min(i + radius, networkSize);\n\n let j = i + 1;\n let k = i - 1;\n let m = 1;\n\n while((j < hi) || (k > lo)){\n const a = radpower[m++];\n\n if (j < hi) {\n const p = network[j++];\n p[0] -= (a * (p[0] - b)) / alpharadbias;\n p[1] -= (a * (p[1] - g)) / alpharadbias;\n p[2] -= (a * (p[2] - r)) / alpharadbias;\n }\n\n if(k > lo){\n const p = network[k--];\n p[0] -= (a * (p[0] - b)) / alpharadbias;\n p[1] -= (a * (p[1] - g)) / alpharadbias;\n p[2] -= (a * (p[2] - r)) / alpharadbias;\n }\n }\n }\n\n /*\n Private Method: contest\n searches for biased BGR values\n */\n function contest(b, g, r) {\n /*\n finds closest neuron (min dist) and updates freq\n finds best neuron (min dist-bias) and returns position\n for frequently chosen neurons, freq[i] is high and bias[i] is negative\n bias[i] = gamma * ((1 / netsize) - freq[i])\n */\n\n let bestd = ~(1 << 31);\n let bestbiasd = bestd;\n let bestpos = -1;\n let bestbiaspos = bestpos;\n\n for(let i = 0; i < networkSize; i++){\n const n = network[i];\n\n const dist = Math.abs(n[0] - b) + Math.abs(n[1] - g) + Math.abs(n[2] - r);\n if(dist < bestd){\n bestd = dist;\n bestpos = i;\n }\n\n const biasdist = dist - ((bias[i]) >> (intbiasshift - netbiasshift));\n if(biasdist < bestbiasd){\n bestbiasd = biasdist;\n bestbiaspos = i;\n }\n\n const betafreq = (freq[i] >> betashift);\n freq[i] -= betafreq;\n bias[i] += (betafreq << gammashift);\n }\n\n freq[bestpos] += beta;\n bias[bestpos] -= betagamma;\n\n return bestbiaspos;\n }\n\n /*\n Private Method: inxbuild\n sorts network and builds netindex[0..255]\n */\n function inxbuild() {\n let previouscol = 0;\n let startpos = 0;\n for (let i = 0; i < networkSize; i++) {\n const p = network[i];\n let smallpos = i;\n let smallval = p[1]; // index on g\n // find smallest in i..netsize-1\n for (let j = i + 1; j < networkSize; j++) {\n const q = network[j];\n if (q[1] < smallval) { // index on g\n smallpos = j;\n smallval = q[1]; // index on g\n }\n }\n const q = network[smallpos];\n\n if(i !== smallpos){\n // swap p (i) and q (smallpos) entries\n for(let j=0;j<4;j++){\n const temp = q[j];\n q[j] = p[j];\n p[j] = temp;\n }\n }\n // smallval entry is now in position i\n if(smallval !== previouscol){\n netindex[previouscol] = (startpos + i) >> 1;\n for(let j = previouscol + 1; j < smallval; j++){\n netindex[j] = i;\n }\n previouscol = smallval;\n startpos = i;\n }\n }\n netindex[previouscol] = (startpos + maxnetpos) >> 1;\n for(let j = previouscol + 1; j < 256; j++){\n netindex[j] = maxnetpos; // really 256\n } \n }\n\n /*\n Private Method: learn\n \"Main Learning Loop\"\n Note that you will get infinite loop if image that is completely transparent is used\n */\n function learn(pixels, samplefac, progressCallback) {\n //these calculations were done supposing pixels had no alpha, so divide by 4 * 3 to get length of pixels without alpha\n const pixelLength = pixels.length;\n //originally was divided by 3, but not sure if we should be \n //dividing by 4 now that we are using rgb instead of rgba\n //however, with samplefac 10 with colors less than 256, divide by 4 gives better results\n //compared to dividing by 3, which gives duller, less saturated result\n const alphadec = 30 + ((samplefac - 1) / 4);\n const samplepixels = pixelLength / (4 * samplefac);\n let delta = ~~(samplepixels / ncycles);\n let alpha = initalpha;\n let radius = initradius;\n\n let rad = radius >> radiusbiasshift;\n if(rad <= 1){ \n rad = 0;\n }\n for(let i = 0; i < rad; i++){\n radpower[i] = alpha * (((rad * rad - i * i) * radbias) / (rad * rad));\n }\n \n const DEFAULT_STEP = 4;\n let step = DEFAULT_STEP;\n\n // four primes near 500 - assume no image has a length so large that it is\n // divisible by all four primes\n const prime1 = 499;\n const prime2 = 491;\n const prime3 = 487;\n const prime4 = 503;\n const minpicturebytes = (4 * prime4);\n if(pixelLength >= minpicturebytes){\n if((pixelLength % prime1) !== 0){\n step *= prime1;\n } \n else if ((pixelLength % prime2) !== 0){\n step *= prime2;\n } \n else if((pixelLength % prime3) !== 0){\n step *= prime3;\n } \n else{\n step *= prime4;\n }\n }\n \n let pixelIndex = 0; // current pixel\n let i = 0;\n let hasTransparentPixels = false;\n let hasUsedProgressCallback = samplefac > 5;\n const halfDone = Math.floor(samplepixels / 2);\n while(i < samplepixels){\n //skip transparent pixels\n if(pixels[pixelIndex+3] === 0){\n hasTransparentPixels = true;\n pixelIndex += step;\n\n //to avoid infinite loops\n if(pixelIndex >= pixelLength){\n pixelIndex = 0;\n step = DEFAULT_STEP;\n }\n continue;\n }\n const b = (pixels[pixelIndex] & 0xff) << netbiasshift;\n const g = (pixels[pixelIndex + 1] & 0xff) << netbiasshift;\n const r = (pixels[pixelIndex + 2] & 0xff) << netbiasshift;\n const j = contest(b, g, r);\n\n altersingle(alpha, j, b, g, r);\n if (rad !== 0){\n alterneigh(rad, j, b, g, r); // alter neighbours\n }\n\n i++;\n delta = delta === 0 ? 1 : delta;\n if(i % delta === 0){\n alpha -= alpha / alphadec;\n radius -= radius / radiusdec;\n rad = radius >> radiusbiasshift;\n rad = rad <= 1 ? 0 : rad;\n\n for(let j = 0; j < rad; j++){\n radpower[j] = alpha * (((rad * rad - j * j) * radbias) / (rad * rad));\n }\n }\n pixelIndex += step;\n if(pixelIndex >= pixelLength){\n pixelIndex = 0;\n //if we get past the end of pixels array, and there are transparent pixels reset step to every pixel,\n //so we don't get caught in a potentially infinite loop if there are transparent pixels\n //don't do this unless we have to, since this leads to worse results\n if(hasTransparentPixels){\n step = DEFAULT_STEP;\n }\n if(!hasUsedProgressCallback && i >= halfDone){\n hasUsedProgressCallback = true;\n progressCallback(50);\n }\n }\n }\n }\n\n /*\n Method: buildColormap\n 1. initializes network\n 2. trains it\n 3. removes misconceptions\n 4. builds colorindex\n \n Arguments:\n pixels - array of pixels in RGBA format; e.g. [r, g, b, a, r, g, b, a]\n samplefac - sampling factor 1 to 30 where lower is better quality\n */\n this.buildColormap = function(pixels, samplefac, progressCallback){\n init();\n learn(pixels, samplefac, progressCallback);\n unbiasnet();\n inxbuild();\n return getColormap();\n };\n\n /*\n Method: getColormap\n builds colormap from the index\n returns array in the format:\n >\n > [r, g, b, r, g, b, r, g, b, ..]\n >\n */\n function getColormap(){\n const map = new Uint8Array(networkSize*3);\n const index = [];\n\n for(let i = 0; i < networkSize; i++){\n index[network[i][3]] = i;\n }\n\n for(let i = 0, k=0; i < networkSize; i++){\n const j = index[i];\n map[k++] = network[j][0];\n map[k++] = network[j][1];\n map[k++] = network[j][2];\n }\n return map;\n }\n}", "title": "" }, { "docid": "7ac65abba9c818cad4acd6457f07724f", "score": "0.48525995", "text": "async function predictDigit() {\n // Copy the digit canvas into a 28 by 28 image\n let inputs = [];\n const smaller = createImage(28, 28, RGB);\n const img = DIGIT_UI.get();\n DIGIT_UI.width;\n smaller.copy(\n img,\n 0,\n 0,\n DIGIT_UI.width,\n DIGIT_UI.height,\n\n 0,\n 0,\n smaller.width,\n smaller.height\n );\n // Get an array representing the smaller image\n smaller.loadPixels();\n for (var i = 0; i < smaller.pixels.length; i += 4) {\n // Just using the red channel since it's a greyscale image\n // Not so great to use inputs of 0 so smallest value is 0.01\n inputs[i / 4] = map(smaller.pixels[i], 0, 255, 0, 0.99) + 0.01;\n }\n console.log(inputs);\n // Get predictions based on that image\n let data = inferModel(inputs);\n PREDICTION_UI.setData(data);\n console.log(data);\n}", "title": "" }, { "docid": "653c43230f9e8bc5fdd85006ce445737", "score": "0.48460454", "text": "function Numeral (number) {\n this._n = number;\n }", "title": "" }, { "docid": "653c43230f9e8bc5fdd85006ce445737", "score": "0.48460454", "text": "function Numeral (number) {\n this._n = number;\n }", "title": "" }, { "docid": "a55eaf6d4d3fbf180bef9a467ed73b01", "score": "0.48411265", "text": "constructor(arrayCapas, activacion, activacionOutput, funcionCoste, learningRate) {\n if (arguments.length != 5) {\n throw new Error(\"Debes indicar bien los parametros. Ej: new EMQUC([2,4,6],'sigmoid','softmax', 'ecm', 0.01)\");\n }\n\n //Estos arrays tendran las matrices de las dimensiones que se indiquen en 'arrayCapas'\n this.capaw = []; //Contiene las matrices de pesos de cada capa\n this.capab = []; //Contiene las matrices de bias de cada capa\n\n this.learningRate = learningRate;\n\n //Empezar a formas las matrices en la capa 1. la capa 0 de inputs no tiene matrices\n for (let i = 1; i < arrayCapas.length; i++) {\n //La capa actual tiene de filas el numero de neuronas de la capa actual y de\n //columnas el numero de neuronas de la capa anterior\n this.capaw[i] = new Matriz(arrayCapas[i], arrayCapas[i - 1]);\n //La capa de bias tiene de filas el numero de neuronas de la capa actual, y una columna\n this.capab[i] = new Matriz(arrayCapas[i], 1);\n\n //Randomizar los pesos y los bias\n this.capaw[i] = Matriz.randomize(this.capaw[i]);\n this.capab[i] = Matriz.randomize(this.capab[i]);\n }\n\n\n //Guardar el tipo de funcion de activacion\n if (activacion == \"relu\" || activacion == \"sigmoid\" || activacion == \"tanh\" || activacion == \"leakyrelu\") {\n this.activacion = activacion;\n } else {\n throw new Error(\"Indica bien la funcion de activacion: 'relu' | 'sigmoid' | 'tanh' | 'leakyrelu'\");\n }\n\n //Guardar el tipo de funcion de activacion del output\n if (activacionOutput == \"talcual\" || activacionOutput == \"softmax\") {\n this.activacionOutput = activacionOutput;\n } else {\n throw new Error(\"Indica bien la funcion de activacion del output: 'talcual' | 'softmax'\");\n }\n\n //Guardar el tipo de funcion de coste\n if (funcionCoste == \"ecm\" || funcionCoste == \"crossentropy\") {\n this.funcionCoste = funcionCoste;\n } else {\n throw new Error(\"Indica bien la funcion de coste: 'ecm' | 'crossentropy'\");\n }\n }", "title": "" }, { "docid": "cf4794438beda55fd086406eef6a2c72", "score": "0.48385012", "text": "function classify() {\n classifier.classify(gotResults);\n}", "title": "" }, { "docid": "1a4992b229debcc52618b232dcb7a1d6", "score": "0.48380524", "text": "train(inputs, target){\n let guess = this.feedforward(inputs);\n let error = target - guess;\n \n for(let i = 0 ; i < this.weights.length; i++){\n this.weights[i] += error * inputs[i] * this.learning_rate;\n }\n \n }", "title": "" }, { "docid": "20b7b27b6649c47f2d95c249b035ae8d", "score": "0.4837233", "text": "function initNetwork() {\n\tlog(\"Initialized new network.\");\n\tnetwork = new NeuralNet(NET_STATE_SIZE, NOTE_RANGE, NOTE_RANGE);\n}", "title": "" }, { "docid": "4720035b45c03aaf7389b6fb45afe2ed", "score": "0.48258355", "text": "function Neuron(id, inputWeights, inputIds, calculatedOutput, outputIds, activationFunction){\r\n this.id = id\r\n this.inputWeights = inputWeights\r\n this.inputIds = inputIds\r\n this.calculatedOutput = calculatedOutput\r\n this.outputIds = outputIds\r\n this.activationFunction = activationFunction\r\n}", "title": "" }, { "docid": "bdc2319da03a4f90c6ea2f70a4dc1e76", "score": "0.48242688", "text": "function Counter() {\n this.el = domify('<div class=\"counter\"></div>');\n this._digits = [];\n this.n = 0;\n this.digits(2);\n}", "title": "" }, { "docid": "a5cfbf929c913722f8a61d345afb5cf7", "score": "0.48241803", "text": "copy() {\n return new NeuralNetwork(this);\n }", "title": "" }, { "docid": "a5cfbf929c913722f8a61d345afb5cf7", "score": "0.48241803", "text": "copy() {\n return new NeuralNetwork(this);\n }", "title": "" }, { "docid": "a5cfbf929c913722f8a61d345afb5cf7", "score": "0.48241803", "text": "copy() {\n return new NeuralNetwork(this);\n }", "title": "" }, { "docid": "a5cfbf929c913722f8a61d345afb5cf7", "score": "0.48241803", "text": "copy() {\n return new NeuralNetwork(this);\n }", "title": "" }, { "docid": "1d5364d0159560385e2cbe33ebdba600", "score": "0.48236945", "text": "function Brain(layers) {\n this.inputs = new Array(layers[0]);\n this.layers = [];\n this.learningRate = 0.001;\n\n let lastLayerInputs = layers[0];\n\n for (let i = 1; i < layers.length; i++) {\n let layer = [];\n\n for(let n = 0; n < layers[i]; n++) {\n layer.push(new Neuron(lastLayerInputs));\n }\n \n this.layers.push(layer);\n \n lastLayerInputs = layers[i];\n }\n}", "title": "" }, { "docid": "f16e03e76b3db36ded493d2c579df714", "score": "0.48130748", "text": "constructor(numStates, numInputs) {\n this.numStates = numStates;\n this.numInputs = numInputs;\n this.rule = this.randomRule();\n }", "title": "" }, { "docid": "824f9171341ae8776d113d930e531b2f", "score": "0.48112836", "text": "function classify() {\n classifier.classify(gotResults);\n}", "title": "" }, { "docid": "4d456bd70df9055e1bebce5c8ba6e6e2", "score": "0.48008737", "text": "constructor(inputValues, minNumElements, epsilon, metric) {\n this.inputValues = inputValues;\n this.minNumElements = minNumElements;\n this.epsilon = epsilon;\n this.epsilon2 = Math.pow(epsilon, 2);\n this.metric = metric;\n this.visitedPoints = new Set();\n }", "title": "" }, { "docid": "834caee997f81c5e14fafa541c270562", "score": "0.4798645", "text": "function Classifier() {\n}", "title": "" }, { "docid": "c3853031cecbbb1f66e1bd452cea5f36", "score": "0.4795519", "text": "function classify() {\n classifier.classify(getResults);\n}", "title": "" }, { "docid": "6a8a8f73297eb96d80ccd45ba91b6da1", "score": "0.47830692", "text": "train(inputArray, targets_array) {\n //Feedforward\n let inputs = Matrix.fromArray(inputArray);\n\n let hidden = Matrix.multiply(this.weights_ih, inputs);\n hidden.add(this.bias_h);\n hidden.sigmoid();\n\n let outputs = Matrix.multiply(this.weights_ho, hidden);\n outputs.add(this.bias_o);\n outputs.sigmoid();\n\n let targets = Matrix.fromArray(targets_array);\n\n //Backpropagation\n //--- Calcular output error -------------------------------------\n //Error = Answer - Outputs\n let output_errors = Matrix.subtract(targets, outputs);\n //Gradiente output = lr * Errores * (sigmoid(wo) * (1 - sigmoid(wo)) * wh)\n //let gradient = outputs\n\n //Calcular gradiente output\n let gradients = outputs.copy();\n gradients.dsigmoid();\n gradients.multiply(output_errors);\n gradients.multiply(this.learning_rate);\n\n\n //Calcular deltas hidden->output\n let hidden_T = Matrix.transpose(hidden);\n let weight_ho_deltas = Matrix.multiply(gradients, hidden_T);\n this.weights_ho.add(weight_ho_deltas);\n this.bias_o.add(gradients);\n\n //--- Calcular hidden layers errors ------------------------------\n let who_t = Matrix.transpose(this.weights_ho);\n let hidden_errors = Matrix.multiply(who_t, output_errors);\n\n //Calcular gradiente hidden\n let hidden_gradient = hidden.copy();\n hidden_gradient.dsigmoid();\n hidden_gradient.multiply(hidden_errors);\n hidden_gradient.multiply(this.learning_rate);\n\n //Calcular deltas input->hidden\n let inputs_t = Matrix.transpose(inputs);\n let weight_ih_deltas = Matrix.multiply(hidden_gradient, inputs_t);\n this.weights_ih.add(weight_ih_deltas);\n this.bias_h.add(hidden_gradient);\n\n // outputs.print();\n // targets.print();\n // output_errors.print();\n\n }", "title": "" }, { "docid": "b8cf0888566980aa79267d117a62dc8d", "score": "0.47556424", "text": "function draw() {\n background(100,10);\n \n if (counter > 50) counter = 0;\n k = counter;\n\n counter ++; \n\n //k = floor(random(10));\n //console.log(k);\n kParagraph.html('label: ' + currentLabel + ' k: ' + k );\n\n\n // Classify every possible spot in 2D space\n for (var x = 0; x < width; x += skip) {\n for (var y = 0; y < height; y += skip) {\n\n // Here is the KNN algorithm!\n\n // List of all neighbors by distance\n var neighbors = [];\n for (var i = 0; i < training.length; i++) {\n var point = training[i];\n // Euclidean distance to this neighbor\n var d = dist(x, y, point.x, point.y);\n // Add to an array\n neighbors.push({\n dist: d,\n label: point.label\n });\n }\n // Sort array by distance\n neighbors.sort(byDistance);\n\n // This function tells the array how to sort\n function byDistance(a, b) {\n return a.dist - b.dist;\n }\n\n // In the top k spots, how many neighbors per label\n var knn = {};\n for (var i = 0; i < k; i++) {\n // Here's the i'th closest neighbor\n var nb = neighbors[i];\n // Increment its count if we've seen it before\n // We could add something to weight by distance here!\n if (knn[nb.label]) {\n knn[nb.label]++;\n } else {\n // Otherwise start with 1\n knn[nb.label] = 1;\n }\n }\n\n // Here are all the possible labels\n var options = Object.keys(knn);\n\n // Which one is the most frequent?\n var record = 0;\n var classification = null;\n for (var i = 0; i < options.length; i++) {\n var label = options[i];\n var total = knn[label];\n // If it's count is higher than any we've found before\n if (total > record) {\n record = total;\n // This is the classification!\n classification = label;\n }\n }\n\n // Draw rectangle with a color based on classfied label\n // Only draw current classifier\n if (classification == currentLabel) {\n stroke(0,100);\n fill(0,90);\n } else {\n noStroke(); \n fill(255);\n }\n\n rect(x, y, skip, skip);\n }\n }\n\n}", "title": "" }, { "docid": "1ac7447f74ce58ca39f410d5b57f6211", "score": "0.47552055", "text": "drawNeuralNet(canvas,context) {\n\t\t// The size in pixel for a neuron\n\t\tvar neuronSize = 0;\n\t\tvar neuronSpace = 10;\n\t\tvar spaceFromBorder = 20;\n\t\tvar pourcent = 15;\n\n\t\t// Get the biggest number of neuron per layer\n\t\tvar maxNeuron = 0;\n\t\tfor (var i = 0; i < this.layers.length; i++) {\n\t\t\tif (this.layers[i].neurons.length > maxNeuron) {\n\t\t\t\tmaxNeuron = this.layers[i].neurons.length;\n\t\t\t}\n\t\t}\n\n\t\t// Get the lowest size (used to create circle)\n\t\tif ((canvas.height / maxNeuron) < (canvas.width / this.layers.length)) {\n\t\t\tneuronSize = (canvas.height / maxNeuron);\n\t\t}\n\t\telse {\n\t\t\tneuronSize = canvas.width / this.layers.length;\n\t\t}\n\n\t\t//\n\t\tneuronSize -= neuronSpace;\n\n\t\tcontext.clearRect(0,0,canvas.width,canvas.height);\n\n\t\t//\n\t\tvar spaceBetweenNeuronX = 0;\n\t\tvar spaceBetweenNeuronY = 0;\n\t\tfor (var y = 0; y < this.layers.length; y++) {\n\t\t\t// Get the size between neuron [Y axis]\n\t\t\tspaceBetweenNeuronY = ((canvas.width - (spaceFromBorder * 2)) / (this.layers.length - 1)) - neuronSize / 2;\n\t\t\tfor (var x = 0; x < this.layers[y].neurons.length; x++) {\n\t\t\t\t// Get the size between neuron [X axis]\n\t\t\t\tspaceBetweenNeuronX = ((canvas.height - (this.layers[y].neurons.length * neuronSize)) / (this.layers[y].neurons.length + 1));\n\n\t\t\t\tvar posY = spaceBetweenNeuronY * y + spaceFromBorder + neuronSize / 2;\n\t\t\t\tvar posX = spaceBetweenNeuronX * (x+1) + neuronSize * x + neuronSize / 2;\n\n\t\t\t\t// Change the color if this is the bias\n\t\t\t\tif (x == this.layers[y].neurons.length - 1) {\n\t\t\t\t\tcontext.fillStyle=\"#BDBDBD\";\n\t\t\t\t\tcontext.strokeStyle=\"#BDBDBD\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tcontext.fillStyle=\"#ee6e73\";\n\t\t\t\t\tcontext.strokeStyle=\"#ee6e73\";\n\t\t\t\t}\n\n\t\t\t\tcontext.lineWidth=1.5;\n\n\t\t\t\t// Draw the circle\n\t\t\t\tcontext.beginPath();\n\t\t\t\tcontext.arc(posY, posX, neuronSize / 2, 0, 2 * Math.PI);\n\t\t\t\tcontext.stroke();\n\t\t\t\tcontext.closePath();\n\n\t\t\t\tcontext.font = \"20px Arial\";\n\n\t\t\t\t// Draw the output values of each neuron\n\t\t\t\tcontext.fillText(this.layers[y].neurons[x].outputValue.toFixed(3),posY - (context.measureText(this.layers[y].neurons[x].outputValue.toFixed(3)).width / 2), posX + 10);\n\n\t\t\t\t// Check if this layer is the last one\n\t\t\t\tif (y + 1 < this.layers.length) {\n\t\t\t\t\tvar nextSpaceBetweenNeuronX = (canvas.height - (this.layers[y+1].neurons.length * neuronSize)) / (this.layers[y+1].neurons.length + 1);\n\t\t\t\t\tfor (var neuronIndex = 0; neuronIndex < this.layers[y+1].neurons.length - 1; neuronIndex++) {\n\n\t\t\t\t\t\t// Get the line position\n\t\t\t\t\t\tvar linePosY = posY + neuronSize / 2;\n\t\t\t\t\t\tvar nextPosY = spaceBetweenNeuronY * (y+1) + spaceFromBorder;\n\t\t\t\t\t\tvar nextPosX = nextSpaceBetweenNeuronX * (neuronIndex+1) + neuronSize * neuronIndex + neuronSize / 2;\n\n\t\t\t\t\t\tvar yPourcent = Math.ceil(Math.ceil(linePosY - nextPosY) / 100 * pourcent);\n\t\t\t\t\t\tvar xPourcent = Math.ceil(Math.ceil(posX - nextPosX) / 100 * pourcent);\n\n\t\t\t\t\t\tcontext.beginPath();\n\n\t\t\t\t\t\t// Draw the line\n\t\t\t\t\t\tcontext.moveTo(linePosY, posX);\n\t\t\t\t\t\tcontext.lineTo(nextPosY, nextPosX);\n\t\t\t\t\t\tcontext.stroke();\n\n\t\t\t\t\t\t// Change the font\n\t\t\t\t\t\tcontext.font = \"12px Arial\";\n\n\t\t\t\t\t\t// Draw a rectangle behind the text\n\t\t\t\t\t\tcontext.fillStyle=\"#FFFFFF\";\n\t\t\t\t\t\tcontext.fillRect(linePosY - yPourcent - 2, posX - xPourcent - 11, 38, 13);\n\n\t\t\t\t\t\tcontext.fillStyle=\"#000000\";\n\n\t\t\t\t\t\t// Draw the weight of each neuron\n\t\t\t\t\t\tcontext.fillText(this.layers[y].neurons[x].outputWeights[neuronIndex].weight.toFixed(3),linePosY - yPourcent, posX - xPourcent);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "87ee64f489e42c6585fdbec7f14a2748", "score": "0.47518027", "text": "activate_layer(inputs, yd){\n let sum = 0.0;\n this.output_values = [];\n //console.log(\"neurons\" + this.numberOfNeurons);\n //returns output\n for(var i = 0; i < this.numberOfNeurons ; i++){\n var tem = this.neurons[i].activate(inputs);\n this.output_values.push(tem);\n //console.log(\" value \" + tem);\n this.neurons[i].output = tem;\n sum += Math.exp(tem);\n }\n //console.log(\"output \" + this.output_values);\n\n if(this.activation.localeCompare(\"softmax\") == 0){\n //console.log(\"output layer\");\n //calculate softmax\n this.cross_entropy = 0.0;\n //e is the expectded output for the neuron\n var e;\n for(var i = 0; i < this.numberOfNeurons ; i++){\n\n //console.log(\"sum \" +sum);\n this.output_values[i] = Math.exp(this.output_values[i])/sum;\n this.neurons[i].output = this.output_values[i];\n e = (i == yd ? 1 : 0);\n this.cross_entropy += e * Math.log2(this.neurons[i].output);\n\n }\n this.cross_entropy = -1*this.cross_entropy;\n //console.log(this.cross_entropy);\n \n \n }\n return this.output_values;\n }", "title": "" }, { "docid": "3363f65742d6d25b0c14bbb50a5e3cef", "score": "0.4735426", "text": "function Numeral(input, number) {\n\t\t this._input = input;\n\n\t\t this._value = number;\n\t\t }", "title": "" }, { "docid": "2fda0ede7a7dbd107bf0c3be1c68db75", "score": "0.4734346", "text": "nnPrediction(data, theta1, theta2) {\n \t// add bias\n if (data.length == 400) data.unshift(1);\n if (theta1.length == 25) {\n const bias = Array(theta1[0].length).fill(1);\n theta1.unshift(bias);\n }\n\n // just some incomplete sanity checks to find the most obvious errors\n if (!Array.isArray(data) || data.length == 0 ||\n !Array.isArray(theta1) || theta1.length == 0 || !Array.isArray(theta1[0]) || data.length != theta1[0].length ||\n !Array.isArray(theta2) || theta2.length == 0 || !Array.isArray(theta2[0]) || theta1.length != theta2[0].length) {\n console.error('invalid parameters in nn function');\n return undefined;\n }\n\n const num_labels = theta2.length;\n let prediction = undefined;\n\n // compute layer2 output, units2 should be 1x26\n let units2 = Array(theta1.length).fill(0);\n for (let i=0; i<theta1.length; i++) {\n\n for (let j=0; j<theta1[i].length; j++) {\n units2[i] += data[j] * theta1[i][j];\n }\n units2[i] = 1 / (1 + Math.exp(-units2[i]));\n }\n\n //compute layer3 activation, units3 should be 1x10\n let units3 = Array(theta2.length).fill(0);\n for (let i=0; i<theta2.length; i++) {\n\n for (let j=0; j<theta2[i].length; j++) {\n units3[i] += units2[j] * theta2[i][j];\n }\n }\n\n const max = Math.max(...units3);\n return units3.findIndex(function(element, index, array){\n \treturn element == max;\n }) + 1;\n }", "title": "" }, { "docid": "07fba0c5aa617e669d96863a551bde01", "score": "0.47216713", "text": "function classify() {\n // Get the total number of labels from knnClassifier\n const numLabels = knnClassifier.getNumLabels();\n if (numLabels <= 0) {\n console.error('There is no examples in any label');\n return;\n }\n // Get the features of the input video\n const features = featureExtractor.infer(video);\n\n knnClassifier.classify(features, gotResults);\n\n}", "title": "" }, { "docid": "883c1f4727425d5f703cf1cd20810908", "score": "0.47215074", "text": "trainNetwork(inp){\r\n let input = inp.slice();\r\n //Input in an array with 2 strings. Get the strings to normal data a LSTM cell can handle.\r\n for(let i = 0; i < input.length; i++){\r\n input[i] = this.toData(input[i]);\r\n }\r\n input = neuralNetwork.ctd(input);\r\n\r\n //Train the network.\r\n for(let i = 0; i < input.length; i++){\r\n this.train(input[i][0], input[i][1][0]);\r\n }\r\n }", "title": "" }, { "docid": "c02bb8990c22df0d3728340b079ee00b", "score": "0.4716064", "text": "function generate_inputs_list(training_num){\n\tvar l = [];\n\tfor (var i=0; i<training_num; i+=1){\n\t\tvar valsToAdd = [];\n\t\tvar maxInExample = -1;\n\t\tvar val;\n\t\tvar maxPos;\n\t\tfor (var j=0; j<nodesPerLayer[0]; j+=1){\n\t\t\tval = random(-1,1); // The value of each randomly generated input is currently -1 <= val <= 1\n\t\t\tif (val > maxInExample){\n\t\t\t\tmaxInExample = val;\n\t\t\t\tmaxPos = j;\n\t\t\t}\n\t\t\tvalsToAdd.push(val);\n\t\t}\n\t\tl.push([valsToAdd]);\n\t\t// This determines the optimum values of the output node, so that there would be no change in the weights of the network\n\t\t// (Basically in this example, the bigger of the two inputs should be marked with a one in its corresponding output, and all others a zero.\n\t\tvar answers = [];\n\t\tfor (var j=0; j<nodesPerLayer[0]; j+=1){\n\t\t\tif (j === maxPos){\n\t\t\t\tanswers.push(1);\n\t\t\t} else {\n\t\t\t\tanswers.push(0); // OR -1\n\t\t\t}\n\t\t}\n\t\tl[i].push(answers);\n\n/*\n\t\tvar ins = [];\n\t\tvar individual = 0;\n\t\tvar max = [0,0];\n\t\tfor (var j=0; j<nodesPerLayer[0]; j+=1){\n\t\t\tindividual = random(-1,1);\n\t\t\tins.push(individual);\n\t\t\tif (individual>max[0]){\n\t\t\t\tmax = [individual, j];\n\t\t\t}\n\t\t}\n\t\tl.push([ins]);\n\t\tvar outs = [];\n\t\tfor (var j=0; j<nodesPerLayer[nodesPerLayer.length-1]; j+=1){\n\t\t\tif (j == max[1]){\n\t\t\t\touts.push(1);\n\t\t\t} else {\n\t\t\t\touts.push(0);\n\t\t\t}\n\t\t}\n\t\tl[i].push(outs);\n*/\n\t}\n\treturn l\n}", "title": "" }, { "docid": "1f5cb1eae6400a7fab64fdda7dc23912", "score": "0.47150534", "text": "function train() {\n // gets net and training data\n var net = new brain.NeuralNetwork();\n var trainingDataRaw = fs.readFileSync('./excerpts.js');\n var trainingData = JSON.parse(trainingDataRaw);\n \n // gets a few excerpts\n var selectData = [];\n for (i = 0; i < 20; i++) {\n var next = trainingData[Math.floor((Math.random() * trainingData.length))];\n selectData.push(next);\n }\n // maps encoded training data\n selectData = compute(selectData);\n \n // trains network and returns it\n net.train(selectData, {\n log: true\n });\n \n return net;\n}", "title": "" }, { "docid": "b77a96b85f415995846c60c13ff4bae1", "score": "0.47102386", "text": "constructor(k,w,h){\n // creates a new set of random data with a random number of \"real\" clusters and a random variation within each cluster\n // 100 clustering attempts are done to decide the most effective cluster centers\n // the final data is visualized using p5.js\n let scaleFactor = 0.80;\n this.k = k || 2;\n this.w = w || width * scaleFactor;\n this.h = h || height * scaleFactor;\n\n this.randomCenters; // stores centers for iterations\n this.attempts = 0; // tracks number of full kmeans solutions\n this.solutions = [];\n\n this.createRealData();\n }", "title": "" }, { "docid": "6b808be765116e2ad86367f8e8e2e8ab", "score": "0.47051883", "text": "constructor(n, k, type) {\n this.n = Math.floor(n);\n this.k = Math.floor(k);\n this.type = Math.floor(type);\n }", "title": "" }, { "docid": "9138d1682135e44d3c862cf1dd07c6cc", "score": "0.47027797", "text": "constructor (number = 1) {\n this.data = number;\n }", "title": "" }, { "docid": "990d635fa078a17508997bbc61eea605", "score": "0.47021148", "text": "function clone(obj) {\n var i, p, ps;\n function ExpantaNum(input,input2) {\n var x=this;\n if (!(x instanceof ExpantaNum)) return new ExpantaNum(input,input2);\n x.constructor=ExpantaNum;\n var parsedObject=null;\n if (typeof input==\"string\"&&(input[0]==\"[\"||input[0]==\"{\")){\n try {\n parsedObject=JSON.parse(input);\n }catch(e){\n //lol just keep going\n }\n }\n var temp,temp2,temp3;\n if (typeof input==\"number\"&&!(input2 instanceof Array)){\n temp=ExpantaNum.fromNumber(input);\n }else if (parsedObject){\n temp=ExpantaNum.fromObject(parsedObject);\n }else if (typeof input==\"string\"&&input[0]==\"E\"){\n temp=ExpantaNum.fromHyperE(input);\n }else if (typeof input==\"string\"){\n temp=ExpantaNum.fromString(input);\n }else if (input instanceof Array||input2 instanceof Array){\n temp=ExpantaNum.fromArray(input,input2);\n }else if (input instanceof ExpantaNum){\n temp=[];\n for (var i=0;i<input.array.length;++i) temp.push([input.array[i][0],input.array[i][1]]);\n temp2=input.sign;\n temp3=input.layer;\n }else if (typeof input==\"object\"){\n temp=ExpantaNum.fromObject(input);\n }else{\n temp=[[0,NaN]];\n temp2=1;\n temp3=0;\n }\n if (typeof temp2==\"undefined\"){\n x.array=temp.array;\n x.sign=temp.sign;\n x.layer=temp.layer;\n }else{\n x.array=temp;\n x.sign=temp2;\n x.layer=temp3;\n }\n return x;\n }\n ExpantaNum.prototype = P;\n\n ExpantaNum.JSON = 0;\n ExpantaNum.STRING = 1;\n \n ExpantaNum.NONE = 0;\n ExpantaNum.NORMAL = 1;\n ExpantaNum.ALL = 2;\n\n ExpantaNum.clone=clone;\n ExpantaNum.config=ExpantaNum.set=config;\n \n //ExpantaNum=Object.assign(ExpantaNum,Q);\n for (var prop in Q){\n if (Q.hasOwnProperty(prop)){\n ExpantaNum[prop]=Q[prop];\n }\n }\n \n if (obj === void 0) obj = {};\n if (obj) {\n ps = ['maxOps', 'serializeMode', 'debug'];\n for (i = 0; i < ps.length;) if (!obj.hasOwnProperty(p = ps[i++])) obj[p] = this[p];\n }\n\n ExpantaNum.config(obj);\n \n return ExpantaNum;\n }", "title": "" }, { "docid": "84684da88eddaa2547af61891950a663", "score": "0.47002506", "text": "copy() {\n let copy;\n if(this.hn_2) {\n copy = new NeuralNetwork(this.in, this.hn_1, this.hn_2, this.on);\n } else {\n copy = new NeuralNetwork(this.in, this.hn_1, this.on);\n }\n\n copy.weights_i_h = this.weights_i_h.clone();\n copy.bias_h1 = this.bias_h1.clone();\n\n if(this.hn_2) {\n copy.weights_h1_h2 = this.weights_h1_h2.clone();\n copy.bias_h2 = this.bias_h2.clone();\n } \n\n copy.weights_h_o = this.weights_h_o.clone();\n copy.bias_o = this.bias_o.clone();\n\n return copy;\n }", "title": "" }, { "docid": "2c3e5678dcbd97f1d9fff642c204d11f", "score": "0.46941817", "text": "constructor (number) {\n this.number = number\n }", "title": "" }, { "docid": "b3e54d6c97c4b9e722848d8f994cef73", "score": "0.46923947", "text": "copy() {\n return new NeuralNetwork(this);\n }", "title": "" }, { "docid": "ed32d55ca106711ee527e0fb85c5737d", "score": "0.4682688", "text": "function createTrainNum(){\n trainNum = (Math.floor(Math.random() * 9999))\n }", "title": "" }, { "docid": "bfbd7130b37da8bc54e91bf89d4425f6", "score": "0.4680757", "text": "predict(input) {\n // Keep a map of named activations for rendering purposes.\n const netout = this.math.scope((keep) => {\n // Preprocess the input.\n const preprocessedInput = this.math.subtract(this.math.arrayDividedByScalar(input, this.PREPROCESS_DIVISOR), this.ONE);\n const x1 = this.convBlock(preprocessedInput, [2, 2]);\n const x2 = this.depthwiseConvBlock(x1, [1, 1], 1);\n const x3 = this.depthwiseConvBlock(x2, [2, 2], 2);\n const x4 = this.depthwiseConvBlock(x3, [1, 1], 3);\n const x5 = this.depthwiseConvBlock(x4, [2, 2], 4);\n const x6 = this.depthwiseConvBlock(x5, [1, 1], 5);\n const x7 = this.depthwiseConvBlock(x6, [2, 2], 6);\n const x8 = this.depthwiseConvBlock(x7, [1, 1], 7);\n const x9 = this.depthwiseConvBlock(x8, [1, 1], 8);\n const x10 = this.depthwiseConvBlock(x9, [1, 1], 9);\n const x11 = this.depthwiseConvBlock(x10, [1, 1], 10);\n const x12 = this.depthwiseConvBlock(x11, [1, 1], 11);\n const x13 = this.depthwiseConvBlock(x12, [2, 2], 12);\n const x14 = this.depthwiseConvBlock(x13, [1, 1], 13);\n const x15 = this.math.conv2d(x14, this.variables['conv_23/kernel'], this.variables['conv_23/bias'], [1, 1], 'same');\n return x15.as4D(13, 13, 5, 6);\n });\n return netout;\n }", "title": "" }, { "docid": "9a10fc24fa0c194d2b2baa76e5d8898d", "score": "0.46792915", "text": "addInput(){\r\n //Here we need to change all the weights which use the input values.\r\n this.Wf = Matrix.addInput(this.Wf);\r\n this.Wi = Matrix.addInput(this.Wi);\r\n this.Wo = Matrix.addInput(this.Wo);\r\n this.Wg = Matrix.addInput(this.Wg);\r\n this.netconfig[0]++;\r\n }", "title": "" }, { "docid": "0a21361893996aa242cdbc61ebbf14bc", "score": "0.46733087", "text": "createNetwork() {\n return new Network(this, new Float32Array(this.numWeights));\n }", "title": "" }, { "docid": "2c1a710256895f16dd64a7d44d976c39", "score": "0.46575606", "text": "constructor(num, alt) {\r\n this.num = num;\r\n this.alt = alt;\r\n }", "title": "" }, { "docid": "b9a07fc43d37fa8c0aef24610bf35077", "score": "0.4643797", "text": "constructor() {\n super([\n [1, 0, 0, 0],\n [0, 1, 0, 0],\n [0, 0, 1, 0],\n [0, 0, 0, 1]\n ]);\n }", "title": "" }, { "docid": "574fadd706b2b8ac9f17ee4fee046394", "score": "0.4642527", "text": "function ProcNeuron(func)\n{\n var that = this || {};\n var base = BaseNeuron; base.call(that);\n\n if (func == null) { func = getDefActFunc(); }\n\n function getRandomInitWeight()\n {\n return (getRandom(-1, 1));\n }\n\n function getRandomInitWeightForNNeurons(n)\n {\n // Select input range of w. for n neurons\n // Simple range is -1..1,\n // But we may try - 1/sqrt(n)..1/sqrt(n) to reduce range of w in case of many inputs (so act func will not saturate)\n var wrange = 1;\n\n if (n > 0)\n {\n wrange = 1.0/Math.sqrt(n);\n }\n\n return (getRandom(-wrange, wrange));\n }\n\n that.inputs = [];\n that.w = [];\n\n that.func = func;\n\n that.out = 0.0;\n\n that.sum = 0.0; // Used for for training, but kept here to simplify training implementation\n\n function calcOutputSum(ins)\n {\n var out = 0;\n\n var count = that.w.length;\n\n assert(ins.length == count);\n\n for (var i = 0; i < count; i++)\n {\n out += ins[i] * that.w[i];\n }\n\n return(out);\n }\n\n that.addInput = function(neuron, w)\n {\n if (w == null) { w = getRandomInitWeight(); }\n that.inputs.push(neuron);\n that.w.push(w);\n }\n\n that.addInputAll = function(neurons, weights)\n {\n for (var i = 0; i < neurons.length; i++)\n {\n var w = null;\n\n if ((weights != null) && (weights[i] != null))\n {\n w = weights[i];\n }\n else\n {\n w = getRandomInitWeightForNNeurons(neurons.length);\n }\n\n that.addInput(neurons[i], w);\n }\n }\n\n // Core proccesing\n // Computes output based on input\n\n that.S = function (x) { assert(func != null); assert(func.S != null); return func.S(x); }\n\n that.proc = function()\n {\n assert(that.inputs.length == that.w.length);\n\n var sum = 0;\n var count = that.inputs.length;\n for (var i = 0; i < count; i++)\n {\n sum += that.inputs[i].get() * that.w[i];\n }\n\n that.sum = sum;\n that.out = that.S(sum);\n }\n\n that.get = function()\n {\n return(that.out);\n }\n\n return that;\n}", "title": "" }, { "docid": "fe227e866cb66bac642f337b15a4acf7", "score": "0.46416876", "text": "function Numeral(input, number) {\n this._input = input;\n\n this._value = number;\n }", "title": "" }, { "docid": "fe227e866cb66bac642f337b15a4acf7", "score": "0.46416876", "text": "function Numeral(input, number) {\n this._input = input;\n\n this._value = number;\n }", "title": "" }, { "docid": "fe227e866cb66bac642f337b15a4acf7", "score": "0.46416876", "text": "function Numeral(input, number) {\n this._input = input;\n\n this._value = number;\n }", "title": "" } ]
2325c236c676bc3d94db93c66677450c
Returns page to state before media click
[ { "docid": "a62c42302a06f7924e2d7f230b01c23b", "score": "0.0", "text": "function restore(){\n output.innerHTML = OldOutput; \n manageFilterOpts()\n displayMedia(library_content);\n}", "title": "" } ]
[ { "docid": "d526511643c21d096f1b219bc2801cde", "score": "0.64066887", "text": "function goto_mymusic( e ){\r\n\r\n\te.preventDefault();\r\n\tif( current_page != 1 ){\r\n\t\tcurrent_page = 1;\r\n\t\t$(\"#contain\").css(\"opacity\",0);\r\n\t\t$(\"#action_buttons\").css(\"opacity\",\"0\");\r\n\t\t$(\"#action_buttons\").css(\"margin-top\",\"-50px\");\r\n\t\tsetTimeout(function(){show_list();}, 500);\r\n\t}\r\n}", "title": "" }, { "docid": "ce7a2936f9c8a72d723986d01cf1d3bc", "score": "0.619886", "text": "function preClick(event) {\n event.preventDefault();\n\n if(remote.currentPage == 1) return;\n\n setTimeout(removeDepth.bind(null, (remote.currentPage-1)), 300);\n\n pages[remote.currentPage-1].classList.remove(\"turned\");\n if(remote.currentPage == 2) {\n sb.container.classList.add(\"deactivated\");\n sb.deacti.style.display = \"block\";\n coverPage.classList.remove(\"turned\");\n setTimeout( (function(){\n this.classList.add(\"set_depth\");\n }).bind(explanation) ,500);\n }\n\n remote.currentPage--;\n remote.update();\n remote.rotateBook(remote.currentPage);\n\n function removeDepth(pnum) {\n pages[pnum].classList.remove(\"set_depth\");\n if(pnum == 2) coverPage.classList.remove(\"set_depth\");\n }\n }", "title": "" }, { "docid": "799a249a4869bdb4d4b9b7d4da29d96e", "score": "0.5946176", "text": "function changeToFirstPage() {\r\n\ttmpPage = objCase.pages[0];\r\n\t\t//Do not select excluded page\r\n\tif (tmpPage != null && tmpPage.deleted != true && tmpPage.deleted != 'true') {\r\n\t\tnextPageId = tmpPage.id;\r\n\t\tnextPageDomId = 0;\r\n\t\t\r\n\t\tthumbnailClickHandler(nextPageId, nextPageDomId);\t\t\r\n\t}\r\n}", "title": "" }, { "docid": "723060101c32718b0ca482df61e78e03", "score": "0.5930874", "text": "goToPage( e )\r\n\t{\r\n\t\tconst target = e.currentTarget.getAttribute( 'data-page' ); \r\n\t\tthis.page = target;\r\n\t\tthis.updateResults();\r\n\t}", "title": "" }, { "docid": "de24e632924baffe3d0c78012c2e3b2a", "score": "0.592804", "text": "function contentsButtonClick(){\r\ndebug(\"contentsButtonClick\");\r\n contentsClicked = \"true\" ;\r\n refocus() ;\r\n if (videoState === \"paused\") {\r\n pauseEvent() ;\r\n }\r\n else { stopVideo(); }\r\n }", "title": "" }, { "docid": "0eee16a79e4ed18fc6546a6e51236088", "score": "0.589877", "text": "function setPreviousPage() {\n\tPAGE_PREVIEW--;\n\tapplyPredicate();\n}", "title": "" }, { "docid": "7a3cb9b41680b76253b154d99ed2d95e", "score": "0.58907104", "text": "_event_media_state() {\n\t\tlet ev = new Event(\"media_state\", { \"bubbles\": true, \"cancelable\": true });\n\t\tthis.dispatchEvent(ev);\n\t}", "title": "" }, { "docid": "cd7fc8b12a8a1a6a3f0f5fd9ac244580", "score": "0.58751816", "text": "function onClicked() {\n\t \n tablet.gotoWebScreen(current_home);\n }", "title": "" }, { "docid": "3e1af8c75533a0c3048c5dca0ddb448c", "score": "0.58256215", "text": "function browserScreenAlbumsClicked() {\r\r\n\tunselect();\r\r\n\t\r\r\n\tif (filterByAlbum==0) {\r\r\n\t\tfilterByAlbum = 1;\r\r\n\t\t$(\"#album\").attr('class', 'browser_button_albums album_active_state'); // change button state\r\r\n\t\tevent_process(EVENT_ON_ALBUMS_BUTTON_CLICK);\r\r\n\t}\r\r\n\telse {\r\r\n\t\tfilterByAlbum = 0;\r\r\n\t\t$(\"#album\").attr('class', 'browser_button_albums album_normal_state'); // change button state\r\r\n\t}\r\r\n}", "title": "" }, { "docid": "e477e36969e4efcc41a39f6e4568edd3", "score": "0.5816337", "text": "function onGoClick() {\n if (runState === 'stopped') {\n getId('goButton').textContent = 'Running';\n runState = 'running';\n resetRun();\n resetSelectState();\n resetTestState();\n runTest();\n } else {\n runState = 'stopped';\n getId('goButton').textContent = 'Go';\n resetSelectState();\n getId('testFrame').src = 'about:blank';\n }\n }", "title": "" }, { "docid": "97861fa58e51e9012e705a64679feb91", "score": "0.57802206", "text": "function gotoAndPlayFeedBack(_status, _curStatus, _retStatus) {\n //console.log(_status , _curStatus , _retStatus , \" :: _status , _curStatus , _retStatus\")\n var audioP;\n if (p.feedbackParam[_curStatus]) {\n audioP = p._shellModel.getMediaPath() + p.feedbackParam[_curStatus];\n }\n //--- dispatch event ---\n if (p.feedBack) {\n p.feedBack({\n status: _status,\n curStatus: _curStatus,\n popup: _curStatus,\n audioPath: audioP,\n feedbackParam: p.feedbackParam,\n jsflObj: p.feedbackParam['jsfl_' + _curStatus],\n videoFb: p.feedbackParam['video_' + _curStatus],\n curSelected: p.baseObj,\n retStatus: _retStatus\n });\n }\n }", "title": "" }, { "docid": "75fd40b0b331a2555680bec3cbdac3af", "score": "0.57655007", "text": "function goTo(e)\r\n{\r\n var clickedLink = e.currentTarget.name;\r\n var ScreenArray=JSON.parse(sessionStorage.getItem(\"ScreenArray\"));\r\n FixBack(true); // enable the \"Back\" arrow \r\n document.getElementById(\"content\").src=[\"Screens/\" + ScreenArray[Number(clickedLink.substring(1,clickedLink.length)) + 1]];\r\n \r\n sessionStorage.setItem(\"LastFrame\", false); // resetting the variable\r\n \r\n sessionStorage.setItem(\"ScreenNum\", Number(clickedLink.substring(1,clickedLink.length)) + 1);\r\n \r\n closeNav();\r\n \r\n \r\n}", "title": "" }, { "docid": "553e723decdf405c5cacb5e631480eb2", "score": "0.5761825", "text": "function goToPreviousPage() {\r\n\t\t// if the previous page is content page\r\n\t\tif ((!get_IfCangoToPreviousPage()) && get_IfCanShowContentsPage() && transitionAnimationBusy==false) {\r\n\t\t\tmagazineDirection = \"prev\";\r\n\t\t\tloadContentsPage();\r\n\t\t// if previous page is available\r\n\t\t} else if(get_IfCangoToPreviousPage() && transitionAnimationBusy==false){\r\n\t\t\tmagazineDirection = \"prev\";\r\n\t\t\tvar previousPage = get_CurrentPageNumber();\r\n\t\t\tset_CurrentPageIndex(get_CurrentPageIndex() - 1);\r\n\t\t\tstopHiFidelityFeatures(previousPage);\r\n\t\t\tupdateNavControls();\r\n\t transitionPage();\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "title": "" }, { "docid": "cc5449e296fa7bbce47c77de3da6cee7", "score": "0.5748111", "text": "first(event) {\n this.changePage(1, event);\n }", "title": "" }, { "docid": "a7881740519a89ad137ef755b18c6b21", "score": "0.57424927", "text": "function back(){\n var pageObjects = NB.page.getObjectsAsArray();\n var caption = pageObjects[0];\n sessionStorage.plainLyrics = caption.getCustomProperty(\"fullLyrics\");\n sessionStorage.trackName = caption.getCustomProperty(\"trackName\");\n window.location.href = \"./stamp.html\";\n}", "title": "" }, { "docid": "eb629fd375fca7df58e8b00468c2a238", "score": "0.57282394", "text": "function pageCurrent(page) {\n\n if(page === 'landingpage'){\n\n setPage('landingpage')\n\n\n }\n else if (page === 'addPage') {\n\n setPage('addPage')\n\n\n }\n\n\n }", "title": "" }, { "docid": "eaa8b0ccb46c40e397e0b69442764d6b", "score": "0.5689429", "text": "function goto_param( e ){\r\n\r\n\te.preventDefault();\r\n\tif( current_page != 4 ){\r\n\t\tcurrent_page = 4;\r\n\t\t$(\"#contain\").css(\"opacity\",0);\r\n\t\t$(\"#action_buttons\").css(\"opacity\",\"0\");\r\n\t\t$(\"#action_buttons\").css(\"margin-top\",\"-50px\");\r\n\t\tsetTimeout(function(){show_param();}, 500);\r\n\t}\r\n}", "title": "" }, { "docid": "d59e2551fdff7ce245caf389233d898c", "score": "0.56840223", "text": "function pressMediaCap() {\n document.getElementById(\"media-cap\").src = \"img/BentMediaCapV2.png\";\n // Initiate bottle-cap sound effect\n var audio = document.getElementById(\"audio\");\n audio.play();\n // Delay navigation to Media Page\n setTimeout(navigateToMedia, 600);\n}", "title": "" }, { "docid": "ce107f3a615e78a72d033e7b0a0315a0", "score": "0.5682472", "text": "function prebutton() {\n exp.go();\n }", "title": "" }, { "docid": "9495ced9701aa307d71bbef261a3039b", "score": "0.56820595", "text": "function startState() {\n $(\".pagination ul li:nth-child(1) a\").trigger('click'); /* Set inital page state on load */\n}", "title": "" }, { "docid": "995e9cc82da2a43ee8ed8cab9d06fc9b", "score": "0.56776637", "text": "function goToPage(page) {\n self.page = (page * 1);\n self.fetch(true);\n }", "title": "" }, { "docid": "1ca11918e063631412dee0733435f2f0", "score": "0.56582904", "text": "function goTo() {\n\t\t\t\tvar element = $(\".main-slideShow\").eq(galleryIndex).find(\".elemContainer\").eq(positionNEW[galleryIndex]);\n\n\t\t\t\tif(!element.hasClass(\"libraryLoaded\"))\n\t\t\t\t{\n\t\t\t\t\tif(!element.hasClass(\"YTVideo\"))\n\t\t\t\t\t{\n\t\t\t\t\t\telement.on(\"allImagesLoaded\",showContent);\n\t\t\t\t\t\tpreloader.preload([element.attr(\"data-src\")], element, element, true);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tgalleryThumbElementsARRAY[galleryIndex].filter(\".selected\").removeClass(\"selected\");\n\t\t\t\tgalleryThumbElementsARRAY[galleryIndex].eq(positionNEW[galleryIndex]).addClass(\"selected\");\n\t\t\t\tmainSlideShowInstanceARRAY[galleryIndex].goTo(positionNEW[galleryIndex]);\n\t\t\t\tthumbSlideShowInstanceARRAY[galleryIndex].goTo(Math.floor(positionNEW[galleryIndex]/8));\n\t\t\t\tloading.fadeOut(700);\n\t\t\t}", "title": "" }, { "docid": "985b9c1f9dbd81bf932b6e34633a0dd9", "score": "0.5657799", "text": "function mainpageSwitcher () {\n startPage.style.display = \"none\";\n pageTwo.style.display = \"block\";\n clickAudio.play();\n}", "title": "" }, { "docid": "8c07d3fb6b2a47a2dd17ea32ee7972a1", "score": "0.56532335", "text": "function ForwardTo(pageURL, page) {\n if (!$(\".next-btn\").attr(\"disabled\") && page != \"Final\") {\n\n var ThisPage = GetPreviousPage(page);\n SetScenarioNavClass(ThisPage, \"unlocked\");\n SetScenarioNavClass(page, \"current\");\n\n SetStorage(ScenarioValues);\n window.location.href = pageURL;\n \n } else if (!$(\".next-btn\").attr(\"disabled\")) {\n SetStorage(ScenarioValues);\n window.location.href = pageURL;\n }\n}", "title": "" }, { "docid": "4c58fff77d4b468f74ca990cea35f524", "score": "0.56499636", "text": "function onPopAndStart(){\n //alert(\"The popstate event is triggered!\");\n\n // Read our url and extract the page name\n // the characters after the last slash\n var l = location.href;\n //might need to change this\n var pageName = l.substring(l.lastIndexOf(\"/\")+1);\n\n // if no pageName set pageName to false\n pageName = pageName || false;\n // console.log(\"pageName: \", pageName);\n //and showPage\n showPage(pageName);\n }", "title": "" }, { "docid": "35132ffa0682b84f8998d22c01ad491f", "score": "0.5646146", "text": "function handleClick(e){\n setCurrentPage(Number(e.target.id))\n}", "title": "" }, { "docid": "3d7f626143435125d2b8f531a1c1673a", "score": "0.56286156", "text": "onBrowsingHandler(direction) {\n switch (direction) {\n case \"prev\":\n if (this.state.currPage === 1) {\n return;\n } else {\n this.getPhotos(this.state.currPage - 1);\n }\n break;\n case \"next\":\n this.getPhotos(this.state.currPage + 1);\n break;\n default:\n return this.state;\n }\n }", "title": "" }, { "docid": "4de361232b3e6247e6d75e6f96ff0c0b", "score": "0.5625083", "text": "function onPageClick(pageId) {\n setActivePage(pageId);\n }", "title": "" }, { "docid": "a8a75c4d8e2cf132d83aebe1a4ee7434", "score": "0.55794084", "text": "function on_change_page() {\n\tevent.preventDefault();\n\t// TODO handle real page and not just next/previous link\n\tfetch_page(event.target.href);\n}", "title": "" }, { "docid": "8a3aa66cb875422b5e0bb11dea734f07", "score": "0.5579087", "text": "function goPage(page){\n\tgameContainer.visible=false;\n\tmainContainer.visible=false;\n\tresultPopContainer.visible=false;\t\n\tbgOverlay.visible=bgPop.visible=false;\n\t\n\tswitch(page){\n\t\tcase 'main':\n\t\t\tmainContainer.visible=true;\n\t\tbreak;\n\t\t\n\t\tcase 'game':\n\t\t\tgameContainer.visible=true;\n\t\tbreak;\n\t}\n}", "title": "" }, { "docid": "e228d9bfaa0cd7f122a254c3c616be75", "score": "0.55661136", "text": "function browserScreenTracksClicked() {\r\r\n\tunselect();\r\r\n\t\r\r\n\tif (filterByTracks==0) {\r\r\n\t\tfilterByTracks = 1;\r\r\n\t\t$(\"#tracks\").attr('class', 'browser_button_tracks tracks_active_state');\r\r\n\t\tevent_process(EVENT_ON_TRACKS_BUTTON_CLICK);\r\r\n\t}\r\r\n\telse {\r\r\n\t\tfilterByTracks = 0;\r\r\n\t\t$(\"#tracks\").attr('class', 'browser_button_tracks tracks_normal_state');\r\r\n\t}\r\r\n}", "title": "" }, { "docid": "08f2baadfdeaa52f79328e691dfb04d2", "score": "0.5563035", "text": "onRequestSong(e) {\n\t\t\tthis.props.history.push('/main/search');\n\t\t}", "title": "" }, { "docid": "34a14c5f853807a29580ad855ec133ce", "score": "0.5551176", "text": "function previousTrack(){\n\t\tvar previousTrackButton = $(mPreviousTrackButtonSelector).get(0);\n\t\tsimulateClick(previousTrackButton);\n\t}", "title": "" }, { "docid": "a43779fd69d8839166a4d7912b2f3545", "score": "0.55509514", "text": "function onPlayerStateChange(event) {\n if (event.data == 0) {\n //Hide rating Buttons\n //document.getElementById(\"likeButton\").style.display = \"none\";\n //document.getElementById(\"dislikeButton\").style.display = \"none\";\n //document.getElementById(\"toSurvey\").style.display = \"inline-block\";\n //Automatically go to next page\n nextPage();\n }\n}", "title": "" }, { "docid": "f519a29b051a87dec84ae3a7a2f14e27", "score": "0.55482924", "text": "function onBeforePageChange(){\n triggerEvent(events.onBeforePageChange);\n }", "title": "" }, { "docid": "0c27d326c76d0e3595c2e8e1e7ec9a24", "score": "0.5545411", "text": "function pageTransition() {\n const formState = $('[class~=\\'trail-search-form\\']').attr('class');\n if(formState === 'trail-search-form initial'){ \n \n leaveLanding();\n } \n $('.trail-search-form').addClass('hidden');\n displayResults();\n}", "title": "" }, { "docid": "29b14b2c01d5e7a69107d5160321581d", "score": "0.5524713", "text": "prev(event) {\n this.changePage(this.current - 1, event);\n }", "title": "" }, { "docid": "876c0450b5b9acfd3828b883d4483db1", "score": "0.5521728", "text": "function navigate (event) {\n\tid = event.srcElement.id;\n\tif (id==='home-button') {\n\t window.location.href = '/index.html';\n\t} else if (id==='back-button') {\n\t window.location.href = '/teaching.html'\n\t}\n\treturn false;\n }", "title": "" }, { "docid": "526a5c5cb21992127143f6c1a7569d0b", "score": "0.5521553", "text": "function previousPage() {\n\n var thumbInFullView = true,\n currentIndex = $scope.state.currentPageIndex;\n\n if (cssanimations) {\n thumbnailInTransition = true;\n }\n\n while (thumbInFullView) {\n thumbInFullView = isImageFullyViewable(currentIndex);\n currentIndex--;\n }\n\n $scope.state.currentPageIndex = ++currentIndex;\n setLastViewableImage($scope.state.currentPageIndex);\n }", "title": "" }, { "docid": "9c383209ef08c7f8783574c947b80126", "score": "0.55190355", "text": "returnToLanding() {\n this.props.actions.unsetActiveStory();\n }", "title": "" }, { "docid": "df1a0733419bbeef58b312437fc93c83", "score": "0.55143243", "text": "function onNavigatedTo(args) {\n page = args.object;\n \n //create a reference to the topmost frame for navigation\n topmostFrame = frameMod.topmost();\n\n //make sure you start with zero submit attempts\n submitAttempts = 0; \n\n //get reference to Image element in XML for camera picture\n\tcameraImage = page.getViewById(\"cameraImage\");\n}", "title": "" }, { "docid": "53322730e7d2b412150bc3fe620a7cff", "score": "0.55095714", "text": "function imageClick(url) { window.location = url; }", "title": "" }, { "docid": "2f5c93c2a5e03f1d27905a8ea84833ef", "score": "0.5507752", "text": "function onClick(){\n\tstate = $(this).attr('data-state');\n\tif (state === 'still') {\n\t\tvar animateUrl = $(this).attr('data-animate');\n\t\t$(this).attr('src', animateUrl);\n\t\t$(this).attr('data-state', 'animate');\n\t} else {\n\t\tvar stillUrl = $(this).attr('data-still');\n\t\t$(this).attr('src', stillUrl);\n\t\t$(this).attr('data-state', 'still');\n\t};\n}", "title": "" }, { "docid": "6f445f966507a45cbaee3c8429942db6", "score": "0.5507413", "text": "function startTransition() {\r\n\t\t// when you go next or previous set the previous page number //\r\n\t\tif (magazineDirection==\"prev\") {\r\n\t\t\tpreviousPage = get_CurrentPageNumber()+1;\r\n\t\t} else if (magazineDirection==\"next\") {\r\n\t\t\tpreviousPage = (get_CurrentPageNumber()-1);\r\n\t\t} else {\r\n\t\t\tpreviousPage =null;\r\n\t\t}\r\n\t\t// prepare next page for being attached\r\n\t\tmagazinePageAttachment.preparePage(get_CurrentPageNumber());\r\n\t\t// set animation on transition to true\r\n\t\tset_transitionAnimationBusy(true);\r\n\t}", "title": "" }, { "docid": "b9c894afb20511ce6a86ff64f1e5c720", "score": "0.55058897", "text": "function getCurrentBrowsePage(firstPage)\n{\n // If it is the first time the playlist loads\n if(firstPage === 0) {\n currentBrowsePage = 0;\n }\n\n // Add active class to current page item\n $('.browsePageNoID' + currentBrowsePage).addClass('active');\n\n}", "title": "" }, { "docid": "0b34fb11ae0a241e48cfbc3c720ea6d5", "score": "0.5493027", "text": "onNextTap_() {\n if (this.loading) {\n return;\n }\n this.loading = true;\n this.browserProxy_.userActed(RELATED_INFO_SCREEN_ID, ['next-pressed']);\n }", "title": "" }, { "docid": "3a5ce63e876fd3074cf3a72561d8c9ff", "score": "0.5488048", "text": "function gotoCurrentAlbum() {\n var song = Grooveshark.getCurrentSongStatus().song;\n var album = GS.Models.Album.newOrUpdate({ AlbumID: song.albumID });\n follow(album.toUrl());\n }", "title": "" }, { "docid": "346c3dd24059e458c880ca6da16ce08f", "score": "0.54839665", "text": "function onClicked() {\r\n tablet.gotoWebScreen(APP_URL);\r\n }", "title": "" }, { "docid": "60869cb73a3fdc9505c17de7959f02c3", "score": "0.54832625", "text": "function goToFirst(){\r\n\t//button does not do anything if the user is on the first page set already\r\n\tif (window.currentPageSet != 1) {\r\n\t\t//hide the previous page set\r\n\t\tdocument.getElementById(\"pageSet\"+window.currentPageSet).style.display=\"none\";\r\n\t\t//go to first and load the first page of the first page set\r\n\t\twindow.currentPageSet = 1;\r\n\t\topenFirstPageOfSet();\r\n\t}\r\n}", "title": "" }, { "docid": "81ebc33394c3fcce4097412cfcd92118", "score": "0.5479601", "text": "returnToLanding() {\n this.props.actions.unsetActivePresentation();\n }", "title": "" }, { "docid": "5a98f5fe4750f6ffcaafd2864c7835a2", "score": "0.5477231", "text": "function previousPage() {\r\n if (!isFirstPage()) {\r\n currentPage -= 1;\r\n searchStreams();\r\n }\r\n}", "title": "" }, { "docid": "3adb179be38d0a32de252a91608230ee", "score": "0.5472677", "text": "setRedirect() {\n this.setState({mainArticleClicked: true});\n }", "title": "" }, { "docid": "92aa32cf4a49aaa4fa631aebb6a68b18", "score": "0.5466351", "text": "function GoToSearch() {\n SetLoader();\n window.location.href = \"#indexPage\";\n document.getElementsByName(\"mainframe\")[0].src=\"http://aktienfreunde.net/investment/newInvestment/?afForceMobile=true&afDisableMobileControls=true\";\n}", "title": "" }, { "docid": "aa2d48fec7b4c6cfc93a40a14c1570aa", "score": "0.54621464", "text": "handleBack() {\n if (this.state.page_details == true) { // on property details page\n this.setState({\n page_basics:true,\n page_details:false\n });\n } else { // going to property details page\n this.setState({\n page_details:true,\n page_photos:false\n });\n } \n }", "title": "" }, { "docid": "3e74d56d3875bbafef4879376a04008f", "score": "0.54600495", "text": "function handleInitClicked(url) {\n switch (url) {\n case \"/edit\":\n return(\"/\");\n case \"/notification\":\n return(\"/\");\n case \"/flight\":\n return(\"/\");\n default:\n return(url); // make the clicked button red === marked\n }\n }", "title": "" }, { "docid": "084d1b6ab972dc4885eea58164d92cb8", "score": "0.54544914", "text": "function onClickPrevious() {\n if (currentPage >= 0) {\n currentPage--\n }\n document.getElementById('current-page').value = currentPage + 1\n document.getElementById('current-page').innerText = currentPage + 1\n if (currentPage === 0) {\n document.getElementById('previous-page').classList.add('uk-invisible')\n }\n document.getElementById('next-page').classList.remove('uk-invisible')\n fetchTMEventList(keywords)\n}", "title": "" }, { "docid": "560f72f1ef54bb4d2dfd91aa3e14c0bc", "score": "0.5452486", "text": "function nextScreen(){\n userClicked = false;\n screenState++;\n}", "title": "" }, { "docid": "fa5473b68f5a93a21d731834744ab6ac", "score": "0.5437775", "text": "function init() {\n\tswitchPage(1);\n}", "title": "" }, { "docid": "ccfa15bae414c0aebeb79d1e68ffbec1", "score": "0.54353744", "text": "function changeMedia(){\n checkAndSetMedia();\n}", "title": "" }, { "docid": "fb4b474d3887ed22c3791d5e03b46e25", "score": "0.5431667", "text": "'click .next'(event) {\n FlowRouter.redirect('/artist-selection');\n }", "title": "" }, { "docid": "755b1c82dc65f75f4038727933e4911f", "score": "0.54240924", "text": "function p(){c.goBackToPrevState()}", "title": "" }, { "docid": "8158f93b15f02533bed53f86120d4dd9", "score": "0.54237866", "text": "function goToViewStory() {\n $state.go(\"sample\");\n }", "title": "" }, { "docid": "508f6978e67daa9c9054752d7379d4e8", "score": "0.54212105", "text": "function changePage() {\n $scope.pageInput = $scope.currentPage;\n\n resetImages(function updatePageView() {\n // preload page set\n determinePageSetIndices();\n $scope.preloadImageList = $scope.imagesData.slice(pageSetStartIndex,\n pageSetEndIndex + 1);\n\n updateVisibleImageSet();\n // fetchImages();\n });\n }", "title": "" }, { "docid": "0abf080e8e7a1a34630bf32d6afb72f8", "score": "0.54100937", "text": "function navPageButton(e) {\r\n if (e.id == \"nextBtn\") {\r\n gotoNextPage();\r\n }\r\n else if (e.id == \"prevBtn\") {\r\n gotoPrevPage();\r\n }\r\n}", "title": "" }, { "docid": "9dedfcc2df61eedd52cfd4b2120abd7d", "score": "0.5409891", "text": "refocusPage() {\n\n }", "title": "" }, { "docid": "25dc8b9fab7bab8e245898d507e53f97", "score": "0.5404363", "text": "backToMessagePage() {\n this.setState({ page_showing: \"message\" });\n }", "title": "" }, { "docid": "be051fe1757ada4d7c9fa6cf893a15d7", "score": "0.5399391", "text": "function init(){\n\t\n\t//hide this page function\n\tgetObj(\"toMin\").onclick=function(){\n window.parent.document.getElementById(\"playPage\").style.display=\"none\";\n\t}\n\n}", "title": "" }, { "docid": "b97a1a41f1edb63ca11d62060b447200", "score": "0.53987706", "text": "navigator(newPage) {\n // could change push to \".replace\" see if it makes a difference\n this.props.history.push({ pathname: PAGES_URLS[newPage] });\n if (newPage === PAGES.LOGIN && this.state.isAdmin) {\n if (this.state.mobileOpen) this.setState({ mobileOpen: false });\n // we do not show login page when admin is logged in\n return;\n }\n\n let { slideState, pageToShow } = this.state;\n // if click on link for the same page that we are already on\n if (newPage === pageToShow) {\n // and the carousel is on the second slide\n if (slideState.slideIndex === 1) {\n // we just want to slide back to the first slide with a render\n // e.g. from page 1, slide 2 to slide 1 - Feed page, post slide to list of posts slide\n let newSlideState = this.readPost(\n \"prev\",\n this.state.slideState.itemToShow\n );\n this.setState({ slideState: newSlideState, mobileOpen: false });\n } else {\n // otherwise do nothing because we're already on the first slide of the requested page\n // e.g. page 1, slide 1 - Feed page, list of posts slide\n if (this.state.mobileOpen) this.setState({ mobileOpen: false });\n }\n } else {\n // if switching to another page, do a render to make new page appear;\n // also reset itemToShow (in slideState) to empty\n this.setState({\n pageToShow: newPage,\n slideState: initialSlideState,\n mobileOpen: false,\n });\n }\n }", "title": "" }, { "docid": "4955de3de307be78aaec508725988014", "score": "0.5397553", "text": "refreshPage(){\n //this.playNext();\n }", "title": "" }, { "docid": "013f67a4d472a9e8655c2f4ba913d78d", "score": "0.5393185", "text": "function goPrev() {\n\t location.href = getNewURL(-1);\n}", "title": "" }, { "docid": "bc1513c0a9ed485c871d4389ccdc4cea", "score": "0.53886324", "text": "function rememberCurrentPage() {\n window.localStorage.setItem('moviePage', window.location.href);\n }", "title": "" }, { "docid": "a6a53d0f5495800d78ea67223be85fcd", "score": "0.53863114", "text": "function browserScreenArtistsClicked() {\r\r\n\tunselect();\r\r\n\t\r\r\n\tif (filterByArtist==0) {\r\r\n\t\tfilterByArtist = 1;\r\r\n\t\t$(\"#artists\").attr('class', 'browser_button_artists artists_active_state'); // change button state\r\r\n\t\tevent_process(EVENT_ON_ARTISTS_BUTTON_CLICK);\r\r\n\t}\r\r\n\telse {\r\r\n\t\tfilterByArtist = 0;\r\r\n\t\t$(\"#artists\").attr('class', 'browser_button_artists artists_normal_state'); // change button state\r\r\n\t}\r\r\n}", "title": "" }, { "docid": "46c8ccf57fd5af2e2f9559ca94ffbc02", "score": "0.5381911", "text": "function init() {\n if (history.pushState) {\n\n function setLink(name) {\n if ($$(name, 'link')) {\n $$(name, 'link').onclick = function() {\n return navigate(name);\n }\n }\n }\n\n for (var i = 0; i < sections.length; i++) {\n setLink(sections[i]);\n }\n }\n\n updateDisplay();\n $('video,audio').mediaelementplayer();\n}", "title": "" }, { "docid": "5915c0d47959254d93f22407a50c1886", "score": "0.53700733", "text": "function previous() {\n if (openArticle && openArticle.prev().length) {\n openArticle.prev().find(\".header\").click();\n }\n}", "title": "" }, { "docid": "11e0e9321b0d1a4e5bc67188e6aa7d8d", "score": "0.5367846", "text": "function clickNav(index) {\n currentPage = index\n loadFile(navItems[index][1])\n pageBtnsEnableCheck()\n}", "title": "" }, { "docid": "39e9eabb9c098f97bfac969b15384f71", "score": "0.5366597", "text": "function MenuClicked(mClick) {\n\n\t\t\tvar onpage = false;\n\n\t\t\t// off page link?\n\t\t\tvar path = mClick.pathname;\n\t\t\tif (path.charAt(0) != \"/\") path = \"/\"+path;\n\t\t\tif (path == window.location.pathname || mClick.search != \"\") {\n\t\t\t\tonpage = true;\n\n\t\t\t\t// activate menu item\n\t\t\t\tmClick.blur();\n\n\t\t\t\tif (active) owl.Css.ClassRemove(active, $C.MenuActiveClass);\n\t\t\t\tactive = mClick;\n\t\t\t\towl.Css.ClassApply(active, $C.MenuActiveClass);\n\n\t\t\t\t// update hidden value\n\t\t\t\tvar f = null, v = owl.Dom.Text(mClick);\n\t\t\t\tif (mClick.hash) {\n\t\t\t\t\tf = owl.Dom.Get(mClick.hash);\n\t\t\t\t\tif (f.length == 1) {\n\t\t\t\t\t\tf = f[0];\n\t\t\t\t\t\tif (f.value || f.value == \"\") f.value = v;\n\t\t\t\t\t}\n\t\t\t\t\telse f = null;\n\t\t\t\t}\n\n\t\t\t\t// handler function\n\t\t\t\tif (typeof $C.ClickFunction == \"function\") $C.ClickFunction(mClick, f, v);\n\t\t\t}\n\n\t\t\treturn onpage;\n\n\t\t}", "title": "" }, { "docid": "70b6297a82ca3b2d80ab0bac6e860055", "score": "0.5363821", "text": "function _showPreviousPage(page) {\n RightMenu.showRightMenu(page, null);\n }", "title": "" }, { "docid": "2ff7031dbf99ce04f42cd6a9c58a89ec", "score": "0.5362935", "text": "goToFirstPage() {\n //join the first page room\n this.goToPage(1);\n }", "title": "" }, { "docid": "a92276fe81613a9756e589e7af743725", "score": "0.5356046", "text": "function initialClick() {\n if (playing === false) {\n start = new Date().getTime();\n setTimer();\n playing = true;\n }\n}", "title": "" }, { "docid": "f6f1635051368a4784659a15acbac2a1", "score": "0.53534955", "text": "function mousePressed() {\n limestone.mousePressed();\n\n if (state === `start`) { // If the start screen is displayed a mouse click will trigger the play state\n state = `play`;\n }\n}", "title": "" }, { "docid": "ad33ccee6e9944467eedf5640e600d4f", "score": "0.53506964", "text": "function prevClick(pageNumber) {\n const prev = Math.ceil((pageNumber - 5) / pageCount);\n const movePage = 1 + (5 * (prev - 1));\n console.log(movePage);\n paging(movePage, savingPage);\n}", "title": "" }, { "docid": "de2d987b549fa43feb10a5cc286f6303", "score": "0.5333558", "text": "function handlePreviousState(session) {\r\n\tif (session.context.previousState == \"unknown_attachment_recieved\") {\r\n\r\n\t}\r\n}", "title": "" }, { "docid": "832a3b1ce81c79ca3d383139b14319e1", "score": "0.53297406", "text": "function onPlay() {\r\n state = play;\r\n}", "title": "" }, { "docid": "77efdf264ea8d58909071841341c0172", "score": "0.53257245", "text": "function navprev(prev) {\n //console.log(prev);\n $(\":mobile-pagecontainer\").pagecontainer(\"change\", prev + \".html\", {\n transition: \"slide\",\n reverse: true\n });\n\n }", "title": "" }, { "docid": "910d781dff443769d1d8a9fa92615af3", "score": "0.53235734", "text": "goToPrevPage(event) {\n event.preventDefault();\n this.transitionPage('backward')\n }", "title": "" }, { "docid": "a220ae4e071ad815f086eacf5f4a9a61", "score": "0.5321399", "text": "function goPage() {\n\tif (gV(gI(\"gz-select-pagination\")) != \"\")\n\t\tgoTo(\"/\" + gz_screen + \"/\" + (gz_code != \"\" ? gz_code + \"/\" : \"\") + \n\t\t\t\tgV(gI(\"gz-select-pagination\")));\n}", "title": "" }, { "docid": "6dec5a4986ce41e48527fefa997ca049", "score": "0.5318296", "text": "function whatNext() {\n $ionicTabsDelegate.select(0);\n $state.go(\"menu.whatNext\");\n }", "title": "" }, { "docid": "0103b58368fd628501987b0bce435c8b", "score": "0.5317675", "text": "function navFavoriteClicked(evt){\n console.debug(\"navFavoriteClicked\", evt);\n hidePageComponents();\n putFavoriteStoryOnPage();\n}", "title": "" }, { "docid": "21f8d651698dd4c2f1d00052df994282", "score": "0.5317361", "text": "function multiPlayerPageInit() {\r\n // to do \r\n}", "title": "" }, { "docid": "c65cc7c23b9c522021e2e576d9c39d39", "score": "0.5316217", "text": "function MarketPlaceButtonClickHandler()\n{\n SlideToPage(\"jobtypeselectionmenu.html\")\n}", "title": "" }, { "docid": "35324cdd20e3de61d36aaee6f366fc4a", "score": "0.5305266", "text": "function goToPreviousSlide(){\n myPresentation.goToPreviousSlide();\n displayNumberCurrentSlide();\n updateNote();\n updateSlideMenu();\n}", "title": "" }, { "docid": "9ab819e62c7dfa232c2fe37744a5e618", "score": "0.5301682", "text": "previousClicked() {\n if(this.get('page') > 0) {\n this.set('page', this.get('page') - 1);\n }\n }", "title": "" }, { "docid": "71389dd56e86fa7e7380c1c378bfb938", "score": "0.5296631", "text": "function showPreviousPhoto() {\n if (state.photoIndex - 1 >= 0) {\n state.photoIndex -= 1;\n state.openedPhoto = photoUrls[state.photoIndex];\n\n showOpenedPhoto(true);\n }\n }", "title": "" }, { "docid": "debcdf950df3d1a66800f99cebc756bc", "score": "0.52954304", "text": "function stateInitialClicktagHandler(e) {\n callStateResolve();\n if (isPremessaging) {\n Enabler.exit(\"clickTag1\");\n } else {\n Enabler.exit(\"clickTag2\");\n }\n\n}", "title": "" }, { "docid": "4e4427ec9a0d2542b8a53b14e86597bd", "score": "0.5295137", "text": "function clickGoPre(){\r\n\tupdateHistMovePre();\r\n\tzTreeSelectNodeById(BList, Hist.visitedIds[Hist.curIndex]);\r\n}", "title": "" }, { "docid": "04a7eef47f98b5df496e113024f9aea0", "score": "0.5294043", "text": "function goToPreviousPage() {\n if (firstPage > 1) {\n firstPage--;\n if (flagSearch === true) {\n CustomSearchService();\n } else {\n getProductListData();\n }\n } else if (firstPage === 1) {\n ProductListScreen.prev.setVisibility(false);\n }\n}", "title": "" }, { "docid": "268045f9d39bda8f4834ccb7df1416bf", "score": "0.5290672", "text": "back() {\n if (this.data.isFromShare) {\n wx.navigateTo({\n url: '../index/index'\n })\n } else {\n wx.navigateBack()\n }\n }", "title": "" }, { "docid": "483ffea2d61e8a8a56093b60e195e560", "score": "0.52882785", "text": "function gotoFirstPage(){\n\tgotoTargetPage(1);\n}", "title": "" }, { "docid": "31159bebaef1f9e365d493d537df2c06", "score": "0.528747", "text": "function journalForwardClick() {\n if(journalPageNumber < 5) goToJournalPage((journalPageNumber + 1));\n}", "title": "" }, { "docid": "631fea906685e68b54ca99125022f7b0", "score": "0.5286676", "text": "function navigateTo(where)\n{\n console.log('Navigating to '+where);\n\n // prevent this if user is in an input field or similar area\n if (document.activeElement.tagName != \"BODY\") return;\n\n // get the element that contains the proper link\n var goWhereButton = document.getElementById('go-'+where);\n // link doesn't exist:\n if (goWhereButton==null) return;\n\n if (!cSpot.presentation) {\n alert('c-SPOT not ready yet, please try again!');\n return;\n }\n\n\n // fade background and show spinner, but not in presentation mode!\n if ( document.baseURI.search('/present')<10 )\n showSpinner();\n\n // in (lyrics) presentation Mode, do we want a blank slide between items?\n if ( cSpot.presentationType=='lyrics' && cSpot.presentation.configBlankSlides && cSpot.presentation.screenBlank ) {\n cSpot.presentation.screenBlank = false;\n // check if there is an empty slide/item (an item without lyrics, bibletext or images)\n var reg = /^[\\s]+$/; // regex for a string containing only white space.\n var main = $('#main-content').text();\n // check if there are images\n var images = $('.slide-background-image');\n // if the slide contains anything but spaces, we were still presenting something\n // and we now show an empty (blank) slide\n if (! reg.test(main) || images) {\n if ( cSpot.presentation.configImageSlide ) {\n ;;;console.log('inserting IMAGE slide on blank page...');\n $('#main-content').html(\n '<img src=\"' + cSpot.appURL + \n '/images/background/blankslideimage.jpg\" ' +\n 'class=\"song-background-image\" ' +\n 'style=\"max-height:' + $('#main-content').css('height') + '\">'\n );\n } else {\n ;;;console.log('inserting empty slide...');\n $('#main-content').html('<div>.</div>');\n }\n // hide current slide title to indicate blank slide\n $('#item-navbar-label').hide();\n $('#show-blank-screen').addClass('ui-state-active')\n return;\n }\n console.log('slide was already empty, proceeding to next item...');\n // otherwise, if the slide/item was empty anyway, we proceed to the next item\n }\n\n // if configured, show blank screen after next item\n cSpot.presentation.screenBlank = true;\n\n\n\n /* For OFFLINE MODE: check if the next (or previous) item is cached in LocalStorage\n */\n if ( where!='edit' && where!='back' && cSpot.presentation.useOfflineMode) {\n\n // get the current item identification values\n var cur_seq_no = 1.0*cSpot.presentation.seq_no; // dynamic value (will be changed below or on reload)\n var max_seq_no = 1.0*cSpot.presentation.max_seq_no; // static value\n var cur_plan_id = 'offline-'+cSpot.presentation.plan_id; // static value\n var next_seq_no, prev_seq_no;\n\n // calculate the identifiers for the next or previous item in local storage\n var fsn = calculateFollowingSeqNos(cur_seq_no, cur_plan_id);\n next_seq_no = fsn[0];\n prev_seq_no = fsn[1];\n\n // Rewrite the page content with the cached data from Local Storage (LS)\n if (where == 'next-item')\n ;;;console.log('Next page from cache would be: '+next_seq_no);\n\n // test if direction is forward and if next item exists in LS\n if ( where == 'next-item' && isInLocalStore(next_seq_no) ) {\n\n // write cached data into the DOM\n writeCachedDataIntoDOM( next_seq_no );\n\n // re-apply locally defined text formatting\n applyLocallyDefinedTextFormatting();\n\n // maintain the correct item sequence number for the just inserted slides\n cSpot.presentation.seq_no = next_seq_no.split('-')[2];\n\n // modify the next-item button to reflect the new item in the url\n modifyHRefOfJumpbutton(next_seq_no, prev_seq_no)\n\n // show new location in DropUp menu\n $('.dropdown-item.nowrap').removeClass('bg-info')\n $('#menu-item-seq-no-'+cSpot.presentation.seq_no+'\\\\.0').addClass('bg-info');\n\n // show title again (if it was hidden because of blank slide)\n $('#item-navbar-label').show();\n\n return;\n }\n\n if (where == 'previous-item')\n ;;;console.log('Previous page from cache would be: '+prev_seq_no);\n\n // test if direction is backward and if previous item exists in LS\n if ( where == 'previous-item' && isInLocalStore(prev_seq_no) ) {\n\n // write cached data into the DOM\n writeCachedDataIntoDOM(prev_seq_no);\n\n // re-apply locally defined text formatting\n applyLocallyDefinedTextFormatting();\n\n // maintain the correct item sequence number for the just inserted slides\n cSpot.presentation.seq_no = prev_seq_no.split('-')[2];\n\n // modify the previous-item button to reflect the new item in the url\n modifyHRefOfJumpbutton(next_seq_no, prev_seq_no)\n\n // show title again (if it was hidden because of blank slide)\n $('#item-navbar-label').show();\n\n return;\n }\n }\n\n var goWhere = $(goWhereButton).attr('href');\n\n if (goWhere != '#')\n // inform server of current position if we are presenter\n sendShowPosition(where);\n else {\n $('#show-spinner').modal('hide');\n return;\n }\n\n if (goWhereButton.href) {\n // try to go to the location defined in href\n window.location.href = goWhere;\n return;\n }\n // otherwise, try to simulate a click on this element\n goWhereButton.click();\n}", "title": "" }, { "docid": "86f54165477f728fba1c3231c08cb878", "score": "0.52842796", "text": "function goto(n,init) {\n if (n>=Object.keys(pages).length) return;\n if (n<0) return;\n if (n===course.page) return;\n if (course.navlock && !init) {\n var msgs = [], current = pages[n].title, i = n-1;\n while (i>-1) {\n if (pages[i].score>0 && !pages[i].completed) {\n msgs.push(pages[i].title);\n }\n i--;\n }\n if (msgs.length > 0) {\n alert(\"Before you can load \\\"\" + current + \"\\\", you need to complete these pages:\\n\\n\\u2022\" + msgs.join(\"\\n\\u2022\"));\n return;\n }\n }\n course.page=n;\n\t[].forEach.call(document.querySelectorAll(\"audio\"), function (el) { el.pause(); });\n load();\n}", "title": "" } ]
72c081edf05762fa949c245c43977439
ax^2 + bx + c
[ { "docid": "0f30f8f049f97c6e24322de542511128", "score": "0.0", "text": "function Raices(a, b, c){\n\n var Discriminante = b*b - 4 * a * c;\n var RaizDiscriminante;\n var RaizReal1, RaizReal2, RaizImaginaria1, RaizImaginaria2;\n var DobleA = 2 * a;\n\n if(Discriminante > 0){\n var RaizDiscriminante = Math.sqrt(Discriminante);\n var RaizReal1 = (-b + RaizDiscriminante) / DobleA;\n var RaizReal2 = (-b - RaizDiscriminante) / DobleA;\n var RaizImaginaria1 = 0;\n var RaizImaginaria2 = 0;\n }else{\n var RaizDiscriminante = Math.sqrt(-Discriminante);\n var RaizReal1 = -b / DobleA;\n var RaizReal2 = -b / DobleA;\n var RaizImaginaria1 = RaizDiscriminante / DobleA;\n var RaizImaginaria2 = -RaizDiscriminante / DobleA;\n }\n\n return [[RaizReal1, RaizImaginaria1], [RaizReal2, RaizImaginaria2]];\n}", "title": "" } ]
[ { "docid": "dddde6c00046672bff4e05f73f27e1c5", "score": "0.676662", "text": "function prodEsc(_ax1, _ay1, _bx1, _by1) \n{\n\tvar resultado =\t(_ax1 * _bx1) +\t(_ay1 * _by1 );\n\treturn resultado;\n}", "title": "" }, { "docid": "0ef7257c7812bf39daec48379c5e76b6", "score": "0.64559036", "text": "function calcYECC(x)\n{\n\tvar y;\n\ty = Math.sqrt(Math.pow(x, 3) + a*x + b);\n\treturn y;\n}", "title": "" }, { "docid": "3dd0479738b2620bcdc179395b96d13a", "score": "0.6450017", "text": "function pitagoras (x, y) {\n var c = (x * x) + (y * y);\n console.log(\"pitagoras lygus: \", c);\n}", "title": "" }, { "docid": "c55916d41b7a7d085f86edb93e4c45af", "score": "0.6401643", "text": "function transmogrifier(a,b,c) {\n\treturn Math.pow((a * b), c);\n}", "title": "" }, { "docid": "b03c1359a5aaddb7351f40fec8a1a238", "score": "0.6263734", "text": "g2cX(x) {\n return (3 * x + 1) * this.basePX;\n }", "title": "" }, { "docid": "e8609d4bceebaa8786a17b3fd474f894", "score": "0.6203483", "text": "function transmogrifier (a, b, c) {\n var product = Math.pow(a * b, c);\n return product;\n}", "title": "" }, { "docid": "8cc6ed20d84044006f429a4aa16ca9e8", "score": "0.61463046", "text": "function ccw(xa, ya, xb, yb, xc, yc) {\n\treturn (yb - ya) * (xc - xa) - (xb - xa) * (yc - ya);\n}", "title": "" }, { "docid": "e765005a7acb518af2614def82fa6544", "score": "0.61228454", "text": "function transmogrifier(x,y,z){\n\treturn Math.pow((x*y),z);\n}", "title": "" }, { "docid": "307d10688ed56664807f16518847ecd6", "score": "0.6117888", "text": "function complexCalc (x,y) {\n\tvar result = 0; /*初始值*/\n\tresult = x*y;\n\tresult = result/(x-y);\n\tresult = result* y - x; \n\treturn result;\n}", "title": "" }, { "docid": "7a7612859ec8ec29ddb1731c9e894b81", "score": "0.6100476", "text": "function cmn(q, a, b, x, s, t)\r\n{\r\n return add(rol(add(add(a, q), add(x, t)), s), b);\r\n}", "title": "" }, { "docid": "d6da1a26715a1e1def9d4da69f165256", "score": "0.60843736", "text": "function positiveQuadratic(a,b,c) {\n \n return(1/(2*a)) * (-b + (Math.sqrt((Math.pow(b,2)) - (4*a*c))));\n \n}", "title": "" }, { "docid": "978e750a272e5530b0e255390313c1d1", "score": "0.602788", "text": "function cmn(q, a, b, x, s, t)\r\n{\r\n return add(rol(add(add(a, q), add(x, t)), s), b);\r\n}", "title": "" }, { "docid": "978e750a272e5530b0e255390313c1d1", "score": "0.602788", "text": "function cmn(q, a, b, x, s, t)\r\n{\r\n return add(rol(add(add(a, q), add(x, t)), s), b);\r\n}", "title": "" }, { "docid": "2ad1fde20427791c8377de0074ef74e6", "score": "0.60248613", "text": "function pythag(a, b) {\n \t cSquared= a*a +b*b; //a squared + b squared = c squared \n \t return Math.sqrt(cSquared); //return c, the sqrt of c^2\n}", "title": "" }, { "docid": "1d4d728305dac6334649a8a89ad6238b", "score": "0.60244274", "text": "function transmogrifier( x , y , z ) {\n return Math.pow( ( x * y ) , z );\n}", "title": "" }, { "docid": "171281e8ed1f6c4ec0f1b8c978425fae", "score": "0.60208946", "text": "function cmn(q, a, b, x, s, t)\r\n{\r\n return add(rol(add(add(a, q), add(x, t)), s), b);\r\n}", "title": "" }, { "docid": "c7405b8fb7b5b5333ca825706a353583", "score": "0.60122085", "text": "function ccw(a, b, c) {\r\n return (a[0] * (b[1] - c[1]) - a[1] * (b[0] - c[0])\r\n + (b[0] * c[1] - b[1] * c[0])) < 0;\r\n}", "title": "" }, { "docid": "e39489e395b3f9633f29b25f40f7c445", "score": "0.59953415", "text": "function ca(a){this.c=Math.exp(Math.log(.5)/a);this.a=this.b=0}", "title": "" }, { "docid": "81c1c99ced0ff2b5d19d03984bf22a3e", "score": "0.5990032", "text": "function ease_mix(x, y, a) //6x^5-15x^4+10x^3\n{\n var ia = (1.0-a);\n var ret = (6.0*Math.pow(ia,5)-15.0*Math.pow(ia, 4)+10.0*Math.pow(ia,3))*x+(6.0*Math.pow(a,5)-15.0*Math.pow(a, 4)+10.0*Math.pow(a,3))*y;\n return ret;\n}", "title": "" }, { "docid": "10c286290640dfebac8d954201237711", "score": "0.5979117", "text": "function solveLinEquation(a, b, c) {\n var x = (c - b) / a;\n return x;\n}", "title": "" }, { "docid": "c8fa113c21c03b3f4f97bf76211aae34", "score": "0.59761655", "text": "function am2(i, x, w, j, c, n) {\n\t\tvar xl = x & 0x7fff, xh = x >> 15;\n\t\twhile (--n >= 0) {\n\t\t\tvar l = this[i] & 0x7fff;\n\t\t\tvar h = this[i++] >> 15;\n\t\t\tvar m = xh * l + h * xl;\n\t\t\tl = xl * l + ((m & 0x7fff) << 15) + w[j] + (c & 0x3fffffff);\n\t\t\tc = (l >>> 30) + (m >>> 15) + xh * h + (c >>> 30);\n\t\t\tw[j++] = l & 0x3fffffff;\n\t\t}\n\t\treturn c;\n\t}", "title": "" }, { "docid": "ff78b9044aa5f555ad5acbeb34e40b32", "score": "0.59619385", "text": "function cmn(q, a, b, x, s, t){\n\t\t return add(rol(add(add(a, q), add(x, t)), s), b);\n\t\t}", "title": "" }, { "docid": "84d66b776c52fac8e17dc74a90c6e3a0", "score": "0.5961025", "text": "function cmn(q, a, b, x, s, t) {\n var a$1 = ((a + q | 0) + x | 0) + t | 0;\n return ((a$1 << s) | (a$1 >>> (32 - s | 0)) | 0) + b | 0;\n }", "title": "" }, { "docid": "07ea3c4905872b2245736896a107e8f6", "score": "0.5952841", "text": "function x2(px,qx) {\n return px*px+px*qx+qx*qx;\n}", "title": "" }, { "docid": "9afffedd6a26afae12f2966d52db077f", "score": "0.59496945", "text": "function derive(a,b){\n let c = a * b\n return `${c}x^${b-1}`\n}", "title": "" }, { "docid": "32841310bffa3b9d2fe47054f2cb1027", "score": "0.5936718", "text": "function am2(i, x, w, j, c, n) {\r\n var xl = x & 0x7fff,\r\n xh = x >> 15\r\n while (--n >= 0) {\r\n var l = this[i] & 0x7fff\r\n var h = this[i++] >> 15\r\n var m = xh * l + h * xl\r\n l = xl * l + ((m & 0x7fff) << 15) + w[j] + (c & 0x3fffffff)\r\n c = (l >>> 30) + (m >>> 15) + xh * h + (c >>> 30)\r\n w[j++] = l & 0x3fffffff\r\n }\r\n return c\r\n }", "title": "" }, { "docid": "836c94e33a8d01fa81daea23c9435f74", "score": "0.5930423", "text": "function Zc(a,b){return Xc(this,a,b,-1)}", "title": "" }, { "docid": "836c94e33a8d01fa81daea23c9435f74", "score": "0.5930423", "text": "function Zc(a,b){return Xc(this,a,b,-1)}", "title": "" }, { "docid": "836c94e33a8d01fa81daea23c9435f74", "score": "0.5930423", "text": "function Zc(a,b){return Xc(this,a,b,-1)}", "title": "" }, { "docid": "836c94e33a8d01fa81daea23c9435f74", "score": "0.5930423", "text": "function Zc(a,b){return Xc(this,a,b,-1)}", "title": "" }, { "docid": "836c94e33a8d01fa81daea23c9435f74", "score": "0.5930423", "text": "function Zc(a,b){return Xc(this,a,b,-1)}", "title": "" }, { "docid": "92724781838b652ef7cee9ff8979829b", "score": "0.5926493", "text": "function am2(i, x, w, j, c, n)\n\t {\n\t var xl = x & 0x7fff,\n\t xh = x >> 15;\n\t while (--n >= 0)\n\t {\n\t var l = this[i] & 0x7fff;\n\t var h = this[i++] >> 15;\n\t var m = xh * l + h * xl;\n\t l = xl * l + ((m & 0x7fff) << 15) + w[j] + (c & 0x3fffffff);\n\t c = (l >>> 30) + (m >>> 15) + xh * h + (c >>> 30);\n\t w[j++] = l & 0x3fffffff;\n\t }\n\t return c;\n\t }", "title": "" }, { "docid": "d9e3fd9ba6b305d4ac5e2a00677d54fd", "score": "0.59001863", "text": "function am2(i, x, w, j, c, n) {\n\t var xl = x & 0x7fff, xh = x >> 15;\n\t while (--n >= 0) {\n\t var l = this[i] & 0x7fff;\n\t var h = this[i++] >> 15;\n\t var m = xh * l + h * xl;\n\t l = xl * l + ((m & 0x7fff) << 15) + w[j] + (c & 0x3fffffff);\n\t c = (l >>> 30) + (m >>> 15) + xh * h + (c >>> 30);\n\t w[j++] = l & 0x3fffffff;\n\t }\n\t return c;\n\t}", "title": "" }, { "docid": "d9e3fd9ba6b305d4ac5e2a00677d54fd", "score": "0.59001863", "text": "function am2(i, x, w, j, c, n) {\n\t var xl = x & 0x7fff, xh = x >> 15;\n\t while (--n >= 0) {\n\t var l = this[i] & 0x7fff;\n\t var h = this[i++] >> 15;\n\t var m = xh * l + h * xl;\n\t l = xl * l + ((m & 0x7fff) << 15) + w[j] + (c & 0x3fffffff);\n\t c = (l >>> 30) + (m >>> 15) + xh * h + (c >>> 30);\n\t w[j++] = l & 0x3fffffff;\n\t }\n\t return c;\n\t}", "title": "" }, { "docid": "60223226589db3ddc48c01d51562abde", "score": "0.58992505", "text": "function computeA(b) {\n\treturn (x - h) + ((y - b) * (2 * h - x) / y);\n}", "title": "" }, { "docid": "3ce33fb2f2580e679008c747880026b3", "score": "0.58971214", "text": "function linComb_(x,y,a,b) {\n var i,c,k,kk;\n k=x.length<y.length ? x.length : y.length;\n kk=x.length;\n for (c=0,i=0;i<k;i++) {\n c+=a*x[i]+b*y[i];\n x[i]=c & mask;\n c = (c - x[i]) / radix;\n }\n for (i=k;i<kk;i++) {\n c+=a*x[i];\n x[i]=c & mask;\n c = (c - x[i]) / radix;\n }\n }", "title": "" }, { "docid": "12cf745d648d99fb095f453122e9b2cf", "score": "0.58962643", "text": "function am2(i, x, w, j, c, n) {\n var xl = x & 0x7fff,\n xh = x >> 15;\n while (--n >= 0) {\n var l = this[i] & 0x7fff;\n var h = this[i++] >> 15;\n var m = xh * l + h * xl;\n l = xl * l + ((m & 0x7fff) << 15) + w[j] + (c & 0x3fffffff);\n c = (l >>> 30) + (m >>> 15) + xh * h + (c >>> 30);\n w[j++] = l & 0x3fffffff;\n }\n return c;\n }", "title": "" }, { "docid": "c49ba1ed718c9ad0be6f530463d59d22", "score": "0.5886199", "text": "function acost(c) {\n if (c > 1) {\n c = 1;\n } else if (c < -1) {\n c = -1;\n }\n return acos(c);\n}", "title": "" }, { "docid": "1369731494a8d4510e30e1ed6f3c1103", "score": "0.58771574", "text": "function ze(a,b,c){var d=Mb(b[1]),e=Mb(c[1]),f=(e-d)/2;b=Mb(c[0]-b[0])/2;d=Math.sin(f)*Math.sin(f)+Math.sin(b)*Math.sin(b)*Math.cos(d)*Math.cos(e);return 2*a.radius*Math.atan2(Math.sqrt(d),Math.sqrt(1-d))}", "title": "" }, { "docid": "f1fcb5c6ed8308e7e5181705b5f043b7", "score": "0.5871349", "text": "function f(a, b, c) {\n a = a|0;\n b = b|0;\n c = c|0;\n var r = 0;\n r = a + ((b << 1) + c) | 0;\n return r|0;\n}", "title": "" }, { "docid": "1796d41c00107a4368ce19ea3188dab1", "score": "0.58573174", "text": "function pythagoreanTheorem(a, b) {\n // Pythagorean Theorem: a2 + b2 = c2\n var cSqr = Math.pow(a,2) + Math.pow(b,2);\n var c = Math.sqrt(cSqr);\n //display c\n console.log(c);\n}", "title": "" }, { "docid": "1dae1689ae8f6429f42ec278e5e2c18e", "score": "0.5846969", "text": "function am1(i, x, w, j, c, n) {\r\n while (--n >= 0) {\r\n var v = x * this[i++] + w[j] + c\r\n c = Math.floor(v / 0x4000000)\r\n w[j++] = v & 0x3ffffff\r\n }\r\n return c\r\n }", "title": "" }, { "docid": "3cb079f3b3395641a79703093d6e239e", "score": "0.5841604", "text": "function Bx(t) { return (1-t)*(1-t)*x1 + 2*(1-t)*t*x3 + t*t*x2; }", "title": "" }, { "docid": "d7ee98ec79a5da880e8c1f00fdc2aae6", "score": "0.5840762", "text": "function cmn(q, a, b, x, s, t)\n{\n return add(rol(add(add(a, q), add(x, t)), s), b);\n}", "title": "" }, { "docid": "d7ee98ec79a5da880e8c1f00fdc2aae6", "score": "0.5840762", "text": "function cmn(q, a, b, x, s, t)\n{\n return add(rol(add(add(a, q), add(x, t)), s), b);\n}", "title": "" }, { "docid": "d7ee98ec79a5da880e8c1f00fdc2aae6", "score": "0.5840762", "text": "function cmn(q, a, b, x, s, t)\n{\n return add(rol(add(add(a, q), add(x, t)), s), b);\n}", "title": "" }, { "docid": "d08bd921eacce46917539cf50513563e", "score": "0.583921", "text": "function axpby(a, v, b, w){\n return {\n x: a * v.x + b * w.x,\n y: a * v.y + b * w.y\n };\n}", "title": "" }, { "docid": "60c4c042b90bddbfa900d966467f9fc2", "score": "0.5828425", "text": "function am2(i, x, w, j, c, n) {\n var xl = x & 0x7fff,\n xh = x >> 15;\n while (--n >= 0) {\n var l = this[i] & 0x7fff;\n var h = this[i++] >> 15;\n var m = xh * l + h * xl;\n l = xl * l + ((m & 0x7fff) << 15) + w[j] + (c & 0x3fffffff);\n c = (l >>> 30) + (m >>> 15) + xh * h + (c >>> 30);\n w[j++] = l & 0x3fffffff;\n }\n return c;\n }", "title": "" }, { "docid": "60c4c042b90bddbfa900d966467f9fc2", "score": "0.5828425", "text": "function am2(i, x, w, j, c, n) {\n var xl = x & 0x7fff,\n xh = x >> 15;\n while (--n >= 0) {\n var l = this[i] & 0x7fff;\n var h = this[i++] >> 15;\n var m = xh * l + h * xl;\n l = xl * l + ((m & 0x7fff) << 15) + w[j] + (c & 0x3fffffff);\n c = (l >>> 30) + (m >>> 15) + xh * h + (c >>> 30);\n w[j++] = l & 0x3fffffff;\n }\n return c;\n }", "title": "" }, { "docid": "0641b0f421bdc8b7f74850cafca1241d", "score": "0.5822254", "text": "function daxpy(y, a, x) {\n for (var i=0; i<y.length; ++i)\n y[i] += a * x[i];\n return y;\n }", "title": "" }, { "docid": "c9f1c099ad0b860d6cba163ea3bc5124", "score": "0.58171105", "text": "function linComb_(x,y,a,b) {\n var i,c,k,kk;\n k=x.length<y.length ? x.length : y.length;\n kk=x.length;\n for (c=0,i=0;i<k;i++) {\n c+=a*x[i]+b*y[i];\n x[i]=c & mask;\n c>>=bpe;\n }\n for (i=k;i<kk;i++) {\n c+=a*x[i];\n x[i]=c & mask;\n c>>=bpe;\n }\n }", "title": "" }, { "docid": "9588b279917372b1d6f4e0bdc700f7a9", "score": "0.58052224", "text": "function am2(i, x, w, j, c, n) {\n var xl = x & 0x7fff,\n xh = x >> 15\n while (--n >= 0) {\n var l = this[i] & 0x7fff\n var h = this[i++] >> 15\n var m = xh * l + h * xl\n l = xl * l + ((m & 0x7fff) << 15) + w[j] + (c & 0x3fffffff)\n c = (l >>> 30) + (m >>> 15) + xh * h + (c >>> 30)\n w[j++] = l & 0x3fffffff\n }\n return c\n}", "title": "" }, { "docid": "9588b279917372b1d6f4e0bdc700f7a9", "score": "0.58052224", "text": "function am2(i, x, w, j, c, n) {\n var xl = x & 0x7fff,\n xh = x >> 15\n while (--n >= 0) {\n var l = this[i] & 0x7fff\n var h = this[i++] >> 15\n var m = xh * l + h * xl\n l = xl * l + ((m & 0x7fff) << 15) + w[j] + (c & 0x3fffffff)\n c = (l >>> 30) + (m >>> 15) + xh * h + (c >>> 30)\n w[j++] = l & 0x3fffffff\n }\n return c\n}", "title": "" }, { "docid": "9588b279917372b1d6f4e0bdc700f7a9", "score": "0.58052224", "text": "function am2(i, x, w, j, c, n) {\n var xl = x & 0x7fff,\n xh = x >> 15\n while (--n >= 0) {\n var l = this[i] & 0x7fff\n var h = this[i++] >> 15\n var m = xh * l + h * xl\n l = xl * l + ((m & 0x7fff) << 15) + w[j] + (c & 0x3fffffff)\n c = (l >>> 30) + (m >>> 15) + xh * h + (c >>> 30)\n w[j++] = l & 0x3fffffff\n }\n return c\n}", "title": "" }, { "docid": "9588b279917372b1d6f4e0bdc700f7a9", "score": "0.58052224", "text": "function am2(i, x, w, j, c, n) {\n var xl = x & 0x7fff,\n xh = x >> 15\n while (--n >= 0) {\n var l = this[i] & 0x7fff\n var h = this[i++] >> 15\n var m = xh * l + h * xl\n l = xl * l + ((m & 0x7fff) << 15) + w[j] + (c & 0x3fffffff)\n c = (l >>> 30) + (m >>> 15) + xh * h + (c >>> 30)\n w[j++] = l & 0x3fffffff\n }\n return c\n}", "title": "" }, { "docid": "9588b279917372b1d6f4e0bdc700f7a9", "score": "0.58052224", "text": "function am2(i, x, w, j, c, n) {\n var xl = x & 0x7fff,\n xh = x >> 15\n while (--n >= 0) {\n var l = this[i] & 0x7fff\n var h = this[i++] >> 15\n var m = xh * l + h * xl\n l = xl * l + ((m & 0x7fff) << 15) + w[j] + (c & 0x3fffffff)\n c = (l >>> 30) + (m >>> 15) + xh * h + (c >>> 30)\n w[j++] = l & 0x3fffffff\n }\n return c\n}", "title": "" }, { "docid": "9588b279917372b1d6f4e0bdc700f7a9", "score": "0.58052224", "text": "function am2(i, x, w, j, c, n) {\n var xl = x & 0x7fff,\n xh = x >> 15\n while (--n >= 0) {\n var l = this[i] & 0x7fff\n var h = this[i++] >> 15\n var m = xh * l + h * xl\n l = xl * l + ((m & 0x7fff) << 15) + w[j] + (c & 0x3fffffff)\n c = (l >>> 30) + (m >>> 15) + xh * h + (c >>> 30)\n w[j++] = l & 0x3fffffff\n }\n return c\n}", "title": "" }, { "docid": "9588b279917372b1d6f4e0bdc700f7a9", "score": "0.58052224", "text": "function am2(i, x, w, j, c, n) {\n var xl = x & 0x7fff,\n xh = x >> 15\n while (--n >= 0) {\n var l = this[i] & 0x7fff\n var h = this[i++] >> 15\n var m = xh * l + h * xl\n l = xl * l + ((m & 0x7fff) << 15) + w[j] + (c & 0x3fffffff)\n c = (l >>> 30) + (m >>> 15) + xh * h + (c >>> 30)\n w[j++] = l & 0x3fffffff\n }\n return c\n}", "title": "" }, { "docid": "9588b279917372b1d6f4e0bdc700f7a9", "score": "0.58052224", "text": "function am2(i, x, w, j, c, n) {\n var xl = x & 0x7fff,\n xh = x >> 15\n while (--n >= 0) {\n var l = this[i] & 0x7fff\n var h = this[i++] >> 15\n var m = xh * l + h * xl\n l = xl * l + ((m & 0x7fff) << 15) + w[j] + (c & 0x3fffffff)\n c = (l >>> 30) + (m >>> 15) + xh * h + (c >>> 30)\n w[j++] = l & 0x3fffffff\n }\n return c\n}", "title": "" }, { "docid": "9588b279917372b1d6f4e0bdc700f7a9", "score": "0.58052224", "text": "function am2(i, x, w, j, c, n) {\n var xl = x & 0x7fff,\n xh = x >> 15\n while (--n >= 0) {\n var l = this[i] & 0x7fff\n var h = this[i++] >> 15\n var m = xh * l + h * xl\n l = xl * l + ((m & 0x7fff) << 15) + w[j] + (c & 0x3fffffff)\n c = (l >>> 30) + (m >>> 15) + xh * h + (c >>> 30)\n w[j++] = l & 0x3fffffff\n }\n return c\n}", "title": "" }, { "docid": "0c68137bab858e057221aece78f751de", "score": "0.57984436", "text": "function am2(i, x, w, j, c, n) {\r\n var xl = x & 0x7fff, xh = x >> 15;\r\n while (--n >= 0) {\r\n var l = this[i] & 0x7fff;\r\n var h = this[i++] >> 15;\r\n var m = xh * l + h * xl;\r\n l = xl * l + ((m & 0x7fff) << 15) + w[j] + (c & 0x3fffffff);\r\n c = (l >>> 30) + (m >>> 15) + xh * h + (c >>> 30);\r\n w[j++] = l & 0x3fffffff;\r\n }\r\n return c;\r\n}", "title": "" }, { "docid": "0c9b16c4c5f3dce888df2db6b5ba107d", "score": "0.5798018", "text": "function annaxscale(ac, c0) {\n var ret;\n ret = c0 + 2 * (ac - c0);\n return ret;\n}", "title": "" }, { "docid": "93f1ce994006ce490eb4f930af57f9f3", "score": "0.5796978", "text": "function am2(i, x, w, j, c, n) {\n var xl = x & 0x7fff;\n var xh = x >> 15;\n while (--n >= 0) {\n var l = this[i] & 0x7fff;\n var h = this[i++] >> 15;\n var m = xh * l + h * xl;\n l = xl * l + ((m & 0x7fff) << 15) + w[j] + (c & 0x3fffffff);\n c = (l >>> 30) + (m >>> 15) + xh * h + (c >>> 30);\n w[j++] = l & 0x3fffffff;\n }\n return c;\n}", "title": "" }, { "docid": "39b7bd85131fe2c4b490213c0d1242c1", "score": "0.57965976", "text": "function am2(i, x, w, j, c, n) {\n var xl = x & 0x7fff, xh = x >> 15;\n while (--n >= 0) {\n var l = this[i] & 0x7fff;\n var h = this[i++] >> 15;\n var m = xh * l + h * xl;\n l = xl * l + ((m & 0x7fff) << 15) + w[j] + (c & 0x3fffffff);\n c = (l >>> 30) + (m >>> 15) + xh * h + (c >>> 30);\n w[j++] = l & 0x3fffffff;\n }\n return c;\n}", "title": "" }, { "docid": "39b7bd85131fe2c4b490213c0d1242c1", "score": "0.57965976", "text": "function am2(i, x, w, j, c, n) {\n var xl = x & 0x7fff, xh = x >> 15;\n while (--n >= 0) {\n var l = this[i] & 0x7fff;\n var h = this[i++] >> 15;\n var m = xh * l + h * xl;\n l = xl * l + ((m & 0x7fff) << 15) + w[j] + (c & 0x3fffffff);\n c = (l >>> 30) + (m >>> 15) + xh * h + (c >>> 30);\n w[j++] = l & 0x3fffffff;\n }\n return c;\n}", "title": "" }, { "docid": "d10bd4c8e3751ffb4cbcd577a8b469ab", "score": "0.57909864", "text": "function CIR(a,p,n,t){\n\n\treturn n*(Math.pow((a/p),(1/(n*t)))-1);\n\n}", "title": "" }, { "docid": "76d266cb0f33311069c91e1c01735f95", "score": "0.5781495", "text": "function solveY(x) {\n return Ca * pow(x, 6) + Cb * pow(x, 5) + Cc * pow(x, 4) + Cd * pow(x, 3) + Ce * pow(x, 2) + Cf * x + Ce;\n}", "title": "" }, { "docid": "3f50fde14910247e734a347912092177", "score": "0.5779922", "text": "function am2(i,x,w,j,c,n) {\n\tvar xl = x&0x7fff, xh = x>>15;\n\twhile(--n >= 0) {\n\t var l = this[i]&0x7fff;\n\t var h = this[i++]>>15;\n\t var m = xh*l+h*xl;\n\t l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff);\n\t c = (l>>>30)+(m>>>15)+xh*h+(c>>>30);\n\t w[j++] = l&0x3fffffff;\n\t}\n\treturn c;\n }", "title": "" }, { "docid": "32b1f083a042c120f32f700921daca93", "score": "0.5772952", "text": "function getRx(a){\n\treturn[ 1, 0, 0, 0,\n\t 0, Math.cos(a), -Math.sin(a), 0,\n\t 0, Math.sin(a), Math.cos(a), 0,\n\t 0, 0, 0, 1 ];\n}", "title": "" }, { "docid": "e8b0f331c428a13b995a5199fe16c239", "score": "0.5770175", "text": "function am2(i, x, w, j, c, n) {\n var xl = x & 0x7fff,\n xh = x >> 15;\n while (--n >= 0) {\n var l = this[i] & 0x7fff;\n var h = this[i++] >> 15;\n var m = xh * l + h * xl;\n l = xl * l + ((m & 0x7fff) << 15) + w[j] + (c & 0x3fffffff);\n c = (l >>> 30) + (m >>> 15) + xh * h + (c >>> 30);\n w[j++] = l & 0x3fffffff;\n }\n return c;\n}", "title": "" }, { "docid": "e8b0f331c428a13b995a5199fe16c239", "score": "0.5770175", "text": "function am2(i, x, w, j, c, n) {\n var xl = x & 0x7fff,\n xh = x >> 15;\n while (--n >= 0) {\n var l = this[i] & 0x7fff;\n var h = this[i++] >> 15;\n var m = xh * l + h * xl;\n l = xl * l + ((m & 0x7fff) << 15) + w[j] + (c & 0x3fffffff);\n c = (l >>> 30) + (m >>> 15) + xh * h + (c >>> 30);\n w[j++] = l & 0x3fffffff;\n }\n return c;\n}", "title": "" }, { "docid": "e8b0f331c428a13b995a5199fe16c239", "score": "0.5770175", "text": "function am2(i, x, w, j, c, n) {\n var xl = x & 0x7fff,\n xh = x >> 15;\n while (--n >= 0) {\n var l = this[i] & 0x7fff;\n var h = this[i++] >> 15;\n var m = xh * l + h * xl;\n l = xl * l + ((m & 0x7fff) << 15) + w[j] + (c & 0x3fffffff);\n c = (l >>> 30) + (m >>> 15) + xh * h + (c >>> 30);\n w[j++] = l & 0x3fffffff;\n }\n return c;\n}", "title": "" }, { "docid": "bbd31ddb216ca0676dff0f2cab06e56c", "score": "0.5764071", "text": "function am2(i,x,w,j,c,n) {\n\t var xl = x&0x7fff, xh = x>>15;\n\t while(--n >= 0) {\n\t var l = this[i]&0x7fff;\n\t var h = this[i++]>>15;\n\t var m = xh*l+h*xl;\n\t l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff);\n\t c = (l>>>30)+(m>>>15)+xh*h+(c>>>30);\n\t w[j++] = l&0x3fffffff;\n\t }\n\t return c;\n\t }", "title": "" }, { "docid": "bbd31ddb216ca0676dff0f2cab06e56c", "score": "0.5764071", "text": "function am2(i,x,w,j,c,n) {\n\t var xl = x&0x7fff, xh = x>>15;\n\t while(--n >= 0) {\n\t var l = this[i]&0x7fff;\n\t var h = this[i++]>>15;\n\t var m = xh*l+h*xl;\n\t l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff);\n\t c = (l>>>30)+(m>>>15)+xh*h+(c>>>30);\n\t w[j++] = l&0x3fffffff;\n\t }\n\t return c;\n\t }", "title": "" }, { "docid": "bbd31ddb216ca0676dff0f2cab06e56c", "score": "0.5764071", "text": "function am2(i,x,w,j,c,n) {\n\t var xl = x&0x7fff, xh = x>>15;\n\t while(--n >= 0) {\n\t var l = this[i]&0x7fff;\n\t var h = this[i++]>>15;\n\t var m = xh*l+h*xl;\n\t l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff);\n\t c = (l>>>30)+(m>>>15)+xh*h+(c>>>30);\n\t w[j++] = l&0x3fffffff;\n\t }\n\t return c;\n\t }", "title": "" }, { "docid": "bbd31ddb216ca0676dff0f2cab06e56c", "score": "0.5764071", "text": "function am2(i,x,w,j,c,n) {\n\t var xl = x&0x7fff, xh = x>>15;\n\t while(--n >= 0) {\n\t var l = this[i]&0x7fff;\n\t var h = this[i++]>>15;\n\t var m = xh*l+h*xl;\n\t l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff);\n\t c = (l>>>30)+(m>>>15)+xh*h+(c>>>30);\n\t w[j++] = l&0x3fffffff;\n\t }\n\t return c;\n\t }", "title": "" }, { "docid": "230c8b3e20a440abd42a80c03eaf8dd8", "score": "0.5755493", "text": "function Yc(a,b){return Xc(this,a,b,1)}", "title": "" }, { "docid": "230c8b3e20a440abd42a80c03eaf8dd8", "score": "0.5755493", "text": "function Yc(a,b){return Xc(this,a,b,1)}", "title": "" }, { "docid": "230c8b3e20a440abd42a80c03eaf8dd8", "score": "0.5755493", "text": "function Yc(a,b){return Xc(this,a,b,1)}", "title": "" }, { "docid": "230c8b3e20a440abd42a80c03eaf8dd8", "score": "0.5755493", "text": "function Yc(a,b){return Xc(this,a,b,1)}", "title": "" }, { "docid": "230c8b3e20a440abd42a80c03eaf8dd8", "score": "0.5755493", "text": "function Yc(a,b){return Xc(this,a,b,1)}", "title": "" }, { "docid": "44743e400ce463c93d720035828a5fc6", "score": "0.5755171", "text": "function am2(i,x,w,j,c,n){\nvar xl=x&0x7fff,xh=x>>15;\nwhile(--n>=0){\nvar l=this[i]&0x7fff;\nvar h=this[i++]>>15;\nvar m=xh*l+h*xl;\nl=xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff);\nc=(l>>>30)+(m>>>15)+xh*h+(c>>>30);\nw[j++]=l&0x3fffffff;\n}\nreturn c;\n}", "title": "" }, { "docid": "7cad8efe54b26ec435d7785b4352b354", "score": "0.57523143", "text": "function cmn(q, a, b, x, s, t) {\n return add(rol(add(add(a, q), add(x, t)), s), b);\n}", "title": "" }, { "docid": "afdbf23600c7bcc7193d3c7c65241aaf", "score": "0.5750339", "text": "function am2(i,x,w,j,c,n) {\n\t\tvar xl = x&0x7fff, xh = x>>15;\n\t\twhile(--n >= 0) {\n\t\t var l = this[i]&0x7fff;\n\t\t var h = this[i++]>>15;\n\t\t var m = xh*l+h*xl;\n\t\t l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff);\n\t\t c = (l>>>30)+(m>>>15)+xh*h+(c>>>30);\n\t\t w[j++] = l&0x3fffffff;\n\t\t}\n\t\treturn c;\n\t }", "title": "" }, { "docid": "71ebf022eac800a819589f3f6b357608", "score": "0.5749944", "text": "function am1(i, x, w, j, c, n) {\n while (--n >= 0) {\n var v = x * this[i++] + w[j] + c;\n c = Math.floor(v / 0x4000000);\n w[j++] = v & 0x3ffffff;\n }\n return c;\n }// am2 avoids a big mult-and-extract completely.", "title": "" }, { "docid": "22a07b67facd12ce8f0dc315caec212f", "score": "0.5743042", "text": "function am2(i,x,w,j,c,n) {\n var xl=x&0x7fff,xh=x>>15;\n while(--n>=0) {\n var l=this[i]&0x7fff;\n var h=this[i++]>>15;\n var m=xh*l+h*xl;\n l=xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff);\n c=(l>>>30)+(m>>>15)+xh*h+(c>>>30);\n w[j++]=l&0x3fffffff;\n }\n return c;\n }", "title": "" }, { "docid": "3c37b335cc3e9b5cd017b91e78862129", "score": "0.57378376", "text": "function computeQuadraticBaseValue(t, a, b, c) {\n\n var mt = 1 - t;\n\n return mt * mt * a + 2 * mt * t * b + t * t * c;\n\n}", "title": "" }, { "docid": "3c37b335cc3e9b5cd017b91e78862129", "score": "0.57378376", "text": "function computeQuadraticBaseValue(t, a, b, c) {\n\n var mt = 1 - t;\n\n return mt * mt * a + 2 * mt * t * b + t * t * c;\n\n}", "title": "" }, { "docid": "0f02eaa448abdfd3c3d7528a7c23a9e8", "score": "0.5737292", "text": "function multiplizieren(a,b) {\r\n return a * b;\r\n}", "title": "" }, { "docid": "fe3e1bc14173319132669fc5e3417ad1", "score": "0.57345027", "text": "function am2(i,x,w,j,c,n) {\n var xl = x&0x7fff, xh = x>>15;\n while(--n >= 0) {\n var l = this[i]&0x7fff;\n var h = this[i++]>>15;\n var m = xh*l+h*xl;\n l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff);\n c = (l>>>30)+(m>>>15)+xh*h+(c>>>30);\n w[j++] = l&0x3fffffff;\n }\n return c;\n }", "title": "" }, { "docid": "fe3e1bc14173319132669fc5e3417ad1", "score": "0.57345027", "text": "function am2(i,x,w,j,c,n) {\n var xl = x&0x7fff, xh = x>>15;\n while(--n >= 0) {\n var l = this[i]&0x7fff;\n var h = this[i++]>>15;\n var m = xh*l+h*xl;\n l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff);\n c = (l>>>30)+(m>>>15)+xh*h+(c>>>30);\n w[j++] = l&0x3fffffff;\n }\n return c;\n }", "title": "" }, { "docid": "fe3e1bc14173319132669fc5e3417ad1", "score": "0.57345027", "text": "function am2(i,x,w,j,c,n) {\n var xl = x&0x7fff, xh = x>>15;\n while(--n >= 0) {\n var l = this[i]&0x7fff;\n var h = this[i++]>>15;\n var m = xh*l+h*xl;\n l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff);\n c = (l>>>30)+(m>>>15)+xh*h+(c>>>30);\n w[j++] = l&0x3fffffff;\n }\n return c;\n }", "title": "" }, { "docid": "fe3e1bc14173319132669fc5e3417ad1", "score": "0.57345027", "text": "function am2(i,x,w,j,c,n) {\n var xl = x&0x7fff, xh = x>>15;\n while(--n >= 0) {\n var l = this[i]&0x7fff;\n var h = this[i++]>>15;\n var m = xh*l+h*xl;\n l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff);\n c = (l>>>30)+(m>>>15)+xh*h+(c>>>30);\n w[j++] = l&0x3fffffff;\n }\n return c;\n }", "title": "" }, { "docid": "fe3e1bc14173319132669fc5e3417ad1", "score": "0.57345027", "text": "function am2(i,x,w,j,c,n) {\n var xl = x&0x7fff, xh = x>>15;\n while(--n >= 0) {\n var l = this[i]&0x7fff;\n var h = this[i++]>>15;\n var m = xh*l+h*xl;\n l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff);\n c = (l>>>30)+(m>>>15)+xh*h+(c>>>30);\n w[j++] = l&0x3fffffff;\n }\n return c;\n }", "title": "" }, { "docid": "fe3e1bc14173319132669fc5e3417ad1", "score": "0.57345027", "text": "function am2(i,x,w,j,c,n) {\n var xl = x&0x7fff, xh = x>>15;\n while(--n >= 0) {\n var l = this[i]&0x7fff;\n var h = this[i++]>>15;\n var m = xh*l+h*xl;\n l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff);\n c = (l>>>30)+(m>>>15)+xh*h+(c>>>30);\n w[j++] = l&0x3fffffff;\n }\n return c;\n }", "title": "" }, { "docid": "fe3e1bc14173319132669fc5e3417ad1", "score": "0.57345027", "text": "function am2(i,x,w,j,c,n) {\n var xl = x&0x7fff, xh = x>>15;\n while(--n >= 0) {\n var l = this[i]&0x7fff;\n var h = this[i++]>>15;\n var m = xh*l+h*xl;\n l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff);\n c = (l>>>30)+(m>>>15)+xh*h+(c>>>30);\n w[j++] = l&0x3fffffff;\n }\n return c;\n }", "title": "" }, { "docid": "fe3e1bc14173319132669fc5e3417ad1", "score": "0.57345027", "text": "function am2(i,x,w,j,c,n) {\n var xl = x&0x7fff, xh = x>>15;\n while(--n >= 0) {\n var l = this[i]&0x7fff;\n var h = this[i++]>>15;\n var m = xh*l+h*xl;\n l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff);\n c = (l>>>30)+(m>>>15)+xh*h+(c>>>30);\n w[j++] = l&0x3fffffff;\n }\n return c;\n }", "title": "" }, { "docid": "fe3e1bc14173319132669fc5e3417ad1", "score": "0.57345027", "text": "function am2(i,x,w,j,c,n) {\n var xl = x&0x7fff, xh = x>>15;\n while(--n >= 0) {\n var l = this[i]&0x7fff;\n var h = this[i++]>>15;\n var m = xh*l+h*xl;\n l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff);\n c = (l>>>30)+(m>>>15)+xh*h+(c>>>30);\n w[j++] = l&0x3fffffff;\n }\n return c;\n }", "title": "" }, { "docid": "fe3e1bc14173319132669fc5e3417ad1", "score": "0.57345027", "text": "function am2(i,x,w,j,c,n) {\n var xl = x&0x7fff, xh = x>>15;\n while(--n >= 0) {\n var l = this[i]&0x7fff;\n var h = this[i++]>>15;\n var m = xh*l+h*xl;\n l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff);\n c = (l>>>30)+(m>>>15)+xh*h+(c>>>30);\n w[j++] = l&0x3fffffff;\n }\n return c;\n }", "title": "" }, { "docid": "fe3e1bc14173319132669fc5e3417ad1", "score": "0.57345027", "text": "function am2(i,x,w,j,c,n) {\n var xl = x&0x7fff, xh = x>>15;\n while(--n >= 0) {\n var l = this[i]&0x7fff;\n var h = this[i++]>>15;\n var m = xh*l+h*xl;\n l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff);\n c = (l>>>30)+(m>>>15)+xh*h+(c>>>30);\n w[j++] = l&0x3fffffff;\n }\n return c;\n }", "title": "" }, { "docid": "fe3e1bc14173319132669fc5e3417ad1", "score": "0.57345027", "text": "function am2(i,x,w,j,c,n) {\n var xl = x&0x7fff, xh = x>>15;\n while(--n >= 0) {\n var l = this[i]&0x7fff;\n var h = this[i++]>>15;\n var m = xh*l+h*xl;\n l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff);\n c = (l>>>30)+(m>>>15)+xh*h+(c>>>30);\n w[j++] = l&0x3fffffff;\n }\n return c;\n }", "title": "" } ]
97925516cb75cb99f4f7c7fc55422519
Instantiates a new ArcFollowCamera
[ { "docid": "1de35eeab04ed0c0238b40010e37c1b7", "score": "0.7607265", "text": "function ArcFollowCamera(name,/** The longitudinal angle of the camera */alpha,/** The latitudinal angle of the camera */beta,/** The radius of the camera from its target */radius,/** Define the camera target (the messh it should follow) */target,scene){var _this=_super.call(this,name,BABYLON.Vector3.Zero(),scene)||this;_this.alpha=alpha;_this.beta=beta;_this.radius=radius;_this.target=target;_this._cartesianCoordinates=BABYLON.Vector3.Zero();_this._follow();return _this;}", "title": "" } ]
[ { "docid": "90252696967553b7eb8de4a3523578f9", "score": "0.6811691", "text": "function createFollowCamera(scene,target)\r\n{\r\n var camera = new BABYLON.FollowCamera(\"tankFollowCamera\",target.position, scene, target);\r\n camera.radius = 80;\r\n camera.heightOffset = 30;\r\n camera.rotationOffset = 180;\r\n camera.rotationAccelartion = 0.5;\r\n camera.maxCameraSpeed = 50;\r\n return camera;\r\n}", "title": "" }, { "docid": "536340d7f689206bfa5a2ebaf6b4d8b6", "score": "0.67622983", "text": "function initFollowCam(camHeight, newFollowingDistance) {\n followingDistance = newFollowingDistance;\n\n followCam = new THREE.PerspectiveCamera(\n 70,\n window.innerWidth / window.innerHeight,\n 1,\n 1000\n );\n followCam.position.set(0, camHeight, 0);\n followCam.lookAt(scene.position);\n\n followCamRig = new THREE.Object3D();\n followCamTarget = new THREE.Object3D();\n followCamTarget.position.z = -followingDistance;\n}", "title": "" }, { "docid": "920101bf6a05f11bb499f228b0e5688f", "score": "0.65314096", "text": "setupCamera() {\r\n \r\n var camera = new Camera();\r\n camera.setPerspective(FOV, this.vWidth/this.vHeight, NEAR, FAR);\r\n //camera.setOrthogonal(-30, 30, -30, 30, NEAR, FAR);\r\n camera.setView();\r\n\r\n return camera;\r\n }", "title": "" }, { "docid": "b3a167f3424e39a6293c183239ae31cf", "score": "0.64561784", "text": "function ArcRotateCamera(name,alpha,beta,radius,target,scene,setActiveOnSceneIfNoneActive){if(setActiveOnSceneIfNoneActive===void 0){setActiveOnSceneIfNoneActive=true;}var _this=_super.call(this,name,BABYLON.Vector3.Zero(),scene,setActiveOnSceneIfNoneActive)||this;/**\n * Current inertia value on the longitudinal axis.\n * The bigger this number the longer it will take for the camera to stop.\n */_this.inertialAlphaOffset=0;/**\n * Current inertia value on the latitudinal axis.\n * The bigger this number the longer it will take for the camera to stop.\n */_this.inertialBetaOffset=0;/**\n * Current inertia value on the radius axis.\n * The bigger this number the longer it will take for the camera to stop.\n */_this.inertialRadiusOffset=0;/**\n * Minimum allowed angle on the longitudinal axis.\n * This can help limiting how the Camera is able to move in the scene.\n */_this.lowerAlphaLimit=null;/**\n * Maximum allowed angle on the longitudinal axis.\n * This can help limiting how the Camera is able to move in the scene.\n */_this.upperAlphaLimit=null;/**\n * Minimum allowed angle on the latitudinal axis.\n * This can help limiting how the Camera is able to move in the scene.\n */_this.lowerBetaLimit=0.01;/**\n * Maximum allowed angle on the latitudinal axis.\n * This can help limiting how the Camera is able to move in the scene.\n */_this.upperBetaLimit=Math.PI;/**\n * Minimum allowed distance of the camera to the target (The camera can not get closer).\n * This can help limiting how the Camera is able to move in the scene.\n */_this.lowerRadiusLimit=null;/**\n * Maximum allowed distance of the camera to the target (The camera can not get further).\n * This can help limiting how the Camera is able to move in the scene.\n */_this.upperRadiusLimit=null;/**\n * Defines the current inertia value used during panning of the camera along the X axis.\n */_this.inertialPanningX=0;/**\n * Defines the current inertia value used during panning of the camera along the Y axis.\n */_this.inertialPanningY=0;/**\n * Defines the distance used to consider the camera in pan mode vs pinch/zoom.\n * Basically if your fingers moves away from more than this distance you will be considered\n * in pinch mode.\n */_this.pinchToPanMaxDistance=20;/**\n * Defines the maximum distance the camera can pan.\n * This could help keeping the cammera always in your scene.\n */_this.panningDistanceLimit=null;/**\n * Defines the target of the camera before paning.\n */_this.panningOriginTarget=BABYLON.Vector3.Zero();/**\n * Defines the value of the inertia used during panning.\n * 0 would mean stop inertia and one would mean no decelleration at all.\n */_this.panningInertia=0.9;//-- end properties for backward compatibility for inputs\n/**\n * Defines how much the radius should be scaled while zomming on a particular mesh (through the zoomOn function)\n */_this.zoomOnFactor=1;/**\n * Defines a screen offset for the camera position.\n */_this.targetScreenOffset=BABYLON.Vector2.Zero();/**\n * Allows the camera to be completely reversed.\n * If false the camera can not arrive upside down.\n */_this.allowUpsideDown=true;/**\n * Define if double tap/click is used to restore the previously saved state of the camera.\n */_this.useInputToRestoreState=true;/** @hidden */_this._viewMatrix=new BABYLON.Matrix();/**\n * Defines the allowed panning axis.\n */_this.panningAxis=new BABYLON.Vector3(1,1,0);/**\n * Observable triggered when the mesh target has been changed on the camera.\n */_this.onMeshTargetChangedObservable=new BABYLON.Observable();/**\n * Defines whether the camera should check collision with the objects oh the scene.\n * @see http://doc.babylonjs.com/babylon101/cameras,_mesh_collisions_and_gravity#how-can-i-do-this\n */_this.checkCollisions=false;/**\n * Defines the collision radius of the camera.\n * This simulates a sphere around the camera.\n * @see http://doc.babylonjs.com/babylon101/cameras,_mesh_collisions_and_gravity#arcrotatecamera\n */_this.collisionRadius=new BABYLON.Vector3(0.5,0.5,0.5);_this._previousPosition=BABYLON.Vector3.Zero();_this._collisionVelocity=BABYLON.Vector3.Zero();_this._newPosition=BABYLON.Vector3.Zero();_this._computationVector=BABYLON.Vector3.Zero();_this._onCollisionPositionChange=function(collisionId,newPosition,collidedMesh){if(collidedMesh===void 0){collidedMesh=null;}if(_this.getScene().workerCollisions&&_this.checkCollisions){newPosition.multiplyInPlace(_this._collider._radius);}if(!collidedMesh){_this._previousPosition.copyFrom(_this.position);}else{_this.setPosition(newPosition);if(_this.onCollide){_this.onCollide(collidedMesh);}}// Recompute because of constraints\nvar cosa=Math.cos(_this.alpha);var sina=Math.sin(_this.alpha);var cosb=Math.cos(_this.beta);var sinb=Math.sin(_this.beta);if(sinb===0){sinb=0.0001;}var target=_this._getTargetPosition();_this._computationVector.copyFromFloats(_this.radius*cosa*sinb,_this.radius*cosb,_this.radius*sina*sinb);target.addToRef(_this._computationVector,_this._newPosition);_this.position.copyFrom(_this._newPosition);var up=_this.upVector;if(_this.allowUpsideDown&&_this.beta<0){up=up.clone();up=up.negate();}_this._computeViewMatrix(_this.position,target,up);_this._viewMatrix.m[12]+=_this.targetScreenOffset.x;_this._viewMatrix.m[13]+=_this.targetScreenOffset.y;_this._collisionTriggered=false;};_this._target=BABYLON.Vector3.Zero();if(target){_this.setTarget(target);}_this.alpha=alpha;_this.beta=beta;_this.radius=radius;_this.getViewMatrix();_this.inputs=new BABYLON.ArcRotateCameraInputsManager(_this);_this.inputs.addKeyboard().addMouseWheel().addPointers();return _this;}", "title": "" }, { "docid": "b1e59122011fe600c9cb9cec0e39d6e8", "score": "0.64331496", "text": "initCameras() {\n this.camera = new CGFcamera(\n 0.1,\n 0.1,\n 500,\n vec3.fromValues(10, 15, 15),\n vec3.fromValues(0, 0, 0)\n );\n }", "title": "" }, { "docid": "a398f5e538dbd2fd0eb1409b592fb97e", "score": "0.6386912", "text": "function Camera() {}", "title": "" }, { "docid": "9967ec3cb03ffd980fec347ddff3e0c1", "score": "0.6345537", "text": "initCameras() {\r\n this.camera = new CGFcamera(0.4, 0.1, 500, vec3.fromValues(15, 15, 15), vec3.fromValues(0, 0, 0));\r\n }", "title": "" }, { "docid": "d5bf97202bbde9ad64411c798b5fb1d7", "score": "0.63382155", "text": "initCameras() {\n this.camera = new CGFcamera(0.4, 0.1, 500, vec3.fromValues(0, 12, -15), vec3.fromValues(0, 10, 0));\n this.interface.setActiveCamera(this.camera);\n }", "title": "" }, { "docid": "311867830fb8b49dd344e29401f41720", "score": "0.63347894", "text": "initializeCamera () {\r\n this.camera = new OrthoCamera(...this.shaderPrograms);\r\n this.camera.update();\r\n }", "title": "" }, { "docid": "41118f85b79fbbe879d5b5fc86e3c532", "score": "0.6288535", "text": "initCameras() {\n\t\tthis.camera = new CGFcamera(0.4, 0.1, 500, vec3.fromValues(15, 15, 15), vec3.fromValues(0, 0, 0));\n\t}", "title": "" }, { "docid": "1a290ed6ebb0933ccb957477ce9ae71c", "score": "0.62709737", "text": "initCameras() {\n this.camera = new CGFcamera(0.78, 0.1, 500, vec3.fromValues(10, 8, 30), vec3.fromValues(10, 0, 5));\n }", "title": "" }, { "docid": "f37ec27c4a3044b2331a58a9b5634940", "score": "0.6235456", "text": "function orbit_camera() {\n\tif (v.graph !== null) {\n\t\tif (v.auto_orbit) {\n\t\t\tvar angle = 0;\n\t\t\tintervalObj = setInterval(function () {\n\t\t\t\tv.graph.cameraPosition({\n\t\t\t\t\tx: orbit_distance * Math.sin(angle),\n\t\t\t\t\ty: 100,\n\t\t\t\t\tz: orbit_distance * Math.cos(angle)\n\t\t\t\t});\n\t\t\t\tangle += Math.PI / 300;\n\t\t\t}, 10);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "495a9914e43f7d6e61a87d36436d3d3a", "score": "0.6172073", "text": "initCameras() {\n this.camera = new CGFcamera(0.4, 0.1, 1000, vec3.fromValues(500, 500, 500), vec3.fromValues(0, 0, 0));\n //this.camera = new CGFcamera(0.4, 0.1, 500, vec3.fromValues(1, 1, 1), vec3.fromValues(0, 0, 0));\n }", "title": "" }, { "docid": "7f59e007e2312c831a22f37fd5bb518e", "score": "0.61224794", "text": "function FollowCamera(name,position,scene,lockedTarget){if(lockedTarget===void 0){lockedTarget=null;}var _this=_super.call(this,name,position,scene)||this;/**\n * Distance the follow camera should follow an object at\n */_this.radius=12;/**\n * Define a rotation offset between the camera and the object it follows\n */_this.rotationOffset=0;/**\n * Define a height offset between the camera and the object it follows.\n * It can help following an object from the top (like a car chaing a plane)\n */_this.heightOffset=4;/**\n * Define how fast the camera can accelerate to follow it s target.\n */_this.cameraAcceleration=0.05;/**\n * Define the speed limit of the camera following an object.\n */_this.maxCameraSpeed=20;_this.lockedTarget=lockedTarget;return _this;}", "title": "" }, { "docid": "2ea660b0d2cad8baf3f6467fe2f46753", "score": "0.6115166", "text": "constructor(player)\n {\n this.player = player;\n this.camera = game.camera;\n\n this.camera.follow(this.player);// follow the player\n }", "title": "" }, { "docid": "d505500112518f437f0a36aa4dabe7d4", "score": "0.6110184", "text": "function Camera () {\n Camera.superclass.constructor.apply(this, arguments);\n\n Enum([\n k_FOV = 0,\n k_ORTHO,\n k_OFFSET_ORTHO\n ], e_Type, a.Camera);\n /**\n * Type. Form enum e_Type\n * @type Int\n */\n this.iType = a.Camera.k_FOV;\n /**\n * View matrix\n * @type Float32Array\n */\n this.m4fView = Mat4.create();\n /**\n * internal, un-biased projection matrix\n * @type Float32Array\n */\n this.m4fProj = Mat4.create();\n /**\n * Matrix\n * @type Float32Array\n */\n this.m4fUnitProj = Mat4.create();\n /**\n * internal, un-biased view+projection matrix\n * @type Float32Array\n */\n this.m4fViewProj = Mat4.create();\n /**\n * Special matrix for billboarding effects\n * @type Float32Array\n */\n this.m4fBillboard = Mat4.create();\n /**\n * Special matrix for sky box effects\n * @type Float32Array\n */\n this.m4fSkyBox = Mat4.create();\n /**\n * Biased for use during current render stage\n * @type Float32Array\n */\n this.m4fRenderStageProj = Mat4.create();\n /**\n * Biased for use during current render stage\n * @type Float32Array\n */\n this.m4fRenderStageViewProj = Mat4.create();\n /**\n * Search rect for scene culling\n * @type Rect3d\n */\n this.pSearchRect = new a.Rect3d();\n /**\n * Position\n * @type Float32Array\n */\n this.v3fTargetPos = Vec3.create();\n /**\n * Attributes for projection matrix\n * @type Float\n */\n this.fFOV = Math.PI / 5;\n /**\n * Attributes for projection matrix\n * @type Float\n */\n this.fAspect = 640 / 480;\n /**\n * Attributes for projection matrix\n * @type Float\n */\n this.fNearPlane = 0.1;\n /**\n * Attributes for projection matrix\n * @type Float\n */\n this.fFarPlane = 500.0;\n /**\n * Attributes for projection matrix\n * @type Float\n */\n this.fWidth = 0.0;\n /**\n * Attributes for projection matrix\n * @type Float\n */\n this.fHeight = 0.0;\n /**\n * Attributes for projection matrix\n * @type Float\n */\n this.fMinX = 0.0;\n /**\n * Attributes for projection matrix\n * @type Float\n */\n this.fMaxX = 0.0;\n /**\n * Attributes for projection matrix\n * @type Float\n */\n this.fMinY = 0.0;\n /**\n * Attributes for projection matrix\n * @type Float\n */\n this.fMaxY = 0.0;\n /**\n * List of points\n * @type Array<Float32Array>(8)\n */\n this.pv3fFarPlanePoints = new Array(8);\n for (var i = 0; i < 8; ++i) {\n this.pv3fFarPlanePoints[i] = Vec3.create();\n }\n /**\n * Frustum\n * @type Frustum\n */\n this.pFrustum = new a.Frustum();\n}", "title": "" }, { "docid": "3b54b8a183f99be711871458c3cfbd9a", "score": "0.60608035", "text": "function criarCamera(){\n\n //3.1 Criar Camera\n var fov = 45; // angulo (fiel of view)\n var aspect = container.clientWidth / container.clientHeight; // aspect ratio\n var near = 0.1; // plano de corte proximo \n var far = 1000; // plano de corte afastado\n\n camera = new THREE.PerspectiveCamera(fov,aspect,near,far);\n\n //3.2 Posicionar camera\n camera.position.set(0,0,50);\n camera.lookAt(0,0,0);\n}", "title": "" }, { "docid": "c9302c606535e2d983fbc1773bb433d8", "score": "0.6037499", "text": "function Camera(options) {\r\n var _this = _super.call(this, 70, options.canvas.width / options.canvas.height, 1 / 99, 12000000 / Math.sin(70 * Math.PI)) || this;\r\n _this.target = new Cartesian();\r\n _this._targetCartographic = QtPositioning.coordinate();\r\n _this._positionCartographic = QtPositioning.coordinate();\r\n _this._map = options.map;\r\n _this._targetCartographic = QtPositioning.coordinate();\r\n _this._positionCartographic = QtPositioning.coordinate();\r\n _this._culledGroundPlane = [new Cartesian(), new Cartesian(), new Cartesian(), new Cartesian()];\r\n _this.updatedLastFrame = false;\r\n return _this;\r\n /**\r\n * FIXME:\r\n * Debuging mesh\r\n */\r\n // const material = new THREE.MeshBasicMaterial({\r\n // wireframe: true,\r\n // // opacity: 0,\r\n // color: new THREE.Color(0xff0000),\r\n // });\r\n // this.geometry = new THREE.Geometry();\r\n // this.geometry.vertices = [\r\n // new THREE.Vector3(),\r\n // new THREE.Vector3(),\r\n // new THREE.Vector3(),\r\n // new THREE.Vector3(),\r\n // ];\r\n // this.geometry.faces = [\r\n // new THREE.Face3(0, 1, 3),\r\n // new THREE.Face3(1, 3, 2),\r\n // ];\r\n // this.geometry.computeFaceNormals();\r\n // const mesh = new THREE.Mesh(this.geometry, material);\r\n // this._map.scene.add(mesh);\r\n }", "title": "" }, { "docid": "0df5ce5bd0f08ecb6cfee33c875a31fa", "score": "0.601163", "text": "addCamera(game, fov, turnSpeed) {\n this.camera = new Camera(this, game, fov, turnSpeed);\n }", "title": "" }, { "docid": "b668fad7dbefdf6e074fe5a84e3a771b", "score": "0.60028565", "text": "function initializeFreeCamera() {\n controls.getObject().position.x = controls.getObject().position.x;\n controls.getObject().position.y = controls.getObject().position.y;\n controls.getObject().position.z = controls.getObject().position.z;\n}", "title": "" }, { "docid": "1266496fa68cfb8f1360fea85c3d32d9", "score": "0.5992069", "text": "initCameras() {\n this.fallBackCamera = new CGFcamera(0.4, 0.1, 500, vec3.fromValues(15, 15, 15), vec3.fromValues(0, 0, 0));\n this.camera = this.fallBackCamera;\n }", "title": "" }, { "docid": "1b364598a834e215a0eb3f0e469d37f0", "score": "0.5975676", "text": "setupCamera(){\n $camera.setTarget(this.target, 3);\n }", "title": "" }, { "docid": "9e40f3c0f967c9b012fec895e88ca543", "score": "0.5965127", "text": "constructor(info: CameraInfo) {\n const { binning_x, binning_y, roi, distortion_model, D, K, P, R } = info;\n\n if (distortion_model === \"\") {\n // Allow CameraInfo with no model to indicate no distortion\n this._distortionState = DISTORTION_STATE.NONE;\n return;\n }\n\n // Binning = 0 is considered the same as binning = 1 (no binning).\n const binningX = binning_x ? binning_x : 1;\n const binningY = binning_y ? binning_y : 1;\n\n const adjustBinning = binningX > 1 || binningY > 1;\n const adjustRoi = roi.x_offset !== 0 || roi.y_offset !== 0;\n\n if (adjustBinning || adjustRoi) {\n throw new Error(\n \"Failed to initialize camera model: unable to handle adjusted binning and adjusted roi camera models.\"\n );\n }\n\n // See comments about Tx = 0, Ty = 0 in\n // http://docs.ros.org/melodic/api/sensor_msgs/html/msg/CameraInfo.html\n if (P[3] !== 0 || P[7] !== 0) {\n throw new Error(\n \"Failed to initialize camera model: projection matrix implies non monocular camera - cannot handle at this time.\"\n );\n }\n\n // Figure out how to handle the distortion\n if (distortion_model === \"plumb_bob\" || distortion_model === \"rational_polynomial\") {\n this._distortionState = D[0] === 0.0 ? DISTORTION_STATE.NONE : DISTORTION_STATE.CALIBRATED;\n } else {\n throw new Error(\n \"Failed to initialize camera model: distortion_model is unknown, only plumb_bob and rational_polynomial are supported.\"\n );\n }\n this.D = D;\n this.P = P;\n this.R = R;\n this.K = K;\n }", "title": "" }, { "docid": "8f2f8f98d08563a617f4ef4d376fcf2b", "score": "0.59494686", "text": "function StereoscopicArcRotateCamera(name,alpha,beta,radius,target,interaxialDistance,isStereoscopicSideBySide,scene){var _this=_super.call(this,name,alpha,beta,radius,target,scene)||this;_this.interaxialDistance=interaxialDistance;_this.isStereoscopicSideBySide=isStereoscopicSideBySide;_this.setCameraRigMode(isStereoscopicSideBySide?BABYLON.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:BABYLON.Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER,{interaxialDistance:interaxialDistance});return _this;}", "title": "" }, { "docid": "fca5a715b5790beb61fe20575823efc2", "score": "0.5941142", "text": "function setupCamera() {\n camera = new PerspectiveCamera(35, config.Screen.RATIO, 0.1, 100);\n //camera.position.set(0, 10, 30);\n //camera.lookAt(new Vector3(0, 0, 0));\n console.log(\"Finished setting up Camera...\");\n }", "title": "" }, { "docid": "92416e40d03c7af3831df5e9fff1bfb1", "score": "0.58896947", "text": "function setupCamera() {\n camera = new PerspectiveCamera(35, config.Screen.RATIO, 0.1, 100);\n //camera.position.set(0, 10, 30);\n //camera.lookAt(new Vector3(0, 0, 0));\n console.log(\"Finished setting up Camera...\");\n}", "title": "" }, { "docid": "0372297b01192a7990a22be6b39ff5bb", "score": "0.58879256", "text": "function camera_init()\n{\n\tCAM = new Camera(displayList.camera, camera_newFocus);\n\n\tCAM.updateResizeCamera();\n\tCAM.connectViewer(displayList.viewer);\n\t// CAM.connectViewerOther(displayList.viewer_fg);\n}", "title": "" }, { "docid": "42a9198dfe6ef97b7adc9fc67d6eb4a4", "score": "0.58650106", "text": "setupCamera() {\n let aspectRatio = this.rootElement.clientWidth / this.rootElement.clientHeight;\n let width = this.cameraWidth;\n let height = width / aspectRatio;\n this.camera = new THREE.OrthographicCamera(width / -2, width / 2, height / 2, height / -2, -100, 1000);\n this.camera.name = \"camera\";\n this.camera.position.z = 20;\n }", "title": "" }, { "docid": "64f0ca0b9112d65b2d6809cc424fffb8", "score": "0.5844267", "text": "applyCamera() {\r\n }", "title": "" }, { "docid": "e2fa20a1a8a299103ffe988b9cb70947", "score": "0.5843943", "text": "function setupCamera() {\n camera = new PerspectiveCamera(35, config.Screen.RATIO, 0.1, 100);\n camera.position.x = 15.3;\n camera.position.y = 18.5;\n camera.position.z = -28.7;\n camera.rotation.set(-1.10305, 0.49742, -0.1396);\n camera.lookAt(new Vector3(0, 0, 0));\n console.log(\"Finished setting up Camera...\");\n }", "title": "" }, { "docid": "e2fa20a1a8a299103ffe988b9cb70947", "score": "0.5843943", "text": "function setupCamera() {\n camera = new PerspectiveCamera(35, config.Screen.RATIO, 0.1, 100);\n camera.position.x = 15.3;\n camera.position.y = 18.5;\n camera.position.z = -28.7;\n camera.rotation.set(-1.10305, 0.49742, -0.1396);\n camera.lookAt(new Vector3(0, 0, 0));\n console.log(\"Finished setting up Camera...\");\n }", "title": "" }, { "docid": "e7052488073ea2a12ade549ac84d03f1", "score": "0.5835452", "text": "function setupCamera() {\n camera = new PerspectiveCamera(35, config.Screen.RATIO, 0.1, 100);\n camera.position.x = 35.3;\n camera.position.y = 38.5;\n camera.position.z = -48.7;\n camera.rotation.set(-1.10305, 0.49742, -0.1396);\n camera.lookAt(new Vector3(0, 0, 0));\n console.log(\"Finished setting up Camera...\");\n }", "title": "" }, { "docid": "39dd6dd2c7b76a9e280adc725645262a", "score": "0.58331263", "text": "addCamera() {\n this.camera = new THREE.PerspectiveCamera(\n 70,\n this.width / this.height,\n 0.01,\n 10\n );\n this.camera.position.z = 1;\n }", "title": "" }, { "docid": "f49987cb69337f0183ea842e1eff3957", "score": "0.58076054", "text": "function AnaglyphArcRotateCamera(name,alpha,beta,radius,target,interaxialDistance,scene){var _this=_super.call(this,name,alpha,beta,radius,target,scene)||this;_this.interaxialDistance=interaxialDistance;_this.setCameraRigMode(BABYLON.Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH,{interaxialDistance:interaxialDistance});return _this;}", "title": "" }, { "docid": "59f97b3d4a564aed4515d05ad4179bdf", "score": "0.57606256", "text": "function setupCamera() {\n camera = new PerspectiveCamera(45, config.Screen.RATIO, 0.1, 1000);\n //camera = new PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.1, 1000);\n camera.position.x = 0.6;\n camera.position.y = 16;\n camera.position.z = -20.5;\n camera.lookAt(new Vector3(0, 0, 0));\n console.log(\"Finished setting up Camera...\");\n}", "title": "" }, { "docid": "c41239ecf0b7e58293bbea82003435fd", "score": "0.574875", "text": "function Camera()\n{\n\tObject3D.call(this);\n\n\tthis.type = \"Camera\";\n\n\t/**\n\t * Near plane.\n\t */\n\tthis.near = 0.1;\n\n\t/**\n\t * Far plane.\n\t */\n\tthis.far = 2000;\n\n\t/**\n\t * Projection matrix of the camera used to project drawable objects into the visualization plane.\n\t */\n\tthis.projectionMatrix = new Matrix4();\n\n\t/**\n\t * Camera inverse matrix transformation.\n\t */\n\tthis.inverseTransformationMatrix = new Matrix4();\n}", "title": "" }, { "docid": "8c76898a385f163e7c32815776b59d6a", "score": "0.57289946", "text": "function setupCamera() {\n camera = new PerspectiveCamera(45, config.Screen.RATIO, 0.1, 1000);\n //camera = new PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.1, 1000);\n camera.position.x = 47.55813;\n camera.position.y = 30.19024;\n camera.position.z = 0.95559;\n camera.lookAt(new Vector3(0, -1, 1));\n console.log(\"Finished setting up Camera...\");\n}", "title": "" }, { "docid": "733236fcc8889fae41ae8602686127ce", "score": "0.57264364", "text": "constructor(camera /*:OrthographicCamera*/, target /*:Vector3*/) {\n this._camera = camera;\n this._target = target;\n this._state = STATE.NONE;\n this._rotate_start = new Vector3();\n this._rotate_end = new Vector3();\n this._zoom_start = [0, 0];\n this._zoom_end = [0, 0];\n this._pinch_start = 0;\n this._pinch_end = 0;\n this._pan_start = [0, 0];\n this._pan_end = [0, 0];\n this._panned = true;\n this._rotating = 0.0;\n this._auto_stamp = null;\n this._go_func = null;\n\n // the far plane is more distant from the target than the near plane (3:1)\n this.slab_width = [2.5, 7.5, null];\n }", "title": "" }, { "docid": "a8e144d0a4aaa0fcb966fa4b0d9cc690", "score": "0.5726146", "text": "initCamera() {\n this.camera = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 10, 1000);\n this.camera.position.y = 400;\n this.camera.position.z = 400;\n this.camera.rotation.x = .70;\n }", "title": "" }, { "docid": "80f5e18f37df23a3cd69cbd214e38ac1", "score": "0.5719653", "text": "function renderFollowCamera() {\r\n\tvar time = Date.now();\r\n\tvar looptime = 20 * 1000;\r\n\tvar t = (time % looptime) / looptime;\r\n\r\n\tvar pos = tube.parameters.path.getPointAt(t);\r\n\tpos.multiplyScalar(scale);\r\n\r\n\t// interpolation\r\n\tvar segments = tube.tangents.length;\r\n\tvar pickt = t * segments;\r\n\tvar pick = Math.floor(pickt);\r\n\tvar pickNext = (pick + 1) % segments;\r\n\r\n\tbinormal.subVectors(tube.binormals[pickNext], tube.binormals[pick]);\r\n\tbinormal.multiplyScalar(pickt - pick).add(tube.binormals[pick]);\r\n\r\n\r\n\tvar dir = tube.parameters.path.getTangentAt(t);\r\n\r\n\tnormal.copy(binormal).cross(dir);\r\n\r\n\t// We move on a offset on its binormal\r\n\tpos.add(normal.clone().multiplyScalar(offset));\r\n\r\n\tsplineCamera.position.copy(pos);\r\n\r\n\t// Using arclength for stablization in look ahead.\r\n\tvar lookAt = tube.parameters.path.getPointAt((t + 30 / tube.parameters.path.getLength()) % 1).multiplyScalar(scale);\r\n\r\n\t// Camera Orientation 2 - up orientation via normal\r\n\tif (!lookAhead)\r\n\t\tlookAt.copy(pos).add(dir);\r\n\tsplineCamera.matrix.lookAt(splineCamera.position, lookAt, normal);\r\n\tsplineCamera.rotation.setFromRotationMatrix(splineCamera.matrix, splineCamera.rotation.order);\r\n\r\n\tparent.rotation.y += (targetRotation - parent.rotation.y) * 0.05;\r\n}", "title": "" }, { "docid": "2953d0f9176920deb2eb336fa51b1223", "score": "0.571359", "text": "static init(startupPosition, startupTarget) {\n MfgCamera.camera = new BABYLON.FreeCamera(\"Camera\", startupPosition, src_1.MfgScene.scene);\n MfgCamera.camera.setTarget(startupTarget);\n MfgCamera.camera.checkCollisions = true;\n MfgCamera.camera.applyGravity = true;\n //Set the ellipsoid around the camera (e.g. your player's size)\n MfgCamera.camera.ellipsoid = new BABYLON.Vector3(src_1.MfgSettings.PLAYER_SIZE_XZ, src_1.MfgSettings.PLAYER_SIZE_Y, src_1.MfgSettings.PLAYER_SIZE_XZ);\n }", "title": "" }, { "docid": "c69ef185aecaf76929dfee26b2060061", "score": "0.5694048", "text": "function setupCamera() {\n camera = new PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.1, 1000);\n camera.position.x = -20;\n camera.position.y = 15;\n camera.position.z = 45;\n camera.lookAt(new Vector3(10, 0, 0));\n console.log(\"Finished setting up Initial Camera...\");\n}", "title": "" }, { "docid": "49ca9809ae03def8c5840338e0e79b40", "score": "0.5692778", "text": "function Camera(pos, yaw, pitch, foward) {\r\n\t\tthis.pos = pos;\r\n\t\tthis.yaw = yaw;\r\n\t\tthis.pitch = pitch;\r\n\t\tthis.foward = foward || [\r\n\t\t\tMath.cos(yaw) * Math.cos(pitch),\r\n\t\t\tMath.sin(yaw) * Math.cos(pitch),\r\n\t\t\tMath.sin(pitch)];\r\n\t\tthis.view = mat4.create();\r\n\t\tmat4.lookAt(this.view, this.pos,\r\n\t\t\tVec3.add(this.pos, this.foward),\r\n\t\t\tVec3.z);\r\n\t}", "title": "" }, { "docid": "c6032313967f8b978d46cc19d7d2d2a4", "score": "0.56813246", "text": "function startPersonCamera(){\r\n\tif (!player)\r\n\t{\t \r\n\t\tplayer = new THREE.FirstPersonControls(camera);\r\n\t\tplayer.setRotationCamera( playerTargetPosition );\r\n\t\tstartAnimationScene();\r\n\t}\t \r\n}", "title": "" }, { "docid": "5f3d71a89ebc728470a710e536b3676f", "score": "0.56248087", "text": "function setupCamera() {\n camera = new PerspectiveCamera(100, window.innerWidth / window.innerHeight, 0.1, 1000);\n camera.position.x = -70;\n camera.position.y = 2;\n camera.position.z = 2;\n camera.lookAt(scene.position);\n cameraControls = new THREE.TrackballControls(camera, renderer.domElement);\n cameraControls.target.set(0, 0, 0);\n console.log(\"Finished setting up Camera...\");\n}", "title": "" }, { "docid": "499a51a3ae6c9aa3a33e80804dc96770", "score": "0.5620463", "text": "setupCamera() {\n this.cameraRunning = true;\n }", "title": "" }, { "docid": "a137f52b5ec13274baeff2115dff0e1e", "score": "0.56189644", "text": "function setupCameras() {\n cameras[0] = new PerspectiveCamera(45, config.Screen.RATIO, 0.1, 1000);\n lookingAt = new Vector3(0, 0, 0);\n cameras[1] = new PerspectiveCamera(45, config.Screen.RATIO, 0.1, 1000);\n cameras[2] = new PerspectiveCamera(45, config.Screen.RATIO, 0.1, 1000);\n cameras[3] = new PerspectiveCamera(45, config.Screen.RATIO, 0.1, 1000);\n cameras[4] = new PerspectiveCamera(45, config.Screen.RATIO, 0.1, 1000);\n cameras[5] = new PerspectiveCamera(45, config.Screen.RATIO, 0.1, 1000);\n console.log(\"Finished setting up Camera...\");\n }", "title": "" }, { "docid": "13848e338d8f8a1e0f6d9d760722420b", "score": "0.5617166", "text": "function crearCamara(){\n\t//Create the camera\n\taspectRatio = ANCHO / ALTURA;\n\tfieldOfView = 55;\t//60\n\tnearPlane = 0.1;\n\tfarPlane = 10000000000;\n\tcamara = new THREE.PerspectiveCamera(fieldOfView, aspectRatio, nearPlane, farPlane);\n\tcamara.position.x = 500;\n\tcamara.position.z = 1000; \n\tcamara.position.y = 500; \n//\tcamara.lookAt(escena.position);\n\tcamara.lookAt(cohete.cuerpo.mesh.position);\n\tescena.add(camara);\n}", "title": "" }, { "docid": "b1a9d2a0b546a1dd97395b1824b7c931", "score": "0.55991733", "text": "initCameras()\r\n {\r\n this.viewNames = [];\r\n if(this.graph.defaultViewDefined){\r\n for (let key in this.graph.views)\r\n {\r\n this.viewNames.push(key);\r\n this.view = this.graph.views[key];\r\n \r\n if (this.view.id == this.graph.defaultViewID){ \r\n var V = this.view;\r\n this.selected = this.view.id;\r\n }\r\n }\r\n } else return;\r\n\r\n\r\n if (V == null) return;\r\n else if (V.type == \"perspective\") \r\n this.camera = new CGFcamera(V.angle*DEGREE_TO_RAD, V.near, V.far, V.from, V.to);\r\n else if (V.type = \"ortho\") \r\n this.camera = new CGFcameraOrtho(V.left, V.right, V.bottom, V.top, V.near, V.far, V.from, V.to, V.up);\r\n \r\n this.interface.setActiveCamera(this.camera);\r\n }", "title": "" }, { "docid": "e5a0dcc316f37e1ba7b016a162f6cff1", "score": "0.55939084", "text": "makeActive () {\n let game = Game.getInstance();\n game.activeCamera = this;\n }", "title": "" }, { "docid": "346c15b9583150ac899cac173dc90e02", "score": "0.5582347", "text": "function initCamera() {\n gCamera = new THREE.PerspectiveCamera(60, window.innerWidth / window.innerHeight, 1, 1000);\n gCamera.position.set(50, 100, 50); // y==200, z==200\n}", "title": "" }, { "docid": "52e93d1d6d62caa987558c3a9ad3db1c", "score": "0.5580843", "text": "setFollowView() {\r\n 'use strict';\r\n //var cameraOffset = relativeCameraOffset.applyMatrix4(MovingCube.matrixWorld);\r\n\r\n var ratio = this.data.camera_ratio;\r\n var camera = new THREE.PerspectiveCamera(50, window.innerWidth / window.innerHeight, 1, 1000);\r\n\r\n camera.position.x = this.ball[0].position.x + 20;\r\n camera.position.y = this.ball[0].position.y + 40;\r\n camera.position.z = this.ball[0].position.z;\r\n console.log(this.ball[0].position);\r\n camera.lookAt(this.ball[0].position);\r\n this.camera = camera;\r\n this.cameraFollow = true;\r\n }", "title": "" }, { "docid": "a7ca725583abe9641242a527a17d353d", "score": "0.5569914", "text": "function M3D_CalculateCamera()\r\n\t{\r\n\t\tM3D_mCamera.position.x = M3D_mCameraZoom * Math.cos(M3D_mCameraAngle) + M3D_mPtLookAt.x;\r\n\t\tM3D_mCamera.position.y = M3D_mCameraY;\r\n\t\tM3D_mCamera.position.z = M3D_mCameraZoom * Math.sin(M3D_mCameraAngle) + M3D_mPtLookAt.z;\r\n\t\tM3D_mCamera.lookAt(M3D_mPtLookAt); //M3D_mScene.position);\r\n\t}", "title": "" }, { "docid": "442c89fcb0c16ff80df0165076186c2a", "score": "0.5567705", "text": "function FreeCamera(name,position,scene,setActiveOnSceneIfNoneActive){if(setActiveOnSceneIfNoneActive===void 0){setActiveOnSceneIfNoneActive=true;}var _this=_super.call(this,name,position,scene,setActiveOnSceneIfNoneActive)||this;/**\n * Define the collision ellipsoid of the camera.\n * This is helpful to simulate a camera body like the player body around the camera\n * @see http://doc.babylonjs.com/babylon101/cameras,_mesh_collisions_and_gravity#arcrotatecamera\n */_this.ellipsoid=new BABYLON.Vector3(0.5,1,0.5);/**\n * Define an offset for the position of the ellipsoid around the camera.\n * This can be helpful to determine the center of the body near the gravity center of the body\n * instead of its head.\n */_this.ellipsoidOffset=new BABYLON.Vector3(0,0,0);/**\n * Enable or disable collisions of the camera with the rest of the scene objects.\n */_this.checkCollisions=false;/**\n * Enable or disable gravity on the camera.\n */_this.applyGravity=false;_this._needMoveForGravity=false;_this._oldPosition=BABYLON.Vector3.Zero();_this._diffPosition=BABYLON.Vector3.Zero();_this._newPosition=BABYLON.Vector3.Zero();// Collisions\n_this._collisionMask=-1;_this._onCollisionPositionChange=function(collisionId,newPosition,collidedMesh){if(collidedMesh===void 0){collidedMesh=null;}//TODO move this to the collision coordinator!\nif(_this.getScene().workerCollisions){newPosition.multiplyInPlace(_this._collider._radius);}var updatePosition=function updatePosition(newPos){_this._newPosition.copyFrom(newPos);_this._newPosition.subtractToRef(_this._oldPosition,_this._diffPosition);if(_this._diffPosition.length()>BABYLON.Engine.CollisionsEpsilon){_this.position.addInPlace(_this._diffPosition);if(_this.onCollide&&collidedMesh){_this.onCollide(collidedMesh);}}};updatePosition(newPosition);};_this.inputs=new BABYLON.FreeCameraInputsManager(_this);_this.inputs.addKeyboard().addMouse();return _this;}", "title": "" }, { "docid": "75e3cc6b14c4428d036f2fc69de97347", "score": "0.556655", "text": "function Camera() {\n\n\tthis._locked = false;\n\n\tthis._scale_x = 1;\n\tthis._scale_y = 1;\n\tthis._offset_x = 0;\n\tthis._offset_y = 0;\n\t\n\tthis._client_w = g_env.getWidth();\n\tthis._client_h = g_env.getHeight();\n\tthis._window_w = this._client_w;\n\tthis._window_h = this._client_h;\n\tthis._center_wx = this._client_w >> 1;\n\tthis._center_wy = this._client_h >> 1;\n\n\tthis._x = this._client_w >> 1;\n\tthis._y = this._client_h >> 1;\n\tthis._z = 1.0;\n\tthis._z_min = 0.5;\n\tthis._z_max = 2.0;\n\tthis._z_from = 1.0;\n\tthis._z_to = 1.0;\n\tthis._z_step_up = 1.2;\n\tthis._z_step_down = 0.8;\n\n\tthis._grab_x = 0;\n\tthis._grab_y = 0;\n\t\n\tthis._pinch_start_x0 = 0;\n\tthis._pinch_start_y0 = 0;\n\tthis._pinch_start_x1 = 0;\n\tthis._pinch_start_y1 = 0;\n\t\n\tthis._drag_delta_buffer = [];\n\tthis._pinch_delta_buffer = [];\n\n\t// Inertia-related..\n\tthis._friction = 0.8;\n\tthis._grabbed = false;\n\tthis._last_x = this._x;\n\tthis._last_y = this._y;\n\tthis._last_z = this._z;\n\tthis._delta_x = 0;\n\tthis._delta_y = 0;\n\tthis._delta_z = 0;\n\t\n\tthis._dragHandler = null;\n\tthis._wheelHandler = null;\n\tthis._pinchHandler = null;\n\t\n\tObject.seal && Object.seal(this);\n}", "title": "" }, { "docid": "59a166cb1d798dcee6ee8d0553576cfb", "score": "0.5563892", "text": "function MfgCamera()\n {\n this.iOffsetX = 0;\n this.iOffsetY = 0;\n }", "title": "" }, { "docid": "422a4e5853675a26512d4f8e44b2f75d", "score": "0.55564725", "text": "init(options, __Gibber) {\n if (Graphics.camera.initialized === true) {\n // store current camera data\n storepos = Marching.camera.pos;\n storedir = Marching.camera.dir;\n storerot = Marching.camera.rotation.value;\n } // we must re-execute to use current Marching.js camera\n\n\n Graphics.createProperty(Graphics.camera.pos, 'x', 0, Marching.camera.pos);\n Graphics.createProperty(Graphics.camera.pos, 'y', 0, Marching.camera.pos);\n Graphics.createProperty(Graphics.camera.pos, 'z', 5, Marching.camera.pos);\n Graphics.createProperty(Graphics.camera, 'rotation', 0, Marching.camera);\n\n if (Graphics.camera.initialized === true) {\n Graphics.camera.pos.z = Graphics.__storepos[2];\n Graphics.camera.pos.x = Graphics.__storepos[0];\n Graphics.camera.pos.y = Graphics.__storepos[1];\n Graphics.camera.dir.z = storedir.z;\n Graphics.camera.dir.x = storedir.x;\n Graphics.camera.dir.y = storedir.y;\n }\n\n Graphics.camera.initialized = true;\n }", "title": "" }, { "docid": "c0a1294f04c6196c129382ac7142616f", "score": "0.5548021", "text": "function ArcRotateCameraInputsManager(camera){return _super.call(this,camera)||this;}", "title": "" }, { "docid": "af2a08533a4b2ac25d82c4ade0f98db7", "score": "0.55456924", "text": "updateCameraLook() {\r\n 'use strict';\r\n if(this.cameraFollow) {\r\n\r\n var cameraOffset = new THREE.Vector3(0, 40, 20);\r\n\r\n this.camera.position.x = this.ball[0].position.x + 20;\r\n this.camera.position.y = this.ball[0].position.y + 40;\r\n this.camera.position.z = this.ball[0].position.z;\r\n\r\n this.camera.lookAt(this.ball[0].position);\r\n }\r\n }", "title": "" }, { "docid": "03b5d5cd5d1306fc31ac7801073fe130", "score": "0.5540634", "text": "create(type, camX, camY, camZ, rotX, rotY, rotZ, fov) {\n return native.createCamWithParams(type, camX, camY, camZ, rotX, rotY, rotZ, fov, true, 2);\n }", "title": "" }, { "docid": "9d3ef1b50270edf4292739b3b068b139", "score": "0.5533209", "text": "function createTrackingCamera(target)\n{\n\tvar camera = {\n\t\tpos:\t[0, 10, 0],\n\t\tvel:\t[0, 0, 0],\n\t\taccl:\t[0, 0, 0],\n\t\tdrag:\t3.0,\n\t\tbounds: {min: [-1, -1, -1], max: [1, 1, 1]}\n\t};\n\n\tvar tpos = [0, 0, 0];\n\tvar ctpos = [0, 0, 0]\n\t\n\tcamera.update = function (dt)\n\t{\n\t\t// target tracking\n\t\tif (target && target.pos)\n\t\t{\n\t\t\ttpos[0] = target.pos[0];\n\t\t\ttpos[1] = target.pos[1];\n\t\t\ttpos[2] = target.pos[2];\n\t\t\t\t\n\t\t\tif (target.rot !== undefined)\n\t\t\t{\n\t\t\t\t// where the camera wants to be\n\t\t\t\tctpos[0] = tpos[0] - Math.sin(target.rot-Math.PI/2.0) * 12.0;\n\t\t\t\tctpos[1] = tpos[1] + 4.0;\n\t\t\t\tctpos[2] = tpos[2] - Math.cos(target.rot-Math.PI/2.0) * 12.0;\n\t\t\t\t\n\t\t\t\t// where the camera wants to look\n\t\t\t\ttpos[0] += Math.sin(target.rot-Math.PI/2.0) * 4.0;\n\t\t\t\ttpos[1] += 1.0;\n\t\t\t\ttpos[2] += Math.cos(target.rot-Math.PI/2.0) * 4.0;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// camera acceleration\n\t\tcamera.accl[0] = (ctpos[0] - camera.pos[0]) * 5.0;\n\t\tcamera.accl[1] = (ctpos[1] - camera.pos[1]) * 5.0;\n\t\tcamera.accl[2] = (ctpos[2] - camera.pos[2]) * 5.0;\n\t\t\n\t\tphysics(camera, dt);\n\t\tcollision(camera, bounds);\n\t};\n\t\n\tvar cameraMtx = mat4.create();\t\n\tcamera.getMatrix = function ()\n\t{\n\t\tmat4.lookAt(camera.pos, tpos, [0.0, 1.0, 0.0], cameraMtx);\n\t\treturn cameraMtx;\n\t};\n\n\treturn camera;\n}", "title": "" }, { "docid": "83287ba80a28c81bc5bbb3b77d72af9d", "score": "0.55279833", "text": "createCamera (renderer) {\n this.camera = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.1, 1000);\n this.camera.position.set (60, 30, 60);\n var look = new THREE.Vector3 (0,20,0);\n this.camera.lookAt(look);\n\n this.trackballControls = new THREE.TrackballControls (this.camera, renderer);\n this.trackballControls.rotateSpeed = 5;\n this.trackballControls.zoomSpeed = -2;\n this.trackballControls.panSpeed = 0.5;\n this.trackballControls.target = look;\n \n this.add(this.camera);\n }", "title": "" }, { "docid": "88b4d0ac3f69c1931f6201e106bb8c62", "score": "0.5525331", "text": "function Camera() {\n\tthis.mTranslate = new IVec2(0, 0); // current translation\n\t\n\tthis.mViewUpdated = false; // indication whether the camera state has been altered\n}", "title": "" }, { "docid": "2f3fb77e6b6236c60766c68fe4193806", "score": "0.5509324", "text": "function setupCamera() {\n camera = new PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.1, 1000);\n camera.position.x = -30;\n camera.position.y = 40;\n camera.position.z = 30;\n camera.lookAt(scene.position);\n console.log(\"Finished setting up Camera...\");\n}", "title": "" }, { "docid": "2f3fb77e6b6236c60766c68fe4193806", "score": "0.5509324", "text": "function setupCamera() {\n camera = new PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.1, 1000);\n camera.position.x = -30;\n camera.position.y = 40;\n camera.position.z = 30;\n camera.lookAt(scene.position);\n console.log(\"Finished setting up Camera...\");\n}", "title": "" }, { "docid": "2f3fb77e6b6236c60766c68fe4193806", "score": "0.5509324", "text": "function setupCamera() {\n camera = new PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.1, 1000);\n camera.position.x = -30;\n camera.position.y = 40;\n camera.position.z = 30;\n camera.lookAt(scene.position);\n console.log(\"Finished setting up Camera...\");\n}", "title": "" }, { "docid": "aec2dd7785b92717957cc76aff0efd10", "score": "0.55008197", "text": "initCameras()\r\n {\r\n this.viewNames = [];\r\n this.camerasInited = [];\r\n if(this.graph.defaultViewDefined)\r\n {\r\n for (let key in this.graph.views)\r\n {\r\n this.viewNames.push(key);\r\n var V = this.graph.views[key];\r\n \r\n if(V.id == this.graph.defaultViewID){ \r\n this.cameraSelected = V.id;\r\n this.securitySelected = V.id;\r\n }\r\n\r\n if (V.type == \"perspective\")\r\n this.camerasInited[V.id]=new CGFcamera(DEGREE_TO_RAD * V.angle, V.near, V.far, V.from, V.to);\r\n \r\n else if (V.type == \"ortho\")\r\n this.camerasInited[V.id]=new CGFcameraOrtho(V.left,V.right,V.bottom,V.top,V.near,V.far,V.from,V.to,V.up);\r\n }\r\n } \r\n else return;\r\n \r\n this.camera = this.camerasInited[this.cameraSelected];\r\n this.securityCAM = this.camerasInited[this.securitySelected];\r\n this.interface.setActiveCamera(this.camera);\r\n }", "title": "" }, { "docid": "381db16e5f986275f395fbde8c4d8327", "score": "0.5493553", "text": "constructor(){\r\n // クラスのインスタンスを保存\r\n CameraManager.instance = this;\r\n this.MainCameraObj = null;\r\n }", "title": "" }, { "docid": "17c465d1f0bc38dda94e506abfe13522", "score": "0.549194", "text": "constructor(fov=75,aspect=window.innerWidth/window.innerHeight,near = 1,far=1000, position, lookAt){\n super();\n this.camera = new THREE.PerspectiveCamera(fov, aspect, near, far);\n position = (position === undefined? new THREE.Vector3(60,30,60) : position);\n this.camera.position.set (position.x,position.y, position.z);\n lookAt = (lookAt === undefined? new THREE.Vector3(0,20,0) : lookAt);\n this.camera.lookAt(lookAt.x,lookAt.y,lookAt.z);\n this.add(this.camera);\n }", "title": "" }, { "docid": "27d842608d94fc25fe17c0b0e15e5998", "score": "0.54883164", "text": "createCamera() {\n this.camera = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.1, 1000);\n this.camera.position.set(0, this.bodyWidth/4, this.bodyWidth/2.5);\n var look = new THREE.Vector3 (0,200,50);\n this.camera.lookAt(look);\n\n return this.camera;\n }", "title": "" }, { "docid": "068edb443d98c45c9908a7e6e6ace970", "score": "0.5478948", "text": "function cameraFollow(\n sprite // Phaser.sprite: The sprite you would like to have the camera follow.\n) {\n this.game.cameras.main.startFollow(sprite);\n}", "title": "" }, { "docid": "51ec0da8aa37dcb5293c6450354a5620", "score": "0.54780555", "text": "init(){\n if (this.cameras.length == 0) alert(\"Empty camera controller.\");\n this.camera = this.cameras[0];\n }", "title": "" }, { "docid": "f09dde2a2e011a7152259d94b5ef5aca", "score": "0.5463616", "text": "function setupCamera() {\n camera = new PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.1, 1000);\n camera.position.x = -110;\n camera.position.y = 110;\n camera.position.z = 110;\n camera.lookAt(scene.position);\n console.log(\"Finished setting up Camera...\");\n}", "title": "" }, { "docid": "cdb66ae4829757bcd700f97ad818e030", "score": "0.5443359", "text": "function Start () {\n\t//create camSpot\n\tcamSpot = new GameObject();\n\tcamSpot.transform.name = \"CameraSpot\";\n\tcamSpot.transform.parent = transform.parent;\n\tcamSpot.transform.position = transform.position;\n\t\n\t//create camFollow\n\tcamFollow = new GameObject();\n\tcamFollow.transform.name = \"CameraFollow\";\n\tcamFollow.transform.parent = transform.parent;\n\tcamFollow.transform.position = focusPoint.position;\n\t//make sure the camFollow is looking at the camera\n\tcamFollow.transform.LookAt(transform);\n\t\n\t//Set maxZoomIn distance to not exceed starting distance from camera to focusPoint\n\tmaxZoomIn = Vector3.Distance(transform.position, focusPoint.transform.position) / zoomDistance;\n}", "title": "" }, { "docid": "6687e29beb5bbf19f6f67fd92249c097", "score": "0.54432833", "text": "function VRDeviceOrientationArcRotateCamera(name,alpha,beta,radius,target,scene,compensateDistortion,vrCameraMetrics){if(compensateDistortion===void 0){compensateDistortion=true;}if(vrCameraMetrics===void 0){vrCameraMetrics=BABYLON.VRCameraMetrics.GetDefault();}var _this=_super.call(this,name,alpha,beta,radius,target,scene)||this;vrCameraMetrics.compensateDistortion=compensateDistortion;_this.setCameraRigMode(BABYLON.Camera.RIG_MODE_VR,{vrCameraMetrics:vrCameraMetrics});_this.inputs.addVRDeviceOrientation();return _this;}", "title": "" }, { "docid": "0136862278638ffdb0537a713a802258", "score": "0.54406863", "text": "function CameraTrigger(game, AM, x, y, width, height, focus, type, speedX, speedY) {\n this.entity = new Entity(x, y, width, height);\n this.game = game;\n this.focus = focus;\n this.type = type;\n this.speedX = speedX;\n this.speedY = speedY;\n \n this.entity.intangible = true;\n}", "title": "" }, { "docid": "584d3e8740ea84fc6634edba30a0ba04", "score": "0.54324466", "text": "create() {\n // listen to resize event\n this.scale.on('resize', this.resize, this);\n\n // create player\n this.createPlayer();\n // add control\n this.createControl();\n\n // camera follow the player\n this.cameras.main.startFollow(this.player);\n }", "title": "" }, { "docid": "1a557b388f7f01b24c12abb38c511ce3", "score": "0.54308254", "text": "function initRenderer() {\n\n var scene = new BABYLON.Scene(engine);\n scene.clearColor = new BABYLON.Color3(0.15, 0, 0.15);\n\n camera = new BABYLON.FreeCamera(\"camera1\", new BABYLON.Vector3(0, 0, -1), scene);\n camera.mode = BABYLON.Camera.ORTHOGRAPHIC_CAMERA;\n\n camera.orthoTop = canvas.height / 400;\n camera.orthoBottom = -canvas.height / 400;\n camera.orthoLeft = -canvas.width / 400;\n camera.orthoRight = canvas.width / 400;\n\n return scene;\n}", "title": "" }, { "docid": "cef65602f0254a40a3fbc2f8d2149c02", "score": "0.54284436", "text": "function TargetCamera(name,position,scene,setActiveOnSceneIfNoneActive){if(setActiveOnSceneIfNoneActive===void 0){setActiveOnSceneIfNoneActive=true;}var _this=_super.call(this,name,position,scene,setActiveOnSceneIfNoneActive)||this;/**\n * Define the current direction the camera is moving to\n */_this.cameraDirection=new BABYLON.Vector3(0,0,0);/**\n * Define the current rotation the camera is rotating to\n */_this.cameraRotation=new BABYLON.Vector2(0,0);/**\n * Define the current rotation of the camera\n */_this.rotation=new BABYLON.Vector3(0,0,0);/**\n * Define the current speed of the camera\n */_this.speed=2.0;/**\n * Add cconstraint to the camera to prevent it to move freely in all directions and\n * around all axis.\n */_this.noRotationConstraint=false;/**\n * Define the current target of the camera as an object or a position.\n */_this.lockedTarget=null;/** @hidden */_this._currentTarget=BABYLON.Vector3.Zero();/** @hidden */_this._viewMatrix=BABYLON.Matrix.Zero();/** @hidden */_this._camMatrix=BABYLON.Matrix.Zero();/** @hidden */_this._cameraTransformMatrix=BABYLON.Matrix.Zero();/** @hidden */_this._cameraRotationMatrix=BABYLON.Matrix.Zero();/** @hidden */_this._referencePoint=new BABYLON.Vector3(0,0,1);/** @hidden */_this._transformedReferencePoint=BABYLON.Vector3.Zero();_this._globalCurrentTarget=BABYLON.Vector3.Zero();_this._globalCurrentUpVector=BABYLON.Vector3.Zero();_this._defaultUp=BABYLON.Vector3.Up();_this._cachedRotationZ=0;_this._cachedQuaternionRotationZ=0;return _this;}", "title": "" }, { "docid": "017e50b151a851de8f484aa3a49a10b0", "score": "0.54249895", "text": "function setupCamera() {\n camera = new PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.1, 1000);\n camera.position.x = -30;\n camera.position.y = 40;\n camera.position.z = 30;\n camera.lookAt(scene.position);\n}", "title": "" }, { "docid": "66b4bb6f4546d5b9bbc491b371e57283", "score": "0.5420706", "text": "async createCamera() {\n alert( 'Please override createCamera() method')\n }", "title": "" }, { "docid": "4a1d13471954cd7e0bf978939e036071", "score": "0.54111695", "text": "cameraFollow(\n sprite // Phaser.sprite: The sprite you would like to have the camera follow.\n ) {\n this.game.cameras.main.startFollow(sprite);\n }", "title": "" }, { "docid": "dc8b0f870294e7fb7a6fda0f0ff203c8", "score": "0.5406602", "text": "constructor(camera) {\n\t\tthis.camera = camera;\n\t\tthis.geometries = [];\n\t}", "title": "" }, { "docid": "50f69d122ab4f6e3c72bbfe749a9dd23", "score": "0.53762543", "text": "constructor(target, cameraElasticity, cameraFriction) {\n this.target = target;\n this.cameraElasticity = cameraElasticity;\n this.cameraFriction = cameraFriction;\n this.action = (target, cam, _eng, _delta) => {\n const position = target.center;\n let focus = cam.getFocus();\n let cameraVel = cam.vel.clone();\n // Calculate the stretch vector, using the spring equation\n // F = kX\n // https://en.wikipedia.org/wiki/Hooke's_law\n // Apply to the current camera velocity\n const stretch = position.sub(focus).scale(this.cameraElasticity); // stretch is X\n cameraVel = cameraVel.add(stretch);\n // Calculate the friction (-1 to apply a force in the opposition of motion)\n // Apply to the current camera velocity\n const friction = cameraVel.scale(-1).scale(this.cameraFriction);\n cameraVel = cameraVel.add(friction);\n // Update position by velocity deltas\n focus = focus.add(cameraVel);\n return focus;\n };\n }", "title": "" }, { "docid": "131fda03ce6148b67c78809358e0dd7d", "score": "0.5368418", "text": "function pointCameraTo(COG, target, camera) {\n // Refocus camera to the center of the new object\n var v = new _three2.default.Vector3();\n v.subVectors(COG, target);\n\n camera.position.addVectors(camera.position, v);\n}", "title": "" }, { "docid": "0256ab8bf93935b7d5bca02879dd300f", "score": "0.5366829", "text": "function launchCamera(){\n\n $(document).trigger('animate', { texts: []})\n\n isCameraMoving = true\n\n currentStep = 0\n\n let p1Position = new THREE.Vector3(...timeline[timelinePostion].position)\n let p2Position = new THREE.Vector3(...timeline[timelinePostion+1].position)\n let linePosition = new THREE.Line3(p1Position, p2Position)\n let centerPosition = linePosition.center()\n\n let p1LookAt = new THREE.Vector3(...timeline[timelinePostion].lookAt)\n let p2LookAt = new THREE.Vector3(...timeline[timelinePostion+1].lookAt)\n let lineLookAt = new THREE.Line3(p1LookAt, p2LookAt)\n let centerLookAt = lineLookAt.center()\n\n // we're trying to find the control point for the position's quadratic curve formed by p1Position and p2Position\n // it will be on the extension of the line formed by the centerLookAt point and the centerLookAt\n // we arbitrary choose that dist(centerLookAt, centerPosition) = 2* dist(centerPosition, controlPosition)\n // the at() function is using a normalized value so we have at(1.5) to reach the controlPosition point\n let lineNormal = new THREE.Line3(centerLookAt, centerPosition)\n let controlPosition = lineNormal.at( 1.5 )\n\n // for the camera's position, we use a quadratic curve\n cameraPositionSteps = new THREE.QuadraticBezierCurve3(\n p1Position,\n controlPosition,\n p2Position\n ).getPoints(animationTotalSteps)\n // but a simple line for the camera's look at\n cameraLookAtSteps = new THREE.LineCurve3(\n p1LookAt,\n p2LookAt\n ).getPoints(animationTotalSteps)\n\n // let's animate !\n animate()\n}", "title": "" }, { "docid": "9c1cb9687244a42d1ee237fabd36f491", "score": "0.5366354", "text": "function Start () {\n InitCamera();\n}", "title": "" }, { "docid": "4ff88fcdbbc21e562e4cc66a886651dd", "score": "0.53605145", "text": "function cameraSetup() {\n this.camera = new THREE.PerspectiveCamera(\n 75, window.innerWidth / window.innerHeight, 1, 10000\n );\n this.camera.position.z = 100;\n this.camera.position.y = 50;\n this.camera.position.x = 100;\n if (_MODE_ == DEV) {\n controls = new THREE.OrbitControls( this.camera );\n controls.target.set(0,0,0);\n }\n return this.camera;\n}", "title": "" }, { "docid": "52ea7de81b9e823d0631e8180b7b6586", "score": "0.53573453", "text": "function CameraMode (editor) {\n this._editor = editor;\n this._startDrag = null;\n }", "title": "" }, { "docid": "18fbc446802af9bbbbbd85f9825aa7fc", "score": "0.5338615", "text": "function Camera() {\n\tthis.camType = 1; //1 = Perspective, 0 = Ortho\n\n\tthis.fov = glMatrix.glMatrix.toRadian(40.0); //glMatrix.mat4.perspective expects radians\n\tthis.upV = glMatrix.vec3.fromValues(0.0, 0.0, 1.0);\n\tglMatrix.vec3.normalize(this.upV, this.upV);\n\n\tthis.panPoint = 3.725;\n\tthis.panStep = 0.02; //pan speed\n\tthis.tiltPoint = 30.209;\n\tthis.tiltStep = 0.015; //tilt speed\n\tthis.eyePoint = glMatrix.vec3.fromValues(80.579, 47.326, 30.112); //camera position\n\tthis.lookPoint = glMatrix.vec3.fromValues(\tthis.eyePoint[0]+Math.cos(this.panPoint), \n\t\t\t\t\t\t\t\t\t\tthis.eyePoint[1] + Math.sin(this.panPoint), \n\t\t\t\t\t\t\t\t\t\tthis.tiltPoint);\n\tthis.dollySpeed = 0.3; //speed for horizontal, vertical movement\n\t\n\tthis.znear = 0.01; //near clipping plane\n\tthis.zfar = 600.0; //far clipping plane\n\tthis.zdist = (this.zfar - this.znear) / 3;\n\t\n\tthis.perAspect;\n\t\n\tthis.halfHeight = this.zdist * Math.tan(Math.PI / 9);\n\tthis.halfWidth = this.halfHeight * this.perAspect; \n\t\n\tthis.changed = true;\n\t\n\tthis.viewMat = glMatrix.mat4.create();\n\tthis.projMat = glMatrix.mat4.create();\n\tthis.vp = glMatrix.mat4.create();\n\tthis.mvp = glMatrix.mat4.create();; //provides faster access to models with id model matricies\n}", "title": "" }, { "docid": "b1f5bf9e82be370f1a24686637f372aa", "score": "0.5337961", "text": "init(xCosine, yCosine, zCosine, controls, box, canvas) {\n // DEPRECATED\n console.warn(\n `cameras.orthographic.init(...) is deprecated.\n Use .cosines, .controls, .box and .canvas instead.`);\n\n //\n if (!(Validators.vector3(xCosine) &&\n Validators.vector3(yCosine) &&\n Validators.vector3(zCosine) &&\n Validators.box(box) &&\n controls)) {\n window.console.log('Invalid input provided.');\n\n return false;\n }\n\n this._right = xCosine;\n this._up = this._adjustTopDirection(xCosine, yCosine);\n this._direction = new Vector3().crossVectors(this._right, this._up);\n this._controls = controls;\n this._box = box;\n this._canvas = canvas;\n\n let ray = {\n position: this._box.center,\n direction: this._direction,\n };\n\n let intersections =\n this._orderIntersections(\n Intersections.rayBox(ray, this._box),\n this._direction);\n this._front = intersections[0];\n this._back = intersections[1];\n\n // set default values\n this.up.set(this._up.x, this._up.y, this._up.z);\n this._updateCanvas();\n this._updatePositionAndTarget(this._front, this._back);\n this._updateMatrices();\n this._updateDirections();\n }", "title": "" }, { "docid": "546e261fd3ffd806ca9f359ef37426b9", "score": "0.5323963", "text": "loadCamera() {\n if (this.interface.cameras) {\n let selectedCamera = this.interface.cameras[ACTIVE_CAMERA];\n this.applyCamera(selectedCamera);\n }\n }", "title": "" }, { "docid": "325cdb3fb1285dba12d4c742fd29edd9", "score": "0.53206044", "text": "function camera()\n {\n eye[0] = center[0] + eyedis * Math.cos(azimuth) * Math.cos(elevation);\n eye[1] = center[1] + eyedis * Math.sin(elevation);\n eye[2] = center[2] + eyedis * Math.cos(elevation) * Math.sin(azimuth);\n\n mat4.lookAt(eye, center, up, view);\n }", "title": "" }, { "docid": "615c3af948efc571f00a29d8b29c35bc", "score": "0.53133786", "text": "constructor() {\r\n super();\r\n this.m_transform = new Transform_target();\r\n this.m_orthographic = false;\r\n this.m_aperture = 100;\r\n this.m_focal = 50;\r\n this.m_clip_max = 1000;\r\n this.m_clip_min = 0.1;\r\n\r\n this.m_scene_up_direction = Camera.Y_UP;\r\n }", "title": "" }, { "docid": "e6be187ac201b447608476307b5530be", "score": "0.53027976", "text": "function initCamera(){\n\tvar width = canvWebGL.width; //references to the 3D context \n\tvar height = canvWebGL.height; \n\n\tcamera = new THREE.PerspectiveCamera(fov, width / height, near, far );\n\tconsole.log(near);\n\tconsole.log(far);\n\tconsole.log(fov);\n\tcamera.position.z = zpos;\n\tcamera.position.y= ypos;\n\tcamera.position.x= xpos;\n\tscene = new THREE.Scene();\n\n\tscene.add(camera);\n\n}", "title": "" }, { "docid": "3e0be1d6e5ea0b7ea054e9fb41786d9b", "score": "0.52953815", "text": "function setupArc(\n r0, // starting direction in local coordinates\n r1, // ending direction local coordinates\n turnradius // turning radius in local coordinates\n) {\n var delta = normalizeRotationDelta(r1 - r0),\n sradius = delta > 0 ? turnradius : -turnradius,\n r0r = convertToRadians(r0),\n dc = [Math.cos(r0r) * sradius, Math.sin(r0r) * sradius],\n r1r = convertToRadians(r1);\n return {\n delta: delta,\n sradius: sradius,\n dc: dc,\n dx: dc[0] - Math.cos(r1r) * sradius,\n dy: dc[1] - Math.sin(r1r) * sradius\n };\n}", "title": "" }, { "docid": "0d4ab1d0ea8b05495877beff74320597", "score": "0.52873653", "text": "function initializeFirstPersonCamera(model) {\n var euler = new THREE.Euler(0, 0, 0, 'YXZ');\n euler.setFromQuaternion(controls.getObject().quaternion);\n controls.getObject().position.set(model.position.x, 4, model.position.z);\n}", "title": "" }, { "docid": "dd815e5ad9b082de9ee264add99524f0", "score": "0.52865374", "text": "function createCamera() {\n camera1 = new THREE.OrthographicCamera(window.innerWidth/20, -window.innerWidth/20, window.innerHeight/20, -window.innerHeight/20,1000,1);\n camera1.position.set(0,-50,0);\n camera1.lookAt(scene.position);\n\n camera2 = new THREE.PerspectiveCamera(90, window.innerWidth/window.innerHeight, 0.1, 1000);\n camera2.position.set(-50,35,0);\n camera2.lookAt(scene.position);\n}", "title": "" }, { "docid": "8ef7d4874e36f46cb7d80ed40f8c5cd4", "score": "0.5286125", "text": "createCamera (renderer) {\n this.camera = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.1, 1000);\n this.camera.position.set (50, 50, 50); //EXAMEN\n var look = new THREE.Vector3 (0,0,0);\n this.camera.lookAt(look);\n this.add(this.camera);\n }", "title": "" }, { "docid": "5ee02eec889009d276b12845a2b8496e", "score": "0.52795166", "text": "function startCamera()\n{\n $('#camera_wrap').camera({fx: 'scrollLeft', time: 2000, loader: 'none', playPause: false, navigation: true, height: '35%', pagination: true});\n}", "title": "" } ]
5f18dad2e47e66a2b45bb81faab8b126
set de json naar de nieuwe events
[ { "docid": "6dd0c7ad914fee1b36f49152fc3a5628", "score": "0.7118701", "text": "function set_events_from_json(new_events) {\n fs.writeFile('events.json', JSON.stringify(new_events), function(err) {\n if(err) throw err;\n });\n}", "title": "" } ]
[ { "docid": "ed17a0f8781ed634ed754cd941001cf2", "score": "0.621933", "text": "async setEvents() {\n let prevEvents = await AsyncStorage.getItem('prevEvents'); \n AsyncStorage.setItem('events', prevEvents);\n this.changeEvents(); \n }", "title": "" }, { "docid": "e87e2f48ecbaf6ccc8397f6ae3537263", "score": "0.6181333", "text": "function setData(data) {\n\tevent_data = data;\n}", "title": "" }, { "docid": "265d8d22e5577d9449f6b5581509512d", "score": "0.5929361", "text": "onChange(newValue) {\n this.json = newValue;\n this.jsonChanged = true;\n }", "title": "" }, { "docid": "1790fe013280160efb68b86b36d608b3", "score": "0.5863866", "text": "getJson() {\r\n var event = {\r\n 'summary': this.cancelled == true ? this.name + '(ANNULÉ)' : this.name,\r\n 'location': this.room,\r\n 'description': this.getDescription(),\r\n 'colorId' : this.color,\r\n 'start': {\r\n 'dateTime': this.start_event,\r\n 'timeZone': 'Europe/Paris',\r\n },\r\n 'end': {\r\n 'dateTime': this.end_event,\r\n 'timeZone': 'Europe/Paris',\r\n },\r\n 'reminders': {\r\n 'useDefault': false,\r\n 'overrides': [\r\n {'method': 'popup', 'minutes': 10},\r\n ],\r\n },\r\n };\r\n\r\n return event;\r\n }", "title": "" }, { "docid": "5490ab3301bfbc180b39672150ec4e90", "score": "0.5816648", "text": "async changeEvents() {\n\n let events = JSON.parse(await AsyncStorage.getItem('events'));\n\n if(events == null){\n events = JSON.parse(await AsyncStorage.getItem('originalEvents'));\n }\n\n this.setState({\n events: events\n });\n }", "title": "" }, { "docid": "98002366a4fee5ae7dec51291207c445", "score": "0.5815897", "text": "constructor() { \n \n JsonV1Event.initialize(this);\n }", "title": "" }, { "docid": "c8c4cda1691a9a580d0ecfe0495e9686", "score": "0.5744568", "text": "constructor() {\n this.events = {}\n }", "title": "" }, { "docid": "7e07e6a6f089d251d309b0eb7154f443", "score": "0.5713728", "text": "toJSON() {\n return Object.assign({}, this.data, {\n timezone: this.timezone(),\n events: this.data.events.map(event => event.toJSON()),\n x: this.x()\n });\n }", "title": "" }, { "docid": "c6e93d51e0f890fbaa54f98412fbef78", "score": "0.57007784", "text": "function setData(jsonData) {\n data = jsonData;\n}", "title": "" }, { "docid": "66da9a217b5e6683114239308ca468b1", "score": "0.5685219", "text": "function getJSON(data)\r\n{\r\n\tvar req = request(data.method, data.url, data);\r\n\tvar result = JSON.parse(req.getBody('utf8'));\r\n\tconsole.log('Загружено: '+ result.events.length + ' событий, ' + data.name);\r\n\treturn result.events;\r\n}", "title": "" }, { "docid": "1482271d316f1df29be388d10321b57f", "score": "0.5575388", "text": "function EventDict() {}", "title": "" }, { "docid": "1482271d316f1df29be388d10321b57f", "score": "0.5575388", "text": "function EventDict() {}", "title": "" }, { "docid": "afba3c74315750d5ba9bf4d60561688a", "score": "0.55192995", "text": "function get_events_from_json() {\n let data = fs.readFileSync('events.json', 'utf-8');\n events = JSON.parse(data);\n}", "title": "" }, { "docid": "5c39a8e7ae7abb11ed80d0be920db9ae", "score": "0.5494333", "text": "function updateMeetingData(single_event) {\n console.log(\"jestem tutaj\")\n console.log(single_event)\n var temp_events = [];\n for (let i=0; i < events.length; i++) {\n if (events[i].id === single_event.id) {\n const event = {}\n event[\"id\"] = single_event.id\n event[\"title\"] = single_event.title\n event[\"start\"] = new Date(single_event.start)\n event[\"end\"] = new Date(single_event.end)\n event[\"location\"] = single_event.location\n console.log(event)\n temp_events.push(event)\n }\n else {\n temp_events.push(events[i])\n }\n \n }\n console.log(temp_events);\n test3(temp_events)\n }", "title": "" }, { "docid": "c9aeb06feae5dc85c4fd3d55f94e6cba", "score": "0.54686195", "text": "function eventReqListener () {\n var jsonResponse = JSON.parse(this.responseText);\n EventActions.createAll(jsonResponse.results);\n}", "title": "" }, { "docid": "5776632fd6e3987b7507bbcb6bd27b72", "score": "0.54655355", "text": "toJSON() {\n return this._events.toJS();\n }", "title": "" }, { "docid": "0fb36a23c1d33120cb5134e4a2c19c7e", "score": "0.54498506", "text": "function SetFieldText(sender, e) {\n var fldName = GetFieldName(sender.name);\n SetJSONField(fldName, sender.GetText());\n}", "title": "" }, { "docid": "6631507b326ac99c4d8f0920a865dc2c", "score": "0.54234016", "text": "function setEventData(data) {\n if (eventData != data) {\n eventData = data;\n chrome.browserAction.setPopup({popup: \"events.html\"});\n }\n}", "title": "" }, { "docid": "d0a17ef81461d2aaab05e4dd2364dab5", "score": "0.5407329", "text": "post(newEventObject) {\n return fetch(`${remoteURL}/events`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(newEventObject)\n }).then(data => data.json())\n }", "title": "" }, { "docid": "4fbfd01b788cd1f0706e83a981d2c881", "score": "0.54026043", "text": "function GetFieldValue(sender, e) { \n var fldName = GetFieldName(sender.name);\n sender.SetValue(GetJSONField(fldName));\n\n}", "title": "" }, { "docid": "a6348b9320f236106fac6192b22b9793", "score": "0.54005134", "text": "toJSON() {\n\t\tvar jsonData = {\n\t\t\tlisteners: this.listeners\n\t\t};\n\n\t\treturn jsonData;\n\t}", "title": "" }, { "docid": "542c6fc323d0208824e4bb412182cfec", "score": "0.5393155", "text": "function recargarEventos(idCampo){\n var events = {\n url: \"/FutPlayFinal/canchas/getJSONEncuentros/\"+idCampo+\"\",\n type: 'POST' \n };\n $(\"#calendar\").fullCalendar('removeEvents');\n $('#calendar').fullCalendar('addEventSource', events);\n }", "title": "" }, { "docid": "83f5626a568ff92e04abb24b67159858", "score": "0.5380856", "text": "async function getJson() {\n\n let jsonObject = await fetch(\"https://jakobfalkenberg.dk/kea/2sem/tema7/huset/wordpress/wp-json/wp/v2/event\");\n allEvents = await jsonObject.json();\n\n\n eventOutPut.textContent = \"\";\n\n\n visEvents();\n\n\n\n\n }", "title": "" }, { "docid": "e0003eee73ff435874d7000d3b5794e0", "score": "0.5379181", "text": "async function updateEvent(data){\n\n}", "title": "" }, { "docid": "6cfa99cf1ed512bf3636361ffc9d9a1d", "score": "0.5371937", "text": "function loadHoseEvents() {\n $.get(\"/api/general/hoseEvents\"\n ).done(function (data) {\n $.each(data.hoseEvents, function (index, element) {\n hoseEvents[element.id] = element;\n });\n updateEvents();\n controlForm(false);\n });\n}", "title": "" }, { "docid": "cba2726eb3cdd030545fb7c200c85a2b", "score": "0.53625464", "text": "constructor() {\n\t\tthis.events = []\n\t\tthis.handlers = {}\n\t}", "title": "" }, { "docid": "4a5338aa4666cbe973ebee21ebf2f552", "score": "0.53563136", "text": "function updateEventList(data, owner) {\n const newEventList = JSON.stringify(data);\n fs.writeFileSync(path.resolve(`./data/events/events_${owner}.json`), newEventList);\n}", "title": "" }, { "docid": "993e1491cc27c37316ff1ade4f9ccaa9", "score": "0.5354319", "text": "function addEvents(eventObject) {\n\tchrome.storage.local.get({events: []}, function(result) {\n\t\tvar list = result.events;\n\t\tlist.push(JSON.stringify(eventObject)); \n\t\tchrome.storage.local.set({\"events\": list}, function() {\n\t\t\tconsole.log('value set to ' + list);\n\t\t});\n\t});\n}", "title": "" }, { "docid": "bfa71983915993352eeeef7d607780dd", "score": "0.5347387", "text": "function receiveEvents(json, error) {\n // If there's been an error, return empty object, else return parsed list of events\n let eventsList = error ? [] : (parseJSON(json));\n return {\n type: RECEIVE_EVENTS,\n receivedAt: Date.now(),\n events: json,\n eventsList: eventsList,\n error: error\n }\n}", "title": "" }, { "docid": "07cb2ab31e0fb31ba8599c7fb7f6f1d9", "score": "0.5346799", "text": "function new_event_json(name, category_type, category_id, money_amount, describe, date, day) {\n var event = {\n \"name\": name,\n \"category_type\": category_type,\n \"category_name\": category_id,\n \"money_amount\": money_amount,\n \"year\": date.getFullYear(),\n \"month\": date.getMonth() + 1,\n \"day\": day\n };\n event_data[\"events\"].push(event);\n }", "title": "" }, { "docid": "180c6e8931737767310a0f32f46df20b", "score": "0.53261334", "text": "function setEvent(event) {\n console.info(\"Setting the Current Event: \", event);\n $('#edit_event').val(event);\n }", "title": "" }, { "docid": "9996cd03b6ed377abc5f9bc5501abeff", "score": "0.5302528", "text": "handleEvent(event) {\n if (event.type !== 'change') { return ;}\n // Try to convert the textarea value to JSON\n // If we can, trigger a change.\n const elTextarea = this.querySelector('textarea');\n const rawJSON = elTextarea.value;\n try {\n const json = JSON.parse(rawJSON);\n this.json = json;\n this.classList.remove('error--json-invalid')\n this.triggerChange();\n }\n catch(e) {\n console.log('handleEvent ERROR parsing JSON', e);\n this.classList.add('error--json-invalid')\n }\n }", "title": "" }, { "docid": "96de331e5397678dfbfb34d45c86fec7", "score": "0.5299485", "text": "async getEvents() {\n let prevEvents = await AsyncStorage.getItem('events'); \n if(prevEvents == null){\n prevEvents = await AsyncStorage.getItem('originalEvents')\n } \n AsyncStorage.setItem('prevEvents', prevEvents);\n }", "title": "" }, { "docid": "ab7cee7254d95229c39851b0435b93bf", "score": "0.52872086", "text": "function setGeoJson () {\n \tscope.objects.addTo(scope.map);\n }", "title": "" }, { "docid": "7169c5b8af7c0c8a00d2999cffdbb5dd", "score": "0.5279674", "text": "function parseJSON(result) {\n for(var v in result.objects) {\n var obj = result.objects[v];\n obj.data_inicio = moment(obj.data_inicio);\n obj.data_fim = moment(obj.data_fim);\n var dateRange = enumerateDaysBetweenDates(obj.data_inicio, obj.data_fim); // dá lista de dias entre datas\n \n for(var day in dateRange) {\n var date = moment(dateRange[day]).format('YYYYMMDD');\n if(!(date in eventos)) eventos[date] = []; // cria dia em lista de eventos se não existe\n eventos[date].push(obj); // insere no dia\n }\n }\n $(\"#data\").date(\"refresh\"); // atualiza marcações no calendário\n}", "title": "" }, { "docid": "8755fb159fe70fba7edad840d1dc22f9", "score": "0.52718973", "text": "addEvent() {\n console.log(\"Adding empty event\");\n this.data.events.push({\n type: \"\",\n date: \"\",\n place: \"\",\n id: 'E_' + this.$root.eventId++\n });\n }", "title": "" }, { "docid": "e3dd2f100f2949acda6c3a85d2853ef8", "score": "0.5255099", "text": "function ObjectWithEvent() {\r\n this._events = {};\r\n}", "title": "" }, { "docid": "9188a512606e9c1d7eb409aed539d063", "score": "0.5243695", "text": "afterLoadFromJSON(args) {\n super.afterLoadFromJSON(args);\n this.setAttributes(this.getAttributes());\n }", "title": "" }, { "docid": "8f78999ea7931df81fc3a6c0827060e6", "score": "0.5241198", "text": "setEvents(...ev) {\n for (let action of actions) {\n this[action] = false;\n }\n for (let e of ev) {\n this[e] = true;\n }\n }", "title": "" }, { "docid": "64d3f0182512570cbea3aac2a3932722", "score": "0.521395", "text": "clearJSON(){\n this.putJSON(null);\n }", "title": "" }, { "docid": "98be6f69ed066b185a0a9b6a3a129b4a", "score": "0.52081776", "text": "function setEvent(inputArray, client) {\n var date = inputArray[3];\n var topic = \"\";\n for (i = 4; i < inputArray.length; i++) {\n topic += inputArray[i] + \" \";\n }\n var event = {\n \"topic\": topic.trim(),\n \"date\": date\n };\n save(event, eventFile);\n client.write(\"\\nYou have updated the event info to:\\n\" + topic.trim() + \" on \" + eventObj.date + \"\\n\\n\");\n}", "title": "" }, { "docid": "20ff295ce71bbf7029725381ad03ca09", "score": "0.5168844", "text": "function getEventos(){\n\t$.ajax({\n type: \"GET\",\n url: \"https://api.myjson.com/bins/vt3sf\",\n contentType: \"application/x-www-form-urlencoded; charset=utf-8\",\n async: false,\n dataType: \"json\",\n success: function(data){\n var status = data.status;\n localStorage.listaEventos = JSON.stringify(data.eventos);\n localStorage.eventosLoaded = \"true\";\n },\n failure: function(errMsg){\n alert(\"Error durante la comunicación con la base de datos de eventos.\");\n }\n });\n}", "title": "" }, { "docid": "0ad8fecb2c30c3d563e395460321218a", "score": "0.51670235", "text": "constructor() {\n this[events] = new Map();\n }", "title": "" }, { "docid": "db5c2f86175ead2c6771e1e82e0d6882", "score": "0.5159991", "text": "updateFromJson(json) {\n const self = this;\n self.set('details', json);\n const keys = Object.keys(json);\n keys.forEach(key => {\n self.set(key, json[key]);\n });\n }", "title": "" }, { "docid": "ff6219dd442154723f3e445ec576ddb8", "score": "0.5148885", "text": "function normilizeEvent(fullEventBody, iterator) {\n var result = {};\n for (var key in fullEventBody) {\n if (fullEventBody[key] !== 'data') {\n result[key] = fullEventBody[key];\n }\n }\n result.data = fullEventBody.data;\n return result;\n}", "title": "" }, { "docid": "b5a1c6fd0b8f5a1860355b65c9443d77", "score": "0.5147383", "text": "get eventsList() {\n let events =\n typeof this.events === \"string\" ? JSON.parse(this.events) : this.events;\n return events || [];\n }", "title": "" }, { "docid": "8e7244f2bb7239708e7b53d8c91bfb76", "score": "0.5137168", "text": "function newEvent(objectContainingData) {\n\n var obj = JSON.parse(objectContainingData.data);\n alarm.lightPowered = obj.lightPowered;\n alarm.currentCelsius = obj.currentCelsius;\n console.log(\"new alarm event\")\n console.log(obj)\n //console.log(alarm)\n // DONE: Publish the state to any listeners\n alarm.stateChange()\n }", "title": "" }, { "docid": "02138a30cab42eb674568cd57d2a37f4", "score": "0.5125556", "text": "function convertirJson(d){\n jsonData = d;\n}", "title": "" }, { "docid": "0365d20c46a9c2f650a6f57bd1a98b78", "score": "0.5123237", "text": "set(key, value) {\n this.data.items[key] = this.serializer.serialize(value);\n }", "title": "" }, { "docid": "4dbcdf524a9f34bcea49e09a8cd2005a", "score": "0.51220256", "text": "function handleAddEvent(){\n if(newEvent.title){\n setAllEvents(prevAllEvents =>{\n return [...prevAllEvents , {title:newEvent.title, start:newEvent.start ,id:v4() , workDay:'Ja', done:false}]\n })\n \n } \n}", "title": "" }, { "docid": "634e6827febafc72c9da1595c108005d", "score": "0.5116825", "text": "updateEvent() {\r\n\r\n let eventId = this.fetchNextEventsId();\r\n\r\n if (eventId === null) return;\r\n this.calendar.events.patch(\r\n {\r\n 'calendarId' : 'primary',\r\n 'eventId' : eventId,\r\n 'resource' : this.getJson()\r\n }\r\n );\r\n\r\n\r\n\r\n\r\n }", "title": "" }, { "docid": "34cf60971bdad9ca80097e40eafa57f3", "score": "0.51130384", "text": "function onEONETEventsLoaded(data) {\n console.log(\"EONET returned \" + data.events.length + \" events\");\n\n $.getJSON('data/usgs-earthquakes-2015-clean.json').done(function(dataEQ) {\n\n // Merge all events into data.events\n Array.prototype.push.apply(data.events, dataEQ.events);\n\n // Convert events form return format to GeoJSON to use them with MapboxGL\n var geojson = eonetDataToGeoJSON(data);\n\n // Map events\n mapEONETEvents(geojson);\n });\n}", "title": "" }, { "docid": "8d384b02d79a9904e9e8260b41467db6", "score": "0.5112605", "text": "set(key, val) {\n this.json[0][key] = val;\n this.writeFile();\n }", "title": "" }, { "docid": "5de499f7ef8e1e008048c1c7dbe0dc7a", "score": "0.51121634", "text": "_handleResponse(event) { \r\n this.data = event.detail.response;\r\n console.log(this.data); \r\n }", "title": "" }, { "docid": "bd694548977e417639a0d1457e985bf4", "score": "0.50970376", "text": "setEvents(socket) {\n const client = this;\n\n const events = {\n ready: (data) => {\n Util.log(data);\n client.ready();\n },\n };\n\n Object.entries(events).forEach((row) => {\n const [e, event] = row;\n socket.removeListener(e, event);\n socket.on(e, event);\n });\n }", "title": "" }, { "docid": "96f03b6b1eacce619c46e714bf2ae007", "score": "0.5092195", "text": "static get listenedEvents(){return Je}", "title": "" }, { "docid": "1a03f141652190379c4264c4733c24a2", "score": "0.50743127", "text": "function generateSelectedEventListObj(jsonObj) {\n let result = [];\n // if (jsonObj.page.totalElements == 0 || typeof jsonObj._embedded.events == undefined || jsonObj._embedded.events.length == 0) {\n // return result;\n // }\n let eventArr = tryGetObj('jsonObj._embedded.events', jsonObj, -1);\n if (eventArr == undefined || eventArr.length == 0) {\n return result;\n }\n for (let index = 0, size = eventArr.length; index < size; index++) {\n // for (let index in jsonObj._embedded.events) { \n let eventObj = jsonObj._embedded.events[index];\n if (eventObj == undefined) {\n continue;\n }\n let name = tryGetObj ('jsonObj[\"name\"]',jsonObj, index);\n let date = tryGetObj ('jsonObj[\"_embedded\"][\"events\"][index][\"dates\"][\"start\"][\"localDate\"]',jsonObj, index);\n let localTime = tryGetObj ('jsonObj[\"_embedded\"][\"events\"][index][\"dates\"][\"start\"][\"localTime\"]',jsonObj, index);\n let eventId = tryGetObj ('jsonObj[\"_embedded\"][\"events\"][index][\"id\"]',jsonObj, index);\n let eventName = tryGetObj ('jsonObj[\"_embedded\"][\"events\"][index][\"name\"]',jsonObj, index);\n let genre = tryGetObj ('jsonObj[\"_embedded\"][\"events\"][index][\"classifications\"][0][\"genre\"][\"name\"]',jsonObj, index);\n let segment = tryGetObj ('jsonObj[\"_embedded\"][\"events\"][index][\"classifications\"][0][\"segment\"][\"name\"]',jsonObj, index);\n let venue = tryGetObj ('jsonObj[\"_embedded\"][\"events\"][index][\"_embedded\"][\"venues\"][0][\"name\"]', jsonObj, index);\n let attractionsArr = tryGetObj ('jsonObj[\"_embedded\"][\"events\"][index][\"_embedded\"][\"attractions\"]', jsonObj, index);\n let buyTicketAt = tryGetObj ('jsonObj[\"_embedded\"][\"events\"][index][\"url\"]', jsonObj, index);\n let artistArr = [];\n try {\n for (let i = 0; i < attractionsArr.length; i++) {\n artistArr.push(attractionsArr[i][\"name\"]);\n }\n } catch (error) {\n artistArr = [];\n }\n\n if (segment && segment.toLowerCase() == 'undefined') {\n segment = undefined;\n }\n if (genre && genre.toLowerCase() == 'undefined') {\n genre = undefined;\n }\n \n //result.push()?????????\n result[index] = {\n 'date' : date,\n 'eventId' : eventId,\n 'eventName' : eventName,\n 'genre' : genre,\n 'segment': segment,\n 'venue' : venue,\n 'artistArr' : artistArr,\n 'buyTicketAt' : buyTicketAt,\n 'localTime' : localTime,\n }\n }\n return result;\n}", "title": "" }, { "docid": "276416b1f8d7eb0b9ede930e28c75b9f", "score": "0.50734735", "text": "AddFechaEvento() {\n this\n .state\n .evento\n .fechas_eventos_attributes\n .push(Object.assign({}, this.emptyFechaEvento));\n this.setState({ evento: this.state.evento });\n }", "title": "" }, { "docid": "7b50a0afe8e49a4e01108a512386a468", "score": "0.5072625", "text": "function newFeedEvent(objectContainingData) {\n loadingPageOff();\n console.dir(objectContainingData);\n var object = JSON.parse(objectContainingData.data);\n console.log(object);\n feeder.fillLevel = object.fillLevel;\n feeder.emptyStatefault = object.emptyStatefault;\n feeder.filledStatefault = object.filledStatefault;\n feeder.feedFault = object.feedFault;\n feeder.stateChange();\n}", "title": "" }, { "docid": "e38d559b0c7f7c528e0ef54cf468cdd1", "score": "0.5072074", "text": "formatEventData(rawJsonData) {\n // Select the correct item in the RSS data\n var eventJsonData = rawJsonData.rss.channel[0].item;\n\n for (key in eventJsonData) {\n // Create a new more friend eventDate object and delete the old one\n eventJsonData[key].EventDate = eventJsonData[key][\"dc:date\"][0];\n delete eventJsonData[key][\"dc:date\"];\n\n // Create a new and more friendly object for the image url\n eventJsonData[key].EventImage = eventJsonData[key][\"media:content\"][0][\"$\"][\"url\"];\n delete eventJsonData[key][\"media:content\"];\n\n // Move the other objects out of an array for easier access\n eventJsonData[key].EventName = eventJsonData[key][\"title\"][0];\n delete eventJsonData[key][\"title\"];\n\n eventJsonData[key].EventDescription = eventJsonData[key][\"description\"][0];\n delete eventJsonData[key][\"description\"];\n\n eventJsonData[key].FriendlyDescription = eventJsonData[key][\"EventDescription\"].replace(/(<([^>]+)>)/gi, \"\");\n\n eventJsonData[key].EventLink = eventJsonData[key][\"link\"][0];\n delete eventJsonData[key][\"link\"];\n\n eventJsonData[key].EventAltDate = eventJsonData[key][\"pubDate\"][0];\n delete eventJsonData[key][\"pubDate\"];\n\n // Add an event ID to each event\n eventJsonData[key].EventId = key;\n\n }\n // Return the formatted data\n return eventJsonData;\n }", "title": "" }, { "docid": "7d9934fd68b32e3d5e1849dce67acf27", "score": "0.5071736", "text": "updateEventsList() {\n \n }", "title": "" }, { "docid": "c07a4e6779243788f5b56b669cfa9b78", "score": "0.50640637", "text": "function Event( passedObj ) {\n\tvar obj = passedObj;\n\tobj.teams = [];\n\tobj.scorers = [];\n\tobj.stations = [];\n\treturn obj;\n}", "title": "" }, { "docid": "c4571f454ba117ea90e6005cb45ce9e7", "score": "0.5059952", "text": "function set(data){\n\nfs.writeFileSync('./todos.json', JSON.stringify(data))\n\n}", "title": "" }, { "docid": "5f736dda87fe7db91f0fcb60b14e5f4f", "score": "0.50562024", "text": "function updatedJson(){\n console.log(\"data updated\");\n}", "title": "" }, { "docid": "c3ce866d6e229f1c6348af8ae2b8bfc3", "score": "0.50535357", "text": "function updateEvent(res){\n\t\t\tif(angular.isDefined(res)){\n\t\t\t\tvm.eventData.length = 0;\n\t\t\t\tangular.forEach(res, function(value, key){\n\t\t\t\t\tvm.eventData.push({x: parseInt(value.timestamp), y: parseFloat(value.confidence), z: key});\n\t\t\t\t});\n\t\t\t\tif(vm.chart.options.data.length<=1){\n\t\t\t\t\tvm.chart.options.data.push({\n\t\t\t\t\t\ttype: \"column\",\n\t\t\t\t\t\tfillOpacity: .5, \n\t\t\t\t\t\tvisible: true,\n\t\t\t\t\t\taxisYType: \"secondary\",\n\t\t\t\t\t\txValueType: \"dateTime\",\n\t\t\t\t\t\txValueFormatString:\"YYYY MM DD HH:mm\",\n\t\t\t\t\t\tdataPoints: vm.eventData,\n\t\t\t\t\t\tclick: function(e){\n\t\t\t\t\t\t\tgetEventDetails(e.dataPoint.z);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tvm.chart.render();\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "fbdeecf18ebf8cc1eeb91818ed521899", "score": "0.5049646", "text": "mapEvents() {\n const key = Object.keys(this.sdfObject.sdfObject)[0];\n for (let property in this.__getRootObject().sdfEvent) {\n const sdfEvent = this.__getSDFObjectEvent(key, property);\n let thingModelEvent = this.__generateThingEvent(property);\n\n for (let inputObjectKey in sdfEvent.sdfOutputData) {\n if (sdfEvent.sdfOutputData[inputObjectKey].sdfRef) {\n thingModelEvent.data = this.__getSDFObjectRef(\n sdfEvent.sdfOutputData[inputObjectKey].sdfRef\n );\n }\n }\n\n // thingModelEvent.forms = this.__generateThingModelForms(\n // thingModelEvent.forms[0].href\n // );\n if (this.__isRequired(property)) {\n // this.targetModel.events.required.push(property);\n this.targetModel[\"tm:required\"].push(`#/events/${property}`);\n }\n this.targetModel.events[property] = thingModelEvent;\n }\n }", "title": "" }, { "docid": "998c5106118190dba4fe0398a390a6e2", "score": "0.5038279", "text": "function calendarSettings(json) {\n\n\t\t$('#calendar').fullCalendar({\n\n\t\t\t// Settings\n\t\t\tcolumnFormat: json[0].columnFormat,\n\t\t\tdefaultView: json[0].view,\n\t\t\tfirstDay: json[0].firstDay,\n\n\t\t\t// Events\n\t\t\tevents: json,\n\t\t\ttimeFormat: 'H:mm',\n\t\t\teventRender: function (event, element) {\n\t\t\t\telement.attr('data-fancybox-href', event.fancybox);\n\t\t\t\telement.attr('title', event.title);\n\t\t\t\telement.find('.fc-time').hide();\n\t\t\t},\n\t\t\teventClick: function () {\n\t\t\t\t$('.light-box').fancybox({\n\t\t\t\t\tscrolling: 'hidden',\n\t\t\t\t\tpadding: 0,\n\t\t\t\t\tautoSize: false,\n\t\t\t\t\tfitToView: false,\n\t\t\t\t\twidth: 600,\n\t\t\t\t\theight: 325,\n\t\t\t\t\tautoCenter: true,\n\t\t\t\t\tcloseBtn: true,\n\t\t\t\t\topenEffect: 'fade',\n\t\t\t\t\tcloseEffect: 'fade',\n\t\t\t\t\ttype: 'ajax',\n\t\t\t\t\thelpers: {\n\t\t\t\t\t\ttitle: null,\n\t\t\t\t\t\toverlay: {\n\t\t\t\t\t\t\tlocked: false\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tbeforeShow: function () {\n\t\t\t\t\t\t$(\"body\").css({'overflow-y': 'hidden'});\n\t\t\t\t\t\t$(\"a[href^='http']\").attr('target','_blank');\n\t\t\t\t\t},\n\t\t\t\t\tafterClose: function () {\n\t\t\t\t\t\t$(\"body\").css({'overflow-y': 'visible'});\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t})\n\t}", "title": "" }, { "docid": "4f9eeec53a3778025428224879665b1c", "score": "0.5029471", "text": "postJsonAssignation(data:JSON) {\n }", "title": "" }, { "docid": "12f9e0ab780fe5cf35e10363c541a214", "score": "0.50293535", "text": "function putJson(data) {\n $.ajax({\n url: 'http://localhost:3000/elevator/1',\n method: 'PUT',\n data: data,\n // contentType: 'application/json; charset=UTF-8',\n // TODO implement event emiter\n complete: () => { getJson(target.render); getJson(status.render); }\n });\n }", "title": "" }, { "docid": "034143c48dc194d4075b4935c136a4b3", "score": "0.5020152", "text": "postEvent (description, init_time, final_time, week_day, is_repeatable, lab, date) {\n var data = JSON.stringify(\n {\n description: description,\n init_time: init_time,\n final_time: final_time,\n week_day: week_day,\n is_repeatable: is_repeatable,\n lab: lab,\n date: date,\n },\n\n )\n var config = {\n method: 'post',\n url: ENDPOINT_PATH + 'event',\n headers: {\n 'x-access-token': this.getUserLogged(),\n Authorization: 'Basic QWRtaW46MTIzNDU=',\n 'Content-Type': 'application/json',\n },\n data: data,\n }\n return axios(config)\n .then(response => {\n alert(response.data.message)\n return response\n // console.log(this.posts.message)\n },\n ).catch(e => {\n console.error(e.data.message)\n })\n }", "title": "" }, { "docid": "c288e208098b4feeaacbb25069e88d89", "score": "0.50101894", "text": "function set(e) {\n\t\tswitch((e.nodeName == \"INPUT\")? e.type:(e.nodeName).toLowerCase()) {\n\t\t\tcase \"fieldset\":\n\t\t\t\t(function(){\n\t\t\t\t\t// 'a' is an array, to hold the checked elements\n\t\t\t\t\tvar a = [];\n\t\t\t\t\t\n\t\t\t\t\t// this is the fieldset element;\n\t\t\t\t\t($(this).find('[type=\"checkbox\"]').length > 0)? a = $(this).find('[type=\"checkbox\"]'):a = $(this).find('[type=\"radio\"]');\n\t\t\t\t\t\n\t\t\t\t\tif (a.length > 0) {\n\t\t\t\t\t\tfor (var i = 0; i < a.length; i++) {\n\t\t\t\t\t\t\tif (a[i].checked && a[i].getAttribute(\"name\")) {\n\t\t\t\t\t\t\t\tif (!json[a[i].getAttribute(\"name\")]) json[a[i].getAttribute(\"name\")] = [];\n\t\t\t\t\t\t\t\tjson[a[i].getAttribute(\"name\")].push(a[i].value);\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}).call(e);\n\t\t\t\tbreak;\n\t\t\tcase \"hidden\":\n\t\t\t\t(function(){\n\t\t\t\t\tif (this.getAttribute(\"name\")) json[this.getAttribute(\"name\")] = this.value;\n\t\t\t\t}).call(e);\n\t\t\t\tbreak;\n\t\t\tcase \"select\":\n\t\t\t\t(function() {\n\t\t\t\t\tif (this.getAttribute(\"name\")) {\n\t\t\t\t\t\tif (this.type != \"select-multiple\") json[this.getAttribute(\"name\")] = this.options[this.selectedIndex].value\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tfor (var i = 0; i < this.options.length; i++) {\n\t\t\t\t\t\t\t\tif (this.options[i].selected) {\n\t\t\t\t\t\t\t\t\tif (!json[this.getAttribute(\"name\")]) json[this.getAttribute(\"name\")] = [];\n\t\t\t\t\t\t\t\t\tconsole.log(json[this.getAttribute(\"name\")])\n\t\t\t\t\t\t\t\t\tjson[this.getAttribute(\"name\")].push(this.options[i].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\t\t\t\t\t}\n\t\t\t\t}).call(e);\n\t\t\t\tbreak;\n\t\t\tcase \"text\":\n\t\t\t\t(function(){\n\t\t\t\t\tif (this.getAttribute(\"name\"))\n\t\t\t\t\t\tif (!(this.value).devoid()) json[this.getAttribute(\"name\")] = this.value;\n\t\t\t\t}).call(e);\n\t\t\t\tbreak;\n\t\t\tcase \"textarea\":\n\t\t\t\t(function(){\n\t\t\t\t\tif (this.getAttribute(\"name\"))\n\t\t\t\t\t\tif (!(this.value).devoid()) json[this.getAttribute(\"name\")] = this.value;\n\t\t\t\t}).call(e);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t}", "title": "" }, { "docid": "1f048a48f896cd7a5c7da89ff2b68cf7", "score": "0.50036216", "text": "function addJsonCallBack(jcb) {\n jsonCallBacks[jcb.id] = jcb;\n }", "title": "" }, { "docid": "120a36f1bee7bce69b8206329907d06e", "score": "0.50035197", "text": "addEvent(name, desc, img_url) {\n AjaxAdapter.addEvent({ name, desc, img_url })\n .then((newEvent) => {\n // clone existing state\n const newState = { ...this.state.events };\n newState[newEvent.id] = newEvent;\n this.setState({ events: newState });\n })\n .catch((error) => {\n throw error;\n });\n }", "title": "" }, { "docid": "4496b2d6bd38c19e6f4905b9c25ba853", "score": "0.49915504", "text": "function r(e,t){return{read:function(t){return JSON.parse(t,e)},write:function(e){return JSON.stringify(e,t)},extend:r}}", "title": "" }, { "docid": "1e8bbf7273906a54845d9dfc8f5b3504", "score": "0.4990027", "text": "function updateCal(){\n\t\tnewCalEvents = JSON.stringify(newCalEvents);\n\n\t\t$.ajax({\n\t\t\ttype:'POST',\n\t\t\turl:'calUpdateDB.php',\n\t\t\tdata:{event:'update',value:newCalEvents},\n\t\t\tdataType:'json',\n\t\t\tsuccess:function(data){\n\t\t\t\n\t\t\t},\n\t\t});\n\t\tnrNewEvents = 0;\n\t\tnewCalEvents = [];\n\t}", "title": "" }, { "docid": "f7b3c6565598109028c329c8991d1fa3", "score": "0.49866313", "text": "function applyRemoteData( newEvent ) {\n\n $scope.events = newEvent;\n\n }", "title": "" }, { "docid": "dafdb20ebe90b6b83d573d4064464c72", "score": "0.49856427", "text": "handleAddEvent(evt) {\n console.log(\"Hola handleAddEvent \")\n\n var id = (+ new Date() + Math.floor(Math.random() * 999999)).toString(36);\n var product = {\n Item: id,\n FacturaNro: '',\n FechaFactura: \"\",\n Marca: \"\",\n NombreComercial: \"\",\n Referencia: '',\n Tipo: \"--\",\n Clase: \"--\",\n Modelo: \"--\",\n SubPartidaArancelaria: \"--\",\n Valor: \"--\",\n Unidad: \"--\",\n Cantidad: \"--\",\n CantidadDeclarar: \"--\",\n PesoSistema: \"--\",\n Preinspeccion: \"--\",\n ConservarDatos: \"--\",\n Carpeta: \"--\",\n Embarque: \"--\",\n CertificadoOrigen: \"--\",\n NroRegistro: \"--\"\n }\n this.props.fileJson.push(product);\n this.setState(this.props.fileJson);\n\n }", "title": "" }, { "docid": "0b395aeb77fbeb26483201a219f7538a", "score": "0.49837625", "text": "function processRequest(event) {\n console.log(event);\n console.log(marequete.readyState);\n console.log(marequete.status);\n // console.log(event);\n\n if (marequete.readyState == 4 && marequete.status == 200) {\n // var mareponse = marequete.response;\n var mareponseText = marequete.responseText;\n // parser la reponse texte en json \n mareponseText = JSON.parse(mareponseText);\n // appel la fonction bindlist avec la réponse en param\n\n // stocker le tableau dans la variable data\n data = mareponseText;\n data.forEach(function(eleve) {\n bindList(eleve);\n\n });\n // console.log(mareponse);\n }\n\n}", "title": "" }, { "docid": "2b7e2713aa8e2ee95e0023bb0aea95ab", "score": "0.4983604", "text": "function get_local_events(){\n\treturn JSON.parse(getfromStorage('localevents'));\n}", "title": "" }, { "docid": "78f78275ed66d417df1b342d6bba8d11", "score": "0.49828592", "text": "function initEventsData(eventsData, cb) {\n $.each(eventsData, function(index, event) {\n if (typeof(loginUserId)!=\"undefined\" && typeof(event.user)!=\"undefined\" && event.user.id == loginUserId) {\n eventsData[index].editable = true;\n } else {\n eventsData[index].editable = false;\n }\n eventsData[index] = renameKey(eventsData[index]);\n });\n cb(eventsData);\n}", "title": "" }, { "docid": "05b2f1e5b2b9049e8ab6ee93ecc7ef78", "score": "0.4981104", "text": "setAllSettings(json) {\n this.settings = json;\n }", "title": "" }, { "docid": "6b9a584da0ba99e8bd9cfc39287ae812", "score": "0.4975558", "text": "simpleSelect(pid,json) {\n let self=this;\n let options=Object.assign({\n \"map\":\"default\",\n condition:\"click\"\n },json);\n\n let selector = new Select();\n self.maps[options.map].object.addInteraction(selector);\n selector.on('select', function(e) {\n console.log(e);\n self.queue.setMemory('simpleSelect', e, \"Session\");\n self.queue.execute(\"simpleSelect\");\n });\n self.finished(pid,self.queue.DEFINE.FIN_OK);\n\n }", "title": "" }, { "docid": "f6a511c8883d34eb53b8673cd2a90f50", "score": "0.49712595", "text": "set(state, payload){\n //empujamos\n //hacemos esto para que emuje los datos introducidos al hombe y los guarde allà \n state.tareas.push(payload)\n //ponemos console para ver si se esta empujando\n //console.log(state.tareas)\n //para guuardar se empuja \n\n }", "title": "" }, { "docid": "30d83027964d302a2e508ddc076a471a", "score": "0.4971135", "text": "function onJsonToken(json){\n //console.log(json);\n access_token=json.access_token;\n }", "title": "" }, { "docid": "84cca2ce72a5ffcf93f6eb5700545753", "score": "0.49693835", "text": "insertNewEvents() {\r\n\r\n this.calendar.freebusy.query(\r\n {\r\n resource : {\r\n timeMin : this.start_event,\r\n timeMax : this.end_event,\r\n timeZone : 'Europe/Paris',\r\n items : [{'id' : 'primary'}]\r\n },\r\n },\r\n (err, res) => {\r\n if (err) return console.error('Free Bussy Error : ', err);\r\n\r\n const eventsArr = res.data.calendars.primary.busy;\r\n\r\n if (eventsArr.length <= 0) {\r\n\r\n return this.calendar.events.insert(\r\n {\r\n calendarId : 'primary',\r\n resource : this.getJson()\r\n },\r\n (err) => {\r\n if (err) return console.error('Erros has been encroured');\r\n\r\n return console.log('Event created !')\r\n }\r\n );\r\n\r\n }\r\n\r\n return console.log('Evenement existant !')\r\n }\r\n )\r\n\r\n let data = this.getJson();\r\n return data;\r\n }", "title": "" }, { "docid": "9141f28b33d3b1b230099f11ed66cb77", "score": "0.4969068", "text": "function shMyEvents(){\n document.getElementById(\"izq_content\").innerHTML=div_loading;\n $.ajax({\n url: '../resources/controlador/fachada.php',\n dataType: \"json\",\n type: \"POST\",\n data:{\n clase: 'Eventos',\n metodo:'getMyEvents'\n },\n success: function(data) {\n document.getElementById(\"izq_content\").innerHTML=\"\";\n if(data.events!=undefined){\n categoriasmostradas=new Array();\n var res=\"<div class='content_izq'>\"+\n \"</div>\"+\n \"<section id='events_my' class='content_events_vert'>\"+\n \"<div class='title_categ_detail'><div class='cont_title'>Mis Eventos</div></div>\";\n for(var j=0; j<data.events.length; j++){\n res+=formatEvent({\n typeFormat: 1,\n id:data.events[j].id,\n name: data.events[j].name,\n date: data.events[j].date,\n place: data.events[j].place,\n img: data.events[j].img\n });\n }\n \n res+=\"<div style='clear: both;'></div></section>\";\n document.getElementById(\"izq_content\").innerHTML+=res;\n }else{\n }\n },\n error: function(obj1, suceso, obj2){\n }\n });\n}", "title": "" }, { "docid": "2d9a79007534a6392ed1f792fe45625c", "score": "0.496363", "text": "function eonetEventToGeoJSONObject(event) {\n\n var object = {};\n\n // Points\n if (event.geometries[0].type == 'Point') {\n object = {\n type: 'Feature',\n properties: {\n type: \"event\",\n // 'marker-color': '#3ca0a0',\n // 'marker-size': 'large',\n // 'marker-symbol': 'rocket',\n id: event.id,\n title: event.title,\n title_clean: cleanEventTitle(event.title),\n description: event.description,\n link: event.link,\n catslug: titleToSlug(event.categories[0].title),\n categories: event.categories,\n sources: event.sources,\n date: event.geometries[0].date\n },\n geometry: {\n type: 'Point',\n coordinates: event.geometries[0].coordinates\n }\n };\n\n // Polygons\n } else if (event.geometries[0].type == 'Polygon') {\n\n object = {\n type: 'Feature',\n properties: {\n type: \"event\",\n // fillColor: \"#fbca19\",\n // fillOpacity: \"0.8\",\n // 'marker-symbol': 'harbor',\n id: event.id,\n title: event.title,\n title_clean: cleanEventTitle(event.title),\n description: event.description,\n link: event.link,\n catslug: titleToSlug(event.categories[0].title),\n categories: event.categories,\n sources: event.sources,\n date: event.geometries[0].date\n },\n geometry: {\n type: 'Polygon',\n coordinates: event.geometries[0].coordinates\n }\n };\n }\n\n return object;\n}", "title": "" }, { "docid": "2c8cd05ca8e9b43b5d7f70dd9cfc7307", "score": "0.49631453", "text": "function json_serviceworker() {\n\tvar self = this;\n\tself.$save(self, self.callback());\n}", "title": "" }, { "docid": "4d980dc5619ac8412efeef7eca1068b4", "score": "0.4952395", "text": "function handleDateNotifications(event) {\n console.log(\"date\");\n let id = event.target.service.device.id;\n let date = decoder.decode(event.target.value);\n for (var i= 0, len=users.length; i<len; i++) {\n let user = users[i];\n if (user.id == id) {\n user.chatValue.date = date;\n }\n }\n}", "title": "" }, { "docid": "ba3a526dd359a036ba020be21f73edaf", "score": "0.49519917", "text": "enviaEvento(evento, ok, err) {\n let xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function () {\n if (xhttp.readyState === 4) {\n if (xhttp.status === 201) {\n ok();\n } else {\n const msg = xhttp.statusText;\n err(msg);\n }\n }\n };\n xhttp.open(\"POST\", EventoHttpService.URI, true);\n xhttp.setRequestHeader(\"content-type\", \"application/json\");\n xhttp.send(JSON.stringify(evento));\n }", "title": "" }, { "docid": "fc8be63ebfd32c739f98d1e443a9dff3", "score": "0.49503005", "text": "patchDataJSON(data) {\n this.data._r = data;\n }", "title": "" }, { "docid": "b5972c056c09d4b6245fe8abb57ef8e2", "score": "0.49468833", "text": "function getAllEvents() {\n\n return fetch('/events/', {\n method: 'GET'\n }).then(response => response.json())\n .then(result => {\n if (result) {\n console.log(result);\n var obj = typeof result !== 'undefined' ? JSON.stringify(result) : \"\";\n var obj2 = typeof obj !== 'undefined' ? JSON.parse(obj) : \"\";\n console.log(obj2[0]);\n\n\n\n //}\n //_js.forEach(addEventTolist);\n\n function addEventTolist(value, index, array) {\n console.log(\"value: \");\n console.log(value['id']);\n console.log(value['title']);\n var e = new EventClass();\n e.fromJson(value);\n console.log(e.getId());\n eventsList.addEvent(e);\n console.log(eventsList.getGeoJson());\n var _geoJson = eventsList.getGeoJson();\n setMapMarkers(_geoJson);\n //console.log(\"list: \");\n console.log(eventsList);\n }\n\n if (typeof obj2 !== 'undefined' && obj2.length > 0)\n obj2.forEach(addEventTolist);\n else {\n eventsList.clear();\n setMapMarkers(geojson);\n console.log(\"events cleared\");\n }\n } else {\n setMapMarkers(geojson);\n }\n\n })\n .catch(error => {\n console.error('Error:', error);\n setMapMarkers(geoJson);\n });\n}", "title": "" }, { "docid": "14dffc494016b6cfe9d96fdc4584dcf6", "score": "0.49400872", "text": "handleFieldChange(value) {\n var vo = value;\n\n if (!_.isPlainObject(value)) { // value should be a event object\n vo = { [value.target.name]: value.target.value }\n }\n\n this.setState({\n response: Object.assign({}, this.state.response, vo)\n })\n }", "title": "" }, { "docid": "63c992e8f37995f96064f6fee9991363", "score": "0.4937139", "text": "function buildEventInfoJSON() {\n const eventJSON = [\n {eventId: \"EVENT_ID\", date: \"DATE_STRING\", time: \"TIME_STRING\"},\n {eventId: \"EVENT_ID\", date: \"DATE_STRING\", time: \"TIME_STRING\"},\n {eventId: \"EVENT_ID\", date: \"DATE_STRING\", time: \"TIME_STRING\"},\n {eventId: \"EVENT_ID\", date: \"DATE_STRING\", time: \"TIME_STRING\"}\n // Add as many events are needed for users to invite and choose from\n ]\n const prop = PropertiesService.getScriptProperties();\n prop.setProperty(\"EVENT_NAME_STRING\", JSON.stringify(eventJSON))\n}", "title": "" }, { "docid": "bea69a0a09714cce356772fb0b0478b3", "score": "0.49359694", "text": "function onData(data) {\n\tdebug('Data %j', arguments);\n\tvar obj = JSON.parse(data.toString());\n\t// When data is sent here from server.\n\tif('function' === typeof this.data) {\n\t\tthis.data(obj.type, obj.data);\n\t}\n}", "title": "" }, { "docid": "9b3ed92e0386c20406ec8fa330f381ee", "score": "0.49346933", "text": "function getEvents()\r\n\t \t{\r\n\t \t\t$http.get(urlBase + '/geotagged/events').\r\n success(function (data) {\r\n $scope.events = data._embedded.events;\r\n \r\n for (var i = 0; i < $scope.events.length; i++) {\r\n addOption($scope.events[i]);\r\n }\r\n });\r\n\t \t}", "title": "" }, { "docid": "a4972a1e8788a8d2f0290f06e722639f", "score": "0.49338531", "text": "updateEvent(state, value) {\n let eventId = state.events.findIndex(event => event.event_id === value.event_id)\n if(eventId >= 0) {\n state.events[eventId] = value\n if(!state.events[eventId].add) {\n state.events[eventId].update = true\n }\n state.touched = !state.touched\n }\n }", "title": "" }, { "docid": "f73f6686211cd3e9db268033d37b1a5b", "score": "0.49318027", "text": "function jsonfromInputEvent (inputEventTitle, inputStart, inputEnd, address, inputContainerTitle, inputContainerType, inputCapacity) {\n var title = $(inputEventTitle).val();\n var startDate = $(inputStart).val();\n var endDate = $(inputEnd).val();\n var addr = $(address).val();\n var containerTitle = $(inputContainerTitle).val();\n var type = $(inputContainerType + ' option:selected').text();\n var capacity = $(inputCapacity).val();\n\n return JSON.stringify({\n 'title': title,\n 'startdate': startDate,\n 'closedate': endDate,\n 'address': addr,\n\n 'eventContainer': {\n 'title': containerTitle,\n 'type': type,\n 'capacity': capacity\n }\n\n });\n}", "title": "" }, { "docid": "1bc45fd98770e8145f7ec24a35c9484a", "score": "0.49310154", "text": "function leeJSON(e) {\n\tvar x = \":::::::::::Estudiantes::::::::::<br>\"\n\tfor (var i = 0; i < e.length; i++) {\n\t\tx += \"codigo: \"+e[i].codigo+\" - \"+\"nombre: \"+e[i].nombre+\" - \"+\"nota: \"+e[i].nota+\"<br>\"\n\t};\n\tdocument.getElementById('todosObjetos').innerHTML = x;\n}", "title": "" }, { "docid": "c5c4b0f879ccc46a84fb572453499227", "score": "0.49308923", "text": "markertap(e) {\n const filteredEvents = this.data.filteredEvents;\n let event = filteredEvents.find(filteredEvents => filteredEvents.id === e.markerId)\n const selectionMade = true\n event.iconPath = event.iconPathRed\n for (var i = filteredEvents.length - 1; i >= 0; i--) {\n if (filteredEvents[i].id === event.id) {\n filteredEvents[i].iconPath = event.iconPath;\n } else {\n filteredEvents[i].iconPath = filteredEvents[i].iconPathYellow;\n }\n };\n\n this.setData({\n event: event,\n selectionMade: selectionMade,\n filteredEvents: filteredEvents\n })\n\n }", "title": "" } ]
bd8e8c81373c842fd0d610393c072e58
Performs feature detection on the deprecated Microsoft Internet Explorer outdated SubtleCrypto interface. This function should only be used after checking for the modern, standard SubtleCrypto interface.
[ { "docid": "1e4f629817b6214c1d4b6e53b82d84e6", "score": "0.6503122", "text": "function _detectSubtleMsCrypto(fn) {\n return (typeof window !== 'undefined' &&\n typeof window.msCrypto === 'object' &&\n typeof window.msCrypto.subtle === 'object' &&\n typeof window.msCrypto.subtle[fn] === 'function');\n}", "title": "" } ]
[ { "docid": "11682336425fad264d067130f47c2408", "score": "0.673446", "text": "function _detectSubtleCrypto(fn) {\n\t return (typeof window !== 'undefined' &&\n\t typeof window.crypto === 'object' &&\n\t typeof window.crypto.subtle === 'object' &&\n\t typeof window.crypto.subtle[fn] === 'function');\n\t}", "title": "" }, { "docid": "ce1e7ec384d7192390e5c2d08715ddb5", "score": "0.6639112", "text": "function _detectSubtleCrypto(fn) {\n return (typeof window !== 'undefined' &&\n typeof window.crypto === 'object' &&\n typeof window.crypto.subtle === 'object' &&\n typeof window.crypto.subtle[fn] === 'function');\n}", "title": "" }, { "docid": "ce1e7ec384d7192390e5c2d08715ddb5", "score": "0.6639112", "text": "function _detectSubtleCrypto(fn) {\n return (typeof window !== 'undefined' &&\n typeof window.crypto === 'object' &&\n typeof window.crypto.subtle === 'object' &&\n typeof window.crypto.subtle[fn] === 'function');\n}", "title": "" }, { "docid": "ce1e7ec384d7192390e5c2d08715ddb5", "score": "0.6639112", "text": "function _detectSubtleCrypto(fn) {\n return (typeof window !== 'undefined' &&\n typeof window.crypto === 'object' &&\n typeof window.crypto.subtle === 'object' &&\n typeof window.crypto.subtle[fn] === 'function');\n}", "title": "" }, { "docid": "1eedb48f2cca64ef732b771d4940394f", "score": "0.65606505", "text": "function _detectSubtleMsCrypto(fn) {\n\t return (typeof window !== 'undefined' &&\n\t typeof window.msCrypto === 'object' &&\n\t typeof window.msCrypto.subtle === 'object' &&\n\t typeof window.msCrypto.subtle[fn] === 'function');\n\t}", "title": "" }, { "docid": "6896dc0622f875e7da12cc9b9ee82277", "score": "0.64480704", "text": "function _detectSubtleCrypto(fn) {\n return (typeof util.globalScope !== 'undefined' &&\n typeof util.globalScope.crypto === 'object' &&\n typeof util.globalScope.crypto.subtle === 'object' &&\n typeof util.globalScope.crypto.subtle[fn] === 'function');\n}", "title": "" }, { "docid": "6896dc0622f875e7da12cc9b9ee82277", "score": "0.64480704", "text": "function _detectSubtleCrypto(fn) {\n return (typeof util.globalScope !== 'undefined' &&\n typeof util.globalScope.crypto === 'object' &&\n typeof util.globalScope.crypto.subtle === 'object' &&\n typeof util.globalScope.crypto.subtle[fn] === 'function');\n}", "title": "" }, { "docid": "6896dc0622f875e7da12cc9b9ee82277", "score": "0.64480704", "text": "function _detectSubtleCrypto(fn) {\n return (typeof util.globalScope !== 'undefined' &&\n typeof util.globalScope.crypto === 'object' &&\n typeof util.globalScope.crypto.subtle === 'object' &&\n typeof util.globalScope.crypto.subtle[fn] === 'function');\n}", "title": "" }, { "docid": "6896dc0622f875e7da12cc9b9ee82277", "score": "0.64480704", "text": "function _detectSubtleCrypto(fn) {\n return (typeof util.globalScope !== 'undefined' &&\n typeof util.globalScope.crypto === 'object' &&\n typeof util.globalScope.crypto.subtle === 'object' &&\n typeof util.globalScope.crypto.subtle[fn] === 'function');\n}", "title": "" }, { "docid": "0c18ee4a9211e4c2e832e62f6c4f0282", "score": "0.6258869", "text": "function $8ab3548bea1beb81$var$_detectSubtleCrypto(fn) {\n return typeof $8ab3548bea1beb81$var$util.globalScope !== \"undefined\" && typeof $8ab3548bea1beb81$var$util.globalScope.crypto === \"object\" && typeof $8ab3548bea1beb81$var$util.globalScope.crypto.subtle === \"object\" && typeof $8ab3548bea1beb81$var$util.globalScope.crypto.subtle[fn] === \"function\";\n}", "title": "" }, { "docid": "96a386439768f2e1fd15d2bb68ae3487", "score": "0.6248548", "text": "function _detectSubtleMsCrypto(fn) {\n return (typeof util.globalScope !== 'undefined' &&\n typeof util.globalScope.msCrypto === 'object' &&\n typeof util.globalScope.msCrypto.subtle === 'object' &&\n typeof util.globalScope.msCrypto.subtle[fn] === 'function');\n}", "title": "" }, { "docid": "96a386439768f2e1fd15d2bb68ae3487", "score": "0.6248548", "text": "function _detectSubtleMsCrypto(fn) {\n return (typeof util.globalScope !== 'undefined' &&\n typeof util.globalScope.msCrypto === 'object' &&\n typeof util.globalScope.msCrypto.subtle === 'object' &&\n typeof util.globalScope.msCrypto.subtle[fn] === 'function');\n}", "title": "" }, { "docid": "96a386439768f2e1fd15d2bb68ae3487", "score": "0.6248548", "text": "function _detectSubtleMsCrypto(fn) {\n return (typeof util.globalScope !== 'undefined' &&\n typeof util.globalScope.msCrypto === 'object' &&\n typeof util.globalScope.msCrypto.subtle === 'object' &&\n typeof util.globalScope.msCrypto.subtle[fn] === 'function');\n}", "title": "" }, { "docid": "96a386439768f2e1fd15d2bb68ae3487", "score": "0.6248548", "text": "function _detectSubtleMsCrypto(fn) {\n return (typeof util.globalScope !== 'undefined' &&\n typeof util.globalScope.msCrypto === 'object' &&\n typeof util.globalScope.msCrypto.subtle === 'object' &&\n typeof util.globalScope.msCrypto.subtle[fn] === 'function');\n}", "title": "" }, { "docid": "931ed7576dd58a35397628b960c927d0", "score": "0.623336", "text": "function $8ab3548bea1beb81$var$_detectSubtleMsCrypto(fn) {\n return typeof $8ab3548bea1beb81$var$util.globalScope !== \"undefined\" && typeof $8ab3548bea1beb81$var$util.globalScope.msCrypto === \"object\" && typeof $8ab3548bea1beb81$var$util.globalScope.msCrypto.subtle === \"object\" && typeof $8ab3548bea1beb81$var$util.globalScope.msCrypto.subtle[fn] === \"function\";\n}", "title": "" }, { "docid": "9f3582b08cdeb795a0d905b7d6f37c0d", "score": "0.61209095", "text": "function detectIE() {\n\t var ua = window.navigator.userAgent;\n\t // Test values; Uncomment to check result …\n\n \t // IE 10\n\t // ua = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)';\n \n\t // IE 11\n\t // ua = 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko';\n\t \n\t // Edge 12 (Spartan)\n\t // ua = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0';\n\t \n\t // Edge 13\n\t // ua = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586';\n\n\t var msie = ua.indexOf('MSIE ');\n\t if (msie > 0) {\n\t // IE 10 or older => return version number\n\t return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n\t }\n\n\t var trident = ua.indexOf('Trident/');\n\t if (trident > 0) {\n\t // IE 11 => return version number\n\t var rv = ua.indexOf('rv:');\n\t return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n\t }\n\n\t var edge = ua.indexOf('Edge/');\n\t if (edge > 0) {\n\t // Edge (IE 12+) => return version number\n\t return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n\t }\n\n\t // other browser\n\t return false;\n\t}", "title": "" }, { "docid": "aec393b3883c9aeb3b6f4fe504a70725", "score": "0.6090348", "text": "_detectBrowserSupport () {\n \t\t\n \t\tvar check = true;\n\n \t\t// nothing below IE9\n \t\tif (!document.addEventListener) check = false;\n\n \t\t// nothing below IE10\n \t\t// if (!window.onpopstate) check = false;\n\n \t\treturn check;\n \t}", "title": "" }, { "docid": "c0a0d362e4f0f191dcc01fb88750b069", "score": "0.60874236", "text": "function detectIE() {\n var ua = window.navigator.userAgent;\n\n // Test values; Uncomment to check result …\n\n // IE 10\n // ua = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)';\n \n // IE 11\n // ua = 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko';\n \n // IE 12 / Spartan\n // ua = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0';\n \n // Edge (IE 12+)\n // ua = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586';\n\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n // Edge (IE 12+) => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n\n // other browser\n return false;\n}", "title": "" }, { "docid": "61cb8f92b026154546063c744db75515", "score": "0.6072532", "text": "function BrowserSniff(){\r\n\t\tvar agt = navigator.userAgent.toLowerCase();\r\n\t\tif (document.layers) return \"NS\";\r\n\t\tif (document.all)\r\n\t\t{\r\n\t\t\tif( navigator.appVersion.indexOf(\"MSIE 5.5\") != -1) return \"IE5.5\";\r\n\t\t\tif (navigator.appVersion.indexOf(\"MSIE 6\") != -1) return \"IE6\";\r\n\t\t\tif (navigator.appVersion.indexOf(\"MSIE 7\") != -1) return \"IE7\";\r\n\t\t\treturn \"IE_old\";\r\n\t\t}\r\n\t\tif (document.getElementById) return \"MOZ\";\r\n\t\tif\t(agt.indexOf(\"mac\")!=-1) return \"MACIE\";\r\n\t\treturn \"OTHER\";\r\n\t}", "title": "" }, { "docid": "84106c7b13ed28139e7a4609d9289d1d", "score": "0.60514617", "text": "function detectIE() {\n\n\t//for test\n //return 10;\n var ua = window.navigator.userAgent;\n\n // Test values; Uncomment to check result …\n\n // IE 10\n // ua = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)';\n \n // IE 11\n // ua = 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko';\n \n // Edge 12 (Spartan)\n // ua = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0';\n \n // Edge 13\n // ua = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586';\n\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n // Edge (IE 12+) => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n console.log('Edge');\n }\n\n // other browser\n return false;\n}", "title": "" }, { "docid": "99b971bad41e4faa3cd871e45098016d", "score": "0.6041144", "text": "function detectIE() {\n var ua = window.navigator.userAgent;\n\n // Test values; Uncomment to check result …\n\n // IE 10\n // ua = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)';\n \n // IE 11\n // ua = 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko';\n \n // Edge 12 (Spartan)\n // ua = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0';\n \n // Edge 13\n // ua = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586';\n\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n // Edge (IE 12+) => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n\n // other browser\n return false;\n}", "title": "" }, { "docid": "99b971bad41e4faa3cd871e45098016d", "score": "0.6041144", "text": "function detectIE() {\n var ua = window.navigator.userAgent;\n\n // Test values; Uncomment to check result …\n\n // IE 10\n // ua = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)';\n \n // IE 11\n // ua = 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko';\n \n // Edge 12 (Spartan)\n // ua = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0';\n \n // Edge 13\n // ua = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586';\n\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n // Edge (IE 12+) => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n\n // other browser\n return false;\n}", "title": "" }, { "docid": "bda63182526139b43aa7031318385b48", "score": "0.60095257", "text": "function detectIE() {\n\t\tvar ua = window.navigator.userAgent;\n\n\t\tvar trident = ua.indexOf(\"Trident/\");\n\t\tif (trident > 0) {\n\t\t\t// IE 11 => return version number\n\t\t\tvar rv = ua.indexOf(\"rv:\");\n\t\t\treturn parseInt(ua.substring(rv + 3, ua.indexOf(\".\", rv)), 10);\n\t\t}\n\t\tvar edge = ua.indexOf('Edge/');\n\t\tif (edge > 0) {\n\t\t\t // Edge (IE 12+) => return version number\n\t\t\t return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n\t\t}\n\n\t\t// other browser\n\t\treturn false;\n\t}", "title": "" }, { "docid": "607d45e7c85550e35662c52f6d3bc239", "score": "0.60055625", "text": "function detectIE() {\n var ua = window.navigator.userAgent;\n\n // Test values; Uncomment to check result …\n\n // IE 10\n // ua = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)';\n\n // IE 11\n // ua = 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko';\n\n // Edge 12 (Spartan)\n // ua = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0';\n\n // Edge 13\n // ua = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586';\n\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n // Edge (IE 12+) => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n\n // other browser\n return false;\n }", "title": "" }, { "docid": "9d665fbce22435bec6b21ac2dae58d44", "score": "0.60029304", "text": "function detectIE() {\n var ua = window.navigator.userAgent;\n\n // Test values; Uncomment to check result …\n\n // IE 10\n // ua = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)';\n\n // IE 11\n // ua = 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko';\n\n // Edge 12 (Spartan)\n // ua = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0';\n\n // Edge 13\n // ua = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586';\n\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n // Edge (IE 12+) => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n\n // other browser\n return false;\n}", "title": "" }, { "docid": "9d665fbce22435bec6b21ac2dae58d44", "score": "0.60029304", "text": "function detectIE() {\n var ua = window.navigator.userAgent;\n\n // Test values; Uncomment to check result …\n\n // IE 10\n // ua = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)';\n\n // IE 11\n // ua = 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko';\n\n // Edge 12 (Spartan)\n // ua = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0';\n\n // Edge 13\n // ua = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586';\n\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n // Edge (IE 12+) => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n\n // other browser\n return false;\n}", "title": "" }, { "docid": "92d414e585d5a7e8ca6e66e1dd361435", "score": "0.59829867", "text": "function detectIE() {\r\n var ua = window.navigator.userAgent;\r\n\r\n // Test values; Uncomment to check result …\r\n\r\n // IE 10\r\n // ua = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)';\r\n\r\n // IE 11\r\n // ua = 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko';\r\n\r\n // Edge 12 (Spartan)\r\n // ua = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0';\r\n\r\n // Edge 13\r\n // ua = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586';\r\n\r\n var msie = ua.indexOf('MSIE ');\r\n if (msie > 0) {\r\n // IE 10 or older => return version number\r\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\r\n }\r\n\r\n var trident = ua.indexOf('Trident/');\r\n if (trident > 0) {\r\n // IE 11 => return version number\r\n var rv = ua.indexOf('rv:');\r\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\r\n }\r\n\r\n var edge = ua.indexOf('Edge/');\r\n if (edge > 0) {\r\n // Edge (IE 12+) => return version number\r\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\r\n }\r\n\r\n // other browser\r\n return null;\r\n}", "title": "" }, { "docid": "09416fa8405a76c957dd2bda39d6e4e2", "score": "0.5974369", "text": "function detectIE() {\n var ua = window.navigator.userAgent;\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n //return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n return true;\n }\n \n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n //return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n return true;\n }\n \n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n // Edge (IE 12+) => return version number\n //return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n return true;\n }\n \n // other browser\n return false;\n }", "title": "" }, { "docid": "d54ae04ec379ad8ac2c91d1651cb7508", "score": "0.59648603", "text": "function seven_isIE () {\n\t\t\tvar myNav = navigator.userAgent.toLowerCase();\n\t\t\treturn (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1]) : false;\n\t\t}", "title": "" }, { "docid": "1797bb0494eda6fa37da120cb4168868", "score": "0.5956021", "text": "iePolyfill() {\n if (typeof (navigator) !== 'undefined') {\n this.ie = (\n /MSIE 9/i.test(navigator.userAgent) ||\n /MSIE 10/i.test(navigator.userAgent) ||\n /rv:11\\.0/i.test(navigator.userAgent) ||\n /Trident/i.test(navigator.userAgent)\n );\n }\n }", "title": "" }, { "docid": "11120a94a8c2627290e9c0d76d6155e1", "score": "0.5950477", "text": "function detectIE() {\r\n var ua = window.navigator.userAgent;\r\n var msie = ua.indexOf('MSIE ');\r\n if (msie > 0) {\r\n // IE 10 or older => return version number\r\n //return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\r\n return true;\r\n }\r\n var trident = ua.indexOf('Trident/');\r\n if (trident > 0) {\r\n // IE 11 => return version number\r\n var rv = ua.indexOf('rv:');\r\n //return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\r\n return true;\r\n }\r\n return false;\r\n}", "title": "" }, { "docid": "b16b36a612b1b6eaed01d9caca60c91e", "score": "0.5947529", "text": "isIE() {\n const ua = navigator.userAgent;\n return ua.indexOf(\"MSIE \") > -1 || ua.indexOf(\"Trident/\") > -1;\n }", "title": "" }, { "docid": "25c1a4de444e9aa3b4e0bc1ab19832fe", "score": "0.59317005", "text": "static ieSupported() { return (document.documentMode || 10) >= 8; }", "title": "" }, { "docid": "097c1ae378631f01dfe227b561fbb710", "score": "0.593048", "text": "function isOldIE() {\n var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var navigator = _globals__WEBPACK_IMPORTED_MODULE_0__[\"window\"].navigator || {};\n var userAgent = opts.userAgent || navigator.userAgent || ''; // We only care about older versions of IE (IE 11 and below). Newer versions of IE (Edge)\n // have much better web standards support.\n\n var isMSIE = userAgent.indexOf('MSIE ') !== -1;\n var isTrident = userAgent.indexOf('Trident/') !== -1;\n return isMSIE || isTrident;\n}", "title": "" }, { "docid": "180c7681ec81c070bae7211245801cda", "score": "0.58799237", "text": "function detectIE() {\n var ua = window.navigator.userAgent;\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n // IE 12 => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n\n\t// other browser\n return false;\n}", "title": "" }, { "docid": "3ef3da9ad40245bf20e7359547220f1e", "score": "0.58662295", "text": "function detectIE() {\r\n var ua = window.navigator.userAgent;\r\n\r\n var msie = ua.indexOf('MSIE ');\r\n if (msie > 0) {\r\n // IE 10 or older => return version number\r\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\r\n }\r\n\r\n var trident = ua.indexOf('Trident/');\r\n if (trident > 0) {\r\n // IE 11 => return version number\r\n var rv = ua.indexOf('rv:');\r\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\r\n }\r\n\r\n var edge = ua.indexOf('Edge/');\r\n if (edge > 0) {\r\n // Edge (IE 12+) => return version number\r\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\r\n }\r\n\r\n // other browser\r\n return false;\r\n }", "title": "" }, { "docid": "054f8b6d8d5468491140ef7d8b310660", "score": "0.5858921", "text": "function detectIE() {\n\t\t\tvar ua = window.navigator.userAgent;\n\t\t\tvar msie = ua.indexOf('MSIE ');\n\t\t\tvar trident = ua.indexOf('Trident/');\n\n\t\t\tif (msie > 0) {\n\t\t\t\t\t// IE 10 or older => return version number\n\t\t\t\t\treturn parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n\t\t\t}\n\n\t\t\tif (trident > 0) {\n\t\t\t\t\t// IE 11 (or newer) => return version number\n\t\t\t\t\tvar rv = ua.indexOf('rv:');\n\t\t\t\t\treturn parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n\t\t\t}\n\n\t\t\t// other browser\n\t\t\treturn false;\n\t\t}", "title": "" }, { "docid": "efd50822f7095abff65c69408a7ffa56", "score": "0.58577627", "text": "function msieversion() {\n\n\t\tua = window.navigator.userAgent;\n\t\tmsie = ua.indexOf(\"MSIE \");\n\n\t\tif (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\\:11\\./)) {\n\t\t\treturn true;\n\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\n\n\t}", "title": "" }, { "docid": "fc9906eebb7f1bca2c4cc90aef48f17c", "score": "0.58565474", "text": "function BrowserCheck() {\n\n var b = navigator.appName.toString();\n\n var b_ver;\n\n var up = navigator.platform.toString();\n\n var ua = navigator.userAgent.toString().toLowerCase();\n\n var re_opera = /Opera.([0-9\\.]*)/i;\n\n var re_msie = /MSIE.([0-9\\.]*)/i;\n\n var re_gecko = /gecko/i;\n\n // mozilla/5.0 (macintosh; u; intel mac os x 10_6_7; en-us) applewebkit/533.20.25 (khtml, like gecko) version/5.0.4 safari/533.20.27\n\n var re_safari = /safari\\/([\\d\\.]*)/i;\n\n var re_mozilla = /firefox\\/([\\d\\.]*)/i;\n\n var re_chrome = /chrome\\/([\\d\\.]*)/i;\n\n var ie_documentMode = 0;\n\n var browserType = {};\n\n browserType.mozilla = browserType.ie = browserType.opera = r = false;\n\n browserType.version = (ua.match(/.+(?:rv|it|ra|ie|me)[\\/: ]([\\d.]+)/) || [])[1];\n\n browserType.chrome = /chrome/.test(ua);\n\n browserType.safari = /webkit/.test(ua) && !/chrome/.test(ua);\n\n browserType.opera = /opera/.test(ua);\n\n browserType.ie = /msie/.test(ua) && !/opera/.test(ua);\n\n browserType.mozilla = /mozilla/.test(ua) && !/(compatible|webkit)/.test(ua);\n\n\t\n\n if (ua.match(re_opera))\n\n {\n\n r = ua.match(re_opera);\n\n browserType.version = parseFloat(r[1]);\n\n }\n\n else if (ua.match(re_msie))\n\n {\n\n r = ua.match(re_msie);\n\n browserType.version = parseFloat(r[1]);\n\n ie_documentMode = browserType.version;\n\n if (browserType.version <= 7)\n\n {\n\n re_ver = /trident\\/([\\d\\.]*)/i;\n\n r = ua.match(re_ver);\n\n // in IE compat mode, trident=4.0 (IE8), =5.0 (IE9), =6.0 (IE10) etc, i.e, version=trident+4.\n\n if (r && parseFloat(r[1]) >= 4)\n\n {\n\n browserType.version = parseFloat(r[1]) + 4;\n\n ie_documentMode = document.documentMode;\n\n }\n\n }\n\n }\n\n else if (browserType.safari && !browserType.chrome)\n\n {\n\n re_ver = /version\\/([\\d\\.]*)/i;\n\n if (ua.match(re_ver))\n\n {\n\n r = ua.match(re_ver);\n\n browserType.version = parseFloat(r[1]);\n\n }\n\n }\n\n else if (browserType.chrome)\n\n {\n\n b_ver = ua.match(re_chrome);\n\n r = b_ver[1].split('.');\n\n browserType.version = parseFloat(r[0]);\n\n }\n\n else if (ua.match(re_gecko))\n\n {\n\n var re_gecko_version = /rv:\\s*([0-9\\.]+)/i;\n\n r = ua.match(re_gecko_version);\n\n browserType.version = parseFloat(r[1]);\n\n if (ua.match(re_mozilla))\n\n {\n\n r = ua.match(re_mozilla);\n\n browserType.version = parseFloat(r[1]);\n\n }\n\n }\n\n else if (ua.match(re_mozilla))\n\n {\n\n r = ua.match(re_mozilla);\n\n browserType.version = parseFloat(r[1]);\n\n }\n\n browserType.windows = browserType.mac = browserType.linux = false;\n\n browserType.Platform = ua.match(/windows/i) ? \"windows\" : (ua.match(/linux/i) ? \"linux\" : (ua.match(/mac/i) ? \"mac\" : ua.match(/unix/i) ? \"unix\" : \"unknown\"));\n\n this[browserType.Platform] = true;\n\n browserType.v = browserType.version;\n\n browserType.valid = browserType.ie && browserType.v >= 6 || browserType.mozilla && browserType.v >= 1.4 || browserType.safari && browserType.v >= 5 || browserType.chrome && browserType.v >= 12;\n\n browserType.okToAuthor = (browserType.ie && browserType.v >= 8 && ie_documentMode >= 7) || (browserType.mozilla && browserType.v >= 3.6);\n\n return browserType;\n\n}", "title": "" }, { "docid": "7547e91d0b60e8402406c3da4deaf4d6", "score": "0.58347017", "text": "function isOldIE() {\n var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var navigator = typeof window !== 'undefined' ? window.navigator || {} : {};\n var userAgent = opts.userAgent || navigator.userAgent || ''; // We only care about older versions of IE (IE 11 and below). Newer versions of IE (Edge)\n // have much better web standards support.\n\n var isMSIE = userAgent.indexOf('MSIE ') !== -1;\n var isTrident = userAgent.indexOf('Trident/') !== -1;\n return isMSIE || isTrident;\n}", "title": "" }, { "docid": "6c9ad428967382641646835fd91aed4f", "score": "0.5827573", "text": "function hb_checkVersion(loc)\n{\n var ver = hb_getInternetExplorerVersion();\n if ( ver > -1 ) {\n if ( ver <= 6.0 ) {\n function getCookie(c_name) {\n var i,x,y,ARRcookies=document.cookie.split(\";\");\n for (i=0;i<ARRcookies.length;i++) {\n x=ARRcookies[i].substr(0,ARRcookies[i].indexOf(\"=\"));\n y=ARRcookies[i].substr(ARRcookies[i].indexOf(\"=\")+1);\n x=x.replace(/^\\s+|\\s+$/g,\"\");\n if (x==c_name) {\n return unescape(y);\n }\n }\n }\n\n var checkIEsession=getCookie(\"oldIE\");\n if (checkIEsession == null || checkIEsession != \"true\") {\n document.cookie = 'oldIE=true';\n window.location = loc;\n }\n }\n }\n}", "title": "" }, { "docid": "649307a9db345a82dd3d0668e7d2c850", "score": "0.5813314", "text": "function versTest()\n{\nvar one = '';\nvar two = '';\n\nif (\n(navigator.appName.substring(0,8)==\"Netscape\" && (navigator.appVersion.substring(0,3) == \"3.0\" || navigator.appVersion.substring(0,3) ==\"4.0\")))\n{var one='true';}\nif(\n (navigator.appName.substring(0,9) == \"Microsoft\" && navigator.appVersion.substring(0,3) == \"3.0\" && navigator.appVersion.indexOf(\"Macintosh\")>=0))\n{var two='true';}\n\nif(one=='true' || two=='true' ||\n(navigator.appName.substring(0,9) == \"Microsoft\" && navigator.appVersion.indexOf(\"MSIE 3.0\")>=0 && \nnavigator.appVersion.indexOf(\"Windows 3.1\")>=0)\n)\n{return true;}\nelse\n{return false;}\n\n}", "title": "" }, { "docid": "84f0a1da2919244f3e336422ce12811f", "score": "0.5808357", "text": "function detectIE() {\n var ua = window.navigator.userAgent;\n\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n// return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n return true;\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n// var rv = ua.indexOf('rv:');\n// return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n return true;\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n // Edge (IE 12+) => return version number\n// return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n return true;\n }\n\n // other browser\n return false;\n}", "title": "" }, { "docid": "2e227f3eb5fa6428a22d6793c3287ea6", "score": "0.5788627", "text": "function isOldIE() {\n\t var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\t var navigator = _globals.window.navigator || {};\n\t var userAgent = opts.userAgent || navigator.userAgent; // We only care about older versions of IE (IE 11 and below). Newer versions of IE (Edge)\n\t // have much better web standards support.\n\n\t var isMSIE = userAgent.indexOf('MSIE ') !== -1;\n\t var isTrident = userAgent.indexOf('Trident/') !== -1;\n\t return isMSIE || isTrident;\n\t}", "title": "" }, { "docid": "6b90d0f9248203fab5a87d4d633c1786", "score": "0.5787502", "text": "function detectIE() {\n var ua = window.navigator.userAgent;\n\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n // Edge (IE 12+) => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n\n // other browser\n return false;\n}", "title": "" }, { "docid": "c4ab821133013f77e3cba2bc2314e0b5", "score": "0.57859105", "text": "function detectIE() {\r\n var ua = window.navigator.userAgent;\r\n var msie = ua.indexOf('MSIE ');\r\n var trident = ua.indexOf('Trident/');\r\n\r\n if (msie > 0) {\r\n // IE 10 or older => return version number\r\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\r\n }\r\n\r\n if (trident > 0) {\r\n // IE 11 (or newer) => return version number\r\n var rv = ua.indexOf('rv:');\r\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\r\n }\r\n\r\n // other browser\r\n return false;\r\n}", "title": "" }, { "docid": "98140885bfbe309399c6b5e361759dfc", "score": "0.57854056", "text": "function isLteIE (refVersion)\n{\n return $.browser.msie && (parseInt ($.browser.version, 10) < refVersion + 1);\n}", "title": "" }, { "docid": "050583908abd1dcabf97a4b07272a929", "score": "0.576763", "text": "function detectIE() {\n var ua = window.navigator.userAgent;\n\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n // Edge (IE 12+) => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n\n // other browser\n return false;\n}", "title": "" }, { "docid": "b960edcf197c38a9e37ab0082ecd8356", "score": "0.57628715", "text": "function getIE9Download()\n {\n\t var userAgent = navigator.userAgent.toLowerCase(),\n\t\t appMinorVersion = window.navigator.appMinorVersion,\n\t\t appMinorVersionF = parseFloat(window.navigator.appMinorVersion),\n\t\t Check = function (value) {\n\t\t\t return userAgent.indexOf(value) >= 0;\n\t\t };\n\n\t this.IsWin = Check(\"windows nt\");\n\t this.IsVista = Check(\"windows nt 6.0\");\n\t this.IsWin7 = Check(\"windows nt 6.1\");\n\t this.IsXP = Check(\"windows nt 5.1\");\n\t this.IsIE = Check(\"msie\");\n\t this.IsIE7 = Check(\"msie 7\");\n\t this.IsIE8 = Check(\"msie 8\");\n\t this.IsIE9 = Check(\"trident/5.0\");\n\t this.IsIE9CompatMode = this.IsIE9 && this.IsIE7;\n\t this.IsIE10 = Check(\"trident/6.0\");\n\t this.IsIE10Preview = (this.IsIE10 && window.external == null); // check for IE10 Platform Preview\n\t this.IsFirefox = Check(\"firefox\");\n\t this.IsChrome = Check(\"chrome\");\n\t if (this.IsChrome) {\n\t\t var t = userAgent.match(/chrome\\/(\\d{1,2})/);\n\t\t this.Version = t[1];\n\t }\n\t if (this.IsFirefox && /Firefox[\\/\\s](\\d+\\.\\d+)/.test(navigator.userAgent)) {\n\t\t //test for Firefox/x.x or Firefox x.x (ignoring remaining digits)\n\t\t this.Version = Number(RegExp.$1) // capture x.x portion and store as a number\n\t }\n\t if (this.IsIE || (this.IsFirefox && this.Version >= 4) || (this.IsChrome && this.Version >= 11)) {\n\t\t // Only IE and recent Chrome/Firefox report 32/64bit in user agent\n\t\t this.BitSniffed = true;\n\t\t this.Is64bit = Check(\"win64\") || Check(\"wow64\");\n\t }\n\t this.WinVersion = this.IsXP? \"xp\" : this.IsVista? \"vista\" : this.IsWin7? \"win7\" : \"\";\n\t this.WinBits = this.Is64bit? \"64\" : \"32\";\n\n\t this.getShortVersionTag = function() {\n\t\t return this.WinVersion? this.WinVersion + \"-\" + this.WinBits : \"\";\n\t };\n\t this.getIEDownloadURL = function() {\n\t\t // Determine the download version to offer based on the Windows version\n\t\t var urlPrefix = \"http://download.microsoft.com/download\",\n\t\t\t // Offer 32-bit browser version on 64-bit OS since plugins work with it\n\t\t\t versionMap = {\n\t\t\t\t \"win7-32\":\t\"/8/6/D/86DB5DC9-5706-4A5B-BD46-FFBA6FA67D44/IE9-Windows7-x86-enu.exe\",\n\t\t\t\t \"win7-64\":\t\"/8/6/D/86DB5DC9-5706-4A5B-BD46-FFBA6FA67D44/IE9-Windows7-x64-enu.exe\",\n\t\t\t\t \"vista-32\":\t\"/8/6/D/86DB5DC9-5706-4A5B-BD46-FFBA6FA67D44/IE9-WindowsVista-x86-enu.exe\",\n\t\t\t\t \"vista-64\":\t\"/8/6/D/86DB5DC9-5706-4A5B-BD46-FFBA6FA67D44/IE9-WindowsVista-x64-enu.exe\",\n\t\t\t\t \"xp-32\":\t\"/C/C/0/CC0BD555-33DD-411E-936B-73AC6F95AE11/IE8-WindowsXP-x86-ENU.exe\",\n\t\t\t\t \"xp-64\":\t\"/7/5/4/754D6601-662D-4E39-9788-6F90D8E5C097/IE8-WindowsServer2003-x64-ENU.exe\"\n\t\t\t },\n\t\t\t version = this.getShortVersionTag();\n\t\t return downloadLink = urlPrefix + (versionMap[version] || versionMap[\"7\"]);\n\t };\n\n return getIEDownloadURL();\n }", "title": "" }, { "docid": "e3375c4cf56133e8d0138852d92239c7", "score": "0.5745349", "text": "async function checkCryptoWorkerSupport() {\n const result = await cryptoCheck().isCryptoInWorkerSupported();\n return result.toString() === 'true';\n}", "title": "" }, { "docid": "6cd34fc3b83d37c26acd27c275e47fbd", "score": "0.5740509", "text": "function detectBrowserFeatures() {\n // Features already set\n if (isDefined(browserFeatures.res)) {\n return browserFeatures;\n }\n\n var i,\n mimeType,\n pluginMap = {\n // document types\n pdf: 'application/pdf',\n\n // media players\n qt: 'video/quicktime',\n realp: 'audio/x-pn-realaudio-plugin',\n wma: 'application/x-mplayer2',\n\n // interactive multimedia\n dir: 'application/x-director',\n fla: 'application/x-shockwave-flash',\n\n // RIA\n java: 'application/x-java-vm',\n gears: 'application/x-googlegears',\n ag: 'application/x-silverlight',\n };\n\n // detect browser features except IE < 11 (IE 11 user agent is no longer MSIE)\n if (!new RegExp('MSIE').test(navigatorAlias.userAgent)) {\n // general plugin detection\n if (navigatorAlias.mimeTypes && navigatorAlias.mimeTypes.length) {\n for (i in pluginMap) {\n if (Object.prototype.hasOwnProperty.call(pluginMap, i)) {\n mimeType = navigatorAlias.mimeTypes[pluginMap[i]];\n browserFeatures[i] = mimeType && mimeType.enabledPlugin ? '1' : '0';\n }\n }\n }\n\n // Safari and Opera\n // IE6/IE7 navigator.javaEnabled can't be aliased, so test directly\n // on Edge navigator.javaEnabled() always returns `true`, so ignore it\n if (\n !new RegExp('Edge[ /](\\\\d+[\\\\.\\\\d]+)').test(navigatorAlias.userAgent) &&\n typeof navigator.javaEnabled !== 'unknown' &&\n isDefined(navigatorAlias.javaEnabled) &&\n navigatorAlias.javaEnabled()\n ) {\n browserFeatures.java = '1';\n }\n\n // Firefox\n if (isFunction(windowAlias.GearsFactory)) {\n browserFeatures.gears = '1';\n }\n\n // other browser features\n browserFeatures.cookie = hasCookies();\n }\n\n var width = parseInt(screenAlias.width, 10);\n var height = parseInt(screenAlias.height, 10);\n browserFeatures.res = parseInt(width, 10) + 'x' + parseInt(height, 10);\n return browserFeatures;\n }", "title": "" }, { "docid": "f6a3ea9cc047915e3c2647e76698aee6", "score": "0.5736351", "text": "function isInternetExplorer() {\n return /*@cc_on!@*/!1; // [Boolean]\n}", "title": "" }, { "docid": "97ed2fa28d5dc4c06a009fd7b52df31d", "score": "0.57301706", "text": "function BrowserCheck()\n{\n\tvar b = navigator.appName.toString();\n\tvar b_ver;\n\tvar up = navigator.platform.toString();\n\tvar ua = navigator.userAgent.toString().toLowerCase();\n\tvar re_opera = /Opera.([0-9\\.]*)/i;\n\tvar re_msie = /MSIE.([0-9\\.]*)/i;\n\tvar re_gecko = /gecko/i;\n\t// mozilla/5.0 (macintosh; u; intel mac os x 10_6_7; en-us) applewebkit/533.20.25 (khtml, like gecko) version/5.0.4 safari/533.20.27\n\tvar re_safari = /safari\\/([\\d\\.]*)/i;\n\tvar re_mozilla = /firefox\\/([\\d\\.]*)/i;\n\tvar re_chrome = /chrome\\/([\\d\\.]*)/i;\n\tvar ie_documentMode = 0;\n\tvar browserType = {};\n\tbrowserType.mozilla = browserType.ie = browserType.opera = r = false;\n\tbrowserType.version = (ua.match(/.+(?:rv|it|ra|ie|me)[\\/: ]([\\d.]+)/) || [])[1];\n\tbrowserType.chrome = /chrome/.test(ua);\n\tbrowserType.safari = /webkit/.test(ua) && !/chrome/.test(ua);\n\tbrowserType.opera = /opera/.test(ua);\n\tbrowserType.ie = /msie/.test(ua) && !/opera/.test(ua);\n\tbrowserType.mozilla = /mozilla/.test(ua) && !/(compatible|webkit)/.test(ua);\n\tbrowserType.ie_documentMode = 0;\n\t\n\tif (ua.match(re_opera))\n\t{\n\t r = ua.match(re_opera);\n\t browserType.version = parseFloat(r[1]);\n\t}\n\telse if (ua.match(re_msie))\n\t{\n\t r = ua.match(re_msie);\n\t browserType.version = parseFloat(r[1]);\n\t ie_documentMode = browserType.version;\n\t if (browserType.version <= 7)\n\t {\n\t re_ver = /trident\\/([\\d\\.]*)/i;\n\t r = ua.match(re_ver);\n\t // in IE compat mode, trident=4.0 (IE8), =5.0 (IE9), =6.0 (IE10) etc, i.e, version=trident+4.\n\t if (r && parseFloat(r[1]) >= 4)\n\t {\n\t browserType.version = parseFloat(r[1]) + 4;\n\t ie_documentMode = document.documentMode;\n\t }\n\t }\n\t}\n\telse if (browserType.safari && !browserType.chrome)\n\t{\n\t re_ver = /version\\/([\\d\\.]*)/i;\n\t if (ua.match(re_ver))\n\t {\n\t r = ua.match(re_ver);\n\t browserType.version = parseFloat(r[1]);\n\t }\n\t}\n\telse if (browserType.chrome)\n\t{\n\t b_ver = ua.match(re_chrome);\n\t r = b_ver[1].split('.');\n\t browserType.version = parseFloat(r[0]);\n\t}\n\telse if (ua.match(re_gecko))\n\t{\n\t var re_gecko_version = /rv:\\s*([0-9\\.]+)/i;\n\t r = ua.match(re_gecko_version);\n\t browserType.version = parseFloat(r[1]);\n\t if (ua.match(re_mozilla))\n\t {\n\t r = ua.match(re_mozilla);\n\t browserType.version = parseFloat(r[1]);\n\t }\n\t}\n\telse if (ua.match(re_mozilla))\n\t{\n\t r = ua.match(re_mozilla);\n\t browserType.version = parseFloat(r[1]);\n\t}\n\tbrowserType.windows = browserType.mac = browserType.linux = false;\n\tbrowserType.Platform = ua.match(/windows/i) ? \"windows\" : (ua.match(/linux/i) ? \"linux\" : (ua.match(/mac/i) ? \"mac\" : ua.match(/unix/i) ? \"unix\" : \"unknown\"));\n\tthis[browserType.Platform] = true;\n\tbrowserType.v = browserType.version;\n\tbrowserType.valid = browserType.ie && browserType.v >= 6 || browserType.mozilla && browserType.v >= 1.4 || browserType.safari && browserType.v >= 5 || browserType.chrome && browserType.v >= 12;\n\tbrowserType.okToAuthor = (browserType.ie && browserType.v >= 8 && ie_documentMode >= 7) || browserType.mozilla && browserType.v >= 3.6 || browserType.safari && browserType.v >= 5 || browserType.chrome && browserType.v >= 12;\n\tbrowserType.ie_documentMode = ie_documentMode;\n\treturn browserType;\n}", "title": "" }, { "docid": "6eba1d0f93ae2c7eef94398ae2549216", "score": "0.57292956", "text": "function preIE10Check() {\n if (window.attachEvent && !window.navigator.msPointerEnabled) {\n // console.log('IE 9 or below detected.');\n return true;\n } else {\n // console.log('This browsers is not IE 9 or below. 001');\n return false;\n }\n }", "title": "" }, { "docid": "08dd562df265386ea01279e4dbefb93c", "score": "0.5726559", "text": "function check_browser_compatibility() {\n var browser = false;\n var add_warning = false;\n var hide_vertical_text = false;\n\n if ( jQuery.browser.msie && parseInt(jQuery.browser.version,10) < 7 ) {\n browser = \"Internet Explorer\";\n add_warning = true;\n } else if ( jQuery.browser.mozilla ) {\n var gecko_version = jQuery.browser.version.split(\".\");\n var major_gecko_revision = parseFloat(gecko_version[0] + \".\" + gecko_version[1]);\n var minor_gecko_revision = parseInt(gecko_version[2],10);\n\n if ( major_gecko_revision == 1.9 && minor_gecko_revision < 1 ) {\n browser = \"the Mozilla Gecko rendering engine (used in Firefox and other browsers)\";\n add_warning = true;\n hide_vertical_text = true;\n } else if ( major_gecko_revision <= 1.8 ) {\n browser = \"the Mozilla Gecko rendering engine (used in Firefox and other browsers)\";\n add_warning = true;\n hide_vertical_text = true;\n }\n } else if ( jQuery.browser.webkit ) {\n var webkit_version = parseInt(jQuery.browser.version.split(\".\")[0],10);\n\n if ( webkit_version < 525 ) {\n browser = \"the Webkit rendering engine (used in Safari, Chrome and other browsers)\";\n add_warning = true;\n hide_vertical_text = true;\n }\n } else if ( jQuery.browser.opera ) {\n var opera_version = jQuery.browser.version.split(\".\");\n var major_opera_version = parseInt(opera_version[0],10);\n var minor_opera_version = parseInt(opera_version[1],10);\n \n if ( major_opera_version == 10 ) {\n if ( minor_opera_version < 50 ) { hide_vertical_text = true; }\n } else if ( major_opera_version <= 9 ) {\n browser = \"the Opera web browser\";\n add_warning = true;\n hide_vertical_text = true;\n }\n }\n \n if ( add_warning && browser ) {\n var warning_string = \n \"<strong>WARNING:</strong> It appears that you are using an \" +\n \"older version of \" + browser + \". This site has been \" +\n \"developed and tested on the most recent versions and may not work \" +\n \"as expected. Please consider upgrading your browser for a better \" +\n \"browsing experience.\";\n \n jQuery(\"#browser_warnings\").html( warning_string );\n jQuery(\"#browser_warnings\").show();\n }\n \n if ( hide_vertical_text ) {\n jQuery(\".vertical_text\").css(\"display\",\"none\");\n jQuery(\".sanger-phenotyping_heatmap th\").css(\"height\",\"auto\");\n }\n}", "title": "" }, { "docid": "9078f03f34d74077240d3eae6a7afff9", "score": "0.57209444", "text": "function _browserSniff() {\n var ua = navigator.userAgent,\n name = navigator.appName,\n fullVersion = '' + parseFloat(navigator.appVersion),\n majorVersion = parseInt(navigator.appVersion, 10),\n nameOffset,\n verOffset,\n ix,\n isIE = false,\n isFirefox = false,\n isChrome = false,\n isSafari = false;\n\n if (navigator.appVersion.indexOf('Windows NT') !== -1 && navigator.appVersion.indexOf('rv:11') !== -1) {\n // MSIE 11\n isIE = true;\n name = 'IE';\n fullVersion = '11';\n } else if ((verOffset = ua.indexOf('MSIE')) !== -1) {\n // MSIE\n isIE = true;\n name = 'IE';\n fullVersion = ua.substring(verOffset + 5);\n } else if ((verOffset = ua.indexOf('Chrome')) !== -1) {\n // Chrome\n isChrome = true;\n name = 'Chrome';\n fullVersion = ua.substring(verOffset + 7);\n } else if ((verOffset = ua.indexOf('Safari')) !== -1) {\n // Safari\n isSafari = true;\n name = 'Safari';\n fullVersion = ua.substring(verOffset + 7);\n if ((verOffset = ua.indexOf('Version')) !== -1) {\n fullVersion = ua.substring(verOffset + 8);\n }\n } else if ((verOffset = ua.indexOf('Firefox')) !== -1) {\n // Firefox\n isFirefox = true;\n name = 'Firefox';\n fullVersion = ua.substring(verOffset + 8);\n } else if ((nameOffset = ua.lastIndexOf(' ') + 1) < (verOffset = ua.lastIndexOf('/'))) {\n // In most other browsers, 'name/version' is at the end of userAgent\n name = ua.substring(nameOffset, verOffset);\n fullVersion = ua.substring(verOffset + 1);\n\n if (name.toLowerCase() === name.toUpperCase()) {\n name = navigator.appName;\n }\n }\n\n // Trim the fullVersion string at semicolon/space if present\n if ((ix = fullVersion.indexOf(';')) !== -1) {\n fullVersion = fullVersion.substring(0, ix);\n }\n if ((ix = fullVersion.indexOf(' ')) !== -1) {\n fullVersion = fullVersion.substring(0, ix);\n }\n\n // Get major version\n majorVersion = parseInt('' + fullVersion, 10);\n if (isNaN(majorVersion)) {\n fullVersion = '' + parseFloat(navigator.appVersion);\n majorVersion = parseInt(navigator.appVersion, 10);\n }\n\n // Return data\n return {\n name: name,\n version: majorVersion,\n isIE: isIE,\n isFirefox: isFirefox,\n isChrome: isChrome,\n isSafari: isSafari,\n isIos: /(iPad|iPhone|iPod)/g.test(navigator.platform),\n isIphone: /(iPhone|iPod)/g.test(navigator.userAgent),\n isTouch: 'ontouchstart' in document.documentElement\n };\n }", "title": "" }, { "docid": "c4e805c39f7bd978a9f383fe11c31012", "score": "0.57103354", "text": "function checkCapabilities() {\n\n\t\tisMobileDevice = /(iphone|ipod|ipad|android)/gi.test( UA );\n\t\tisChrome = /chrome/i.test( UA ) && !/edge/i.test( UA );\n\n\t\tvar testElement = document.createElement( 'div' );\n\n\t\tfeatures.transforms3d = 'WebkitPerspective' in testElement.style ||\n\t\t\t'MozPerspective' in testElement.style ||\n\t\t\t'msPerspective' in testElement.style ||\n\t\t\t'OPerspective' in testElement.style ||\n\t\t\t'perspective' in testElement.style;\n\n\t\tfeatures.transforms2d = 'WebkitTransform' in testElement.style ||\n\t\t\t'MozTransform' in testElement.style ||\n\t\t\t'msTransform' in testElement.style ||\n\t\t\t'OTransform' in testElement.style ||\n\t\t\t'transform' in testElement.style;\n\n\t\tfeatures.requestAnimationFrameMethod = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame;\n\t\tfeatures.requestAnimationFrame = typeof features.requestAnimationFrameMethod === 'function';\n\n\t\tfeatures.canvas = !!document.createElement( 'canvas' ).getContext;\n\n\t\t// Transitions in the overview are disabled in desktop and\n\t\t// Safari due to lag\n\t\tfeatures.overviewTransitions = !/Version\\/[\\d\\.]+.*Safari/.test( UA );\n\n\t\t// Flags if we should use zoom instead of transform to scale\n\t\t// up slides. Zoom produces crisper results but has a lot of\n\t\t// xbrowser quirks so we only use it in whitelsited browsers.\n\t\tfeatures.zoom = 'zoom' in testElement.style && !isMobileDevice &&\n\t\t\t( isChrome || /Version\\/[\\d\\.]+.*Safari/.test( UA ) );\n\n\t}", "title": "" }, { "docid": "6539adff23dcd38338f6dd267f68d586", "score": "0.568581", "text": "function checkCapabilities() {\n\n\t\tisMobileDevice = /(iphone|ipod|ipad|android)/gi.test( UA );\n\t\tisChrome = /chrome/i.test( UA ) && !/edge/i.test( UA );\n\n\t\tvar testElement = document.createElement( 'div' );\n\n\t\tfeatures.transforms3d = 'WebkitPerspective' in testElement.style ||\n\t\t\t\t\t\t\t\t'MozPerspective' in testElement.style ||\n\t\t\t\t\t\t\t\t'msPerspective' in testElement.style ||\n\t\t\t\t\t\t\t\t'OPerspective' in testElement.style ||\n\t\t\t\t\t\t\t\t'perspective' in testElement.style;\n\n\t\tfeatures.transforms2d = 'WebkitTransform' in testElement.style ||\n\t\t\t\t\t\t\t\t'MozTransform' in testElement.style ||\n\t\t\t\t\t\t\t\t'msTransform' in testElement.style ||\n\t\t\t\t\t\t\t\t'OTransform' in testElement.style ||\n\t\t\t\t\t\t\t\t'transform' in testElement.style;\n\n\t\tfeatures.requestAnimationFrameMethod = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame;\n\t\tfeatures.requestAnimationFrame = typeof features.requestAnimationFrameMethod === 'function';\n\n\t\tfeatures.canvas = !!document.createElement( 'canvas' ).getContext;\n\n\t\t// Transitions in the overview are disabled in desktop and\n\t\t// Safari due to lag\n\t\tfeatures.overviewTransitions = !/Version\\/[\\d\\.]+.*Safari/.test( UA );\n\n\t\t// Flags if we should use zoom instead of transform to scale\n\t\t// up slides. Zoom produces crisper results but has a lot of\n\t\t// xbrowser quirks so we only use it in whitelsited browsers.\n\t\tfeatures.zoom = 'zoom' in testElement.style && !isMobileDevice &&\n\t\t\t\t\t\t( isChrome || /Version\\/[\\d\\.]+.*Safari/.test( UA ) );\n\n\t}", "title": "" }, { "docid": "08eef3baa802e57c5feeabfaf0b35e9a", "score": "0.5668111", "text": "function detectIE() {\n if (typeof window === \"undefined\") return false;\n var ua = window.navigator.userAgent;\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n return false;\n}", "title": "" }, { "docid": "b8ffbc42ac32aa51ac7415b2952eea2b", "score": "0.56491363", "text": "function checkCapabilities() {\n\n\t\tfeatures.transforms3d = 'WebkitPerspective' in document.body.style ||\n\t\t\t\t\t\t\t\t'MozPerspective' in document.body.style ||\n\t\t\t\t\t\t\t\t'msPerspective' in document.body.style ||\n\t\t\t\t\t\t\t\t'OPerspective' in document.body.style ||\n\t\t\t\t\t\t\t\t'perspective' in document.body.style;\n\n\t\tfeatures.transforms2d = 'WebkitTransform' in document.body.style ||\n\t\t\t\t\t\t\t\t'MozTransform' in document.body.style ||\n\t\t\t\t\t\t\t\t'msTransform' in document.body.style ||\n\t\t\t\t\t\t\t\t'OTransform' in document.body.style ||\n\t\t\t\t\t\t\t\t'transform' in document.body.style;\n\n\t\tfeatures.requestAnimationFrameMethod = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame;\n\t\tfeatures.requestAnimationFrame = typeof features.requestAnimationFrameMethod === 'function';\n\n\t\tfeatures.canvas = !!document.createElement( 'canvas' ).getContext;\n\n\t\tisMobileDevice = navigator.userAgent.match( /(iphone|ipod|android)/gi );\n\n\t}", "title": "" }, { "docid": "b8ffbc42ac32aa51ac7415b2952eea2b", "score": "0.56491363", "text": "function checkCapabilities() {\n\n\t\tfeatures.transforms3d = 'WebkitPerspective' in document.body.style ||\n\t\t\t\t\t\t\t\t'MozPerspective' in document.body.style ||\n\t\t\t\t\t\t\t\t'msPerspective' in document.body.style ||\n\t\t\t\t\t\t\t\t'OPerspective' in document.body.style ||\n\t\t\t\t\t\t\t\t'perspective' in document.body.style;\n\n\t\tfeatures.transforms2d = 'WebkitTransform' in document.body.style ||\n\t\t\t\t\t\t\t\t'MozTransform' in document.body.style ||\n\t\t\t\t\t\t\t\t'msTransform' in document.body.style ||\n\t\t\t\t\t\t\t\t'OTransform' in document.body.style ||\n\t\t\t\t\t\t\t\t'transform' in document.body.style;\n\n\t\tfeatures.requestAnimationFrameMethod = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame;\n\t\tfeatures.requestAnimationFrame = typeof features.requestAnimationFrameMethod === 'function';\n\n\t\tfeatures.canvas = !!document.createElement( 'canvas' ).getContext;\n\n\t\tisMobileDevice = navigator.userAgent.match( /(iphone|ipod|android)/gi );\n\n\t}", "title": "" }, { "docid": "baeb889fceeef85c533f6c8139c4c39d", "score": "0.564637", "text": "function BrowserDetect () {\r\n\t// convert all characters to lowercase to simplify testing\r\n\tvar agt=navigator.userAgent.toLowerCase();\r\n\tthis.nameB=navigator.userAgent.toLowerCase();\r\n\t// *** BROWSER VERSION ***\r\n\t// Note: On IE5, these return 4, so use is.ie5up to detect IE5.\r\n\tthis.major = parseInt(navigator.appVersion);\r\n\tthis.minor = parseFloat(navigator.appVersion);\r\n\t\r\n\tthis.nav = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1) && (agt.indexOf('webtv')==-1));\r\n this.nav4 = (this.nav && (this.major == 4));\r\n this.nav4up = (this.nav && (this.major >= 4));\r\n this.navonly = (this.nav && ((agt.indexOf(\";nav\") != -1) ||\r\n (agt.indexOf(\"; nav\") != -1)) );\r\n this.nav5 = (this.nav && (this.major == 5));\r\n this.nav5up = (this.nav && (this.major >= 5));\r\n\r\n this.ie = (agt.indexOf(\"msie\") != -1);\r\n this.ie4 = (this.ie && (this.major == 4) && (agt.indexOf(\"msie 5.0\")==-1) );\r\n this.ie4up = (this.ie &&(this.major >= 4));\r\n this.ie5 = (this.ie && (this.major == 4) && (agt.indexOf(\"msie 5.0\")!=-1) );\r\n this.ie5up = (this.ie &&!this.ie3 && !this.ie4);\r\n\r\n // KNOWN BUG: On AOL4, returns false if IE3 is embedded browser\r\n // or if this is the first browser window opened. Thus the\r\n // properties is.aol, is.aol3, and is.aol4 aren't 100% reliable.\r\n this.aol4 = (this.aol && this.ie4);\r\n\r\n // *** PLATFORM ***\r\n this.win = ( (agt.indexOf(\"win\")!=-1) || (agt.indexOf(\"16bit\")!=-1) );\r\n this.mac = (agt.indexOf(\"mac\")!=-1);\r\n}", "title": "" }, { "docid": "db8122aca0d4736b26224e7734b2b3d1", "score": "0.56427836", "text": "function preIE10Check() {\n if (window.attachEvent && !window.navigator.msPointerEnabled) {\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "74904d7a5d06ccdfb5f08b8e57480a5b", "score": "0.5635753", "text": "checkSupport() {\n if (!isSupported()) {\n throw new SupportError()\n }\n }", "title": "" }, { "docid": "34398d7fc30adbb19f556a8c8cf7201b", "score": "0.5634165", "text": "function getCryptoSubtle() {\n if (\"undefined\" !== typeof crypto) {\n if (\"undefined\" !== typeof crypto.subtle) {\n return crypto.subtle;\n }\n }\n\n return undefined;\n}", "title": "" }, { "docid": "b9016139e58c606692458048d0046479", "score": "0.5619959", "text": "function browserDetectNotify() {\n\t\n\t// Initialize vars:\n\n\t// Message array\n\tvar message_legacy = '';\n\tvar message_solution = '';\n\n\t/****************************************************************************/\n\n\t// Quirks mode detection not working [02.07.2012 - Jakob Anderson]\n\t// if (jQuery.support.boxModel != 'true') {\n\t// \tmessage_legacy = 'maybe?';\n\t// \tmessage_solution = quirks_solution;\n\t// \t//report to console for testing\n\t// \tconsole.log('legacy: ' + message_legacy);\n\t// \tconsole.log('solution: ' + message_solution);\n\t// }\n\n\t// Use jQuery.support and Modernizr.js to determine feature support\n\t// Run Modernizr first, because IE9 can give false positives on feature support when in compat. mode\n\t// And because compat. mode can sometimes be found on a subset of non-legacy browsers (IE9)\n\tif ( (Modernizr.fontface && Modernizr.canvas ) ) { /* remove \"!\" for deployment */\n\t // script to run if test returns true\n\t\t//report to console for testing\n\t\t//console.log('modernizr: Is a valid browser / not legacy browser. Passed all: \"fontface && canvas\"');\n\t} else {\n\t // script to run if baseline features are not supported\n\t message_legacy = 'true';\n\t\tmessage_solution = 'legacy_solution';\n\t\t//report to console for testing\n\t\t//console.log('modernizr: Not a valid browser / is legacy browser, Failed one or more: \"fontface && canvas\"');\n\t}\n\n\t// JQuery.browser test for IE9+ compatibility mode\n\t// Test browser type and rendering engine version to determine whether it's \n\t// IE9+ with compatibility mode on lying to us, saying that it is ie7\n\n\t// If browser user-agent registers as less than IE 9\n\tif ( ($.browser.msie) && ($.browser.version < '9.0') ){\n\t\tif(navigator.userAgent.indexOf(\"Trident/5\")>-1) {\n\t\t\tmessage_legacy = 'false';\n\t\t\tmessage_solution = 'ie_compat_solution';\n\t\t\t//report to console for testing\n\t\t\t//console.log('ie 9 legacy: ' + message_legacy);\n\t\t\t//console.log('ie, but not legacy browser');\n\t\t}\n\t\telse {\n\t\t\tmessage_legacy = 'true';\n\t\t\tmessage_solution = 'legacy_solution';\n\t\t\t//report to console for testing\n\t\t\t//console.log('ie legacy: ' + message_legacy);\n\t\t}\n\t}\n\n\tvar browser_valid = '';\n\t// If browser has failed the baseline tests, show notification\n\tif ( (message_legacy != '') && (message_solution != '') ) {\n\t\t\n\t\tif (message_solution == 'ie_compat_solution') {\n\t\t\t//console.log('message_solution: ' + message_solution);\n\t\t\t$('#compat_message').css('display', 'block');\n\t\t} else {\n\t\t\t//console.log('message_solution: ' + message_solution);\n\t\t\t$('#legacy_message').css('display', 'block');\n\t\t}\n\n\t\t$('#legacy_browser_notification').slideDown(\"slow\");\n\t\t$(\".close_button\").click(function () {\n\t $('#legacy_browser_notification').slideUp(\"slow\");\n\t });\n\t browser_valid = 'false';\n\t} else {\n\t\tbrowser_valid = 'true';\n\t}\n\treturn browser_valid;\n\t//console.log('at end of detection js');\n\t\n}", "title": "" }, { "docid": "abe6fe451dae923bf1b8af14594f2f59", "score": "0.56192636", "text": "function BrowserInfo() {\n \n this.mac = false;\n this.win = false;\n this.lin = false;\n this.op = false;\n this.konq = false;\n this.saf = false;\n this.moz = false;\n this.ie = false;\n this.ie4 = false;\n this.ie5x = false;\n this.ie5xmac = false;\n this.ie5xwin = false;\n this.ns4x =false;\n \n var d = document;\n var n = navigator;\n var na = n.appVersion;\n var nua = n.userAgent;\n this.win = ( na.indexOf( 'Win' ) != -1 );\n this.mac = ( na.indexOf( 'Mac' ) != -1 );\n this.lin = ( nua.indexOf( 'Linux' ) != -1 );\n this.ipad = nua.indexOf('iPad') != -1;\n this.iphone = nua.indexOf('iPhone') != -1;\n this.ios = this.ipad || this.iphone;\n this.ff = nua.indexOf('Firefox') != -1;\n this.android = nua.indexOf('Android') != -1;\n this.saf = ( nua.indexOf( 'Safari' ) != -1 );\n \n if ( !d.layers ){\n var dom = ( d.getElementById );\n this.op = ( nua.indexOf( 'Opera' ) != -1 );\n this.konq = ( nua.indexOf( 'Konqueror' ) != -1 );\n this.moz = ( nua.indexOf( 'Gecko' ) != -1 && !this.saf && !this.konq);\n this.ie = ( d.all && !this.op );\n this.ie4 = ( this.ie && !dom );\n \n /*\n ie5x tests only for functionality. ( dom||ie5x ) would be default settings. \n Opera will register true in this test if set to identify as IE 5\n */\n \n this.ie5x = ( d.all && dom );\n this.ie5xmac = ( this.mac && this.ie5x );\n this.ie5xwin = ( this.win && this.ie5x );\n } else {\n this.ns4x = true;\n }\n}", "title": "" }, { "docid": "bf3a990211b1c511df5560335dc09f5a", "score": "0.56125385", "text": "function Browserdetect ( )\n{\n var ua = navigator.userAgent;\n var uaname = new Array(\"Netscape\", \"Firefox\", \"Opera\", \"MSIE\", \"Mozilla\");\n var engine = new Array(\"Gecko\", \"MSIE\", \"Opera\");\n var compat = new Array(\"Mozilla\", \"Opera\");\n var pattern = /([0-9\\.]+)(.*?)$/;\n var replaces = \"$1\";\n var i, pos = 0, version = null;\n\n for (i = 0; i < uaname.length; i++) {\n if ((pos = ua.indexOf(uaname[i])) >= 0) {\n version = ua.substring(pos + uaname[i].length + 1);\n this.uaname = uaname[i];\n this.uavers = version.replace(pattern, replaces);\n break;\n }\n }\n for (i = 0; i < engine.length; i++) {\n if ((pos = ua.indexOf(engine[i])) >= 0) {\n version = ua.substring(pos + engine[i].length + 1);\n this.enname = engine[i];\n this.envers = version.replace(pattern, replaces);\n break;\n }\n }\n for (i = 0; i < compat.length; i++) {\n if ((pos = ua.indexOf(compat[i])) >= 0) {\n version = ua.substring(pos + compat[i].length + 1);\n this.cmname = compat[i];\n this.cmvers = version.replace(pattern, replaces);\n break;\n }\n }\n if (!this.uaname) {\n this.uaname = this.enname = this.cmname = \"Other\";\n this.uavers = this.envers = this.cmvers = 0.0;\n } else {\n if (this.uaname == uaname[4]) {\n if ((pos = ua.indexOf(\"rv:\")) >= 0) {\n version = ua.substring(pos + 3);\n this.uavers = version.replace(pattern, replaces);\n }\n }\n }\n}", "title": "" }, { "docid": "f6986101016f1330f06bcf8b5ffdf8e5", "score": "0.5603395", "text": "function checkBrowser() {\n\tthis.ver = navigator.appVersion\n\tthis.dom = document.getElementById ? 1 : 0\n\tthis.ie5 = (this.ver.indexOf(\"MSIE 5\") > -1 && this.dom) ? 1 : 0;\n\tthis.ie4 = (document.all && !this.dom) ? 1 : 0;\n\tthis.ns5 = (this.dom && parseInt(this.ver) >= 5) ? 1 : 0;\n\tthis.ns4 = (document.layers && !this.dom) ? 1 : 0;\n\tthis.bw = (this.ie5 || this.ie4 || this.ns4 || this.ns5)\n\treturn this\n}", "title": "" }, { "docid": "81305d673773188ecebc9288c007e756", "score": "0.5600199", "text": "function preIE10Check() {\n if (window.attachEvent && !window.navigator.msPointerEnabled) {\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "3748332e9fd16c7f0dc94dfeab041337", "score": "0.5595654", "text": "function checkBrowser(){\n\tthis.ver=navigator.appVersion\n\tthis.dom=document.getElementById?1:0\n\tthis.ie5=(this.ver.indexOf(\"MSIE 5\")>-1 && this.dom)?1:0;\n\tthis.ie4=(document.all && !this.dom)?1:0;\n\tthis.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;\n\tthis.ns4=(document.layers && !this.dom)?1:0;\n\tthis.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)\n\treturn this\n}", "title": "" }, { "docid": "8561153ef97924c9cc8d2809b62ff761", "score": "0.55911964", "text": "function adderIsIE() {\n return (navigator.userAgent.indexOf(\"MSIE\") != -1\n && navigator.userAgent.indexOf(\"Win\") != -1);\n}", "title": "" }, { "docid": "c847ca97573e742d95dae5609812ed65", "score": "0.55793804", "text": "function _browserSniff() {\n\t var nAgt = navigator.userAgent,\n\t name = navigator.appName,\n\t fullVersion = \"\" + parseFloat(navigator.appVersion),\n\t majorVersion = parseInt(navigator.appVersion, 10),\n\t nameOffset,\n\t verOffset,\n\t ix;\n\n\t // MSIE 11\n\t if ((navigator.appVersion.indexOf(\"Windows NT\") !== -1) && (navigator.appVersion.indexOf(\"rv:11\") !== -1)) {\n\t name = \"IE\";\n\t fullVersion = \"11;\";\n\t }\n\t // MSIE\n\t else if ((verOffset=nAgt.indexOf(\"MSIE\")) !== -1) {\n\t name = \"IE\";\n\t fullVersion = nAgt.substring(verOffset + 5);\n\t }\n\t // Chrome\n\t else if ((verOffset=nAgt.indexOf(\"Chrome\")) !== -1) {\n\t name = \"Chrome\";\n\t fullVersion = nAgt.substring(verOffset + 7);\n\t }\n\t // Safari\n\t else if ((verOffset=nAgt.indexOf(\"Safari\")) !== -1) {\n\t name = \"Safari\";\n\t fullVersion = nAgt.substring(verOffset + 7);\n\t if ((verOffset=nAgt.indexOf(\"Version\")) !== -1) {\n\t fullVersion = nAgt.substring(verOffset + 8);\n\t }\n\t }\n\t // Firefox\n\t else if ((verOffset=nAgt.indexOf(\"Firefox\")) !== -1) {\n\t name = \"Firefox\";\n\t fullVersion = nAgt.substring(verOffset + 8);\n\t }\n\t // In most other browsers, \"name/version\" is at the end of userAgent \n\t else if ((nameOffset=nAgt.lastIndexOf(\" \") + 1) < (verOffset=nAgt.lastIndexOf(\"/\"))) {\n\t name = nAgt.substring(nameOffset,verOffset);\n\t fullVersion = nAgt.substring(verOffset + 1);\n\n\t if (name.toLowerCase() == name.toUpperCase()) {\n\t name = navigator.appName;\n\t }\n\t }\n\t // Trim the fullVersion string at semicolon/space if present\n\t if ((ix = fullVersion.indexOf(\";\")) !== -1) {\n\t fullVersion = fullVersion.substring(0, ix);\n\t }\n\t if ((ix = fullVersion.indexOf(\" \")) !== -1) {\n\t fullVersion = fullVersion.substring(0, ix);\n\t }\n\t // Get major version\n\t majorVersion = parseInt(\"\" + fullVersion, 10);\n\t if (isNaN(majorVersion)) {\n\t fullVersion = \"\" + parseFloat(navigator.appVersion); \n\t majorVersion = parseInt(navigator.appVersion, 10);\n\t }\n\n\t // Return data\n\t return {\n\t name: name, \n\t version: majorVersion, \n\t ios: /(iPad|iPhone|iPod)/g.test(navigator.platform)\n\t };\n\t }", "title": "" }, { "docid": "4af360f621b0f91085bf040ce72b832c", "score": "0.55671275", "text": "function _browserSniff() {\n\t var nAgt = navigator.userAgent,\n\t name = navigator.appName,\n\t fullVersion = '' + parseFloat(navigator.appVersion),\n\t majorVersion = parseInt(navigator.appVersion, 10),\n\t nameOffset,\n\t verOffset,\n\t ix;\n\n\t // MSIE 11\n\t if ((navigator.appVersion.indexOf('Windows NT') !== -1) && (navigator.appVersion.indexOf('rv:11') !== -1)) {\n\t name = 'IE';\n\t fullVersion = '11;';\n\t }\n\t // MSIE\n\t else if ((verOffset=nAgt.indexOf('MSIE')) !== -1) {\n\t name = 'IE';\n\t fullVersion = nAgt.substring(verOffset + 5);\n\t }\n\t // Chrome\n\t else if ((verOffset=nAgt.indexOf('Chrome')) !== -1) {\n\t name = 'Chrome';\n\t fullVersion = nAgt.substring(verOffset + 7);\n\t }\n\t // Safari\n\t else if ((verOffset=nAgt.indexOf('Safari')) !== -1) {\n\t name = 'Safari';\n\t fullVersion = nAgt.substring(verOffset + 7);\n\t if ((verOffset=nAgt.indexOf('Version')) !== -1) {\n\t fullVersion = nAgt.substring(verOffset + 8);\n\t }\n\t }\n\t // Firefox\n\t else if ((verOffset=nAgt.indexOf('Firefox')) !== -1) {\n\t name = 'Firefox';\n\t fullVersion = nAgt.substring(verOffset + 8);\n\t }\n\t // In most other browsers, 'name/version' is at the end of userAgent\n\t else if ((nameOffset=nAgt.lastIndexOf(' ') + 1) < (verOffset=nAgt.lastIndexOf('/'))) {\n\t name = nAgt.substring(nameOffset,verOffset);\n\t fullVersion = nAgt.substring(verOffset + 1);\n\n\t if (name.toLowerCase() == name.toUpperCase()) {\n\t name = navigator.appName;\n\t }\n\t }\n\t // Trim the fullVersion string at semicolon/space if present\n\t if ((ix = fullVersion.indexOf(';')) !== -1) {\n\t fullVersion = fullVersion.substring(0, ix);\n\t }\n\t if ((ix = fullVersion.indexOf(' ')) !== -1) {\n\t fullVersion = fullVersion.substring(0, ix);\n\t }\n\t // Get major version\n\t majorVersion = parseInt('' + fullVersion, 10);\n\t if (isNaN(majorVersion)) {\n\t fullVersion = '' + parseFloat(navigator.appVersion);\n\t majorVersion = parseInt(navigator.appVersion, 10);\n\t }\n\n\t // Return data\n\t return {\n\t name: name,\n\t version: majorVersion,\n\t ios: /(iPad|iPhone|iPod)/g.test(navigator.platform),\n\t touch: 'ontouchstart' in document.documentElement\n\t };\n\t }", "title": "" }, { "docid": "81f724ce8ca18f0b8133d759e546c576", "score": "0.55620605", "text": "function _browserSniff() {\n var nAgt = navigator.userAgent,\n name = navigator.appName,\n fullVersion = '' + parseFloat(navigator.appVersion),\n majorVersion = parseInt(navigator.appVersion, 10),\n nameOffset,\n verOffset,\n ix;\n\n // MSIE 11\n if ((navigator.appVersion.indexOf('Windows NT') !== -1) && (navigator.appVersion.indexOf('rv:11') !== -1)) {\n name = 'IE';\n fullVersion = '11;';\n }\n // MSIE\n else if ((verOffset=nAgt.indexOf('MSIE')) !== -1) {\n name = 'IE';\n fullVersion = nAgt.substring(verOffset + 5);\n }\n // Chrome\n else if ((verOffset=nAgt.indexOf('Chrome')) !== -1) {\n name = 'Chrome';\n fullVersion = nAgt.substring(verOffset + 7);\n }\n // Safari\n else if ((verOffset=nAgt.indexOf('Safari')) !== -1) {\n name = 'Safari';\n fullVersion = nAgt.substring(verOffset + 7);\n if ((verOffset = nAgt.indexOf('Version')) !== -1) {\n fullVersion = nAgt.substring(verOffset + 8);\n }\n }\n // Firefox\n else if ((verOffset=nAgt.indexOf('Firefox')) !== -1) {\n name = 'Firefox';\n fullVersion = nAgt.substring(verOffset + 8);\n }\n // In most other browsers, 'name/version' is at the end of userAgent\n else if ((nameOffset=nAgt.lastIndexOf(' ') + 1) < (verOffset=nAgt.lastIndexOf('/'))) {\n name = nAgt.substring(nameOffset,verOffset);\n fullVersion = nAgt.substring(verOffset + 1);\n\n if (name.toLowerCase() == name.toUpperCase()) {\n name = navigator.appName;\n }\n }\n // Trim the fullVersion string at semicolon/space if present\n if ((ix = fullVersion.indexOf(';')) !== -1) {\n fullVersion = fullVersion.substring(0, ix);\n }\n if ((ix = fullVersion.indexOf(' ')) !== -1) {\n fullVersion = fullVersion.substring(0, ix);\n }\n // Get major version\n majorVersion = parseInt('' + fullVersion, 10);\n if (isNaN(majorVersion)) {\n fullVersion = '' + parseFloat(navigator.appVersion);\n majorVersion = parseInt(navigator.appVersion, 10);\n }\n\n // Return data\n return {\n name: name,\n version: majorVersion,\n ios: /(iPad|iPhone|iPod)/g.test(navigator.platform),\n touch: 'ontouchstart' in document.documentElement\n };\n }", "title": "" }, { "docid": "377e6600d0ed51287fd12fa72b4d7ba5", "score": "0.55550367", "text": "function isIE11Test(navigator) {\n // https://stackoverflow.com/questions/17447373/how-can-i-target-only-internet-explorer-11-with-javascript\n return /Trident.*rv[ :]*11\\./.test(navigator.userAgent);\n }", "title": "" }, { "docid": "5276db758dc527f0e6a2bb33cfbb14fd", "score": "0.55538887", "text": "function isMsie() {\n\t\treturn navigator.cpuClass && !navigator.product;\n\t}", "title": "" }, { "docid": "5276db758dc527f0e6a2bb33cfbb14fd", "score": "0.55538887", "text": "function isMsie() {\n\t\treturn navigator.cpuClass && !navigator.product;\n\t}", "title": "" }, { "docid": "ed1d3129d79a60d2d2d0ba8c17e4bea7", "score": "0.5551247", "text": "function lib_bwcheck(){ //Browsercheck (needed)\n this.ver=navigator.appVersion\n this.agent=navigator.userAgent\n this.dom=document.getElementById?1:0\n this.opera5=this.agent.indexOf(\"Opera 5\")>-1\n this.ie5=(this.ver.indexOf(\"MSIE 5\")>-1 && this.dom && !this.opera5)?1:0;\n this.ie6=(this.ver.indexOf(\"MSIE 6\")>-1 && this.dom && !this.opera5)?1:0;\n\tthis.ie7=(this.ver.indexOf(\"MSIE 7\")>-1 && this.dom && !this.opera5)?1:0;\n this.ie4=(document.all && !this.dom && !this.opera5)?1:0;\n this.ie=this.ie4||this.ie5||this.ie6||this.ie7\n this.mac=this.agent.indexOf(\"Mac\")>-1\n this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0;\n this.ns4=(document.layers && !this.dom)?1:0;\n this.bw=(this.ie7 ||this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)\n\t\n return this\n}", "title": "" }, { "docid": "91a2ee68b3f0770d63f41b866c7f6780", "score": "0.5549903", "text": "function checkBrowser(){\r\tthis.ver=navigator.appVersion\r\tthis.dom=document.getElementById?1:0\r\tthis.ie5=(this.ver.indexOf(\"MSIE 5\")>-1 && this.dom)?1:0;\r\tthis.ie4=(document.all && !this.dom)?1:0;\r\tthis.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;\r\tthis.ns4=(document.layers && !this.dom)?1:0;\r\tthis.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)\r\treturn this\r}", "title": "" }, { "docid": "05061deb8410f5a5b982c7ee6648886c", "score": "0.5542829", "text": "function isIE11Test(navigator) {\n // https://stackoverflow.com/questions/17447373/how-can-i-target-only-internet-explorer-11-with-javascript\n return /Trident.*rv[ :]*11\\./.test(navigator.userAgent);\n }", "title": "" }, { "docid": "05061deb8410f5a5b982c7ee6648886c", "score": "0.5542829", "text": "function isIE11Test(navigator) {\n // https://stackoverflow.com/questions/17447373/how-can-i-target-only-internet-explorer-11-with-javascript\n return /Trident.*rv[ :]*11\\./.test(navigator.userAgent);\n }", "title": "" }, { "docid": "05061deb8410f5a5b982c7ee6648886c", "score": "0.5542829", "text": "function isIE11Test(navigator) {\n // https://stackoverflow.com/questions/17447373/how-can-i-target-only-internet-explorer-11-with-javascript\n return /Trident.*rv[ :]*11\\./.test(navigator.userAgent);\n }", "title": "" }, { "docid": "55b17c19532ff4aa356e06920bb8e2a6", "score": "0.5515408", "text": "function versTest()\n{\n\tvar one = '';\n\tvar two = '';\n\t\n\tif (\n\t(navigator.appName.substring(0,8)==\"Netscape\" && (navigator.appVersion.substring(0,3) == \"3.0\" || navigator.appVersion.substring(0,3) ==\"4.0\")))\n\t{\n\t\tone='true';\n\t}\n\n\tif(\n\t (navigator.appName.substring(0,9) == \"Microsoft\" && navigator.appVersion.substring(0,3) == \"3.0\" && navigator.appVersion.indexOf(\"Macintosh\")>=0))\n\t{\n\t\ttwo='true';\n\t}\n\t\n\tif(one=='true' || two=='true' ||\n\t(navigator.appName.substring(0,9) == \"Microsoft\" && navigator.appVersion.indexOf(\"MSIE 3.0\")>=0 && \n\tnavigator.appVersion.indexOf(\"Windows 3.1\")>=0)\t)\n\t{\n\t\treturn true;\n\t}\n\telse\n\t{\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "07de8e228b072ebbef1db67ced4241c8", "score": "0.5498879", "text": "function alertBrowserCompatibility() {\n\tif (getBrowserName() != \"Firefox\" && getBrowserName() != \"Chrome\") {\n\t\tvar userLang = getBrowserLanguage();\n\t\tvar useFirefoxMsg = \"WISE has detected that you are not using Firefox or Chrome.\\n\\n\" +\n\t\t\t\t\"Some things may not work properly. For best results, please use \" +\n\t\t\t\t\"Firefox 3.5 or newer or the latest version of Chrome.\";\n\t\tif (userLang == \"ja\") {\n\t\t\tuseFirefoxMsg = \"Firefox\\u610f\\u5916\\u306e\\u30d6\\u30e9\\u30a6\\u30b6\\u30fc\\u306f\\u30b5\\u30dd\\u30fc\\u30c8\\u3055\\u308c\\u3066\\u3044\\u307e\\u305b\\u3093\\u3002Firefox 3.5\\u4ee5\\u4e0a\\u3092\\u304a\\u4f7f\\u3044\\u304f\\u3060\\u3055\\u3044\\u3002\";\n\t\t} else if (userLang == \"zh_TW\") {\n\t\t\tuseFirefoxMsg = \"Firefox\\u610f\\u5916\\u306e\\u30d6\\u30e9\\u30a6\\u30b6\\u30fc\\u306f\\u30b5\\u30dd\\u30fc\\u30c8\\u3055\\u308c\\u3066\\u3044\\u307e\\u305b\\u3093\\u3002Firefox 3.5\\u4ee5\\u4e0a\\u3092\\u304a\\u4f7f\\u3044\\u304f\\u3060\\u3055\\u3044\\u3002\";\n\t\t}\n\t\talert(useFirefoxMsg);\n\t};\n}", "title": "" }, { "docid": "7c6dea9c56b56597f82413de3bd924d1", "score": "0.54983044", "text": "function checkIE() {\n var ua = window.navigator.userAgent;\n var msie = ua.indexOf(\"MSIE \");\n\n if (msie > -1 || !!navigator.userAgent.match(/Trident.*rv\\:11\\./)) {\n return true;\n } // If another browser, return 0\n else {\n return false;\n }\n}", "title": "" }, { "docid": "507f8f3a823883d33c66b41402eee355", "score": "0.5496118", "text": "function msieversion() {\n\n var ua = window.navigator.userAgent;\n var msie = ua.indexOf(\"MSIE \");\n\n if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\\:11\\./)) // If Internet Explorer, return version number\n {\n DrawWelcome();\n }\n}", "title": "" }, { "docid": "5920b96f093e1cffff4d405a6fc45d6f", "score": "0.548675", "text": "function checkBrowser() \n{\n\n if (document.getElementById && document.attachEvent) \t\t//Modern IE browser (IE 5+)\n {\n \n }\n if (document.getElementById) \t\t//Modern non-IE browser\n {\n //var userAgentString = \"Mozilla/4.0 (compatible; MSIE 5.0; Mac_PowerPC)\";\n \n var userAgentString = navigator.userAgent;\n var macStatus = userAgentString.toLowerCase().indexOf(\"mac\") > -1;\n var macIEversion = parseInt(userAgentString.substr(userAgentString.indexOf(\"MSIE \") + (\"MSIE \").length, 3));\n\t\t\n if (macStatus && (macIEversion == 5)) //Check for IE 5 on Mac\n {\n alert(\"ALERT! Your browser does not support the minimum functionality requirements for this application. \\nYou are now being redirected to download Mozilla Firefox.\");\n \n window.location=\"http://www.mozilla.org/en-US/firefox/new/\";\n }\n }\n else //Very old browsers, warn them and redirect to download a latest browser\n {\n alert(\"ALERT! Your browser does not support the minimum functionality requirements for this application. \\nYou are now being redirected to download Mozilla Firefox.\");\n\n windows.location = \"http://www.GetFirefox.com/\";\n }\n\n}", "title": "" }, { "docid": "f804391b6ac2492c714a8ba28c393612", "score": "0.5477016", "text": "function isInternetExplorerBefore(version) {\n var iematch = /MSIE ([0-9]+)/g.exec(window.navigator.userAgent);\n\n return iematch ? +iematch[1] < version : false;\n }", "title": "" }, { "docid": "df80a141d16cb4e2d3a660ff05b7a438", "score": "0.54743487", "text": "static checkSupported() {\r\n return true;\r\n }", "title": "" }, { "docid": "c57aa0336fca8bb9c8e0f611de01a010", "score": "0.54715914", "text": "function isOldWebKit(){var A=navigator.userAgent.match(/WebKit\\/(\\d*)/);return!!(A&&A[1]<536)}", "title": "" }, { "docid": "a7e3471b42f2279f974ab408ea1379dc", "score": "0.5466264", "text": "function _detect() {\n\n\t\tvar is_ie7 = false,\n\t\t\tis_ie8 = false,\n\t\t\tis_ie9 = false,\n\t\t\tmodernizr_detects_false = false\n\t\t;\n\n\t\tif ( $( 'html' ).hasClass( 'ie7' ) ) {\n\t\t\tis_ie7 = true;\n\t\t} else if ( $( 'html' ).hasClass( 'ie8' ) ) {\n\t\t\tis_ie8 = true;\n\t\t} else if ( $( 'html' ).hasClass( 'ie9' ) ) {\n\t\t\tis_ie9 = true;\n\t\t} else if (( typeof Modernizr !== 'undefined' ) && !Modernizr.input.placeholder) {\n\t\t\tmodernizr_detects_false = true;\n\t\t}\n\n\t\tif ( is_ie7 || is_ie8 || is_ie9 || modernizr_detects_false ) {\n\t\t\t_setup();\n\t\t}\n\n\t}", "title": "" }, { "docid": "e3854a4d31735c6b719e9c6d7672e888", "score": "0.5450649", "text": "function IsE10sCapable() {\n return InFF(\"38.0\");\n}", "title": "" }, { "docid": "616088ae71533bbb5ac7434abd031e0c", "score": "0.54482234", "text": "function Check_Version() {\n var rv = -1; // Return value assumes failure.\n\n if (navigator.appName == 'Microsoft Internet Explorer') {\n\n var ua = navigator.userAgent,\n re = new RegExp(\"MSIE ([0-9]{1,}[\\\\.0-9]{0,})\");\n\n if (re.exec(ua) !== null) {\n rv = parseFloat(RegExp.$1);\n }\n } else if (navigator.appName == \"Netscape\") {\n /// in IE 11 the navigator.appVersion says 'trident'\n /// in Edge the navigator.appVersion does not say trident\n if (navigator.appVersion.indexOf('Trident') === -1) rv = 12;\n else rv = 11;\n }\n\n return rv;\n }", "title": "" }, { "docid": "a2b23bccd2863fc3c96c8424a47d109b", "score": "0.5447762", "text": "function msieversion() {\r\n var ua = window.navigator.userAgent\r\n var net = ua.indexOf(\"NET \")\r\n\r\n if (net > 0 || !!navigator.userAgent.match(/Trident.*rv\\:11\\./)) {\r\n if (!Modernizr.objectfit) {\r\n console.log(net)\r\n jQuery(\".img_link\").each(function() {\r\n var $container = jQuery(this),\r\n imgUrl = $container.find(\"img\").prop(\"src\")\r\n if (imgUrl) {\r\n $container\r\n .css(\"backgroundImage\", \"url(\" + imgUrl + \")\")\r\n .addClass(\"compat-object-fit\")\r\n }\r\n })\r\n }\r\n }\r\n return false\r\n} // End", "title": "" }, { "docid": "3493da0896ff54d5be3ce608a9128ed1", "score": "0.5444055", "text": "function browserCheck() {\n if (window.File) {\n } else {\n //alert('The File APIs are not fully supported in this browser.');\n }\n\n if (Modernizr.localstorage) {\n } else {\n //alert('The Storage APIs are not fully supported in this browser.');\n }\n\n if (checkVersion() == false) {\n $(\"#BrowserCheck\").append(\"<p>Warning: The State Diagram Generator does not work properly with this version of Internet Explorer<p>\");\n $(\"#BrowserCheck\").append(\"<p>Note: The <a href=\\\"../Home/Download\\\"> Finite State Machine Source Code Generators</a> are *not* affected by these browsers imcompatibilities.<p>\");\n }\n}", "title": "" }, { "docid": "228f9a1c36ca189060818d99c5122508", "score": "0.54319364", "text": "function ApiBrowserCheck() {\r\n var UA = window.navigator.userAgent;\r\n if(UA.match(/(iPad)|(iPhone)|(iPod)|(android)|(webOS)/i)){\r\n\tgvar.isMobile= true;\r\n }else{\r\n\tif(/(Opera)[\\/\\s](\\d+\\.\\d+)/i.test(UA) && typeof(window.opera)!='undefined') {\r\n\t\tgvar.isOpera=true; gvar.infinite_scroll = false;\r\n\t}else if(/(Firefox)[\\/\\s](\\d+\\.\\d+)/i.test(UA)){\r\n\t\tgvar.isFF=true;\r\n\t}else if(/(Chrome)[\\/\\s](\\d+\\.\\d+)/i.test(UA)){\r\n\t\tgvar.isChrome=true;\r\n\t} \r\n } \r\n gvar.uaStr = RegExp.$1 + (!gvar.isMobile ? new Number( RegExp.$2 ) : '' );\r\n gvar.html5 = (history.pushState && history.replaceState);\r\n if (gvar.isChrome || gvar.isSafari || gvar.isOpera) {\r\n createHTMLDocumentByString = function(str) {\r\n if (document.documentElement.nodeName != 'HTML') {\r\n return new DOMParser().parseFromString(str, 'application/xhtml+xml')\r\n }\r\n // FIXME\r\n var html = str.replace(/<script(?:[ \\t\\r\\n][^>]*)?>[\\S\\s]*?<\\/script[ \\t\\r\\n]*>|<\\/?(?:i?frame|html|script|object)(?:[ \\t\\r\\n][^<>]*)?>/gi, ' ')\r\n var htmlDoc = document.implementation.createHTMLDocument ?\r\n document.implementation.createHTMLDocument('apfc') :\r\n document.implementation.createDocument(null, 'html', null)\r\n var range = document.createRange()\r\n range.selectNodeContents(document.documentElement)\r\n htmlDoc.documentElement.appendChild(range.createContextualFragment(html))\r\n return htmlDoc\r\n }\r\n }\r\n}", "title": "" }, { "docid": "99821e24acc56d3a1713ca79845f43e8", "score": "0.5421764", "text": "isIE() {\n let me = this.icn3dui\n //http://stackoverflow.com/questions/19999388/check-if-user-is-using-ie-with-jquery\n let ua = window.navigator.userAgent\n let msie = ua.indexOf('MSIE ')\n\n if (msie > 0 || !!window.navigator.userAgent.match(/Trident.*rv\\:11\\./))\n // If Internet Explorer\n return true\n // If another browser, return 0\n else return false\n }", "title": "" } ]
54d63afef17dbd29cf59dcc61a560992
The game has a leaderboard which is initialized with various names. During a game it will be necessary to update this leaderboard regularly. Create a function called `updateLeaderBoard` which accepts two parameters, the first is an array of player names, the first ten of which should be inserted into the leaderboard as list items. The second parameter `me` is an optional string that represents the current player's name. If any string in the array exactly matches the second parameter, then set its list item class to be `me`
[ { "docid": "fff2c59b53c1de471f546581658a6422", "score": "0.8108902", "text": "function updateLeaderBoard(playerNames, userName) {\n // Clear the current list\n while (window.top10.firstChild) {\n window.top10.removeChild(window.top10.firstChild);\n }\n\n if (playerNames.length > 0) {\n // Go through the list \n for (var i = 0; i < playerNames.length; i++) {\n if (i <= 9) {\n var li = document.createElement(\"li\");\n li.textContent = playerNames[i];\n\n if (playerNames[i] == userName) {\n li.className += \"me\";\n }\n\n window.top10.appendChild(li);\n }\n }\n }\n}", "title": "" } ]
[ { "docid": "4d5194a89a0abae12fa4ef8c2fc4098a", "score": "0.7009063", "text": "function updateLeaderboard()\n{\n\tlet leaderboard = Engine.GetGUIObjectByName(\"leaderboardBox\");\n\tlet boardList = Engine.GetBoardList().sort((a, b) => b.rating - a.rating);\n\n\tlet list = [];\n\tlet list_name = [];\n\tlet list_rank = [];\n\tlet list_rating = [];\n\n\tfor (let i in boardList)\n\t{\n\t\tlist_name.push(boardList[i].name);\n\t\tlist_rating.push(boardList[i].rating);\n\t\tlist_rank.push(+i + 1);\n\t\tlist.push(boardList[i].name);\n\t}\n\n\tleaderboard.list_name = list_name;\n\tleaderboard.list_rating = list_rating;\n\tleaderboard.list_rank = list_rank;\n\tleaderboard.list = list;\n\n\tif (leaderboard.selected >= leaderboard.list.length)\n\t\tleaderboard.selected = -1;\n}", "title": "" }, { "docid": "9364617dcbf10e43d4c5bbbba1d01cdf", "score": "0.6552712", "text": "function adaptLeaderboard() {\n LEADERBOARD_ARRAY = replaceInArrayGeneric(LEADERBOARD_ARRAY, 1, 3, POINTS, 0);\n setLeaderboard(false);\n}", "title": "" }, { "docid": "b3e4132360f325a9e539ba86c9b0ed1c", "score": "0.6542178", "text": "function Leaderboard() {}", "title": "" }, { "docid": "98756a65649a2edacf07928703c8dbf6", "score": "0.64883834", "text": "update_leaderboard(msg) {\n const max_scores = 5;\n\n // Create a new score, add it to the leaderboard, and reorder the scores\n const $new_score = $(`<li class='collapsed' data-score='${msg['score']}' data-name='${msg['name']}' />`).html(`${msg['name']}: ${msg['score']} points`);\n const $leaderboard = $('.realtime-queries .leaderboard');\n\n const delayed_expand = (_s) => {\n setTimeout(() => { $(_s).removeClass('collapsed')}, 100);\n };\n\n // If the leaderboard is empty, add the score as the first entry\n if( $leaderboard.is(':empty')) {\n $leaderboard.append($new_score);\n delayed_expand($new_score);\n }\n else {\n // Go through each score on the leaderboard to figure out where the new score fits\n $.each($leaderboard.children(), (i, _s) => {\n // Score and name of the current list item\n const curr = {\n score: parseInt($(_s).data('score')),\n name: $(_s).data('name')\n };\n\n /* If the new score is higher than the current score (or if the name\n comes before it alphabetically), time to add it to the list */\n if ((msg.score > curr.score) || (msg.score == curr.score && msg.name < curr.name)) {\n $(_s).before($new_score);\n delayed_expand($new_score);\n return false;\n }\n\n // If the leaderboard has room (but it's the lowest score), add it to the end\n const num_scores = $leaderboard.children().length;\n if ((num_scores < max_scores) && (i+1 == num_scores)) {\n $(_s).after($new_score);\n delayed_expand($new_score);\n return false;\n }\n });\n }\n\n // Trim the list if it's too long\n $.each($leaderboard.children().slice(max_scores), (_score) => $(_score).remove());\n }", "title": "" }, { "docid": "12cea2d56219008d2dfee0be5c901a9e", "score": "0.6433238", "text": "function updateLeaderboard() {\n // Get the highest score at the front of the array\n // http://www.w3schools.com/jsref/jsref_sort.asp\n if (Object.keys(scores).length > 1) {\n leaderboard.sort(function(a, b) {return (scores[b]-scores[a]);});\n var slicedLeaderboard = leaderboard.slice(0, 9);\n io.emit('leaderboardUpdate', slicedLeaderboard);\n }\n}", "title": "" }, { "docid": "5dda8c1beeb0246ca2a710d28688bbec", "score": "0.63117176", "text": "function displayLeaderBoard(playerInfo) {\n console.log('player info', playerInfo)\n if (playerInfo) {\n const newestUL = document.querySelector('.thisGuy')\n let newestLi = document.createElement('li')\n newestLi.innerText = playerInfo\n newestUL.appendChild(newestLi)\n }\n}", "title": "" }, { "docid": "d6815d5d49a3b4ec273ce5944e48c1c7", "score": "0.62584394", "text": "function leaderBoard() {\n removeFromLeaderBoard();\n addToLeaderBoard();\n scoreList.sort((a, b) => {\n return b.score - a.score;\n });\n //only render the top 4 scores.\n topTen = scoreList.slice(0, 10);\n\n for (var i = 0; i < topTen.length; i++) {\n var player = topTen[i].player;\n var score = topTen[i].score;\n\n var newDiv = document.createElement(\"div\");\n leaderBoardDiv.appendChild(newDiv);\n\n var newLabel = document.createElement(\"label\");\n newLabel.textContent = player + \" - \" + score;\n newDiv.appendChild(newLabel);\n }\n}", "title": "" }, { "docid": "d9be0f1e97dcec0cf74e73935cc8d7d8", "score": "0.6198671", "text": "function LeaderboardManager() {}", "title": "" }, { "docid": "dc301e0c16640677065af14c6811fa8c", "score": "0.61790997", "text": "function updatePlayerList(autoScroll = false)\n{\n\tlet playersBox = Engine.GetGUIObjectByName(\"playerList\");\n\tlet highlightedBuddy = Engine.ConfigDB_GetValue(\"user\", \"lobby.highlightbuddies\") == \"true\";\n\n\tlet buddyStatusList = [];\n\tlet playerList = [];\n\tlet presenceList = [];\n\tlet nickList = [];\n\tlet ratingList = [];\n\n\tg_PlayerList = Engine.GetPlayerList().map(player => {\n\t\tplayer.isBuddy = g_Buddies.indexOf(player.name) != -1;\n\t\treturn player;\n\t}).sort((a, b) => {\n\t\tlet status = obj => Object.keys(g_PlayerStatuses).indexOf(obj.presence); // + obj.name.toLowerCase();\n\n\t\tfor (let sort of g_PlayersSort)\n\t\t{\n\t\t\tlet ret = cmpObjs(a, b, sort.name, {\n\t\t\t\t\t'buddy': obj => (obj.name == g_Username ? 3 : obj.isBuddy ? 2 : 1),\n\t\t\t\t\t'rating': obj => +obj.rating,\n\t\t\t\t\t'status': obj => status(obj),\n\t\t\t\t\t'name': obj => obj.name.toLowerCase()\n\t\t\t\t}, sort.order);\n\n\t\t\tif (ret)\n\t\t\t\treturn ret\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t;\n\n\t\t\t// Keep user player on same sort data priored.\n\t\t\tif (a.name == g_Username)\n\t\t\t\treturn -sort.order;\n\t\t\tif (b.name == g_Username)\n\t\t\t\treturn +sort.order;\n\t\t}\n\t\treturn 0;\n\t});\n\n\t// Colorize list entries\n\tfor (let player of g_PlayerList)\n\t{\n\t\tif (player.rating && player.name == g_Username)\n\t\t\tg_UserRating = player.rating;\n\t\tlet rating = player.rating ? (\" \" + player.rating).substr(-5) : \" -\";\n\n\t\tlet presence = g_PlayerStatuses[player.presence] ? player.presence : \"unknown\";\n\t\tif (presence == \"unknown\")\n\t\t\twarn(\"Unknown presence:\" + player.presence);\n\n\t\tlet statusStyle = highlightedBuddy && player.name == g_Username ? g_UserStyle :\n\t\t\thighlightedBuddy && player.isBuddy ? g_PlayerStatuses[presence].buddyStyle :\n\t\t\tg_PlayerStatuses[presence].style;\n\n\t\tbuddyStatusList.push(player.name == g_Username ? setStringTags(g_UserSymbol, statusStyle) : player.isBuddy ? setStringTags(g_BuddySymbol, statusStyle) : \"\");\n\t\tplayerList.push(colorPlayerName((player.role == \"moderator\" ? g_ModeratorPrefix : \"\") + player.name));\n\t\tpresenceList.push(setStringTags(g_PlayerStatuses[presence].status, statusStyle));\n\t\tratingList.push(setStringTags(rating, statusStyle));\n\t\tnickList.push(player.name);\n\t}\n\n\tplayersBox.list_buddy = buddyStatusList;\n\tplayersBox.list_name = playerList;\n\tplayersBox.list_status = presenceList;\n\tplayersBox.list_rating = ratingList;\n\tplayersBox.list = nickList;\n\n\tplayersBox.auto_scroll = autoScroll;\n\tplayersBox.selected = playersBox.list.indexOf(g_SelectedPlayer);\n\tupdatePlayerGamesNumber();\n}", "title": "" }, { "docid": "5d141f4124020114058400290445a401", "score": "0.6170125", "text": "function addPlayersToLeaderboard(players) {\n\tif($('#view-leaderboard .player').length > 0) {\n\t\treturn;\n\t}\n\tfor(let pid in players) {\t\t\n\t\tlet frag = fragment($('#template-player').html());\n\t\t$(frag).find('.player').attr('data-player-id', pid).addClass(`player-${room.players[pid].number}-bg coloured`);\t\t\n\t\t$(frag).find('.player .name').text(room.players[pid].name);\n\t\t$(frag).find('.player .score').text(room.players[pid].score);\n\t\t$('#view-leaderboard .players').append(frag);\n\t}\t\n}", "title": "" }, { "docid": "97e29e0b957f2ec771ae2ad40eb493ef", "score": "0.60244066", "text": "function UIUpdateLobbyPlayers(players) {\n var uiPlayers = $(\"#lobby-players\");\n var uiPlayer = \"<li><div class='lobby-indicator circle { isReady }'></div><span>{ playerName }</span></li>\";\n var uiMe = \"<li id='lobby-player-me'><div class='lobby-indicator circle { isReady }'></div><span>{ playerName }</span><button id='ready-button' onclick='readyUp(this)'>READY</button></li>\";\n\n uiPlayers.empty();\n\n // Make sure the current player is at the top of the list\n players.sort(function(a, b) {\n if (a.id === player.id) {\n return -1;\n }\n if (b.id === player.id) {\n return 1;\n }\n return 0;\n });\n\n players.forEach(function(other) {\n var template;\n\n if (other.id === player.id) {\n template = uiMe;\n } else {\n template = uiPlayer;\n }\n\n li = template.replace(\"{ playerName }\", other.name)\n .replace(\"{ isReady }\", other.isReady ? \"indicator-ready\" : \"indicator-wait\");\n\n uiPlayers.append(li);\n });\n}", "title": "" }, { "docid": "44097cefe873742c9bb95752c8ab3afc", "score": "0.60068065", "text": "function updateScoreboard(newList) {\n for (i = 0; i < newList.length; i++) {\n scoreList.children[i].textContent = newList[i].name + \" \" + newList[i].score;\n }\n}", "title": "" }, { "docid": "4611757561d0b99c6dfb162d47ae782f", "score": "0.5995322", "text": "function showScoreboard(newName) {\n var newUser = {name: newName, score: score}\n // Get local scores\n scoreRanking = JSON.parse(localStorage.getItem(\"scores\"));\n // Compare scores\n if (!scoreRanking) {\n scoreRanking = [newUser]\n } else {\n compareScore(scoreRanking, newUser)\n }\n // Update scores\n console.log(scoreRanking);\n updateScoreboard(scoreRanking);\n // Update local data\n localStorage.setItem(\"scores\", JSON.stringify(scoreRanking));\n\n removeElement(initials);\n returnElement(scoreBoard);\n}", "title": "" }, { "docid": "4d5e752192d19d42ca37f5582b77e2fe", "score": "0.59630644", "text": "function updatePlayers(array, location){\n for(let i=0; i<array.length; i++) {\n let node = document.createElement(\"li\");\n let textnode = document.createTextNode(`${array[i].name}: ${array[i].score}`);\n node.appendChild(textnode);\n location.appendChild(node);\n }\n }", "title": "" }, { "docid": "5af164968550b230c5b165306295e75e", "score": "0.5931041", "text": "function updateLeaderboards() {\n document.getElementById(\"daniel-score\").innerHTML = danielRandom;\n document.getElementById(\"basmala-score\").innerHTML = basmalaRandom;\n document.getElementById(\"nifemi-score\").innerHTML = nifemiRandom;\n document.getElementById(\"katelyn-score\").innerHTML = katelynRandom;\n document.getElementById(\"saif-score\").innerHTML = saifRandom;\n document.getElementById(\"user-score\").innerHTML = \"<i>This could be you soon...</i>\";\n }", "title": "" }, { "docid": "e8addca91b0e2af27bbe925bf4a6e790", "score": "0.5800872", "text": "function updateChat() {\n\n [\"1\", \"2\"].forEach(playerNum => {\n var obj = window[\"player\" + playerNum + \"ChatObject\"];\n var chatText = obj.text;\n var listText = $(\"<li>\").attr(\"id\",playerNum);\n if(playerNum == obj.userId){\n listText.addClass(\"current-user\");\n }\n if(playerNum != obj.userId){\n listText.addClass(\"other-user\");\n }\n chatText = \"<strong>\"+obj.name +\": <strong>\" +chatText;\n listText.html(chatText);\n $(\"#chat-log\").append(listText);\n });\n\n // Scroll to bottom\n $(\"#chat-log\").scrollTop($(\"#chat-log\")[0].scrollHeight);\n}", "title": "" }, { "docid": "5f74cb922d1c77c54ea1f1f2f9a24909", "score": "0.5799029", "text": "function playerName() {\n // Names retrieved from http://listofrandomnames.com/\n // Remove duplicates via https://www.textfixer.com/tools/remove-duplicate-lines.php\n const firstNames = [\n 'Minh',\n 'Zachariah',\n 'Julio',\n 'Val',\n 'Darrin',\n 'Marcelino',\n 'Christian',\n 'Nathanael',\n 'Garfield',\n 'Lionel',\n 'Alonso',\n 'Vernon',\n 'Monroe',\n 'Norberto',\n 'Bruno',\n 'Hershel',\n 'Elvis',\n 'Bill',\n 'Claudio',\n 'Josh',\n 'Clarence',\n 'Emil',\n 'Calvin',\n 'Allan',\n 'Jacinto',\n 'Harrison',\n 'Gabriel',\n 'Gerry',\n 'Reid',\n 'Riley',\n 'Mauro',\n 'Sebastian',\n 'Billy',\n 'Bob',\n 'Donn',\n 'Terence',\n 'Otha',\n 'Henry',\n 'Everette',\n 'Elliot',\n 'Barney',\n 'Trenton',\n 'Rolando',\n 'Lacy',\n 'Samuel',\n 'Mohammed',\n 'Rupert',\n 'Davis',\n 'Rey',\n 'Lane',\n 'Bradford',\n 'Jarred',\n 'Harley',\n 'Carlton',\n 'Lawerence',\n 'Corey',\n 'Rick',\n 'Elvin',\n 'Moses',\n 'Larry',\n 'Claud',\n 'Palmer',\n 'Rolf',\n 'Willard',\n 'Ezra',\n 'Roscoe',\n 'Fritz',\n 'Ellsworth',\n 'Luigi',\n 'Buddy',\n 'Abraham',\n 'Rickie',\n 'Roosevelt',\n 'Dominic',\n 'Winston',\n 'Frederic',\n 'Francesco',\n 'Bobby',\n 'Everett',\n 'Hollis',\n 'Simon',\n 'Gregorio',\n 'Teodoro',\n 'Barrett',\n 'Hank',\n 'Lawrence',\n 'Adolph',\n 'Neville',\n 'Clay',\n 'Jarrett',\n 'Sol',\n 'Ariel',\n 'Pedro',\n 'Glenn',\n 'Lupe',\n 'Mckinley',\n 'Kenton',\n 'Rene',\n 'Mervin'\n ];\n\n const lastNames = [\n 'Wee',\n 'Lamp',\n 'Tichenor',\n 'Cronin',\n 'Linquist',\n 'Mackenzie',\n 'Sulton',\n 'Karim',\n 'Misner',\n 'Siegle',\n 'Herrick',\n 'Cifaldi',\n 'Copes',\n 'Lehmkuhl',\n 'Gridley',\n 'Drain',\n 'Ketelsen',\n 'Fullenkamp',\n 'Merrifield',\n 'Pittsley',\n 'Wall',\n 'Dinger',\n 'Gosse',\n 'Guidi',\n 'Calvo',\n 'Correira',\n 'Trim',\n 'Aubert',\n 'Difilippo',\n 'Peery',\n 'Nicodemus',\n 'Zirbel',\n 'Nickel',\n 'Gaulin',\n 'Mcmanus',\n 'Groth',\n 'Albus',\n 'Rippeon',\n 'Calender',\n 'Mansour',\n 'Peart',\n 'Chaplin',\n 'Bossert',\n 'Deville',\n 'Bautch',\n 'Doucette',\n 'Marr',\n 'Tesch',\n 'Cafferty',\n 'Burriss',\n 'Guidotti',\n 'Cousar',\n 'Cree',\n 'Penna',\n 'Hockett',\n 'Moores',\n 'Swart',\n 'Byerly',\n 'Gargano',\n 'Fontenot',\n 'Culwell',\n 'Cornejo',\n 'Hellyer',\n 'Rada',\n 'Giron',\n 'Oakley',\n 'Mariotti',\n 'Estes',\n 'Marker',\n 'Mattocks',\n 'Musick',\n 'Whitely',\n 'Dao',\n 'Varian',\n 'Koziel',\n 'Johanson',\n 'Mcphearson',\n 'Alaniz',\n 'Ganser',\n 'Zell',\n 'Mcnichol',\n 'Kirkpatrick',\n 'Mullaney',\n 'Hamill',\n 'Sproles',\n 'Haan',\n 'Girard',\n 'Toups',\n 'Donnell',\n 'Garrity',\n 'Brownson',\n 'Kellum',\n 'Cocklin',\n 'Custard',\n 'Degreenia',\n 'Goldsborough',\n 'Lubin',\n 'Gamache',\n 'Kinzer',\n 'Alaimo'\n ];\n\n return generateName([firstNames, lastNames]);\n}", "title": "" }, { "docid": "4a1cd5c3c5b0d40b2461775c2292fa18", "score": "0.57970446", "text": "function updateLeaderboard() {\n if (results.size == 0) {\n return;\n }\n\n // Sort all finished athlethes according time\n const resultSorted = new Map([...results.entries()].sort((a, b) => a[1] - b[1]));\n\n // Generate the result table and overwrite the old one.\n // Dirty, yep. But for this usecase, it is fine.\n var i = 1;\n var content = \"<table class=\\\"leaderboard-table\\\">\";\n for (let [key, value] of resultSorted) {\n content += `\n <tr>\n <td class=\"leaderboard-rank\">` + i + `.</td>\n <td class=\"leaderboard-name\">` + key + `</td>\n <td class=\"leaderboard-time\">` + timeToStr(value) + `</td>\n </tr>`;\n i++;\n }\n content += \"</table>\";\n $('#leaderboard').empty().append(content);\n}", "title": "" }, { "docid": "25704a910c82b6c767826863fd8b560b", "score": "0.5768038", "text": "function updateAvaliablePlayersList(players) {\n\n\tlet divPlayers = '';\n\tlet idx = $(\"#currentUser\").text().indexOf(\":\") + 1;\n\tlet curUser = $(\"#currentUser\").text().substr(idx).trim();\n\n\tplayers\n\t\t\t.forEach(function(playerName) {\n\t\t\t\tif (playerName !== curUser) {\n\n\t\t\t\t\tdivPlayers += '<div class=\"col-sm-1 col-xs-6 col-md-1\"><img src=\"http://placehold.it/64x64\" alt=\"Generic placeholder thumbnail\" class=\"thumbnail\"'\n\t\t\t\t\t\t\t+ 'style=\"margin-bottom: 0\"> <div class=\"col-md-1 col-xs-6 caption text-center\">'\n\t\t\t\t\t\t\t+ playerName + '<p>';\n\t\t\t\t\tif (!gameStarted) {\n\t\t\t\t\t\t//Player should not be possible to send other invitation if a game already started.\n\t\t\t\t\t\tdivPlayers += '<button class=\"btn btn-xs btn-primary btnInvite\" role=\"button\" onClick=\"sendInvitationToPlayer(&quot;'\n\t\t\t\t\t\t\t\t+ playerName + '&quot;)\"> Invite </button>';\n\t\t\t\t\t}\n\n\t\t\t\t\tdivPlayers += '</p></div></div>';\n\t\t\t\t}\n\n\t\t\t});\n\n\t$(\"#availablePlayers\").html(divPlayers);\n}", "title": "" }, { "docid": "199ce7447ed75903205182e9ee24d277", "score": "0.57675904", "text": "function loadLeaderboardLeader()\n{\n\tconnection.query(\"SELECT Name, Score, Mult from \" + table + \" ORDER BY Score DESC LIMIT 5\", function(err, rows, fields)\n\t{\n\t\tif (!err)\n\t\t{\n\t\t\tfor (var i = 0; i < rows.length; i++) {\n\t\t\t\tif (players[rows[i].Name] == undefined)\n\t\t\t\t{\n\t\t\t\t\tplayers[rows[i].Name] = {score: rows[i].Score, mult: rows[i].Mult};\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t\tconsole.log('Error while performing Query.');\n\t});\n}", "title": "" }, { "docid": "b4e28d1d5865532a863d67d63d9d2c61", "score": "0.574327", "text": "function updatePlayersPanelRanks() {\n\n // To start, reset the rankedPlayers array\n rankedPlayers = [];\n\n // Copy each player to the new array\n for (var p in players) {\n\trankedPlayers.push(players[p]);\n }\n\n // Sort the array by score, highest score first\n rankedPlayers.sort(function(b,a) {\n\t return a.score-b.score;\n\t});\n\n // Now update the players panel\n for (var i in rankedPlayers) {\n\t// After the first player, we check to see if there is a tie and adjust rank accordingly.\n\tif (i > 0 && players[rankedPlayers[i-1].num].score == players[rankedPlayers[i].num].score) {\n\t players[rankedPlayers[i].num].rank = players[rankedPlayers[i-1].num].rank;\n\t} else { // Either this is the first player, or there was not tie.\n\t players[rankedPlayers[i].num].rank = i;\n\t}\n\n\t// Now update the rank display in the panel\n\tdocument.getElementById('p'+players[rankedPlayers[i].num].num+'PanelRank').innerHTML = parseInt(players[rankedPlayers[i].num].rank)+1;\n }\n\n}", "title": "" }, { "docid": "bc87003b98606ee0a838700b55449668", "score": "0.57349753", "text": "function organizeLeaderBoards() {\n //clear interval just incase view highscore button is pressed during quiz\n clearInterval(interval);\n //reset the rankings\n leaderBoardsEl.innerHTML = \"\";\n\n leaderBoards = JSON.parse(localStorage.getItem(\"leaderBoards\"));\n \n //add new elements to the html\n if (leaderBoards === null) {\n leaderBoards =[];\n return;\n } else {\n for (var i = 0; i < leaderBoards.length; i++) {\n var newLi = document.createElement(\"li\");\n newLi.textContent = leaderBoards[i];\n leaderBoardsEl.appendChild(newLi);\n }\n }\n}", "title": "" }, { "docid": "50be0e6294fa67e0434003b21edcee6d", "score": "0.5718963", "text": "async updateScoreboard() {\n const res = await fetch('/api/scores');\n const resJson = res.json();\n resJson.then(result => {\n let i;\n let scores = [];\n for (i = 0; i < result.length; i++) {\n scores[i] = [result[i].name, result[i].score];\n }\n this.setState({ playerList: scores });\n });\n }", "title": "" }, { "docid": "8ed1d30027e322433b8c15b9698691b1", "score": "0.5713707", "text": "function addNewScoreToLeaderboard(leaderboardData, newName, newScore) {\n\tif (!leaderboardData) {\n\t\tleaderboardData = [[newName,newScore]];\n\t\treturn leaderboardData;\n\t}\n\t//verify data is good, no blanks, delete leading/trailing whitespace\n\tfor (var i = 0; i < leaderboardData.length; i++) {\n\t\tif (leaderboardData[i][0] && leaderboardData[i][1]) {\n\t\t\tleaderboardData[i][0] = leaderboardData[i][0].trim();\n\t\t\tleaderboardData[i][1] = Number(leaderboardData[i][1].trim());\n\t\t} else {\n\t\t\t//shift array up one, overwriting current index (bad/missing data, should never happen)\n\t\t}\n\t}\n\n\t//add new name/value onto the end of the array\n\tleaderboardData[leaderboardData.length] = [];\n\tleaderboardData[leaderboardData.length - 1][0] = newName;\n\tleaderboardData[leaderboardData.length - 1][1] = newScore;\n\n\t//sort names/values into decreasing order (first cell has highest value)\n\tvar valuesOrdered = false;\n\n\t//used for unnecessary optimization of sorting algorithm\n\tvar iterationDepth = leaderboardData.length - 1;\n\n\tvar minScore = newScore;\n\tvar maxScore = newScore;\n\twhile (!valuesOrdered) {\n\t\tvaluesOrdered = true;\n\t\tfor (var i = 0; i < iterationDepth; i++) {\n\t\t\tminScore = Math.min(minScore, leaderboardData[i][1]);\n\t\t\tmaxScore = Math.max(maxScore, leaderboardData[i][1]);\n\t\t\tif (leaderboardData[i][1] < leaderboardData[i+1][1]) {\n\t\t\t\tvaluesOrdered = false;\n\t\t\t\t//swap values and names\n\t\t\t\tvar tempStoreName = leaderboardData[i][0];\n\t\t\t\tvar tempStoreValue = leaderboardData[i][1];\n\n\t\t\t\tleaderboardData[i][0] = leaderboardData[i+1][0];\n\t\t\t\tleaderboardData[i][1] = leaderboardData[i+1][1];\n\n\t\t\t\tleaderboardData[i+1][0] = tempStoreName;\n\t\t\t\tleaderboardData[i+1][1] = tempStoreValue;\n\t\t\t}\n\t\t}\n\t\titerationDepth--;\n\t}\n\n\tvar currentRunLeaderboardRank = getParseRank(newScore, leaderboardData);\n\n\n\n\tdisplayCurrentRunParse(currentRunLeaderboardRank);\n\treturn leaderboardData;\n}", "title": "" }, { "docid": "c26fe535556896c96e4a565c0270a07f", "score": "0.56913227", "text": "updateScores()\n {\n let winners = this.getWinners()\n for (var p=0; p<this.players.length; p++)\n {\n let player = this.players[p]\n if (winners[player.name]) player.incrementScore()\n }\n }", "title": "" }, { "docid": "7f1f53649635b274654ba3fc0add54d0", "score": "0.5677205", "text": "function showLeader() {\n // Hide All Container Divs\n formDiv.classList.add(\"hide\");\n questionDiv.classList.add(\"hide\");\n welcomeDiv.classList.add(\"hide\");\n\n // Un-hide leader board modal container\n highScoreModal.classList.remove(\"hide\");\n\n // Clear the users and scores from <ul id='highscores'>\n leaderboard.innerHTML = \"\";\n\n let highScoreBoard = localStorage.getItem('userScores');\n let parsedScoreBoard = JSON.parse(highScoreBoard);\n\n // Display high scores\n for (let i = 0; i < parsedScoreBoard.length; i++) {\n let newScore = document.createElement(\"li\");\n newScore.textContent = parsedScoreBoard[i].username + \" : \" + parsedScoreBoard[i].score;\n newScore.classList.add(\"score-item\");\n leaderboard.appendChild(newScore);\n }\n}", "title": "" }, { "docid": "fa0458e11e83fc5ae13f03d9b065690e", "score": "0.5669809", "text": "function populateLeaderboard() {\r\n const parameters = ADL.XAPIWrapper.searchParams();\r\n parameters[\"verb\"] = \"http://adlnet.gov/expapi/verbs/passed\";\r\n parameters[\"activity\"] = \"http://example.com/xapi-sample-quiz\";\r\n const queryData = ADL.XAPIWrapper.getStatements(parameters);\r\n\r\n//\r\n let statements = queryData.statements;\r\n statements.sort(function(a, b) {\r\n return b.result.score.raw-a.result.score.raw;\r\n })\r\n\r\n//\r\n for (let i = 0; i < statements.length; i++) {\r\n statements[i].result.score.raw = statements[i].result.score.raw * 100;\r\n }\r\n\r\n const player = GetPlayer();\r\n\r\n //Sets the names of the top 5 of the leaderboard\r\n player.SetVar(\"firstUser\", statements[0].actor.name);\r\n player.SetVar(\"secondUser\", statements[1].actor.name);\r\n player.SetVar(\"thirdUser\", statements[2].actor.name);\r\n player.SetVar(\"fourthUser\", statements[3].actor.name);\r\n player.SetVar(\"fifthUser\", statements[4].actor.name);\r\n\r\n //Sets the score of the top 5 of the leaderboard\r\n player.SetVar(\"firstScore\", statements[0].result.score.raw);\r\n player.SetVar(\"secondScore\", statements[1].result.score.raw);\r\n player.SetVar(\"thirdScore\", statements[2].result.score.raw);\r\n player.SetVar(\"fourthScore\", statements[3].result.score.raw);\r\n player.SetVar(\"fifthScore\", statements[4].result.score.raw);\r\n\r\n //Sets the avatar choice of the top 5 of the leaderboard\r\n player.SetVar(\"firstAvatar\", statements[0].result.response);\r\n player.SetVar(\"secondAvatar\", statements[1].result.response);\r\n player.SetVar(\"thirdAvatar\", statements[2].result.response);\r\n player.SetVar(\"fourthAvatar\", statements[3].result.response);\r\n player.SetVar(\"fifthAvatar\", statements[4].result.response);\r\n\r\n}", "title": "" }, { "docid": "7208a758b23510b31123e678df0c0bc6", "score": "0.5667378", "text": "function displayLeaders(player) {\n $('#leader_' + player.playerID).html(player.playerName + \" has \" + player.playerNumWins + \" wins\");\n}", "title": "" }, { "docid": "cd609159848852f1f1c19bc4a16144f4", "score": "0.565771", "text": "function drawleaderBoard() {\r\n\r\n //variables that hold scores\r\n let scores = getScores();\r\n\r\n let newScores = scores.slice(0, 10);\r\n\r\n //loops scores and displays username and scores in the browser\r\n let table = \"\";\r\n for (let i = 0; i < newScores.length; i++) {\r\n table += \"<tr><td>\" + [i + 1] + \"</td><td>\" + newScores[i].name + \" </td><td>\" + newScores[i].score + \"</td></tr>\";\r\n }\r\n\r\n return scoreList.innerHTML = table;\r\n}", "title": "" }, { "docid": "02545e7eaba69454bd012f2d58cc6b8b", "score": "0.56338024", "text": "function updatePlayerListView (playerArray) {\n\n\t// First reorder the player array so current user is at the top, without modifying the turn order\n\tlet clientIndex = getPlayerIndexById(socket.id, playerArray);\n\tlet playersTopSegment = playerArray.slice(clientIndex);\n\tlet playersBottomSegment = playerArray.slice(0, clientIndex);\n\tlet reorderedPlayers = playersTopSegment.concat(playersBottomSegment);\n\n\t// Delete the contents of playerListView each time\n\twhile (playerListView.firstChild) {\n \tplayerListView.removeChild(playerListView.firstChild);\n\t}\n\n\t// Append player names to playerListView\n\treorderedPlayers.forEach(function(player){\t\t\n\t\t// Create an <li> node with player's name and avatar\n\t\tlet playerElement = document.createElement('li');\n\t\tplayerElement.id = player.id;\t\t\n\n\t\t// Display user's GitHub avatar image\n\t\tlet userAvatarElem = document.createElement('img');\n\t \tuserAvatarElem.src = player.avatar_url;\n \t\tuserAvatarElem.classList.add('avatar');\n\n\t\t// If this player is the current player, highlight their name\n\t\tif (player.id === getCurrentPlayer().id) {\n\t\t\tplayerElement.classList.add('highlight');\n\t\t}\n\n\t\t// Append player <li> to playerListView <ol>\n\t\tplayerListView.appendChild(playerElement);\n\n\t\t// Append image and text node to player <li>\n \t\tplayerElement.appendChild(userAvatarElem);\n \t\tplayerElement.appendChild(document.createTextNode(player.login));\n\t});\n}", "title": "" }, { "docid": "6f5443441dce5dcc257e3c03e053f599", "score": "0.5624644", "text": "function updatePlayerListView (playerArray) {\t\n\t// Delete the contents of playerListView each time\n\twhile (playerListView.firstChild) {\n \tplayerListView.removeChild(playerListView.firstChild);\n\t}\n\n\t// Put li#me back into playerListView! (using previously saved reference)\n\tplayerListView.appendChild(myNameListItemView);\n\n\t// Append player names to playerListView\n\tplayerArray.forEach(function(player){\n\t\t\n\t\t// Create an <li> node with player's name\n\t\tvar playerElement = document.createElement('li');\n\t\tplayerElement.id = player.id;\n\t\tplayerElement.textContent = player.name;\n\n\t\t// If this player is the current player, highlight their name\n\t\tif (player.id === currentPlayerId) {\n\t\t\tplayerElement.classList.add('highlight');\n\t\t}\n\n\t\t// Append to playerListView <ol>\n\t\tplayerListView.appendChild(playerElement);\n\n\t});\n}", "title": "" }, { "docid": "ec6b2f67ed33e745ed9d04e384e2b355", "score": "0.55925095", "text": "function addPlayer(rank, name, wmp, acc){\n\n var table = document.getElementById(\"leaderboard\");\n\n // Create an empty <tr> element and add it to the correct position of the table:\n var row = table.insertRow(rank); // Row 0 is the header row\n\n // Insert new cells (<td> elements) in the \"new\" <tr> element:\n var cell1 = row.insertCell(0);\n var cell2 = row.insertCell(1);\n var cell3 = row.insertCell(2);\n var cell4 = row.insertCell(3);\n\n // Add some text to the new cells:\n cell1.innerHTML = rank;\n cell2.innerHTML = name;\n cell3.innerHTML = wmp;\n cell4.innerHTML = acc;\n\n // Update Rankings for all entries after added entry\n updateRankings(table, rank);\n }", "title": "" }, { "docid": "e5c3bb2dd1b7aa5e75a3b90085729bc2", "score": "0.5576319", "text": "function updatePlayers() {\n fetchTeams(function (teams) {\n var teamPlayerMapping = {};\n teams.forEach(function(team) {\n teamPlayerMapping[team['abbreviation']] = team['id'];\n })\n convertPlayers(teamPlayerMapping);\n })\n}", "title": "" }, { "docid": "130e6e6fb84c783067f94b8e512e6e32", "score": "0.55497444", "text": "handleSetLeader(name) {\n if (name.toLowerCase() === this.username.toLowerCase()) {\n this.isLeader = true;\n loopThroughWaiting(this, 'settime');\n } else {\n this.isLeader = false;\n }\n }", "title": "" }, { "docid": "7d3974ce1d0a05644c1547a2ec0598bb", "score": "0.5539783", "text": "function updateLeaderBoard(boardId) {\n var $board = $(\"#\"+boardId);\n\n // Find the top score\n var topScore = 0;\n $board.find(\".progress\").each(function(idx, el){\n var thisScore = parseInt( $(this).attr(\"data-score\") );\n if (thisScore > topScore) { topScore = thisScore; }\n });\n //console.log(\"Top score on the board: \"+topScore);\n\n // Set the team/athlete total widths according to their point totals:\n $board.find(\".progress\").each(function(idx, el){\n var thisScore = parseInt( $(this).attr(\"data-score\") );\n $(this).css(\"width\", parseInt(thisScore / topScore * 100)+\"%\" );\n });\n //console.log(\"Team total widths set.\");\n\n // Set the medal widths by score percentage:\n $board.find(\".progress .bar\").each(function(idx, el){\n var $medalBar = $(this);\n var $totalBar = $medalBar.parent();\n // var totalCount = parseInt( $totalBar.attr(\"data-count\") );\n // var thisCount = parseInt( $medalBar.attr(\"data-count\") );\n // $medalBar.css(\"width\", parseInt(thisCount / totalCount * 100)+\"%\");\n var totalScore = parseInt( $totalBar.attr(\"data-score\") );\n var thisScore = parseInt( $medalBar.attr(\"data-score\") );\n var thisPct = parseInt(thisScore / totalScore * 100);\n $medalBar.css(\"width\", thisPct+\"%\");\n\n var $lastNonZeroBar = $totalBar.find(\".bar[data-score!=0]\").last();\n if (thisScore > 0 && $medalBar.is($lastNonZeroBar))\n $medalBar.css({\"width\":\"100%\", \"float\":\"none\"});\n });\n\n}", "title": "" }, { "docid": "c0952e730ef1fa67e25aee563ce6daff", "score": "0.55275863", "text": "function nameChange(data) {\n\t\ttheBoard[data.id].username = data.username;\n\t\tupdateBoard();\n\t}", "title": "" }, { "docid": "1342be1385a465a3b1be99d1af13dd84", "score": "0.5504996", "text": "function getPlayerNames(playerCount) {\n for(let i=0; i<playerCount; i++) {\n let name = (prompt(`Player ${i + 1} enter your name.`));\n let upper = name.charAt(0).toUpperCase();\n let end = name.substr(1);\n playerList[i].name = upper + end;\n };\n}", "title": "" }, { "docid": "6a5175c87b94033c6bac4e747acb2c9f", "score": "0.5482291", "text": "function execNamePlayers() {\n numPlayers = parseInt(l.gid('numPlayers').value);\n playerNumbers.className = 'invis';\n playerNames.className = 'visible';\n var playNames = l.gid(\"nameInputs\");\n for (var i = 0; i < numPlayers; i++) {\n playNames.appendChild(l.newInput('player' + i.toString(), 'playerNames'));\n }\n}", "title": "" }, { "docid": "d4d46f7fa4cd81a2bf483c294bd9555d", "score": "0.54637814", "text": "function lobbyUpdatePlayer(pData)\n\t{\n\t\tconsole.log(\"Updating player: \" + pData.guid);\n\t\t//console.log(pData);\n\n\t\tvar playerBox = $('.gamertag-box.player-' + pData.guid);\n\t\t// If the scorebox already exists\n\t\tif(playerBox.length > 0)\n\t\t{\n\t\t\t// Change the isMine status\n\t\t\tif(pData.IsMine)\n\t\t\t\t$(playerBox).addClass('me');\n\t\t\telse\n\t\t\t\t$(playerBox).removeClass('me');\n\n\t\t\tupdateUserColor(pData);\n\t\t\tupdateUserGamertag(pData);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tlobbyAddPlayer(pData);\n\t\t}\n\n\n\t}", "title": "" }, { "docid": "dfd47a5b122f3395528a538dbaa7bf3b", "score": "0.5457408", "text": "function setPlayers(players) {\r\n var playerArea = document.getElementById(\"players\");\r\n while (playerArea.firstChild) {\r\n playerArea.removeChild(playerArea.firstChild);\r\n }\r\n players.forEach(player => {\r\n var newPlayer = document.createElement('div');\r\n newPlayer.className = \"player-info\";\r\n if (player.name == playerName) {\r\n newPlayer.style.background = \"#f78ddE\";\r\n newPlayer.style.borderColor = \"#df35b7\";\r\n }\r\n \r\n var nam = document.createElement('div');\r\n nam.className = \"player-info-name\";\r\n nam.innerHTML = player.name\r\n \r\n var wordList = document.createElement('div');\r\n wordList.className = \"words-container\";\r\n console.log(player.words);\r\n player.words.forEach(word =>{\r\n wordList.innerHTML += \"<p>\" + word + \"</p>\";\r\n });\r\n \r\n newPlayer.appendChild(nam);\r\n newPlayer.appendChild(wordList);\r\n playerArea.appendChild(newPlayer);\r\n });\r\n}", "title": "" }, { "docid": "90d1eef5d03a5c62322f27664ddcb5ac", "score": "0.54430526", "text": "function updatePlayers(){\n if(playernames.length == 1){\n var name_1 = document.getElementById('speler_1');\n name_1.innerText = playernames[0];\n }\n if(playernames.length == 2){\n var name_1 = document.getElementById('speler_1');\n name_1.innerText = playernames[0];\n var name_2 = document.getElementById('speler_2');\n name_2.innerText = playernames[1];\n }\n if(playernames.length == 3){\n var name_1 = document.getElementById('speler_1');\n name_1.innerText = playernames[0];\n var name_2 = document.getElementById('speler_2');\n name_2.innerText = playernames[1];\n var name_3 = document.getElementById('speler_3');\n name_3.innerText = playernames[2];\n }\n if(playernames.length == 4){\n var name_1 = document.getElementById('speler_1');\n name_1.innerText = playernames[0];\n var name_2 = document.getElementById('speler_2');\n name_2.innerText = playernames[1];\n var name_3 = document.getElementById('speler_3');\n name_3.innerText = playernames[2];\n var name_4 = document.getElementById('speler_4');\n name_4.innerText = playernames[3];\n }\n else{\n return;\n }\n}", "title": "" }, { "docid": "c423e208b535b37d0591e87beb77a957", "score": "0.54427946", "text": "function updatePlayerUI()\r\n{\r\n\tlet htmlStrings = [];\r\n\tlet rotate = 0;\r\n\tfor (let i = 0; i < players.length; i++) {\r\n\t\tif (players[i].id !== myId) {\r\n\t\t\thtmlStrings.push(`<div class='otherPlayer player'>\r\n\t\t\t\t<span class='name'>${players[i].name}</span><br><br>\r\n\t\t\t\t<div class='playingField player-${i}'></div>\r\n\t\t\t</div>`);\r\n\t\t}\r\n\t\telse {\r\n\t\t\trotate = i;\r\n\t\t}\r\n\t}\r\n\thtmlStrings = htmlStrings.concat(htmlStrings);\r\n\tlet htmlString = '';\r\n\tfor (let i = 0; i < players.length - 1; i++) {\r\n\t\thtmlString += htmlStrings[i + rotate];\r\n\t}\r\n\t$('.otherPlayers').html(htmlString);\r\n\tvar playerList = '<b>Players: </b>';\r\n\tvar i = 0;\r\n\twhile (i < players.length)\r\n\t{\r\n\t\tif (players[i] != null)\r\n\t\t{\r\n\t\t\tplayerList += '<br>' + players[i].name + ' 打 ' + players[i].score;\r\n\r\n\t\t}\r\n\t\ti++;\r\n\t}\r\n\t$('.scoreboard').html(playerList);\r\n}", "title": "" }, { "docid": "f586ed974071bbd16eaeebd1904c639c", "score": "0.5438562", "text": "function replaceNameList(playerQueue){\n $(\"#name-list\").empty();\n for (var i = 0; i < playerQueue.length; i++){\n player = playerQueue[i];\n //<p id=\"name-53263\">DeliciousMango</p>\n var line = `${player.nickname} (${player.id})`;\n var id = `name-${player.id}`\n line = `<li id=\"${id}\">${line}</li>`;\n $(\"#name-list\").append(line);\n }\n}", "title": "" }, { "docid": "b469c65012264ef520a883d4c37836d9", "score": "0.5433361", "text": "function generateHighScores(){\n var highscores = JSON.parse(localStorage.getItem(\"savedhighScores\")) || [];\n var leaderBoard = document.getElementById('leader-board');\n for (i=0; i<highscores.length; i++) {\n var players = document.createElement(\"li\");\n players.style.listStyle = \"none\";\n players.style.margin = \"1em\";\n players.textContent = `${highscores[i].name} ${highscores[i].score}`;\n leaderBoard.appendChild(players);\n }\n}", "title": "" }, { "docid": "de9e8294249c1f3a2bf52257761006be", "score": "0.54230636", "text": "updatePlayerScore(game) {\n game.players.map((player, index) => {\n $(`.player-${index + 1}__current-points`).text(`${player.roundCaps}`);\n $(`.player-${index + 1}__total-points`).text(`${player.totalCaps}`);\n })\n }", "title": "" }, { "docid": "8f65c6b9a8404bfad052b32f5a1facd3", "score": "0.5417985", "text": "onPlayerOnlineListCommand(context) {\n let players = [];\n let formattedPlayers = [];\n\n // (1) Establish the list of players to consider for the output. NPCs are ignored, and the\n // levels of undercover people are hidden as well.\n server.playerManager.forEach(player => {\n if (player.isNonPlayerCharacter())\n return;\n \n const name = player.name;\n const registered = player.account.isRegistered();\n const vip = player.isVip();\n const minimized = isPlayerMinimized(player.id);\n const temporary = player.isTemporaryAdministrator();\n const level = player.isUndercover() ? Player.LEVEL_PLAYER\n : player.level;\n\n players.push({ name, registered, vip, temporary, level, minimized });\n });\n\n // (2) Sort the list of |players| alphabetically for display. \n players.sort((lhs, rhs) => lhs.name.localeCompare(rhs.name));\n \n // (3) Format each of the entries in |players| in accordance with the information we've\n // gathered on them.\n for (const info of players) {\n let prefix = info.minimized ? '\u001d' : '';\n let color = '';\n\n if (!info.registered) {\n color = '\u000314'; // dark grey\n } else {\n switch (info.level) {\n case Player.LEVEL_PLAYER:\n if (info.vip)\n color = '\u000312'; // dark blue\n\n break;\n\n case Player.LEVEL_ADMINISTRATOR:\n color = info.temporary ? '\u000310' // blue-greyish\n : '\u000304'; // red\n break;\n\n case Player.LEVEL_MANAGEMENT:\n color = '\u000303'; // dark green\n break;\n }\n }\n\n formattedPlayers.push(\n prefix + color + info.name + (color ? '\u0003' : '') + (info.minimized ? '\u001d' : ''));\n }\n\n // (4) Output the formatted result to the requester on IRC.\n if (!formattedPlayers.length)\n context.respond('\u00037There are currently no players online.');\n else\n context.respond(`\u00037Online players\u0003 (${players.length}): ` + formattedPlayers.join(', '));\n }", "title": "" }, { "docid": "69682a55369ce59645aa48bc90412ee7", "score": "0.54170144", "text": "function addScore(name, time) {\n var score = new NewScore(name, time); // create instince of object\n leaderboard.unshift(score);\n playerScore.insertAdjacentHTML(\"afterend\", `<div>${leaderboard[0].name} ${leaderboard[0].time}</div>`);\n // after push use Number(array.time).sort() to order array based on time\n}", "title": "" }, { "docid": "9083aefed1b13d0a34b340ceda5e9f5f", "score": "0.5408176", "text": "function loadLeaderboardsAndAchievements() {\n var maxLevelsScores = 5;\n var allScores = [];\n var scoresNb = 0;\n document.querySelector('#scoresListDiv').innerHTML = '';\n document.querySelector('#scoresListDiv').style.display = 'block';\n for (var lb in leaderboardIDs) {\n // Create the request\n if (lb > 0 && lb <= maxLevelsScores) {\n gapi.client.request({\n path: '/games/v1/players/me/leaderboards/' + leaderboardIDs[lb].id + '/scores/public',\n params: { maxResults: 1, timeSpan: \"ALL_TIME\", includeRankType: 'ALL' },\n callback: function(response) {\n scoresNb++;\n console.log('Get scores', response);\n if (response && response.hasOwnProperty('error')) {\n console.log(\"error while posting global scores \" + response.error.code);\n } else {\n allScores.push(response.items[0]);\n if (scoresNb == maxLevelsScores) {\n var root = document.getElementById('scoresListDiv');\n leaderboards.createScoresList(root, allScores);\n }\n }\n }\n });\n }\n }\n // var root = document.getElementById('scoresListDiv');\n // leaderboards.createScoresList(root, allScores);\n}", "title": "" }, { "docid": "00ffd4d9f788ca84e27c356f7b1a06e3", "score": "0.54052377", "text": "function update_users(){\n\tuserList.style.display = \"none\";\n\tuserList.innerHTML = \"\";\n\tvar tr = document.createElement(\"tr\");\n\tvar th = document.createElement(\"th\");\n\ttr.appendChild(th);\n\tth = document.createElement(\"th\");\n\tth.innerHTML = \"Matches\";\n\ttr.appendChild(th);\n\tuserList.appendChild(tr);\n\n\tfor(var i = 0; i < game.turnOrder.length; i++){\n\t\tvar id = game.turnOrder[i];\n\t\tif(!game.get_user(id))\n\t\t\tcontinue;\n\n\t\ttr = document.createElement(\"tr\");\n\n\t\tvar name_td = document.createElement(\"td\");\n\t\tname_td.className = \"name\";\n\t\t$(name_td).text(game.get_user_data(id, \"name\"));\n\t\tvar img = game.get_user_data(id, \"icon\");\n\t\tvar color = \"255,255,255\";\n\t\tif(game.currentTurn === i){\n\t\t\ttr.className = \"current\";\n\t\t\tcolor = \"255,153,0\";\n\t\t}else if(id === game.channel.get_public_client_id()){\n\t\t\ttr.className = \"me\";\n\t\t\tcolor = \"181,211,255\";\n\t\t}\n\t\tvar gradient = \"linear-gradient(to right, rgba(\" + color + \",0) 0%,rgba(\" + color + \",1) 100%)\";\n\t\t$(name_td).css(\"background\", gradient + \" repeat-y, url(\" + img + \") no-repeat\");\n\t\ttr.appendChild(name_td);\n\n\t\tvar score_td = document.createElement(\"td\");\n\t\t$(score_td).text(game.get_user_data(id, \"score\"));\n\t\ttr.appendChild(score_td);\n\n\t\tuserList.appendChild(tr);\n\t}\n\tuserList.style.display = \"table\";\n}", "title": "" }, { "docid": "62d8e00de548746ef8ee0deafce0bd62", "score": "0.54050916", "text": "updateScores() {\n\t\tlet index = this.configuration.scores.findIndex(\n\t\t\t(score) => score.currentPlayer === true);\n\t\tif (index !== -1) {\n\t\t\tthis.configuration.scores[index].currentPlayer = false;\n\t\t}\n\t\t/**\n\t\t * Pushes any new scores to the leaderboard\n\t\t */\n\t\tthis.configuration.scores.push({\n\t\t\tplayerName: this.configuration.playerName,\n\t\t\tflips: this.totalTurns,\n\t\t\ttotalTime: this.totalTime - this.timeLeft,\n\t\t\tcurrentPlayer: true,\n\t\t});\n\t\t/**\n\t\t * Arranges the scores on the leaderboard from high to low\n\t\t */\n\t\tthis.configuration.scores.sort((a, b) => {\n\t\t\tif (a.flips < b.flips) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif (a.flips > b.flips) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\tif (a.totalTime < b.totalTime) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif (a.totalTime > b.totalTime) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\treturn 0;\n\t\t});\n\t\t/**\n\t\t * Removes the last player from the leaderboard if there are more than 10 scores, it will arrange the scores into the top 10.\n\t\t */\n\t\tif (this.configuration.scores.length > maxTopScores) {\n\t\t\tthis.configuration.scores.pop();\n\t\t}\n\t\tlocalStorage.setItem(gameId, JSON.stringify(this.configuration));\n\t}", "title": "" }, { "docid": "38f02b5d421a709eaa9984a7ab4766f9", "score": "0.53943956", "text": "function LeaderboardTable(LB, snapshot, links, opts, selected_players, name_format, diagnose) {\n/*\n\tLB is specific to one game and is a data structure that contains one board\n\tper snapshot, and each board is a list of players.\n\n\t\tIn LB:\n\t\tFirst tier (game_wrapper) has just five values:\n\t\t\tGame PK,\n\t\t\tGame BGGid,\n\t\t\tGame name,\n\t\t\tGame play count,\n\t\t\tGame session count,\n\t\t\tSnap (true if next entry is snapshots, false if next entry is leaderboard)\n\t\t\tHas_Reference (true if a reference snapshot is included - outside of the compare_back_to window)\n\t\t\tHas_Baseline (true if a baseline snapshot is included - outside of any query, provided only for delta calculation)\n\t\t\tLeaderboard (being a ranked list of players + data) or Snapshots (being a list of snapshots)\n\n\t\tNote: \tReference snapshots are outside of the query and provided if possible for display as the leaderboard\n\t\t\t\tbefore the first in-query snapshot. That is, the rankings beforfe the first game session in the query\n\t\t\t\twas played. Baseline snapshots are provided so that reference snapshots can show their delta columns.\n\t\t\t\tA set of snaps can have none, one or both. It cannot have a baseline without a refernece.\n\n\t\tOptional Second tier (session wrapper) contains the snapshots which is a list of five-value tuples containing:\n\t\t\tSession PK\n\t\t\tDate time string,\n\t\t\tcount of plays,\n\t\t\tcount of sessions,\n\t\t\tsession details\n\t\t\tsession anaysis pre-play\n\t\t\tsession anaysis post-play\n\t\t\tLeaderboard (being a ranked list of players + data)\n\t\t\tA diagnostic leaderboard if needed\n\n\t\tNote: session details, session anaysis pre-play, session anaysis post-play are all 2-tuples\n\t\t\t with the first element an HTML template and the second a list of data tuples one entry\n\t\t\t for each row on the list of the analysis (which lists rankers, i.e. players, or teams.\n\t\t\t These templates include encoded player names, links, and annotations that all need\n\t\t\t substituting with data selected from the data list while rendering.\n\n\t\tSecond or Third tier (player list) is the Leaderboard which is a list of tuples which have six values:\n\t\t\tPlayer PK,\n\t\t\tPlayer BGGid,\n\t\t\tPlayer name,\n\t\t\tTrueskill rating,\n\t\t\tPlay count,\n\t\t\tVictory count\n\n\tsnapshot: \t\t an integer, index into the list of Snapshots (being which snapshot to render)\n\tlinks:\t \t\t a string, either \"BGG\" or \"CoGs\" which selects what kind of links to use\n\topts: \t \t\t a list of flags (true/false) requesting specific rendering features\n\tselected_players: a list of players to highled if the highlight_selected option is on.\n\tname_format:\t a string, either \"nick\", \"full\" or \"complete\"\n*/\n\tif (diagnose == undefined) diagnose = false;\n\n\t// Column Indices in LB (game wrapper):\n\tconst iPKgame = 0;\n\tconst iBGGid = 1;\n\tconst iGameName = 2;\n\tconst iTotalPlays = 3;\n\tconst iTotalSessions = 4;\n\tconst iSnaps = 5;\n\tconst iReference = 6; // a reference snapshot is included - outside of the compare_back_to window\n\tconst iBaseline = 7; // a baseline snapshot is icluded - outside of any query, provided only for delt calculation\n\tconst iGameData = 8;\n\n\t// Column Indices in session wrapper\n\tconst iSessionData = 8;\n\n\t// Options (not all of them affect rendering here)\n\tconst [\thighlight_players,\n\t\t\thighlight_changes,\n\t\t\thighlight_selected,\n\t\t\tdetails,\n\t\t\tanalysis_pre,\n\t\t\tanalysis_post,\n\t\t\tshow_performances,\n\t\t\tshow_d_rank,\n\t\t\tshow_d_rating,\n\t\t\tshow_baseline,\n\t\t\tselect_players ] = opts;\n\n\t// Extract the data we need\n\tconst pkg = LB[iPKgame];\n\tconst BGGid = LB[iBGGid];\n\tconst game = LB[iGameName];\n\tconst game_plays = LB[iTotalPlays];\n\tconst game_sessions = LB[iTotalSessions];\n\tconst snaps = LB[iSnaps];\n\tconst has_reference = LB[iReference];\n\tconst has_baseline = LB[iBaseline];\n\tconst hide = has_baseline && !show_baseline;\n\n\tlet is_reference = false;\n\tlet is_baseline = false;\n\n\t// A horendous hack but for now we determine if there's a session wrapper by checking the first element of the\n\t// Game data (or the first snap in the game data). This will be a PK if it's session wrapper, but will be a\n\t// tuple if the game data is a player list.\n\tconst test_element = snaps ? LB[iGameData][0][0] : LB[iGameData][0];\n\tconst session_wrapper = !Array.isArray(test_element);\n\n\tlet session = session_wrapper ? {} : null;\n\n\t// Fetch the player list\n\tlet player_list = null;\n\tif (snapshot != null && snaps) {\n\t\tconst count_snaps = LB[iGameData].length;\n\n\t\t// Determine if the requested snapshot is a reference or baseline.\n\t\t// The snapshots include a baseline if Has_Baseline is true and a\n\t\t// reference if Has_Refrence is true.\n\t\t// If present the baseline is always the last, and if present the\n\t\t// reference is the second last (if there's a baseline) or last\n\t\t// (if there isn't)\n\t\tis_reference = (has_reference && has_baseline) ? snapshot === count_snaps-2\n : has_reference ? snapshot === count_snaps-1\n : false;\n\t\tis_baseline = has_baseline && snapshot === count_snaps-1;\n\n\t\t// Return nothing if:\n\t\t// \tsnapshot is too high (beyond the last snapshot, >= count_snaps)\n\t\t// \tsnapshot is too low (before the first snapshot, < 0)\n\t\t//\tthe snapshot is a baseline that we should hide (snapshot >= count_snaps-1 && hide)\n\t\tif (snapshot >= count_snaps || snapshot < 0 || (hide && snapshot >= count_snaps-1))\n\t\t\treturn null;\n\n\t\tif (session) {\n\t\t\t// This MUST align with the way ajax_Leaderboards() bundles up leaderboards\n\t\t\t// which in turn relies on Game.leaderboard to provide its tuples.\n\t\t\t//\n\t\t\t// Rather a complex structure that may benefit from some naming (rather than\n\t\t\t// being a list of lists of lists of lists. Must explore how dictionaries\n\t\t\t// map\n\t\t\t// into Javascript at some stage and consider a reimplementation.\n\n\t\t\t// We cannot provide a diagnosis board if none is included\n\t\t\t// +2 because iSessionData is the index of the data item in the session wrapper.\n\t\t\t// .length returns one more, that is if iSessionData is 8 then then .length is 9.\n\t\t\t// This is the expected count. We expect a diagnostic board then at position 9\n\t\t\t// and if the .length is not (at least) 10 then we don't have a diagnostic board.\n\t\t\t// To with 8+2 is 10. We check if lengths is less than 10 or iSessionData+2\n\t\t\tif (LB[iGameData][snapshot].length < iSessionData+2) diagnose = false;\n\n\t\t\t// Column Indices in LB[iSnapshots]:\n\t\t\tconst iSessionPK = 0;\n\t\t\tconst iDateTime = 1;\n\t\t\tconst iPlayCount = 2;\n\t\t\tconst iSessionCount = 3;\n\t\t\tconst iSessionPlayers = 4;\n\t\t\tconst iSessionDetails = 5;\n\t\t\tconst iSessionAnalysisPre = 6;\n\t\t\tconst iSessionAnalysisPost = 7;\n\t\t\tconst iPlayerList = diagnose ? 9 : 8;\n\n\t\t\t// HTML values are let not const because we'll wrap selective contents with\n\t\t\t// links later\n\t\t\t// HTML values come paired with data values (which are ordered player list)\n\t\t\tsession.pk = LB[iGameData][snapshot][iSessionPK]\n\t\t\tsession.date_time = LB[iGameData][snapshot][iDateTime]\n\t\t\tsession.play_count = LB[iGameData][snapshot][iPlayCount];\n\t\t\tsession.session_count = LB[iGameData][snapshot][iSessionCount];\n\t\t\tsession.players = LB[iGameData][snapshot][iSessionPlayers];\n\t\t\tsession.details_html = LB[iGameData][snapshot][iSessionDetails][0];\n\t\t\tsession.details_data = LB[iGameData][snapshot][iSessionDetails][1];\n\t\t\tsession.analysis_pre_html = LB[iGameData][snapshot][iSessionAnalysisPre][0];\n\t\t\tsession.analysis_pre_data = LB[iGameData][snapshot][iSessionAnalysisPre][1];\n\t\t\tsession.analysis_post_html = LB[iGameData][snapshot][iSessionAnalysisPost][0];\n\t\t\tsession.analysis_post_data = LB[iGameData][snapshot][iSessionAnalysisPost][1];\n\n\t\t\t// session.players is special, can be a list of PKs or a dict keyed on PK of\n\t\t\t// name variants for substituting into the three html elements:\n\t\t\t//\t\tsession.details_html\n\t\t\t//\t\tsession.analysis_pre_html\n\t\t\t//\t\tsession.analysis_post_html\n\t\t\t//\n\t\t\t// These all list the same session players with differrent details. So the name expansions\n\t\t\t// are shared once only in session.players not three times in each of the data elements\n\t\t\t// accompanyng the HTML elements. Those Data elements include the BGG ids for linking and\n\t\t\t// optional annotations for the each player in the list (scores and performance records/predictions)\n\t\t\t//\n\t\t\t// If it's not an array (list of PKs) we assume it's a dict/object with keys and values\n\t\t\tlet player_name_variants = {};\n\n\t\t\tif (Array.isArray(session.players)) {\n\t\t\t\t// A default variant if none are provided\n\t\t\t\tfor (const pk of session.players)\n\t\t\t\t\tplayer_name_variants[pk] = `Player ${pk}`;\n\t\t\t} else {\n\t\t\t\t// Conserve the dict for lookups\n\t\t\t\tplayer_name_variants = session.players;\n\t\t\t\t// provide a list of PKs for rest of this function (keys are str, we want int)\n\t\t\t\tsession.players = Object.keys(session.players).map(Number);\n\t\t\t}\n\n\t\t\t// Now expand all the templated names in the HTML elements\n\t\t\tsession.details_html = fix_template_names(session.details_html, player_name_variants, name_format)\n\t\t\tsession.analysis_pre_html = fix_template_names(session.analysis_pre_html, player_name_variants, name_format)\n\t\t\tsession.analysis_post_html = fix_template_names(session.analysis_post_html, player_name_variants, name_format)\n\n\t\t\tsession.link \t\t\t = url_view_Session.replace('00',session.pk);\n\n\t\t\tplayer_list = LB[iGameData][snapshot][iPlayerList];\n\t\t} else\n\t\t\tplayer_list = LB[iGameData][snapshot];\n\t} else\n\t\tplayer_list = LB[iGameData];\n\n\t// It's meaningless to show deltas on the last (earliest) snapshot, nothing to compare against.\n\tlet hide_d_rank = (snapshot == LB[iGameData].length-1) || diagnose;\n\tlet hide_d_rating = (snapshot == LB[iGameData].length-1) || diagnose;\n\n\t// Check if we have previous ranks or ratings provided\n\t// As these are provided programmatically we'll be conservatine here and if any one rank or rating\n\t// happens to missing we'll hide them (to ) preven a JS error trying to access it later). A failsafe.\n\tconst iRankPrev = 13;\t\t\t// index into player_list tuples of the previous rank if it's provided\n\tlet have_previous_ranks = true; // Assume we have them\n\tfor (let i = 0; i < player_list.length; i++)\n\t\tif (player_list[i].length <= iRankPrev) {\n\t\t\thave_previous_ranks = false;\n\t\t\tbreak;\n\t\t}\n\n\tconst iRatingPrev = 14;\t\t\t// index into player_list tuples of the previous rating if it's provided\n\tlet have_previous_ratings = true; // Assume we have them\n\tfor (let i = 0; i < player_list.length; i++)\n\t\tif (player_list[i].length <= iRatingPrev) {\n\t\t\thave_previous_ratings = false;\n\t\t\tbreak;\n\t\t}\n\n\t// If we have no previous ranks or ratings we can't show the delta column!\n\tif (!have_previous_ranks) hide_d_rank = true;\n\tif (!have_previous_ratings) hide_d_rating = true;\n\n\t// Create the Game link based on the requested link target\n\tconst linkGameCoGs = url_view_Game.replace('00',pkg);\n\tconst linkGameBGG = \"https:\\/\\/boardgamegeek.com/boardgame/\" + BGGid;\n\tconst linkGame = links == \"CoGs\" ? linkGameCoGs : links == \"BGG\" ? linkGameBGG : null;\n\n\t// Fix the session detail and analysis headers which were provided with\n\t// templated links\n\tconst linkPlayerCoGs = url_view_Player.replace('00','{ID}');\n\tconst linkPlayerBGG = \"https:\\/\\/boardgamegeek.com/user/{ID}\";\n\tconst linkTeamCoGs = url_view_Team.replace('00','{ID}');\n\n\tlet linkRanker = {};\n\tlinkRanker[\"Player\"] = links == \"CoGs\" ? linkPlayerCoGs : links == \"BGG\" ? linkPlayerBGG : null;\n\tlinkRanker[\"Team\"] = links == \"CoGs\" ? linkTeamCoGs : links == \"BGG\" ? null : null;\n\n\t// Session rendering has options that influence name rendering, links and annotations\n\t// The HTML supplied by server side is expected to encode the names, link\n\tif (session) {\n\t\t// Build a map of PK to BGGid for all rankers\n\t\t// Note, session.details_data, session.analysis_pre_data and session.analysis_post_data\n\t\t// perforce contain the same map (albeit in a different order) so we can use just one\n\t\t// of them to build the map.\n\t\tlet linkRankerID = {};\n\t\tlet annotation = [];\n\t\tfor (let r = 0; r < session.details_data.length; r++) {\n\t\t\tconst PK = session.details_data[r][0];\n\t\t\tconst BGGname = session.details_data[r][1];\n\n\t\t\tlinkRankerID[PK] = links == \"CoGs\" ? PK : links == \"BGG\" ? BGGname : null;\n\t\t}\n\n\t\t// A regex replacer which has as args first the matched string then each of\n\t\t// the matched subgroups\n\t\t// The subgroups we expect for a link update to the HTML headers are\n\t\t// klass, model, id and then the text.\n\t\t// This is a function that the following replace() functions pass matched\n\t\t// groups to and is tasked with returning a the replacement string.\n\t\tfunction fix_template_link(match, klass, model, id, txt) {\n\t\t\tif (linkRankerID[id] == null)\n\t\t\t\treturn txt;\n\t\t\telse {\n\t\t\t\tconst url = linkRanker[model].replace('{ID}', linkRankerID[id]);\n\t\t\t\treturn \"<A href='\"+url+\"' class='\"+klass+\"'>\"+txt+\"</A>\";\n\t\t\t}\n\t\t}\n\n\t\t// Fix the links in the HTML headers\n\t\t// An example: {link.field_link.Player.1}Bernd{link_end}\n\t\tsession.details_html = session.details_html.replace(/{link\\.(.*?)\\.(.*?)\\.(.*?)}(.*?){link_end}/mg, fix_template_link);\n\t\tsession.analysis_pre_html = session.analysis_pre_html.replace(/{link\\.(.*?)\\.(.*?)\\.(.*?)}(.*?){link_end}/mg, fix_template_link);\n\t\tsession.analysis_post_html = session.analysis_post_html.replace(/{link\\.(.*?)\\.(.*?)\\.(.*?)}(.*?){link_end}/mg, fix_template_link);\n\n\t\t// A set of regex replacer, this time for the annotations in each of the three blocks\n\t\t// Element 2 is taken to carry the basic annotation and Element 3 the performance-including annotation..\n\t\tfunction fix_template_annotation1(match, row) {return show_performances ? session.details_data[row][3] : session.details_data[row][2];}\n\t\tfunction fix_template_annotation2(match, row) {return show_performances ? session.analysis_pre_data[row][3] : session.analysis_pre_data[row][2];}\n\t\tfunction fix_template_annotation3(match, row) {return show_performances ? session.analysis_post_data[row][3] : session.analysis_post_data[row][2];}\n\n\t\t// Fix the annotations in the HTML headers\n\t\t// An example: {link.field_link.Player.1}Bernd{link_end}{anno.0}\n\t\tsession.details_html = session.details_html.replace(/{anno\\.(.*?)}/mg, fix_template_annotation1);\n\t\tsession.analysis_pre_html = session.analysis_pre_html.replace(/{anno\\.(.*?)}/mg, fix_template_annotation2);\n\t\tsession.analysis_post_html = session.analysis_post_html.replace(/{anno\\.(.*?)}/mg, fix_template_annotation3);\n\t}\n\n\t// Define the number of columns in the board\n\tlet lb_cols = 5;\n\tif (show_d_rank && !hide_d_rank) lb_cols++;\n\tif (show_d_rating && !hide_d_rating) lb_cols++;\n\n\tconst table = document.createElement('TABLE');\n\ttable.className = is_reference ? \"leaderboard reference\"\n\t\t\t\t\t: is_baseline ? \"leaderboard baseline\"\n\t\t\t\t\t: \"leaderboard\";\n\n\t// Five header rows as follows:\n\t// A full-width session detail block, or the date the leaderboard was set\n\t// (of last session played that contributed to it)\n\t// A full-width pre session analysis\n\t// A full-width post session analysis\n\t// A game header with the name of the game (2 cols) and play/session summary\n\t// (3 cols)\n\t// A final header with 5 column headers (rank, player, rating, plays,\n\t// victories)\n\n\tconst tableHead = document.createElement('THEAD');\n\ttable.appendChild(tableHead);\n\n\t// #############################################################\n\t// First Header Row: The Game!\n\n\tconst name_cols = 3;\n\n\tlet tr = document.createElement('TR');\n\ttableHead.appendChild(tr);\n\n\tlet th = document.createElement('TH');\n\tlet content;\n\n\t// ****** The Game Name\n\tif (linkGame) {\n\t\tcontent = document.createElement('a');\n\t\tcontent.setAttribute(\"style\", \"text-decoration: none; color: inherit;\");\n\t\tcontent.href = linkGame;\n\t\tcontent.innerHTML = game;\n\t} else {\n\t\tcontent = document.createTextNode(game);\n\t}\n\tth.appendChild(content);\n\tth.colSpan = name_cols;\n\tth.className = 'leaderboard header'\n\ttr.appendChild(th);\n\n\t// ****** The Game Play Count\n\tth = document.createElement('TH');\n\tplays = document.createTextNode((session ? session.play_count : game_plays) + \" plays in \");\n\tth.appendChild(plays);\n\n\t// ****** The Game Play Count (Sessions)\n\tconst sessions = (session ? session.session_count : game_sessions) + \" sessions\";\n\tif (links == \"CoGs\") {\n\t\tcontent = document.createElement('a');\n\t\tcontent.setAttribute(\"style\", \"text-decoration: none; color: inherit;\");\n\t\tcontent.href = url_list_Sessions + \"?rich&no_menus&index&game=\" + pkg;\n\t\tcontent.innerHTML = sessions;\n\t} else {\n\t\tcontent = document.createTextNode(sessions);\n\t}\n\tth.appendChild(content);\n\n\tth.colSpan = lb_cols - name_cols;\n\tth.className = 'leaderboard normal'\n\tth.style.textAlign = 'center';\n\ttr.appendChild(th);\n\n\t// Three optional rows only relevant for sessions\n\tif (session) {\n\t\t// #############################################################\n\t\t// Second (optional) Header Row (session details if requested)\n\n\t\tif (details) {\n\t\t\tlet tr = document.createElement('TR');\n\t\t\ttableHead.appendChild(tr);\n\n\t\t\tlet td = document.createElement('TD');\n\t\t\ttd.innerHTML = session.details_html;\n\t\t\ttd.colSpan = lb_cols;\n\t\t\ttd.className = 'leaderboard normal'\n\t\t\ttr.appendChild(td);\n\n\t\t// If no details are displayed at least show the date-time of the session\n\t\t// that produced this leaderboard snapshot\n\t\t} else {\n\t\t\tlet tr = document.createElement('TR');\n\t\t\ttableHead.appendChild(tr);\n\n\t\t\tlet th = document.createElement('TH');\n\n\t\t\t// content = document.createTextNode(\"Results after \" + date_time);\n\n\t\t\tconst intro = document.createTextNode(\"Results after \");\n\n\t\t\tif (session.link) {\n\t\t\t\tcontent = document.createElement('a');\n\t\t\t\tcontent.setAttribute(\"style\", \"text-decoration: none; color: inherit;\");\n\t\t\t\tcontent.href = session.link;\n\t\t\t\tcontent.innerHTML = session.date_time;\n\t\t\t} else {\n\t\t\t\tcontent = document.createTextNode(session.date_time);\n\t\t\t}\n\n\t\t\tth.appendChild(intro);\n\t\t\tth.appendChild(content);\n\t\t\tth.colSpan = lb_cols;\n\t\t\tth.className = 'leaderboard normal'\n\t\t\ttr.appendChild(th);\n\t\t}\n\n\t\t// #############################################################\n\t\t// Third Header Row (pre session analysis)\n\n\t\tif (analysis_pre) {\n\t\t\tlet tr = document.createElement('TR');\n\t\t\ttableHead.appendChild(tr);\n\n\t\t\tlet td = document.createElement('TD');\n\t\t\ttd.innerHTML = session.analysis_pre_html;\n\t\t\ttd.colSpan = lb_cols;\n\t\t\ttd.className = 'leaderboard normal'\n\t\t\ttr.appendChild(td);\n\t\t}\n\n\t\t// #############################################################\n\t\t// Fourth Header Row (post session analysis)\n\n\t\tif (analysis_post) {\n\t\t\tlet tr = document.createElement('TR');\n\t\t\ttableHead.appendChild(tr);\n\n\t\t\tlet td = document.createElement('TD');\n\t\t\ttd.innerHTML = session.analysis_post_html;\n\t\t\ttd.colSpan = lb_cols;\n\t\t\ttd.className = 'leaderboard normal'\n\t\t\ttr.appendChild(td);\n\t\t}\n\t}\n\n\t// #############################################################\n\t// Fifth Header Row (Player table header)\n\n\ttr = document.createElement('TR');\n\ttableHead.appendChild(tr);\n\n\tth = document.createElement('TH');\n\tth.style.textAlign = 'center';\n\tth.appendChild(document.createTextNode(\"Rank\"));\n\tth.className = 'leaderboard normal'\n\ttr.appendChild(th);\n\n\tif (show_d_rank && !hide_d_rank) {\n\t\tth = document.createElement('TH');\n\t\tth.style.textAlign = 'center';\n\t\tth.appendChild(document.createTextNode(\"Δ\"));\n\t\tth.className = 'leaderboard normal'\n\t\ttr.appendChild(th);\n\t}\n\n\tth = document.createElement('TH');\n\tth.appendChild(document.createTextNode(\"Player\"));\n\tth.className = 'leaderboard normal'\n\ttr.appendChild(th);\n\n\tth = document.createElement('TH');\n\tth.style.textAlign = 'center';\n\tth.appendChild(document.createTextNode(\"Teeth\"));\n\tth.className = 'leaderboard normal'\n\ttr.appendChild(th);\n\n\tif (show_d_rating && !hide_d_rating) {\n\t\tth = document.createElement('TH');\n\t\tth.style.textAlign = 'center';\n\t\tth.appendChild(document.createTextNode(\"Δ\"));\n\t\tth.className = 'leaderboard normal'\n\t\ttr.appendChild(th);\n\t}\n\n\tth = document.createElement('TH');\n\tth.style.textAlign = 'center';\n\tth.appendChild(document.createTextNode(\"Plays\"));\n\tth.className = 'leaderboard normal'\n\ttr.appendChild(th);\n\n\tth = document.createElement('TH');\n\tth.style.textAlign = 'center';\n\tth.appendChild(document.createTextNode(\"Victories\"));\n\tth.className = 'leaderboard normal'\n\ttr.appendChild(th);\n\n\t// #############################################################\n\t// The Body (List of players)\n\n\tconst tableBody = document.createElement('TBODY');\n\ttable.appendChild(tableBody);\n\n\tfor (let i = 0; i < player_list.length; i++) {\n\t\tconst tr = document.createElement('TR');\n\t\ttableBody.appendChild(tr);\n\n\t\t// Column Indices in player_list[i]:\n\t\t// 0 is the rank\n\t\t// 1 and 2 are the PK and BGGname,\n\t\t// 3, 4 and 5 are the nickname, full name and complete name of the\n\t\t// player respectively\n\t\t// 6, 7, and 8 are Trueskill eta, mu and sigma\n\t\t// 9 and 10 are play count and victory count\n\t\tconst iRank = 0;\n\t\tconst iPK = 1;\n\t\tconst iBGGname = 2;\n\t\tconst iNickName = 3;\n\t\tconst iFullName = 4;\n\t\tconst iCompleteName = 5;\n\t\tconst iEta = 6;\n\t\tconst iMu = 7;\n\t\tconst iSigma = 8;\n\t\tconst iPlays = 9;\n\t\tconst iWins = 10;\n\t\t// 11 and 12 are last_play and player_leagues respectively not used here\n\n\t\tlet td_class = 'leaderboard normal';\n\n\t\tconst this_player = player_list[i][iPK];\n\n\t\t// Highlight the session players if we can (if it's a session snapshot)\n\t\tif (session) {\n\t\t\t// session.players is the list of players in the game session that\n\t\t\t// resulted in this leaderboard snapshot.\n\t\t\tif (session.players.indexOf(this_player) >= 0)\n\t\t\t\ttd_class += highlight_players ? ' highlight_players_on' : ' highlight_players_off';\n\t\t}\n\n\t\t// selected_players a list of players to highlight when highligh_selected is true\n\t\tif (selected_players && selected_players.includes(this_player.toString()))\n\t\t\ttd_class += highlight_selected ? ' highlight_selected_on' : ' highlight_selected_off';\n\n\t\t// Not a number by default\n\t\tlet rank_delta = NaN;\n\t\tlet rating_delta = NaN;\n\n\t\t// if a previous rank is available in the leaderboard\n\t\tif (have_previous_ranks) {\n\t\t\tconst rank = player_list[i][iRank];\n\t\t\tconst prev_rank = player_list[i][iRankPrev];\n\n\t\t\tif (typeof prev_rank == 'number') // Denotes a possible change in rank\n\t\t\t\trank_delta = prev_rank - rank;\n\t\t\telse if (prev_rank == null) // Denotes a new leaderboard entry\n\t\t\t\trank_delta = null;\n\t\t\telse\t\t\t\t\t\t\t // should never happen!\n\t\t\t\trank_delta = NaN;\n\n\t\t\tif (rank_delta != 0)\n\t\t\t\ttd_class += (highlight_changes && !hide_d_rank) ? ' highlight_changes_on' : ' highlight_changes_off';\n\t\t}\n\n\t\t// if a previous rating is available in the leaderboard\n\t\tif (have_previous_ratings) {\n\t\t\tconst rating = player_list[i][iEta];\n\t\t\tconst prev_rating = player_list[i][iRatingPrev];\n\n\t\t\tif (typeof prev_rating == 'number') // Denotes a posisble change in rating\n\t\t\t\trating_delta = rating - prev_rating;\n\t\t\telse if (prev_rating == null) \t // Denotes a new leaderboard entry\n\t\t\t\trating_delta = null;\n\t\t\telse\t\t\t\t\t\t\t // should never happen!\n\t\t\t\trating_delta = NaN;\n\n\t\t\tif (rating_delta !== 0)\n\t\t\t\ttd_class += (highlight_changes && !hide_d_rating) ? ' highlight_changes_on' : ' highlight_changes_off';\n\t\t}\n\n\t\tconst pkp = player_list[i][iPK];\n\t\tconst BGGname = player_list[i][iBGGname];\n\t\tconst rating = player_list[i][iEta];\n\t\tconst mu = player_list[i][iMu];\n\t\tconst sigma = player_list[i][iSigma];\n\t\tconst plays = player_list[i][iPlays];\n\t\tconst wins = player_list[i][iWins];\n\t\tconst play_count = player_list[i][iPlays];\n\t\tconst victory_count = player_list[i][iWins];\n\n\t\tconst linkPlayerCoGs = url_view_Player.replace('00',pkp);\n\t\tconst linkPlayerBGG = BGGname ? \"https:\\/\\/boardgamegeek.com/user/\" + BGGname : null;\n\t\tconst linkPlayer = links == \"CoGs\" ? linkPlayerCoGs : links == \"BGG\" ? linkPlayerBGG : null;\n\n\t\t// ###########################################################################\n\t\t// The RANK column\n\t\tconst rank = player_list[i][iRank]\n\n\t\tconst td_rank = document.createElement('TD');\n\t\ttd_rank.style.textAlign = 'center';\n\t\ttd_rank.className = td_class;\n\t\ttd_rank.appendChild(document.createTextNode(rank));\n\t\ttr.appendChild(td_rank);\n\n\t\t// ###########################################################################\n\t\t// The Rank DELTA column\n\t\tif (show_d_rank && !hide_d_rank) {\n\t\t\tconst td_rank_delta = document.createElement('TD');\n\t\t\ttd_rank_delta.style.textAlign = 'center';\n\t\t\ttd_rank_delta.className = td_class;\n\n\t\t\tcontent = rank_delta == 0 ? '-'\n\t\t\t\t : rank_delta == null ? '↥'\n\t\t\t\t\t: (rank_delta > 0 ? '↑' : '↓') + Math.abs(rank_delta);\n\n\t\t\tconst div_rank_delta = document.createElement('div');\n\t\t\tdiv_rank_delta.setAttribute(\"class\", \"tooltip\");\n\t\t\tdiv_rank_delta.innerHTML = content;\n\n\t\t\tconst tt_rank_delta = document.createElement('span');\n\n\t\t\tconst tt_text = rank_delta == 0 ? 'Rank unchanged'\n\t\t\t\t\t\t : rank_delta == null ? 'First entry on this leaderboard'\n\t\t\t\t\t\t : 'Rank went '\n\t\t\t\t\t\t\t+ (rank_delta > 0 ? 'up ' : 'down ')\n\t\t\t\t\t\t\t+ Math.abs(rank_delta)\n\t\t\t\t\t\t\t+ (Math.abs(rank_delta) > 1 ? ' places' : ' place')\n\t\t\t\t\t\t\t+ ' from rank ' + (rank+rank_delta);\n\n\t\t\ttt_rank_delta.className = \"tooltiptext\";\n\t\t\ttt_rank_delta.style.width='15ch';\n\t\t\ttt_rank_delta.innerHTML = tt_text;\n\n\t\t\tdiv_rank_delta.appendChild(tt_rank_delta);\n\t\t\ttd_rank_delta.appendChild(div_rank_delta);\n\t\t\ttr.appendChild(td_rank_delta);\n\t\t}\n\n\t\t// ###########################################################################\n\t\t// The PLAYER column\n\t\tconst chosen_name = name_format == 'nick' ? player_list[i][iNickName]\n\t\t : name_format == 'full' ? player_list[i][iFullName]\n\t\t\t \t : name_format == 'complete' ? player_list[i][iCompleteName]\n\t\t : \"ERROR\";\n\n\t\tconst td_player = document.createElement('TD');\n\t\ttd_player.className = td_class;\n\n\t\tif (linkPlayer) {\n\t\t\tconst a_player = document.createElement('a');\n\t\t\ta_player.setAttribute(\"style\", \"text-decoration: none; color: inherit;\");\n\t\t\ta_player.href = linkPlayer;\n\t\t\ta_player.innerText = chosen_name;\n\t\t\ttd_player.appendChild(a_player);\n\t\t} else {\n\t\t\ttd_player.innerHTML = chosen_name;\n\t\t}\n\n\t\ttr.appendChild(td_player);\n\n\t\t// ###########################################################################\n\t\t// The TEETH/RATING column\n\n\t\tconst fixed_rating = rating.toFixed(1);\n\t\tconst fixed_mu = mu.toFixed(1);\n\t\tconst fixed_sigma = sigma.toFixed(1);\n\n\t\tconst td_rating = document.createElement('TD');\n\t\ttd_rating.className = td_class;\n\t\ttd_rating.style.textAlign = 'center'\n\n\t\tconst div_rating = document.createElement('div');\n\t\tdiv_rating.setAttribute(\"class\", \"tooltip\");\n\t\tdiv_rating.innerHTML = fixed_rating;\n\n\t\tconst tt_rating = document.createElement('span');\n\t\ttt_rating.className = \"tooltiptext\";\n\t\ttt_rating.style.width='12ch';\n\t\ttt_rating.innerHTML = \"&mu;=\" + fixed_mu + \" &sigma;=\" + fixed_sigma;\n\n\t\tdiv_rating.appendChild(tt_rating);\n\t\ttd_rating.appendChild(div_rating);\n\t\ttr.appendChild(td_rating);\n\n\t\t// ###########################################################################\n\t\t// The Rating DELTA column\n\t\tif (show_d_rating && !hide_d_rating) {\n\t\t\tconst precision = 2\n\t\t\tconst fixed_delta = typeof rating_delta == 'number' ? rating_delta.toFixed(precision) : rating_delta;\n\n\t\t\tconst td_rating_delta = document.createElement('TD');\n\t\t\ttd_rating_delta.style.textAlign = 'center';\n\t\t\ttd_rating_delta.className = td_class;\n\n\t\t\tcontent = rating_delta == 0 ? '-'\n\t\t\t\t : rating_delta == null ? '↥'\n\t\t\t\t\t: (rating_delta > 0 ? '↑' : '↓') + Math.abs(fixed_delta);\n\n\t\t\tconst div_rating_delta = document.createElement('div');\n\t\t\tdiv_rating_delta.setAttribute(\"class\", \"tooltip\");\n\t\t\tdiv_rating_delta.innerHTML = content;\n\n\t\t\tconst tt_rating_delta = document.createElement('span');\n\n\t\t\tconst tt_text = rating_delta == 0 ? 'Rating unchanged'\n\t\t\t\t \t : rating_delta == null ? 'First entry on this leaderboard'\n\t\t\t\t\t\t : 'Rating went '\n\t\t\t\t\t\t\t+ (rating_delta > 0 ? 'up ' : 'down ')\n\t\t\t\t\t\t\t+ Math.abs(fixed_delta)\n\t\t\t\t\t\t\t+ (Math.abs(rating_delta) > 1 ? ' teeth' : ' tooth')\n\t\t\t\t\t\t\t+ ' from ' + (rating-rating_delta).toFixed(precision)\n\t\t\t\t\t\t\t+ ' to ' + rating.toFixed(precision);\n\n\t\t\ttt_rating_delta.className = \"tooltiptext\";\n\t\t\ttt_rating_delta.style.width='15ch';\n\t\t\ttt_rating_delta.innerHTML = tt_text;\n\n\t\t\tdiv_rating_delta.appendChild(tt_rating_delta);\n\t\t\ttd_rating_delta.appendChild(div_rating_delta);\n\t\t\ttr.appendChild(td_rating_delta);\n\t\t}\n\n\t\t// ###########################################################################\n\t\t// The PLAY COUNT column\n\n\t\tconst td_plays = document.createElement('TD');\n\t\ttd_plays.className = td_class;\n\t\ttd_plays.style.textAlign = 'center'\n\n\t\tconst a_plays = document.createElement('a');\n\t\ta_plays.setAttribute(\"style\", \"text-decoration: none; color: inherit;\");\n\t\ta_plays.href = url_list_Sessions + \"?performances__player=\" + pkp + \"&game=\" + pkg + \"&detail&external_links&no_menus&index\";\n\t\ta_plays.innerHTML = plays;\n\n\t\ttd_plays.appendChild(a_plays);\n\t\ttr.appendChild(td_plays);\n\n\t\t// ###########################################################################\n\t\t// The WIN COUNT column\n\n\t\tconst td_wins = document.createElement('TD');\n\t\ttd_wins.className = td_class;\n\t\ttd_wins.style.textAlign = 'center'\n\n\t\t// FIXME: What link can get victories in teams as well?\n\t\t// And are team victories listed in the victory count at all?\n\t\t// url_filters can only be ANDs I think, so this hard for team\n\t\t// victories. One way is if Performance has a field is_victory\n\t\t// that can be filtered on. Currently has a property that returns\n\t\t// this. Can url_filter filter on properties? Via Annotations on\n\t\t// a query?\n\n\t\tconst a_wins = document.createElement('a');\n\t\ta_wins.setAttribute(\"style\", \"text-decoration: none; color: inherit;\");\n\t\ta_wins.href = url_list_Sessions + \"?ranks__rank=1&ranks__player=\" + pkp + \"&game=\" + pkg + \"&detail&external_links&no_menus&index\";;\n\t\ta_wins.innerHTML = wins;\n\n\t\ttd_wins.appendChild(a_wins);\n\t\ttr.appendChild(td_wins);\n\t}\n\n\treturn table;\n}", "title": "" }, { "docid": "315147d127fa4ae891e25ce21ba99103", "score": "0.53751117", "text": "function GetLeagueStandingsTickerDetailsBasedOnTheOverallScoresForThisGame(scores, totalUsersInLeague)\n{\n //we DONT want to display details on the league untill - the game has started - and at least one person has won a bet!!!!!\n var LeaderBoardDetails = \"\";\n var usersScoreAndPosition = \"\"; //this will ALWAYS go first - so that when we place a bet or update our score the first thing we see will be our score and position!!\n\n if (scores) {\n lastOverallScoresList = scores;\n }\n\n if (totalUsersInLeague) {\n lastCountOfUsersInLeague = totalUsersInLeague;\n }\n\n if ((lastOverallScoresList) && ((thisFixture) && (thisFixture.currenthalf != -101))) { //we have some league data AND the game HAS started!!!!!\n\n AddMyScoreToOverAllLeaderBoard(totalUsersInLeague, \"AddingToTickersLEagueInfo\");\n\n if (totalUsersInLeague > 1) {\n LeaderBoardDetails = \"<li class='news-item'>There are \" + lastCountOfUsersInLeague + \" people playing this game!!</li>\";\n }\n\n var Scoreboard = typeof scores != 'object' ? JSON.parse(lastOverallScoresList) : lastOverallScoresList;\n var thisUser = JSON.parse(window.sessionStorage.getItem(\"facebookuser\"));\n \n var LeadersName = \"\";\n var LeadersScore = \"\";\n var LeadersFBID = \"\";\n var userLeading = 0;\n var AllScoresAreTheSame = 1;\n var lastScore = 0;\n\n try {\n for (var i = 0; i < Scoreboard.length; i++) {\n\n if (i > 0) {\n if (Scoreboard[i].S != lastScore) {\n AllScoresAreTheSame = 0; //this means not all scores are the same - i.e at the start of the game everyone will be on 0!!!!!!!\n }\n }\n lastScore = Scoreboard[i].S;\n\n if (i == 0) {\n //this person is Leading the game!!!!! (well is the first position in the array anyway!!!)\n LeadersName = Scoreboard[i].U;\n LeadersScore = Scoreboard[i].S;\n LeadersFBID = Scoreboard[i].F;\n\n if (thisUser.fbuserid == LeadersFBID) {\n //this user is currently leading!!!!!!!\n //LeaderBoardDetails = LeaderBoardDetails + \"<li class='news-item'>You are currently in the lead with \" + LeadersScore + \" points!!</li>\";\n usersScoreAndPosition = usersScoreAndPosition + \"<li class='news-item'>You are currently in the lead with \" + LeadersScore + \" points!!</li>\";\n userLeading = 1;\n }\n else {\n LeaderBoardDetails = LeaderBoardDetails + \"<li class='news-item'>\" + LeadersName + \" is currently leading this game with \" + LeadersScore + \" points!!</li>\";\n }\n }\n else { //this is NOT the first position\n\n if (Scoreboard[i].F == thisUser.fbuserid) {\n //this user!!\n if (userLeading != 1) { //the user is NOT leading\n\n var pointsBehindLeader = LeadersScore - Scoreboard[i].S;\n var position = Scoreboard[i].P + \"\"; //force this to be a string - so we can do string functionality on it!!!\n\n if ((position) && (position > 0)) {\n var lastNumber = position.charAt(position.length - 1);\n var last2numbers;\n\n if (position.length >= 2) {\n //check if the last 2 digits of the position are 11 - i.e could be 11,211,111,3456811 etc\n last2numbers = position.substr(position.length - 2, 2);\n }\n\n if (last2numbers == 11) {\n position = position + \"th\";\n }\n else if (lastNumber == 1) {\n position = position + \"st\";\n }\n else if (lastNumber == 2) {\n \n try {\n if (last2numbers) {\n //check if the 2nd last number is 1 - if it is the this is either 12th or 112th etc\n if (last2numbers.substring(0, 1) == \"1\") {\n position = position + \"th\";\n }\n else {\n position = position + \"nd\";\n }\n }\n else {\n //there is only one number - so this must be 2nd\n position = position + \"nd\";\n }\n\n } catch (ex) { position = position + \"nd\"; }\n\n }\n else if (lastNumber == 3) {\n\n try\n {\n if (last2numbers) {\n //check if the 2nd last number is 1 - if it is the this is either 13th or 113th etc\n if (last2numbers.substring(0, 1) == \"1\") {\n position = position + \"th\";\n }\n else {\n position = position + \"rd\";\n }\n }\n else {\n //there is only one number - so this must be 3rd\n position = position + \"rd\";\n }\n\n } catch (ex) { position = position + \"rd\"; }\n\n \n }\n else {\n position = position + \"th\";\n }\n\n }\n\n if (pointsBehindLeader > 0) {\n\n //LeaderBoardDetails = LeaderBoardDetails + \"<li class='news-item'>You are \" + pointsBehindLeader + \" points behind the leader!!</li>\";\n usersScoreAndPosition = usersScoreAndPosition + \"<li class='news-item'>You have \" + Scoreboard[i].S + \" points!!</li><li class='news-item'>You are \" + pointsBehindLeader + \" points behind the leader!!</li>\";\n\n if (position) {\n //LeaderBoardDetails = LeaderBoardDetails + \"<li class='news-item'>You are in \" + position + \" position!!</li>\";\n usersScoreAndPosition = \"<li class='news-item'>You are in \" + position + \" position in the overall scores!!</li>\" + usersScoreAndPosition;\n }\n }\n else {\n //this user may not be the first in the list - however they are joint top!!!!\n //LeaderBoardDetails = LeaderBoardDetails + \"<li class='news-item'>You are joint top of the leader board with \" + LeadersName + \"!!</li><li class='news-item'>You have \" + LeadersScore + \" points!!</li>\";\n usersScoreAndPosition = usersScoreAndPosition + \"<li class='news-item'>You are joint top of the leader board with \" + LeadersName + \"!!</li><li class='news-item'>You have \" + LeadersScore + \" points!!</li>\";\n }\n }\n }\n else { //these details are not the users\n if ((i == 1) && (userLeading == 1)) {\n //the current user is in the lead - and these are the details of the person in second!!!\n var Lead = LeadersScore - Scoreboard[i].S;\n if (Lead > 0) {\n LeaderBoardDetails = LeaderBoardDetails + \"<li class='news-item'>\" + Scoreboard[i].U + \" is in second place!!</li><li class='news-item'>You lead \" + Scoreboard[i].U + \" by \" + Lead + \" points!!</li>\"\n }\n else {\n //the user is not actually in the lead - infact they are joint top!!!!!!\n //LeaderBoardDetails = LeaderBoardDetails + \"<li class='news-item'>You are joint top of the leader board with \" + LeadersName + \"!!</li><li class='news-item'>You have \" + LeadersScore + \" points!!</li>\";\n usersScoreAndPosition = usersScoreAndPosition + \"<li class='news-item'>You are joint top of the leader board with \" + LeadersName + \"!!</li><li class='news-item'>You have \" + LeadersScore + \" points!!</li>\";\n }\n }\n } //END - these details are not the users\n } // end this is NOT the first position\n } //end for loop\n\n if (AllScoresAreTheSame == 1) { //everyone is on the same score - so dont return anything here!!!!\n LeaderBoardDetails = \"\"; \n usersScoreAndPosition = \"\";\n }\n }\n catch (ex) {\n logError(\"GetLeagueStandingsTickerDetailsBasedOnTheOverallScoresForThisGame\", ex);\n }\n }\n return usersScoreAndPosition + LeaderBoardDetails;\n}", "title": "" }, { "docid": "62f3057effc7e293035e1b9995d039b8", "score": "0.535106", "text": "function updateRanks(string) {\n let lastElement = allStatsArray[0];\n lastElement.rank = 1;\n let rankCount = 1;\n\n if(string === \"nickname\") {\n //Iterate through all stats\n for(let i = 0; i < allStatsArray.length; i++) {\n allStatsArray[i].rank = (i+1);\n }\n }\n else {\n //Iterate through all stats\n for (let i = 1; i < allStatsArray.length; i++) {\n\n if (string === \"nickname\") {\n allStatsArray[i].rank = rankCount;\n rankCount++;\n }\n\n if (string === \"score\") {\n //If current stat matches the previous one, they are tied\n if (lastElement.score === allStatsArray[i].score) {\n allStatsArray[i].rank = lastElement.rank;\n }\n //Else, increment the rank counter and assign that rank to the current player\n else {\n rankCount++;\n allStatsArray[i].rank = rankCount;\n lastElement = allStatsArray[i];\n }\n }\n\n if (string === \"wins\") {\n //If current stat matches the previous one, they are tied\n if (lastElement.wins === allStatsArray[i].wins) {\n allStatsArray[i].rank = lastElement.rank;\n }\n //Else, increment the rank counter and assign that rank to the current player\n else {\n rankCount++;\n allStatsArray[i].rank = rankCount;\n lastElement = allStatsArray[i];\n }\n }\n\n if (string === \"losses\") {\n //If current stat matches the previous one, they are tied\n if (lastElement.losses === allStatsArray[i].losses) {\n allStatsArray[i].rank = lastElement.rank;\n }\n //Else, increment the rank counter and assign that rank to the current player\n else {\n rankCount++;\n allStatsArray[i].rank = rankCount;\n lastElement = allStatsArray[i];\n }\n }\n\n if (string === \"winRate\") {\n //If current stat matches the previous one, they are tied\n if (lastElement.winRate === allStatsArray[i].winRate) {\n allStatsArray[i].rank = lastElement.rank;\n }\n //Else, increment the rank counter and assign that rank to the current player\n else {\n rankCount++;\n allStatsArray[i].rank = rankCount;\n lastElement = allStatsArray[i];\n }\n }\n\n }\n }\n}", "title": "" }, { "docid": "597c1e0df715dc1e30613df699623b8a", "score": "0.53483945", "text": "function constructLeaderboard(leaderboardData, onlyUniqueEntries) {\n\tvar leaderboardTableElement = $(document.createElement(\"table\"));\n\tvar leaderboardHeaderRowElement = $(document.createElement(\"tr\"));\n\tvar leaderboardHeaderRowRank = $(document.createElement(\"th\"));\n\tleaderboardHeaderRowRank.text(\"Rank\");\n\tvar leaderboardHeaderRowName = $(document.createElement(\"th\"));\n\tleaderboardHeaderRowName.text(\"Name\");\n\tvar leaderboardHeaderRowDPS = $(document.createElement(\"th\"));\n\tleaderboardHeaderRowDPS.text(\"DPS\");\n\n\tleaderboardHeaderRowElement.append(leaderboardHeaderRowRank);\n\tleaderboardHeaderRowElement.append(leaderboardHeaderRowName);\n\tleaderboardHeaderRowElement.append(leaderboardHeaderRowDPS);\n\n\tleaderboardTableElement.append(leaderboardHeaderRowElement);\n\n\t//used when \"onlyUniqueEntries\" is true\n\tvar namesAddedToLeaderboard = [];\n\n\tfor (var i = 0; i < leaderboardData.length; i++) {\n\t\tvar addEntry = true;\n\t\tif (onlyUniqueEntries) {\n\t\t\tfor (var j = 0; j < namesAddedToLeaderboard.length; j++) {\n\t\t\t\tif (namesAddedToLeaderboard[j] == leaderboardData[i][0]) {\n\t\t\t\t\taddEntry = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (addEntry) {\n\t\t\t\tnamesAddedToLeaderboard.push(leaderboardData[i][0]);\n\t\t\t}\n\t\t}\n\n\t\tif (addEntry) {\n\t\t\tvar leaderboardRowElement = $(document.createElement(\"tr\"));\n\t\t\tif (i%2 == 0) {\n\t\t\t\tleaderboardRowElement.addClass(\"tableRowEven\");\n\t\t\t} else {\n\t\t\t\tleaderboardRowElement.addClass(\"tableRowOdd\");\n\t\t\t}\n\t\t\tvar leaderboardRankElement = $(document.createElement(\"td\"));\n\t\t\tleaderboardRankElement.addClass(\"leaderboardRank\");\n\t\t\tvar rank = getParseRank(leaderboardData[i][1], leaderboardData);\n\t\t\tleaderboardRankElement.text(rank);\n\t\t\taddRankColorToElement(leaderboardRankElement, rank);\n\t\t\tvar leaderboardNameElement = $(document.createElement(\"td\"));\n\t\t\tleaderboardNameElement.text(leaderboardData[i][0]);\n\t\t\tvar leaderboardDPSElement = $(document.createElement(\"td\"));\n\t\t\tleaderboardDPSElement.addClass(\"leaderboardDPS\");\n\t\t\tvar prettyNumber = Math.floor(leaderboardData[i][1]);\n\t\t\tleaderboardDPSElement.text(prettyNumber);\n\t\t\tleaderboardRowElement.append(leaderboardRankElement);\n\t\t\tleaderboardRowElement.append(leaderboardNameElement);\n\t\t\tleaderboardRowElement.append(leaderboardDPSElement);\n\n\t\t\tleaderboardTableElement.append(leaderboardRowElement);\n\t\t}\n\t}\n\treturn leaderboardTableElement;\n}", "title": "" }, { "docid": "9b32a308704033e483bf4fa2ac269640", "score": "0.53443545", "text": "function set_name(player, customName){\n\t//Get list name.\n\tvar listName = determine_list_name(customName);\n\t//Set display and list names.\n\tplayer.setDisplayName(customName+c.RESET);\n\tplayer.setPlayerListName(listName);\n}", "title": "" }, { "docid": "5d712fd6f74af2d50d0c52dfecbefd0c", "score": "0.5335648", "text": "function RefreshPlayerData() {\n // TODO: Use 'getHighscore()'?\n if (currentHighscores == \"HC\") {\n CreateSkillList(playerSkillsHC);\n } else if (currentHighscores == \"Iron\") {\n CreateSkillList(playerSkillsIron);\n } else if (currentHighscores == \"Reg\") {\n CreateSkillList(playerSkillsReg);\n }\n sort(currentSortCol, false);\n}", "title": "" }, { "docid": "14866655307530ed8c6b157925a23893", "score": "0.53308237", "text": "function newLeader(leader) {\n if(leader < players.length -1) {\n return leader++;\n } else {\n return leader = 0;\n }\n}", "title": "" }, { "docid": "36a76b2b1e8149804d08a43d0b8dbb3e", "score": "0.53288317", "text": "function handle_setname(args, self){\n\t//Check if person has permission.\n\tif (!self.isOp()){\n\t\tannouncer.tell(\"You don't have permission to change your/others name!\", self);\n\t\treturn;\n\t}\n\n\t//Shift args array by one.\n\targs.shift();\n\n\t//Check if the length of args is less than 2.\n\tif (args.length < 2){\n\t\tannouncer.tell(\"Usage: /setname <player> <custom_name>\", self);\n\t\treturn;\n\t}\n\n\t//Define variables.\n\tvar target,\n\t\ttargetName,\n\t\tcustomName,\n\t\tcustomLower,\n\t\tcustomColor,\n\t\tlistName;\n\n\t//Determine target.\n\ttarget = server.getPlayer(args.shift());\n\t//Check if target exists.\n\tif (!target){\n\t\tannouncer.tell(\"No player found with that username!\", self);\n\t\treturn;\n\t}\n\t\n\t//Target's username.\n\ttargetName = String(target.getName());\n\t//Custom name, raw input\n\tcustomRaw = String(args.join(\" \"));\n\t//Custom name, formatted without color.\n\tcustomName = String(stringcolor.stripu(customRaw));\n\t//Custom name, formatted with color.\n\tcustomColor = String(stringcolor.format(customRaw));\n\t//Custom name, formatted without color, lowercase.\n\tcustomLower = customName.toLowerCase();\n\n\tif (customColor.length > 16){\n\t\tif (customName.length > 16){\n\t\t\tannouncer.tell(\"Warning: Your list name is colorless and trimmed to fit the character limit.\", target);\n\t\t\tannouncer.tell(\"Warning: The list name is colorless and trimmed to fit the character limit.\", self);\n\t\t}\n\t\telse{\n\t\t\tannouncer.tell(\"Warning: Your list name is colorless to fit the character limit.\", target);\n\t\t\tannouncer.tell(\"Warning: The list name is colorless to fit the character limit.\", self);\n\t\t}\n\t}\n\n\t//Check if target name is same as custom name color-formatted.\n\tif (targetName == customColor){\n\t\t//If the player doesn't already have a custom name, then just cancel.\n\t\tif (!plgn.players[targetName]){\n\t\t\tannouncer.tell(\"Why would you set \"+targetName+\"'s custom username as \"+targetName+\"'s username?\", self);\n\t\t\treturn;\n\t\t}\n\t\t//Otherwise, delete the player's data and reset their display and list names.\n\t\tdelete plgn.usernames[stringcolor.stripf(plgn.players[targetName]).toLowerCase()];\n\t\tdelete plgn.players[targetName];\n\t\tset_name(target, targetName);\n\t\tannouncer.broadcast(targetName+\" has cleared their custom username.\");\n\t\tannouncer.tell(targetName+\"'s custom username has been cleared.\", self);\n\t\treturn;\n\t}\n\n\t//Check if the username is already registered.\n\tif (plgn.usernames[customLower] && plgn.usernames[customLower] != undefined){\n\t\tannouncer.tell(\"That custom name already belongs to \"+plgn.usernames[customLower], self);\n\t\treturn;\n\t}\n\t\n\t//Check if they already have a custom name, and if so, delete it.\n\tif (plgn.players[targetName]){\n\t\tdelete plgn.usernames[stringcolor.stripf(plgn.players[targetName]).toLowerCase()];\n\t}\n\t//Then, set their username.\n\tplgn.players[targetName] = customColor;\n\tplgn.usernames[customLower] = targetName;\n\tset_name(target, customColor);\n\tannouncer.broadcast(targetName+\" is now known as \"+customColor);\n}", "title": "" }, { "docid": "a0be5d8da3f931ff9094668a5a78ca4f", "score": "0.53269696", "text": "constructor(players, name) {\n this.players = players;\n this.name = name;\n }", "title": "" }, { "docid": "132d93a6bc1e799c00debb32f9a8e4aa", "score": "0.53132975", "text": "function setExamplePointsAndLB() {\n setExamplePoints();\n var leaderboard = [\n {'name': 'verdani', points: 10200},\n {'name': 'neo23', points: 6000},\n {'name': 'legolas', points: 2900},\n {'name': 'Du (Bsp.)', points: 1200},\n {'name': 'anork85', points: 1100}\n ];\n setLeaderboardFromAPI(leaderboard);\n}", "title": "" }, { "docid": "7c5fdddb0bf816aa9b0ae6dc8310b30c", "score": "0.5304525", "text": "function initLeaderboard() {\n\tvar container = document.createElement('div');\n\tcontainer.id = 'leaderboard_wrapper';\n\tcontainer.style.display = \"none\";\n\n\tdocument.getElementById('col_right').appendChild(container);\n\n\tvar leaderboard = document.createElement('table');\n\tleaderboard.id = 'leaderboard';\n\n\tvar th = document.createElement('tr');\n\tth.style.fontSize = '11px';\n\tth.style.color = '#ddd';\n\n\tvar thc = document.createElement('th');\n\tvar thn = document.createElement('th');\n\tvar thl = document.createElement('th');\n\tthc.appendChild(document.createTextNode('Rank'));\n\tthn.appendChild(document.createTextNode('Name'));\n\tthl.appendChild(document.createTextNode('Level'));\n\n\tth.appendChild(thc);\n\tth.appendChild(thn);\n\tth.appendChild(thl);\n\n\tleaderboard.appendChild(th);\n\n\tdocument.getElementById('leaderboard_wrapper').appendChild(leaderboard);\n\n\tvar credit = document.createElement('div');\n\tcredit.style.fontSize = \"12px\";\n\tcredit.style.textAlign = \"center\";\n\tcredit.innerHTML = 'Data by <a href=\"http://steamga.me/\" style=\"color:#ddd;\" alt=\"http://steamga.me/\" target=\"_blank\">steamga.me</a>';\n\n\tdocument.getElementById('leaderboard_wrapper').appendChild(credit);\n\n\tvar toggler = document.createElement('div');\n\ttoggler.id = \"leaderboard_toggler\";\n\ttoggler.onclick = function() {\n\t\ttoggleLeaderboard();\n\t};\n\ttoggler.style.position = 'absolute';\n\ttoggler.style.bottom = \"-48px\";\n\ttoggler.style.color = \"black\";\n\ttoggler.style.textAlign = \"center\";\n\ttoggler.style.width = '261px';\n\ttoggler.style.cursor = \"pointer\";\n\ttoggler.appendChild(document.createTextNode(\"Show Leaderboards\"));\n\n\tdocument.getElementById('col_right').appendChild(toggler);\n\n\tgetLeaderboard();\n\n\tsetInterval(function() {\n\t\tgetLeaderboard();\n\t}, 1000 * 30);\n}", "title": "" }, { "docid": "7de1febda673f35238a2d71a86445f33", "score": "0.5303282", "text": "function updatePlayerNames(){\n \n if(player0Name === undefined || player0Name.trim().length === 0){\n player0Name = 'Player 1'\n }\n \n if(player1Name === undefined || player1Name.trim().length === 0){\n player1Name = 'Player 2'\n }\n \n document.getElementById('name-0').textContent = player0Name;\n document.getElementById('name-1').textContent = player1Name;\n}", "title": "" }, { "docid": "9415f8fadff12f3e23bf54567f8a5534", "score": "0.5298962", "text": "function updateNewGroupPlayerList(selectedPlayerId, selectedPlayerName){\n\tvar $lis = $('ol li');\n\tfor(var i=0; i < $lis.length; i++)\n\t{\n\t\tif ($('ol li:eq(' + i + ')').text() == ''){\n\t\t\t$('ol li:eq(' + i + ')').text(selectedPlayerName);\n\t\t\t$('ol li:eq(' + i + ')').attr(\"id\", selectedPlayerId);\n\t\t\treturn;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "bcb2641bc4c125eb60c18630117118be", "score": "0.52979785", "text": "function jsonLeaderboard(data) {\r\n\r\n var info = [];\r\n for (var i = 0; i < data.length; i++) {\r\n var gamePlayers = data[i].gamesPlayers;\r\n console.log(gamePlayers);\r\n\r\n for (var j = 0; j < gamePlayers.length; j++) {\r\n var newPlayer = info.find(player => player.email == gamePlayers[j].player.email);\r\n if (newPlayer == undefined) {\r\n var player = {\r\n\r\n email: '',\r\n totalScores: 0,\r\n win: 0,\r\n losses: 0,\r\n tied: 0\r\n }\r\n\r\n player.email = gamePlayers[j].player.email;\r\n\r\n\r\n\r\n var playerScore = gamePlayers[j].score != null ? gamePlayers[j].score.score : null;\r\n\r\n\r\n\r\n if (playerScore === 1.0) {\r\n player.win++;\r\n } else if (playerScore === 0.5) {\r\n player.tied++\r\n } else if (playerScore === 0) {\r\n player.losses++\r\n }\r\n if (playerScore != null) {\r\n player.totalScores = playerScore;\r\n }\r\n\r\n info.push(player);\r\n } else {\r\n var playerScore = gamePlayers[j].score != null ? gamePlayers[j].score.score : null;\r\n\r\n if (playerScore === 1.0) {\r\n newPlayer.win++;\r\n } else if (playerScore === 0.5) {\r\n newPlayer.tied++\r\n } else if (playerScore === 0) {\r\n newPlayer.losses++\r\n }\r\n\r\n if (playerScore != null) {\r\n newPlayer.totalScores += playerScore;\r\n }\r\n\r\n }\r\n }\r\n }\r\n console.log(info);\r\n return info;\r\n\r\n }", "title": "" }, { "docid": "dcae92dfad7e4800f07d819e1ca26d76", "score": "0.529548", "text": "gameslistUpdated(updatedList) {\n this.props.updateGamelist(updatedList);\n }", "title": "" }, { "docid": "c2c32f862122b8b5d891b51e8621d2dc", "score": "0.52901983", "text": "function addToLeaderBoard() {\n leaderBoardDiv = document.createElement(\"div\");\n leaderBoardDiv.setAttribute(\"id\", \"playerInitials\");\n document.getElementById(\"leaderBoard\").appendChild(leaderBoardDiv);\n}", "title": "" }, { "docid": "c34a00b42089f4a77465b8b6f50b0ac4", "score": "0.5287764", "text": "function renderLeaderboard() {\n\n var container = $('#leaderboard');\n container.empty();\n\n for (var i = 0, iLen = (showAll ? repos.length : (repos.length > 10 ? 10 : repos.length)); i < iLen; i++) {\n var repo = repos[i];\n var elem = $(\n '<li class=\"' + (repo.language || '').toLowerCase() + ' place' + (i + 1) + '\">' +\n '<a href=\"' + (repo.homepage ? repo.homepage : repo.html_url) + '\">' +\n (i > 9 ? '' : '<span class=\"place place' + (i + 1) + '\">' + (i + 1) + '</span>') +\n '<span class=\"name\">' + repo.full_name + '</span><br />' +\n repo.description + '<br />' +\n '<span class=\"details\">' +\n 'Forks: ' + repo.forks +\n ' &nbsp;&nbsp;&bull;&nbsp;&nbsp; Watchers: ' + repo.watchers +\n ' &nbsp;&nbsp;&bull;&nbsp;&nbsp; Open Issues: ' + repo.open_issues +\n ' &nbsp;&nbsp;&bull;&nbsp;&nbsp; Last Updated: ' + $.timeago(repo.updated_at) +\n '</span>' +\n (i > 9 ? '' : '<span class=\"score\">' +\n (i == 0 ? '<span class=\"trophy\"></span>' : '') +\n repo.leaderboardScore +\n '</span>') +\n '</a>' +\n '</li>');\n container.append(elem);\n }\n\n if (showAll) {\n $('#leaderboardShowAll').text('View only top ten repos');\n }\n else {\n $('#leaderboardShowAll').text('View all ' + repos.length + ' repos');\n }\n\n }", "title": "" }, { "docid": "e73fe379e63bc3ea3e3cbdc764bca6ce", "score": "0.52835774", "text": "function setRank() {\n for(let i = 0; i < allStatsArray.length; i++) {\n if(allStatsArray[i].nick === userNickname) {\n userRank = (i+1);\n }\n }\n}", "title": "" }, { "docid": "9a9db46968857640d21b6de2345d9ace", "score": "0.5279859", "text": "function setGamePlayers(n) {\n\t\tnumPlayers = Math.max(n,1);\n\t\tnumPlayers = Math.min(n,5);\n\t\tdocument.getElementById(\"idNumPlayers\").value = numPlayers;\n\n\t\t// Trim extra entries\n\t\tfor (var i=players.length; i>n; i--) {\n\t\t\tvar p = players.pop();\n\t\t\tp.erase();\n\t\t}\n\n\t\t// Add entries\n\t\tfor (var i=players.length; i<n; i++) {\n\t\t\tplayers.push(new Player(i));\n\t\t\tplayers[i].showBallCount();\n\t\t\tplayers[i].showScore();\n\t\t}\n\t\t\n\t\tcanvasState.draw();\n\t}", "title": "" }, { "docid": "d2b2521de80f8c9b6621e44d5493c756", "score": "0.5276261", "text": "drawLeaderboard() {\n const rankedPlayers = this.state.players.sort((a, b) => {\n if (b.points < a.points) return -1;\n if (b.points > a.points) return 1;\n if (a.color < b.color) return -1; // sort by color on ties\n if (a.color > b.color) return 1;\n return 0;\n });\n\n const thisPlayer = rankedPlayers.find((p, idx) => {\n if (p.id === this.state.player.id) {\n this.state.player.rank = idx + 1;\n return true;\n }\n\n return false;\n });\n\n if (thisPlayer) {\n this.setState({\n player: this.state.player,\n });\n }\n\n const ctx = this.canvas.getContext('2d');\n ctx.beginPath();\n const rectHeight = 130;\n const rectWidth = 170;\n const rectX = window.innerWidth - rectWidth;\n const rectY = 0;\n let xPos;\n let yPos;\n ctx.rect(rectX, rectY, rectWidth, rectHeight);\n ctx.fillStyle = 'rgba(255,0,0,0.3)';\n ctx.fill();\n\n // Print leaderboard data:\n // Draw the leaderboard title:\n ctx.font = '16px Lucida Sans Unicode';\n ctx.textAlign = 'center';\n ctx.textBaseline = 'middle';\n ctx.fillStyle = '#FFFFFF';\n ctx.fillText('Leaderboard', rectX + (rectWidth / 2) - 10, rectY + (rectHeight / 2) - 45);\n\n // Draw the ranks with corresponding player names and points:\n ctx.font = '10px Lucida Sans Unicode';\n rankedPlayers.forEach((player, i) => {\n if (player.name !== '') {\n ctx.fillStyle = player.color;\n ctx.textAlign = 'left';\n xPos = rectX + (rectWidth / 2) - 80;\n yPos = rectY + (rectHeight / 2) - 25 + 15 * i;\n ctx.fillText(`${i + 1}. ${player.name}`, xPos, yPos);\n ctx.textAlign = 'right';\n xPos = rectX + (rectWidth / 2) + 60;\n yPos = rectY + (rectHeight / 2) - 25 + 15 * i;\n ctx.fillText(player.points, xPos, yPos);\n ctx.fillStyle = '#FFFFFF';\n }\n });\n ctx.closePath();\n }", "title": "" }, { "docid": "011fb2b2e95b57735aa8a13a0190e058", "score": "0.52630484", "text": "function displayLeaderBoard(numberOfQuestions) {\n\nconsole.log(chalk.yellow(\"GAME OVER! Your Final Score : \" + score + \"/\" + numberOfQuestions) + \"\\n\");\n\n//Leaderboard\nconsole.log(chalk.white.bgRed.bold(\"Current Leaderboard\"));\nconsole.log(\"--------------------------\");\n\nvar userBeatHighScore = false;\n\nfor(var i = 0; i < highScores.length; i++) {\n\n console.log(highScores[i].name + \" : \" + highScores[i].score);\n if(score >= highScores[i].score) {\n userBeatHighScore = true;\n }\n\n}\n\nconsole.log(\"--------------------------\");\n\nif(userBeatHighScore) {\n console.log(\"--------------------------\");\n console.log(\"You're a Wizard \" + userName + \"!!\")\n console.log(\"Think you should be up there? Ping me with a screenshot and I'll add you! \");\n} else {\n console.log(chalk.yellow(\"You are a Muggle \" + userName + \"!\"));\n}\n\n}", "title": "" }, { "docid": "83ac92a4ba27564b8e3d305d95ff83b7", "score": "0.5262566", "text": "function bestMatch (newScore) {\n var existingList = friends;\n console.log(existingList, \"Exisiting List\");\n for(i = 0; i < friends.length; i++) {\n var existingListScore = existingList[i].scores;\n console.log(existingListScore, \"Exisiting List Score\");\n }\n}", "title": "" }, { "docid": "aceba14d5b77e0daf6b0ce916be5b2e6", "score": "0.52565753", "text": "function doScoreboardUpdate()\n{\n const memberList = getCompetitors_();\n // Assemble a per-competitor object, indexed by link (since link is printed on the log sheet).\n /** @type {Object <string, Object <string, any>>} */\n const members = memberList.reduce((acc, member) => {\n const uid = member[2];\n const link = `https://www.mousehuntgame.com/profile.php?snuid=${uid}`;\n acc[link] = {\n name: member[0],\n uid: uid,\n link: link,\n historyLink: `https://script.google.com/macros/s/AKfycbxvvtBNQ66BBlB-md1jn_y-TlujQf1ytDkYG-7nEAG4SDaecMFF/exec?uid=${uid}`,\n startSilver: 0,\n startGold: 0,\n startRecordDate: new Date(2099, 0, 1),\n currentRecordDate: new Date(0),\n gold: 0,\n silver: 0,\n bronze: 0,\n lastSeen: new Date(0),\n lastCrown: new Date(0),\n data: []\n };\n return acc;\n }, {});\n\n // Load the current datalog (which is sorted chronologically and by member).\n const wb = SpreadsheetApp.getActive();\n const log = wb.getSheetByName('Daily Log');\n sortLog_(log);\n const data = log.getDataRange().getValues();\n const headers = data.shift();\n\n // Assign the relevant data indexes.\n const linkIndex = headers.indexOf('Link');\n const silverIndex = headers.indexOf(\"Silver\");\n const goldIndex = headers.indexOf(\"Gold\");\n const bronzeIndex = headers.indexOf(\"Bronze\");\n const seenIndex = headers.indexOf(\"Last Seen\");\n const crownIndex = headers.indexOf(\"Last Crown\");\n\n // First, loop through and collate each row with each member so that starting counts can be assessed.\n data.forEach(function (row) { members[row[linkIndex]].data.push(row); });\n\n const competitionBegin = new Date(Date.UTC(COMP_YEAR, 0, 1));\n const output = [];\n for (var link in members) {\n const m = members[link];\n // Compute the starting counts, and determine the most recent counts.\n m.data.forEach(function (rowData) {\n const recordDate = new Date(rowData[seenIndex]);\n // Only records with a relevant LastSeen value have been collected (within 7 days of the comp start). The\n // first one that is non-zero is used as the starting count record (unless others records closer to the\n // beginning of the competition are available).\n if (rowData[bronzeIndex]-0 + rowData[silverIndex]-0 + rowData[goldIndex]-0 > 0\n && (recordDate < m.startRecordDate || (recordDate < competitionBegin && recordDate >= m.startRecordDate)))\n {\n m.startSilver = rowData[silverIndex];\n m.startGold = rowData[goldIndex];\n m.startRecordDate = recordDate;\n }\n // Update the member's object with this record.\n if (recordDate > m.currentRecordDate)\n {\n m.gold = rowData[goldIndex];\n m.silver = rowData[silverIndex];\n m.bronze = rowData[bronzeIndex];\n m.lastSeen = new Date(rowData[seenIndex]);\n m.lastCrown = new Date(rowData[crownIndex]);\n m.currentRecordDate = recordDate;\n }\n });\n\n // Summarize the member's progress\n output.push([\n 0,\n `=hyperlink(\"${m.link}\",\"${m.name}\")`,\n ((m.silver - m.startSilver) * 1 + (m.gold - m.startGold) * 1),\n m.startSilver,\n m.gold,\n m.silver,\n m.bronze,\n `=hyperlink(\"${m.historyLink}\",\"${(m.gold + m.silver + m.bronze)}\")`,\n m.lastSeen,\n m.lastCrown,\n ]);\n }\n\n // Sort the scoreboard data table by silvers earned.\n output.sort((a, b) => b[2] - a[2]);\n\n // Update the ranks in the sorted scoreboard.\n let rank = 0;\n output.forEach((row) => { row[0] = ++rank });\n if (output.length)\n {\n wb.getSheetByName(\"Scoreboard\").getRange(2, 1, output.length, output[0].length).setValues(output)\n .getSheet().getRange(\"L1\").setValue(Utilities.formatDate(new Date(), \"GMT\", \"yyyy-MM-dd' 'HH:mm' UTC'\"));\n }\n else\n console.warn('No output for the scoreboard');\n}", "title": "" }, { "docid": "1e400cc8b87cb6a1c382e3000f5538cf", "score": "0.5250338", "text": "constructor(username, maxhp, gold, av, Wlvl, Dlvl, Tlvl, Clvl) {\n this.name = username;\n this.maxhp = parseInt(maxhp);\n this.hp = parseInt(maxhp);\n this.gold = parseInt(gold);\n this.av = parseInt(av);\n this.Wlvl=Wlvl;\n this.Dlvl=Dlvl;\n this.Tlvl=Tlvl;\n this.Clvl=Clvl;\n this.followers = {};\n }", "title": "" }, { "docid": "be587ef6022ccd081d17ad755cec6c59", "score": "0.5239325", "text": "function printObj(players) {\n var list = document.getElementById('teams');\n var index = 0;\n\n\n if (list !== null) {\n players.reverse();\n while (list.firstChild) {\n list.removeChild(list.lastChild);\n }\n\n\n for (let x in players) {\n //Add to leaderboard\n index = index + 1;\n\n var tr = document.createElement('tr');\n tr.innerHTML = '<th scope=\"row\">' + index + '</th><td>' + players[x].playerName + '</td><td>' + players[x].clues + '/5</td>';\n\n list.appendChild(tr);\n\n //Add marker\n addMarker({\n coords: {\n lat: players[x].playerCoordinates.lat,\n lng: players[x].playerCoordinates.lng\n },\n content: players[x].playerName\n },\n map);\n }\n }\n}", "title": "" }, { "docid": "77df91c5c5670bea57d5dc30c93734fe", "score": "0.5224506", "text": "function updateWeapons(bot, player, pNumber){\n console.log(player)\n let weapons = `<div><div class='selectionLink' data-toggle='collapse' data-target='#${pNumber}weapons'><span class='arrow'>&#9654;</span> Available Weapons</div><div><ul id='${pNumber}weapons' class='collapse'>`;\n let weaponCache;\n for (let key in bot){\n if (key === 'WeaponsAllowed'){\n weaponCache = bot[key];\n }\n }\n for (let weapon in weaponCache){\n weapons += `<li id='${weaponCache[weapon]}' class='${player}weapon'>${weaponCache[weapon]}</li>`\n }\n weapons += `</div>`\n $(`.${pNumber}Stats`).append(weapons);\n loadSelectionEvents('weapons', player);\n}", "title": "" }, { "docid": "c17e96b39f9ffa718ab716c55c9ceb8a", "score": "0.52231234", "text": "function getUser(players){\n console.clear()\n let name = prompt(\"What is your name?\")\n players[1].name = name\n players[0].name = \"Dealer\"\n \n console.log(\"Hello \" + name + \"!\")\n \n}", "title": "" }, { "docid": "2284325635a1fe0fde4fe09dd47c3a43", "score": "0.52212477", "text": "function updatePlayerDisplay() {\n for(let i=0; i<playerCount; i++) {\n nameDisplayList[i].textContent = playerList[i].name + ' ' + boardSpaceList[playerList[i].location].name;\n moneyDisplayList[i].textContent = `$${playerList[i].money}`;\n\n //PLACEHOLDER PLACEHOLDER PLACEHOLDER make it look better after functionality is complete\n //iterates throught players owned property and displayes prop name\n propertyDisplayList[i].textContent = 'Properties owned: ';\n let prop;\n for(let j=0; j<playerList[i].property.length; j++) {\n prop = playerList[i].property[j];\n propertyDisplayList[i].textContent += ' ' + boardSpaceList[prop].name;\n }\n\n railroadDisplayList[i].textContent = `RailRoads Owned: ${playerList[i].railroad}`;\n utilityDisplayList[i].textContent = `Utilities Owned: ${playerList[i].utility}`;\n };\n}", "title": "" }, { "docid": "abfe8f5cc9ddd65efbc4eed16abe5b96", "score": "0.5216167", "text": "function updateHighScore(arr)\n {\n $(\"#scoreList tr\").next().remove(); \n _count = 1;\n \n for(let p in arr)\n {\n _insertToBoard(arr[p].name, arr[p].score, arr[p].date);\n }\n }", "title": "" }, { "docid": "4919e7121f1464aa0775e2da338b93c4", "score": "0.5213744", "text": "switchLeader() {\n let tmp;\n tmp = this.opponent;\n this.opponent = this.leader;\n this.leader = tmp;\n }", "title": "" }, { "docid": "c020f5492f2f6d0e288878796838b897", "score": "0.521214", "text": "function checkLeaderboard() {\n for (let i = 0; i < 10; i++) {\n if (score > leaderboardCollection.leaderboard[i].score) {\n let today = new Date();\n let dd = String(today.getDate()).padStart(2, '0');\n let mm = String(today.getMonth() + 1).padStart(2, '0');\n let yyyy = today.getFullYear();\n today = dd + '/' + mm + '/' + yyyy;\n leaderboardCollection.leaderboard.splice(i, 0, {\"name\": name, \"score\": score, \"date\": today});\n break;\n }\n }\n}", "title": "" }, { "docid": "6f34863075292193896902668c89d29b", "score": "0.52098787", "text": "function updateList() {\n\n var pickedPlayers = [];\n\n // Select all players which are currently picked\n for (var i = 0; i < currentList.length; i++) {\n\n var currentId = currentList[i].getAttribute('data-player');\n\n for (var j = 0; j < common.currentTeamModel.length; j++) {\n\n // Reset highlighting\n currentList[i].classList.remove('picked');\n\n if (common.currentTeamModel[j].indexOf(currentId) > -1) {\n\n pickedPlayers.push(i);\n }\n }\n }\n\n // Highlight all the picked players\n for (var k = 0; k < pickedPlayers.length; k++) {\n\n currentList[pickedPlayers[k]].classList.add('picked');\n }\n }", "title": "" }, { "docid": "e8086b39277485db8a9e4e349ed7c2e7", "score": "0.52042913", "text": "function updatePaddles(playerList) {\n var players = Object.keys(playerList);\n\n players.forEach(function(player) {\n if (allPlayers.indexOf(player) === -1) {\n if (player === $scope.clientId) {\n clientPaddle = new Paddle('client', playerList[player], player);\n } else {\n gamePaddles[playerList[player]] = new Paddle('foreign', playerList[player], player);\n }\n allPlayers.push(player);\n }\n });\n }", "title": "" }, { "docid": "098982b661cc24f3a84125550b7cb9b1", "score": "0.51955193", "text": "function updateScores (id, key, value) {\n var $prev;\n // New player - score object\n if (value.name) {\n $prev = $(\"#\"+value.name);\n if ($prev.length)\n $prev.text(value.name +' : ' + value.score);\n else\n $scores.append('<p id=\"' + value.name + '\">' + value.name + ' : ' + value.score + '</p>');\n }\n // Update of an existing player - score object\n else if (key == \"score\") {\n $prev = $(\"#\"+id);\n if ($prev.length)\n $prev.text(id+' : ' + value);\n }\n}", "title": "" }, { "docid": "41ce4a101549b330335102065cf0ffc1", "score": "0.51912266", "text": "function loadLeaderboard() {\n // append to #leaderboardRows\n }", "title": "" }, { "docid": "31ac2a0912e184826ee7a0d1544af876", "score": "0.5189607", "text": "function updateLeaderboard() {\n\treturn new Promise((resolve, reject) => {\n\t\tlet totalScore = 0;\n\t\tlet averageScore = 0;\n\t\tlet morphSounds = [\"morph-1.mp3\", \"morph-2.mp3\", \"morph-3.mp3\", \"silence\", \"silence\"];\n\t\tfor(let pid in room.players) {\n\t\t\ttotalScore += room.players[pid].score;\n\t\t}\n\t\taverageScore = totalScore / Object.keys(room.players).length; // mean of the scores\n\n\t\tfor(let pid in room.players) {\n\t\t\tlet $player = $(`#view-leaderboard .player[data-player-id=\"${pid}\"]`); // get this player from the DOM\n\t\t\tlet offset = ((room.players[pid].score - averageScore) / 2) * -1; // calculate the y offset based on deviation from the mean\n\t\t\tlet percent = `${(room.players[pid].score / totalScore) * (100/4)}%`; // calculate percentage width as a ratio of the total score\n\t\t\tlet tmln = new TimelineMax();\t\n\t\t\tlet initialWidth = $player.width(); // get the initial width of the player circles\n\t\t\tlet newWidth;\n\n\t\t\t$player.find('.score').text(room.players[pid].score) // set the player's score in the view\n\n\t\t\ttmln.set($player, { width: percent, onComplete: () => { // first, set the width as percentage\n\t\t\t\t\t\tnewWidth = $player.width(); // in order to get absolute in pixels\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.set($player, { width: initialWidth }) // then set it back to it's initial width, ready for tweening\n\t\t\t\t.to($player, 4, { height: newWidth, width: newWidth, ease: Power3.easeInOut, delay: 0.5 }) // tween the width and height\n\t\t\t\t.to($player, 3, { y: offset, ease: Power3.easeInOut, onStart: _playRandomMorph }, \"-=3\") // and tween the y offset\n\t\t\t\t.staggerTo('#view-leaderboard .content-wrapper', 1.2, { opacity: 1, ease: Power4.easeInOut }, 0.1, 3, resolve) // then fade in the player names\n\t\t}\n\t\tfunction _playRandomMorph(){\n\t\t\tvar randSound = morphSounds.splice(rand(0, morphSounds.length - 1), 1);\n\t\t\trandSound == \"silence\" ? null : oneShotSfx(randSound, 500);\n\t\t}\n\t})\t\t\n}", "title": "" }, { "docid": "6cdf4b4a882450a8cc80d1a20cd686f9", "score": "0.51868635", "text": "function PlayerStat() {\n for (var i = 0; i < numberOfPlayers; i++) {\n players[i] = new Player(prompt(\"What is player \" + (i + 1) + \"'s name?\"), prompt(\"What is player \" + (i + 1) + \"'s number guess?\"));\n }\n}", "title": "" }, { "docid": "6a20daa97c95903d56645161f0c3e281", "score": "0.51652473", "text": "updateTeamName(gameAry, oldName, newName) {\n for(var i in gameAry){\n if(gameAry[i].team1 == oldName) {\n gameAry[i].team1 = newName;\n }\n if(gameAry[i].team2 == oldName) {\n gameAry[i].team2 = newName;\n }\n }\n }", "title": "" }, { "docid": "308256eafae10a90dfda47a095c26d86", "score": "0.51628923", "text": "function updatePlayersPanelScores() {\n\n // Update score for all players\n for (var i in players) {\n\tdocument.getElementById('p'+i+'PanelScore').innerHTML = players[i].score;\n\n }\n\n\n}", "title": "" }, { "docid": "3484a50f1f24482b6478d25483a84441", "score": "0.5161637", "text": "function updateGuessedLetters(newgame, char, list, matched) {\n\tif (newgame) {\n\t\t//empty the list\n\t\tlist.splice(0, list.length);\t\n\t}\n\t//add char if not in the list\n\telse {\n\t\t//if this char is a match\n\t\tif (matched) {\n\t\t\tchar = `<span class='orange'> ${char} </span>`;\n\t\t}\n\t\tif (list.indexOf(char) === -1) {\n\t\t\tlist.push(char);\n\t\t\tlist.sort();\n\t\t\tupdateGuessRemaining(false, matched);\n\t\t}\n\t}//else \n\tdisplayGuessedLetters(list);\n}", "title": "" }, { "docid": "7b1e6ea915a110ae6d736b23c44821b4", "score": "0.51531637", "text": "function update_game_info() {\n // Get the date the user last played\n var last_play = document.getElementById('last_play');\n if (persistentData.hasNeverPlayed()) {\n text = \"Greetings! I haven't seen you before. Please select an opponent type and start playing!\";\n } else {\n text = \"Welcome back! You last played on \" + persistentData.getLastPlay();\n }\n last_play.innerHTML = text;\n // Update the user scores\n var score = document.getElementById('score');\n var scores = persistentData.getScores();\n score.innerHTML = 'Wins: ' + scores.win + ' Losses: ' + scores.loss + ' Ties: ' + scores.tie;\n // Show the plea for help if the player has won a bunch\n if (scores.win >= 10) {\n var plea = document.getElementById('plea_for_help');\n plea.classList.remove('gone');\n }\n}", "title": "" }, { "docid": "3465da8a416cdacca732f4ebfa101e7f", "score": "0.51500756", "text": "function makeList(players, callback) {\n var listBoard = [];\n if (players.length == 0) {\n callback();\n }\n for (var i = 0; i < players.length; i++) {\n var hrac = players[i];\n listBoard[i] = {\n 'id': hrac._id,\n 'name': hrac.name,\n 'sex': hrac.sex,\n 'member': hrac.member,\n 'gamescount': hrac.gamescount,\n 'highscore': hrac.highscore,\n 'strikes': hrac.strikes,\n 'spares': hrac.spares,\n 'games': hrac.games\n };\n if (listBoard.length == players.length) {\n console.log('Celkem hracu: ' + players.length);\n callback(listBoard)\n }\n\n }\n}", "title": "" }, { "docid": "70c99c6098e67720b4b314f73ae77525", "score": "0.51489115", "text": "function appendPlayers(ret){\n // First, delete all players on the list\n $(\"#leaderboard tr\").empty();\n $(\"#leaderboard\").append(\"<tr><th>Player</th><th>Points</th></tr>\");\n\n // Next, add the new list of players to the list\n for (var i = 0; i < ret.length; i++){\n var player = ret[i];\n var str;\n if (player.winner){\n str = \"<tr class='winner'>\";\n } else {\n str = \"<tr class='notWinner'>\"\n }\n str += \"<td>\" + player.name + \"</td>\";\n str += \"<td>\" + player.score + \"</td>\";\n str += \"</tr>\";\n $(\"#leaderboard\").append(str);\n }\n\n}", "title": "" }, { "docid": "4ed3982f305adcc40728bbcbe0f8860f", "score": "0.5148209", "text": "function grabLocalStorage() {\n if(localStorage.leaderboard === undefined){\n return;\n } else{\n var grabData = localStorage.getItem('leaderboard');\n var dataParsed = JSON.parse(grabData);\n for (var i = 0; i < dataParsed.length; i++) {\n var newPlaya = new Player(dataParsed[i].name, dataParsed[i].score);\n winners.push(newPlaya);\n }\n }\n\n\n //function that 1. sorts an array 2. loops through the array and returns the lowest then next lowest, etc 3. checks that for every a, there is no b that is smaller (that is how it decides) 4. while loop - after all the scores are sorted smallest to largest, if the array is longer than 10, the 1st in the array (smallest) is shifted off\n winners.sort((a,b) => {\n if(a.score > b.score){\n return 1;\n } else {\n return -1;\n }\n });\n while (winners.length > 10) {\n winners.shift();\n }\n}", "title": "" }, { "docid": "f534d39aa8a4c68070a07d564ee80334", "score": "0.5145004", "text": "function AddOrReplacePlayer(playerToAdd) {\n let newPlayerList = [];\n\n let addedPlayer = false;\n Players.forEach(function (player) {\n if (player.api_key === playerToAdd.api_key) {\n writeToChat(player.name + \" rejoined the game\");\n playerToAdd.status = ((player.stack === 0 && player.bet === 0) ? 'busted' : 'active');\n playerToAdd.id = player.id;\n playerToAdd.stack = player.stack;\n playerToAdd.bet = player.bet;\n playerToAdd.last_action = player.last_action;\n playerToAdd.hole_cards = player.hole_cards;\n\n newPlayerList.push(playerToAdd);\n addedPlayer = true;\n } else {\n //existing player\n newPlayerList.push(player);\n }\n });\n\n if (!addedPlayer) {\n //new player\n newPlayerList.push(playerToAdd);\n\n if (gameState.game_started === true) {\n playerToAdd.status = \"waiting\";\n }\n }\n\n Players = newPlayerList;\n}", "title": "" }, { "docid": "929a6a8c624d83a9857c09327a8aee44", "score": "0.5140714", "text": "function updateGameList(autoScroll = false)\n{\n\tlet gamesBox = Engine.GetGUIObjectByName(\"gameList\");\n\tlet highlightedBuddy = Engine.ConfigDB_GetValue(\"user\", \"lobby.highlightbuddies\") == \"true\";\n\tlet compTrans = (compTrans, obj, att, defAtt) => compTrans[att] && compTrans[att](obj) || obj[att] || obj[defAtt];\n\n\tif (gamesBox.selected > -1)\n\t{\n\t\tlet game = g_GameList[gamesBox.selected];\n\t\tg_SelectedGameIP = game.stunIP ? game.stunIP : game.ip;\n\t\tg_SelectedGamePort = game.stunPort ? game.stunPort : game.port;\n\t\t// if (g_AutoScrollGameListFromSelection && g_GameList.length > 0)\n\t\t// \twarn(g_SelectedGameIP + \":\" + g_SelectedGamePort);\n\t}\n\n\tg_GameList = Engine.GetGameList().map(game => {\n\t\tgame.hasBuddies = 0;\n\t\tgame.observeNum = 0;\n\t\tgame.buddies = 0;\n\n\t\t// Compute average rating of participating players\n\t\tlet playerRatings = [];\n\n\t\tfor (let player of stringifiedTeamListToPlayerData(game.players))\n\t\t{\n\t\t\tlet playerNickRating = splitRatingFromNick(player.Name);\n\n\t\t\tif (player.Team != \"observer\")\n\t\t\t\tplayerRatings.push(playerNickRating.rating || g_DefaultLobbyRating);\n\n\t\t\tgame.hasUser = game.hasUser || multiplayerName(g_Username) == playerNickRating.nick || playerNickRating.nick == g_Username;\n\n\t\t\tif (game.hasUser)\n\t\t\t\tgame.hasBuddies = 3;\n\t\t\t// Sort games with playing buddies above games with spectating buddies\n\t\t\tif (game.hasBuddies < 2 && g_Buddies.indexOf(playerNickRating.nick) != -1)\n\t\t\t\tgame.hasBuddies = player.Team == \"observer\" ? 1 : 2;\n\n\t\t\tif (!player.Offline && g_Buddies.indexOf(playerNickRating.nick) != -1)\n\t\t\t{\n\t\t\t\t++game.buddies;\n\t\t\t}\n\t\t\t\n\t\t\tif (player.Team == \"observer\")\n\t\t\t\t++game.observeNum;\n\t\t}\n\n\t\tgame.time = 0;\n\t\tif (game.startTime)\n\t\t\tgame.time = Math.round((Date.now() - game.startTime*1000)/(1000*60));\n\n\t\tgame.gameRating =\n\t\t\tplayerRatings.length ?\n\t\t\t\tMath.round(playerRatings.reduce((sum, current) => sum + current) / playerRatings.length) :\n\t\t\t\tg_DefaultLobbyRating;\n\n\t\tif (!hasSameMods(JSON.parse(game.mods), g_EngineInfo.mods))\n\t\t\tgame.state = \"incompatible\";\n\n\t\treturn game;\n\t}).filter(game => !filterGame(game)).sort((a, b) => {\n\t\tfor (let sort of g_GamesSort)\n\t\t{\n\t\t\tif (gamesBox[\"hidden_\" + sort.name])\n\t\t\t\tcontinue;\n\t\t\t\t// (obj.hasBuddies || obj.hasUser == g_Username ? 1 : 2),\n\t\t\tlet ret = cmpObjs(a, b, sort.name, {\n\t\t\t\t'buddy': obj => obj.buddies,\n\t\t\t\t'name': obj => g_GameStatusOrder.indexOf(obj.state) + obj.name.toLowerCase(),\n\t\t\t\t'mapName': obj => translate(obj.niceMapName),\n\t\t\t\t'nPlayers':\tobj => obj.maxnbp\n\t\t\t}, sort.order);\n\n\t\t\tif (ret)\n\t\t\t\treturn ret;\n\t\t}\n\t\treturn 0;\n\t});\n\n\tlet list_buddy = [];\n\tlet list_buddies = [];\n\tlet list_name = [];\n\tlet list_mapName = [];\n\tlet list_mapSize = [];\n\tlet list_mapType = [];\n\tlet list_nPlayers = [];\n\tlet list_gameRating = [];\n\tlet list_time = [];\n\tlet list = [];\n\tlet list_data = [];\n\tlet selectedGameIndex = -1;\n\t\n\tfor (let i in g_GameList)\n\t{\n\t\tlet game = g_GameList[i];\n\t\tlet gameName = escapeText(game.name);\n\t\tlet mapTypeIdx = g_MapTypes.Name.indexOf(game.mapType);\n\n\t\tif ((g_SelectedGameName && game.name == g_SelectedGameName) || (game.stunIP && (game.stunIP == g_SelectedGameIP && game.stunPort == g_SelectedGamePort)) || (!game.stunIP && (game.ip == g_SelectedGameIP && game.port == g_SelectedGamePort)))\n\t\t{\n\t\t\tselectedGameIndex = +i;\n\t\t\tg_SelectedGameName = \"\";\n\t\t}\n\n\t\tlist_buddy.push((game.hasBuddies || game.hasUser ? setStringTags(\n\t\t\tgame.hasUser ? g_UserSymbol : g_BuddySymbol,\n\t\t\thighlightedBuddy && game.hasUser ? g_UserStyle :\n\t\t\thighlightedBuddy && game.hasBuddies ? g_GameColors[game.state].buddyStyle :\n\t\t\tg_GameColors[game.state].style)\n\t\t\t: \"\")+setStringTags(game.buddies ? \" \" + game.buddies : \"\", { \"color\": \"255 215 0\" }));\n\n\t\tlet fgod = JSON.parse(game.mods).some(mod => mod[0].startsWith(\"fgod\"));\n\t\tlist_name.push(setStringTags(gameName, fgod ? { \"color\": \"yellow\" } : highlightedBuddy && game.hasUser ? g_UserStyle :\n\t\t\thighlightedBuddy && game.hasBuddies ? g_GameColors[game.state].buddyStyle : g_GameColors[game.state].style));\n\t\tlist_mapName.push(translateMapTitle(game.niceMapName));\n\t\tlist_mapSize.push(translateMapSize(game.mapSize));\n\t\tlist_mapType.push(g_MapTypes.Title[mapTypeIdx] || \"\");\n\t\tlet ob = game.observeNum ? setStringTags(\" +\" + game.observeNum + \"\", { \"color\": \"255 215 0\" }) : \"\";\n\t\t\t\n\t\tlist_nPlayers.push(game.nbp + \"/\" + game.maxnbp + ob);\n\t\tlist_gameRating.push(game.gameRating);\n\t\tlist.push(gameName);\n\t\tlist_data.push(i);\n\t\tlist_time.push(game.time + \"m\");\n\t}\n\n\tgamesBox.list_buddy = list_buddy;\n\t// gamesBox.list_buddies = list_buddies;\n\tgamesBox.list_name = list_name;\n\tgamesBox.list_mapName = list_mapName;\n\tgamesBox.list_mapSize = list_mapSize;\n\tgamesBox.list_mapType = list_mapType;\n\tgamesBox.list_nPlayers = list_nPlayers;\n\tgamesBox.list_gameRating = list_gameRating;\n\tgamesBox.list_time = list_time;\n\t\n\t// Change these last, otherwise crash\n\tgamesBox.list = list;\n\tgamesBox.list_data = list_data;\n\n\tgamesBox.auto_scroll = autoScroll;\n\tgamesBox.selected = selectedGameIndex;\n\n\tupdateGameSelection();\n\tupdatePlayerGamesNumber();\n}", "title": "" }, { "docid": "1cf111339972d93b2cb20edc4d924c49", "score": "0.5136844", "text": "function aNewOne(newplayer){\n\n const findnewplayer = allplayers.find(aplayer => aplayer.name === newplayer);\n\n if (findnewplayer !== undefined){\n return(\n alert(\"This player already exsits. Please enter a unique name\")\n )\n }\n\n const newplayeradded= {id: allplayers.length +1 , name: newplayer, score: 0}\n // console.log(newplayeradded);\n const arryPlusOnePlayer = [...allplayers,newplayeradded]\n\n set_players(arryPlusOnePlayer); \n}", "title": "" }, { "docid": "4512a7c9741ce734d10daa0d653850c3", "score": "0.51301", "text": "_updateGame({board, player1, player2, matched}) {\n this.setState({\n board: board,\n player1: player1,\n player2: player2,\n matched: matched,\n });\n }", "title": "" }, { "docid": "62bbb2d8f1a58ee0dffb1f221dd5d5d8", "score": "0.51260203", "text": "function makeBoard () {\n for (let i = 0; i < width * height; i++) {\n const cell = document.createElement('div')\n grid.appendChild(cell)\n cells.push(cell)\n }\n for (let j = width * 3; j < width * 4; j++) {\n cells[j].style.borderBottom = '2px solid rgb(74, 74, 155)'\n }\n for (let k = 0; k < 16; k++) {\n const littleCell = document.createElement('div')\n littleGrid.appendChild(littleCell)\n littleCells.push(littleCell)\n }\n\n // leaderboard sstuff\n // for (let i = 0; i < 10; i++) {\n // const leaderListItem = document.createElement('li')\n // leaderListItem.innerHTML = '<span id=\"span1\">span tag</span><span id=\"span2\">tag 2</span>'\n // leaderListItem.classList.add('leaderListItem')\n // leaderBoard.append(leaderListItem)\n // }\n // ***************************************************************\n // testing adding info from arrays to the leaderboard;\n // leaderBoardArray = leaderBoardArray.sort((function(index) {\n // return function(a, b) {\n // return (a[index] === b[index] ? 0 : (a[index] > b[index] ? -1 : 1))\n // }\n // })(1))\n // const items = document.querySelectorAll('li')\n // for (let i = 0; i < leaderBoardArray.length; i++) {\n // items[i].innerHTML = `<span id=\"span1\">${leaderBoardArray[i][0]}</span><span id=\"span2\">${leaderBoardArray[i][1]}</span>`\n // }\n // *************************************************************** \n }", "title": "" }, { "docid": "1bee611e74effe632bc5151e11464195", "score": "0.5125998", "text": "function BoardMember (name, homeState, training) {\n this.name = name;\n this.homeState = homeState;\n this.training = training\n }", "title": "" } ]
e3901fb905f8754cd3e03e5e51740175
Runtime helper for resolving filters
[ { "docid": "ad6377ff5ebc9b0df681353611350406", "score": "0.0", "text": "function resolveFilter (id) {\n return resolveAsset(this.$options, 'filters', id, true) || identity\n}", "title": "" } ]
[ { "docid": "6bae1fd43896c5c160d7c20054711668", "score": "0.6792624", "text": "function resolveFilter(id){return resolveAsset(this.$options,'filters',id,true)||identity;}", "title": "" }, { "docid": "6bae1fd43896c5c160d7c20054711668", "score": "0.6792624", "text": "function resolveFilter(id){return resolveAsset(this.$options,'filters',id,true)||identity;}", "title": "" }, { "docid": "6bae1fd43896c5c160d7c20054711668", "score": "0.6792624", "text": "function resolveFilter(id){return resolveAsset(this.$options,'filters',id,true)||identity;}", "title": "" }, { "docid": "dd8b65d403e195cf6b9898f9efda4616", "score": "0.6689732", "text": "function createFilters() {\n\n}", "title": "" }, { "docid": "0a94128e1275b6151a230e19d2fc5b2f", "score": "0.66795343", "text": "filterForFrontend() {}", "title": "" }, { "docid": "d26447e7298a3135f7750d47e1df51e6", "score": "0.6602312", "text": "function executeOnFilters(fn) {\n\t var appState = getAppState();\n\t var globalFilters = [];\n\t var appFilters = [];\n\n\t if (globalState.filters) globalFilters = globalState.filters;\n\t if (appState && appState.filters) appFilters = appState.filters;\n\n\t globalFilters.concat(appFilters).forEach(fn);\n\t }", "title": "" }, { "docid": "2b921efe01df5e41e8488c7b7ac7788f", "score": "0.6572347", "text": "function resolveFilter (id) {\n\t return resolveAsset(this.$options, 'filters', id, true) || identity\n\t}", "title": "" }, { "docid": "2b921efe01df5e41e8488c7b7ac7788f", "score": "0.6572347", "text": "function resolveFilter (id) {\n\t return resolveAsset(this.$options, 'filters', id, true) || identity\n\t}", "title": "" }, { "docid": "e8234d3b1b0c92f25244b5a3e3558b0a", "score": "0.6558848", "text": "apply(Vue) {\n Object.keys(this.filters)\n .forEach(filterName => Vue.filter(filterName, this.filters[filterName]));\n }", "title": "" }, { "docid": "0709de60cd1668213942cc4ddac28a8a", "score": "0.6551497", "text": "function resolveFilter(id) {\n\t return resolveAsset(this.$options, 'filters', id, true) || identity;\n\t}", "title": "" }, { "docid": "bb44dff4fa0bd30454eaee4c91473c36", "score": "0.6546134", "text": "function applyFilters()\n /* filter, filtered arg, arg2, ... */\n {\n var args = slice.call(arguments);\n var filter = args.shift();\n\n if ('string' === typeof filter) {\n return _runHook('filters', filter, args);\n }\n\n return MethodsAvailable;\n }", "title": "" }, { "docid": "f24a00c3d1fa2bb084afcccf313880bb", "score": "0.65372044", "text": "function applyFilters( /* filter, filtered arg, arg2, ... */\n ) {\n var args = Array.prototype.slice.call(arguments);\n var filter = args.shift();\n if (typeof filter === 'string') {\n return _runHook('filters', filter, args);\n }\n return MethodsAvailable;\n }", "title": "" }, { "docid": "2c61522b6deb82b7c45ac7e0ef5ac270", "score": "0.65234965", "text": "static applyFilters(swigEngine) {\n if (View.filtersMap != null) {\n for (let filterName in View.filtersMap) {\n if (View.filtersMap.hasOwnProperty(filterName)) {\n swigEngine.setFilter(filterName, View.filtersMap[filterName]);\n }\n }\n }\n }", "title": "" }, { "docid": "ce34fa89f44ba74c2cac260ccfb7b3df", "score": "0.6521426", "text": "function resolveFilter (id) {\n return resolveAsset(this.$options, 'filters', id, true) || identity\n }", "title": "" }, { "docid": "cef624637b040b8ef6dbe80d212a4e06", "score": "0.6505626", "text": "setFilter(filter){\n }", "title": "" }, { "docid": "c60491ebc96f9f4fe42cec91012f1c74", "score": "0.6385557", "text": "addFilters() {\n if (this.params.where) {\n this.filters.push(this.expand(this.params.where));\n }\n }", "title": "" }, { "docid": "d80235e5b6de0d9274d71745b43b208e", "score": "0.6374046", "text": "function resolveFilter (id) {\n return resolveAsset(this.$options, 'filters', id, true) || identity\n }", "title": "" }, { "docid": "d80235e5b6de0d9274d71745b43b208e", "score": "0.6374046", "text": "function resolveFilter (id) {\n return resolveAsset(this.$options, 'filters', id, true) || identity\n }", "title": "" }, { "docid": "d80235e5b6de0d9274d71745b43b208e", "score": "0.6374046", "text": "function resolveFilter (id) {\n return resolveAsset(this.$options, 'filters', id, true) || identity\n }", "title": "" }, { "docid": "d80235e5b6de0d9274d71745b43b208e", "score": "0.6374046", "text": "function resolveFilter (id) {\n return resolveAsset(this.$options, 'filters', id, true) || identity\n }", "title": "" }, { "docid": "fc3183b30aeea1860a7cc75673f5affb", "score": "0.6361013", "text": "function resolveFilter(id) {\n return resolveAsset(this.$options, 'filters', id, true) || identity\n }", "title": "" }, { "docid": "1609c9740a3f28e5713ae23cbb51c971", "score": "0.63547873", "text": "visitVsFilterDefinition(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.6334972", "text": "function setFilters() {}", "title": "" } ]
af93eaa32d8529f6f3f673fbb8ffb389
`path` exists and is a file.
[ { "docid": "a80c608cd695d50454ea15939e99b40a", "score": "0.7497974", "text": "function fileExists(path) {\n return stat(path).then(function (stat) { return stat.isFile(); }, function () { return false; });\n }", "title": "" } ]
[ { "docid": "d395a91b581925f8439044e10acedfab", "score": "0.7861006", "text": "function isFile(path){\n try{ return fs.statSync(path).isFile(); }\n catch(e){ return false; }\n}", "title": "" }, { "docid": "817a63d523006a0de9860dedccdcdc13", "score": "0.78478193", "text": "function isFile(path) {\n var result = false;\n try {\n result = fs.lstatSync(path).isFile();\n } catch (err) {\n }\n return result;\n}", "title": "" }, { "docid": "453080a26c218fde8d230c6a4115443a", "score": "0.7649069", "text": "function isFile(path) {\n try {\n return fs_1.statSync(path).isDirectory() === false;\n }\n catch (err) {\n return false;\n }\n}", "title": "" }, { "docid": "c9923ff59bc2d1e6d9f590e9b29bd27f", "score": "0.7642722", "text": "function fileExists (path) {\n try {\n return fs.existsSync(path)\n } catch (err) {\n return false\n }\n}", "title": "" }, { "docid": "b1e88734b9a8003add28c56648b2a4a2", "score": "0.7615171", "text": "exists(path) {\n return Fs.existsSync(JoinPath(path));\n }", "title": "" }, { "docid": "1eadef4c716b7940bc052b958b4bf745", "score": "0.74373996", "text": "function fileExists(path) {\n return fs.accessAsync(path)\n .then(() => {\n return true;\n })\n .catch((err) => {\n if (err.code === 'ENOENT') {\n return false;\n }\n throw err;\n });\n}", "title": "" }, { "docid": "4530a3ae39442662802fa235a7459b39", "score": "0.7371629", "text": "async function file_exists(path) {\n try {\n await access(path, fs.constants.R_OK);\n return true;\n } catch (err) {\n //console.error(err)\n return false;\n }\n}", "title": "" }, { "docid": "832e9b7158675d346948c8058eada916", "score": "0.7368563", "text": "function ifExistsFunc( path ) {\n try {\n let stat = fs.statSync( path );\n return stat.isFile() || stat.isDirectory();\n } catch ( err ) {\n return false;\n }\n }", "title": "" }, { "docid": "0863494c5c5d9f2483e08857e4700396", "score": "0.73204994", "text": "function fileExists(path)\n{\n // fs.existsSync is deprecated (https://nodejs.org/api/fs.html#fs_fs_exists_path_callback)\n try {\n var stats = fs.statSync(path);\n if (stats.isFile())\n return true;\n }\n catch (err)\n {\n if (err && err.code === 'ENOENT') {\n // file doesn't exist\n } else if (err) {\n } \n }\n return false;\n}", "title": "" }, { "docid": "b26e969818403bc8dd6d38a72281e0be", "score": "0.72609776", "text": "function isFilePath(path) {\n return path.includes('.');\n}", "title": "" }, { "docid": "b26e969818403bc8dd6d38a72281e0be", "score": "0.72609776", "text": "function isFilePath(path) {\n return path.includes('.');\n}", "title": "" }, { "docid": "d0fa88e0efe20a44458a0b84d97494fd", "score": "0.71887684", "text": "function testPath(path) {\n console.log(\">>>>> Processing template path: \", path);\n if (fs.existsSync(path)) {\n return true;\n } else {\n console.error(\"ERROR: Template path does not exist: \", path);\n return false;\n }\n}", "title": "" }, { "docid": "b3f95555623fc0b194bc8ddccef3b1cc", "score": "0.7181504", "text": "function pathExists(path) {\n return fs.accessAsync(path)\n .then(() => true)\n .catch({code: 'ENOENT'}, () => false)\n .catch({code: 'ENOTDIR'}, () => false);\n}", "title": "" }, { "docid": "426853a9e01b164d8ae865d3b0e854ce", "score": "0.71743214", "text": "function fileAlreadyExists(path) {\n if (fs.existsSync(path)) {\n return true;\n }\n else {\n return false;\n }\n}", "title": "" }, { "docid": "28fc52054e2a923b30009df03d80129a", "score": "0.7052006", "text": "function isFile(path){\n return /[jpg|jpeg|png|gif]$/.test(path);\n}", "title": "" }, { "docid": "f11003c5c7fafb1feb9f1ebdeb7f744f", "score": "0.7050334", "text": "function isFileOrFail(path, message) {\n if (!isFile(path)) {\n throw new Error(message);\n }\n return true;\n}", "title": "" }, { "docid": "8fbc17aab736411a912c858b537cbf86", "score": "0.6946523", "text": "isFile(pathFile) {\n return fs.statSync(pathFile).isFile();\n }", "title": "" }, { "docid": "160c532166b251bcc55cc330b5396d9c", "score": "0.69221", "text": "function canWriteTo(path) {\n return exists(path).then(function (exists) {\n if (exists) {\n return fileAccess(path, fs.W_OK);\n }\n else {\n return true;\n }\n });\n}", "title": "" }, { "docid": "f6088cb7dbd060869ae040042698b0b7", "score": "0.68097985", "text": "fileExists(path){\n var filepath = RNFS.DocumentDirectoryPath + path;\n return RNFS.exists(filepath);\n }", "title": "" }, { "docid": "018ed5e6a890291cd148590e03cc2290", "score": "0.67786646", "text": "function checkExist(path, cb) {\n\tfs.exists(path, function(exists) {\n\t\tcb(exists);\n\t});\n}", "title": "" }, { "docid": "9548f6769a0cbc77cd8672fa7c49c0fc", "score": "0.6761944", "text": "function existsSync(path)\n{\n let stat = fse.statSync(path);\n if (stat.isDirectory() || stat.isFile())\n {\n return fse.existsSync(path)\n }\n Log.error('Path is neither a file or a directory. ', Log.chalk.red(path));\n return false;\n\n}", "title": "" }, { "docid": "e859e792283a0eca7569be67ed1ed331", "score": "0.6660808", "text": "function logExistence(path) {\n if (fs.existsSync(path)) {\n console.log(`'${path}' exists.`);\n } else {\n console.log(`'${path}' does not exist.`);\n }\n}", "title": "" }, { "docid": "9c4ac6dc6ff7b0f210c814089f3886b1", "score": "0.6547202", "text": "function isFileSync(path) {\n try {\n return fs_1.statSync(path).isFile();\n }\n catch (e) {\n return false;\n }\n}", "title": "" }, { "docid": "174e126dd8264e70b2d7059904c8aebd", "score": "0.65251994", "text": "function fileExists(filePath) {\n return (0, _fsExtra.access)(filePath).then(() => true).catch(() => false);\n}", "title": "" }, { "docid": "5f242d3fc7461e26bd653b6c809fd7e8", "score": "0.6521878", "text": "function isPathAccessible(path) {\n return path\n ? new Promise(resolve => (0, fs_1.access)(path, err => resolve(err ? false : true)))\n : Promise.resolve(false);\n}", "title": "" }, { "docid": "bb3ad10fa1e2af6109b8a1b5fa1ff8cc", "score": "0.64738125", "text": "function doesFileExist (filepath) {\n return fs.existsSync(filepath)\n}", "title": "" }, { "docid": "3ed4c00a4fe8abef1db50f64a6c44d62", "score": "0.64606667", "text": "async exists (filepath, options = {}) {\n try {\n await this._stat(filepath);\n return true\n } catch (err) {\n if (err.code === 'ENOENT' || err.code === 'ENOTDIR') {\n return false\n } else {\n console.log('Unhandled error in \"FileSystem.exists()\" function', err);\n throw err\n }\n }\n }", "title": "" }, { "docid": "ed9c3dfbfc94c7488c563786d908d4ac", "score": "0.64521855", "text": "checkFile(callback)\n {\n if (fs.existsSync(this.fullPath))\n {\n callback(true);\n }\n else {\n callback(fasle); \n }\n }", "title": "" }, { "docid": "2be5350585c2bb53b141c16311776b6d", "score": "0.6393437", "text": "function fileExists(filePath){\n try{\n return fs.statSync(filePath).isFile();\n }\n catch (err){\n return false;\n }\n}", "title": "" }, { "docid": "f8eff61ded006631f24270a93724fb38", "score": "0.6385083", "text": "function isFile(dirPath)\n{\n return fs.lstatSync(dirPath).isFile();\n}", "title": "" }, { "docid": "05a7a8e3427b1f7c9df60a1c6e523a44", "score": "0.63684523", "text": "static isFile(val) {\n return toString.call(val) === '[object File]';\n }", "title": "" }, { "docid": "7b0f010a9294b118095a85a30c284e01", "score": "0.6354417", "text": "function isFileExisting(filePath) {\n try {\n fs.statSync(filePath);\n return true;\n }\n catch (err) {\n return false;\n }\n}", "title": "" }, { "docid": "2d582e48d26e3df673c9a79b6d7dac19", "score": "0.63072324", "text": "exists(path) {\n return new Promise((resolve, reject) => {\n try {\n assert.assertNotEmpty(path, \"path is not defined\");\n\n logger.i(\"Checking file existence\", path);\n\n __storageManager.exists(path, (error, value) => {\n if (error) {\n logger.e(value);\n reject(value)\n } else {\n resolve(value)\n }\n })\n } catch (e) {\n logger.e(e);\n reject(e);\n }\n });\n }", "title": "" }, { "docid": "2fcc8640dd0ad697532dc73e34de6d70", "score": "0.6299176", "text": "function dirExists(path)\n{\n // fs.existsSync is deprecated (https://nodejs.org/api/fs.html#fs_fs_exists_path_callback)\n try {\n var stats = fs.statSync(path);\n if (stats.isDirectory())\n return true;\n // is a file, so return false\n }\n catch (err)\n {\n if (err && err.code === 'ENOENT') {\n // dir doesn't exist\n } else if (err) {\n } \n }\n return false;\n}", "title": "" }, { "docid": "0204e1e85fc6ce6e5864356b885f0d5b", "score": "0.62875056", "text": "async function checkPath(path) {\n if (! paths.has(path)) {\n let n = path.lastIndexOf(\"/\", path.length - 2);\n let parent = path.substring(0, n + 1);\n let ok = await checkPath(parent);\n if (ok) await addContents(parent);\n }\n return paths.has(path);\n}", "title": "" }, { "docid": "94502218e060e4559e29cfa8bde65679", "score": "0.62707645", "text": "function validatePath(path) {\n if (path == name)\n return true\n}", "title": "" }, { "docid": "acfe775f12c5b91db6dba53d328710cb", "score": "0.6259947", "text": "function isFile(filePath) {\n if (!isExist(filePath)) return false;\n try {\n const stat = fs.statSync(filePath);\n return stat.isFile();\n } catch (e) {\n return false;\n }\n}", "title": "" }, { "docid": "03c735e382a01b3556c705977a42f6ab", "score": "0.6258474", "text": "function fileExists(file) {\n return test('-f', file);\n}", "title": "" }, { "docid": "0e821296aa15ab353b398d0250dec6af", "score": "0.6255842", "text": "function fileExists (filePath) {\n try\n {\n return fs.statSync(filePath).isFile();\n }\n catch (err)\n {\n return false;\n }\n}", "title": "" }, { "docid": "20c1ffe150b08e3acb4e8dc0b79751ee", "score": "0.62303036", "text": "function exists(file) {\n var stats;\n try {\n stats = fs.lstatSync(file);\n if (stats.isFile()) {\n return true;\n }\n }catch (e){\n return false;\n }\n return false; \n }// function", "title": "" }, { "docid": "248d3704621043dc4509846974b779b2", "score": "0.6217419", "text": "static isExistFile(filePath) {\n return fs.existsSync(filePath);\n }", "title": "" }, { "docid": "21ffb6c63f0af6cec296cdc62acee6f6", "score": "0.6204229", "text": "function hasPathImpl()\n{\n\n}", "title": "" }, { "docid": "49bb18bbe31ce7e0a9654a69a6c7a47c", "score": "0.6200323", "text": "function checkIfFileExistCallback(filepath, callback) {\n var isExist = fs.existsSync(filepath);\n if (isExist) {\n callback(true, filepath);\n } else {\n callback(false, filepath);\n }\n}", "title": "" }, { "docid": "7841aa32256f2fe71db3c837575291e2", "score": "0.6192624", "text": "exists() {\n\t\t\treturn file.exists();\n\t\t}", "title": "" }, { "docid": "9dfd0d52ccb2f674380d76f9bbe51876", "score": "0.6192037", "text": "function dirExists(path) {\n return stat(path).then(function (stat) { return stat.isDirectory(); }, function () { return false; });\n }", "title": "" }, { "docid": "9dfd0d52ccb2f674380d76f9bbe51876", "score": "0.6192037", "text": "function dirExists(path) {\n return stat(path).then(function (stat) { return stat.isDirectory(); }, function () { return false; });\n }", "title": "" }, { "docid": "49c3c3365151173d9d0c3c0f7d6fda25", "score": "0.61873347", "text": "isFileInConflict(path) {\n return Index.hasFile(path, 2);\n }", "title": "" }, { "docid": "9e2c7f7a95916d30596e67a52bf228cb", "score": "0.6181073", "text": "function fileAccess(path, mode) {\n if (mode === void 0) { mode = exports.F_OK; }\n return Q.Promise(function (resolve) {\n fs.access(path, mode, function (err) {\n if (err) {\n resolve(false);\n }\n else {\n resolve(true);\n }\n });\n });\n}", "title": "" }, { "docid": "978e0d71e5dc02915765a2225c480b2e", "score": "0.61149305", "text": "function doesFileExist(filePath) {\n\tfilePath = convertFilePath(filePath);\n\tfilePath = filePath.replace(\"file:///\", \"\");\n\tif (!fs.existsSync(filePath)) {//check if Mac OS\n\t\tlet filePath = \"/\" + filePath;\n\t}\n\treturn fs.existsSync(filePath);\n}", "title": "" }, { "docid": "af6541bb6d7b6542fe0cacc1776bcc57", "score": "0.60878086", "text": "hasFile(path, stage) {\n return Index.read()[Index.key(path, stage)] !== undefined;\n }", "title": "" }, { "docid": "65f5a97ed51bfbad1bd2e999b139573e", "score": "0.6068949", "text": "exists ()\n\t{\n\t\t/* Stat de file. */\n\t\tfs.stat (this.path, (err, stat) =>\n\t\t{\n\t\t\t/* Bestaat de file? */\n\t\t\tif (err == null)\n\t\t\t{\n\t\t\t\t/* Ja, roep monitor aan. */\n\t\t\t\tthis.monitor ();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t/* File bestaat niet. Probeer over 10 seconde nog een keer. */\n\t\t\t\tsetTimeout (this.exists.bind (this), 10000);\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "05903f82f0538cbaf8d491248b9d8ae7", "score": "0.60468733", "text": "function _exists(path) {\n if (path.match(/Theme\\/main.js$/) || path.match(/\\/requirejs-config.json$/) || (path.match(/\\/package.json$/) && !path.match(/Theme\\/package.json$/))) {\n// console.log(\"Assuming \" + path + \" does not exist\");\n return false;\n }\n \n return true; // TODO: use $.get(HEAD) to check if it really exists?\n }", "title": "" }, { "docid": "5790e379030c54860822d7ac8ce9778f", "score": "0.6020868", "text": "function isFileOrNot(src) {\n return fs.lstatSync(src).isFile();\n}", "title": "" }, { "docid": "c7b5d6948dfd3afe538ca6a433e424a1", "score": "0.60127264", "text": "function exists(path, errorMessage) {\n if (!fs.existsSync(path)) {\n trace.debug(errorMessage);\n throw new Error(errorMessage);\n }\n}", "title": "" }, { "docid": "b782d50fa76c2265693ae1023b70dc0e", "score": "0.5981575", "text": "function isFilorNot(dirpath) {\n // check extension\n return fs.lstatSync(dirpath).isFile();\n}", "title": "" }, { "docid": "f217da083de33d993ee382ff1c7b6703", "score": "0.59648937", "text": "async function checkAccess(path) {\n try {\n await fs.access(path);\n } catch (err) {\n console.log(err)\n throw \"path does not exist\"\n }\n}", "title": "" }, { "docid": "522568834cb6fa1cf700e222693384ed", "score": "0.59508234", "text": "function exists(file) {\n try {\n if (fs.statSync(file).isFile()) {\n return true;\n }\n } catch (e) {\n return false;\n }\n}", "title": "" }, { "docid": "522568834cb6fa1cf700e222693384ed", "score": "0.59508234", "text": "function exists(file) {\n try {\n if (fs.statSync(file).isFile()) {\n return true;\n }\n } catch (e) {\n return false;\n }\n}", "title": "" }, { "docid": "522568834cb6fa1cf700e222693384ed", "score": "0.59508234", "text": "function exists(file) {\n try {\n if (fs.statSync(file).isFile()) {\n return true;\n }\n } catch (e) {\n return false;\n }\n}", "title": "" }, { "docid": "522568834cb6fa1cf700e222693384ed", "score": "0.59508234", "text": "function exists(file) {\n try {\n if (fs.statSync(file).isFile()) {\n return true;\n }\n } catch (e) {\n return false;\n }\n}", "title": "" }, { "docid": "135ea56a68f9e9916cee61c62fc31615", "score": "0.59402335", "text": "async function exists(filePath) {\n try {\n await Deno.lstat(filePath);\n return true;\n } catch (err) {\n if (err instanceof Deno.errors.NotFound) {\n return false;\n }\n throw err;\n }\n }", "title": "" }, { "docid": "d76240ed2190f81a4b3f8e1ff7084dc4", "score": "0.5936895", "text": "static fileExists(filePath) {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve) => {\n fs.access(filePath, fs.constants.F_OK, (err) => {\n if (err) {\n resolve(false);\n }\n resolve(true);\n });\n });\n });\n }", "title": "" }, { "docid": "bf264569ac2ce90b05f856d09f0761cc", "score": "0.59244263", "text": "async function checkStats(path) {\n let stats\n try {\n stats = await fs.stat(path);\n if (!stats.isFile) {\n throw \"not a regular file \"\n }\n } catch (err) {\n console.log(err)\n throw \"error in fs.stat\"\n }\n}", "title": "" }, { "docid": "8442fabf5fbe2906bd7d2835f82fff9d", "score": "0.5907455", "text": "async _handleFileExists(path) {\n\t\tlet text = `Target file ${path} already exists`;\n\t\tlet title = \"File exists\";\n\t\tlet buttons = [\"overwrite\", \"overwrite-all\", \"skip\", \"skip-all\", \"abort\"];\n\t\treturn this._processIssue(\"overwrite\", { text, title, buttons });\n\t}", "title": "" }, { "docid": "f120564ba8d5fe73975fe980d5b61ae5", "score": "0.59018326", "text": "function isFileChecker(dirPath) {\n return fs.lstatSync(dirPath).isFile(); //checks whether a File exists in the passed dirPath\n}", "title": "" }, { "docid": "00fc6be486eee48afa9ef37e4386cedd", "score": "0.5887825", "text": "function fileExists(filename, cb) {\n fs.access(filename, fs.F_OK, (err) => {\n if (err) {\n cb(false);\n }\n else {\n cb(true);\n }\n })\n}", "title": "" }, { "docid": "5240e8982e0ebb6b0eae0899a63b4849", "score": "0.58852565", "text": "function fsExist(path,back){\r\n\tvar fs=api.require('fs');\r\n\tfs.exist({\n\t path:path\n },function(ret,err){\n \tif(ret.exist)\r\n \t{\r\n \t\tconsole.log(JSON.stringify(ret));\r\n \t\tvar back_ret=JSON.parse('{\"status\":true,\"exist\":true}');\r\n \t\tvar back_err=JSON.parse('{\"status\":false,\"error\":4}');\r\n \t\tback(back_ret,back_err);\r\n \t}\r\n \telse\r\n \t{\r\n \t\tconsole.log(JSON.stringify(err));\r\n \t\tvar back_ret=JSON.parse('{\"status\":true,\"exist\":false}');\r\n \t\tvar back_err=JSON.parse('{\"status\":false,\"error\":3}');\r\n \t\tback(back_ret,back_err);\r\n \t}\n });\r\n}", "title": "" }, { "docid": "bbcdab37794faa0f5d7f580370bc2261", "score": "0.58801866", "text": "function fileExists(filePath) {\n\tconst fileExistsPromiseResolver = (resolve) => {\n\t\t// Checks to see if we can read the file\n\t\tfs.access(filePath, fs.constants.F_OK, (e) => {\n\t\t\t// If the error exists, the file does not.\n\t\t\tresolve(!e);\n\t\t});\n\t};\n\n\treturn new Promise(fileExistsPromiseResolver);\n}", "title": "" }, { "docid": "5cc3a95d2765ff0b854380f00840d4c4", "score": "0.58723444", "text": "function fileExists(pFile) {\n try {\n fs.accessSync(pFile, fs.R_OK);\n } catch (e) {\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "687915f65b8e2028d73ac9a6166e03aa", "score": "0.58710796", "text": "function _exists() {\n _exists = (0, _bluebirdLst().coroutine)(function* (file) {\n try {\n yield (0, _fsExtraP().access)(file);\n return true;\n } catch (e) {\n return false;\n }\n });\n return _exists.apply(this, arguments);\n}", "title": "" }, { "docid": "35b70f0bf90f18accf0d235de1feefce", "score": "0.586521", "text": "function isFile(name) {\n try {\n return fs.statSync(name).isFile();\n } catch (e) {\n // continue\n }\n\n return false;\n}", "title": "" }, { "docid": "5c77347c8a76fee51143123d2c35efd4", "score": "0.5852732", "text": "async function exists(filePath) {\n try {\n await lstat(filePath);\n return true;\n } catch (err) {\n if (err instanceof Deno.errors.NotFound) {\n return false;\n }\n throw err;\n }\n }", "title": "" }, { "docid": "4ff809e23c0ebf713cd79aeba0f707cf", "score": "0.58511627", "text": "function fileExists(url) {\n return tryStatSync(fileURLToPath(url)).isFile();\n}", "title": "" }, { "docid": "e83e917a640e030efc8d674eaa67ff0f", "score": "0.58498734", "text": "function fileExists (fileName) {\n\treturn fs.existsSync(fileName);\n}", "title": "" }, { "docid": "6ab30a0a47d6d179b0eeabb87da69d40", "score": "0.584599", "text": "function File_CheckFileExists(filePath)\r\n{\r\n if (filePath == null)\r\n return;\r\n\r\n if (!aqFile.Exists(filePath))\r\n CommonReporting.Log_StepError(\"[CommonFiles: File_CheckFileExists] The file path does not exist< \" + filePath + \">\");\r\n\r\n CommonReporting.Log_Debug(\"[CommonFiles: File_CheckFileExists] The filepath <\" + filePath + \"> exists\");\r\n}", "title": "" }, { "docid": "e0a4d1a7472060050542a4756afffc79", "score": "0.5830938", "text": "checkDocPathValidity(path) {\n if (path.startsWith('/')) {\n path = `file://${path}`;\n }\n return REGEX_DOC_PATH_FILE.test(path) || REGEX_DOC_PATH_HTTP.test(path);\n }", "title": "" }, { "docid": "956e549ba079ce76ed777bfded4661cf", "score": "0.5814365", "text": "function isShortFile(path) {\n\n var ext = path.split(\".\").pop();\n var file = path.split(\"/\").pop();\n\n if ([\"done\"].indexOf(ext) >= 0\n || [\"status.log\"].indexOf(file) >= 0) {\n return true;\n }\n\n return false;\n}", "title": "" }, { "docid": "8e65d14a98c2c0d8ddbd3000780ec293", "score": "0.58116686", "text": "function isFilePath(str) {\r\n if (!isString(str))\r\n return false;\r\n else\r\n return winPath.test(str) || unixPath.test(str);\r\n}", "title": "" }, { "docid": "4d97f083640bea52d573e1175aa4f0c0", "score": "0.5800643", "text": "function doesFileExist(file, callback){\n\t\t\n\tfs.stat(file, function(err, stat) {\n\t\tif(err) {\n\t\t\tif(err.code == 'ENOENT') {\n\t\t\t\tcallback(null, false)\n\t\t\t} else {\n\t\t\t\tcallback(null, err.code);\n\t\t\t}\n\t\t} else { \n\t\t\tcallback(null,true);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "39224da6a9fad4316232dcad4a8c8040", "score": "0.5787806", "text": "function isDirectory(path) {\n try {\n return fs_1.statSync(path).isDirectory();\n }\n catch (err) {\n return false;\n }\n}", "title": "" }, { "docid": "8abb64bb47985feed975b9c257e1b9da", "score": "0.5779554", "text": "function fileExists(name) {\n try {\n if (fs.statSync(name))\n return true;\n } catch (e) {\n // continue\n }\n\n return false;\n}", "title": "" }, { "docid": "ed4328d824706ded5a1d4b1c97b105dc", "score": "0.57770026", "text": "checkDirectory(path){\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tfs.lstat(path, (err, stats) => {\n\t\t\t\tif (err) {\n\t\t\t\t\treturn console.log(err); \n\t\t\t\t} else {\n\t\t\t\t\tif (stats.isFile() == true){\n\t\t\t\t\t\tresolve(false); \n\t\t\t\t\t} else {\n\t\t\t\t\t\tresolve(true); \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}) \n\t\t}); \n\t}", "title": "" }, { "docid": "fb488dcc8fb2957f643f5414b9ce14e4", "score": "0.5765201", "text": "function checkFile(file, type)\n{\n return file.type.indexOf(type) === 0;\n}", "title": "" }, { "docid": "eca61cde6007a5b7ae42a325d9174c3a", "score": "0.5731364", "text": "function createFileIfNotExistsSync(path){\n if(fs.existsSync(path)){\n return true;\n }else{\n mkdirp.sync(getDirname(path));\n //write and close immediately\n fs.closeSync(fs.openSync(path, 'w'));\n return true;\n }\n}", "title": "" }, { "docid": "e798073366506823e04f69696afb0531", "score": "0.5729559", "text": "function directoryExists(path) {\n try {\n return fs.statSync(path).isDirectory();\n } catch (e) {\n logMe(\"directoryExists error: \" + e);\n return false;\n }\n}", "title": "" }, { "docid": "f09563c54fe8b43eb9d6544f8a6e7c27", "score": "0.57180107", "text": "function fileExists(file, key) {\n fs.exists(file, (exists) => {\n test(`file(s) exist for ${key}`, function (t) {\n t.plan(1);\n t.true(exists, `file ${file} exists`);\n });\n });\n}", "title": "" }, { "docid": "41f2374c06a5aa4b4f5d4ae33df08573", "score": "0.57095563", "text": "function isValid (path) {\n const isValid = valid(path)\n if (isValid) {\n log.verbose('extracted file from tarball', path)\n extractCount++\n } else {\n // invalid\n log.silly('ignoring from tarball', path)\n }\n return isValid\n }", "title": "" }, { "docid": "5cc7f7c15f3a9e777e65fb9714153abf", "score": "0.570755", "text": "function isAbsolutePath (path) {\n return path[0] === '/';\n}", "title": "" }, { "docid": "5cc7f7c15f3a9e777e65fb9714153abf", "score": "0.570755", "text": "function isAbsolutePath (path) {\n return path[0] === '/';\n}", "title": "" }, { "docid": "72a29ee323d0dbcbe1052655f3fc6015", "score": "0.56961226", "text": "function file_exists(path_lock) {\n return new Promise(function(resolve, reject) {\n fs.exists(path_lock.key, function(exists) {\n if (exists) {\n resolve(path_lock);\n } else {\n reject(path_lock);\n }\n });\n });\n}", "title": "" }, { "docid": "5303110355a95f0fa3fed048876b8c17", "score": "0.56837624", "text": "function doesFileExist ( filepath ) {\n\t\t\tvar hasFile = grunt.file.exists;\n\n\t\t\tif( !hasFile( filepath ) ){\n\t\t\t\tgrunt.log.warn('Source file\"' + filepath + '\" not found.');\n\t\t\t\treturn false;\n\t\t\t}else{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "0d05e0fe6fd444e346c7a97e6cc8154b", "score": "0.5681348", "text": "function isDir(path) {\n return fs.lstatSync(path).isDirectory();\n}", "title": "" }, { "docid": "89c760e3aee1fcdc81e19333dc7e3d95", "score": "0.5676883", "text": "function isExist(dir) {\n dir = path.normalize(dir);\n try {\n fs.accessSync(dir, fs.R_OK);\n return true;\n } catch (e) {\n return false;\n }\n}", "title": "" }, { "docid": "ddea4df3f10d1955716250bc9434e35b", "score": "0.5666651", "text": "function checkPath(path){\n\treturn path &&\n\t\t\t\tpath !== location.pathname &&\n\t\t\t\tpath !== location.pathname + \"/\";\n}", "title": "" }, { "docid": "45bac8c2d15ef27ec08a92ccde7bb80b", "score": "0.56486833", "text": "exists() {\n return this.filePointer.exists();\n }", "title": "" }, { "docid": "d133139bb09898d46150746637b8df46", "score": "0.5645309", "text": "function isDirectoryOrFail(path, message) {\n if (!isDirectory(path)) {\n throw new Error(message);\n }\n return true;\n}", "title": "" }, { "docid": "c62d8d9cbd4823615e928935a51dbc39", "score": "0.5644933", "text": "function verifyPath(curPath, done) {\n nodeFs.stat(curPath, function(err, stats) {\n done(curPath, !err);\n });\n }", "title": "" }, { "docid": "4ecd0d0470e8448b2768e1e8d1296d99", "score": "0.56311685", "text": "function fileExists(file) {\n var exists = false;\n try {\n exists = fs.existsSync(file);\n } catch (err) {\n writeLog(\"ERROR: Unable to check if '\" + file + \"' exists.\", FORCE_LOG);\n writeLog(\" \" + err.message, FORCE_LOG);\n return false;\n }\n\n return exists;\n }", "title": "" }, { "docid": "923146ec09ba77c35fa106f2cbdf9a21", "score": "0.5611308", "text": "function isSameFile(path1, path2) {\n return Promise.join(fs.lstatAsync(path1), fs.lstatAsync(path2), (stat1, stat2) => {\n if (stat1.dev === stat2.dev && stat1.ino === stat2.ino) {\n return true;\n }\n return false;\n })\n .catch({code: 'ENOENT'}, () => false)\n .catch({code: 'ENOTDIR'}, () => false);\n}", "title": "" } ]
e38f46c85c5e8c7eaf3ae83e14d5ae86
funcao menu de opcaoes para pedido
[ { "docid": "ac8e8db82f8f4bcb27bcee1e7133a7e3", "score": "0.0", "text": "function TelaConfigurarSerial() {\r\n let codigoHTML = ``;\r\n\r\n codigoHTML += `<h4 class=\"text-center\">Serial Atual</h4>\r\n <h5 class=\"text-center\" style=\"margin-top:50px\">Data Atual: <span class=\"badge badge-success\">${localStorage.getItem(\"dataAtual\")}</span> - Licença até: <span class=\"badge badge-danger\">${localStorage.getItem(\"dataFim\")}</span></h5>\r\n <hr class=\"my-6 bg-dark\" style=\"margin-top:50px\">\r\n <h4 class=\"text-center\" style=\"margin-top:50px\">Cadastrar Novo Serial</h4>\r\n <form style=\"margin-top:50px\">\r\n <div class=\"form-row\">\r\n <input id=\"dataFim\" type=\"date\" class=\"form-control col-md-8\" placeholder=\"Número Pedido\">\r\n <button onclick=\"cadastrarSerial();\" type=\"button\" class=\"btn btn-light border border-dark col-md-3\">\r\n <span class=\"fas fa-search\"></span> Cadastrar\r\n </button>\r\n </div>\r\n </form>`\r\n\r\n document.getElementById('janela2').innerHTML = codigoHTML;\r\n}", "title": "" } ]
[ { "docid": "60834d823622e14214d6ebc4634d585f", "score": "0.6412877", "text": "function menuOptions() {}", "title": "" }, { "docid": "7c16b9913537cb746c7d6391cff7fe71", "score": "0.63729167", "text": "function menu_paquet(){\n\t\taction=prompt(\"F fin de tour | P piocher une carte\");\n\t\taction=action.toUpperCase();\n\t\tif (action != null){\n\t\t\tswitch(action){\n\t\t\t\tcase \"F\":\n\t\t\t\t\tif (att_me.length>0){\n\t\t\t\t\t\t//MAJ des cartes en INV_ATT1,2\n\t\t\t\t\t\tmajCartesEnAttaque();\n\t\t\t\t\t}\n\t\t\t\t\tif (pv_adv==0 || pv_me==0){\n\t\t\t\t\t\tif (pv_adv==0){\n\t\t\t\t\t\t\talert(\"Vous avez gagné !!!\");\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\talert(\"Vous avez perdu !!!\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/////////////////////////////////Gérer la fin de partie ICI\n\t\t\t\t\t} else {\n\t\t\t\t\t\tIA_jouer(IA_stategie_basic);\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tcase \"P\":\n\t\t\t\t\tjeu_piocherDsPaquet(true);\t\t\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "a16ff455776e1949eb34e890b0f13822", "score": "0.6165285", "text": "function menuOptions() {\n inquirer.prompt([\n {\n name: \"action\",\n type: \"list\",\n message: \"What would you like to do?\",\n choices: [\n \"View products for sale\",\n \"View inventory with stock lower than five\",\n \"Add to inventory to current product\",\n \"Add a new product\",\n \"EXIT\"\n\n ]\n }\n ]).then(function(answer) {\n switch (answer.action) {\n case \"View products for sale\":\n displayProducts();\n break;\n\n case \"View inventory with stock lower than five\":\n lowerStock();\n break;\n\n case \"Add to inventory to current product\":\n addItems();\n\n break;\n\n case \"Add a new product\":\n addProduct();\n break;\n\n case \"EXIT\":\n connection.end();\n break;\n }\n })\n}", "title": "" }, { "docid": "624a15f90ea57dbbe8acc5d805aed114", "score": "0.60915315", "text": "function Estiliza_menu_itens()\n{\n //PARA CADA ITEM DO MENU, BASTA CHAMAR A FUNÇÃO ABAIXO, ESPECIFICANDO\n //SEU INDICE(NUMERO), SUA COR(STRING), SEU CONTEUDO(STRING), SEU LABEL(STRING)\n //Estiliza_item(Indice, Cor, Conteudo, Texto Lateral);\n Estiliza_item(0,\"blue\",\"+\",\"Adicionar\");\n Estiliza_item(1,\"red\",\"Botão\");\n}", "title": "" }, { "docid": "c8b2395a8031af9d29565ed960e1a8fe", "score": "0.60729367", "text": "function carregaOpcoesUnidadeSuporte(){\n\tcarregaTipoGerencia();\t\n\tcarregaTecnicos();\n\tcarregaUnidadesSolicitantes();\t\n\tcarregaEdicaoTipos();//no arquivo tipoSubtipo.js\n\tcarregaComboTipo();//no arquivo tipoSubtipo.js\n}", "title": "" }, { "docid": "aafa578da4085c04ed7e7699c53b58e5", "score": "0.6035763", "text": "function options() {\n inquirer\n .prompt({\n name: \"departmentOfManagers\",\n type: \"list\",\n message: \"Which saleDepartment you are looking for ?\",\n choices: [\"Products of sale\", \"Low Inventory\", \"Add to Inventory\", \" Add New Product\"]\n })\n .then(function(answer) {\n // based on their answer of functions\n if (answer.options === \"Products of sale\") {\n viewSaleProduct();\n }\n else if(answer.options === \"Low Inventory\") {\n lowInventory();\n }\n else if(answer.options === \"Add to Inventory\") {\n addInventory();\n } \n else if(answer.options === \"Add New Product\") \n {\n addNewProduct();\n } else{\n connection.end();\n }\n });\n}", "title": "" }, { "docid": "5848a051c8b1482a903fa22c1fe0db8d", "score": "0.5926129", "text": "function menuHandler() {\n console.log('menuHandler');\n\n agent.add('Questi sono alcuni dei modi in cui posso aiutarti nella tua visita al nostro store online')\n agent.add(new Suggestion(`Esplorazione delle categorie`));\n agent.add(new Suggestion(`Ricerca prodotto specifico`));\n agent.add(new Suggestion(`Suggerimento prodotto`));\n}", "title": "" }, { "docid": "0319c88844add69be3a0863e87a1b3dc", "score": "0.5912714", "text": "function showOptions() {\n inquirer.prompt([{\n type: \"list\",\n name: \"menu\",\n message: \"Menu Options\",\n choices: [\n \"View Product Sales by Department\",\n \"Create New Department\",\n \"Exit\"\n ]\n }\n\n ]).then(function (option) {\n\n switch (option.menu) {\n case \"View Product Sales by Department\":\n viewProductSalesbyDepartment();\n break;\n case \"Create New Department\":\n createNewDepartment();\n break;\n default:\n connection.end();\n }\n });\n}", "title": "" }, { "docid": "eba43b872b87179f51eeeecf43b597e1", "score": "0.58417004", "text": "function managerMenu(){\n inquirer.prompt([\n\t\t{\n\t\t\t type: \"list\",\n\t\t message: \"Select an operation to perform\",\n name: \"mgrmenu\",\n choices: ['1 - View Products', '2 - View Low Inventory', '3 - Add to Inventory', '4 - Add New Product', '5 - Exit']\n\t\t},\n\t]).then(function(response){\n if(response.mgrmenu.includes(1)){\n viewSaleProducts();\n }\n else if(response.mgrmenu.includes(2)){\n viewLowInvetory();\n }\n else if(response.mgrmenu.includes(3)){\n viewSaleProducts(addInventory);\n }\n else if(response.mgrmenu.includes(4)){\n addProduct();\n }\n else{\n //close the connection\n connection.end();\n }\n });\n}", "title": "" }, { "docid": "dcba3adfec5cdcf718fcbd1c3cb76174", "score": "0.5815076", "text": "function menu() {\n inquirer\n .prompt({\n name: \"menuOptions\",\n type: \"list\",\n message: \"What would you like to do?\",\n choices: [\"View Products\", \"View Low Inventory\", \"Add Inventory\", \"Add New Product\"]\n })\n .then(function(answer) {\n // based on their answer, run appropriate function\n if (answer.menuOptions === \"View Products\") {\n viewProducts();\n }\n else if (answer.menuOptions === \"View Low Inventory\") {\n viewLowInventory();\n }\n else if (answer.menuOptions === \"Add Inventory\") {\n addInventory();\n }\n else if (answer.menuOptions === \"Add New Product\") {\n addNewProduct();\n }\n else {\n connection.end();\n }\n });\n}", "title": "" }, { "docid": "fcddf44a3240b1b557e14e054dfa499d", "score": "0.58031356", "text": "function commandsSelect(comm, para) {\n\n switch (comm) {\n case \"concert-this\":\n concert(para);\n break;\n\n case \"spotify-this-song\":\n spotify(para);\n break;\n\n case \"movie-this\":\n movie(para);\n break;\n\n case \"do-what-it-says\":\n doWhatItSays();\n break;\n default:\n console.log(\"Check out the commands.\");\n }\n\n}", "title": "" }, { "docid": "d7a22243a66b57f762cd9c32711c62e2", "score": "0.5795049", "text": "function choisir_prochaine_action( sessionId, context, entities ) {\n // ACTION PAR DEFAUT CAR AUCUNE ENTITE DETECTEE\n if(Object.keys(entities).length === 0 && entities.constructor === Object) {\n // Affichage message par defaut : Je n'ai pas compris votre message !\n }\n // PAS DINTENTION DETECTEE\n if(!entities.intent) {\n\n }\n // IL Y A UNE INTENTION DETECTEE : DECOUVRONS LAQUELLE AVEC UN SWITCH\n else {\n switch ( entities.intent && entities.intent[ 0 ].value ) {\n case \"Bonjour\":\n var msg = {\n \"attachment\": {\n \"type\": \"template\",\n \"payload\": {\n \"template_type\": \"generic\",\n \"elements\": [\n {\n \"title\": \"NutriScore\",\n \"image_url\": \"https://mon-chatbot.com/nutribot2018/images/nutriscore-good.jpg\",\n \"subtitle\": \"Recherchez ici un produit alimentaire et ses équivalents plus sains.\",\n \"buttons\": [\n {\n \"type\": \"postback\",\n \"title\": \"❓ Informations\",\n \"payload\": \"INFOS_SUR_LE_NUTRI\"\n },\n\n {\n \"type\": \"postback\",\n \"title\": \"🔍 Rechercher\",\n \"payload\": \"PRODUIT_PLUS_SAIN\"\n },\n {\n \"type\": \"postback\",\n \"title\": \"🍏 Produit + sain\",\n \"payload\": \"ALTERNATIVE_BEST\"\n }\n\n ]\n },\n {\n \"title\": \"Le sucre\",\n \"image_url\": \"https://mon-chatbot.com/nutribot2018/images/sucre.jpg\",\n \"subtitle\": \"Connaissez-vous réellement le Sucre ? Percez ici tous ses mystères !\",\n \"buttons\": [\n {\n \"type\": \"postback\",\n \"title\": \"En Savoir +\",\n \"payload\": \"CAT_SUCRE\"\n }\n ]\n },\n {\n \"title\": \"Les aliments\",\n \"image_url\": \"https://mon-chatbot.com/nutribot2018/images/aliments.jpg\",\n \"subtitle\": \"Quels aliments contiennent du sucre ? Vous allez être surpris !\",\n \"buttons\": [\n {\n \"type\": \"postback\",\n \"title\": \"En Savoir +\",\n \"payload\": \"CAT_ALIMENTS\"\n }\n ]\n },\n {\n \"title\": \"Les additifs\",\n \"image_url\": \"https://mon-chatbot.com/nutribot2018/images/additifs.jpg\",\n \"subtitle\": \"C'est quoi un additif ? Où les trouvent-on ?\",\n \"buttons\": [\n {\n \"type\": \"postback\",\n \"title\": \"En Savoir +\",\n \"payload\": \"CAT_ADDITIFS\"\n }\n ]\n },\n {\n \"title\": \"Les nutriments\",\n \"image_url\": \"https://mon-chatbot.com/nutribot2018/images/nutriments.jpg\",\n \"subtitle\": \"Eléments indispensables à l'Homme ! Découvrez tous les secrets des nutriments.\",\n \"buttons\": [\n {\n \"type\": \"postback\",\n \"title\": \"En Savoir +\",\n \"payload\": \"CAT_NUTRIMENTS\"\n }\n ]\n },\n {\n \"title\": \"La diététique\",\n \"image_url\": \"https://mon-chatbot.com/nutribot2018/images/diet.jpg\",\n \"subtitle\": \"Découvrez ici tous mes conseils concernant la diététique !\",\n \"buttons\": [\n {\n \"type\": \"postback\",\n \"title\": \"En Savoir +\",\n \"payload\": \"CAT_DIETETIQUE\"\n }\n ]\n },\n {\n \"title\": \"L'organisme\",\n \"image_url\": \"https://mon-chatbot.com/nutribot2018/images/organisme.jpg\",\n \"subtitle\": \"Ici vous découvrirez tous les secrets concernant votre corps et le sucre !\",\n \"buttons\": [\n {\n \"type\": \"postback\",\n \"title\": \"En Savoir +\",\n \"payload\": \"CAT_ORGANISME\"\n }\n ]\n }\n\n\n ]\n }\n }\n };\n var response_text = {\n \"text\": \"PS : Si vous voulez je peux vous proposer des sujets pour débuter :\"\n };\n actions.reset_context( entities, context, sessionId ).then(function() {\n actions.getUserName( sessionId, context, entities ).then( function() {\n actions.envoyer_message_text( sessionId, context, entities, 'Bonjour '+context.userName+'. Enchanté de faire votre connaissance. Je suis NutriBot, un robot destiné à vous donner des informations sur le sucre, la nutrition et tout particulièrement le Nutriscore : le logo nutritionel de référence permettant de choisir les aliments pour mieux se nourrir au quotidien.').then(function() {\n actions.timer(entities, context, sessionId, temps_entre_chaque_message).then(function() {\n actions.envoyer_message_text(sessionId, context, entities, \"PS : Si vous voulez je peux vous proposer des sujets pour débuter :\").then(function() {\n actions.timer(entities, context, sessionId, temps_entre_chaque_message).then(function() {\n actions.envoyer_message_bouton_generique(sessionId, context, entities, msg);\n })\n })\n })\n })\n })\n })\n break;\n case \"RETOUR_ACCUEIL\":\n // Revenir à l'accueil et changer de texte\n actions.reset_context( entities,context,sessionId ).then(function() {\n actions.choixCategories_retour( sessionId,context );\n })\n break;\n case \"Dire_aurevoir\":\n actions.getUserName( sessionId, context, entities ).then( function() {\n actions.envoyer_message_text( sessionId, context, entities, \"A bientôt \"+context.userName+\" ! N'hésitez-pas à revenir nous voir très vite !\").then(function() {\n actions.envoyer_message_image( sessionId, context, entities, \"https://mon-chatbot.com/img/byebye.jpg\" );\n })\n })\n break;\n case \"FIRST_USE_OF_TUTO_OK\":\n actions.getUserName( sessionId, context, entities ).then( function() {\n actions.envoyer_message_text( sessionId, context, entities, \"Bonjour \"+context.userName+\". Je suis NutriBot ! Voici un petit peu d'aide concernant mon fonctionnement !\").then(function() {\n actions.timer(entities, context, sessionId, temps_entre_chaque_message).then(function() {\n actions.afficher_tuto( sessionId,context );\n })\n })\n })\n break;\n case \"Thanks\":\n actions.remerciements(entities,context,sessionId);\n break;\n case \"GO_TO_MENU_DEMARRER\":\n actions.reset_context( entities,context,sessionId ).then(function() {\n actions.choixCategories( sessionId,context );\n })\n break;\n case \"SCAN\":\n actions.ExplicationScan(sessionId,context);\n break;\n\n case \"MANUELLE\":\n actions.envoyer_message_text( sessionId, context, entities, \"Quelle est la marque, le nom ou bien le type de produit que vous souhaitez rechercher ? (Ex : Nutella, Pain de mie, croissant, etc). Je vous écoute :\");\n // then mettre dans le context qu'on est dans recherche manuelle\n break;\n // SIMPLE\n case \"Combien de sucre\":\n actions.go_reste_from_howmuchsugar(entities,context,sessionId);\n break;\n case \"CAT_NUTRIMENTS\":\n actions.go_leg_prot_vital(entities,context,sessionId);\n break;\n case \"Insuline\":\n actions.go_reste_from_insuline(entities,context,sessionId);\n break;\n case \"Betterave\":\n actions.go_legume(entities,context,sessionId);\n break;\n case \"CAT_ORGANISME\":\n actions.go_tout_organisme(entities,context,sessionId);\n break;\n case \"Glucides\":\n actions.go_nutriments(entities,context,sessionId);\n break;\n\n case \"Saccharose\":\n actions.go_glucose_canne_betterave_fructose(entities,context,sessionId);\n break;\n case \"CAT_SUCRE\":\n actions.go_saccharose(entities,context,sessionId);\n break;\n case \"Glucides complexes\":\n actions.go_relance_nutriments_from_glucomplexes(entities,context,sessionId);\n break;\n case \"Index glycémique lent\":\n actions.go_reste_index_lent(entities,context,sessionId);\n break;\n case \"Aliments transformés\":\n actions.go_additifs(entities,context,sessionId);\n break;\n case \"Produit allégé en sucre\":\n actions.go_reste_from_allege(entities,context,sessionId);\n break;\n case \"Nutriments\":\n actions.go_leg_prot_vital(entities,context,sessionId);\n break;\n case \"Besoins\":\n actions.go_reste_from_besoins(entities,context,sessionId);\n break;\n case \"Canne à sucre\":\n actions.go_relance_aliments_from_sugar_canne(entities,context,sessionId);\n break;\n case \"Les sucres\":\n actions.go_amidon_glucides_from_les_sucres(entities,context,sessionId);\n break;\n case \"CAT_DIETETIQUE\":\n actions.go_tout_diet(entities,context,sessionId);\n break;\n case \"Combien de fruits\":\n actions.go_reste_from_howmuchfruits(entities,context,sessionId);\n break;\n case \"Fructose\":\n actions.go_relance_aliments_from_fructose(entities,context,sessionId);\n break;\n case \"Légumes secs\":\n actions.go_prot(entities,context,sessionId);\n break;\n case \"ASTUCE\":\n actions.astuces(entities,context,sessionId);\n break;\n case \"Index glycémique rapide\":\n actions.go_reste_index_rapide(entities,context,sessionId);\n break;\n case \"Apports\":\n actions.go_reste_from_apports(entities,context,sessionId);\n break;\n case \"Aliments\":\n actions.go_aliments_alitransfo(entities,context,sessionId);\n break;\n case \"Produit vital\":\n actions.go_relance_from_vital(entities,context,sessionId);\n break;\n case \"Trop de sucre\":\n actions.go_reste_from_toomuchsugar(entities,context,sessionId);\n break;\n case \"Calorie ou Kcal\":\n actions.go_reste_kcal(entities,context,sessionId);\n break;\n case \"Sucre simple ou sucre rapide\":\n actions.go_reste_sucre_rapide_lent(entities,context,sessionId);\n break;\n case \"CAT_ADDITIFS\":\n actions.go_amidon_glucides(entities,context,sessionId);\n break;\n case \"Amidon\":\n actions.go_glucides_glucomplexes(entities,context,sessionId);\n break;\n case \"Protéines\":\n actions.go_vital(entities,context,sessionId);\n break;\n case \"Légume\":\n actions.go_relance_aliments_from_legume(entities,context,sessionId);\n break;\n case \"Pancréas\":\n actions.go_reste_from_pancreas(entities,context,sessionId);\n break;\n case \"Alimentation équilibrée\":\n actions.go_reste_from_alimentation_equ(entities,context,sessionId);\n break;\n case \"Glucose\":\n actions.go_relance(entities,context,sessionId);\n break;\n case \"Morceau de sucre\":\n actions.go_reste_from_morceau(entities,context,sessionId);\n break;\n case \"Composition\":\n actions.go_alitransfo(entities,context,sessionId);\n break;\n case \"Additifs\":\n actions.go_amidon_glucides(entities,context,sessionId);\n break;\n case \"CAT_ALIMENTS\":\n actions.go_aliments_alitransfo(entities,context,sessionId);\n break;\n // RESTE COMPLEXE\n case \"PRODUIT_PLUS_SAIN\":\n var element = {\n \"attachment\":{\n \"type\":\"template\",\n \"payload\":{\n \"template_type\":\"button\",\n \"text\":\"Utilisez le formulaire ci-dessous et obtenez toutes les informations nécessaires au sujet d'un produit alimentaire ou bien scannez directement un code barre.\",\n \"buttons\":[\n {\n \"type\":\"web_url\",\n \"messenger_extensions\": true,\n \"url\":\"https://mon-chatbot.com/nutribot2018/recherche.html\",\n \"title\":\"Rechercher\"\n },\n {\n \"type\":\"postback\",\n \"title\":\"Scanner\",\n \"payload\":\"SCANSCANSCAN\"\n }\n ]\n }\n }\n };\n sessions[sessionId].recherche = 'normale';\n actions.envoyer_message_bouton_generique( sessionId, context, entities, element);\n break;\n case \"ALTERNATIVE_BEST\":\n var element = {\n \"attachment\":{\n \"type\":\"template\",\n \"payload\":{\n \"template_type\":\"button\",\n \"text\":\"Recherchez ici un produit alimentaire et ses équivalents plus sains.\",\n \"buttons\":[\n {\n \"type\":\"web_url\",\n \"messenger_extensions\": true,\n \"url\":\"https://mon-chatbot.com/nutribot2018/recherche.html\",\n \"title\":\"Rechercher\"\n }\n ]\n }\n }\n };\n sessions[sessionId].recherche = 'autre';\n actions.envoyer_message_bouton_generique( sessionId, context, entities, element);\n break;\n case \"Rechercher_un_produit\":\n actions.queryManuelleSearch2(entities,context,sessionId);\n break;\n case \"INFOS_SUR_LE_NUTRI\":\n actions.afficher_infos_nutriscore(entities,context,sessionId);\n break;\n case \"SCANSCANSCAN\":\n actions.afficher_infos_nutriscore(entities,context,sessionId);\n break;\n case \"AstuceAstuce\":\n actions.astuces( sessionId,context );\n break;\n case \"ByeByeBye\":\n actions.byebye( sessionId,context );\n break;\n\n case \"GENESE\":\n actions.go_relance_from_glycemie(entities, context, sessionId);\n break;\n case \"Glycémie\":\n actions.go_relance_from_glycemie(entities, context, sessionId);\n break;\n case \"RECHERCHE\":\n actions.go_relance_from_glycemie(entities, context, sessionId);\n break;\n\n case \"SPECIFICSPECIFIC\":\n actions.go_relance_from_glycemie(entities, context, sessionId);\n break;\n case \"Insultes\":\n actions.go_relance_from_glycemie(entities, context, sessionId);\n break;\n case \"Sucre\":\n actions.go_relance_from_glycemie(entities, context, sessionId);\n break;\n\n case \"TAPER\":\n actions.go_relance_from_glycemie(entities, context, sessionId);\n break;\n case \"AUTRE_AUTRE_AUTRE\":\n actions.go_relance_from_glycemie(entities, context, sessionId);\n break;\n };\n }\n}", "title": "" }, { "docid": "b9444c30b5ba998551c1d39bdfc804ff", "score": "0.5784833", "text": "function reservacion(completo,opciones){\n /* opciones = opciones || {};\n if(completo)\n console.log(opciones.metodoPago);\n else\n console.log('No se pudo completar la operación'); */\n let {metodoPago,cantidad,dias}=opciones\n console.log(metodoPago);\n console.log(cantidad);\n console.log(dias);\n }", "title": "" }, { "docid": "37e271f0a7ac567e09d872eff4555f22", "score": "0.57540286", "text": "function showOptions(indexPedido){\n console.log(\"index Pedido \"+indexPedido);\n //test = indexProducto;\n //$rootScope.indexP= indexProducto;\n $ionicActionSheet.show({\n buttons: [\n { text: '<i class=\"icon ion-clipboard\"></i> Ver Pedido' }\n ],\n //destructiveText: \"<i class='icon ion-trash-b'></i> Delete\",\n cancelText: 'CANCEL',\n titleText: \"OPCIONES\",\n \n buttonClicked: function(indexButton){\n if(indexButton == 0){\n //console.log(\"TEST \"+test);\n $scope.verPedido(indexPedido);\n\n }\n return true;\n }\n });\n }", "title": "" }, { "docid": "7787523f3b808f3af8c1523c6c101994", "score": "0.5736864", "text": "function managerOptions() {\n inquirer.prompt({\n name: \"action\",\n type: \"list\",\n message: \"Please make a selection.\",\n choices: [\"View products for sale.\",\n \"View low inventory.\",\n \"Add to current inventory levels.\",\n \"Add new product.\",\n \"Exit the system.\"\n ]\n }).then(function(answer) {\n switch (answer.action) {\n case \"View products for sale.\":\n displayInventory();\n break;\n case \"View low inventory.\":\n lowInventory();\n break;\n case \"Add to current inventory levels.\":\n addInventory();\n break;\n case \"Add new product.\":\n addNewItem();\n break;\n case \"Exit the system.\":\n quitManager();\n break;\n }\n });\n}", "title": "" }, { "docid": "e3ceeb13d9616caf9a2849038110a3b5", "score": "0.57099783", "text": "function maisProdutos(){\n rl.question(\"Deseja acrescentar mais produtos a sacola?\\n 1 - Sim\\n 2 - Não\\n\", (opcao) =>{\n if(opcao === \"1\"){\n procurandoPedido();\n }else{\n listarSacola();\n }\n })\n}", "title": "" }, { "docid": "43e57b1e841b53761520eba335c7fada", "score": "0.5689484", "text": "function Go_Funciones()\n {\n if( g_listar == 1 )\n {\n Get_Marca_Producto();\n }\n \n }", "title": "" }, { "docid": "8fc10a539e857435ddb6e7e24c1fa6ab", "score": "0.5683399", "text": "function accionConsultarProducto(){\n listado1.actualizaDat();\n var numSelec = listado1.numSelecc();\n if ( numSelec < 1 ) {\n GestionarMensaje(\"PRE0025\", null, null, null); // Debe seleccionar un producto.\n } else {\n var codSeleccionados = listado1.codSeleccionados();\n var arrayDatos = obtieneLineasSeleccionadas(codSeleccionados, 'listado1'); \n var cadenaLista = serializaLineasDatos(arrayDatos);\n var obj = new Object();\n obj.hidCodSeleccionadosLE = \"[\" + codSeleccionados + \"]\";\n obj.hidListaEditable = cadenaLista;\n //set('frmContenido.conectorAction', 'LPModificarGrupo');\n mostrarModalSICC('LPModificarOferta','Consultar producto',obj,795,495);\n }\n}", "title": "" }, { "docid": "834925a610e5924c38c2a30f1dc85083", "score": "0.5667234", "text": "function cambiarAccion(metodo){\n\t$(\".action-options\").hide();\n\t$(\"#\"+ metodo + \"_options\").show();\n}", "title": "" }, { "docid": "d947631549c58f07d5759f3a81905988", "score": "0.56609994", "text": "function mostrarPermisos(data){\n\n\t\tif(data.add == 1){\n\t\t\taddIcoPermOk(\"add-est\");\n\t\t\taddBtnQuitar(\"add\");\n\t\t}else{\n\t\t\taddIcoPermNOk(\"add-est\");\n\t\t\taddBtnAdd(\"add\");\n\t\t}\n\t\tif(data.upd == 1){\n\t\t\taddIcoPermOk(\"upd-est\");\n\t\t\taddBtnQuitar(\"upd\");\n\t\t}else{\n\t\t\taddIcoPermNOk(\"upd-est\");\n\t\t\taddBtnAdd(\"upd\");\n\t\t}\n\t\tif(data.del == 1){\n\t\t\taddIcoPermOk(\"del-est\");\n\t\t\taddBtnQuitar(\"del\");\n\t\t}else{\n\t\t\taddIcoPermNOk(\"del-est\");\n\t\t\taddBtnAdd(\"del\");\n\t\t}\n\t\tif(data.list == 1){\n\t\t\taddIcoPermOk(\"list-est\");\n\t\t\taddBtnQuitar(\"list\");\n\t\t}else{\n\t\t\taddIcoPermNOk(\"list-est\");\n\t\t\taddBtnAdd(\"list\");\n\t\t}\n\n\t\t/*Una vez dibujados los permisos del usuario, \n\t\tel selector de usuario obtiene el foco */\n\t\t$('select#usuario').focus(); \n\n\t}", "title": "" }, { "docid": "bf5177a003abca4c1e99e2c4d79b2b9b", "score": "0.5659316", "text": "function mainOptions() {\n inquirer\n .prompt({\n name: \"action\",\n type: \"list\",\n message: \"What would you like to do?\",\n choices: [\n \"View\",\n \"Add\",\n \"Delete\",\n \"Update\"\n ]\n })\n .then(function (answer) {\n switch (answer.action) {\n\n case \"View\":\n viewChoice();\n break;\n\n case \"Add\":\n addChoice();\n break;\n\n case \"Delete\":\n deleteChoice()\n break;\n\n case \"Update\":\n updateChoice()\n break;\n\n\n }\n });\n\n}", "title": "" }, { "docid": "a52c8567ad329607dc7546191da17aa6", "score": "0.5654608", "text": "function processOption(param) {\n\n gw_com_api.show(\"frmOption\");\n\n //----------\n var args = { targetid: \"frmOption\", type: \"FREE\", title: \"조회 조건\",\n trans: true, border: true, margin: 82, show: true,\n editable: { focus: \"sheet\", validate: true },\n content: { row: [\n { \n \telement: [\n\t\t\t\t { name: \"sheet_nm\", label: { title: \"시트명 :\" },\n\t\t\t\t editable: { type: \"select\", data: { memory: \"SHEET\" } } },\n { name: \"supp_cd\", label: { title: \"협력사 :\" }, hidden: true, \t//SuppOnly\n editable: { type: \"select\", size: 7, maxlength: 20, data: { memory: \"협력사\"} }\n }\n\t\t\t\t ]\n },\n { align: \"right\",\n element: [\n\t\t\t\t { name: \"실행\", value: \"실행\", act: true, format: { type: \"button\" } },\n\t\t\t\t { name: \"취소\", value: \"취소\", format: { type: \"button\", icon: \"닫기\" } }\n\t\t\t\t ]\n }\n\t\t\t]\n }\n };\n gw_com_module.formCreate(args);\n gw_com_api.setValue(\"frmOption\", 1, \"supp_cd\", gw_com_module.v_Session.EMP_NO );\n //----------\n var args = { targetid: \"frmOption\", element: \"실행\", event: \"click\", handler: click_frmOption_실행 };\n gw_com_module.eventBind(args);\n //----------\n var args = { targetid: \"frmOption\", element: \"취소\", event: \"click\", handler: click_frmOption_취소 };\n gw_com_module.eventBind(args);\n\n}", "title": "" }, { "docid": "29e357eb4ab1c517255b9c9ea220b4cd", "score": "0.5647958", "text": "function menu(){\n inquirer.prompt({\n name: \"action\",\n type: \"list\",\n message: \"What would you like to do?\",\n choices: [\n \"View Products for Sale\",\n \"View Low Inventory\",\n \"Add to Inventory\",\n \"Add New Product\",\n \"exit\"\n ]\n }).then(function(answer){\n switch(answer.action){\n case \"View Products for Sale\":\n products();\n break;\n\n case \"View Low Inventory\":\n lowInventory();\n break;\n\n case \"Add to Inventory\":\n addToInventory();\n break;\n\n case \"Add New Product\":\n addProduct();\n break;\n\n case \"exit\":\n connection.end();\n break;\n }\n });\n}", "title": "" }, { "docid": "2663d31b1b9cc90938ceaa32c884dcbd", "score": "0.56367266", "text": "function chamarAperto(){\n commandAbortJob();\n commandSelectParameterSet(1);\n commandVehicleIdNumberDownload(\"ASDEDCUHBG34563EDFRCVGFR6\");\n commandDisableTool();\n commandEnableTool();\n}", "title": "" }, { "docid": "dddad8a91f2f2f7e472d1acf0bd912bc", "score": "0.56277394", "text": "function habilitarMovimento(sentido, casaBaixo){\n\t\t\t\tif(sentido == 'baixo'){ baixo(casaBaixo); }\n\t\t\t\telse{ $('#baixo_btn').off(); }\n\n\t\t\t\tif(sentido == 'direita'){ direita(); }\n\t\t\t\telse{ $('#direita_btn').off(); }\n\n\t\t\t\tif(sentido == 'esquerda'){ esquerda(); }\n\t\t\t\telse{ $('#esquerda_btn').off(); }\n\t\t\t}", "title": "" }, { "docid": "b3fdf654aa5fb346743888b50108b8a1", "score": "0.5625724", "text": "function OptionPanel(Opc) {\n\n Campo = Opc;\n\n switch (Opc) {\n\n case \"C\":\n $(\"#block_search_PC\").css(\"display\", \"none\");\n $(\"#Block_Insert_PC\").css(\"display\", \"block\");\n $(\"#Bloque_estado\").css(\"display\", \"none\");\n $(\"#BtnSave\").attr(\"value\", \"Crear\");\n $(\"#TxtPais_ID\").removeAttr(\"disabled\");\n $(\"#Select_Pais\").parent().find(\"input.ui-autocomplete-input\").autocomplete(\"option\", \"disabled\", false).prop(\"disabled\", false);\n $(\"#Select_Pais\").parent().find(\"a.ui-button\").button(\"enable\");\n $('#Select_Pais').siblings('.ui-combobox').find('.ui-autocomplete-input').val('Seleccione...');\n\n Estado_Process = \"C\";\n $(\"#Tab_PaisesCiudades\").tabs({ disabled: false });\n Clear();\n break;\n\n case \"R\":\n $(\"#block_search_PC\").css(\"display\", \"block\");\n $(\"#Block_Insert_PC\").css(\"display\", \"none\");\n Estado_Process = \"R\";\n break;\n\n case \"U\":\n $(\"#block_search_PC\").css(\"display\", \"block\");\n $(\"#Block_Insert_PC\").css(\"display\", \"none\");\n Estado_Process = \"U\";\n break;\n\n case \"D\":\n $(\"#block_search_PC\").css(\"display\", \"block\");\n $(\"#Block_Insert_PC\").css(\"display\", \"none\");\n Estado_Process = \"D\";\n break;\n\n }\n}", "title": "" }, { "docid": "25d02c6cf3f716832201d80e0ab4a95a", "score": "0.5614827", "text": "function elegidoSelect() {\n //recogemos el destino que se ha elegido.\n var elegidoSel = document.getElementById('otro').value;\n if (elegidoSel == \"\") {\n //si no se ha elegido ninguno volvemos a la funcion de inicio\n inicio();\n }\n\n //si si que se ha elegido alguno, lo llevamos a su funcion personalizada\n else if (elegidoSel == 'VQC') {\n vqc();\n } else if (elegidoSel == 'P.COLORES') {\n colores();\n } else if (elegidoSel == 'MALVINAS') {\n malvinas();\n } else {\n fin();\n }\n}", "title": "" }, { "docid": "31e0b337d75dd68fc2a833f111c6bb1e", "score": "0.5608701", "text": "function PunteroGuia(opciones)\n{\n let opcionesDefecto = {\n 'display' : false,\n 'golpeStyle' : 'red',\n 'lineaAncho' : 3\n };\n\n // Now loop through the default opciones and create properties of this class set to the value for\n // the option passed in if a value was, or if not then set the value of the default.\n for (let llave in opcionesDefecto) {\n if ((opciones != null) && (typeof(opciones[llave]) !== 'undefined')) {\n this[llave] = opciones[llave];\n } else {\n this[llave] = opcionesDefecto[llave];\n }\n }\n}", "title": "" }, { "docid": "55b4c5b62163fc3bb7eef15d2ba6f776", "score": "0.5596847", "text": "function selectMenu() {\n\tif (menuActive()) { //Si on est dans le menu, on lance la fonction appropriée\n\t\tvar fn = window[$(\".menu_item_selected\").attr(\"action\")];\n\t\tif(typeof fn === 'function') {\n\t\t\tfn();\n\t\t}\n\t} else if (delAllActive()) { //Si on est dans la validation du delete\n\t\tdelAll();\n\t}\n}", "title": "" }, { "docid": "2e47291628fed5ae557fd8d36480b367", "score": "0.55828357", "text": "function contextMenuWorkForRecycleBin(action, el, pos) {\r\n\r\n switch (action) {\r\n case \"delete\":\r\n {\r\n var contractTitle = $(el).find(\"#ContractTitle\").text();\r\n var entityid = $(el).find(\"#ContractID\").text();\r\n DeleteContractFromRecycleBin(contractTitle, entityid);\r\n break;\r\n }\r\n case \"viewdetails\":\r\n {\r\n var entityid = $(el).find(\"#ContractID\").text();\r\n location = \"/Contracts/ContractDetails?ContractID=\" + entityid;\r\n break;\r\n }\r\n case \"history\":\r\n {\r\n var contractID = $(el).find(\"#ContractID\").text();\r\n $(\"#hdContractID\").val(contractID);\r\n // $('#ddlHistoryFilter').val('All');\r\n CreateContractActivityList(contractID);\r\n break;\r\n }\r\n }\r\n}", "title": "" }, { "docid": "50e23c4ed06e54a7266ef9ed4220a485", "score": "0.55788285", "text": "function managerOptions(){\n inquirer\n .prompt({\n //format and question #1 to ask manager--menu options\n name: \"mgrMenu\",\n type: \"list\",\n message: \"What do you need to do?\",\n choices: [\"View Products for Sale\", \"View Low Inventory Products\", \"Update Inventory for a Product\", \"Add Product to Inventory\"]\n })\n //function to run after the inquiry based on manager's selection\n .then(function(answer){\n switch (answer.mgrMenu){\n //to view all products for sale\n case \"View Products for Sale\":\n totalInv();\n break;\n //to view products with low inventory\n case \"View Low Inventory Products\":\n lowInv();\n break;\n //to update inventory for a product\n case \"Update Inventory for a Product\":\n updateInv();\n break;\n //to add a product to products for sale\n case \"Add Product to Inventory\":\n addProduct();\n break\n }\n \n })\n}", "title": "" }, { "docid": "1d1c15033313dad3c2e7e5dfbc5b24b4", "score": "0.5558557", "text": "function menu()\n{\n\ninquirer.prompt({\n name:'menu',\n type:\"list\",\n choices:['View Products for Sale','View Low Inventory','Add to Inventory','Add New Product','exit'],\n message:\"MENU\\n ==================\\n\"\n}).then(function(choice)\n{\n console.log(choice.menu);\n var op=choice.menu;\n switch(op)\n {\n case 'View Products for Sale' :\n products_for_sale();\n break;\n case 'View Low Inventory' :\n low_inventory();\n break;\n case 'Add to Inventory' :\n add_inventory();\n break;\n case 'Add New Product' :\n add_product()\n break;\n case 'exit':\n connection.end();\n break;\n }\n}\n);\n}", "title": "" }, { "docid": "384f20c7f201bef469bd11083fc97e80", "score": "0.5556665", "text": "function ClickGerarPontosDeVida(modo) {\n GeraPontosDeVida(modo);\n AtualizaGeral();\n}", "title": "" }, { "docid": "09c2b75d689a4d5096a92782d2355922", "score": "0.5548771", "text": "function deptOptions() {\n inquirer\n .prompt(\n {\n name: 'action',\n type: 'list',\n message: 'What would you like to do?',\n choices: [\n 'View all Departments',\n 'View the Cost by Department',\n 'Add a Department',\n 'Remove a Department',\n 'Go Back'\n ]\n }\n ).then(answer => {\n switch (answer.action) {\n case 'View all Departments':\n deptSearch();\n break;\n\n case 'View the Cost by Department':\n salaryDept();\n break;\n\n case 'Add a Department':\n addDept();\n break;\n\n case 'Remove a Department':\n deleteDept();\n break;\n\n case 'Go Back':\n init();\n break;\n }\n })\n}", "title": "" }, { "docid": "06cf39b68363959c9291c5a92643235c", "score": "0.5545924", "text": "function pesquisarModulos() {\n\n apiService.get('/api/menu/modulos', null,\n moduloLoadCompleted,\n moduloLoadFailed);\n }", "title": "" }, { "docid": "614c94280a7a9097b6134e63986734cc", "score": "0.5536997", "text": "function action(mode, type, selection) {\n if (mode == 1) {\n\tstatus++;\n } else {\n\tstatus--;\n }\n if (status == 1) {\n\tif (cm.getMapId() == 910320001) {\n\t\tcm.warp(910320000, 0);\n\t\tcm.dispose();\n\t} else if (cm.getMapId() == 910330001) {\n\t\tvar itemid = 4001321;\n\t\tif (!cm.canHold(itemid)) {\n\t\t\tcm.sendOk(\"请腾出背包空间\");\n\t\t} else {\n\t\t\tcm.gainItem(itemid,1);\n\t\t\tcm.warp(910320000, 0);\n\t\t}\n\t\tcm.dispose();\n\t} else if (cm.getMapId() >= 910320100 && cm.getMapId() <= 910320304) {\n\t\tcm.sendYesNo(\"你想退出这个地方吗?\");\n\t\tstatus = 99;\n\t} else {\n\t\tcm.sendSimple(\"我的名字是林车长.\\r\\n#b#L1#进入灰尘的平台。#l#n\\r\\n#L2#挑战999列车平台。#l\\r\\n#L3#荣誉乘务员勋章。#l#k\");\n\t}\n } else if (status == 2) {\n\t\tsection = selection;\n\t\tif (selection == 1) {\n\t\t\tif (cm.getPlayer().getLevel() < 25 || cm.getPlayer().getLevel() > 30 || !cm.isLeader()) {\n\t\t\t\tcm.sendOk(\"你必须在等级范围25-30和队伍队长\");\n\t\t\t} else {\n\t\t\t\tif (!cm.start_PyramidSubway(-1)) {\n\t\t\t\t\tcm.sendOk(\"里面有人,请稍后挑战\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t//todo\n\t\t} else if (selection == 2) {\n\t\t\tif (cm.haveItem(4001321)) {\n\t\t\t\tif (cm.bonus_PyramidSubway(-1)) {\n\t\t\t\t\tcm.gainItem(4001321, -1);\n\t\t\t\t} else {\n\t\t\t\t\tcm.sendOk(\"999列车平台目前有人挑战,请稍后再试。\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcm.sendOk(\"你没有999列车车票\");\n\t\t\t}\n\t\t} else if (selection == 3) {\n\t\t\tvar record = cm.getQuestRecord(7662);\n\t\t\tvar data = record.getCustomData();\n\t\t\tif (data == null) {\n\t\t\t\trecord.setCustomData(\"0\");\n\t\t\t\tdata = record.getCustomData();\n\t\t\t}\n\t\t\tvar mons = parseInt(data);\n\t\t\tif (mons < 3000) {\n\t\t\t\tcm.sendOk(\"请在车站击败至少10000个怪物,然后再找我。目前杀死 : \" + mons);\n\t\t\t} else if (cm.canHold(1142141) && !cm.haveItem(1142141)){\n\t\t\t\tcm.gainItem(1142141,1);\n\t\t\t\tcm.forceStartQuest(29931);\n\t\t\t\tcm.forceCompleteQuest(29931);\n\t\t\tcm.worldMessage(6,\"玩家:[\"+cm.getName()+\"] 领取 荣誉乘务员勋章!\");\t\t\t\t\n\t\t\t} else {\n\t\t\t\tcm.sendOk(\"请腾出背包空间.\");\n\t\t\t}\n\t\t}\n\t\tcm.dispose();\n\t} else if (status == 100) {\n\t\tcm.warp(910320000,0);\n\t\tcm.dispose();\n\t}\n}", "title": "" }, { "docid": "f5cd9d5889972ef872cb4012b931aa5f", "score": "0.5534821", "text": "function getOp(event){\n\tvar op = operation.options[operation.selectedIndex].value;\n\t//define qual operacao sera realizada na curva\n\tif(op == \"add\"){\n\t\taddPoint(event);\n\t}else if(op == \"del\"){\n\t\tdeletePoint(event);\n\t}else if(op == \"edit\"){\n\t\teditPoint(event);\n\t}\n}", "title": "" }, { "docid": "8be07d8d1f0270efb82632bd31c9a3e2", "score": "0.5526814", "text": "function options() {\n\tconsole.clear();\n\t\n\tconsole.log('☮☮☮.⚠⚠⚠⚠⚠.⌘⌘⌘..⌘⌘⌘.⚠⚠⚠⚠⚠.☮☮☮\\n');\n\t\n\tconsole.log(' SUKUNASPAM OFICIAL v1.1'.help);\n\tconsole.log(' Powered by MP Server Inc.\\n'.help);\n\t\n\tconsole.log('☮☮☮.⚠⚠⚠⚠⚠.⌘⌘⌘..⌘⌘⌘.⚠⚠⚠⚠⚠.☮☮☮\\n');\n\t\n\tconsole.log('1 - Spam SMS [ Vivo ]'.yellow);\n\tconsole.log('2 - Spam SMS [ Claro ]'.yellow);\n\tconsole.log('3 - Spam SMS [ 99 Food ]'.yellow);\n\tconsole.log('4 - Spam SMS [ OFF ]'.yellow);\n\tconsole.log('5 - Spam SMS [ Uber Eats ]'.yellow);\n\tconsole.log('6 - Spam SMS [ OFF ]'.yellow);\n\tconsole.log('0 - Sair\\n'.yellow);\n\treturn readLine.question('Selecione uma opção: '.error);\n}", "title": "" }, { "docid": "4d4a421f3465828cf8d5d0fff3c23243", "score": "0.55227244", "text": "function menu() {\n inquirer.prompt([\n {\n name: \"menu\",\n message: \"Menu:\",\n type: \"list\",\n choices: [\"Products for Sale\", \"Low Inventory\", \"Add to Inventory\", \"New Product\", \"Exit\"],\n }]).then(function (answer) {\n\n // depending on the option picked for the chosen call the correct function\n switch (answer.menu) {\n case \"Products for Sale\": {\n showInventory();\n break;\n }\n case \"Low Inventory\": {\n lowerInventory();\n break;\n }\n case \"Add to Inventory\": {\n addInventory();\n \n break;\n }\n case \"New Product\": {\n addNewProduct();\n break;\n }\n case \"Exit\": {\n connection.end();\n break;\n }\n }\n\n });\n}", "title": "" }, { "docid": "22a6a67a22a4fac6ed5fa34c7cbe210e", "score": "0.5522084", "text": "function menu(_func){\n\tif(myNodeInit){\t\t\n\t\tif(_func == \"properties\"){\n\t\t\topenproperties();\n\t\t} else if(_func == \"collapse\"){\n \tmyExpandedMode = 0;\n\t\t\texpand();\n \toutlet(4, \"vpl_menu\", \"setitem\", 3, \"expand\");\n \toutlet(4, \"vpl_menu\", \"setitem\", 4, \"fold\");\n\t\t} else if(_func == \"expand\" || _func == \"unfold\"){\n \tmyExpandedMode = 2;\n\t\t\texpand();\n \toutlet(4, \"vpl_menu\", \"setitem\", 3, \"collapse\");\n \toutlet(4, \"vpl_menu\", \"setitem\", 4, \"fold\");\n } else if(_func == \"fold\"){\n \tmyExpandedMode = 1;\n\t\t\texpand();\n \toutlet(4, \"vpl_menu\", \"setitem\", 3, \"collapse\");\n \toutlet(4, \"vpl_menu\", \"setitem\", 4, \"unfold\");\n\t\t} else if(_func == \"duplicate\"){\n\t\t\t;\n\t\t} else if(_func == \"delete\"){\n\t\t\t;\n\t\t} else if(_func == \"help\"){\n\t\t\toutlet(2, \"load\", \"bs.help.node.\" + myNodeHelp + \".maxpat\");\n\t\t}\n\t}\n}", "title": "" }, { "docid": "4b3ef90b1e25db59871e6d361572991d", "score": "0.5507995", "text": "function asOdes(){\n if(ascenOdescen == null || ascenOdescen == 'Descendente'){\n return dispatch({type:'SET_ASCEN_DESCEN', payload:'Ascendente'})\n }\n if(ascenOdescen == null || ascenOdescen == 'Descendente'){\n return dispatch({type:'SET_ASCEN_DESCEN', payload:'Ascendente'})\n }\n return dispatch({type:'SET_ASCEN_DESCEN', payload:null})\n }", "title": "" }, { "docid": "f99023d183795e907ed39021dddfcd64", "score": "0.54987746", "text": "function cobUsuarEtapaCobraDetalPostQueryActions(datos){\n\t//Primer comprovamos que hay datos. Si no hay datos lo indicamos, ocultamos las capas,\n\t//que estubiesen visibles, las minimizamos y finalizamos\n\tif(datos.length == 0){\n\t\tdocument.body.style.cursor='default';\n\t\tvisibilidad('cobUsuarEtapaCobraDetalListLayer', 'O');\n\t\tvisibilidad('cobUsuarEtapaCobraDetalListButtonsLayer', 'O');\n\t\tif(get('cobUsuarEtapaCobraDetalFrm.accion') == \"remove\"){\n\t\t\tparent.iconos.set_estado_botonera('btnBarra',4,'inactivo');\n\t\t}\n\t\tresetJsAttributeVars();\n\t\tminimizeLayers();\n\t\tcdos_mostrarAlert(GestionarMensaje('MMGGlobal.query.noresults.message'));\n\t\treturn;\n\t}\n\t\n\t//Guardamos los parámetros de la última busqueda. (en la variable javascript)\n\tcobUsuarEtapaCobraDetalLastQuery = generateQuery();\n\n\t//Antes de cargar los datos en la lista preparamos los datos\n\t//Las columnas que sean de tipo valores predeterminados ponemos la descripción en vez del codigo\n\t//Las columnas que tengan widget de tipo checkbox sustituimos el true/false por el texto en idioma\n\tvar datosTmp = new Vector();\n\tdatosTmp.cargar(datos);\n\t\n\t\t\n\t\n\t\n\t//Ponemos en el campo del choice un link para poder visualizar el registro (DESHABILITADO. Existe el modo view.\n\t//A este se accede desde el modo de consulta o desde el modo de eliminación)\n\t/*for(var i=0; i < datosTmp.longitud; i++){\n\t\tdatosTmp.ij2(\"<A HREF=\\'javascript:cobUsuarEtapaCobraDetalViewDetail(\" + datosTmp.ij(i, 0) + \")\\'>\" + datosTmp.ij(i, cobUsuarEtapaCobraDetalChoiceColumn) + \"</A>\",\n\t\t\ti, cobUsuarEtapaCobraDetalChoiceColumn);\n\t}*/\n\n\t//Filtramos el resultado para coger sólo los datos correspondientes a\n\t//las columnas de la lista Y cargamos los datos en la lista\n\tcobUsuarEtapaCobraDetalList.setDatos(datosTmp.filtrar([0,1,2,3,4,5,6,7,8,9,10,11],'*'));\n\t\n\t//La última fila de datos representa a los timestamps que debemos guardarlos\n\tcobUsuarEtapaCobraDetalTimeStamps = datosTmp.filtrar([12],'*');\n\t\n\t//SI hay mas paginas reigistramos que es así e eliminamos el último registro\n\tif(datosTmp.longitud > mmgPageSize){\n\t\tcobUsuarEtapaCobraDetalMorePagesFlag = true;\n\t\tcobUsuarEtapaCobraDetalList.eliminar(mmgPageSize, 1);\n\t}else{\n\t\tcobUsuarEtapaCobraDetalMorePagesFlag = false;\n\t}\n\t\n\t//Activamos el botón de borrar si estamos en la acción\n\tif(get('cobUsuarEtapaCobraDetalFrm.accion') == \"remove\")\n\t\tparent.iconos.set_estado_botonera('btnBarra',4,'activo');\n\n\t//Estiramos y hacemos visibles las capas que sean necesarias\n\tmaximizeLayers();\n\tvisibilidad('cobUsuarEtapaCobraDetalListLayer', 'V');\n\tvisibilidad('cobUsuarEtapaCobraDetalListButtonsLayer', 'V');\n\n\t//Ajustamos la lista de resultados con el margen derecho de la ventana\n\tDrdEnsanchaConMargenDcho('cobUsuarEtapaCobraDetalList',20);\n\teval(ON_RSZ); \n\n\t//Es necesario realizar un repintado de la tabla debido a que hemos eliminado registro\n\tcobUsuarEtapaCobraDetalList.display();\n\t\n\t//Actualizamos el estado de los botones \n\tif(cobUsuarEtapaCobraDetalMorePagesFlag){\n\t\tset_estado_botonera('cobUsuarEtapaCobraDetalPaginationButtonBar',\n\t\t\t3,\"activo\");\n\t}else{\n\t\tset_estado_botonera('cobUsuarEtapaCobraDetalPaginationButtonBar',\n\t\t\t3,\"inactivo\");\n\t}\n\tif(cobUsuarEtapaCobraDetalPageCount > 1){\n\t\tset_estado_botonera('cobUsuarEtapaCobraDetalPaginationButtonBar',\n\t\t\t2,\"activo\");\n\t\tset_estado_botonera('cobUsuarEtapaCobraDetalPaginationButtonBar',\n\t\t\t1,\"activo\");\n\t}else{\n\t\tset_estado_botonera('cobUsuarEtapaCobraDetalPaginationButtonBar',\n\t\t\t2,\"inactivo\");\n\t\tset_estado_botonera('cobUsuarEtapaCobraDetalPaginationButtonBar',\n\t\t\t1,\"inactivo\");\n\t}\n\t\n\t//Ponemos el cursor de vuelta a su estado normal\n\tdocument.body.style.cursor='default';\n}", "title": "" }, { "docid": "32052fed0c1b6ffc17c48ff18fd52daf", "score": "0.5490861", "text": "function trasforma(pos,selected)\n{\n\tdocument.getElementById(pos).innerHTML=\"<img src='imm/\"+selected+\".png'>\";//trasforma il pedone nella pedina selezionata\n\tdocument.getElementById(\"transPedone\").innerHTML='';//toglie il menu di selezione delle pedine per la trasformazione\n}", "title": "" }, { "docid": "a5ad795cd6dbbaeec3ad601f7c4b7375", "score": "0.5487054", "text": "function selectAction() {\n inquirer.prompt([\n {\n name: \"action\",\n message: \"Please select what you want to do:\",\n type: \"list\",\n choices: [\n \"View Product Sales by Department\",\n \"Create New Department\",\n ]\n }\n // use if to lead manager to the different functions\n ]).then(function (answers) {\n if (answers.action === \"View Product Sales by Department\") {\n // run the list function to display all available product\n console.log(\"=============================================\")\n salesByDepartment()\n } else if (answers.action === \"Create New Department\") {\n // run the lowInventory function to display all product with lower than 5 stock quant\n console.log(\"=============================================\")\n createDepartment() \n } else {\n console.log(\"I don't know what you want to do.\")\n }\n })\n}", "title": "" }, { "docid": "0f477d9c3113ef2670a296f1c843e740", "score": "0.54835826", "text": "function m_tt_Extm_CmdEnum()\n{\n\tvar s;\n\n\t// Add new command(s) to the commands enum\n\tfor(var i in config_menu)\n\t{\n\t\ts = \"window.\" + i.toString().toUpperCase();\n\t\tif(eval(\"typeof(\" + s + \") == m_tt_u\"))\n\t\t{\n\t\t\teval(s + \" = \" + m_tt_aV.length);\n\t\t\tm_tt_aV[m_tt_aV.length] = null;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "c3b7f1c5704564c1df36e6b39ce46fc2", "score": "0.5478533", "text": "function mostrarMenuDerecho(cuentaSelect, idList){\n\t\t\t\t//mostrar\n\t\t\t\t$(\".tarea-seleccionada li\").dblclick(function(){ \n\t\t\t\t\tlet capturoId = $(this).attr('rel');\t\t\t//capturo id de la tarea\n\t\t\t\t\tlet capturoTitle = $(this).attr('title'); \t\t//capturo ttulo de la tarea\n\t\t\t\t\t$(\".colocarNombreTarea\").attr('rel', capturoId);//añado id de tarea\n\t\t\t\t\t$(\".colocarNombreTarea\").text(capturoTitle); //añado titulo de tarea al texto\n\t\t\t\t\t$(\"#detail\").removeClass(\"hidden\");\t\t\t\t//abro el menu derecho de tarea\n\t\t\t\t\t\n\t\t\t\t\t$(\".ejecutarMostrarEliminarTarea\").on('click', function(){\n\t\t\t\t\t\t$(\".textoParaEliminar\").attr('data-idtarea', capturoId);\t//añado la accion que quiero que elimine\n\t\t\t\t\t\t$(\".textoParaEliminar\").attr('rel', 'tarea');\t\t\t\t//añado la accion que quiero que elimine\n\t\t\t\t\t\t$(\"#textoBotonEliminarListaTarea\").text(\"Eliminar tarea\"); \t//añado texto en el boton\n\t\t\t\t\t\t$(\".textoParaEliminar\").text('”'+capturoTitle+'” se eliminará de forma permanente.'); //añado titulo de tarea al texto\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t// funcion modificar tarea\n\t\t\t\tmodificarTareaSeleccionada(cuentaSelect, idList);\n\t\t\t\t// funcion elminar tarea\n\t\t\t\teliminarTareaSeleccionada(cuentaSelect, idList);\n\t\t\t}", "title": "" }, { "docid": "43bd048daff5fbb11bd9f2a4ae28a330", "score": "0.5476706", "text": "function mostrarHoteles() {\n if (mostraStatus) {\n mostrarHotelesActivados();\n } else {\n mostrarHotelesDesactivados();\n }\n}", "title": "" }, { "docid": "d7d1e7d4e6a500ae2c268e6d33da6b54", "score": "0.54688054", "text": "function maeEstatProduPostQueryActions(datos){\n\t//Primer comprovamos que hay datos. Si no hay datos lo indicamos, ocultamos las capas,\n\t//que estubiesen visibles, las minimizamos y finalizamos\n\tif(datos.length == 0){\n\t\tdocument.body.style.cursor='default';\n\t\tvisibilidad('maeEstatProduListLayer', 'O');\n\t\tvisibilidad('maeEstatProduListButtonsLayer', 'O');\n\t\tif(get('maeEstatProduFrm.accion') == \"remove\"){\n\t\t\tparent.iconos.set_estado_botonera('btnBarra',4,'inactivo');\n\t\t}\n\t\tresetJsAttributeVars();\n\t\tminimizeLayers();\n\t\tcdos_mostrarAlert(GestionarMensaje('MMGGlobal.query.noresults.message'));\n\t\treturn;\n\t}\n\t\n\t//Guardamos los parámetros de la última busqueda. (en la variable javascript)\n\tmaeEstatProduLastQuery = generateQuery();\n\n\t//Antes de cargar los datos en la lista preparamos los datos\n\t//Las columnas que sean de tipo valores predeterminados ponemos la descripción en vez del codigo\n\t//Las columnas que tengan widget de tipo checkbox sustituimos el true/false por el texto en idioma\n\tvar datosTmp = new Vector();\n\tdatosTmp.cargar(datos);\n\t\n\t\t\n\t\n\t\n\t//Ponemos en el campo del choice un link para poder visualizar el registro (DESHABILITADO. Existe el modo view.\n\t//A este se accede desde el modo de consulta o desde el modo de eliminación)\n\t/*for(var i=0; i < datosTmp.longitud; i++){\n\t\tdatosTmp.ij2(\"<A HREF=\\'javascript:maeEstatProduViewDetail(\" + datosTmp.ij(i, 0) + \")\\'>\" + datosTmp.ij(i, maeEstatProduChoiceColumn) + \"</A>\",\n\t\t\ti, maeEstatProduChoiceColumn);\n\t}*/\n\n\t//Filtramos el resultado para coger sólo los datos correspondientes a\n\t//las columnas de la lista Y cargamos los datos en la lista\n\tmaeEstatProduList.setDatos(datosTmp.filtrar([0,1,2],'*'));\n\t\n\t//La última fila de datos representa a los timestamps que debemos guardarlos\n\tmaeEstatProduTimeStamps = datosTmp.filtrar([3],'*');\n\t\n\t//SI hay mas paginas reigistramos que es así e eliminamos el último registro\n\tif(datosTmp.longitud > mmgPageSize){\n\t\tmaeEstatProduMorePagesFlag = true;\n\t\tmaeEstatProduList.eliminar(mmgPageSize, 1);\n\t}else{\n\t\tmaeEstatProduMorePagesFlag = false;\n\t}\n\t\n\t//Activamos el botón de borrar si estamos en la acción\n\tif(get('maeEstatProduFrm.accion') == \"remove\")\n\t\tparent.iconos.set_estado_botonera('btnBarra',4,'activo');\n\n\t//Estiramos y hacemos visibles las capas que sean necesarias\n\tmaximizeLayers();\n\tvisibilidad('maeEstatProduListLayer', 'V');\n\tvisibilidad('maeEstatProduListButtonsLayer', 'V');\n\n\t//Ajustamos la lista de resultados con el margen derecho de la ventana\n\tDrdEnsanchaConMargenDcho('maeEstatProduList',20);\n\teval(ON_RSZ); \n\n\t//Es necesario realizar un repintado de la tabla debido a que hemos eliminado registro\n\tmaeEstatProduList.display();\n\t\n\t//Actualizamos el estado de los botones \n\tif(maeEstatProduMorePagesFlag){\n\t\tset_estado_botonera('maeEstatProduPaginationButtonBar',\n\t\t\t3,\"activo\");\n\t}else{\n\t\tset_estado_botonera('maeEstatProduPaginationButtonBar',\n\t\t\t3,\"inactivo\");\n\t}\n\tif(maeEstatProduPageCount > 1){\n\t\tset_estado_botonera('maeEstatProduPaginationButtonBar',\n\t\t\t2,\"activo\");\n\t\tset_estado_botonera('maeEstatProduPaginationButtonBar',\n\t\t\t1,\"activo\");\n\t}else{\n\t\tset_estado_botonera('maeEstatProduPaginationButtonBar',\n\t\t\t2,\"inactivo\");\n\t\tset_estado_botonera('maeEstatProduPaginationButtonBar',\n\t\t\t1,\"inactivo\");\n\t}\n\t\n\t//Ponemos el cursor de vuelta a su estado normal\n\tdocument.body.style.cursor='default';\n}", "title": "" }, { "docid": "79468de2bc8d4f09fce181bda23cc1ea", "score": "0.54685694", "text": "procesarControles(){\n\n }", "title": "" }, { "docid": "a351cc27403dd5a9a8c46b81e0ef45f2", "score": "0.54650503", "text": "function mainMenu() {\n\n inquirer\n .prompt({\n type: \"list\",\n name: \"task\",\n message: \"Plz, select your entry ?\",\n choices: [\n \"View Employees\",\n \"View Departments\",\n \"View Roles\",\n \"Add Employees\",\n \"Update EmployeeRole\",\n \"Add Role\",\n \"Exit\"]\n })\n .then(function ({ task }) {\n switch (task) {\n case \"View Employees\":\n viewEmployee();\n break;\n case \"View Departments\":\n viewDepartmnt();\n break;\n case \"View Roles\":\n viewRole();\n break;\n case \"Add Employees\":\n addEmployee();\n break;\n case \"Update EmployeeRole\":\n updateEmployeeRole();\n break;\n case \"Add Role\":\n addRole();\n break;\n case \"Exit\":\n connection.end();\n break;\n \n }\n });\n}", "title": "" }, { "docid": "24894f0b8baca9fa984c1b9f347cbf7d", "score": "0.5464237", "text": "function alteraOpcao(){\n\tlet selectDias = document.getElementById(\"dias-semana\")\n\tlet opcaoDia = selectDias.options[selectDias.selectedIndex].value\n\treturn opcaoDia\n}", "title": "" }, { "docid": "c072c60c980939c86616ddcab8f79ac8", "score": "0.5459817", "text": "function montarSelectStatus(idTipoSituacao) {\n sistemaController.getTiposSituacoes().then(\n data => {\n let selectStatus = $('#sistema').find('#status');\n tiposSituacoes = data;\n definirOption(selectStatus,{id : '', descricao : 'Selecione'});\n\n tiposSituacoes.forEach(tiposSituacao => {\n definirOption(selectStatus, tiposSituacao, idTipoSituacao);\n });\n }, error => {\n mensagem.adicionaMensagemErro(error);\n }\n );\n}", "title": "" }, { "docid": "0fb6aefbe40cead496f0ee58f913cd84", "score": "0.54595816", "text": "function mainMenu() {\n inquirer\n .prompt({\n name: \"action\",\n type: \"rawlist\",\n message: \"What would you like to do?\",\n choices: [\n \"Add Departments\",\n \"Add Roles\",\n \"Add Employees\",\n \"View Departments\",\n \"View Roles\",\n \"View Employees\",\n \"Update Role\",\n \"Update Manager\"\n // \"View Employees by Manager\"\n ]\n })\n // Case statement for selection of menu item\n .then(function(answer) {\n switch (answer.action) {\n case \"Add Departments\":\n addDepartments();\n break;\n case \"Add Roles\":\n addRoles();\n break;\n case \"Add Employees\":\n addEmployees();\n break;\n case \"View Departments\":\n viewDepartments();\n break;\n\n case \"View Roles\":\n viewRoles();\n break;\n case \"View Employees\":\n viewEmployees();\n break;\n case \"Update Role\":\n updateRole();\n break;\n case \"Update Manager\":\n updateManager();\n break;\n // case \"View Employees by Manager\":\n // viewEmployeesByManager();\n // break;\n }\n });\n}", "title": "" }, { "docid": "e399d03e9a90bc6d41ab52fb72b0a5fb", "score": "0.545677", "text": "function mostraOpvenda(opcao) {\r\n $('.opvenda').each(function () {\r\n $(this).addClass('ocultar');\r\n });\r\n $('.' + opcao + '').toggleClass('ocultar');\r\n}", "title": "" }, { "docid": "c30f65d887fa38cfefdef3aa307027a7", "score": "0.5455444", "text": "function showOptions() {\n inquirer.prompt([\n {\n type: \"list\",\n name: \"menu_options\",\n message: \"Choose from the menu below:\",\n choices: [\"View Products for Sale\", \"View Low Inventory\", \"Add to Inventory\", \"Add New Product\"]\n }\n ])\n //once they respond\n .then(function (response) {\n\n //use a switch block to use the managers answer to trigger the\n //respective function to kick off\n switch (response.menu_options) {\n case \"View Products for Sale\":\n viewProduct();\n break;\n\n case \"View Low Inventory\":\n viewInventory();\n break;\n\n case \"Add to Inventory\":\n addInventory();\n break;\n\n case \"Add New Product\":\n addProduct();\n break;\n }\n });\n\n //======================================= VIEW PRODUCT =========================================================\n //if the manager chooses to view all products\n function viewProduct() {\n\n //query from the database all products\n connection.query(\"SELECT * FROM products\",\n\n //if there is an error, show it\n function (err, res) {\n\n if (err) throw (err);\n\n for (var i = 0; i < res.length; i++) {\n console.log(\"----------------------\\n\" + \"ID: \" + res[i].item_id + \"\\nProduct: \" + res[i].product_name + \"\\nPrice: $\" + res[i].price + \"\\nQuantity: \" + res[i].stock_quantity + \"\\n----------------------\");\n }\n\n inquirer.prompt([\n {\n type: \"confirm\",\n name: \"continue\",\n message: \"Would you like to add a new product?\"\n }\n ])\n .then(function (continue_response) {\n if (continue_response.continue) {\n addProduct();\n } else {\n console.log(\"goodbye\");\n connection.end();\n }\n })\n })\n };\n\n //======================================= VIEW INVENTORY =========================================================\n //if the manager chooses to view all inventory\n function viewInventory() {\n connection.query(\"SELECT * FROM products WHERE stock_quantity < 5\",\n function (err, res) {\n for (var i = 0; i < res.length; i++) {\n console.log(res[i].product_name + \"\\n----------------------\\n\");\n }\n }\n )\n };\n\n //======================================= ADD INVENTORY =========================================================\n //if the manager chooses to add to inventory\n function addInventory() {\n connection.query(\"SELECT * FROM products\",\n function (err, res) {\n\n if (err) throw (err);\n\n var results = [];\n\n for (var i = 0; i < res.length; i++) {\n results.push(res[i].product_name)\n }\n\n inquirer.prompt([\n {\n type: \"list\",\n name: \"update_choice\",\n message: \"Which item would you like to add to?\",\n choices: results\n }\n ]).then(function (results_two) {\n console.log(results_two.update_choice);\n })\n }\n )\n };\n\n //======================================= ADD PRODUCT =========================================================\n //if the manager chooses to add a product\n function addProduct() {\n connection.query(\"SELECT * FROM products\",\n function (err, res) {\n\n if (err) throw (err);\n\n inquirer.prompt([\n {\n type: \"input\",\n name: \"input_product\",\n message: \"Which product would you like to add?\",\n }\n ]).then(function (results_three) {\n console.log(results_three);\n })\n }\n )\n\n };\n\n\n}", "title": "" }, { "docid": "786c4b0f93f0d5faf991b7a71f648233", "score": "0.54513955", "text": "function desbloquearCamposHU(){\n\t\tif(tieneRol(\"cliente\")){//nombre, identificador, prioridad, descripcion y observaciones puede modificar, el boton crear esta activo para el\n\t\t\n\t\t}\n\t\tif(tieneRol(\"programadror\")){// modificar:estimacion de tiempo y unidad dependencia responsables, todos los botones botones \n\t\t\n\t\t}\n\t}", "title": "" }, { "docid": "c1bd11a75ff627d220a5a7e6144814aa", "score": "0.5449727", "text": "function GM_registerMenuCommand(){\n // TODO: Elements placed into the page\n }", "title": "" }, { "docid": "e8a34620e3ebac8f3b0341bf2628824c", "score": "0.54494053", "text": "function printMenu() {\n console.log(\"\\n<====== PENDAFATARAN SISWA BARU ======>\");\n console.log(\"<====== SMKN 1 RPL ======>\");\n console.log(\"\\n<====== Menu ======>\");\n console.log(\"1. Registrasi\");\n console.log(\"2. Input Nilai\");\n console.log(\"3. Lihat Profil\");\n console.log(\"4. Informasi Kelulusan\");\n console.log(\"5. keluar\");\n }", "title": "" }, { "docid": "406690231459ed6df1537678891dcb04", "score": "0.5429793", "text": "function selectOrder(evt) {\n\t\t\tmnuEditOrder.set(\"disabled\", false);\n\t\t\tmnuDeleteOrder.set(\"disabled\", false);\n\t\t\tctxMnuEditOrder.set(\"disabled\", false);\n\t\t\tctxMnuDeleteOrder.set(\"disabled\", false);\n\t\t}", "title": "" }, { "docid": "59c23cfd92a6076a5202bae0b3dd0c78", "score": "0.54290634", "text": "function carrega_tipo_opcao(key){\n var retorno = '';\n $.each(resultTipoOpcao, function (i, obj){\n retorno += ' <option value=\"'+obj['id']+'\">'+obj['nome']+'</option>';\n });\n $('div#div_pergunta_'+key).find('select#pergunta_tipo_opcao').html(retorno);\n return false;\n }", "title": "" }, { "docid": "b912f72b7117e89bfd8623ab90311fe9", "score": "0.5424238", "text": "function menu() {\n inquirer.prompt([\n {\n type: \"list\",\n name: \"choice\",\n message: \"Supervisor's Menu Options:\",\n choices: [\"View Product Sales By Department\", \"Create New Department\", \"Exit\"]\n }\n ]).then(function (answers) {\n if (answers.choice === \"View Product Sales By Department\") {\n displaySales();\n }\n else if (answers.choice === \"Create New Department\") {\n createDepartment();\n }\n else {\n connection.end();\n }\n });\n}", "title": "" }, { "docid": "9903733636935bfac6a65e2e49722cef", "score": "0.5423706", "text": "function menu() {\n inquirer\n .prompt([\n {\n type: \"list\",\n name: \"inventory\",\n message: \"Select the options below to manage the inventory:\",\n choices: [\n \"View products available for sale.\",\n \"View low inventory.\",\n \"Add new quantitites to inventory.\",\n \"Add new products to products database.\"\n ]\n }\n ])\n .then(function(answer) {\n if (answer.inventory === \"View products available for sale.\") {\n viewProducts();\n } else if (answer.inventory === \"View low inventory.\") {\n viewLowInventory();\n } else if (answer.inventory === \"Add new quantitites to inventory.\") {\n addToInventory();\n } else if (\n answer.inventory === \"Add new products to products database.\"\n ) {\n addNewProduct();\n }\n });\n}", "title": "" }, { "docid": "7ce257ad170ee7f8535d43dd48c7e8b0", "score": "0.5417268", "text": "function options() {\n inquirer.prompt({\n type: 'list',\n name: 'menu',\n message: 'What would you like to do?',\n choices: [\n 'View All Departments',\n 'Add Department',\n 'View All Roles',\n 'Add Role',\n 'View All Employees',\n 'Add Employee',\n 'Update Employee Role',\n 'Delete Department',\n 'Delete Employee',\n 'Delete Role',\n 'Quit'\n ]\n\n })\n .then(function (answers) {\n console.log('view');\n switch (answers.menu) {\n case 'View All Departments':\n viewAllDepartments();\n break;\n case 'Add Department':\n addDepartment();\n break;\n case 'View All Roles':\n viewAllRoles();\n break;\n case 'Add Role':\n addRole();\n break;\n case 'View All Employees':\n viewAllEmployees();\n break;\n case 'Add Employee':\n addEmployee();\n break;\n case 'Update Employee Role':\n updateEmployeeRole();\n break;\n case 'Delete Department':\n deleteDepartment();\n break;\n case 'Delete Employee':\n deleteEmployee();\n break;\n case 'Delete Role':\n deleteRole();\n break;\n case 'Quit':\n quitApp();\n break;\n default:\n console.log(\"You chose wrong.\")\n }\n })\n\n}", "title": "" }, { "docid": "b35941d5fcd949528ec47d249ea53589", "score": "0.54142547", "text": "function cambiamenu(){\n\n\t\t\tseleccionado=form1.epsnueva.selectedIndex;\n\t\t\tp = form1.epsnueva[form1.epsnueva.selectedIndex].value;\n \t\tt = form1.epsnueva[form1.epsnueva.selectedIndex].text;\n\t\t\ttextoseleccionado=\"\"+p+\"-\"+t;\n\t\t\tcodigoseleccionado=p;\n\n\t\t\t//alert(\"\"+p+\"-\"+t);\n\t\t\testadoclick=true;\t\t\n}", "title": "" }, { "docid": "c12064f793615aaebf2ca404e7570f30", "score": "0.54135716", "text": "function Guarda_Clics_EES_Menos()\r\n{\r\n\tGuarda_Clics(1,0);\r\n}", "title": "" }, { "docid": "b30057d68ba62769d3fc8f5548b07264", "score": "0.54132396", "text": "function fnMenuContextPastas() {\n var vjsHtml = \"\";\n vjsHtml = vjsHtml + \"<li>\";\n vjsHtml = vjsHtml + \" <div style='margin: 3px;border:1px none #4cff00;'>\";\n vjsHtml = vjsHtml + \" <span style='display:block; font-size: 11px; margin:0 0 0 20px; min-width:200px; width:200px; color: #bbb;'>Ações para a pasta:</span>\";\n vjsHtml = vjsHtml + \" <span id='menuContextPastas_pasta' style='display:block; margin: 0 20px; font-size: 15px; max-width:200px;font-size: 13px; overflow:hidden; white-space: nowrap; text-overflow: ellipsis;' title=''></span>\";\n vjsHtml = vjsHtml + \" </div>\";\n vjsHtml = vjsHtml + \"</li>\";\n vjsHtml = vjsHtml + \"<li class='divider'></li>\";\n vjsHtml = vjsHtml + \"<li><a tabindex='-1' href='#' id='menuContextPastas_abrir' data-caminho=''><i class='fa fa-folder-open-o'>&nbsp;&nbsp;</i>Abrir</a></li>\";\n vjsHtml = vjsHtml + \"<li><a tabindex='-1' href='#' id='menuContextPastas_renomear' data-toggle='modal' data-target='#modalBootstrap' data-whatever='' data-estadopasta='fechada' data-tipo='D' data-caminho=''><i class='fa fa-pencil'>&nbsp;&nbsp;</i>Renomear</a></li>\";\n vjsHtml = vjsHtml + \"<li><a tabindex='-1' href='#' id='menuContextPastas_moverpara' data-toggle='modal' data-target='#modalBootstrap' data-nome='' data-estadopasta='fechada' data-tipo='D' data-caminho=''><i class='fa fa-arrows'>&nbsp;&nbsp;</i>Mover Para</a></li>\";\n vjsHtml = vjsHtml + \"<li><a tabindex='-1' href='#' class='btn disabled' style='text-align: left;'><i class='fa fa-files-o'>&nbsp;&nbsp;</i>Copiar Para</a></li>\";\n vjsHtml = vjsHtml + \"<li role='separator' class='divider'></li>\";\n vjsHtml = vjsHtml + \"<li><a tabindex='-1' href='#' id='menuContextPastas_excluir' data-caminho='' data-caminhopastapai= '' data-whatever='' data-tipo='D' data-estadopasta='fechada' class='btn' style='text-align: left;'><i class='fa fa-trash'>&nbsp;&nbsp;</i>Excluir</a></li>\";\n $(\".folders, .folders_lista, .directory\").contextMenu({\n menuSelector: \"#contextMenu\",\n menuSelected: function (invokedOn, selectedMenu) {\n },\n beforeShow: function (invokedOn) {\n $(\"#contextMenu ul\").empty().append(vjsHtml);\n if (invokedOn.closest('#container_principallista').length) {\n $(\"#menuContextPastas_pasta\").attr('title', $.trim(invokedOn.closest('.folders, .folders_lista').find('#tituloPasta, .body_lista_titulo').text()));\n $(\"#menuContextPastas_pasta\").text($.trim(invokedOn.closest('.folders, .folders_lista').find('#tituloPasta, .body_lista_titulo').text()));\n $(\"#menuContextPastas_abrir\").data('caminho', invokedOn.find('a').data('caminho'));\n $(\"#menuContextPastas_renomear\").data('whatever', $.trim(invokedOn.closest('.folders, .folders_lista').find('#tituloPasta, .body_lista_titulo').text()));\n $(\"#menuContextPastas_renomear\").data('caminho', invokedOn.find('a').data('caminho'));\n $(\"#menuContextPastas_moverpara\").data('nome', $.trim(invokedOn.closest('.folders, .folders_lista').find('#tituloPasta, .body_lista_titulo').text()));\n $(\"#menuContextPastas_moverpara\").data('caminho', invokedOn.find('a').data('caminho'));\n $(\"#menuContextPastas_excluir\").data('caminho', invokedOn.find('a').data('caminho'));\n $(\"#menuContextPastas_excluir\").data('whatever', $.trim(invokedOn.closest('.folders, .folders_lista').find('#tituloPasta, .body_lista_titulo').text()));\n $(\"#menuContextPastas_excluir\").data('caminhopastapai', $.trim(invokedOn.closest('#container_principallista').data('caminhopasta')));\n }\n else if (invokedOn.closest('.jqueryFileTree').length) {\n $(\"#menuContextPastas_pasta\").attr('title', $.trim(invokedOn.closest('.directory').find('a:first').text()));\n $(\"#menuContextPastas_pasta\").text($.trim(invokedOn.closest('.directory').find('a:first').text()));\n if (invokedOn.closest('.directory').hasClass('collapsed')) {\n $(\"#menuContextPastas_abrir\").text(\"Abrir\").prepend(\"<i class='fa fa-folder-open-o'>&nbsp;&nbsp;</i>\");\n $(\"#menuContextPastas_renomear\").data(\"estadopasta\", \"fechada\");\n $(\"#menuContextPastas_excluir\").data(\"estadopasta\", \"fechada\");\n $(\"#menuContextPastas_moverpara\").data(\"estadopasta\", \"fechada\");\n }\n else if (invokedOn.closest('.directory').hasClass('expanded')) {\n $(\"#menuContextPastas_abrir\").text(\"Recarregar\").prepend(\"<i class='fa fa-refresh'>&nbsp;&nbsp;</i>\");\n $(\"#menuContextPastas_renomear\").data(\"estadopasta\", \"aberta\");\n $(\"#menuContextPastas_excluir\").data(\"estadopasta\", \"aberta\");\n $(\"#menuContextPastas_moverpara\").data(\"estadopasta\", \"aberta\");\n }\n $(\"#menuContextPastas_abrir\").data('caminho', invokedOn.find('a:first').data('caminho'));\n $(\"#menuContextPastas_renomear\").data('whatever', $.trim(invokedOn.closest('.directory').find('a:first').text()));\n $(\"#menuContextPastas_renomear\").data('caminho', invokedOn.find('a:first').data('caminho'));\n $(\"#menuContextPastas_moverpara\").data('nome', $.trim(invokedOn.closest('.directory').find('a:first').text()));\n $(\"#menuContextPastas_moverpara\").data('caminho', invokedOn.find('a:first').data('caminho'));\n $(\"#menuContextPastas_excluir\").data('caminho', invokedOn.find('a:first').data('caminho'));\n $(\"#menuContextPastas_excluir\").data('whatever', $.trim(invokedOn.closest('.directory').find('a:first').text()));\n if (invokedOn.closest('.jqueryFileTree').closest('.expanded').length) {\n $(\"#menuContextPastas_excluir\").data('caminhopastapai', invokedOn.closest('.jqueryFileTree').closest('.expanded').find('a:first').data('caminho'));\n }\n else{\n $(\"#menuContextPastas_excluir\").data('caminhopastapai', '/');\n }\n if (invokedOn.data('origemacesso') == '1') {\n $(\"#menuContextPastas_moverpara\").data('origemacesso', invokedOn.data('origemacesso'));\n }\n }\n }\n });\n }", "title": "" }, { "docid": "3a53070fb36b399ff608d3092dba1308", "score": "0.54018235", "text": "function onMenuItemClick(p_sType, p_aArgs, p_oValue) {\n if (p_oValue == \"startVM\") \t{ \n\t\tYAHOO.vnode.container.dialog1.show()\n\t\tYAHOO.vnode.container.dialog1.focus()\n }\n\telse if (p_oValue == \"terminateVM\") {\n\t\tYAHOO.vnode.container.dialog2.show()\n\t\tYAHOO.vnode.container.dialog2.focus()\n }\n else if (p_oValue == \"stateVM\") {\n YAHOO.vnode.container.dialog3.show()\n\t\tYAHOO.vnode.container.dialog3.focus()\n }\n else if (p_oValue == \"upTimeVM\") {\n YAHOO.vnode.container.dialog4.show()\n\t\tYAHOO.vnode.container.dialog4.focus()\n }\n else if (p_oValue == \"startVG\") {\n YAHOO.vnode.container.dialog5.show()\n\t\tYAHOO.vnode.container.dialog5.focus()\n }\n else if (p_oValue == \"stateVG\") {\n YAHOO.vnode.container.dialog6.show()\n\t\tYAHOO.vnode.container.dialog6.focus()\n }\n else if (p_oValue == \"terminateVG\") {\n YAHOO.vnode.container.dialog7.show()\n\t\tYAHOO.vnode.container.dialog7.focus()\n }\n else if (p_oValue == \"adminPanel\") {\n if (checkPermission()) {\n YAHOO.vnode.container.dialog8.show()\n\t \tYAHOO.vnode.container.dialog8.focus()\n }\n else {\n alert(\"User is not allowed\")\n }\n }\n}", "title": "" }, { "docid": "dd71167ff0742ff6141df2b48eabb8e5", "score": "0.53975165", "text": "function menuOptions() {\n\tinquirer.prompt([\n\t{\n\t\ttype: \"list\",\n\t\tmessage:\"\\nSelect a menu option from below\",\n\t\tchoices: [\"Make a new card\", \"Show existing cards\", \"Exit\"],\n\t\tname: \"menuChoices\"\n\t}\n\t\t]).then(function(useranswer){\n\n\t\t\tswitch (useranswer.menuChoices){\n\t\t\t\tcase 'Make a new card':\n\t\t\t\tconsole.log(\"Make a new flashcard\");\n\t\t\t\tBasicCard();\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'Show existing cards':\n\t\t\t\tconsole.log(\"This feature is not yet active\");\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'Exit':\n\t\t\t\tconsole.log(\"Exit\");\n\t\t\t\treturn;\n\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\treturn;\n\t\t\t\tconsole.log(\"\");\n\t\t\t\tconsole.log(\"Try Again\");\n\t\t\t\tconsole.log(\"\");\n\t\t\t} // close question selection\n\t\t});\n\t} // close function menuOptions", "title": "" }, { "docid": "606ea378470d5eb243806572a5c236f0", "score": "0.5397345", "text": "function ClickDescansar(valor) {\n // Cura letal e nao letal.\n EntradasAdicionarFerimentos(-PersonagemNivel(), false);\n EntradasAdicionarFerimentos(-PersonagemNivel(), true);\n EntradasRenovaSlotsFeiticos();\n AtualizaGeralSemLerEntradas();\n AtualizaGeral();\n}", "title": "" }, { "docid": "d7833aa9c4f4b24bce30a153025d352c", "score": "0.539538", "text": "function Guarda_Clics_EMC_Menos()\r\n{\r\n\tGuarda_Clics(3,0);\r\n}", "title": "" }, { "docid": "6113b66ae63f1861461c24a5214127b5", "score": "0.5394702", "text": "function reservar(completo, opciones){\n opciones = opciones || {};\n\n }", "title": "" }, { "docid": "39ea4a0419bc5e64ed72934678be896c", "score": "0.53930956", "text": "function menu() {\n console.log (\"\\n 1 : Lister les contacts\");\n console.log (\" 2 : Ajouter un contact\");\n console.log (\" 0 : Quitter le Gestionnaire\");\n\n}", "title": "" }, { "docid": "d662c41347a5a89fbb4efe594317db5b", "score": "0.5390587", "text": "function f_ordenar_por_V2(this_obj,ord_por){\n\n\tf=document.form1;\n\t\n\tvar estado_ord = $(this_obj).data('estado');\n\tif(estado_ord == '' || estado_ord == null || estado_ord == \"desc\"){\n\t\tord_por \t= ord_por+\" asc\";\n\t\testado_ord\t= \"asc\";\n\t\t// si esta vacio primero ordena ASC (ascendentemente)\n\t\tadd_input('ord_por','hidden',ord_por);\t\t\n\t\t\t\t\n\t}else if(estado_ord == \"asc\"){\n\t\tord_por \t= ord_por+\" desc\";\n\t\testado_ord\t= \"desc\";\n\t\tadd_input('ord_por','hidden',ord_por);\t\t\n\t\t\n\t}\n\tadd_input('estado_ord','hidden',estado_ord);\t\t\n\t\n\tf_enter();\n}", "title": "" }, { "docid": "835e0d8bc8f49ae1a3f6da1af5e2ac11", "score": "0.5390145", "text": "function cobEtapaDeudaPostQueryActions(datos){\n\t//Primer comprovamos que hay datos. Si no hay datos lo indicamos, ocultamos las capas,\n\t//que estubiesen visibles, las minimizamos y finalizamos\n\tif(datos.length == 0){\n\t\tdocument.body.style.cursor='default';\n\t\tvisibilidad('cobEtapaDeudaListLayer', 'O');\n\t\tvisibilidad('cobEtapaDeudaListButtonsLayer', 'O');\n\t\tif(get('cobEtapaDeudaFrm.accion') == \"remove\"){\n\t\t\tparent.iconos.set_estado_botonera('btnBarra',4,'inactivo');\n\t\t}\n\t\tresetJsAttributeVars();\n\t\tminimizeLayers();\n\t\tcdos_mostrarAlert(GestionarMensaje('MMGGlobal.query.noresults.message'));\n\t\treturn;\n\t}\n\t\n\t//Guardamos los parámetros de la última busqueda. (en la variable javascript)\n\tcobEtapaDeudaLastQuery = generateQuery();\n\n\t//Antes de cargar los datos en la lista preparamos los datos\n\t//Las columnas que sean de tipo valores predeterminados ponemos la descripción en vez del codigo\n\t//Las columnas que tengan widget de tipo checkbox sustituimos el true/false por el texto en idioma\n\tvar datosTmp = new Vector();\n\tdatosTmp.cargar(datos);\n\t\n\t\t\n\t\n\t\n\t//Ponemos en el campo del choice un link para poder visualizar el registro (DESHABILITADO. Existe el modo view.\n\t//A este se accede desde el modo de consulta o desde el modo de eliminación)\n\t/*for(var i=0; i < datosTmp.longitud; i++){\n\t\tdatosTmp.ij2(\"<A HREF=\\'javascript:cobEtapaDeudaViewDetail(\" + datosTmp.ij(i, 0) + \")\\'>\" + datosTmp.ij(i, cobEtapaDeudaChoiceColumn) + \"</A>\",\n\t\t\ti, cobEtapaDeudaChoiceColumn);\n\t}*/\n\n\t//Filtramos el resultado para coger sólo los datos correspondientes a\n\t//las columnas de la lista Y cargamos los datos en la lista\n\tcobEtapaDeudaList.setDatos(datosTmp.filtrar([0,1,2,3,4],'*'));\n\t\n\t//La última fila de datos representa a los timestamps que debemos guardarlos\n\tcobEtapaDeudaTimeStamps = datosTmp.filtrar([5],'*');\n\t\n\t//SI hay mas paginas reigistramos que es así e eliminamos el último registro\n\tif(datosTmp.longitud > mmgPageSize){\n\t\tcobEtapaDeudaMorePagesFlag = true;\n\t\tcobEtapaDeudaList.eliminar(mmgPageSize, 1);\n\t}else{\n\t\tcobEtapaDeudaMorePagesFlag = false;\n\t}\n\t\n\t//Activamos el botón de borrar si estamos en la acción\n\tif(get('cobEtapaDeudaFrm.accion') == \"remove\")\n\t\tparent.iconos.set_estado_botonera('btnBarra',4,'activo');\n\n\t//Estiramos y hacemos visibles las capas que sean necesarias\n\tmaximizeLayers();\n\tvisibilidad('cobEtapaDeudaListLayer', 'V');\n\tvisibilidad('cobEtapaDeudaListButtonsLayer', 'V');\n\n\t//Ajustamos la lista de resultados con el margen derecho de la ventana\n\tDrdEnsanchaConMargenDcho('cobEtapaDeudaList',20);\n\teval(ON_RSZ); \n\n\t//Es necesario realizar un repintado de la tabla debido a que hemos eliminado registro\n\tcobEtapaDeudaList.display();\n\t\n\t//Actualizamos el estado de los botones \n\tif(cobEtapaDeudaMorePagesFlag){\n\t\tset_estado_botonera('cobEtapaDeudaPaginationButtonBar',\n\t\t\t3,\"activo\");\n\t}else{\n\t\tset_estado_botonera('cobEtapaDeudaPaginationButtonBar',\n\t\t\t3,\"inactivo\");\n\t}\n\tif(cobEtapaDeudaPageCount > 1){\n\t\tset_estado_botonera('cobEtapaDeudaPaginationButtonBar',\n\t\t\t2,\"activo\");\n\t\tset_estado_botonera('cobEtapaDeudaPaginationButtonBar',\n\t\t\t1,\"activo\");\n\t}else{\n\t\tset_estado_botonera('cobEtapaDeudaPaginationButtonBar',\n\t\t\t2,\"inactivo\");\n\t\tset_estado_botonera('cobEtapaDeudaPaginationButtonBar',\n\t\t\t1,\"inactivo\");\n\t}\n\t\n\t//Ponemos el cursor de vuelta a su estado normal\n\tdocument.body.style.cursor='default';\n}", "title": "" }, { "docid": "04615eb8b8f4400bfc06893766f8e509", "score": "0.5384503", "text": "function createPromotionDropdown(promotionMove) {\n\n promotonMenuOpen = true;\n setMoveOptions([]);\n var xy = anToXy(promotionMove.to);\n var promotors = [];\n var colormod = 1;\n if (playerInfo.playingAs == \"black\")\n colormod = -1;\n\n createPromotor({\n promotors: promotors,\n move: promotionMove,\n promoteTo: \"q\",\n x: xy.x,\n y: xy.y\n });\n\n createPromotor({\n promotors: promotors,\n move: promotionMove,\n promoteTo: \"n\",\n x: xy.x + colormod * 1,\n y: xy.y\n });\n\n createPromotor({\n promotors: promotors,\n move: promotionMove,\n promoteTo: \"r\",\n x: xy.x + colormod * 2,\n y: xy.y\n });\n\n createPromotor({\n promotors: promotors,\n move: promotionMove,\n promoteTo: \"b\",\n x: xy.x + colormod * 3,\n y: xy.y\n });\n }", "title": "" }, { "docid": "bcf1de0ceeb018aae019e6096e3f21e2", "score": "0.53844935", "text": "function managerMenu(){\n\tinquirer.prompt([{\n\t\ttype: \"list\",\n\t\tname: \"mainSelection\",\n\t\tmessage: \"Please make a selection: \",\n\t\tchoices: [\"View Products for Sale\", \"View Low Inventory\", \"Add to Inventory\", \"Add New Product\"]\n\t}]).then(function(selection){\n\n\t\t// Call a particular function depending on user's selection\n\t\tswitch(selection.mainSelection){\n\t\t\tcase \"View Products for Sale\":\n\t\t\t\tviewProducts();\n\t\t\t\tbreak;\n\t\t\tcase \"View Low Inventory\":\n\t\t\t\tviewLowInventory();\n\t\t\t\tbreak;\n\t\t\tcase \"Add to Inventory\":\n\t\t\t\taddInventory();\n\t\t\t\tbreak;\n\t\t\tcase \"Add New Product\":\n\t\t\t\taddProduct();\n\t\t}\n\t});\n}", "title": "" }, { "docid": "74e310b732c7eaea48c2cf8d67b8322d", "score": "0.5377119", "text": "function ExecutaBotaoPopup(t : String, listEntry : int){\n\tfuncObj = GameObject.Find(t);\n\tfunc = funcObj.GetComponent(Funcionario);\n\ttreino = funcObj.GetComponent(Treinamento);\n\tif (listEntry != 0 && listEntry != 1)\n\t{\n\t\tswitch(listEntry)\n\t\t{\n\t\t\tcase 2: \t//\"Change Task\"\n\t\t\t\t//if (treino.GetLockEscolha() == false)// && playStyle.IsMacro() == false)\n\t\t\t\t\twindowController.ShowRoleWindow(func, treino);\n\t\t break;\n\t\t \n\t\t case 3: \t//\"Train\"\n\t\t\t\t//if (treino.GetLockEscolha() == false)// && playStyle.IsMacro() == false)\n\t\t\t\t//{\n\t\t\t\t\t//treino.SetLockEscolha(true);\n\t\t\t\t\t//novopapel = TakePapel(listEntry);\n\t\t\t\t\tmenuEsp.Especializar(func, treino);\n\t\t\t\t//}\n\t\t break;\n\t\t \n\t\t case 4: \t//\"Profile\"\n\t\t\t\tmenuAtr.SetJanelatributo(func, true, func.report);\n\t\t break;\n\t\t \n\t\t case 5: \t//\"Work Hours\"\n\t\t\t\t//if(playStyle.IsMacro() == false)\n\t\t\t\t\tworkHours.ChangeWorkHours(func);\n\t\t break;\n\t\t \n\t\t default:\n\t\t\tbreak;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "16db60d14085bf0873c70074185b6c53", "score": "0.53754133", "text": "function contextMenuWork(action, el, pos) {\r\n var count=9;\r\n switch (action) {\r\n\r\n case \"deleteDimension\":\r\n {\r\n if(count>0){\r\n $('#dimensionDialog').dialog('open');\r\n count=0;\r\n }\r\n else{\r\n //alert(\"in else\")\r\n $('#warning').dialog('open');\r\n $(\"#alert\").html(\"New Message\")\r\n }\r\n break;\r\n }\r\n case \"partialPublish\":\r\n {\r\n var fullVal=el.attr('id');\r\n var str = fullVal.split(':');\r\n\r\n var dimid = str[0];\r\n var subfolderId= str[1];\r\n var folderid=str[2];\r\n partialPublish(dimid,subfolderId,FolderId)\r\n\r\n break;\r\n }\r\n\r\n case \"deleteDimensionMember\":\r\n {\r\n if(count>0){\r\n $('#dimensionMemberDialog').dialog('open');\r\n count=0;\r\n }\r\n else{\r\n //alert(\"in else\")\r\n $('#warning').dialog('open');\r\n $(\"#alert\").html(\"New Message\")\r\n }\r\n break;\r\n }\r\n case \"showDimensionDrill\":\r\n {\r\n $(\"#editDrillDiv\").dialog('open')\r\n var frameObj=document.getElementById(\"DimenionDrillData\");\r\n// frameObj.style.display='block';\r\n// document.getElementById('fade').style.display='block';\r\n // alert('in edit subFolId '+subFolId);\r\n var source = \"pbEditDimensionRoleDrill.jsp?subFoldId=\"+subFolId;\r\n frameObj.src=source;\r\n break;\r\n }\r\n case \"viewDimensionDrill\":\r\n {\r\n $(\"#viewDrillDiv\").dialog('open')\r\n var frameObj2=document.getElementById(\"viewDrillData\");\r\n// frameObj2.style.display='block';\r\n //alert('in view drill.');\r\n //document.getElementById('fade').style.display='block';\r\n // alert('in view subFolId '+subFolId);\r\n var source2 = \"pbViewDimensionRoleDrill.jsp?subFoldId=\"+subFolId;\r\n frameObj2.src=source2;\r\n break;\r\n }\r\n\r\n //added by susheela start 02-12-09\r\n case \"editUserDimensionDrill\":\r\n {\r\n //alert('subFolderUserId '+subFolderUserId);\r\n var frameObj2=document.getElementById(\"editUserDrillData\");\r\n frameObj2.style.display='block';\r\n document.getElementById('fade').style.display='block';\r\n var source2 = \"pbEditUserRoleDrill.jsp?subFolderUserId=\"+subFolderUserId;\r\n frameObj2.src=source2;\r\n break;\r\n }\r\n case \"viewUserDimensionDrill\":\r\n {\r\n // alert('subFolderUserId '+subFolderUserId);\r\n var frameObj2=document.getElementById(\"viewUserDrillData\");\r\n frameObj2.style.display='block';\r\n document.getElementById('fade').style.display='block';\r\n var source2 = \"pbViewUserRoleDrill.jsp?subFolderUserId=\"+subFolderUserId;\r\n frameObj2.src=source2;\r\n break;\r\n }\r\n case \"restrictAccess\":\r\n {\r\n subFolderIdUser=$(\"#\"+el.attr(\"id\")+ \" input\").attr(\"id\")\r\n userDimId=memId\r\n \r\n mbrName=$(\"#\"+el.attr(\"id\")+ \" span font\").html()\r\n $(\"#accessLevel\").val(\"roleLevel\")\r\n $(\"#subFolderIdUser\").val($(\"#\"+el.attr(\"id\")+ \" input\").attr(\"id\"))\r\n $(\"#userMemId\").val(memId)\r\n \r\n mbrName=$(\"#\"+el.attr(\"id\")+ \" span font\").html()\r\n $(\"#mbrName\").val(mbrName)\r\n \r\n\r\n restrictAccessFun()\r\n //\r\n // var frameObj2=document.getElementById(\"selectRoleDimValuesData\");\r\n // frameObj2.style.display='block';\r\n // document.getElementById('fade').style.display='block';\r\n // var source2 = \"pbRoleSelectDimMembers.jsp?memId=\"+memId+\"&sFolder=\"+sFolder+\"&dimTabId=\"+dimTabId;\r\n // frameObj2.src=source2;\r\n break;\r\n }\r\n case \"userDimension\":\r\n {\r\n $(\"#accessLevel\").val(\"userLevel\")\r\n $(\"#userId\").val(userId)\r\n $(\"#subFolderIdUser\").val(subFolderIdUser)\r\n $(\"#userMemId\").val(userDimId)\r\n $(\"#mbrName\").val(mbrName)\r\n restrictAccessFun();\r\n\r\n break;\r\n }\r\n\r\n //added by susheela over 02-12-09\r\n //added by susheela over 02-12-09\r\n //added by chiranjeevi on 24-12-09 for accounts start\r\n case \"showCreateAccount\":\r\n {\r\n var frameObj2=document.getElementById(\"createAccData\");\r\n var source2 = \"createOrganisation.jsp?accountFolderId=\"+accountFolId;\r\n frameObj2.src=source2;\r\n $(\"#createAcc\").dialog('open');\r\n\r\n break;\r\n }\r\n case \"assignAccount\":\r\n {\r\n //alert(\"in asasign account....\");\r\n var frameObj = document.getElementById(\"assignAccFrame\");\r\n var source = \"assignAccounts.jsp?orgId=\"+orgId;\r\n frameObj.src = source;\r\n $(\"#assignAccDiv\").dialog('open');\r\n break;\r\n }\r\n case \"expireAccount\":\r\n {\r\n $.ajax({\r\n url: 'organisationDetails.do?param=verifyExpireOrg&orgId='+orgId,\r\n success: function(data) {\r\n // alert(\"data is\"+data)\r\n if(data=='ok'){\r\n // alert('Account Expired.');\r\n var r=confirm(\"Confirm Expire\");\r\n if (r==true){\r\n saveExpireAccount();\r\n }\r\n }else{\r\n alert(data);\r\n }\r\n }\r\n });\r\n\r\n\r\n break;\r\n }\r\n case \"getaccessAccount\":\r\n {\r\n //alert(orgId+' in acco accesss '+memId+\" ';';' \"+mbrName);\r\n var frameObj2=document.getElementById(\"selectAccountDimValuesData\");\r\n frameObj2.style.display='block';\r\n document.getElementById('fade').style.display='block';\r\n var source2 = \"pbAccountSelectDimMembers.jsp?orgId=\"+orgId+\"&memId=\"+memId+\"&memberName=\"+mbrName+\"&subFolderId=\"+subFolderId;\r\n frameObj2.src=source2;\r\n break;\r\n }\r\n case \"showInvalidateUser\":\r\n {\r\n //alert(' ina showInvalidateUser '+userIdForAcc)\r\n $.ajax({\r\n url: 'organisationDetails.do?param=expireUser&userId='+userIdForAcc.split(\":\")[1],\r\n success: function(data) {\r\n if(data==1){\r\n alert('User Invalidated.');\r\n }else{\r\n alert('User is already Invalidated');\r\n }\r\n\r\n }\r\n });\r\n break;\r\n }\r\n //added by chiranjeevi on 24-12-09 for accounts start\r\n }\r\n}", "title": "" }, { "docid": "042d93cb674aef50e925c7d7a5c67475", "score": "0.5374618", "text": "setupMenu () {\n let dy = 17;\n // create buttons for the action categories\n this.menu.createButton(24, 0, () => this.selectionMode = 'info', this, null, 'info');\n this.menu.createButton(41, 0, () => this.selectionMode = 'job', this, null, 'job');\n // create buttons for each command\n for (let key of Object.keys(this.jobCommands)) {\n let button = this.menu.createButton(0, dy, () => this.jobCommand = key, this, this.jobCommands[key].name);\n dy += button.height + 1;\n }\n // set the hit area for the menu\n this.menu.calculateHitArea();\n // menu is closed by default\n this.menu.hideMenu();\n }", "title": "" }, { "docid": "eee569cc55d30789e6350c70cd9c85b5", "score": "0.5371325", "text": "function supervisorMenu() {\n inquirer\n .prompt({\n name: 'apple',\n type: 'list',\n message: 'What would you like to do?'.yellow,\n choices: ['View Product Sales by Department',\n 'View/Update Department',\n 'Create New Department',\n 'Exit']\n })\n .then(function (pick) {\n switch (pick.apple) {\n case 'View Product Sales by Department':\n departmentSales();\n break;\n case 'View/Update Department':\n updateDepartment();\n break;\n case 'Create New Department':\n createDepartment();\n break;\n case 'Exit':\n connection.end();\n break;\n }\n });\n}", "title": "" }, { "docid": "72f63541378829bdb751feb2a581d743", "score": "0.53638595", "text": "function menuBuscar() {\n let opcion = \"\";\n while (opcion !== 1 && opcion !== 2 && opcion !== 3 && opcion !== 4 && opcion !== 5) {\n opcion = rl.question('Introduce la accion a realizar:\\n' +\n '1) Buscar autor\\n' +\n '2) Buscar todo por año de publicación\\n' +\n '3) Buscar por tipo de publicación\\n' +\n '4) Buscar por autor, año de publicación y tipo de publicación\\n' +\n '5) Volver\\n');\n\n if (opcion === '1') {\n buscarAutor();\n }\n else if (opcion === '2') {\n buscarAnyoPubli();\n }\n else if (opcion === '3') {\n buscarTipoPubli();\n }\n else if (opcion === '4') {\n buscarAutorAnyioPubliTipo();\n }\n else if (opcion === '5') {\n return;\n }\n }\n}", "title": "" }, { "docid": "e3a59075085d04395cbe5437536936a5", "score": "0.5363817", "text": "function opcions(selectedNav){\n var nav = $('#' + selectedNav);\n var valores = [nav.data('fechaInit'), nav.data('fechaFin')]\n\n var options =\n {\"optionsChart\":{\n title:{\n display: true,\n text: nav.data('desc')\n },\n legend:{\n display:true,\n position:'bottom',\n labels:{\n fontColor:'#000'\n }\n },\n tooltips:{\n enabled:true\n }\n },\n \"tipo\":nav.data('tipo'),\n \"paramsApi\":nav.data(),\n \"id\":nav.data('id')\n };\n return options;\n}", "title": "" }, { "docid": "0c8b44fc88ba5f5e172852e664d4f9d6", "score": "0.53582734", "text": "function appMenu() {\n inquirer\n .prompt({\n name: 'options',\n type: 'rawlist',\n message: 'What would you like to do?',\n choices: [\n 'Add a new department',\n 'Add a new role',\n 'Add a new employee',\n 'View all departments',\n 'View all roles',\n 'View all employees',\n 'Update an employee role',\n 'Exit',\n ],\n }).then((answer) => {\n switch (answer.options) {\n case 'Add a new department':\n addDept();\n break;\n\n case 'Add a new role':\n addRole();\n break;\n\n case 'Add a new employee':\n addEmployee();\n break;\n\n case 'View all departments':\n viewDept();\n break;\n\n case 'View all roles':\n viewRoles();\n break;\n\n case 'View all employees':\n viewEmployees();\n break;\n\n case 'Update an employee role':\n updateRole();\n break;\n\n case 'Exit':\n connection.end();\n break;\n\n };\n });\n}", "title": "" }, { "docid": "2384dc34a0111a16a14d2c6eb65f6b17", "score": "0.5357861", "text": "options(req,res){\n res.status(200).json(\n {\n sucess: true,\n messages: 'Estructura base OPTIONS',\n errors: null,\n data: [{}, {}, {}]\n }\n );\n }", "title": "" }, { "docid": "cfae75db70a727eb506c57d22a39dab6", "score": "0.5355898", "text": "function mainMenu() {\n makeDepartmentArr();\n makeRoleArr();\n makeEmployeeArr();\n inquirer.prompt([\n {\n type: 'list',\n message: 'What would you like to do?',\n name: 'action',\n choices: [\n \"view all departments\",\n \"view all roles\",\n \"view all employees\",\n \"add a department\",\n \"add a role\",\n \"add an employee\",\n \"update an employee role\",\n \"end session\"\n ]\n }\n ]).then(({ action }) => {\n switch (action) {\n case \"view all departments\":\n viewAllDepartments();\n break;\n case \"view all roles\":\n viewAllRoles();\n break;\n case \"view all employees\":\n viewAllEmployees();\n break;\n case \"add a department\":\n addDepartment();\n break;\n case \"add a role\":\n addRole();\n break;\n case \"add an employee\":\n addEmployee();\n break;\n case \"update an employee role\":\n updateEmployee();\n break;\n case \"end session\":\n connection.end();\n break;\n }\n });\n}", "title": "" }, { "docid": "a02e7f97f320c4e97ec2a2fd1472ebc5", "score": "0.5355352", "text": "function showMenu() {\n // clear the console\n console.log('\\033c');\n // menu selection\n inquirer\n .prompt([\n {\n type: \"list\",\n name: \"wish\",\n choices: [\"View Product Sales by Department\", \"Create New Department\", \"Exit\"],\n message: '\\nWhat would you like to do? '\n }\n ]).then( answer => {\n switch (answer.wish){\n case \"View Product Sales by Department\":\n showSale();\n break;\n case \"Create New Department\":\n createDept();\n break;\n case \"Exit\":\n connection.end();\n break;\n default:\n console.log( `\\x1b[1m \\x1b[31m\\nERROR! Invalid Selection\\x1b[0m`);\n }\n })\n}", "title": "" }, { "docid": "2afb1bf36d797903f3d98fc473d27fda", "score": "0.5354149", "text": "function menuoption(){\n inquirer.prompt({\n type: \"list\",\n name : \"menu\",\n message : \"What do you want to see ?\",\n choices : [\"\\n\",\"View Products for Sale\",\"View Low Inventory\",\"Add to Inventory\",\"Add New Product\"]\n\n }).then(function(answer){\n // var update;\n // var addnew;\n console.log(answer.menu);\n //if else option to compare user input and call the required function\n if(answer.menu == \"View Products for Sale\" ){\n showitem();\n }else if(answer.menu == \"View Low Inventory\"){\n \n lowinventory();\n }else if(answer.menu == \"Add to Inventory\"){\n updateinventory();\n // updateonecolumn(itemidinput);\n }else if(answer.menu == \"Add New Product\"){\n addnewproduct();\n }\n \n });\n }", "title": "" }, { "docid": "6923ed75313abff08768cde38e52c8e7", "score": "0.5352924", "text": "function mostrarDatosProducto(producto){\n let transaccion = obtenerTransaccionInicial(producto.getCodigo());\n let datosProducto = [obtenerInputsIdsProducto(),producto.fieldsToArray()];\n let datosTransaccion = [obtenerInputsIdsTransaccion(),transaccion.fieldsToArray()];\n fillFields(datosProducto);\n fillFields(datosTransaccion);\n htmlValue('inputEditar', 'EDICION');\n htmlDisable('txtCodigo');\n htmlDisable('btnAgregarNuevo', false);\n}", "title": "" }, { "docid": "29b091d3bcf3000eb27a7c976ddb2534", "score": "0.5351859", "text": "function managerMenu() {\n\n inquirer\n .prompt([\n {\n type: \"list\",\n message: \"Please select from the following options:\",\n choices: [\"View Products for Sale\", \"View Low Inventory\", \"Add to Inventory\", \"Add New Product\", \"Exit Inventory Management\"],\n name: \"action\",\n }\n ])\n .then(function(inquirerResponse) {\n \n switch (inquirerResponse.action) {\n case \"View Products for Sale\":\n displayInventory();\n \n break;\n\n case \"View Low Inventory\":\n lowInventory();\n \n break;\n\n case \"Add to Inventory\":\n addInventory();\n \n break;\n\n case \"Add New Product\":\n addProduct();\n\n break;\n\n case \"Exit Inventory Management\":\n console.log(\"Exiting Inventory Management...Goodbye!\".bold.yellow);\n //only end connection when manager chooses to from main menu\n connection.end(); \n break;\n\n }\n \n });\n}", "title": "" }, { "docid": "b8aaa0f1be91b4ca34795f322a21f97d", "score": "0.5347848", "text": "function doAdmin() {\n\n inquirer.prompt([\n {\n name: \"operation\",\n type: \"list\",\n message: \"Which product function do you want to perform?\",\n choices: [\"View Products for Sale\", \"View Low Inventory\", \"Add to Inventory\", \"Add New Product\"]\n }\n ]).then(function (admin) {\n\n switch (admin.operation) {\n\n case \"View Products for Sale\":\n dispAll();\n break;\n\n case \"View Low Inventory\":\n dispLowInv();\n break;\n\n case \"Add to Inventory\":\n addInv();\n break;\n\n case \"Add New Product\":\n addProd()\n break;\n\n }\n });\n}", "title": "" }, { "docid": "5d9e165e18c18f60bae16ce88f1f70b1", "score": "0.5346744", "text": "function comportement (){\n\t }", "title": "" }, { "docid": "f345541b0d1c4ed5e14c30fc920bc007", "score": "0.534583", "text": "function managerOptions() {\n inquirer.prompt([\n {\n name: \"option\",\n message: \"Hello, random manager. What would you like to do today?\",\n type: \"list\",\n choices: [\"View Products for Sale\", \"View Low Inventory\", \"Add to Inventory\", \"Add New Product\"]\n }\n ]).then(function (answer) {\n\n //Use a switch case since we have multiple scenarios\n switch (answer.option) {\n\n case \"View Products for Sale\":\n viewProducts();\n break;\n\n case \"View Low Inventory\":\n lowInventory();\n break;\n\n case \"Add to Inventory\":\n addInventory();\n break;\n\n case \"Add New Product\":\n addNew();\n break;\n };\n });\n}", "title": "" }, { "docid": "d21d7866279e5500072e03c523af1562", "score": "0.5344677", "text": "function menu1_carte(id,no){\n\t\tc = jeu_me[no];\n\t\tif (c.etat == ETAT_JEU){\n\t\t\taction=prompt(\"A1,A2 pour attaquer | S pour sacrifier\");\n\t\t\tif (action!=null){\n\t\t\t\tc = jeu_me[no];\n\t\t\t\tnoAtt= action.substring(1);\n\t\t\t\t\t\t\n\t\t\t\tswitch(action){\n\t\t\t\t\tcase \"A1\":\n\t\t\t\t\tcase \"A2\":\n\t\t\t\t\t\tif (cim.length<c.cout){\n\t\t\t\t\t\t\talert(\">>pas assez de créatures ds le cimetière !!!\");\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tmy_logger(\"Je place carte:\"+ c.nom+ \" en \" +action);\n\t\t\t\t\t\t\t//récupére no ATT\n\t\t\t\t\t\t\tnoAtt= action.substring(1);\n\t\t\t\t\t\t\t//placer la carte en ATT\n\t\t\t\t\t\t\tmy_logger(\"contenu:\"+att_me[noAtt-1]);\n\t\t\t\t\t\t\tif (att_me[noAtt-1]== 0){\n\t\t\t\t\t\t\t\tjeu_effacerCarte(c);\n\t\t\t\t\t\t\t\tjeu_placerEnAttaque(true, no,c,noAtt);\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\talert(\">>Attaque déjà occupée !\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"S\":\n\t\t\t\t\t\tmy_logger(\"Je sacrifie la carte=>\"+c.nom);\n\t\t\t\t\t\tsacrifierUneCarte(no,c,true,true);\n\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "0f8f74817047b54ab2394e43b2d8ef63", "score": "0.53398806", "text": "function Guarda_Clics_EMN_Menos()\r\n{\r\n\tGuarda_Clics(2,0);\r\n}", "title": "" }, { "docid": "f400c267a41e0c70d8a8c8a3031ac42f", "score": "0.53353304", "text": "function condiçaoVitoria(){}", "title": "" }, { "docid": "dbe6ca67af6471e8ffc5bbec9655c2a8", "score": "0.5335219", "text": "function testMenuPostion( menu ){\n \n }", "title": "" }, { "docid": "e53fd0f2db86de8904f40389388fadcb", "score": "0.5333977", "text": "function abrir_orden_compra(nuevo,modificar,eliminar){\n var url = \"\";\n if(nuevo==1){\n url=\"../../../../webapp/modulos/mrp/index.php/buy_order/form\";\n } else {\n if(modificar==1){\n url=\"../../../../webapp/modulos/mrp/index.php/buy_order/grid\";\n } else { \n \t\turl=\"../../../../webapp/modulos/mrp/index.php/buy_order/grid/2\";\n }\n }\n var frop = document.getElementById(\"opciones\");\n frop.src = url;\n }", "title": "" }, { "docid": "be974eda06b6dc32fd92c3c778c3f140", "score": "0.53324175", "text": "function mainMenu(){\n inquirer.prompt([\n {\n name: \"mainOptions\",\n type: \"list\",\n message:\"What would you like to do?\",\n choices: [\"View Products\", \"View Low Inventory Products\", \"Add Product Inventory\", \"Add New Product\", \"Exit\"]\n }\n ]).then(function(answer){\n switch (answer.mainOptions) {\n case \"View Products\":\n displayInventory();\n break;\n case \"View Low Inventory Products\":\n displayLowInv();\n break;\n case \"Add Product Inventory\":\n addInventory();\n break;\n case \"Add New Product\":\n addProduct();\n break;\n case \"Exit\":\n console.log(\"***********************************************************\");\n console.log(\"* Have a productive day :-) *\");\n console.log(\"***********************************************************\");\n connection.end();\n };\n });\n}", "title": "" }, { "docid": "a8f7cab9b6e2e1a312c6e10217e0f939", "score": "0.53282225", "text": "function mainMenu() {\n mapping();\n inquirer.prompt(\n {\n type: \"list\",\n message: \"What would you like to do?\",\n name: \"choices\",\n choices: [\n {\n name: \"View All Employees\",\n value: \"viewEmp\"\n },\n {\n name: \"View Employees by Manager\",\n value: \"viewEmpMan\"\n },\n {\n name: \"View All Departments\",\n value: \"viewDept\"\n },\n {\n name: \"View All Roles\",\n value: \"viewRoles\"\n },\n {\n name: \"Add an Employee\",\n value: \"addEmp\"\n },\n {\n name: \"Add a Department\",\n value: \"addDept\"\n },\n {\n name: \"Add a Role\",\n value: \"addRole\"\n },\n {\n name: \"Update Employee Role\",\n value: \"updateRole\"\n },\n {\n name: \"Update Employee Manager\",\n value: \"updateManager\"\n },\n {\n name: \"Delete a Department\",\n value: \"deleteDept\"\n },\n {\n name: \"Delete a Role\",\n value: \"deleteRole\"\n },\n {\n name: \"Delete an Employee\",\n value: \"deleteEmp\"\n },\n {\n name: \"Quit\",\n value: \"end\"\n }\n ]\n }).then(function(res) {\n execute(res.choices)\n })\n}", "title": "" }, { "docid": "5605e30f0851784d2b4419c0f3fbb1d2", "score": "0.5318366", "text": "function doRegisterCommands() {\r\n GM_registerMenuCommand('Configurar ' + appName + ' ' + appVersion + '...', preferences);\r\n GM_registerMenuCommand('Ver información de depurado', showLog);\r\n }", "title": "" }, { "docid": "26caa6c7549c9794434fc912db194168", "score": "0.5316824", "text": "function options() {\n\tstorage.getf().then((props) => {\n\t\tjira.profile(props.url).then((profile) => {\n\t\t\tdirect.speak(S(MENU_OPTION_INITIAL).template({\n\t\t\t\tname: profile.displayName\n\t\t\t}).s);\n\n\t\t\tdefineOption1(props.url, props.project);\n\t\t\tdefineOption2(props.url, props.project);\n\t\t}, (error) => {\n\t\t\tcommands = {};\n\t\t\tdirect.speak(jira.errors(error));\n\t\t});\n\t});\n}", "title": "" } ]
0046deb6fd384030b5025773865cc851
Gets the item that is the best match for the specified world coordinates.
[ { "docid": "a14f68544fb315f4575bfdcd122efed3", "score": "0.5729363", "text": "getItem(world) {\n let iv = this.i.fp(toPoint(world));\n return (iv);\n }", "title": "" } ]
[ { "docid": "7147d8b57c7e1c69fe71498bbe7ecfd6", "score": "0.623523", "text": "function findBestItem(items) {\n var bestItem = null;\n var bestValue = 0;\n var itemsIndex = 0;\n \n // Loop over the items array.\n // Find the item with the highest valueOverDistance()\n for(var i=0; i < items.length; i++){\n var tmpItemValue = valueOverDistance(items[i]);\n if(tmpItemValue > bestValue){\n bestValue = tmpItemValue;\n bestItem = items[i];\n }\n }\n return bestItem;\n}", "title": "" }, { "docid": "1f4add2d9cb8e2e15eb68dedc8653d20", "score": "0.6197345", "text": "function findBestItem(items) {\n var bestItem = null;\n var bestValue = 0;\n var itemsIndex = 0;\n \n // Loop over the items array.\n // Find the item with the highest valueOverDistance()\n while(itemsIndex < items.length) {\n var item = items[itemsIndex];\n if (valueOverDistance(item) > bestValue) {\n bestValue = valueOverDistance(item);\n bestItem = item;\n }\n itemsIndex += 1;\n }\n return bestItem;\n}", "title": "" }, { "docid": "1cb2b754c5a62ce13767908330d8bcee", "score": "0.6009995", "text": "function getClosestRes(current_loc, resource_map)\n{\n\tconst map_length = resource_map.length;\n\tvar closest_location = null;\n\tvar closest_dist = 1000;\n\n\tfor (let y = 0; y < map_length; y++){\n\t for (let x = 0; x < map_length; x++){\n if (resource_map[y][x] && square_distance({x,y}, current_loc) < closest_dist){\n\t closest_dist = square_distance({x,y}, current_loc);\n\t closest_location = {x, y};\n }\n\t }\n\t}\n\treturn closest_location;\n}", "title": "" }, { "docid": "5ac0fc85f2047df6f1444db62a8e8780", "score": "0.58584195", "text": "function bestDrop(unit) {\r\n var best = null;\r\n var bestValue = 0;\r\n var pos0 = unit.pos;\r\n var drops = unit.room.find(FIND_DROPPED_RESOURCES);\r\n for (var i = 0; i < drops.length; ++i) {\r\n var item = drops[i];\r\n var pos1 = item.pos;\r\n if (pos0.inRangeTo(pos1, 3))\r\n return item; // Automatically grab anything within 3 tiles\r\n var dx = pos0.x - pos1.x;\r\n var dy = pos0.y - pos1.y;\r\n var norm = Math.sqrt((dx * dx) + (dy * dy));\r\n var value = item.amount / norm;\r\n if (bestValue < value) {\r\n best = item;\r\n bestValue = value;\r\n }\r\n }\r\n return best;\r\n}", "title": "" }, { "docid": "4152ad64e5507fb55b1993dd7e2ef343", "score": "0.5822775", "text": "searchByPosition(posX, posY) {\n return this.getByIndex(this.toIndex(posX), this.toIndex(posY))\n }", "title": "" }, { "docid": "025f7fd54738434f48774ba86f5cede5", "score": "0.5766758", "text": "function getClosestFood(){\n if (foodList.length == 0){\n return 0;\n } else {\n var curClosest = -1;\n var curDistance = -1;\n for (var i = 0; i < foodList.length; i++){\n var curFood = foodList[i];\n var distance = Math.sqrt(Math.pow(curFood.xLoc - this.xLoc, 2) + Math.pow(curFood.yLoc - this.yLoc, 2));\n if (curClosest == -1){\n curClosest = curFood;\n curDistance = distance;\n } else if (distance < curDistance) {\n curClosest = curFood;\n curDistance = distance;\n }\n }\n return curClosest;\n }\n}", "title": "" }, { "docid": "76ee542054d50df7ea2dbcbaff0ddd33", "score": "0.5751215", "text": "function closestFoodTo(x, y) {\n\tvar closest;\n\tvar closestDistance = 999999;\n\n\tfor(var i = 0; i < foodBlobs.length; i++) {\n\t\tvar distance = utils.distance(x, y, foodBlobs[i].x, foodBlobs[i].y);\n\t\tif(distance < closestDistance) {\n\t\t\tclosest = foodBlobs[i];\n\t\t\tclosestDistance = distance;\n\t\t}\n\t}\n\n\tif(closest == undefined) {\n\t\treturn {x: x, y: y};\n\t} else {\n\t\treturn {x: closest.x, y: closest.y};\n\t}\n}", "title": "" }, { "docid": "5e55bef6c835e14db21c299f36f56070", "score": "0.5734916", "text": "function bestSpot() {\n\treturn emptySquares()[0];\n}", "title": "" }, { "docid": "4c73b5647a7d893afbf204fe3ff0c979", "score": "0.57147986", "text": "static getAgentAt(x, y) {\n\t\tvar closestDistance = 9999;\n\t\tvar closest;\n\n\t\tfor(var i = 0; i < population.length; i++) {\n\t\t\tvar distance = utils.distance(x, y, population[i].x, population[i].y);\n\n\t\t\tif(distance < closestDistance) {\n\t\t\t\tclosestDistance = distance;\n\t\t\t\tclosest = population[i];\n\t\t\t}\n\t\t}\n\n\t\tif(closest != undefined)\n\t\t\treturn closest;\n\t\telse\n\t\t\treturn false;\n\t}", "title": "" }, { "docid": "ad35458ce5881a47aad31c00db079180", "score": "0.565006", "text": "findBestOpponent() {\n const opponents = Array.from(this.trackedObjects).filter(obj => obj !== this);\n let bestOpponent = opponents[0];\n if (!bestOpponent) {\n return;\n }\n let bestDistance = math_1.Vector.squaredDistance(opponents[0].position, this.position);\n for (const opponent of opponents.slice(1)) {\n const distance = math_1.Vector.squaredDistance(opponent.position, this.position);\n if (distance < bestDistance) {\n bestOpponent = opponent;\n bestDistance = distance;\n }\n }\n return bestOpponent;\n }", "title": "" }, { "docid": "1b4cd683cafaf1d59ad10c223191eb5e", "score": "0.564114", "text": "get(xPos, yPos) {\n const x = \"x\" + xPos;\n const y = \"y\" + yPos;\n if (typeof this.locations[x] != 'undefined')\n return this.locations[x][y];\n\n // Value not found\n return null;\n }", "title": "" }, { "docid": "9f521495b3f593bf798e7d7578911aec", "score": "0.5629594", "text": "function find(x, y, radius = Infinity) {\n return pack.cells.q.find(x, y, radius);\n}", "title": "" }, { "docid": "9f521495b3f593bf798e7d7578911aec", "score": "0.5629594", "text": "function find(x, y, radius = Infinity) {\n return pack.cells.q.find(x, y, radius);\n}", "title": "" }, { "docid": "c462363b2bc1fce2a9cb3bb0a6e5190a", "score": "0.56127435", "text": "getClosest(p) {\n\t\t// Figure out what we're hovering over\n\t\tlet minD = 100\n\t\tlet closest = undefined\n\n\t\tthis.individuals.forEach((ind,index) => {\n\t\t\tlet d = Vector.getDistance(ind.center, p)\n\t\t\tif (d < minD) { \n\t\t\t\tclosest = index\n\t\t\t\tminD = d\n\t\t\t}\n\t\t})\n\t\treturn closest\n\t}", "title": "" }, { "docid": "b5bef6f9b14d72f47cde03b09d6f9a11", "score": "0.5595873", "text": "function findLocation(x){\n\tfor (var i=0; i<locations.length; i++){\n\t if (locations[i].id == x)\n\t return locations[i];\n\t}\n\treturn 0;\n}", "title": "" }, { "docid": "0f24f564020ccdc80bf875aa2c286471", "score": "0.55750287", "text": "closestObject( type, x )\n {\n let index = 0, dist = 10 ** 6, objX = undefined;\n\n // find the closest building to guard\n for( index = 0;index < this.objects.length;index++ )\n {\n let o = this.objects[ index ];\n\n const d = Math.abs( o.p.x - x );\n\n if( ( o.oType == type ) && ( d < dist ) )\n {\n dist = d;\n objX = o.p.x;\n }\n }\n\n return objX;\n }", "title": "" }, { "docid": "be703db5ed761a1c774d5da197db372a", "score": "0.553905", "text": "getFoodLocation() {\n // Generate random x and y positions\n let x = Utils.rand(GAME_WRAPPER_LEFT, GAME_WRAPPER_WIDTH, SIZE);\n let y = Utils.rand(GAME_WRAPPER_TOP - SIZE, GAME_WRAPPER_HEIGHT, SIZE);\n // If random spot is already filled, pick a new one to avoid conflicts\n if (Locations.has(x, y)) {\n [x, y] = this.getFoodLocation();\n }\n return [x, y];\n }", "title": "" }, { "docid": "3f2a8ed898f5b43e95e5381d57f8fad1", "score": "0.55255806", "text": "function getPieceFromPosition(x, y){\n for (const piece of pieces) {\n if (piece.x == x && piece.y == y) {\n return piece;\n }\n }\n return null;\n}", "title": "" }, { "docid": "fd46785736abf7d4623aa4926994b70e", "score": "0.5519656", "text": "function findrock(x,y){\n\n for (let t of rocksArray){ // goes through all rocks and returns rock at givin location\n if((t.x - 20 <= x) && (t.x + 20 >= x) && (t.y - 20 <= y) && (t.y + 20 >= y)){\n //returns the object\n return (t);\n }\n }\n return null;\n}", "title": "" }, { "docid": "f8656b2a06356a826a981de147ad72f3", "score": "0.54847634", "text": "function bestSpot(){\r\n if (isMinimax) return minimax(origBoard, aiPlayer).index;\r\n return emptySquares()[0];\r\n}", "title": "" }, { "docid": "6e4b47e2d3463db5a295a9c2cdd0114a", "score": "0.54737335", "text": "_closestRoom(rooms, room) {\n let dist = Infinity;\n let center = room.getCenter();\n let result = null;\n for (let i = 0; i < rooms.length; i++) {\n let r = rooms[i];\n let c = r.getCenter();\n let dx = c[0] - center[0];\n let dy = c[1] - center[1];\n let d = dx * dx + dy * dy;\n if (d < dist) {\n dist = d;\n result = r;\n }\n }\n return result;\n }", "title": "" }, { "docid": "76231647900dc03a400ae9d362d4247a", "score": "0.5446139", "text": "function findLocation(x, y) {\n console.log(x, y);\n for (var i = 0; i < places.length; i++) {\n if (places[i].lokasi[0] == x && places[i].lokasi[1] == y) {\n return i;\n }\n }\n return -1;\n}", "title": "" }, { "docid": "76231647900dc03a400ae9d362d4247a", "score": "0.5446139", "text": "function findLocation(x, y) {\n console.log(x, y);\n for (var i = 0; i < places.length; i++) {\n if (places[i].lokasi[0] == x && places[i].lokasi[1] == y) {\n return i;\n }\n }\n return -1;\n}", "title": "" }, { "docid": "673688b34009f9ccdee24138c2520aa2", "score": "0.5442951", "text": "function findLocation(x,y) {\r\n //console.log(x,y);\r\n for (var i = 0; i < places.length; i++){\r\n if(places[i].lokasi[0]==x && places[i].lokasi[1]==y){\r\n return i;\r\n }\r\n }\r\n return -1;\r\n}", "title": "" }, { "docid": "8bf0102dae621a7c9cbaffdc3b6606ba", "score": "0.54392916", "text": "findUse(itemName) {\n var usableItems = this.world.rooms[this.currentRoom].uses;\n if(usableItems) {\n for (var i = 0; i < usableItems.length; i++) {\n if (usableItems[i].item == itemName) {\n return usableItems[i];\n }\n }\n };\n return null;\n }", "title": "" }, { "docid": "0eb2fa4bdee3811c0cad9aed753d9918", "score": "0.5433448", "text": "function getComponent(name, closestPosition) {\r\n if (_SceneComponents[name]) \r\n return _SceneComponents[name];\r\n\r\n var name2, obj, dist, closestObj;\r\n var array = [];\r\n var i = 1;\r\n\r\n while (true) { //eek!\r\n name2 = name + '[' + i + ']';\r\n i = i+1;\r\n\r\n obj = _SceneComponents[name2];\r\n if (obj) {\r\n if (closestPosition === true) { //get all items\r\n array.push(obj);\r\n } else {\r\n if (!closestPosition) \r\n return obj;\r\n \r\n if (dist===undefined || distance(obj.position,closestPosition) < dist) {\r\n closestObj = obj;\r\n dist = distance(obj.position,closestPosition);\r\n }\r\n }\r\n } else {\r\n break;\r\n }\r\n }\r\n if (closestPosition===true && array.length > 0) return array;\r\n return closestObj;\r\n}", "title": "" }, { "docid": "17c8a1ce58ff872675bb98aba91dba5f", "score": "0.54225427", "text": "function locate() {\n var returnPtr = getPosition(Player.objectInMemory);\n return [returnPtr[0], returnPtr[1], returnPtr[2]];\n}", "title": "" }, { "docid": "63dd6c150dc6691f87bdd96852a49b41", "score": "0.5417169", "text": "function findNearestParcel() {\n let nearestParcel = parcels[0]; //default parcel\n let shortestDistance = findRoute(roadGraph, place, parcels[0].place).length; //default/base route length\n for (parcel of parcels) {\n let parcelDistance = findRoute(roadGraph, place, parcel.place).length;\n if (parcelDistance < shortestDistance) {\n //sets the current parcel if it is closer than all previous\n nearestParcel = parcel;\n shortestDistance = parcelDistance;\n }\n }\n return nearestParcel;\n }", "title": "" }, { "docid": "be235e09a9b459c5688bb408af88eadc", "score": "0.54142714", "text": "function bestSpot(){ \n\n // FOR THE MIN MAX ALGORITHM\n return minimax(origBoard, aiPlayer).index;\n \n // FOR THE SIMPLE ALGORITHM\n // return emptySquares()[0];\n}", "title": "" }, { "docid": "2bad9926021c40f90a399607d8d03bec", "score": "0.5412635", "text": "function getTileAt(x, y){\n for(var i = 0; i < tileArray.length; i++){\n if(tileArray[i]._x == x && tileArray[i]._y == y){\n return tileArray[i];\n }\n }\n return null;\n }", "title": "" }, { "docid": "90c31125bb60280d7f42ee1682feaa15", "score": "0.53969043", "text": "closestObstacle(obs)\n {\n let closestObs = null;\n let closestDistance = Infinity;\n\n for(let x = 0; x < obs.length; x++)\n {\n let distance = (obs[x].x + obs[x].width) - this.x;\n\n if(distance < closestDistance && distance > 0)\n {\n closestObs = obs[x];\n closestDistance = distance;\n }\n }\n\n return closestObs;\n }", "title": "" }, { "docid": "1bc89c5441ab4e8fa911610e1c5c29e5", "score": "0.53674567", "text": "function FindBestEnemy () : GameObject {\n\n // Find all game objects with tag Car\n var gos : GameObject[];\n gos = GameObject.FindGameObjectsWithTag(\"Car\"); \n var closest : GameObject = null; \n var distance = Mathf.Infinity; \n var distanceToCurrentTarget : float = Mathf.Infinity;\n var position = transform.position; \n // Iterate through them and find the closest one\n for (var go : GameObject in gos) { \n \tif (go.transform == transform) {\n \t\t// we don't want to attack ourselves\n \t\tcontinue;\n \t}\n \t\n \t\tif (!go.GetComponent(BuggyPlayer).alive) {\n \t\t\tcontinue;\n \t\t}\n \t\n var diff = (go.transform.position - position);\n var curDistance = diff.sqrMagnitude; \n if (curDistance < distance) { \n closest = go; \n distance = curDistance; \n }\n if (currentTargetCar) {\n \t\t\tif (go.transform == currentTargetCar.transform) {\n \t\t\t\tdistanceToCurrentTarget = curDistance;\n \t\t\t}\n \t\t} \n } \n \n if (currentTargetCar) {\n \tif (currentTargetCar.GetComponent(BuggyPlayer).alive && distance > distanceToCurrentTarget * aiMeanie) {\n \t\treturn currentTargetCar;\n \t}\n }\n \n return closest;\n}", "title": "" }, { "docid": "348f3687e96ef14702b8462c40f3acc3", "score": "0.53651947", "text": "function bestSpot(){\n return minimax(origBoard, aiPlayer).index; // It will return the value of the 0th index of the array that returned by method emptySquares()\n}", "title": "" }, { "docid": "6f749fd648134667afb17436942e33bd", "score": "0.5360874", "text": "function FindBestEnemy () : GameObject {\n\n // Find all game objects with tag Car\n var gos : GameObject[];\n gos = GameObject.FindGameObjectsWithTag(\"Car\"); \n var closest : GameObject = null; \n var distance = Mathf.Infinity; \n var distanceToCurrentTarget : float = Mathf.Infinity;\n var position = transform.position; \n // Iterate through them and find the closest one\n for (var go : GameObject in gos) { \n \tif (go.transform == transform) {\n \t\t// we don't want to attack ourselves\n \t\tcontinue;\n \t}\n \t\n \t\tif (!go.GetComponent(Car).alive) {\n \t\t\tcontinue;\n \t\t}\n \t\n var diff = (go.transform.position - position);\n var curDistance = diff.sqrMagnitude; \n if (curDistance < distance) { \n closest = go; \n distance = curDistance; \n }\n if (currentTargetCar) {\n \t\t\tif (go.transform == currentTargetCar.transform) {\n \t\t\t\tdistanceToCurrentTarget = curDistance;\n \t\t\t}\n \t\t} \n } \n \n if (currentTargetCar) {\n \tif (currentTargetCar.GetComponent(Car).alive && distance > distanceToCurrentTarget * aiMeanie) {\n \t\treturn currentTargetCar;\n \t}\n }\n \n return closest;\n}", "title": "" }, { "docid": "66ec350412adf3c68be98dd7ff961302", "score": "0.5351828", "text": "function get(x, y, z) {\n x = parseInt(x, 10);\n y = parseInt(y, 10);\n z = parseInt(z, 10);\n var tile = getTile(x, y, z);\n x = x % tileSize;\n if (x < 0) x += tileSize;\n y = y % tileSize;\n if (y < 0) y += tileSize;\n return tile ? items[tile.get(x, y)] : items[0];\n }", "title": "" }, { "docid": "7b690da5d697fb155474651e28a5a2d1", "score": "0.5346907", "text": "function findHQ(player) {\n for (var row = 0; row < ySize; row++) {\n for (var col = 0; col < xSize; col++) {\n var square = board[row][col];\n if (square.player == player && square.HQ) {\n return square;\n }\n }\n }\n}", "title": "" }, { "docid": "f2e6d3c19971191c011e2b2423179cee", "score": "0.5345855", "text": "function findNearbyItem(mouseX, mouseY, seriesFilter) {\n\t var maxDistance = options.grid.mouseActiveRadius,\n\t smallestDistance = maxDistance * maxDistance + 1,\n\t item = null, foundPoint = false, i, j, ps;\n\n\t for (i = series.length - 1; i >= 0; --i) {\n\t if (!seriesFilter(series[i]))\n\t continue;\n\n\t var s = series[i],\n\t axisx = s.xaxis,\n\t axisy = s.yaxis,\n\t points = s.datapoints.points,\n\t mx = axisx.c2p(mouseX), // precompute some stuff to make the loop faster\n\t my = axisy.c2p(mouseY),\n\t maxx = maxDistance / axisx.scale,\n\t maxy = maxDistance / axisy.scale;\n\n\t ps = s.datapoints.pointsize;\n\t // with inverse transforms, we can't use the maxx/maxy\n\t // optimization, sadly\n\t if (axisx.options.inverseTransform)\n\t maxx = Number.MAX_VALUE;\n\t if (axisy.options.inverseTransform)\n\t maxy = Number.MAX_VALUE;\n\n\t if (s.lines.show || s.points.show) {\n\t for (j = 0; j < points.length; j += ps) {\n\t var x = points[j], y = points[j + 1];\n\t if (x == null)\n\t continue;\n\n\t // For points and lines, the cursor must be within a\n\t // certain distance to the data point\n\t if (x - mx > maxx || x - mx < -maxx ||\n\t y - my > maxy || y - my < -maxy)\n\t continue;\n\n\t // We have to calculate distances in pixels, not in\n\t // data units, because the scales of the axes may be different\n\t var dx = Math.abs(axisx.p2c(x) - mouseX),\n\t dy = Math.abs(axisy.p2c(y) - mouseY),\n\t dist = dx * dx + dy * dy; // we save the sqrt\n\n\t // use <= to ensure last point takes precedence\n\t // (last generally means on top of)\n\t if (dist < smallestDistance) {\n\t smallestDistance = dist;\n\t item = [i, j / ps];\n\t }\n\t }\n\t }\n\n\t if (s.bars.show && !item) { // no other point can be nearby\n\n\t var barLeft, barRight;\n\n\t switch (s.bars.align) {\n\t case \"left\":\n\t barLeft = 0;\n\t break;\n\t case \"right\":\n\t barLeft = -s.bars.barWidth;\n\t break;\n\t default:\n\t barLeft = -s.bars.barWidth / 2;\n\t }\n\n\t barRight = barLeft + s.bars.barWidth;\n\n\t for (j = 0; j < points.length; j += ps) {\n\t var x = points[j], y = points[j + 1], b = points[j + 2];\n\t if (x == null)\n\t continue;\n\n\t // for a bar graph, the cursor must be inside the bar\n\t if (series[i].bars.horizontal ?\n\t (mx <= Math.max(b, x) && mx >= Math.min(b, x) &&\n\t my >= y + barLeft && my <= y + barRight) :\n\t (mx >= x + barLeft && mx <= x + barRight &&\n\t my >= Math.min(b, y) && my <= Math.max(b, y)))\n\t item = [i, j / ps];\n\t }\n\t }\n\t }\n\n\t if (item) {\n\t i = item[0];\n\t j = item[1];\n\t ps = series[i].datapoints.pointsize;\n\n\t return { datapoint: series[i].datapoints.points.slice(j * ps, (j + 1) * ps),\n\t dataIndex: j,\n\t series: series[i],\n\t seriesIndex: i };\n\t }\n\n\t return null;\n\t }", "title": "" }, { "docid": "4a259fdf36ca92abb51bdd99cddecb51", "score": "0.53447396", "text": "function bestSpot() {\n return minimax(origBoard, aiPlayer).index;\n}", "title": "" }, { "docid": "a4804f7da588da908d3a0c6aeb2ab353", "score": "0.5331753", "text": "function getEnemyAt(row,column)\n{\n\tvar tile = map[row][column];\n\tif(tile.stack.length > 0)\n\t{\n\t\tfor(var i = 0; i < tile.stack.length; i++)\n\t\t{\n\t\t\tvar object = tile.stack[i];\n\t\t\tif(i == tile.stack.length-1 && object.color != player.color)\n\t\t\t{\n\t\t\t\treturn object;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(isUnit(object) && object.color != player.color)\n\t\t\t\t{\n\t\t\t\t\treturn object;\n\t\t\t\t} \n\t\t\t}\n\t\t}\n\t}\n\treturn null;\n}", "title": "" }, { "docid": "d2c6f5a78e317e06e23a528bd7fbe93d", "score": "0.5324962", "text": "function findNearestMDAnderson(coords) {\n var closest;\n var closestArray = [];\n for (var i = 0; i < $scope.locationList.length; i++) {\n var latDelta = coords.lat - $scope.locationList[i].latitude;\n var longDelta = coords.long - $scope.locationList[i].longitude;\n var distSqared = (latDelta * latDelta) + (longDelta * longDelta);\n $scope.locationList[i].distance = Math.sqrt(distSqared);\n //$scope.locationList[i].name = $scope.locationList[i].name;// + \" \" + Math.sqrt(distSqared)\n $scope.locationPredicate = 'distance';\n closestArray.push($scope.locationList[i].distance)\n }\n closest = closestArray.indexOf(Math.min.apply(Math, closestArray));\n return closest;\n }", "title": "" }, { "docid": "78e0b2856e83e7e443882789f403d1ea", "score": "0.53219587", "text": "function getTileAtGlobal(x, y) {\n var tileNX = 0|(x/64);\n var tileNY = 0|(y/64);\n var tile = tiles[tileNX] [tileNY];\n return tile;\n}", "title": "" }, { "docid": "b6b9f2b147d14aac5cf7e302f3ce7ced", "score": "0.531511", "text": "function FindPlace(originalItem, originalLevel) {\n //actualizamos la lista de objetos en el nivel\n let updatePositionList = originalLevel.map(item => item.piece.map(pieceList => pieceList.pos)).flat();\n //reservamos el item original creando una copia del mismo\n let newItem = Object.assign({}, originalItem);\n //Aplicamos ofset de rotacion y posicion al objeto proporcionado\n newItem = AssignRandomPositionToItem(newItem);\n //solo con las posiciones finales\n let finalPosItem = newItem.piece.filter(thispiece => {\n if (typeof thispiece.ID !== \"undefined\") {\n return thispiece\n }\n });\n //recombinamos el item\n newItem.piece = finalPosItem;\n //Hacemos un array con las posiciones que va a ocupar nuestro item\n let itemPosList = newItem.piece.map(piece => piece.pos);\n //Comprobamos que ningun valor este cogido ya en el tablero\n let isPositionTaken = updatePositionList.some(takenPos => itemPosList.some(itemPos => JSON.stringify(takenPos) === JSON.stringify(itemPos)));\n //con el resultado final mandamos de vuelta las coordenadas y \n if (isPositionTaken) {\n let hitItem = FindPlace(originalItem, originalLevel);\n return hitItem;\n } else {\n return newItem\n }\n}", "title": "" }, { "docid": "a2406177fd940474380365a716e0023a", "score": "0.53132683", "text": "function getRandomPosition() {\n\tvar openSpots = []; // inefficient (but guaranteed) method to find all available spots in the world\n\tvar tiles = engine.world.tiles;\n\tfor (var i = 0; i < tiles.length; i++) {\n\t\tfor (var j = 0; j < tiles[i].length; j++) {\n\t\t\tif (!engine.overlapsSprites(tiles[i][j]))\n\t\t\t\topenSpots.push({x:Constants.toPixels(i),y:Constants.toPixels(j)});\n\t\t}\n\t}\n\treturn openSpots[Constants.getRandomInt(0,openSpots.length)];\n}", "title": "" }, { "docid": "97048c86ce67578fc87a96ae4c0a5a44", "score": "0.53004056", "text": "getBest() {\n var top = 0;\n let best;\n for (let s of this.pop) {\n if (s.fitness > top) {\n top = s.fitness;\n best = s;\n }\n }\n return best;\n }", "title": "" }, { "docid": "01779d7992a6a2fb6042fafb96b7f0f0", "score": "0.5294442", "text": "function findNearestNeighbor(coordinatesMap, x, y) {\n let nearestNeighbor;\n let minDistance;\n let multipleNearest = false;\n\n for (const coordinates in coordinatesMap) {\n if (coordinatesMap.hasOwnProperty(coordinates)) {\n if (coordinates === JSON.stringify([x, y])) {\n return coordinates;\n }\n\n let distance = manhattanDistance(coordinates, x, y);\n\n if (!minDistance) {\n minDistance = distance;\n nearestNeighbor = coordinates;\n continue;\n }\n\n if (distance === minDistance) {\n multipleNearest = true;\n }\n\n if (distance < minDistance) {\n minDistance = distance;\n nearestNeighbor = coordinates;\n multipleNearest = false;\n }\n }\n }\n\n return multipleNearest ? null : nearestNeighbor;\n}", "title": "" }, { "docid": "2d25a8312f2ae9f87dc784474a2193b2", "score": "0.52903783", "text": "getClosestNode( sprite ) {\n let gridX = (sprite.x-32) /64;\n let gridY = (sprite.y-32) /64;\n\n let closestNode = null;\n let closestDist = 100000000;\n\n // loop through all nodes, find the closest one\n nodes.forEach( node => {\n let dist = Math.hypot(gridY-node.y, gridX-node.x);\n if( dist < closestDist ) {\n closestDist = dist;\n closestNode = node;\n }\n });\n\n return closestNode;\n }", "title": "" }, { "docid": "d542c08fcb8398de613fb7bd26a66181", "score": "0.52754307", "text": "function findCell(x, y, radius = Infinity) {\n const found = pack.cells.q.find(x, y, radius);\n return found ? found[2] : undefined;\n}", "title": "" }, { "docid": "d542c08fcb8398de613fb7bd26a66181", "score": "0.52754307", "text": "function findCell(x, y, radius = Infinity) {\n const found = pack.cells.q.find(x, y, radius);\n return found ? found[2] : undefined;\n}", "title": "" }, { "docid": "00b6f04de47dba936335081f5530af2a", "score": "0.5263038", "text": "function getObject(position,array){\n for (var i of array){\n if (i.pos == position){\n return i;\n }\n }\n}", "title": "" }, { "docid": "9b71a533b657a1a52fdd0b857407c308", "score": "0.5257807", "text": "getActiveWorld () {\n\n for ( let i in this.keyList ) {\n\n let w = this.keyList[ i ];\n\n if ( w.scene.active ) {\n\n return w;\n\n }\n\n }\n\n return null;\n\n }", "title": "" }, { "docid": "e59ecc75e3c88ce257bb70d104f1225d", "score": "0.52530974", "text": "function findClosestStation(position) {\n closestStation = null;\n distance = 99999;\n for (var key in Stations){\n stationPos = Stations[key].position;\n d = google.maps.geometry.spherical.computeDistanceBetween(position, stationPos);\n\n if ( d < distance){\n distance = d;\n closestStation = Stations[key];\n }\n }\n miles = distance * 0.00062137; //convert returned meters to miles\n //return the closestStation as well as the distance converted to miles.\n return { station: closestStation, distance: miles };\n\n}", "title": "" }, { "docid": "13ce367984b228a78864f7456789f5b3", "score": "0.52511114", "text": "getSquareByCoord(row, col) {\n for (let i = 0; i < this.rowSize * this.columnSize; i++)\n if(this.gridArray[i].position.row == row && this.gridArray[i].position.col == col)\n return this.gridArray[i];\n }", "title": "" }, { "docid": "1c5a1c3917047c8b5175c8ed90bfef5c", "score": "0.52452075", "text": "function get_elem_by_xy(x, y) { \n let field_col = Math.floor(x / rect_w), \n field_row = Math.floor(y / rect_h)\n \n if (0 <= field_row && field_row < field.length &&\n 0 <= field_col && field_col < field[0].length) {\n return field[field_row][field_col]\n } else {\n return -1 \n }\n}", "title": "" }, { "docid": "8fc4888400f052f78b3fbf253e55d65e", "score": "0.5236064", "text": "getTileUnderPos( xPos, yPos, zPos )\n\t{\n\t\tvar tileBeneath = \"\";\n\t\tvar mapTiles = this.getTileMeshes();\n\t\tif( mapTiles.length > 0 )\n\t\t{\n\t\t\tvar botPos = new THREE.Vector3;\n\t\t\tbotPos.y = yPos;\n\t\t\tbotPos.x = xPos;\n\t\t\tbotPos.z = zPos; \n\t\t\n\t\t\tvar vec = new THREE.Vector3;\n\t\t\tvec.x = 0;\n\t\t\tvec.y = -1;\n\t\t\tvec.z = 0;\n\t\t\n\t\t\tthis.raycaster.set( botPos, vec.normalize() );\n\t\t\n\t\t\tvar intersects = this.raycaster.intersectObjects(mapTiles); // store intersecting objects\n\t\t\n\t\t\tif( intersects.length > 0 )\n\t\t\t{\n\t\t\t\t//console.log( \"getTileUnderBot() num tiles under bot is \", intersects.length );\n\t\t\t\ttileBeneath = intersects[0].object.name;\n\t\t\t}\n\t\t}\n\t\n\t\treturn tileBeneath;\n\t}", "title": "" }, { "docid": "99af391737f029a536f2807734386f2f", "score": "0.52314234", "text": "function findNearbyItem(mouseX, mouseY, seriesFilter) {\n var maxDistance = options.grid.mouseActiveRadius,\n smallestDistance = maxDistance * maxDistance + 1,\n item = null,\n foundPoint = false,\n i,\n j,\n ps;\n\n for (i = series.length - 1; i >= 0; --i) {\n if (!seriesFilter(series[i])) continue;\n\n var s = series[i],\n axisx = s.xaxis,\n axisy = s.yaxis,\n points = s.datapoints.points,\n mx = axisx.c2p(mouseX),\n // precompute some stuff to make the loop faster\n my = axisy.c2p(mouseY),\n maxx = maxDistance / axisx.scale,\n maxy = maxDistance / axisy.scale;\n\n ps = s.datapoints.pointsize;\n // with inverse transforms, we can't use the maxx/maxy\n // optimization, sadly\n if (axisx.options.inverseTransform) maxx = Number.MAX_VALUE;\n if (axisy.options.inverseTransform) maxy = Number.MAX_VALUE;\n\n if (s.lines.show || s.points.show) {\n for (j = 0; j < points.length; j += ps) {\n var x = points[j],\n y = points[j + 1];\n if (x == null) continue;\n\n // For points and lines, the cursor must be within a\n // certain distance to the data point\n if (x - mx > maxx || x - mx < -maxx || y - my > maxy || y - my < -maxy) continue;\n\n // We have to calculate distances in pixels, not in\n // data units, because the scales of the axes may be different\n var dx = Math.abs(axisx.p2c(x) - mouseX),\n dy = Math.abs(axisy.p2c(y) - mouseY),\n dist = dx * dx + dy * dy; // we save the sqrt\n\n // use <= to ensure last point takes precedence\n // (last generally means on top of)\n if (dist < smallestDistance) {\n smallestDistance = dist;\n item = [i, j / ps];\n }\n }\n }\n\n if (s.bars.show && !item) {\n // no other point can be nearby\n\n var barLeft, barRight;\n\n switch (s.bars.align) {\n case \"left\":\n barLeft = 0;\n break;\n case \"right\":\n barLeft = -s.bars.barWidth;\n break;\n default:\n barLeft = -s.bars.barWidth / 2;\n }\n\n barRight = barLeft + s.bars.barWidth;\n\n for (j = 0; j < points.length; j += ps) {\n var x = points[j],\n y = points[j + 1],\n b = points[j + 2];\n if (x == null) continue;\n\n // for a bar graph, the cursor must be inside the bar\n if (series[i].bars.horizontal ? mx <= Math.max(b, x) && mx >= Math.min(b, x) && my >= y + barLeft && my <= y + barRight : mx >= x + barLeft && mx <= x + barRight && my >= Math.min(b, y) && my <= Math.max(b, y)) item = [i, j / ps];\n }\n }\n }\n\n if (item) {\n i = item[0];\n j = item[1];\n ps = series[i].datapoints.pointsize;\n\n return { datapoint: series[i].datapoints.points.slice(j * ps, (j + 1) * ps),\n dataIndex: j,\n series: series[i],\n seriesIndex: i };\n }\n\n return null;\n }", "title": "" }, { "docid": "6d7ce01cc27d76e6a97193fc1f927a7d", "score": "0.5228799", "text": "function findNearbyItem(mouseX, mouseY, seriesFilter) {\n var maxDistance = options.grid.mouseActiveRadius,\n smallestDistance = maxDistance * maxDistance + 1,\n item = null, foundPoint = false, i, j, ps;\n\n for (i = series.length - 1; i >= 0; --i) {\n if (!seriesFilter(series[i]))\n continue;\n\n var s = series[i],\n axisx = s.xaxis,\n axisy = s.yaxis,\n points = s.datapoints.points,\n mx = axisx.c2p(mouseX), // precompute some stuff to make the loop faster\n my = axisy.c2p(mouseY),\n maxx = maxDistance / axisx.scale,\n maxy = maxDistance / axisy.scale;\n\n ps = s.datapoints.pointsize;\n // with inverse transforms, we can't use the maxx/maxy\n // optimization, sadly\n if (axisx.options.inverseTransform)\n maxx = Number.MAX_VALUE;\n if (axisy.options.inverseTransform)\n maxy = Number.MAX_VALUE;\n\n if (s.lines.show || s.points.show) {\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1];\n if (x == null)\n continue;\n\n // For points and lines, the cursor must be within a\n // certain distance to the data point\n if (x - mx > maxx || x - mx < -maxx ||\n y - my > maxy || y - my < -maxy)\n continue;\n\n // We have to calculate distances in pixels, not in\n // data units, because the scales of the axes may be different\n var dx = Math.abs(axisx.p2c(x) - mouseX),\n dy = Math.abs(axisy.p2c(y) - mouseY),\n dist = dx * dx + dy * dy; // we save the sqrt\n\n // use <= to ensure last point takes precedence\n // (last generally means on top of)\n if (dist < smallestDistance) {\n smallestDistance = dist;\n item = [i, j / ps];\n }\n }\n }\n\n if (s.bars.show && !item) { // no other point can be nearby\n\n var barLeft, barRight;\n\n switch (s.bars.align) {\n case \"left\":\n barLeft = 0;\n break;\n case \"right\":\n barLeft = -s.bars.barWidth;\n break;\n default:\n barLeft = -s.bars.barWidth / 2;\n }\n\n barRight = barLeft + s.bars.barWidth;\n\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1], b = points[j + 2];\n if (x == null)\n continue;\n\n // for a bar graph, the cursor must be inside the bar\n if (series[i].bars.horizontal ?\n (mx <= Math.max(b, x) && mx >= Math.min(b, x) &&\n my >= y + barLeft && my <= y + barRight) :\n (mx >= x + barLeft && mx <= x + barRight &&\n my >= Math.min(b, y) && my <= Math.max(b, y)))\n item = [i, j / ps];\n }\n }\n }\n\n if (item) {\n i = item[0];\n j = item[1];\n ps = series[i].datapoints.pointsize;\n\n return { datapoint: series[i].datapoints.points.slice(j * ps, (j + 1) * ps),\n dataIndex: j,\n series: series[i],\n seriesIndex: i };\n }\n\n return null;\n }", "title": "" }, { "docid": "6d7ce01cc27d76e6a97193fc1f927a7d", "score": "0.5228799", "text": "function findNearbyItem(mouseX, mouseY, seriesFilter) {\n var maxDistance = options.grid.mouseActiveRadius,\n smallestDistance = maxDistance * maxDistance + 1,\n item = null, foundPoint = false, i, j, ps;\n\n for (i = series.length - 1; i >= 0; --i) {\n if (!seriesFilter(series[i]))\n continue;\n\n var s = series[i],\n axisx = s.xaxis,\n axisy = s.yaxis,\n points = s.datapoints.points,\n mx = axisx.c2p(mouseX), // precompute some stuff to make the loop faster\n my = axisy.c2p(mouseY),\n maxx = maxDistance / axisx.scale,\n maxy = maxDistance / axisy.scale;\n\n ps = s.datapoints.pointsize;\n // with inverse transforms, we can't use the maxx/maxy\n // optimization, sadly\n if (axisx.options.inverseTransform)\n maxx = Number.MAX_VALUE;\n if (axisy.options.inverseTransform)\n maxy = Number.MAX_VALUE;\n\n if (s.lines.show || s.points.show) {\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1];\n if (x == null)\n continue;\n\n // For points and lines, the cursor must be within a\n // certain distance to the data point\n if (x - mx > maxx || x - mx < -maxx ||\n y - my > maxy || y - my < -maxy)\n continue;\n\n // We have to calculate distances in pixels, not in\n // data units, because the scales of the axes may be different\n var dx = Math.abs(axisx.p2c(x) - mouseX),\n dy = Math.abs(axisy.p2c(y) - mouseY),\n dist = dx * dx + dy * dy; // we save the sqrt\n\n // use <= to ensure last point takes precedence\n // (last generally means on top of)\n if (dist < smallestDistance) {\n smallestDistance = dist;\n item = [i, j / ps];\n }\n }\n }\n\n if (s.bars.show && !item) { // no other point can be nearby\n\n var barLeft, barRight;\n\n switch (s.bars.align) {\n case \"left\":\n barLeft = 0;\n break;\n case \"right\":\n barLeft = -s.bars.barWidth;\n break;\n default:\n barLeft = -s.bars.barWidth / 2;\n }\n\n barRight = barLeft + s.bars.barWidth;\n\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1], b = points[j + 2];\n if (x == null)\n continue;\n\n // for a bar graph, the cursor must be inside the bar\n if (series[i].bars.horizontal ?\n (mx <= Math.max(b, x) && mx >= Math.min(b, x) &&\n my >= y + barLeft && my <= y + barRight) :\n (mx >= x + barLeft && mx <= x + barRight &&\n my >= Math.min(b, y) && my <= Math.max(b, y)))\n item = [i, j / ps];\n }\n }\n }\n\n if (item) {\n i = item[0];\n j = item[1];\n ps = series[i].datapoints.pointsize;\n\n return { datapoint: series[i].datapoints.points.slice(j * ps, (j + 1) * ps),\n dataIndex: j,\n series: series[i],\n seriesIndex: i };\n }\n\n return null;\n }", "title": "" }, { "docid": "6d7ce01cc27d76e6a97193fc1f927a7d", "score": "0.5228799", "text": "function findNearbyItem(mouseX, mouseY, seriesFilter) {\n var maxDistance = options.grid.mouseActiveRadius,\n smallestDistance = maxDistance * maxDistance + 1,\n item = null, foundPoint = false, i, j, ps;\n\n for (i = series.length - 1; i >= 0; --i) {\n if (!seriesFilter(series[i]))\n continue;\n\n var s = series[i],\n axisx = s.xaxis,\n axisy = s.yaxis,\n points = s.datapoints.points,\n mx = axisx.c2p(mouseX), // precompute some stuff to make the loop faster\n my = axisy.c2p(mouseY),\n maxx = maxDistance / axisx.scale,\n maxy = maxDistance / axisy.scale;\n\n ps = s.datapoints.pointsize;\n // with inverse transforms, we can't use the maxx/maxy\n // optimization, sadly\n if (axisx.options.inverseTransform)\n maxx = Number.MAX_VALUE;\n if (axisy.options.inverseTransform)\n maxy = Number.MAX_VALUE;\n\n if (s.lines.show || s.points.show) {\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1];\n if (x == null)\n continue;\n\n // For points and lines, the cursor must be within a\n // certain distance to the data point\n if (x - mx > maxx || x - mx < -maxx ||\n y - my > maxy || y - my < -maxy)\n continue;\n\n // We have to calculate distances in pixels, not in\n // data units, because the scales of the axes may be different\n var dx = Math.abs(axisx.p2c(x) - mouseX),\n dy = Math.abs(axisy.p2c(y) - mouseY),\n dist = dx * dx + dy * dy; // we save the sqrt\n\n // use <= to ensure last point takes precedence\n // (last generally means on top of)\n if (dist < smallestDistance) {\n smallestDistance = dist;\n item = [i, j / ps];\n }\n }\n }\n\n if (s.bars.show && !item) { // no other point can be nearby\n\n var barLeft, barRight;\n\n switch (s.bars.align) {\n case \"left\":\n barLeft = 0;\n break;\n case \"right\":\n barLeft = -s.bars.barWidth;\n break;\n default:\n barLeft = -s.bars.barWidth / 2;\n }\n\n barRight = barLeft + s.bars.barWidth;\n\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1], b = points[j + 2];\n if (x == null)\n continue;\n\n // for a bar graph, the cursor must be inside the bar\n if (series[i].bars.horizontal ?\n (mx <= Math.max(b, x) && mx >= Math.min(b, x) &&\n my >= y + barLeft && my <= y + barRight) :\n (mx >= x + barLeft && mx <= x + barRight &&\n my >= Math.min(b, y) && my <= Math.max(b, y)))\n item = [i, j / ps];\n }\n }\n }\n\n if (item) {\n i = item[0];\n j = item[1];\n ps = series[i].datapoints.pointsize;\n\n return { datapoint: series[i].datapoints.points.slice(j * ps, (j + 1) * ps),\n dataIndex: j,\n series: series[i],\n seriesIndex: i };\n }\n\n return null;\n }", "title": "" }, { "docid": "6d7ce01cc27d76e6a97193fc1f927a7d", "score": "0.5228799", "text": "function findNearbyItem(mouseX, mouseY, seriesFilter) {\n var maxDistance = options.grid.mouseActiveRadius,\n smallestDistance = maxDistance * maxDistance + 1,\n item = null, foundPoint = false, i, j, ps;\n\n for (i = series.length - 1; i >= 0; --i) {\n if (!seriesFilter(series[i]))\n continue;\n\n var s = series[i],\n axisx = s.xaxis,\n axisy = s.yaxis,\n points = s.datapoints.points,\n mx = axisx.c2p(mouseX), // precompute some stuff to make the loop faster\n my = axisy.c2p(mouseY),\n maxx = maxDistance / axisx.scale,\n maxy = maxDistance / axisy.scale;\n\n ps = s.datapoints.pointsize;\n // with inverse transforms, we can't use the maxx/maxy\n // optimization, sadly\n if (axisx.options.inverseTransform)\n maxx = Number.MAX_VALUE;\n if (axisy.options.inverseTransform)\n maxy = Number.MAX_VALUE;\n\n if (s.lines.show || s.points.show) {\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1];\n if (x == null)\n continue;\n\n // For points and lines, the cursor must be within a\n // certain distance to the data point\n if (x - mx > maxx || x - mx < -maxx ||\n y - my > maxy || y - my < -maxy)\n continue;\n\n // We have to calculate distances in pixels, not in\n // data units, because the scales of the axes may be different\n var dx = Math.abs(axisx.p2c(x) - mouseX),\n dy = Math.abs(axisy.p2c(y) - mouseY),\n dist = dx * dx + dy * dy; // we save the sqrt\n\n // use <= to ensure last point takes precedence\n // (last generally means on top of)\n if (dist < smallestDistance) {\n smallestDistance = dist;\n item = [i, j / ps];\n }\n }\n }\n\n if (s.bars.show && !item) { // no other point can be nearby\n\n var barLeft, barRight;\n\n switch (s.bars.align) {\n case \"left\":\n barLeft = 0;\n break;\n case \"right\":\n barLeft = -s.bars.barWidth;\n break;\n default:\n barLeft = -s.bars.barWidth / 2;\n }\n\n barRight = barLeft + s.bars.barWidth;\n\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1], b = points[j + 2];\n if (x == null)\n continue;\n\n // for a bar graph, the cursor must be inside the bar\n if (series[i].bars.horizontal ?\n (mx <= Math.max(b, x) && mx >= Math.min(b, x) &&\n my >= y + barLeft && my <= y + barRight) :\n (mx >= x + barLeft && mx <= x + barRight &&\n my >= Math.min(b, y) && my <= Math.max(b, y)))\n item = [i, j / ps];\n }\n }\n }\n\n if (item) {\n i = item[0];\n j = item[1];\n ps = series[i].datapoints.pointsize;\n\n return { datapoint: series[i].datapoints.points.slice(j * ps, (j + 1) * ps),\n dataIndex: j,\n series: series[i],\n seriesIndex: i };\n }\n\n return null;\n }", "title": "" }, { "docid": "6d7ce01cc27d76e6a97193fc1f927a7d", "score": "0.5228799", "text": "function findNearbyItem(mouseX, mouseY, seriesFilter) {\n var maxDistance = options.grid.mouseActiveRadius,\n smallestDistance = maxDistance * maxDistance + 1,\n item = null, foundPoint = false, i, j, ps;\n\n for (i = series.length - 1; i >= 0; --i) {\n if (!seriesFilter(series[i]))\n continue;\n\n var s = series[i],\n axisx = s.xaxis,\n axisy = s.yaxis,\n points = s.datapoints.points,\n mx = axisx.c2p(mouseX), // precompute some stuff to make the loop faster\n my = axisy.c2p(mouseY),\n maxx = maxDistance / axisx.scale,\n maxy = maxDistance / axisy.scale;\n\n ps = s.datapoints.pointsize;\n // with inverse transforms, we can't use the maxx/maxy\n // optimization, sadly\n if (axisx.options.inverseTransform)\n maxx = Number.MAX_VALUE;\n if (axisy.options.inverseTransform)\n maxy = Number.MAX_VALUE;\n\n if (s.lines.show || s.points.show) {\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1];\n if (x == null)\n continue;\n\n // For points and lines, the cursor must be within a\n // certain distance to the data point\n if (x - mx > maxx || x - mx < -maxx ||\n y - my > maxy || y - my < -maxy)\n continue;\n\n // We have to calculate distances in pixels, not in\n // data units, because the scales of the axes may be different\n var dx = Math.abs(axisx.p2c(x) - mouseX),\n dy = Math.abs(axisy.p2c(y) - mouseY),\n dist = dx * dx + dy * dy; // we save the sqrt\n\n // use <= to ensure last point takes precedence\n // (last generally means on top of)\n if (dist < smallestDistance) {\n smallestDistance = dist;\n item = [i, j / ps];\n }\n }\n }\n\n if (s.bars.show && !item) { // no other point can be nearby\n\n var barLeft, barRight;\n\n switch (s.bars.align) {\n case \"left\":\n barLeft = 0;\n break;\n case \"right\":\n barLeft = -s.bars.barWidth;\n break;\n default:\n barLeft = -s.bars.barWidth / 2;\n }\n\n barRight = barLeft + s.bars.barWidth;\n\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1], b = points[j + 2];\n if (x == null)\n continue;\n\n // for a bar graph, the cursor must be inside the bar\n if (series[i].bars.horizontal ?\n (mx <= Math.max(b, x) && mx >= Math.min(b, x) &&\n my >= y + barLeft && my <= y + barRight) :\n (mx >= x + barLeft && mx <= x + barRight &&\n my >= Math.min(b, y) && my <= Math.max(b, y)))\n item = [i, j / ps];\n }\n }\n }\n\n if (item) {\n i = item[0];\n j = item[1];\n ps = series[i].datapoints.pointsize;\n\n return { datapoint: series[i].datapoints.points.slice(j * ps, (j + 1) * ps),\n dataIndex: j,\n series: series[i],\n seriesIndex: i };\n }\n\n return null;\n }", "title": "" }, { "docid": "6d7ce01cc27d76e6a97193fc1f927a7d", "score": "0.5228799", "text": "function findNearbyItem(mouseX, mouseY, seriesFilter) {\n var maxDistance = options.grid.mouseActiveRadius,\n smallestDistance = maxDistance * maxDistance + 1,\n item = null, foundPoint = false, i, j, ps;\n\n for (i = series.length - 1; i >= 0; --i) {\n if (!seriesFilter(series[i]))\n continue;\n\n var s = series[i],\n axisx = s.xaxis,\n axisy = s.yaxis,\n points = s.datapoints.points,\n mx = axisx.c2p(mouseX), // precompute some stuff to make the loop faster\n my = axisy.c2p(mouseY),\n maxx = maxDistance / axisx.scale,\n maxy = maxDistance / axisy.scale;\n\n ps = s.datapoints.pointsize;\n // with inverse transforms, we can't use the maxx/maxy\n // optimization, sadly\n if (axisx.options.inverseTransform)\n maxx = Number.MAX_VALUE;\n if (axisy.options.inverseTransform)\n maxy = Number.MAX_VALUE;\n\n if (s.lines.show || s.points.show) {\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1];\n if (x == null)\n continue;\n\n // For points and lines, the cursor must be within a\n // certain distance to the data point\n if (x - mx > maxx || x - mx < -maxx ||\n y - my > maxy || y - my < -maxy)\n continue;\n\n // We have to calculate distances in pixels, not in\n // data units, because the scales of the axes may be different\n var dx = Math.abs(axisx.p2c(x) - mouseX),\n dy = Math.abs(axisy.p2c(y) - mouseY),\n dist = dx * dx + dy * dy; // we save the sqrt\n\n // use <= to ensure last point takes precedence\n // (last generally means on top of)\n if (dist < smallestDistance) {\n smallestDistance = dist;\n item = [i, j / ps];\n }\n }\n }\n\n if (s.bars.show && !item) { // no other point can be nearby\n\n var barLeft, barRight;\n\n switch (s.bars.align) {\n case \"left\":\n barLeft = 0;\n break;\n case \"right\":\n barLeft = -s.bars.barWidth;\n break;\n default:\n barLeft = -s.bars.barWidth / 2;\n }\n\n barRight = barLeft + s.bars.barWidth;\n\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1], b = points[j + 2];\n if (x == null)\n continue;\n\n // for a bar graph, the cursor must be inside the bar\n if (series[i].bars.horizontal ?\n (mx <= Math.max(b, x) && mx >= Math.min(b, x) &&\n my >= y + barLeft && my <= y + barRight) :\n (mx >= x + barLeft && mx <= x + barRight &&\n my >= Math.min(b, y) && my <= Math.max(b, y)))\n item = [i, j / ps];\n }\n }\n }\n\n if (item) {\n i = item[0];\n j = item[1];\n ps = series[i].datapoints.pointsize;\n\n return { datapoint: series[i].datapoints.points.slice(j * ps, (j + 1) * ps),\n dataIndex: j,\n series: series[i],\n seriesIndex: i };\n }\n\n return null;\n }", "title": "" }, { "docid": "6d7ce01cc27d76e6a97193fc1f927a7d", "score": "0.5228799", "text": "function findNearbyItem(mouseX, mouseY, seriesFilter) {\n var maxDistance = options.grid.mouseActiveRadius,\n smallestDistance = maxDistance * maxDistance + 1,\n item = null, foundPoint = false, i, j, ps;\n\n for (i = series.length - 1; i >= 0; --i) {\n if (!seriesFilter(series[i]))\n continue;\n\n var s = series[i],\n axisx = s.xaxis,\n axisy = s.yaxis,\n points = s.datapoints.points,\n mx = axisx.c2p(mouseX), // precompute some stuff to make the loop faster\n my = axisy.c2p(mouseY),\n maxx = maxDistance / axisx.scale,\n maxy = maxDistance / axisy.scale;\n\n ps = s.datapoints.pointsize;\n // with inverse transforms, we can't use the maxx/maxy\n // optimization, sadly\n if (axisx.options.inverseTransform)\n maxx = Number.MAX_VALUE;\n if (axisy.options.inverseTransform)\n maxy = Number.MAX_VALUE;\n\n if (s.lines.show || s.points.show) {\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1];\n if (x == null)\n continue;\n\n // For points and lines, the cursor must be within a\n // certain distance to the data point\n if (x - mx > maxx || x - mx < -maxx ||\n y - my > maxy || y - my < -maxy)\n continue;\n\n // We have to calculate distances in pixels, not in\n // data units, because the scales of the axes may be different\n var dx = Math.abs(axisx.p2c(x) - mouseX),\n dy = Math.abs(axisy.p2c(y) - mouseY),\n dist = dx * dx + dy * dy; // we save the sqrt\n\n // use <= to ensure last point takes precedence\n // (last generally means on top of)\n if (dist < smallestDistance) {\n smallestDistance = dist;\n item = [i, j / ps];\n }\n }\n }\n\n if (s.bars.show && !item) { // no other point can be nearby\n\n var barLeft, barRight;\n\n switch (s.bars.align) {\n case \"left\":\n barLeft = 0;\n break;\n case \"right\":\n barLeft = -s.bars.barWidth;\n break;\n default:\n barLeft = -s.bars.barWidth / 2;\n }\n\n barRight = barLeft + s.bars.barWidth;\n\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1], b = points[j + 2];\n if (x == null)\n continue;\n\n // for a bar graph, the cursor must be inside the bar\n if (series[i].bars.horizontal ?\n (mx <= Math.max(b, x) && mx >= Math.min(b, x) &&\n my >= y + barLeft && my <= y + barRight) :\n (mx >= x + barLeft && mx <= x + barRight &&\n my >= Math.min(b, y) && my <= Math.max(b, y)))\n item = [i, j / ps];\n }\n }\n }\n\n if (item) {\n i = item[0];\n j = item[1];\n ps = series[i].datapoints.pointsize;\n\n return { datapoint: series[i].datapoints.points.slice(j * ps, (j + 1) * ps),\n dataIndex: j,\n series: series[i],\n seriesIndex: i };\n }\n\n return null;\n }", "title": "" }, { "docid": "6d7ce01cc27d76e6a97193fc1f927a7d", "score": "0.5228799", "text": "function findNearbyItem(mouseX, mouseY, seriesFilter) {\n var maxDistance = options.grid.mouseActiveRadius,\n smallestDistance = maxDistance * maxDistance + 1,\n item = null, foundPoint = false, i, j, ps;\n\n for (i = series.length - 1; i >= 0; --i) {\n if (!seriesFilter(series[i]))\n continue;\n\n var s = series[i],\n axisx = s.xaxis,\n axisy = s.yaxis,\n points = s.datapoints.points,\n mx = axisx.c2p(mouseX), // precompute some stuff to make the loop faster\n my = axisy.c2p(mouseY),\n maxx = maxDistance / axisx.scale,\n maxy = maxDistance / axisy.scale;\n\n ps = s.datapoints.pointsize;\n // with inverse transforms, we can't use the maxx/maxy\n // optimization, sadly\n if (axisx.options.inverseTransform)\n maxx = Number.MAX_VALUE;\n if (axisy.options.inverseTransform)\n maxy = Number.MAX_VALUE;\n\n if (s.lines.show || s.points.show) {\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1];\n if (x == null)\n continue;\n\n // For points and lines, the cursor must be within a\n // certain distance to the data point\n if (x - mx > maxx || x - mx < -maxx ||\n y - my > maxy || y - my < -maxy)\n continue;\n\n // We have to calculate distances in pixels, not in\n // data units, because the scales of the axes may be different\n var dx = Math.abs(axisx.p2c(x) - mouseX),\n dy = Math.abs(axisy.p2c(y) - mouseY),\n dist = dx * dx + dy * dy; // we save the sqrt\n\n // use <= to ensure last point takes precedence\n // (last generally means on top of)\n if (dist < smallestDistance) {\n smallestDistance = dist;\n item = [i, j / ps];\n }\n }\n }\n\n if (s.bars.show && !item) { // no other point can be nearby\n\n var barLeft, barRight;\n\n switch (s.bars.align) {\n case \"left\":\n barLeft = 0;\n break;\n case \"right\":\n barLeft = -s.bars.barWidth;\n break;\n default:\n barLeft = -s.bars.barWidth / 2;\n }\n\n barRight = barLeft + s.bars.barWidth;\n\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1], b = points[j + 2];\n if (x == null)\n continue;\n\n // for a bar graph, the cursor must be inside the bar\n if (series[i].bars.horizontal ?\n (mx <= Math.max(b, x) && mx >= Math.min(b, x) &&\n my >= y + barLeft && my <= y + barRight) :\n (mx >= x + barLeft && mx <= x + barRight &&\n my >= Math.min(b, y) && my <= Math.max(b, y)))\n item = [i, j / ps];\n }\n }\n }\n\n if (item) {\n i = item[0];\n j = item[1];\n ps = series[i].datapoints.pointsize;\n\n return { datapoint: series[i].datapoints.points.slice(j * ps, (j + 1) * ps),\n dataIndex: j,\n series: series[i],\n seriesIndex: i };\n }\n\n return null;\n }", "title": "" }, { "docid": "6d7ce01cc27d76e6a97193fc1f927a7d", "score": "0.5228799", "text": "function findNearbyItem(mouseX, mouseY, seriesFilter) {\n var maxDistance = options.grid.mouseActiveRadius,\n smallestDistance = maxDistance * maxDistance + 1,\n item = null, foundPoint = false, i, j, ps;\n\n for (i = series.length - 1; i >= 0; --i) {\n if (!seriesFilter(series[i]))\n continue;\n\n var s = series[i],\n axisx = s.xaxis,\n axisy = s.yaxis,\n points = s.datapoints.points,\n mx = axisx.c2p(mouseX), // precompute some stuff to make the loop faster\n my = axisy.c2p(mouseY),\n maxx = maxDistance / axisx.scale,\n maxy = maxDistance / axisy.scale;\n\n ps = s.datapoints.pointsize;\n // with inverse transforms, we can't use the maxx/maxy\n // optimization, sadly\n if (axisx.options.inverseTransform)\n maxx = Number.MAX_VALUE;\n if (axisy.options.inverseTransform)\n maxy = Number.MAX_VALUE;\n\n if (s.lines.show || s.points.show) {\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1];\n if (x == null)\n continue;\n\n // For points and lines, the cursor must be within a\n // certain distance to the data point\n if (x - mx > maxx || x - mx < -maxx ||\n y - my > maxy || y - my < -maxy)\n continue;\n\n // We have to calculate distances in pixels, not in\n // data units, because the scales of the axes may be different\n var dx = Math.abs(axisx.p2c(x) - mouseX),\n dy = Math.abs(axisy.p2c(y) - mouseY),\n dist = dx * dx + dy * dy; // we save the sqrt\n\n // use <= to ensure last point takes precedence\n // (last generally means on top of)\n if (dist < smallestDistance) {\n smallestDistance = dist;\n item = [i, j / ps];\n }\n }\n }\n\n if (s.bars.show && !item) { // no other point can be nearby\n\n var barLeft, barRight;\n\n switch (s.bars.align) {\n case \"left\":\n barLeft = 0;\n break;\n case \"right\":\n barLeft = -s.bars.barWidth;\n break;\n default:\n barLeft = -s.bars.barWidth / 2;\n }\n\n barRight = barLeft + s.bars.barWidth;\n\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1], b = points[j + 2];\n if (x == null)\n continue;\n\n // for a bar graph, the cursor must be inside the bar\n if (series[i].bars.horizontal ?\n (mx <= Math.max(b, x) && mx >= Math.min(b, x) &&\n my >= y + barLeft && my <= y + barRight) :\n (mx >= x + barLeft && mx <= x + barRight &&\n my >= Math.min(b, y) && my <= Math.max(b, y)))\n item = [i, j / ps];\n }\n }\n }\n\n if (item) {\n i = item[0];\n j = item[1];\n ps = series[i].datapoints.pointsize;\n\n return { datapoint: series[i].datapoints.points.slice(j * ps, (j + 1) * ps),\n dataIndex: j,\n series: series[i],\n seriesIndex: i };\n }\n\n return null;\n }", "title": "" }, { "docid": "6d7ce01cc27d76e6a97193fc1f927a7d", "score": "0.5228799", "text": "function findNearbyItem(mouseX, mouseY, seriesFilter) {\n var maxDistance = options.grid.mouseActiveRadius,\n smallestDistance = maxDistance * maxDistance + 1,\n item = null, foundPoint = false, i, j, ps;\n\n for (i = series.length - 1; i >= 0; --i) {\n if (!seriesFilter(series[i]))\n continue;\n\n var s = series[i],\n axisx = s.xaxis,\n axisy = s.yaxis,\n points = s.datapoints.points,\n mx = axisx.c2p(mouseX), // precompute some stuff to make the loop faster\n my = axisy.c2p(mouseY),\n maxx = maxDistance / axisx.scale,\n maxy = maxDistance / axisy.scale;\n\n ps = s.datapoints.pointsize;\n // with inverse transforms, we can't use the maxx/maxy\n // optimization, sadly\n if (axisx.options.inverseTransform)\n maxx = Number.MAX_VALUE;\n if (axisy.options.inverseTransform)\n maxy = Number.MAX_VALUE;\n\n if (s.lines.show || s.points.show) {\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1];\n if (x == null)\n continue;\n\n // For points and lines, the cursor must be within a\n // certain distance to the data point\n if (x - mx > maxx || x - mx < -maxx ||\n y - my > maxy || y - my < -maxy)\n continue;\n\n // We have to calculate distances in pixels, not in\n // data units, because the scales of the axes may be different\n var dx = Math.abs(axisx.p2c(x) - mouseX),\n dy = Math.abs(axisy.p2c(y) - mouseY),\n dist = dx * dx + dy * dy; // we save the sqrt\n\n // use <= to ensure last point takes precedence\n // (last generally means on top of)\n if (dist < smallestDistance) {\n smallestDistance = dist;\n item = [i, j / ps];\n }\n }\n }\n\n if (s.bars.show && !item) { // no other point can be nearby\n\n var barLeft, barRight;\n\n switch (s.bars.align) {\n case \"left\":\n barLeft = 0;\n break;\n case \"right\":\n barLeft = -s.bars.barWidth;\n break;\n default:\n barLeft = -s.bars.barWidth / 2;\n }\n\n barRight = barLeft + s.bars.barWidth;\n\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1], b = points[j + 2];\n if (x == null)\n continue;\n\n // for a bar graph, the cursor must be inside the bar\n if (series[i].bars.horizontal ?\n (mx <= Math.max(b, x) && mx >= Math.min(b, x) &&\n my >= y + barLeft && my <= y + barRight) :\n (mx >= x + barLeft && mx <= x + barRight &&\n my >= Math.min(b, y) && my <= Math.max(b, y)))\n item = [i, j / ps];\n }\n }\n }\n\n if (item) {\n i = item[0];\n j = item[1];\n ps = series[i].datapoints.pointsize;\n\n return { datapoint: series[i].datapoints.points.slice(j * ps, (j + 1) * ps),\n dataIndex: j,\n series: series[i],\n seriesIndex: i };\n }\n\n return null;\n }", "title": "" }, { "docid": "6d7ce01cc27d76e6a97193fc1f927a7d", "score": "0.5228799", "text": "function findNearbyItem(mouseX, mouseY, seriesFilter) {\n var maxDistance = options.grid.mouseActiveRadius,\n smallestDistance = maxDistance * maxDistance + 1,\n item = null, foundPoint = false, i, j, ps;\n\n for (i = series.length - 1; i >= 0; --i) {\n if (!seriesFilter(series[i]))\n continue;\n\n var s = series[i],\n axisx = s.xaxis,\n axisy = s.yaxis,\n points = s.datapoints.points,\n mx = axisx.c2p(mouseX), // precompute some stuff to make the loop faster\n my = axisy.c2p(mouseY),\n maxx = maxDistance / axisx.scale,\n maxy = maxDistance / axisy.scale;\n\n ps = s.datapoints.pointsize;\n // with inverse transforms, we can't use the maxx/maxy\n // optimization, sadly\n if (axisx.options.inverseTransform)\n maxx = Number.MAX_VALUE;\n if (axisy.options.inverseTransform)\n maxy = Number.MAX_VALUE;\n\n if (s.lines.show || s.points.show) {\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1];\n if (x == null)\n continue;\n\n // For points and lines, the cursor must be within a\n // certain distance to the data point\n if (x - mx > maxx || x - mx < -maxx ||\n y - my > maxy || y - my < -maxy)\n continue;\n\n // We have to calculate distances in pixels, not in\n // data units, because the scales of the axes may be different\n var dx = Math.abs(axisx.p2c(x) - mouseX),\n dy = Math.abs(axisy.p2c(y) - mouseY),\n dist = dx * dx + dy * dy; // we save the sqrt\n\n // use <= to ensure last point takes precedence\n // (last generally means on top of)\n if (dist < smallestDistance) {\n smallestDistance = dist;\n item = [i, j / ps];\n }\n }\n }\n\n if (s.bars.show && !item) { // no other point can be nearby\n\n var barLeft, barRight;\n\n switch (s.bars.align) {\n case \"left\":\n barLeft = 0;\n break;\n case \"right\":\n barLeft = -s.bars.barWidth;\n break;\n default:\n barLeft = -s.bars.barWidth / 2;\n }\n\n barRight = barLeft + s.bars.barWidth;\n\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1], b = points[j + 2];\n if (x == null)\n continue;\n\n // for a bar graph, the cursor must be inside the bar\n if (series[i].bars.horizontal ?\n (mx <= Math.max(b, x) && mx >= Math.min(b, x) &&\n my >= y + barLeft && my <= y + barRight) :\n (mx >= x + barLeft && mx <= x + barRight &&\n my >= Math.min(b, y) && my <= Math.max(b, y)))\n item = [i, j / ps];\n }\n }\n }\n\n if (item) {\n i = item[0];\n j = item[1];\n ps = series[i].datapoints.pointsize;\n\n return { datapoint: series[i].datapoints.points.slice(j * ps, (j + 1) * ps),\n dataIndex: j,\n series: series[i],\n seriesIndex: i };\n }\n\n return null;\n }", "title": "" }, { "docid": "6d7ce01cc27d76e6a97193fc1f927a7d", "score": "0.5228799", "text": "function findNearbyItem(mouseX, mouseY, seriesFilter) {\n var maxDistance = options.grid.mouseActiveRadius,\n smallestDistance = maxDistance * maxDistance + 1,\n item = null, foundPoint = false, i, j, ps;\n\n for (i = series.length - 1; i >= 0; --i) {\n if (!seriesFilter(series[i]))\n continue;\n\n var s = series[i],\n axisx = s.xaxis,\n axisy = s.yaxis,\n points = s.datapoints.points,\n mx = axisx.c2p(mouseX), // precompute some stuff to make the loop faster\n my = axisy.c2p(mouseY),\n maxx = maxDistance / axisx.scale,\n maxy = maxDistance / axisy.scale;\n\n ps = s.datapoints.pointsize;\n // with inverse transforms, we can't use the maxx/maxy\n // optimization, sadly\n if (axisx.options.inverseTransform)\n maxx = Number.MAX_VALUE;\n if (axisy.options.inverseTransform)\n maxy = Number.MAX_VALUE;\n\n if (s.lines.show || s.points.show) {\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1];\n if (x == null)\n continue;\n\n // For points and lines, the cursor must be within a\n // certain distance to the data point\n if (x - mx > maxx || x - mx < -maxx ||\n y - my > maxy || y - my < -maxy)\n continue;\n\n // We have to calculate distances in pixels, not in\n // data units, because the scales of the axes may be different\n var dx = Math.abs(axisx.p2c(x) - mouseX),\n dy = Math.abs(axisy.p2c(y) - mouseY),\n dist = dx * dx + dy * dy; // we save the sqrt\n\n // use <= to ensure last point takes precedence\n // (last generally means on top of)\n if (dist < smallestDistance) {\n smallestDistance = dist;\n item = [i, j / ps];\n }\n }\n }\n\n if (s.bars.show && !item) { // no other point can be nearby\n\n var barLeft, barRight;\n\n switch (s.bars.align) {\n case \"left\":\n barLeft = 0;\n break;\n case \"right\":\n barLeft = -s.bars.barWidth;\n break;\n default:\n barLeft = -s.bars.barWidth / 2;\n }\n\n barRight = barLeft + s.bars.barWidth;\n\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1], b = points[j + 2];\n if (x == null)\n continue;\n\n // for a bar graph, the cursor must be inside the bar\n if (series[i].bars.horizontal ?\n (mx <= Math.max(b, x) && mx >= Math.min(b, x) &&\n my >= y + barLeft && my <= y + barRight) :\n (mx >= x + barLeft && mx <= x + barRight &&\n my >= Math.min(b, y) && my <= Math.max(b, y)))\n item = [i, j / ps];\n }\n }\n }\n\n if (item) {\n i = item[0];\n j = item[1];\n ps = series[i].datapoints.pointsize;\n\n return { datapoint: series[i].datapoints.points.slice(j * ps, (j + 1) * ps),\n dataIndex: j,\n series: series[i],\n seriesIndex: i };\n }\n\n return null;\n }", "title": "" }, { "docid": "6d7ce01cc27d76e6a97193fc1f927a7d", "score": "0.5228799", "text": "function findNearbyItem(mouseX, mouseY, seriesFilter) {\n var maxDistance = options.grid.mouseActiveRadius,\n smallestDistance = maxDistance * maxDistance + 1,\n item = null, foundPoint = false, i, j, ps;\n\n for (i = series.length - 1; i >= 0; --i) {\n if (!seriesFilter(series[i]))\n continue;\n\n var s = series[i],\n axisx = s.xaxis,\n axisy = s.yaxis,\n points = s.datapoints.points,\n mx = axisx.c2p(mouseX), // precompute some stuff to make the loop faster\n my = axisy.c2p(mouseY),\n maxx = maxDistance / axisx.scale,\n maxy = maxDistance / axisy.scale;\n\n ps = s.datapoints.pointsize;\n // with inverse transforms, we can't use the maxx/maxy\n // optimization, sadly\n if (axisx.options.inverseTransform)\n maxx = Number.MAX_VALUE;\n if (axisy.options.inverseTransform)\n maxy = Number.MAX_VALUE;\n\n if (s.lines.show || s.points.show) {\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1];\n if (x == null)\n continue;\n\n // For points and lines, the cursor must be within a\n // certain distance to the data point\n if (x - mx > maxx || x - mx < -maxx ||\n y - my > maxy || y - my < -maxy)\n continue;\n\n // We have to calculate distances in pixels, not in\n // data units, because the scales of the axes may be different\n var dx = Math.abs(axisx.p2c(x) - mouseX),\n dy = Math.abs(axisy.p2c(y) - mouseY),\n dist = dx * dx + dy * dy; // we save the sqrt\n\n // use <= to ensure last point takes precedence\n // (last generally means on top of)\n if (dist < smallestDistance) {\n smallestDistance = dist;\n item = [i, j / ps];\n }\n }\n }\n\n if (s.bars.show && !item) { // no other point can be nearby\n\n var barLeft, barRight;\n\n switch (s.bars.align) {\n case \"left\":\n barLeft = 0;\n break;\n case \"right\":\n barLeft = -s.bars.barWidth;\n break;\n default:\n barLeft = -s.bars.barWidth / 2;\n }\n\n barRight = barLeft + s.bars.barWidth;\n\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1], b = points[j + 2];\n if (x == null)\n continue;\n\n // for a bar graph, the cursor must be inside the bar\n if (series[i].bars.horizontal ?\n (mx <= Math.max(b, x) && mx >= Math.min(b, x) &&\n my >= y + barLeft && my <= y + barRight) :\n (mx >= x + barLeft && mx <= x + barRight &&\n my >= Math.min(b, y) && my <= Math.max(b, y)))\n item = [i, j / ps];\n }\n }\n }\n\n if (item) {\n i = item[0];\n j = item[1];\n ps = series[i].datapoints.pointsize;\n\n return { datapoint: series[i].datapoints.points.slice(j * ps, (j + 1) * ps),\n dataIndex: j,\n series: series[i],\n seriesIndex: i };\n }\n\n return null;\n }", "title": "" }, { "docid": "6d7ce01cc27d76e6a97193fc1f927a7d", "score": "0.5228799", "text": "function findNearbyItem(mouseX, mouseY, seriesFilter) {\n var maxDistance = options.grid.mouseActiveRadius,\n smallestDistance = maxDistance * maxDistance + 1,\n item = null, foundPoint = false, i, j, ps;\n\n for (i = series.length - 1; i >= 0; --i) {\n if (!seriesFilter(series[i]))\n continue;\n\n var s = series[i],\n axisx = s.xaxis,\n axisy = s.yaxis,\n points = s.datapoints.points,\n mx = axisx.c2p(mouseX), // precompute some stuff to make the loop faster\n my = axisy.c2p(mouseY),\n maxx = maxDistance / axisx.scale,\n maxy = maxDistance / axisy.scale;\n\n ps = s.datapoints.pointsize;\n // with inverse transforms, we can't use the maxx/maxy\n // optimization, sadly\n if (axisx.options.inverseTransform)\n maxx = Number.MAX_VALUE;\n if (axisy.options.inverseTransform)\n maxy = Number.MAX_VALUE;\n\n if (s.lines.show || s.points.show) {\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1];\n if (x == null)\n continue;\n\n // For points and lines, the cursor must be within a\n // certain distance to the data point\n if (x - mx > maxx || x - mx < -maxx ||\n y - my > maxy || y - my < -maxy)\n continue;\n\n // We have to calculate distances in pixels, not in\n // data units, because the scales of the axes may be different\n var dx = Math.abs(axisx.p2c(x) - mouseX),\n dy = Math.abs(axisy.p2c(y) - mouseY),\n dist = dx * dx + dy * dy; // we save the sqrt\n\n // use <= to ensure last point takes precedence\n // (last generally means on top of)\n if (dist < smallestDistance) {\n smallestDistance = dist;\n item = [i, j / ps];\n }\n }\n }\n\n if (s.bars.show && !item) { // no other point can be nearby\n\n var barLeft, barRight;\n\n switch (s.bars.align) {\n case \"left\":\n barLeft = 0;\n break;\n case \"right\":\n barLeft = -s.bars.barWidth;\n break;\n default:\n barLeft = -s.bars.barWidth / 2;\n }\n\n barRight = barLeft + s.bars.barWidth;\n\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1], b = points[j + 2];\n if (x == null)\n continue;\n\n // for a bar graph, the cursor must be inside the bar\n if (series[i].bars.horizontal ?\n (mx <= Math.max(b, x) && mx >= Math.min(b, x) &&\n my >= y + barLeft && my <= y + barRight) :\n (mx >= x + barLeft && mx <= x + barRight &&\n my >= Math.min(b, y) && my <= Math.max(b, y)))\n item = [i, j / ps];\n }\n }\n }\n\n if (item) {\n i = item[0];\n j = item[1];\n ps = series[i].datapoints.pointsize;\n\n return { datapoint: series[i].datapoints.points.slice(j * ps, (j + 1) * ps),\n dataIndex: j,\n series: series[i],\n seriesIndex: i };\n }\n\n return null;\n }", "title": "" }, { "docid": "6d7ce01cc27d76e6a97193fc1f927a7d", "score": "0.5228799", "text": "function findNearbyItem(mouseX, mouseY, seriesFilter) {\n var maxDistance = options.grid.mouseActiveRadius,\n smallestDistance = maxDistance * maxDistance + 1,\n item = null, foundPoint = false, i, j, ps;\n\n for (i = series.length - 1; i >= 0; --i) {\n if (!seriesFilter(series[i]))\n continue;\n\n var s = series[i],\n axisx = s.xaxis,\n axisy = s.yaxis,\n points = s.datapoints.points,\n mx = axisx.c2p(mouseX), // precompute some stuff to make the loop faster\n my = axisy.c2p(mouseY),\n maxx = maxDistance / axisx.scale,\n maxy = maxDistance / axisy.scale;\n\n ps = s.datapoints.pointsize;\n // with inverse transforms, we can't use the maxx/maxy\n // optimization, sadly\n if (axisx.options.inverseTransform)\n maxx = Number.MAX_VALUE;\n if (axisy.options.inverseTransform)\n maxy = Number.MAX_VALUE;\n\n if (s.lines.show || s.points.show) {\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1];\n if (x == null)\n continue;\n\n // For points and lines, the cursor must be within a\n // certain distance to the data point\n if (x - mx > maxx || x - mx < -maxx ||\n y - my > maxy || y - my < -maxy)\n continue;\n\n // We have to calculate distances in pixels, not in\n // data units, because the scales of the axes may be different\n var dx = Math.abs(axisx.p2c(x) - mouseX),\n dy = Math.abs(axisy.p2c(y) - mouseY),\n dist = dx * dx + dy * dy; // we save the sqrt\n\n // use <= to ensure last point takes precedence\n // (last generally means on top of)\n if (dist < smallestDistance) {\n smallestDistance = dist;\n item = [i, j / ps];\n }\n }\n }\n\n if (s.bars.show && !item) { // no other point can be nearby\n\n var barLeft, barRight;\n\n switch (s.bars.align) {\n case \"left\":\n barLeft = 0;\n break;\n case \"right\":\n barLeft = -s.bars.barWidth;\n break;\n default:\n barLeft = -s.bars.barWidth / 2;\n }\n\n barRight = barLeft + s.bars.barWidth;\n\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1], b = points[j + 2];\n if (x == null)\n continue;\n\n // for a bar graph, the cursor must be inside the bar\n if (series[i].bars.horizontal ?\n (mx <= Math.max(b, x) && mx >= Math.min(b, x) &&\n my >= y + barLeft && my <= y + barRight) :\n (mx >= x + barLeft && mx <= x + barRight &&\n my >= Math.min(b, y) && my <= Math.max(b, y)))\n item = [i, j / ps];\n }\n }\n }\n\n if (item) {\n i = item[0];\n j = item[1];\n ps = series[i].datapoints.pointsize;\n\n return { datapoint: series[i].datapoints.points.slice(j * ps, (j + 1) * ps),\n dataIndex: j,\n series: series[i],\n seriesIndex: i };\n }\n\n return null;\n }", "title": "" }, { "docid": "0bb7b35323bdcfde48ec5cd6418ea737", "score": "0.5228799", "text": "function findNearbyItem(mouseX, mouseY, seriesFilter) {\n var maxDistance = options.grid.mouseActiveRadius,\n smallestDistance = maxDistance * maxDistance + 1,\n item = null, foundPoint = false, i, j, ps;\n\n for (i = series.length - 1; i >= 0; --i) {\n if (!seriesFilter(series[i]))\n continue;\n\n var s = series[i],\n axisx = s.xaxis,\n axisy = s.yaxis,\n points = s.datapoints.points,\n mx = axisx.c2p(mouseX), // precompute some stuff to make the loop faster\n my = axisy.c2p(mouseY),\n maxx = maxDistance / axisx.scale,\n maxy = maxDistance / axisy.scale;\n\n ps = s.datapoints.pointsize;\n // with inverse transforms, we can't use the maxx/maxy\n // optimization, sadly\n if (axisx.options.inverseTransform)\n maxx = Number.MAX_VALUE;\n if (axisy.options.inverseTransform)\n maxy = Number.MAX_VALUE;\n\n if (s.lines.show || s.points.show) {\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1];\n if (x == null)\n continue;\n\n // For points and lines, the cursor must be within a\n // certain distance to the data point\n if (x - mx > maxx || x - mx < -maxx ||\n y - my > maxy || y - my < -maxy)\n continue;\n\n // We have to calculate distances in pixels, not in\n // data units, because the scales of the axes may be different\n var dx = Math.abs(axisx.p2c(x) - mouseX),\n dy = Math.abs(axisy.p2c(y) - mouseY),\n dist = dx * dx + dy * dy; // we save the sqrt\n\n // use <= to ensure last point takes precedence\n // (last generally means on top of)\n if (dist < smallestDistance) {\n smallestDistance = dist;\n item = [i, j / ps];\n }\n }\n }\n\n if (s.bars.show && !item) { // no other point can be nearby\n var barLeft = s.bars.align == \"left\" ? 0 : -s.bars.barWidth/2,\n barRight = barLeft + s.bars.barWidth;\n\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1], b = points[j + 2];\n if (x == null)\n continue;\n\n // for a bar graph, the cursor must be inside the bar\n if (series[i].bars.horizontal ?\n (mx <= Math.max(b, x) && mx >= Math.min(b, x) &&\n my >= y + barLeft && my <= y + barRight) :\n (mx >= x + barLeft && mx <= x + barRight &&\n my >= Math.min(b, y) && my <= Math.max(b, y)))\n item = [i, j / ps];\n }\n }\n }\n\n if (item) {\n i = item[0];\n j = item[1];\n ps = series[i].datapoints.pointsize;\n\n return { datapoint: series[i].datapoints.points.slice(j * ps, (j + 1) * ps),\n dataIndex: j,\n series: series[i],\n seriesIndex: i };\n }\n\n return null;\n }", "title": "" }, { "docid": "0bb7b35323bdcfde48ec5cd6418ea737", "score": "0.5228799", "text": "function findNearbyItem(mouseX, mouseY, seriesFilter) {\n var maxDistance = options.grid.mouseActiveRadius,\n smallestDistance = maxDistance * maxDistance + 1,\n item = null, foundPoint = false, i, j, ps;\n\n for (i = series.length - 1; i >= 0; --i) {\n if (!seriesFilter(series[i]))\n continue;\n\n var s = series[i],\n axisx = s.xaxis,\n axisy = s.yaxis,\n points = s.datapoints.points,\n mx = axisx.c2p(mouseX), // precompute some stuff to make the loop faster\n my = axisy.c2p(mouseY),\n maxx = maxDistance / axisx.scale,\n maxy = maxDistance / axisy.scale;\n\n ps = s.datapoints.pointsize;\n // with inverse transforms, we can't use the maxx/maxy\n // optimization, sadly\n if (axisx.options.inverseTransform)\n maxx = Number.MAX_VALUE;\n if (axisy.options.inverseTransform)\n maxy = Number.MAX_VALUE;\n\n if (s.lines.show || s.points.show) {\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1];\n if (x == null)\n continue;\n\n // For points and lines, the cursor must be within a\n // certain distance to the data point\n if (x - mx > maxx || x - mx < -maxx ||\n y - my > maxy || y - my < -maxy)\n continue;\n\n // We have to calculate distances in pixels, not in\n // data units, because the scales of the axes may be different\n var dx = Math.abs(axisx.p2c(x) - mouseX),\n dy = Math.abs(axisy.p2c(y) - mouseY),\n dist = dx * dx + dy * dy; // we save the sqrt\n\n // use <= to ensure last point takes precedence\n // (last generally means on top of)\n if (dist < smallestDistance) {\n smallestDistance = dist;\n item = [i, j / ps];\n }\n }\n }\n\n if (s.bars.show && !item) { // no other point can be nearby\n var barLeft = s.bars.align == \"left\" ? 0 : -s.bars.barWidth/2,\n barRight = barLeft + s.bars.barWidth;\n\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1], b = points[j + 2];\n if (x == null)\n continue;\n\n // for a bar graph, the cursor must be inside the bar\n if (series[i].bars.horizontal ?\n (mx <= Math.max(b, x) && mx >= Math.min(b, x) &&\n my >= y + barLeft && my <= y + barRight) :\n (mx >= x + barLeft && mx <= x + barRight &&\n my >= Math.min(b, y) && my <= Math.max(b, y)))\n item = [i, j / ps];\n }\n }\n }\n\n if (item) {\n i = item[0];\n j = item[1];\n ps = series[i].datapoints.pointsize;\n\n return { datapoint: series[i].datapoints.points.slice(j * ps, (j + 1) * ps),\n dataIndex: j,\n series: series[i],\n seriesIndex: i };\n }\n\n return null;\n }", "title": "" }, { "docid": "6d7ce01cc27d76e6a97193fc1f927a7d", "score": "0.5228799", "text": "function findNearbyItem(mouseX, mouseY, seriesFilter) {\n var maxDistance = options.grid.mouseActiveRadius,\n smallestDistance = maxDistance * maxDistance + 1,\n item = null, foundPoint = false, i, j, ps;\n\n for (i = series.length - 1; i >= 0; --i) {\n if (!seriesFilter(series[i]))\n continue;\n\n var s = series[i],\n axisx = s.xaxis,\n axisy = s.yaxis,\n points = s.datapoints.points,\n mx = axisx.c2p(mouseX), // precompute some stuff to make the loop faster\n my = axisy.c2p(mouseY),\n maxx = maxDistance / axisx.scale,\n maxy = maxDistance / axisy.scale;\n\n ps = s.datapoints.pointsize;\n // with inverse transforms, we can't use the maxx/maxy\n // optimization, sadly\n if (axisx.options.inverseTransform)\n maxx = Number.MAX_VALUE;\n if (axisy.options.inverseTransform)\n maxy = Number.MAX_VALUE;\n\n if (s.lines.show || s.points.show) {\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1];\n if (x == null)\n continue;\n\n // For points and lines, the cursor must be within a\n // certain distance to the data point\n if (x - mx > maxx || x - mx < -maxx ||\n y - my > maxy || y - my < -maxy)\n continue;\n\n // We have to calculate distances in pixels, not in\n // data units, because the scales of the axes may be different\n var dx = Math.abs(axisx.p2c(x) - mouseX),\n dy = Math.abs(axisy.p2c(y) - mouseY),\n dist = dx * dx + dy * dy; // we save the sqrt\n\n // use <= to ensure last point takes precedence\n // (last generally means on top of)\n if (dist < smallestDistance) {\n smallestDistance = dist;\n item = [i, j / ps];\n }\n }\n }\n\n if (s.bars.show && !item) { // no other point can be nearby\n\n var barLeft, barRight;\n\n switch (s.bars.align) {\n case \"left\":\n barLeft = 0;\n break;\n case \"right\":\n barLeft = -s.bars.barWidth;\n break;\n default:\n barLeft = -s.bars.barWidth / 2;\n }\n\n barRight = barLeft + s.bars.barWidth;\n\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1], b = points[j + 2];\n if (x == null)\n continue;\n\n // for a bar graph, the cursor must be inside the bar\n if (series[i].bars.horizontal ?\n (mx <= Math.max(b, x) && mx >= Math.min(b, x) &&\n my >= y + barLeft && my <= y + barRight) :\n (mx >= x + barLeft && mx <= x + barRight &&\n my >= Math.min(b, y) && my <= Math.max(b, y)))\n item = [i, j / ps];\n }\n }\n }\n\n if (item) {\n i = item[0];\n j = item[1];\n ps = series[i].datapoints.pointsize;\n\n return { datapoint: series[i].datapoints.points.slice(j * ps, (j + 1) * ps),\n dataIndex: j,\n series: series[i],\n seriesIndex: i };\n }\n\n return null;\n }", "title": "" }, { "docid": "6d7ce01cc27d76e6a97193fc1f927a7d", "score": "0.5228799", "text": "function findNearbyItem(mouseX, mouseY, seriesFilter) {\n var maxDistance = options.grid.mouseActiveRadius,\n smallestDistance = maxDistance * maxDistance + 1,\n item = null, foundPoint = false, i, j, ps;\n\n for (i = series.length - 1; i >= 0; --i) {\n if (!seriesFilter(series[i]))\n continue;\n\n var s = series[i],\n axisx = s.xaxis,\n axisy = s.yaxis,\n points = s.datapoints.points,\n mx = axisx.c2p(mouseX), // precompute some stuff to make the loop faster\n my = axisy.c2p(mouseY),\n maxx = maxDistance / axisx.scale,\n maxy = maxDistance / axisy.scale;\n\n ps = s.datapoints.pointsize;\n // with inverse transforms, we can't use the maxx/maxy\n // optimization, sadly\n if (axisx.options.inverseTransform)\n maxx = Number.MAX_VALUE;\n if (axisy.options.inverseTransform)\n maxy = Number.MAX_VALUE;\n\n if (s.lines.show || s.points.show) {\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1];\n if (x == null)\n continue;\n\n // For points and lines, the cursor must be within a\n // certain distance to the data point\n if (x - mx > maxx || x - mx < -maxx ||\n y - my > maxy || y - my < -maxy)\n continue;\n\n // We have to calculate distances in pixels, not in\n // data units, because the scales of the axes may be different\n var dx = Math.abs(axisx.p2c(x) - mouseX),\n dy = Math.abs(axisy.p2c(y) - mouseY),\n dist = dx * dx + dy * dy; // we save the sqrt\n\n // use <= to ensure last point takes precedence\n // (last generally means on top of)\n if (dist < smallestDistance) {\n smallestDistance = dist;\n item = [i, j / ps];\n }\n }\n }\n\n if (s.bars.show && !item) { // no other point can be nearby\n\n var barLeft, barRight;\n\n switch (s.bars.align) {\n case \"left\":\n barLeft = 0;\n break;\n case \"right\":\n barLeft = -s.bars.barWidth;\n break;\n default:\n barLeft = -s.bars.barWidth / 2;\n }\n\n barRight = barLeft + s.bars.barWidth;\n\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1], b = points[j + 2];\n if (x == null)\n continue;\n\n // for a bar graph, the cursor must be inside the bar\n if (series[i].bars.horizontal ?\n (mx <= Math.max(b, x) && mx >= Math.min(b, x) &&\n my >= y + barLeft && my <= y + barRight) :\n (mx >= x + barLeft && mx <= x + barRight &&\n my >= Math.min(b, y) && my <= Math.max(b, y)))\n item = [i, j / ps];\n }\n }\n }\n\n if (item) {\n i = item[0];\n j = item[1];\n ps = series[i].datapoints.pointsize;\n\n return { datapoint: series[i].datapoints.points.slice(j * ps, (j + 1) * ps),\n dataIndex: j,\n series: series[i],\n seriesIndex: i };\n }\n\n return null;\n }", "title": "" }, { "docid": "6d7ce01cc27d76e6a97193fc1f927a7d", "score": "0.5228799", "text": "function findNearbyItem(mouseX, mouseY, seriesFilter) {\n var maxDistance = options.grid.mouseActiveRadius,\n smallestDistance = maxDistance * maxDistance + 1,\n item = null, foundPoint = false, i, j, ps;\n\n for (i = series.length - 1; i >= 0; --i) {\n if (!seriesFilter(series[i]))\n continue;\n\n var s = series[i],\n axisx = s.xaxis,\n axisy = s.yaxis,\n points = s.datapoints.points,\n mx = axisx.c2p(mouseX), // precompute some stuff to make the loop faster\n my = axisy.c2p(mouseY),\n maxx = maxDistance / axisx.scale,\n maxy = maxDistance / axisy.scale;\n\n ps = s.datapoints.pointsize;\n // with inverse transforms, we can't use the maxx/maxy\n // optimization, sadly\n if (axisx.options.inverseTransform)\n maxx = Number.MAX_VALUE;\n if (axisy.options.inverseTransform)\n maxy = Number.MAX_VALUE;\n\n if (s.lines.show || s.points.show) {\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1];\n if (x == null)\n continue;\n\n // For points and lines, the cursor must be within a\n // certain distance to the data point\n if (x - mx > maxx || x - mx < -maxx ||\n y - my > maxy || y - my < -maxy)\n continue;\n\n // We have to calculate distances in pixels, not in\n // data units, because the scales of the axes may be different\n var dx = Math.abs(axisx.p2c(x) - mouseX),\n dy = Math.abs(axisy.p2c(y) - mouseY),\n dist = dx * dx + dy * dy; // we save the sqrt\n\n // use <= to ensure last point takes precedence\n // (last generally means on top of)\n if (dist < smallestDistance) {\n smallestDistance = dist;\n item = [i, j / ps];\n }\n }\n }\n\n if (s.bars.show && !item) { // no other point can be nearby\n\n var barLeft, barRight;\n\n switch (s.bars.align) {\n case \"left\":\n barLeft = 0;\n break;\n case \"right\":\n barLeft = -s.bars.barWidth;\n break;\n default:\n barLeft = -s.bars.barWidth / 2;\n }\n\n barRight = barLeft + s.bars.barWidth;\n\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1], b = points[j + 2];\n if (x == null)\n continue;\n\n // for a bar graph, the cursor must be inside the bar\n if (series[i].bars.horizontal ?\n (mx <= Math.max(b, x) && mx >= Math.min(b, x) &&\n my >= y + barLeft && my <= y + barRight) :\n (mx >= x + barLeft && mx <= x + barRight &&\n my >= Math.min(b, y) && my <= Math.max(b, y)))\n item = [i, j / ps];\n }\n }\n }\n\n if (item) {\n i = item[0];\n j = item[1];\n ps = series[i].datapoints.pointsize;\n\n return { datapoint: series[i].datapoints.points.slice(j * ps, (j + 1) * ps),\n dataIndex: j,\n series: series[i],\n seriesIndex: i };\n }\n\n return null;\n }", "title": "" }, { "docid": "0bb7b35323bdcfde48ec5cd6418ea737", "score": "0.5228799", "text": "function findNearbyItem(mouseX, mouseY, seriesFilter) {\n var maxDistance = options.grid.mouseActiveRadius,\n smallestDistance = maxDistance * maxDistance + 1,\n item = null, foundPoint = false, i, j, ps;\n\n for (i = series.length - 1; i >= 0; --i) {\n if (!seriesFilter(series[i]))\n continue;\n\n var s = series[i],\n axisx = s.xaxis,\n axisy = s.yaxis,\n points = s.datapoints.points,\n mx = axisx.c2p(mouseX), // precompute some stuff to make the loop faster\n my = axisy.c2p(mouseY),\n maxx = maxDistance / axisx.scale,\n maxy = maxDistance / axisy.scale;\n\n ps = s.datapoints.pointsize;\n // with inverse transforms, we can't use the maxx/maxy\n // optimization, sadly\n if (axisx.options.inverseTransform)\n maxx = Number.MAX_VALUE;\n if (axisy.options.inverseTransform)\n maxy = Number.MAX_VALUE;\n\n if (s.lines.show || s.points.show) {\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1];\n if (x == null)\n continue;\n\n // For points and lines, the cursor must be within a\n // certain distance to the data point\n if (x - mx > maxx || x - mx < -maxx ||\n y - my > maxy || y - my < -maxy)\n continue;\n\n // We have to calculate distances in pixels, not in\n // data units, because the scales of the axes may be different\n var dx = Math.abs(axisx.p2c(x) - mouseX),\n dy = Math.abs(axisy.p2c(y) - mouseY),\n dist = dx * dx + dy * dy; // we save the sqrt\n\n // use <= to ensure last point takes precedence\n // (last generally means on top of)\n if (dist < smallestDistance) {\n smallestDistance = dist;\n item = [i, j / ps];\n }\n }\n }\n\n if (s.bars.show && !item) { // no other point can be nearby\n var barLeft = s.bars.align == \"left\" ? 0 : -s.bars.barWidth/2,\n barRight = barLeft + s.bars.barWidth;\n\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1], b = points[j + 2];\n if (x == null)\n continue;\n\n // for a bar graph, the cursor must be inside the bar\n if (series[i].bars.horizontal ?\n (mx <= Math.max(b, x) && mx >= Math.min(b, x) &&\n my >= y + barLeft && my <= y + barRight) :\n (mx >= x + barLeft && mx <= x + barRight &&\n my >= Math.min(b, y) && my <= Math.max(b, y)))\n item = [i, j / ps];\n }\n }\n }\n\n if (item) {\n i = item[0];\n j = item[1];\n ps = series[i].datapoints.pointsize;\n\n return { datapoint: series[i].datapoints.points.slice(j * ps, (j + 1) * ps),\n dataIndex: j,\n series: series[i],\n seriesIndex: i };\n }\n\n return null;\n }", "title": "" }, { "docid": "6d7ce01cc27d76e6a97193fc1f927a7d", "score": "0.5228799", "text": "function findNearbyItem(mouseX, mouseY, seriesFilter) {\n var maxDistance = options.grid.mouseActiveRadius,\n smallestDistance = maxDistance * maxDistance + 1,\n item = null, foundPoint = false, i, j, ps;\n\n for (i = series.length - 1; i >= 0; --i) {\n if (!seriesFilter(series[i]))\n continue;\n\n var s = series[i],\n axisx = s.xaxis,\n axisy = s.yaxis,\n points = s.datapoints.points,\n mx = axisx.c2p(mouseX), // precompute some stuff to make the loop faster\n my = axisy.c2p(mouseY),\n maxx = maxDistance / axisx.scale,\n maxy = maxDistance / axisy.scale;\n\n ps = s.datapoints.pointsize;\n // with inverse transforms, we can't use the maxx/maxy\n // optimization, sadly\n if (axisx.options.inverseTransform)\n maxx = Number.MAX_VALUE;\n if (axisy.options.inverseTransform)\n maxy = Number.MAX_VALUE;\n\n if (s.lines.show || s.points.show) {\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1];\n if (x == null)\n continue;\n\n // For points and lines, the cursor must be within a\n // certain distance to the data point\n if (x - mx > maxx || x - mx < -maxx ||\n y - my > maxy || y - my < -maxy)\n continue;\n\n // We have to calculate distances in pixels, not in\n // data units, because the scales of the axes may be different\n var dx = Math.abs(axisx.p2c(x) - mouseX),\n dy = Math.abs(axisy.p2c(y) - mouseY),\n dist = dx * dx + dy * dy; // we save the sqrt\n\n // use <= to ensure last point takes precedence\n // (last generally means on top of)\n if (dist < smallestDistance) {\n smallestDistance = dist;\n item = [i, j / ps];\n }\n }\n }\n\n if (s.bars.show && !item) { // no other point can be nearby\n\n var barLeft, barRight;\n\n switch (s.bars.align) {\n case \"left\":\n barLeft = 0;\n break;\n case \"right\":\n barLeft = -s.bars.barWidth;\n break;\n default:\n barLeft = -s.bars.barWidth / 2;\n }\n\n barRight = barLeft + s.bars.barWidth;\n\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1], b = points[j + 2];\n if (x == null)\n continue;\n\n // for a bar graph, the cursor must be inside the bar\n if (series[i].bars.horizontal ?\n (mx <= Math.max(b, x) && mx >= Math.min(b, x) &&\n my >= y + barLeft && my <= y + barRight) :\n (mx >= x + barLeft && mx <= x + barRight &&\n my >= Math.min(b, y) && my <= Math.max(b, y)))\n item = [i, j / ps];\n }\n }\n }\n\n if (item) {\n i = item[0];\n j = item[1];\n ps = series[i].datapoints.pointsize;\n\n return { datapoint: series[i].datapoints.points.slice(j * ps, (j + 1) * ps),\n dataIndex: j,\n series: series[i],\n seriesIndex: i };\n }\n\n return null;\n }", "title": "" }, { "docid": "6d7ce01cc27d76e6a97193fc1f927a7d", "score": "0.5228799", "text": "function findNearbyItem(mouseX, mouseY, seriesFilter) {\n var maxDistance = options.grid.mouseActiveRadius,\n smallestDistance = maxDistance * maxDistance + 1,\n item = null, foundPoint = false, i, j, ps;\n\n for (i = series.length - 1; i >= 0; --i) {\n if (!seriesFilter(series[i]))\n continue;\n\n var s = series[i],\n axisx = s.xaxis,\n axisy = s.yaxis,\n points = s.datapoints.points,\n mx = axisx.c2p(mouseX), // precompute some stuff to make the loop faster\n my = axisy.c2p(mouseY),\n maxx = maxDistance / axisx.scale,\n maxy = maxDistance / axisy.scale;\n\n ps = s.datapoints.pointsize;\n // with inverse transforms, we can't use the maxx/maxy\n // optimization, sadly\n if (axisx.options.inverseTransform)\n maxx = Number.MAX_VALUE;\n if (axisy.options.inverseTransform)\n maxy = Number.MAX_VALUE;\n\n if (s.lines.show || s.points.show) {\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1];\n if (x == null)\n continue;\n\n // For points and lines, the cursor must be within a\n // certain distance to the data point\n if (x - mx > maxx || x - mx < -maxx ||\n y - my > maxy || y - my < -maxy)\n continue;\n\n // We have to calculate distances in pixels, not in\n // data units, because the scales of the axes may be different\n var dx = Math.abs(axisx.p2c(x) - mouseX),\n dy = Math.abs(axisy.p2c(y) - mouseY),\n dist = dx * dx + dy * dy; // we save the sqrt\n\n // use <= to ensure last point takes precedence\n // (last generally means on top of)\n if (dist < smallestDistance) {\n smallestDistance = dist;\n item = [i, j / ps];\n }\n }\n }\n\n if (s.bars.show && !item) { // no other point can be nearby\n\n var barLeft, barRight;\n\n switch (s.bars.align) {\n case \"left\":\n barLeft = 0;\n break;\n case \"right\":\n barLeft = -s.bars.barWidth;\n break;\n default:\n barLeft = -s.bars.barWidth / 2;\n }\n\n barRight = barLeft + s.bars.barWidth;\n\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1], b = points[j + 2];\n if (x == null)\n continue;\n\n // for a bar graph, the cursor must be inside the bar\n if (series[i].bars.horizontal ?\n (mx <= Math.max(b, x) && mx >= Math.min(b, x) &&\n my >= y + barLeft && my <= y + barRight) :\n (mx >= x + barLeft && mx <= x + barRight &&\n my >= Math.min(b, y) && my <= Math.max(b, y)))\n item = [i, j / ps];\n }\n }\n }\n\n if (item) {\n i = item[0];\n j = item[1];\n ps = series[i].datapoints.pointsize;\n\n return { datapoint: series[i].datapoints.points.slice(j * ps, (j + 1) * ps),\n dataIndex: j,\n series: series[i],\n seriesIndex: i };\n }\n\n return null;\n }", "title": "" }, { "docid": "6398c6da09b686d7747eee5619dc1ccd", "score": "0.5217164", "text": "function findNearbyItem(mouseX, mouseY, seriesFilter) {\n var maxDistance = options.grid.mouseActiveRadius,\n smallestDistance = maxDistance * maxDistance + 1,\n item = null,\n foundPoint = false,\n i,\n j,\n ps;\n\n for (i = series.length - 1; i >= 0; --i) {\n if (!seriesFilter(series[i])) continue;\n var s = series[i],\n axisx = s.xaxis,\n axisy = s.yaxis,\n points = s.datapoints.points,\n mx = axisx.c2p(mouseX),\n // precompute some stuff to make the loop faster\n my = axisy.c2p(mouseY),\n maxx = maxDistance / axisx.scale,\n maxy = maxDistance / axisy.scale;\n ps = s.datapoints.pointsize; // with inverse transforms, we can't use the maxx/maxy\n // optimization, sadly\n\n if (axisx.options.inverseTransform) maxx = Number.MAX_VALUE;\n if (axisy.options.inverseTransform) maxy = Number.MAX_VALUE;\n\n if (s.lines.show || s.points.show) {\n for (j = 0; j < points.length; j += ps) {\n var x = points[j],\n y = points[j + 1];\n if (x == null) continue; // For points and lines, the cursor must be within a\n // certain distance to the data point\n\n if (x - mx > maxx || x - mx < -maxx || y - my > maxy || y - my < -maxy) continue; // We have to calculate distances in pixels, not in\n // data units, because the scales of the axes may be different\n\n var dx = Math.abs(axisx.p2c(x) - mouseX),\n dy = Math.abs(axisy.p2c(y) - mouseY),\n dist = dx * dx + dy * dy; // we save the sqrt\n // use <= to ensure last point takes precedence\n // (last generally means on top of)\n\n if (dist < smallestDistance) {\n smallestDistance = dist;\n item = [i, j / ps];\n }\n }\n }\n\n if (s.bars.show && !item) {\n // no other point can be nearby\n var barLeft, barRight;\n\n switch (s.bars.align) {\n case \"left\":\n barLeft = 0;\n break;\n\n case \"right\":\n barLeft = -s.bars.barWidth;\n break;\n\n default:\n barLeft = -s.bars.barWidth / 2;\n }\n\n barRight = barLeft + s.bars.barWidth;\n\n for (j = 0; j < points.length; j += ps) {\n var x = points[j],\n y = points[j + 1],\n b = points[j + 2];\n if (x == null) continue; // for a bar graph, the cursor must be inside the bar\n\n if (series[i].bars.horizontal ? mx <= Math.max(b, x) && mx >= Math.min(b, x) && my >= y + barLeft && my <= y + barRight : mx >= x + barLeft && mx <= x + barRight && my >= Math.min(b, y) && my <= Math.max(b, y)) item = [i, j / ps];\n }\n }\n }\n\n if (item) {\n i = item[0];\n j = item[1];\n ps = series[i].datapoints.pointsize;\n return {\n datapoint: series[i].datapoints.points.slice(j * ps, (j + 1) * ps),\n dataIndex: j,\n series: series[i],\n seriesIndex: i\n };\n }\n\n return null;\n }", "title": "" }, { "docid": "9599716268de3a8b9c050418d7ec3383", "score": "0.51894736", "text": "getBest() {\n let maxScore = -1;\n let index;\n for (let i in this.population) {\n if (this.population[i].fitness > maxScore) {\n index = i;\n maxScore = this.population[i].fitness;\n }\n }\n\n return index;\n }", "title": "" }, { "docid": "e4aede08a35845a4c34851159bdd6506", "score": "0.5182454", "text": "function findNearbyItem(mouseX, mouseY, seriesFilter) {\n var maxDistance = options.grid.mouseActiveRadius,\n smallestDistance = maxDistance * maxDistance + 1,\n item = null, foundPoint = false, i, j;\n\n for (i = series.length - 1; i >= 0; --i) {\n if (!seriesFilter(series[i]))\n continue;\n \n var s = series[i],\n axisx = s.xaxis,\n axisy = s.yaxis,\n points = s.datapoints.points,\n ps = s.datapoints.pointsize,\n mx = axisx.c2p(mouseX), // precompute some stuff to make the loop faster\n my = axisy.c2p(mouseY),\n maxx = maxDistance / axisx.scale,\n maxy = maxDistance / axisy.scale;\n\n // with inverse transforms, we can't use the maxx/maxy\n // optimization, sadly\n if (axisx.options.inverseTransform)\n maxx = Number.MAX_VALUE;\n if (axisy.options.inverseTransform)\n maxy = Number.MAX_VALUE;\n \n if (s.lines.show || s.points.show) {\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1];\n if (x == null)\n continue;\n \n // For points and lines, the cursor must be within a\n // certain distance to the data point\n if (x - mx > maxx || x - mx < -maxx ||\n y - my > maxy || y - my < -maxy)\n continue;\n\n // We have to calculate distances in pixels, not in\n // data units, because the scales of the axes may be different\n var dx = Math.abs(axisx.p2c(x) - mouseX),\n dy = Math.abs(axisy.p2c(y) - mouseY),\n dist = dx * dx + dy * dy; // we save the sqrt\n\n // use <= to ensure last point takes precedence\n // (last generally means on top of)\n if (dist < smallestDistance) {\n smallestDistance = dist;\n item = [i, j / ps];\n }\n }\n }\n \n if (s.bars.show && !item) { // no other point can be nearby\n var barLeft = s.bars.align == \"left\" ? 0 : -s.bars.barWidth/2,\n barRight = barLeft + s.bars.barWidth;\n \n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1], b = points[j + 2];\n if (x == null)\n continue;\n \n // for a bar graph, the cursor must be inside the bar\n if (series[i].bars.horizontal ? \n (mx <= Math.max(b, x) && mx >= Math.min(b, x) && \n my >= y + barLeft && my <= y + barRight) :\n (mx >= x + barLeft && mx <= x + barRight &&\n my >= Math.min(b, y) && my <= Math.max(b, y)))\n item = [i, j / ps];\n }\n }\n }\n\n if (item) {\n i = item[0];\n j = item[1];\n ps = series[i].datapoints.pointsize;\n \n return { datapoint: series[i].datapoints.points.slice(j * ps, (j + 1) * ps),\n dataIndex: j,\n series: series[i],\n seriesIndex: i };\n }\n \n return null;\n }", "title": "" }, { "docid": "e4aede08a35845a4c34851159bdd6506", "score": "0.5182454", "text": "function findNearbyItem(mouseX, mouseY, seriesFilter) {\n var maxDistance = options.grid.mouseActiveRadius,\n smallestDistance = maxDistance * maxDistance + 1,\n item = null, foundPoint = false, i, j;\n\n for (i = series.length - 1; i >= 0; --i) {\n if (!seriesFilter(series[i]))\n continue;\n \n var s = series[i],\n axisx = s.xaxis,\n axisy = s.yaxis,\n points = s.datapoints.points,\n ps = s.datapoints.pointsize,\n mx = axisx.c2p(mouseX), // precompute some stuff to make the loop faster\n my = axisy.c2p(mouseY),\n maxx = maxDistance / axisx.scale,\n maxy = maxDistance / axisy.scale;\n\n // with inverse transforms, we can't use the maxx/maxy\n // optimization, sadly\n if (axisx.options.inverseTransform)\n maxx = Number.MAX_VALUE;\n if (axisy.options.inverseTransform)\n maxy = Number.MAX_VALUE;\n \n if (s.lines.show || s.points.show) {\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1];\n if (x == null)\n continue;\n \n // For points and lines, the cursor must be within a\n // certain distance to the data point\n if (x - mx > maxx || x - mx < -maxx ||\n y - my > maxy || y - my < -maxy)\n continue;\n\n // We have to calculate distances in pixels, not in\n // data units, because the scales of the axes may be different\n var dx = Math.abs(axisx.p2c(x) - mouseX),\n dy = Math.abs(axisy.p2c(y) - mouseY),\n dist = dx * dx + dy * dy; // we save the sqrt\n\n // use <= to ensure last point takes precedence\n // (last generally means on top of)\n if (dist < smallestDistance) {\n smallestDistance = dist;\n item = [i, j / ps];\n }\n }\n }\n \n if (s.bars.show && !item) { // no other point can be nearby\n var barLeft = s.bars.align == \"left\" ? 0 : -s.bars.barWidth/2,\n barRight = barLeft + s.bars.barWidth;\n \n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1], b = points[j + 2];\n if (x == null)\n continue;\n \n // for a bar graph, the cursor must be inside the bar\n if (series[i].bars.horizontal ? \n (mx <= Math.max(b, x) && mx >= Math.min(b, x) && \n my >= y + barLeft && my <= y + barRight) :\n (mx >= x + barLeft && mx <= x + barRight &&\n my >= Math.min(b, y) && my <= Math.max(b, y)))\n item = [i, j / ps];\n }\n }\n }\n\n if (item) {\n i = item[0];\n j = item[1];\n ps = series[i].datapoints.pointsize;\n \n return { datapoint: series[i].datapoints.points.slice(j * ps, (j + 1) * ps),\n dataIndex: j,\n series: series[i],\n seriesIndex: i };\n }\n \n return null;\n }", "title": "" }, { "docid": "2ba9649102d434d3669bbb7c581b5455", "score": "0.5181046", "text": "getItemIndex(world) {\n let iv = this.i.e8(toPoint(world));\n return (iv);\n }", "title": "" }, { "docid": "4f817387ee042208695fa0ba2165ef57", "score": "0.51695794", "text": "function getFreeLocation(x,y){\n\tvar heightOfGameFrame = Number($(\"#gameFrame\").height());\n\tvar widthOfGameFrame = Number($(\"#gameFrame\").width());\n\tif(x==0 && y==0)\n\t\tconsole.log(\"H/W==\"+heightOfGameFrame.toString()+widthOfGameFrame.toString());\n\tvar leftStart = (widthOfGameFrame - MATRIX_SIZE*TILE_SIZE - (MATRIX_SIZE-1)*TILE_SPACING)/2;\n\tvar leftCoord = leftStart + y*(TILE_SIZE+TILE_SPACING);\n\tvar topStart = (heightOfGameFrame - MATRIX_SIZE*TILE_SIZE - (MATRIX_SIZE-1)*TILE_SPACING)/2;\n\tvar topCoord = topStart + x*(TILE_SIZE+TILE_SPACING);\n\tvar coord = new Coordinates(x,y,leftCoord,topCoord);\n\treturn coord;\n}", "title": "" }, { "docid": "1da001551eddd5992a5c3d4d5880a5e7", "score": "0.51583815", "text": "function getBoxFromMouseLocation() {\n\tfor(box in boxes) {if(boxes[box].sprite.position.x <= mouseX) {\n\t\t\tif(boxes[box].sprite.position.x + boxes[box].sprite.width > mouseX) {\n\t\t\t\tif(boxes[box].sprite.position.y <= mouseY) {\n\t\t\t\t\tif(boxes[box].sprite.position.y + boxes[box].sprite.height > mouseY) {\n\t\t\t\t\t\treturn boxes[box];\n\t\t\t\t\t}\n\t\t\t\t}\t\t\n\t\t\t}\n\t\t}\n\t}\n\treturn null;\n}", "title": "" }, { "docid": "cfcf01bb25557b8966c078a8062ab8a3", "score": "0.51578", "text": "function itemLocY() {\n var number = Math.floor(Math.random() * 6) + 1;\n if (number === 1) {\n return -25;\n } else if (number === 2) {\n return 58;\n } else if (number === 3) {\n return 141;\n } else if (number === 4) {\n return 224;\n } else if (number === 5) {\n return 307;\n } else {\n return 390;\n }\n}", "title": "" }, { "docid": "66eb9b94531322f15c9a25dadb0d3d46", "score": "0.5153899", "text": "function findNearbyItem(mouseX, mouseY, seriesFilter) {\r\n var maxDistance = options.grid.mouseActiveRadius,\r\n smallestDistance = maxDistance * maxDistance + 1,\r\n item = null, foundPoint = false, i, j;\r\n\r\n for (i = series.length - 1; i >= 0; --i) {\r\n if (!seriesFilter(series[i]))\r\n continue;\r\n \r\n var s = series[i],\r\n axisx = s.xaxis,\r\n axisy = s.yaxis,\r\n points = s.datapoints.points,\r\n ps = s.datapoints.pointsize,\r\n mx = axisx.c2p(mouseX), // precompute some stuff to make the loop faster\r\n my = axisy.c2p(mouseY),\r\n maxx = maxDistance / axisx.scale,\r\n maxy = maxDistance / axisy.scale;\r\n\r\n // with inverse transforms, we can't use the maxx/maxy\r\n // optimization, sadly\r\n if (axisx.options.inverseTransform)\r\n maxx = Number.MAX_VALUE;\r\n if (axisy.options.inverseTransform)\r\n maxy = Number.MAX_VALUE;\r\n \r\n if (s.lines.show || s.points.show) {\r\n for (j = 0; j < points.length; j += ps) {\r\n var x = points[j], y = points[j + 1];\r\n if (x == null)\r\n continue;\r\n \r\n // For points and lines, the cursor must be within a\r\n // certain distance to the data point\r\n if (x - mx > maxx || x - mx < -maxx ||\r\n y - my > maxy || y - my < -maxy)\r\n continue;\r\n\r\n // We have to calculate distances in pixels, not in\r\n // data units, because the scales of the axes may be different\r\n var dx = Math.abs(axisx.p2c(x) - mouseX),\r\n dy = Math.abs(axisy.p2c(y) - mouseY),\r\n dist = dx * dx + dy * dy; // we save the sqrt\r\n\r\n // use <= to ensure last point takes precedence\r\n // (last generally means on top of)\r\n if (dist < smallestDistance) {\r\n smallestDistance = dist;\r\n item = [i, j / ps];\r\n }\r\n }\r\n }\r\n \r\n if (s.bars.show && !item) { // no other point can be nearby\r\n var barLeft = s.bars.align == \"left\" ? 0 : -s.bars.barWidth/2,\r\n barRight = barLeft + s.bars.barWidth;\r\n \r\n for (j = 0; j < points.length; j += ps) {\r\n var x = points[j], y = points[j + 1], b = points[j + 2];\r\n if (x == null)\r\n continue;\r\n \r\n // for a bar graph, the cursor must be inside the bar\r\n if (series[i].bars.horizontal ? \r\n (mx <= Math.max(b, x) && mx >= Math.min(b, x) && \r\n my >= y + barLeft && my <= y + barRight) :\r\n (mx >= x + barLeft && mx <= x + barRight &&\r\n my >= Math.min(b, y) && my <= Math.max(b, y)))\r\n item = [i, j / ps];\r\n }\r\n }\r\n }\r\n\r\n if (item) {\r\n i = item[0];\r\n j = item[1];\r\n ps = series[i].datapoints.pointsize;\r\n \r\n return { datapoint: series[i].datapoints.points.slice(j * ps, (j + 1) * ps),\r\n dataIndex: j,\r\n series: series[i],\r\n seriesIndex: i };\r\n }\r\n \r\n return null;\r\n }", "title": "" }, { "docid": "231c9ace2c893c3d9ccdda228678f10d", "score": "0.5146057", "text": "getWorldPositionFromRegionPosition(x, y)\n {\n return {x: x * REGION_WIDTH, y: y * REGION_HEIGHT};\n }", "title": "" }, { "docid": "fd085d222990bf427d9088c89d05f14a", "score": "0.5142603", "text": "get_closest_dwarf() {\n var closest_dwarfs = [];\n var closest_distance = 999;\n this.controller.dwarfs().forEach((dwarf) => {\n var space_info = this.controller.space_info(dwarf.x, dwarf.y);\n if (space_info.nearest_troll.distance < closest_distance) {\n closest_distance = space_info.nearest_troll.distance;\n closest_dwarfs = [dwarf];\n }\n if (closest_distance == space_info.nearest_troll.distance) {\n closest_dwarfs.push(dwarf);\n }\n });\n return closest_dwarfs[0];\n }", "title": "" }, { "docid": "2a63f9c19d753192d71b1557d244240b", "score": "0.5137174", "text": "async function fetchNearbyByCurrentPosition({ coords: { latitude, longitude } }) {\n const stores = await getNearbyGroceryStore(latitude, longitude);\n return await Promise.all(stores.map((store) => {\n return new Promise(async (resolve, reject) => {\n try {\n const { geometry, business_status: businessStatus, mapsUrl, name, place_id: placeId, vicinity } = store;\n const photoId = store.photos ? store.photos[0].photo_reference : null;\n const urlObj = photoId ? await getGroceryPhoto(photoId) : null;\n resolve({ geometry, businessStatus, mapsUrl, name, placeId, vicinity, photoUrl: (urlObj ? urlObj.url : null) });\n }\n catch (error) {\n reject(error);\n }\n });\n }));\n}", "title": "" }, { "docid": "fa32646ade26b2c5ec7805c5dc0c31a8", "score": "0.5119039", "text": "function closestPathTile(loc) {\n var shortest_dist = 10000;\n var shortest_tile_index = 0\n for (var i = 0; i < path.length; i++) {\n if (loc.distanceSquared(path[i].getLocation(startLocation)) < shortest_dist) {\n shortest_dist = loc.distanceSquared(path[i].getLocation(startLocation));\n shortest_tile_index = i;\n }\n }\n console.log(\"Shortest tile to location was tile: \"+shortest_tile_index);\n return shortest_tile_index;\n }", "title": "" }, { "docid": "32cf95b0af0b11d2d89ecb940de5c7e0", "score": "0.511729", "text": "getWorldObject(name) {\n return this.worldObjects.get(name);\n }", "title": "" }, { "docid": "fa2c1886893fd6d56bba56b199803f1d", "score": "0.51064014", "text": "getCurrentItem() {\n\t\t\tlet itemID = currentAdventure.rooms[currentRoom].item_id;\n\t\t\t\n\t\t\tif (!itemID)\n\t\t\t\treturn null;\n\n\t\t\tlet items = currentAdventure.items;\n\t\t\tlet itemObj = {};\n\n\t\t\tfor (let i=0; i < items.length; i++){\n\t\t\t\tif (items[i].id === itemID)\n\t\t\t\t\titemObj = items[i];\n\t\t\t}\n\n\t\t\treturn itemObj;\n\t\t}", "title": "" }, { "docid": "3dd1227d2b9cb58ae2aaaa4852a3872d", "score": "0.5077783", "text": "function findNearby (hook) {\n let q = hook.params.query;\n\n if (!q.near) return;\n\n let miles = q.miles || 10;\n let radiusInMeters = Number(miles) * 1609;\n\n const Model = createModel(hook.app);\n return Model.findById(q.near)\n .then(zip => {\n let lat = zip.lat;\n let lng = zip.lng;\n\n let north = calcDerivedLatitude(lat, radiusInMeters, 0);\n let east = calcDerivedPosition(lat, lng, radiusInMeters, 90);\n let south = calcDerivedLatitude(lat, radiusInMeters, 180);\n let west = calcDerivedPosition(lat, lng, radiusInMeters, 270);\n\n q.lat = {\n $lt: north,\n $gt: south\n };\n q.lng = {\n $lt: east.lng,\n $gt: west.lng\n };\n\n delete q.near;\n delete q.miles;\n });\n}", "title": "" }, { "docid": "03f3ac134bb74a415eda7529a4e596ae", "score": "0.5057028", "text": "_getIndexOfItemNear(selected, prev) {\n // edge case\n if (selected.items.length < 2) return 0;\n\n let prevItem = prev.selected || prev.currentItem;\n let prevOffset = prev.transition('x').targetValue || 0;\n let [itemX] = prevItem.core.getAbsoluteCoords(-prevOffset, 0);\n let prevMiddle = itemX + prevItem.w / 2;\n\n // set the first item to be closest\n let closest = selected.items[0];\n let closestMiddle = closest.core.getAbsoluteCoords(0, 0)[0] + closest.w / 2;\n\n // start at the 2nd item\n for (let i = 1; i < selected.items.length; i++) {\n const item = selected.items[i];\n const middle = item.core.getAbsoluteCoords(0, 0)[0] + item.w / 2;\n\n if (\n Math.abs(middle - prevMiddle) < Math.abs(closestMiddle - prevMiddle)\n ) {\n // current item is the closest\n closest = item;\n closestMiddle = middle;\n } else {\n // previous index is the closest, return it\n return i - 1;\n }\n }\n // last index is the closest\n return selected.items.length - 1;\n }", "title": "" }, { "docid": "47c2b82761cf4860b9a6e21b24e4b51a", "score": "0.505589", "text": "getOverWorldCharacter() {\n for (var ov of this.overWorldCharacter) {\n if (ov.id == this.player.currentCharacter) {\n return ov;\n }\n }\n return null;\n }", "title": "" }, { "docid": "a3c9e3d37ebd4535a6f693563f485791", "score": "0.50462306", "text": "nearest(p) {\n let d = distance(this.node, p);\n let best = this;\n for (let i = 0; i < this.children.length; ++i) {\n let other = this.children[i].nearest(p);\n if (distance(other.node, p) < d) {\n best = other;\n d = distance(other.node, p);\n }\n }\n return best;\n }", "title": "" }, { "docid": "db032a0f7168ff8716f8a09eb1ee6f1a", "score": "0.50414515", "text": "forEachEntity(x, y, cb) {\n cb = cb || function() { return true; };\n for(let e of this.entities) {\n if(e.pos.x === x && e.pos.y === y && cb(e)) {\n return e;\n }\n }\n return null;\n }", "title": "" }, { "docid": "84f9038b9ccc38e64564337b50649028", "score": "0.5032765", "text": "findBestPlaylistMatch(query,allPlaylists) {\n let bestMatch = {uri:'',score:''};\n bestMatch.uri = allPlaylists[0].uri;\n bestMatch.score = getEditDistance(query.toLowerCase(), allPlaylists[0].name.toLowerCase());\n for (let i = 1; i < allPlaylists.length; i++) {\n let score = getEditDistance(query.toLowerCase(),allPlaylists[i].name.toLowerCase());\n if (score < bestMatch.score) {\n bestMatch.score = score;\n bestMatch.uri = allPlaylists[i].uri;\n }\n if(bestMatch.score === 0) break;\n }\n return bestMatch.uri;\n }", "title": "" } ]
53d78a6171125753dbb4fa6f9bb23643
The function whose prototype chain sequence wrappers inherit from.
[ { "docid": "60b30758ec0905a9c7b4f2306c8a97b3", "score": "0.0", "text": "function baseLodash() {\n // No operation performed.\n }", "title": "" } ]
[ { "docid": "f2e3cca60066d0b870b9a7ed23d27c1f", "score": "0.63196474", "text": "function func4() {\n return new.target.prototype;\n}", "title": "" }, { "docid": "2048650359104c60f434c750f1627b73", "score": "0.6050515", "text": "function m(t){return\"function\"===typeof t.prototype.next}", "title": "" }, { "docid": "1a618bf7e4de2e02b92a589805b91a65", "score": "0.59690493", "text": "function base() {}", "title": "" }, { "docid": "21d66bff0f7cf51efe801672a8d9cc06", "score": "0.58722645", "text": "function provideAsCallbackInFunctionChain() {\n function createCallbackFunc(targetFunction, superCallback) {\n let funcCallback\n /* Deal with different function types - redirect construct to particular implementation using specific execution depending of function type. \n Usage: ```function* implementation() {\n let { superCallback } = function.sent\n if (superCallback) instance = callerClass::superCallback(...arguments)\n }```\n */\n if (isGeneratorFunction(targetFunction))\n funcCallback = function() {\n let iterator = this::targetFunction(...arguments)\n let iteratorObject = iterator.next({ superCallback })\n assert(iteratorObject.done, `• Generator implementation function must not yield results, only recieve the superCallback and return a value.`)\n return iteratorObject.value\n }\n else funcCallback = targetFunction // in case a regular function, then the superCallback will not be passed and so the execution chain will break.\n\n return funcCallback\n }\n\n implementationArray.reverse() // start from parent implementations - will result in the following order: [<parent>, ... , <child>] in hierarchy of implementations\n let previousLoopCallback = null\n for (let index = 0; index < implementationArray.length; index++) {\n let currentFunction = implementationArray[index]\n let callback = createCallbackFunc(currentFunction, previousLoopCallback)\n previousLoopCallback = callback\n }\n let result = callerClass::previousLoopCallback(...arguments) // the lowest implementation in delegation hierarchy\n return result\n }", "title": "" }, { "docid": "30f93781ba2e3e695853ad2fce90c4a3", "score": "0.5804303", "text": "getPrototypeOf() {\n return SProto;\n }", "title": "" }, { "docid": "aa348d29fc06e0e70f5911be1dc58b01", "score": "0.58016324", "text": "function primBeget(parent) {\n function F() {}\n F.prototype = parent;\n return new F();\n }", "title": "" }, { "docid": "47d304ac3e2836cb2406c37e2936702b", "score": "0.57314515", "text": "function F () {}", "title": "" }, { "docid": "387f573dcf2303a14af6b5ac6c6f67f5", "score": "0.5718173", "text": "function getFunctionParent() {\n\t return this.findParent(function (path) {\n\t return path.isFunction() || path.isProgram();\n\t });\n\t}", "title": "" }, { "docid": "387f573dcf2303a14af6b5ac6c6f67f5", "score": "0.5718173", "text": "function getFunctionParent() {\n\t return this.findParent(function (path) {\n\t return path.isFunction() || path.isProgram();\n\t });\n\t}", "title": "" }, { "docid": "387f573dcf2303a14af6b5ac6c6f67f5", "score": "0.5718173", "text": "function getFunctionParent() {\n\t return this.findParent(function (path) {\n\t return path.isFunction() || path.isProgram();\n\t });\n\t}", "title": "" }, { "docid": "f2119aea69bd0c2c12aab622a2f19009", "score": "0.5692657", "text": "function o(t,e,n){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,e);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:o(i,e,n)}if(\"value\"in r)return r.value;var a=r.get;return void 0!==a?a.call(n):void 0}", "title": "" }, { "docid": "5799c74a5b77b00aae14e81da0c00348", "score": "0.5678385", "text": "function F() {}", "title": "" }, { "docid": "5799c74a5b77b00aae14e81da0c00348", "score": "0.5678385", "text": "function F() {}", "title": "" }, { "docid": "5799c74a5b77b00aae14e81da0c00348", "score": "0.5678385", "text": "function F() {}", "title": "" }, { "docid": "5799c74a5b77b00aae14e81da0c00348", "score": "0.5678385", "text": "function F() {}", "title": "" }, { "docid": "5799c74a5b77b00aae14e81da0c00348", "score": "0.5678385", "text": "function F() {}", "title": "" }, { "docid": "5799c74a5b77b00aae14e81da0c00348", "score": "0.5678385", "text": "function F() {}", "title": "" }, { "docid": "5799c74a5b77b00aae14e81da0c00348", "score": "0.5678385", "text": "function F() {}", "title": "" }, { "docid": "5799c74a5b77b00aae14e81da0c00348", "score": "0.5678385", "text": "function F() {}", "title": "" }, { "docid": "5799c74a5b77b00aae14e81da0c00348", "score": "0.5678385", "text": "function F() {}", "title": "" }, { "docid": "5799c74a5b77b00aae14e81da0c00348", "score": "0.5678385", "text": "function F() {}", "title": "" }, { "docid": "5799c74a5b77b00aae14e81da0c00348", "score": "0.5678385", "text": "function F() {}", "title": "" }, { "docid": "5799c74a5b77b00aae14e81da0c00348", "score": "0.5678385", "text": "function F() {}", "title": "" }, { "docid": "5799c74a5b77b00aae14e81da0c00348", "score": "0.5678385", "text": "function F() {}", "title": "" }, { "docid": "5799c74a5b77b00aae14e81da0c00348", "score": "0.5678385", "text": "function F() {}", "title": "" }, { "docid": "5799c74a5b77b00aae14e81da0c00348", "score": "0.5678385", "text": "function F() {}", "title": "" }, { "docid": "5799c74a5b77b00aae14e81da0c00348", "score": "0.5678385", "text": "function F() {}", "title": "" }, { "docid": "5799c74a5b77b00aae14e81da0c00348", "score": "0.5678385", "text": "function F() {}", "title": "" }, { "docid": "1ead5569ff4f1a1ec87ac1148f3a98c5", "score": "0.56670094", "text": "function a(t,e){i(t,e),Object.getOwnPropertyNames(e.prototype).forEach((function(n){i(t.prototype,e.prototype,n)})),Object.getOwnPropertyNames(e).forEach((function(n){i(t,e,n)}))}", "title": "" }, { "docid": "231c8231ae3dd99ed2f12e9800d53ba6", "score": "0.56635344", "text": "function getFunctionParent() {\n\t\t return this.findParent(function (path) {\n\t\t return path.isFunction() || path.isProgram();\n\t\t });\n\t\t}", "title": "" }, { "docid": "b6754008448bfc56195d2b569834e0b3", "score": "0.5634797", "text": "function get_prototype_chain( constructor ) {\n\t\t\t\t\tconst chain = [];\n\t\t\t\t\tlet proto = constructor.prototype;\n\t\t\t\t\twhile( proto ) {\n\t\t\t\t\t\tchain.suck( proto );\n\t\t\t\t\t\tproto = proto.__proto__;\n\t\t\t\t\t}\n\t\t\t\t\treturn chain;\n\t\t\t\t}", "title": "" }, { "docid": "fa2a058e35c1ed93cadf7429572d34e4", "score": "0.562449", "text": "function A() {}", "title": "" }, { "docid": "fa2a058e35c1ed93cadf7429572d34e4", "score": "0.562449", "text": "function A() {}", "title": "" }, { "docid": "fa2a058e35c1ed93cadf7429572d34e4", "score": "0.562449", "text": "function A() {}", "title": "" }, { "docid": "fa2a058e35c1ed93cadf7429572d34e4", "score": "0.562449", "text": "function A() {}", "title": "" }, { "docid": "fa2a058e35c1ed93cadf7429572d34e4", "score": "0.562449", "text": "function A() {}", "title": "" }, { "docid": "5d1951bd05497cc6b066d1772afb32a1", "score": "0.561883", "text": "function getFunctionParent() {\n\t\t return this.findParent(function (path) /*istanbul ignore next*/{\n\t\t return path.isFunction() || path.isProgram();\n\t\t });\n\t\t}", "title": "" }, { "docid": "5d1951bd05497cc6b066d1772afb32a1", "score": "0.561883", "text": "function getFunctionParent() {\n\t\t return this.findParent(function (path) /*istanbul ignore next*/{\n\t\t return path.isFunction() || path.isProgram();\n\t\t });\n\t\t}", "title": "" }, { "docid": "32251373e47ca1ef145d42ece29d735b", "score": "0.5607608", "text": "function s(t,e){o(t,e),Object.getOwnPropertyNames(e.prototype).forEach(function(n){o(t.prototype,e.prototype,n)}),Object.getOwnPropertyNames(e).forEach(function(n){o(t,e,n)})}", "title": "" }, { "docid": "26ed26abff93b6cc00788ab1c7391954", "score": "0.5600578", "text": "function chainPrototypes() {\n return Array.prototype.reduce.call(arguments, function(prev, curr) {\n if(!prev) return curr;\n if(!curr) return prev;\n if(prev === curr) return curr;\n curr.__proto__ = prev;\n return curr;\n });\n}", "title": "" }, { "docid": "499e3c3b6df18c490abdae404432ba9a", "score": "0.5589169", "text": "function FunctionLike() {}", "title": "" }, { "docid": "72fdbfb8907b06649930e2d9de7d00b8", "score": "0.5587799", "text": "function heir(p) {\n function f(){}\n f.prototype = p;\n return new f();\n}", "title": "" }, { "docid": "6f70ab2501dba368e9b2983c9217c999", "score": "0.55781776", "text": "function F(){n.call(this)}", "title": "" }, { "docid": "592d2f7714f07c54af5ddf792dd196bd", "score": "0.55621916", "text": "function F () { }", "title": "" }, { "docid": "592d2f7714f07c54af5ddf792dd196bd", "score": "0.55621916", "text": "function F () { }", "title": "" }, { "docid": "41af7bf7d14e419be95a676537034c1b", "score": "0.5546887", "text": "function a(e,t){o(e,t),Object.getOwnPropertyNames(t.prototype).forEach(function(n){o(e.prototype,t.prototype,n)}),Object.getOwnPropertyNames(t).forEach(function(n){o(e,t,n)})}", "title": "" }, { "docid": "2aeffc454480bc107b5170a2021004ee", "score": "0.5534026", "text": "function a(e,t){o(e,t),Object.getOwnPropertyNames(t.prototype).forEach((function(n){o(e.prototype,t.prototype,n)})),Object.getOwnPropertyNames(t).forEach((function(n){o(e,t,n)}))}", "title": "" }, { "docid": "a5c81cf153e68b76f2d506c9604ada0a", "score": "0.55255425", "text": "function inheritPrototype(proto) {\n function F() {}\n F.prototype = proto;\n return new F;\n }", "title": "" }, { "docid": "be5aa733bea098284ed76ff07505d175", "score": "0.55217654", "text": "function E() {}", "title": "" }, { "docid": "910d18103ce9abd71a350e7a2a4e4e04", "score": "0.55201316", "text": "fn() {\n return this.fn;\n }", "title": "" }, { "docid": "e099ef0ca068dc2fc60bbcd79f0d6b85", "score": "0.55147797", "text": "function p(t,e){function n(){this.constructor=t}l(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}", "title": "" }, { "docid": "d7319f53c21f81debeff7d37d4d2266b", "score": "0.54935974", "text": "function I(e,t){function n(){this.constructor=e}R(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}", "title": "" }, { "docid": "870f4a5e5ebfed1fdfc5fce1cb2c4788", "score": "0.5447913", "text": "function Function$prototype$chain(f) {\n var chain = this;\n return function(x) { return f(chain(x))(x); };\n }", "title": "" }, { "docid": "870f4a5e5ebfed1fdfc5fce1cb2c4788", "score": "0.5447913", "text": "function Function$prototype$chain(f) {\n var chain = this;\n return function(x) { return f(chain(x))(x); };\n }", "title": "" }, { "docid": "870f4a5e5ebfed1fdfc5fce1cb2c4788", "score": "0.5447913", "text": "function Function$prototype$chain(f) {\n var chain = this;\n return function(x) { return f(chain(x))(x); };\n }", "title": "" }, { "docid": "de431a4ea228dd10563990478bd3faec", "score": "0.54293233", "text": "function Vr(e,t){function n(){this.constructor=e}Lr(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}", "title": "" }, { "docid": "84cffe4cd88c106e1685760e6dcc2442", "score": "0.54176956", "text": "get super () {\n\n var p = this,\n c = p._chain_ || [],\n m = c[c.length - 1],\n d = c.reduce(function(a, b) {\n if (b === m) a++;\n return a;\n }, 0);\n\n while (d--) {\n p = p._super_.prototype;\n }\n\n if (p && prop.call(p, m)) {\n return p[m];\n }\n return null;\n }", "title": "" }, { "docid": "154b14a3c98b1c36908e197355dade8d", "score": "0.5416251", "text": "function F() {\n}", "title": "" }, { "docid": "74555ad91b667ed62cac72543129a6fe", "score": "0.5415478", "text": "function C(e,t){function n(){this.constructor=e}I(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}", "title": "" }, { "docid": "3bafdee255dca0c70a6a338c729c26a6", "score": "0.5399949", "text": "function l(t,e){function r(){this.constructor=t}h(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}", "title": "" }, { "docid": "f4a8b8de19b46bb4defc37278785e770", "score": "0.539573", "text": "function i(e,t){function i(){}i.prototype=t.prototype,e.superClass_=t.prototype,e.prototype=new i,e.prototype.constructor=e}", "title": "" }, { "docid": "7136ee1c3f92a605421efc875c4d0095", "score": "0.5387299", "text": "function r(e){return\"function\"===typeof e}", "title": "" }, { "docid": "7136ee1c3f92a605421efc875c4d0095", "score": "0.5387299", "text": "function r(e){return\"function\"===typeof e}", "title": "" }, { "docid": "1afa122b443150da8ed5655e8fe4d3f3", "score": "0.5373841", "text": "function C() {}", "title": "" }, { "docid": "8b6ec2df056233fe185d47d25eeb2176", "score": "0.53725433", "text": "function F(){}", "title": "" }, { "docid": "14f8013be58604bf0c607575fb288c13", "score": "0.5371169", "text": "function a(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}", "title": "" }, { "docid": "14f8013be58604bf0c607575fb288c13", "score": "0.5371169", "text": "function a(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}", "title": "" }, { "docid": "14f8013be58604bf0c607575fb288c13", "score": "0.5371169", "text": "function a(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}", "title": "" }, { "docid": "cb636c5d2989206e2f7b08597596296f", "score": "0.5368655", "text": "function s(t,e){function n(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}", "title": "" }, { "docid": "5408e4a4de4e5f4b5bfa97220cfdbe11", "score": "0.5356992", "text": "function Parent() {}", "title": "" }, { "docid": "5408e4a4de4e5f4b5bfa97220cfdbe11", "score": "0.5356992", "text": "function Parent() {}", "title": "" }, { "docid": "2d83ffd0e2ac7df216e0efddd5cbbab3", "score": "0.5350013", "text": "function inherit(proto) {\r\n\tfunction F() {}\r\n\tF.prototype = proto;\r\n\tvar object = new F;\r\n\treturn object;\r\n}", "title": "" }, { "docid": "4c091516cadd2fb3807944e808a3a3c8", "score": "0.5343151", "text": "function i(e){return\"function\"===typeof e}", "title": "" }, { "docid": "4c091516cadd2fb3807944e808a3a3c8", "score": "0.5343151", "text": "function i(e){return\"function\"===typeof e}", "title": "" }, { "docid": "dcf6013543d02d137a99db3034b42056", "score": "0.5337687", "text": "function i(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}", "title": "" }, { "docid": "60190256af0ebdd74df6f82b2e2563e8", "score": "0.5326464", "text": "function qp(e,t){function n(){this.constructor=e}Wp(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}", "title": "" }, { "docid": "d9c95c95aa4d4f0e09292ebf00270012", "score": "0.531564", "text": "function L(e,t){function n(){this.constructor=e}B(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}", "title": "" }, { "docid": "006d8ba1f584c7d227636b1b9f2a744e", "score": "0.5310741", "text": "function o(t,e){a(t,e),Object.getOwnPropertyNames(e.prototype).forEach(function(n){a(t.prototype,e.prototype,n)}),Object.getOwnPropertyNames(e).forEach(function(n){a(t,e,n)})}", "title": "" }, { "docid": "006d8ba1f584c7d227636b1b9f2a744e", "score": "0.5310741", "text": "function o(t,e){a(t,e),Object.getOwnPropertyNames(e.prototype).forEach(function(n){a(t.prototype,e.prototype,n)}),Object.getOwnPropertyNames(e).forEach(function(n){a(t,e,n)})}", "title": "" }, { "docid": "006d8ba1f584c7d227636b1b9f2a744e", "score": "0.5310741", "text": "function o(t,e){a(t,e),Object.getOwnPropertyNames(e.prototype).forEach(function(n){a(t.prototype,e.prototype,n)}),Object.getOwnPropertyNames(e).forEach(function(n){a(t,e,n)})}", "title": "" }, { "docid": "7ee06eb217168441907968636548fa95", "score": "0.53103566", "text": "function o(t,e){s(t,e),Object.getOwnPropertyNames(e.prototype).forEach(function(n){s(t.prototype,e.prototype,n)}),Object.getOwnPropertyNames(e).forEach(function(n){s(t,e,n)})}", "title": "" }, { "docid": "7ee06eb217168441907968636548fa95", "score": "0.53103566", "text": "function o(t,e){s(t,e),Object.getOwnPropertyNames(e.prototype).forEach(function(n){s(t.prototype,e.prototype,n)}),Object.getOwnPropertyNames(e).forEach(function(n){s(t,e,n)})}", "title": "" }, { "docid": "c7e5d07acef0935b821fa80a70f54f36", "score": "0.5306218", "text": "function o(t,e){a(t,e),Object.getOwnPropertyNames(e.prototype).forEach((function(n){a(t.prototype,e.prototype,n)})),Object.getOwnPropertyNames(e).forEach((function(n){a(t,e,n)}))}", "title": "" }, { "docid": "f82bc1b29e42058579f8344fad64e964", "score": "0.52925557", "text": "function n(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}", "title": "" }, { "docid": "02be5399f9015baaa6be16db61e651f1", "score": "0.5285759", "text": "onExtend(constructor) { }", "title": "" }, { "docid": "96243b2bd7de1ee6db44cc26522af327", "score": "0.52812517", "text": "function v(){f.call(this)}", "title": "" }, { "docid": "91588883772057da3b76e63c00f2f267", "score": "0.52744937", "text": "_makeImperativeCounterpart() {\n throw new TypeError('This method should be implemented by classes extending DeclarativeBase.')\n }", "title": "" }, { "docid": "3634b21fd82e904d6a3e2aec34cd9d45", "score": "0.5264471", "text": "function C(e){return C=\"function\"===typeof Symbol&&\"symbol\"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},C(e)}", "title": "" }, { "docid": "3935e07213b59186311b7e16e1a6ea2f", "score": "0.525294", "text": "function s(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}", "title": "" }, { "docid": "c3a1ed765500109d41b016a023e93590", "score": "0.5250546", "text": "function a() {}", "title": "" }, { "docid": "c3a1ed765500109d41b016a023e93590", "score": "0.5250546", "text": "function a() {}", "title": "" }, { "docid": "d755f151d03c34eed4582b64475d1695", "score": "0.52378815", "text": "function Bn(e,t){function r(){this.constructor=e}wn(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}", "title": "" }, { "docid": "95c83684d25f58b42d65a98ed25551cd", "score": "0.5230055", "text": "function c() {}", "title": "" }, { "docid": "01d68d1df30962faa925c0f393d3db51", "score": "0.52273035", "text": "function a () {}", "title": "" }, { "docid": "01d68d1df30962faa925c0f393d3db51", "score": "0.52273035", "text": "function a () {}", "title": "" }, { "docid": "c447d6f7d4a37e777d3bce7b51206420", "score": "0.522538", "text": "function L(){A.call(this)}", "title": "" }, { "docid": "c447d6f7d4a37e777d3bce7b51206420", "score": "0.522538", "text": "function L(){A.call(this)}", "title": "" }, { "docid": "c447d6f7d4a37e777d3bce7b51206420", "score": "0.522538", "text": "function L(){A.call(this)}", "title": "" }, { "docid": "2a4992dd46b9d90bde13c9f7f69d25e9", "score": "0.5223708", "text": "function u(e,t){function n(){this.constructor=e}s(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}", "title": "" }, { "docid": "e3e45e22cb52550dd460b93168ad069f", "score": "0.5222881", "text": "function p() {}", "title": "" }, { "docid": "01c4b15e31bdb85d42a4f49bb1317d4b", "score": "0.5222187", "text": "function Sl(e){return(Sl=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e})(e)}", "title": "" } ]
95e954ed5c4ab20f7d2d45ac43015e3f
This function loops through all the Create User error messages and sets form error messages to show in the form when repopulating
[ { "docid": "b89523677fba1688e446dc4661514097", "score": "0.6005047", "text": "function handleUserErrorMessages(req, err)\n{\n for (var i = 0; i < err.errors.length; i++) {\n switch(err.errors[i].message) {\n case 'emptyUsername':\n req.session.errUsername = 1;\n break;\n case 'username must be unique':\n req.session.errUsername = 2;\n break;\n case 'emptyPassword':\n req.session.errPassword = true;\n break;\n case 'emptyAccess':\n req.session.errAccess = true;\n break;\n default:\n break;\n }\n }\n}", "title": "" } ]
[ { "docid": "528b01792e2b037d817f8728be034acb", "score": "0.6940007", "text": "function prepFormErrors() {\n // log();\n var forms = document.querySelectorAll('form')\n for (var i = 0; i < forms.length; i++) {\n forms[i].addEventListener('blur', function(e) {\n if (e.target.value) {\n switch(e.target.className) {\n case('user'):\n if (formValidate.user(e.target.value)) {\n formError.hide('.userError');\n } else {\n formError.display('.userError', 'Invalid username');\n }\n break;\n case('password'):\n if (formValidate.password(e.target.value)) {\n formError.hide('.pwError')\n } else {\n formError.display('.pwError', 'Passwords must be at least 7 characters long and contain one uppercase character and one number.')\n }\n break;\n case('userSearch'):\n if (formValidate.search(users, e.target.value)) {\n formError.hide('.searchError');\n } else {\n formError.display('.searchError', 'User not found.')\n }\n break;\n }\n }\n }, true);\n }\n }", "title": "" }, { "docid": "cd649b79159c827ee4d4fde4abd7a244", "score": "0.6920889", "text": "function createAllErrorMessages () {\n // Name error for empty\n newHeading = createErrorMessage('Sorry, name field is required.', 'nameError');\n $('fieldset label').eq(0).after(newHeading);\n // Name error for numbers\n newHeading = createErrorMessage('Sorry, this is not a valid name.', 'nameInvalid');\n $('fieldset label').eq(0).after(newHeading);\n // Email error for invalid email\n newHeading = createErrorMessage('Sorry, this is not a valid email.', 'emailInvalid');\n $('fieldset label').eq(1).after(newHeading);\n // Email error for empty email\n newHeading = createErrorMessage('Sorry, email field is required.', 'emailError');\n $('fieldset label').eq(1).after(newHeading);\n // Activity error\n newHeading = createErrorMessage('Sorry, please choose at least 1 activity.', 'activityError');\n $('.activities legend').after(newHeading);\n // Credit card Error\n newHeading = createErrorMessage('Credit card field is required.', 'creditError');\n $('.credit-card div').eq(0).append(newHeading);\n // Credit card invalid\n newHeading = createErrorMessage('This is not a valid credit card number.', 'creditInvalid');\n $('.credit-card div').eq(0).append(newHeading);\n // Zip code error\n newHeading = createErrorMessage('Zip code is required field.', 'zipError');\n $('.credit-card div').eq(1).append(newHeading);\n // Zip code error\n newHeading = createErrorMessage('This is not a valid Zip code.', 'zipInvalid');\n $('.credit-card div').eq(1).append(newHeading);\n // CVV error\n newHeading = createErrorMessage('CVV is a requried field.', 'cvvError');\n $('.credit-card div').eq(2).append(newHeading);\n // CVV error\n newHeading = createErrorMessage('This is not a valid CVV.', 'cvvInvalid');\n $('.credit-card div').eq(2).append(newHeading);\n // Styles the error messages\n $('.error').css('color', 'red');\n // Hides all error messages on the page\n $('.error').hide();\n}", "title": "" }, { "docid": "c6e1cd63605bab4f7c637b81d8ca6aed", "score": "0.65805405", "text": "function createErrors(errors) {\n // Ensure we fade out and clear the current errors container\n // in case messages are already present.\n elements.errorsContainer.fadeOut(50, function() {\n elements.errors.empty();\n\n // Loop through each available error that is available, and ensure\n // an alert is created for each one.\n for (let error of errors) {\n elements.errors.append(`\n <div class=\"alert alert-${error[\"type\"]} alert-dismissible\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>\n ${error[\"message\"]}\n </div>\n `);\n }\n // Fade the error container in once we've added all our present errors\n // to the element.\n enableForm(function() {\n elements.errorsContainer.fadeIn(250);\n });\n });\n }", "title": "" }, { "docid": "7d70ff4ed1960d2821fdb7c8ba1f8eb1", "score": "0.64263386", "text": "function put_errors(target_form, response){\n\n\n $('#'+target_form.attr('id')+' .has-error').each(function(){\n $(this).removeClass('has-error');\n $(this).children('.help-block').remove();\n });\n\n $.each(response.responseJSON.errors, function(i, item){\n target = $('#'+target_form.attr('id')+\" #fg-\"+i);\n target.addClass('has-error');\n target.append('<span class=\"help-block\" style=\"margin-bottom:0px\">'+item+'</span>');\n });\n\n $.notify(\n {\n message: 'Please fill out the required fields.',\n\n },\n { \n type: 'warning',\n z_index: 30000,\n animate: {\n enter: 'animate__animated animate__jackInTheBox',\n exit: 'animated fadeOutUp'\n },\n }\n );\n}", "title": "" }, { "docid": "d62e834e27f979edd719981d1899059a", "score": "0.6261264", "text": "function user(errors, target) {\n init(errors, target);\n var errorMessages = [];\n angular.forEach(errors, function (error) {\n errorMessages.push(error.errorMessage);\n\n switch (error.errorCode) {\n case 3011:\n case 3012:\n case 3013:\n case 3037:\n case 3038: {\n target.username = error.errorMessage;\n break;\n }\n case 3027: {\n target.location_id = error.errorMessage;\n break;\n }\n case 3028: {\n target.date_of_birth = error.errorMessage;\n break;\n }\n case 2316:\n case 2317:\n case 2318:\n case 2319: {\n target.email = error.errorMessage;\n break;\n }\n case 3020:\n case 3021:\n case 3022:\n case 3023:\n case 3024: {\n target.password = error.errorMessage;\n break;\n }\n case 3025:\n case 3026: {\n target.confirm_password = error.errorMessage;\n break;\n }\n case 3032:\n case 3033: {\n target.current_password = error.errorMessage;\n break;\n }\n case 3034:\n case 3036:\n case 3042:\n case 3043:\n case 3044: {\n target.phone = error.errorMessage;\n break;\n }\n case 3047:\n case 3060:{\n target.first_name = error.errorMessage;\n break;\n }\n case 3048:\n case 3061:{\n target.surname = error.errorMessage;\n break;\n }\n case 3049: {\n target.province = error.errorMessage;\n break;\n }\n case 3050: {\n target.city = error.errorMessage;\n break;\n }\n case 3051:\n case 3052:\n case 3053: {\n target.postal_code = error.errorMessage;\n break;\n }\n case 3054: {\n target.address1 = error.errorMessage;\n break;\n }\n case 3055: {\n target.address2 = error.errorMessage;\n break;\n }\n case 3062:{\n target.role_id = error.errorMessage;\n break;\n }\n }\n });\n }", "title": "" }, { "docid": "e13119750b2f0af41afd9b7a83e2b0b1", "score": "0.6190972", "text": "function checkErrors() {\n var firstName = document.getElementById('first-name');\n var lastName = document.getElementById('last-name');\n var subject = document.getElementById('compose-subject');\n var message = document.getElementById('compose-message');\n /* The following JavaScript Regular Expressions (RegExp) are from : https://www.w3schools.com/jsref/jsref_obj_regexp.asp */\n var RegExp = /[\\d \\s]/g;\n var specialChar = /[! @ # $ % ^ & * ( ) \\[ \\] - _ = + \\ | / ? . > < , \" : ; ` ~]/g;\n var RegExp2 = /[a-zA-Z0-9]/g;\n /* the following counter will keep track of whether the form fields are correct.\n it will decide if the form should display the success message or not. */\n var correctCounter = 0;\n\n\tif(firstName.value == \"\" || RegExp.test(firstName.value) == true || specialChar.test(firstName.value) == true) {\n\t\tfirstName.style.borderColor = \"red\";\n\t\tfirstName.style.boxShadow = \" 0px 0px 5px 5px red\";\n\t\tfirstName.placeholder = \"Enter your first name here. Numbers not allowed\";\n\t\tfirstName.value = \"\";\n\t}\n\n\telse {\n\t\tfirstName.style.borderColor = \"#3F7674\";\n\t\tfirstName.style.boxShadow = \" 0px 0px 5px 5px #3F7674\";\n correctCounter++;\n\t}\n\n\tif(lastName.value == \"\" || RegExp.test(lastName.value) == true || specialChar.test(firstName.value) == true) {\n\t\tlastName.style.borderColor = \"red\";\n\t\tlastName.style.boxShadow = \" 0px 0px 5px 5px red\";\n\t\tlastName.placeholder = \"Enter your last name here. Numbers not allowed\";\n\t\tlastName.value = \"\";\n\t}\n\telse {\n\t\tlastName.style.borderColor = \"#3F7674\";\n\t\tlastName.style.boxShadow = \" 0px 0px 5px 5px #3F7674\";\n correctCounter++;\n\t}\n\n\tif(subject.value == \"\" || RegExp2.test(subject.value) == false || specialChar.test(subject.value) == true) {\n\t\tsubject.style.borderColor = \"red\";\n\t\tsubject.style.boxShadow = \" 0px 0px 5px 5px red\";\n\t\tsubject.placeholder = \"Please enter a subject\";\n\t}\n\telse {\n\t\tsubject.style.borderColor = \"#3F7674\";\n\t\tsubject.style.boxShadow = \" 0px 0px 5px 5px #3F7674\";\n correctCounter++;\n\t}\n\n\tif(message.value == \"\" || RegExp2.test(message.value) == false) {\n\t\tmessage.style.borderColor = \"red\";\n\t\tmessage.style.boxShadow = \" 0px 0px 5px 5px red\";\n\t\tmessage.placeholder = \"Please enter a message\";\n\t}\n\telse {\n\t\tmessage.style.borderColor = \"#3F7674\";\n\t\tmessage.style.boxShadow = \" 0px 0px 5px 5px #3F7674\";\n correctCounter++;\n\t}\n sendEmail(correctCounter);\n}", "title": "" }, { "docid": "c02271f48a9d99265e23f622c742f0ae", "score": "0.6125326", "text": "function createAccount() {\n //get the user name, password and confirm password from user\n let inputUserName = document.getElementById('userCreate').value;\n let inputPassword = document.getElementById('passCreate').value;\n let inputConfirmPass = document.getElementById('confirmCreate').value;\n\n //if either of the inputs are empty then show red error\n if (inputUserName == '' || inputPassword == '' || inputConfirmPass == '') {\n if (inputUserName == '')\n document.getElementById('validNameCreate').style.display = 'block';\n else\n document.getElementById('validNameCreate').style.display = 'none';\n\n if (inputPassword == '')\n document.getElementById('validPasswordCreate').style.display = 'block';\n else\n document.getElementById('validPasswordCreate').style.display = 'none';\n\n if (inputConfirmPass == '')\n document.getElementById('validConfirmCreate').style.display = 'block';\n else\n document.getElementById('validConfirmCreate').style.display = 'none';\n }\n //else both are not empty and vanish the red errors\n //create the account and add it to the database\n else {\n document.getElementById('validNameCreate').style.display = 'none';\n document.getElementById('validPasswordCreate').style.display = 'none';\n document.getElementById('validConfirmCreate').style.display = 'none';\n\n if (inputPassword != inputConfirmPass)\n alert('You did not confirm the password');\n\n //check if the user already registered\n else if (userFound(inputUserName) != -1)\n alert('You already registered to the game');\n\n //all is good- password and confirm are the same and the user didn't registered\n else {\n let user = {\n userName: inputUserName,\n password: inputPassword,\n score: '00:00:00'\n };\n users.push(user);\n alert('You have successfully registered to the game!');\n currentUser = inputUserName;\n addUsersToLeadBoard();\n change_form('createAccountForm', 'helloUserForm');\n document.getElementById('playerName').innerHTML = 'Hello ' + inputUserName;\n }\n\n }\n}", "title": "" }, { "docid": "28c59cac3aacc3479e599cced2ea7495", "score": "0.6123673", "text": "function signUp(){\n\t//check if the username is blank, if it is, display error message\n\tif (username.value == \"\"){\n\t\terrorMsg[1].style.display = \"block\";\n\t\tusername.style.border = \"1px solid red\";\n\t\tinvalidUsername = true;\n\t}else\n\t\tinvalidUsername = false;\n\t//check if the password is blank, if it is, display error message\n\tif (password.value == \"\"){\n\t\terrorMsg[2].innerHTML = \"&#10007<small> Please enter password</small>\";\n\t\terrorMsg[2].style.color=\"red\";\n\t\terrorMsg[2].style.display = \"block\";\n\t\tpassword.style.border = \"1px solid red\";\n\t\tinvalidPsw = true;\n\t}\n\t//check if the confirmation password is blank, if it is, display error message\n\tif (confirmPsw.value == \"\"){\n\t\terrorMsg[3].innerHTML = \"&#10007;<small> Please enter confirm password</small>\";\n\t\terrorMsg[3].style.display = \"block\";\n\t\tconfirmPsw.style.border = \"1px solid red\";\n\t\tinvalidCPsw = true;\n\t}\n\t//check if the id type is chosen\n\tif (idType.value == \"\"){\n\t\terrorMsg[4].style.display = \"block\";\n\t\tidType.style.border = \"1px solid red\";\n\t\tinvalidIDtype = true;\n\t}else\n\t\tinvalidIDtype = false;\n\t//check if the id number is blank\n\tif (idNo.value == \"\"){\n\t\terrorMsg[5].style.display = \"block\";\n\t\tidNo.style.border = \"1px solid red\";\n\t\tinvalidIDno = true;\n\t}else\n\t\tinvalidIDno = false;\n\t//check if the full name is blank\n\tif (fullname.value == \"\"){\n\t\terrorMsg[6].style.display = \"block\";\n\t\tfullname.style.border = \"1px solid red\";\n\t\tinvalidName = true;\n\t}else\n\t\tinvalidName = false;\n\t//check if the nationality is blank\n\tif (nationality.value == \"\"){\n\t\terrorMsg[7].style.display = \"block\";\n\t\tnationality.style.border = \"1px solid red\";\n\t\tinvalidNationality = true;\n\t}else\n\t\tinvalidNationality = false;\n\tif (dateOfBirth.value == \"\"){\n\t\terrorMsg[8].style.display = \"block\";\n\t\tdateOfBirth.style.border = \"1px solid red\";\n\t\tinvalidDOB = true;\n\t}else\n\t\tinvalidDOB = false;\n\tif (email.value == \"\"){\n\t\terrorMsg[9].innerHTML = \"&#10007<small> Please enter email address</small>\";\n\t\terrorMsg[9].style.color=\"red\";\n\t\temail.style.border = \"1px solid red\";\n\t\tinvalidEmail = true;\n\t}\n\t//check if phone number is blank\n\tif (phoneNo.value == \"\"){\n\t\terrorMsg[10].innerHTML = \"&#10007<small> Please enter mobile number</small>\";\n\t\terrorMsg[10].style.color=\"red\";\n\t\tphoneNo.style.border = \"1px solid red\";\n\t\tinvalidPhoneNo = true;\n\t}\n\t//check if address is blank\n\tif (address.value == \"\"){\n\t\terrorMsg[11].style.display = \"block\";\n\t\taddress.style.border = \"1px solid red\";\n\t\tinvalidAddress = true;\n\t}else\n\t\tinvalidAddress = false;\n\t//alert(\"a\"+ invalidUsername + \"\" + invalidPsw + \"\" + invalidCPsw + \"\" + invalidIDtype + \"\" + invalidIDno + \"\" + invalidName + \"\" +\n\t//invalidNationality + \"\" + invalidDOB + \"\" + invalidEmail + \"\" + invalidPhoneNo + \"\" + invalidAddress);\n\tinvalid = [invalidUsername, invalidPsw, invalidCPsw, invalidIDtype, invalidIDno, invalidName, invalidNationality,\n\tinvalidDOB, invalidEmail, invalidPhoneNo, invalidAddress];\n\tfor ( i = 0 ; i < invalid.length; i++){\n\t\tif (invalid[i]){\n\t\t\tdocument.getElementsByClassName(\"form-control\")[i].focus();\n\t\t\treturn false;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "4b497b5646349c03052a168a1ab5a176", "score": "0.61183935", "text": "function resetFormErrors() {\n\t\t// Delete all form error messages\n\t\t$('.form_error_container p').remove();\n\t}", "title": "" }, { "docid": "f47e82c0bf446e2bb112c8cdc893e385", "score": "0.61077034", "text": "function applyValidationErrors(errors) {\n\t\tvar errorMessage = '';\n\n\t\t$.each(errors, function(key, value) {\n\t\t\t$loginForm.find('*[name=' + key + ']').parent('.login-form-control').addClass('login-validation-error');\n\t\t\terrorMessage += errorMessage ? (' ' + value) : value;\n\t\t});\n\t\tdisplayClientError(errorMessage);\n\t}", "title": "" }, { "docid": "8123de6a3d0450bf41403f8b06f0f8f0", "score": "0.61033684", "text": "handleSubmitFailed(user) {\n if (user.email.errors.required) {\n this.setErrors(Message.emailRequired);\n } else if (user.password.errors.validateEmail) {\n this.setErrors(Message.validEmail);\n }\n }", "title": "" }, { "docid": "d97b6191c83c93b2a20ebdc9c4d828f4", "score": "0.6100475", "text": "addErrorMsgs (errorMsgs) {\n let fieldName = this.inputDiv.querySelector('label').innerText\n for (let msg of errorMsgs) {\n const msgNode = document.createElement('p')\n msgNode.classList.add('input-hint', 'text-danger', 'error-msg')\n msgNode.innerText = `${fieldName} ${msg}.`\n this.inputDiv.appendChild(msgNode)\n }\n }", "title": "" }, { "docid": "4340be88c6a888bf88fadda38269bd2c", "score": "0.6098984", "text": "clearFormErrors(){\n this[this.formObject].fields.forEach(val=>{\n // set error message of fields to null\n val.errorMessages = null;\n // set error status of fields to false or clear error status on form input\n val.error = false;\n })\n }", "title": "" }, { "docid": "be8bae169bc7309dcb2c6ee77a8bd4cd", "score": "0.60843986", "text": "function validate ( )\n{\n let valid = true;\n reset_form ( );\n SUBMIT.hide();\n\n // This currently checks to see if the username is\n // present and if it is at least 5 characters in length.\n if ( !USERNAME.val() || USERNAME.val().length < 5 )\n {\n // Show an invalid input message\n USERNAME_MSG.html( \"Username must be 5 characters or more\" );\n USERNAME_MSG.show();\n // Indicate the type of bad input in the console.\n console.log( \"Bad username\" );\n // Indicate that the form is invalid.\n valid = false;\n }\n // TODO: Add your additional checks here.\n\n\n if ( USERNAME.val() != USERNAME.val().toLowerCase())\n {\n USERNAME_MSG.html(\"Username must be all lowercase\");\n USERNAME_MSG.show();\n valid = false;\n }\n\n if ( !PASSWORD.val() || PASSWORD.val().length < 8 )\n {\n PASSWORD_MSG.html(\"Password needs to be at least 8 characters long\");\n PASSWORD_MSG.show();\n valid = false;\n }\n\n if ( !CONFIRM.val() || PASSWORD.val() != CONFIRM.val() )\n {\n CONFIRM_MSG.html(\"Passwords don't match\");\n CONFIRM_MSG.show();\n valid = false;\n }\n\n if ( !FNAME.val() )\n {\n FNAME_MSG.html(\"First name must not be empty\");\n FNAME_MSG.show();\n valid = false;\n }\n\n if ( !LNAME.val() )\n {\n LNAME_MSG.html(\"Last name must not be empty\");\n LNAME_MSG.show();\n valid = false;\n }\n\n var x = EMAIL.val().trim();\n var atpos = x.indexOf(\"@\");\n var dotpos = x.lastIndexOf(\".\");\n if ( atpos < 1 || dotpos < atpos + 2 || dotpos + 2 >= x.length ) {\n EMAIL_MSG.html(\"You need to enter a valid email address\");\n EMAIL_MSG.show();\n valid = false;\n }\n\n // If the form is valid, reset error messages\n if ( valid )\n {\n reset_form ( );\n }\n}", "title": "" }, { "docid": "2d4b432e38c2eef10dca13536d31affb", "score": "0.60584265", "text": "function addValidations() {\n\n var messageExceptions = \"\";\n for (var i = 0, l = opt.validations.length; i < l; i++) {\n messageExceptions += opt.validations[i] + \"<br/>\";\n }\n\n var message = $(\".biz-dialog-alert-email-message\", opt.emailDialog);\n message.html(messageExceptions);\n\n }", "title": "" }, { "docid": "f0a793325d40002d3f1647cde736be84", "score": "0.6056105", "text": "function prepare() {\n\n // var errorTags = $(\".error, error\").toArray();\n // errorTags.forEach(function(e, idx) {\n $(\".error, error\").each(function(idx, e) {\n\n // Check if this fit of one of the case\n var hasErrorFor = $(e).attr(\"errorFor\") != undefined,\n afterInput = supportedTag.indexOf( $(e).prev().prop(\"tagName\") ) >= 0,\n underErrorGroup = $(e).parent().prop(\"tagName\") == \"errorGroup\".toUpperCase();\n var underErrorGroupWithForKey = (underErrorGroup && $(e).parent().attr(\"errorFor\") !== undefined),\n underErrorGroupAfterInput = (underErrorGroup\n &&\n supportedTag.indexOf(\n $(e).parent().prev().prop(\"tagName\")\n ) >= 0);\n\n if ( !hasErrorFor && !afterInput && !underErrorGroupWithForKey && !underErrorGroupAfterInput) {\n console.error(\"Error message with no paired validation target\\nError Tag[\"+(idx+1)+\"]: '\"+$(e).text()+\"'\");\n } else {\n\n // Pair them by ID\n var inputTag = getTargetInputField(e);\n if (inputTag) {\n\n var inputIDStr = $(inputTag).attr(\"id\") || generateUUID_v4();\n $(e).data(\"errorFor\", inputIDStr);\n\n // Copy rules into input fields\n var errorRules = $(e).attr(\"data-rule\") ? $(e).attr(\"data-rule\").split(',') : [];\n var rulesArr = $(inputTag).data(\"rules\") || [];\n $(inputTag).data(\"rules\", rulesArr.concat(errorRules));\n\n // Warning if input field has no ID\n if ($(inputTag).attr(\"id\") === undefined) {\n $(inputTag).attr(\"id\", inputIDStr);\n DEBUG(\"Form field missing ID attribute, generated an UUID instead [\"+inputIDStr+\"]\", 'error');\n }\n\n }\n\n }\n\n });\n\n }", "title": "" }, { "docid": "6db9da612769253dc7244f5d41a4aeb5", "score": "0.60223275", "text": "function insert_errors_messages(container, errors) {\n errors.forEach(errMess => {\n container.append('<div class=\"alert alert-warning\" role=\"alert\">' + errMess + '</div>');\n });\n}", "title": "" }, { "docid": "c9534508398f13c1e592caaee9286568", "score": "0.59932196", "text": "function addErrors(error, form, progression, notification) {\n var element = angular.element( document.querySelector( '#create-view' ) );\n var previousErrors = angular.element( document.querySelector( '#errors' ) );\n if(previousErrors)\n previousErrors.remove();\n var html = '<div id=\"errors\">';\n var errorData = Object.keys(error.data.data);\n for (var i = 0; i < errorData.length; i++) {\n var list = '<ul>';\n for (var j = 0; j < error.data.data[errorData[i]].length; j++) {\n list = list + '<strong>' + error.data.data[errorData[i]][j].value + '</strong>';\n list = list + '<li>' + error.data.data[errorData[i]][j].rule + '</li>';\n list = list + '<li>' + error.data.data[errorData[i]][j].message + '</li>';\n }\n list = list + '</ul> <br>';\n }\n html = html + list + '</div>';\n element.prepend(html);\n progression.done();\n notification.log(`Some values are invalid, see details in the form`, { addnCls: 'humane-flatty-error' });\n return false;\n }", "title": "" }, { "docid": "922138dc9b2e90894ac53189da5e142d", "score": "0.5985126", "text": "async function createUser() {\n //Checks whether all the form areas have been filled out\n if (!userFormData.fname || !userFormData.lname || !userFormData.email || !userFormData.password || !confPassword){\n setError('Fill out all parts of the form please!')\n }\n //Checks whether the fist and last name is alphanumeric\n else if (!userFormData.fname.match(/^[0-9a-zA-Z]+$/) || !userFormData.lname.match(/^[0-9a-zA-Z]+$/)){\n setError('The first and last name must be alphanumeric')\n }\n //Checks whether the password and confirmation password was filled out\n else if (userFormData.password !== confPassword) {\n setError('The passwords do not match. Make sure to type the same password')\n }\n //Checks whether the users email is already being used in the database\n else if (userExists()) {\n setError('This email is already exists. Use a different email or login to this existing email')\n }\n //Creates the user in the API and database\n else{\n //Uses the createUserMutation to create the user using userFormData\n await API.graphql({query: createUserMutation, variables: {input: userFormData}})\n //Adds the formData to the users\n setUsers([...users, userFormData]);\n //Sets the registered variables to be transferred to the confirmation page\n setRegistered({\n success: true,\n email: userFormData.email,\n password: userFormData.password\n });\n //Resets the userFormData\n setUserFormData({\n fname: '',\n lname: '',\n email: '',\n password: '',\n bio: '',\n image: avatarURL\n });\n setConfPassword('');\n }\n }", "title": "" }, { "docid": "3efe4c6c4b64ce3daeef0ac7313f29f1", "score": "0.5984312", "text": "function addErrorMessage(errors) {\n\t$.each(errors, function (index, value) {\n\t\tif ($(\"#error-\" + value.field).text().length <= 0) {\n\t\t\t$(\"#error-\" + value.field).append(\"<p>\" + value.defaultMessage + \"</p>\");\n\t\t\t$(\"#error-\" + value.field).removeClass(\"alert-hide\");\n\t\t}\n\t});\n}", "title": "" }, { "docid": "72cf406288a92e6aaaf3d945014ee151", "score": "0.5972118", "text": "function save_form_user()\n\t{\n\t\ttry{\n\t\t\t\t\n\t\t\tinit_dialog_error();\n\t\t\t\n\t\t\tobj_user = $(\"#wizard_add_member\");\n\t\t\tvar name = $(obj_user).find(\"#id_name\").val();\n\t\t\tvar accesstype = $(obj_user).find(\"#id_accesstype option:selected\").val();\n\t\t\tvar displayname = $(obj_user).find(\"#id_displayname\").val();\n\t\t\tvar password = $(obj_user).find(\"#id_password\").val();\n\t\t\tvar comment = $(obj_user).find(\"#id_comment\").val();\n\t\t\t\n\t\t\tvar data = {\n\t\t\t\t\t'name' : name,\n\t\t\t\t\t'accesstype' : accesstype,\n\t\t\t\t\t'displayname' : displayname,\n\t\t\t\t\t'password' : password,\n\t\t\t\t\t'comment' : comment\n\t\t\t};\n\t\t\t\n\t\t\t$.post(url_save_new_user,data,function(result){\n\t\t\t\t\n\t\t\t\tif(result.status == \"success\")\n\t\t\t\t{\n\t\t\t\t\tobj_group = $(\"#wizard_content_add_group\");\n\t\t\t\t\t\n\t\t\t\t\tobj_members = $(obj_group).find(\"#members\");\n\t\t\t\t\t\n\t\t\t\t\t$(obj_members).append(result.form);\n\t\t\t\t\t\n\t\t\t\t\talternative_row();\n\t\t\t\t\t\n\t\t\t\t\t$(\"#wizard_add_member\").dialog(\"close\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(result.status == \"error\")\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\tshow_error_dialog(result.error_info);\n\t\t\t\t}\n\t\t\t\n\t\t\t});\n\t\t}\n\t\tcatch(error)\n\t\t{\n\t\t\tshow_error_dialog(error.message);\n\t\t}\n\t}", "title": "" }, { "docid": "f369d9c7c1b7bb3379c1a0239d4401ce", "score": "0.59705544", "text": "function CreateNewErrorsLi()\n{\n for (errorMessage of errorMessages){\n let newError = document.createElement(\"li\");\n newError.innerText = errorMessage;\n errorPanel.appendChild(newError);\n // Toggle class to errors if not already set to errors.\n if (errorPanel.classList != \"errors\"){\n errorPanel.classList.add(\"errors\");\n }\n // Clears the errors array preparing for the next submit click event. \n errorMessages = [];\n }\n}", "title": "" }, { "docid": "ddd58f707ea1edce497270fcdc0d209f", "score": "0.5948878", "text": "render() {\n const { isNewUser } = this.props;\n const { firstName, lastName, email, designation, companyName, companyAddress, errors } = this.state;\n\n return (\n <div className=\"offset-md-3 col-md-6\">\n <form\n className=\"signup-form\"\n method=\"post\"\n onSubmit={this.submitForm(firstName, lastName, email, designation, companyName, companyAddress)}\n >\n {/* first name */}\n <FormField\n name=\"First Name\"\n inputName=\"firstName\"\n type=\"text\"\n value={firstName}\n onChange={e => {\n const { value } = e.target;\n return this.setState(prevState => ({\n firstName: value,\n errors: { ...prevState.errors, firstName: validateTextString(value).message },\n }));\n }}\n errorMsg={errors.firstName}\n isVisible={isNewUser}\n />\n {/* last name */}\n <FormField\n name=\"Last Name\"\n inputName=\"lastName\"\n type=\"text\"\n value={lastName}\n onChange={e => {\n const { value } = e.target;\n return this.setState(prevState => ({\n lastName: value,\n errors: { ...prevState.errors, lastName: validateTextString(value).message },\n }));\n }}\n errorMsg={errors.lastName}\n isVisible={isNewUser}\n />\n {/* email */}\n <FormField\n name=\"Email\"\n inputName=\"email\"\n type=\"email\"\n value={email}\n onChange={e => {\n const { value } = e.target;\n return this.setState(prevState => ({\n email: value,\n errors: { ...prevState.errors, email: validateEmail(value).message },\n }));\n }}\n errorMsg={errors.email}\n isVisible={isNewUser}\n />\n {/* Designation */}\n <FormField\n name=\"Designation\"\n inputName=\"designation\"\n type=\"text\"\n value={designation}\n onChange={e => {\n const { value } = e.target;\n return this.setState(prevState => ({\n designation: value,\n errors: { ...prevState.errors, designation: validateTextString(value).message },\n }));\n }}\n errorMsg={errors.designation}\n />\n {/* company name */}\n <FormField\n name=\"Company Name\"\n inputName=\"companyName\"\n type=\"text\"\n value={companyName}\n onChange={e => {\n const { value } = e.target;\n return this.setState(prevState => ({\n companyName: value,\n errors: { ...prevState.errors, companyName: validateTextString(value).message },\n }));\n }}\n errorMsg={errors.companyName}\n />\n {/* company address */}\n <FormField\n name=\"Company Address\"\n inputName=\"companyAddress\"\n type=\"text\"\n value={companyAddress}\n onChange={e => {\n const { value } = e.target;\n return this.setState(prevState => ({\n companyAddress: value,\n errors: { ...prevState.errors, companyAddress: validateTextString(value).message },\n }));\n }}\n errorMsg={errors.companyAddress}\n />\n {/* Submit profile button */}\n <FormSubmitButton name=\"Submit\" />\n </form>\n </div>\n );\n }", "title": "" }, { "docid": "25385640caa36e3a81740c66af89a82c", "score": "0.5948075", "text": "handleCreate(event)\n {\n this.setState({\n errorMessage: ''\n });\n // verify that needed values have been provided\n if(this.username.value !== '' && \n this.password1.value !== '' &&\n this.password2.value !== '')\n {\n // verify that passwords provided match\n if(this.password1.value === this.password2.value)\n {\n // call backend api to create new user account\n createUser(this.username.value, this.password1.value)\n .then((res) => {\n if(res.success)\n {\n // if successful, notify user and close the dialog\n // does not set the current user and portfolio\n // user must log in after creating an account\n console.log('Account creation successful');\n // close the dialog\n this.toggleCreateModal();\n }\n else\n {\n // if unsuccessful, notify user why in dialog\n this.setState({\n errorMessage: res.error\n });\n }\n })\n .catch(() => {\n // if unsuccessful, notify user why in dialog\n this.setState({\n errorMessage: 'Account creation failed'\n });\n });\n }\n else\n {\n // if unsuccessful, notify user why in dialog\n this.setState({\n errorMessage: 'Passwords do not match'\n });\n }\n }\n else\n {\n // if unsuccessful, notify user why in dialog\n if(this.username.value === '')\n {\n this.setState({\n errorMessage: 'Please provide a username'\n });\n }\n else if(this.password1.value === '')\n {\n this.setState({\n errorMessage: 'Please provide a password'\n });\n }\n else if(this.password2.value === '')\n {\n this.setState({\n errorMessage: 'Please confirm your password'\n });\n }\n }\n event.preventDefault();\n }", "title": "" }, { "docid": "5bc9a00e01653cb103f30650e9684a9b", "score": "0.59242696", "text": "function SignUpFormRemoveError(){\n if(signUp_fName.value !=\"\"){\n signUp_fName.style.borderColor = \"\";\n signUp_fName.style.color = \"\";\n document.getElementById('firstNameErr').style.visibility = \"hidden\";\n }\n\n if(signUp_lName.value !=\"\"){\n signUp_lName.style.borderColor = \"\";\n signUp_lName.style.color = \"\";\n document.getElementById('lastNameErr').style.visibility = \"hidden\";\n }\n\n if(signUp_lName.value !=\"\"){\n signUp_lName.style.borderColor = \"\";\n signUp_lName.style.color = \"\";\n document.getElementById('lastNameErr').style.visibility = \"hidden\";\n }\n\n var regex = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,4}$/;\n if (signUp_email.value.match(regex) || signUp_email.value == \"\"){\n signUp_email.style.borderColor = \"\";\n signUp_email.style.color = \"\";\n document.getElementById('emailErr').style.visibility = \"hidden\";\n }else{\n document.getElementById('emailErr').style.visibility = \"visible\";\n document.getElementById('emailErr').innerHTML =\"Enter Valid Email!\";\n }\n\n if((signUp_password.value !=\"\" && signUp_password.value.length >=6) || signUp_password.value ==\"\"){\n signUp_password.style.borderColor = \"\";\n signUp_password.style.color = \"\";\n document.getElementById('SignuppasswordErr').style.visibility = \"hidden\";\n }else{\n document.getElementById('SignuppasswordErr').style.visibility = \"visible\";\n document.getElementById('SignuppasswordErr').innerHTML = \"Enter at least 6 characters!\";\n }\n\n if((confirmPassword.value !=\"\" && confirmPassword.value == signUp_password.value) || confirmPassword.value==\"\"){\n confirmPassword.style.borderColor = \"\";\n confirmPassword.style.color = \"\";\n document.getElementById('confirmPasswordErr').style.visibility = \"hidden\";\n }else{\n confirmPassword.style.borderColor = \"\";\n confirmPassword.style.color = \"\";\n document.getElementById('confirmPasswordErr').style.visibility = \"visible\";\n document.getElementById('confirmPasswordErr').innerHTML = \"Password Doesn't Matched!\";\n }\n}", "title": "" }, { "docid": "790651b59d474c0fb837d6e2bb9b75d9", "score": "0.5917541", "text": "function validateCreateAccount() {\n var errorDiv = document.querySelector(\"#createAccount .errorMessage\");\n var usernameElement = document.getElementById(\"username\");\n var pass1Element = document.getElementById(\"pass1\");\n var pass2Element = document.getElementById(\"pass2\");\n var passwordMismatch = false;\n var invColor = \"rgb(255,233,233)\";\n try {\n // reset styles to valid state\n usernameElement.style.background = \"\";\n pass1Element.style.background = \"\";\n pass2Element.style.background = \"\";\n errorDiv.style.display = \"none\";\n if ((usernameElement.value !== \"\" && pass1Element.value !== \"\" && pass2Element.value !== \"\")) {\n // all fields are filled\n if (pass1Element.value !== pass2Element.value) {\n // passwords don't match\n passwordMismatch = true;\n throw \"Passwords entered do not match; please reenter.\";\n }\n }\n if (!(usernameElement.value === \"\" && pass1Element.value === \"\" && pass2Element.value === \"\")) {\n // not all fields are blank\n throw \"Please complete all fields to create an account.\";\n }\n }\n catch(msg) {\nerrorDiv.innerHTML = msg;\n errorDiv.style.display = \"block\";\n if (passwordMismatch) {\n usernameElement.style.background = \"\";\n pass1Element.style.background = invColor;\n pass2Element.style.background = invColor;\n } else {\n if (usernameElement.value === \"\") {\n usernameElement.style.background = invColor;\n }\nif (pass1Element.value === \"\") {\n pass1Element.style.background = invColor;\n }\n if (pass2Element.value === \"\") {\n pass2Element.style.background = invColor;\n }\n }\n formValidity = false;\n }\n }", "title": "" }, { "docid": "31eadbbd1f94d42f39a2ffde14e46f93", "score": "0.5908347", "text": "function formValidation() {\n\n $(\"#errorMessages\").empty();\n\n let errMsg = [];\n\n if ($(\"#teamname\").val().trim() == \"\") {\n errMsg[errMsg.length] = \"Team Name is required\";\n }\n\n if ($(\"#managername\").val().trim() == \"\") {\n errMsg[errMsg.length] = \"Manager Name is required\";\n }\n\n if ($(\"#managerphone\").val().trim() == \"\") {\n errMsg[errMsg.length] = \"Manager Phone is required\";\n }\n\n\n let emailPattern = /^\\w+@[a-zA-Z_]+?\\.[a-zA-Z]{2,3}$/;\n let email = $(\"#manageremail\").val();\n\n\n if (emailPattern.test(email) == false) {\n errMsg[errMsg.length] = \"Valid email address is required\";\n }//ends if statement for email validation\n\n\n if ($(\"#maxteammembers\").val().trim() == \"\") {\n errMsg[errMsg.length] = \"Maximum # Team Members is required\";\n }\n\n \n if (errMsg.length == 0) {\n return true;\n }\n else {\n for (let i = 0; i < errMsg.length; i++) {\n $(\"<li>\" + errMsg[i] + \"</li>\").appendTo($(\"#errorMessages\"));\n }\n return false;\n }\n}//ends form validation function", "title": "" }, { "docid": "bf66fee9a9c2c36b8aa9c82a7d44ef4f", "score": "0.5908047", "text": "function validate() {\n \n firstname = document.getElementById(\"firstname\");\n lastname = document.getElementById(\"lastname\");\n clientemail = document.getElementById(\"clientemail\");\n message = document.getElementById(\"messagearea\");\n if (firstname.value == \"\" && lastname.value == \"\" && clientemail.value == \"\" && message.value == \"\") {\n for (var i = 0; i < 4; i++) {\n document.getElementsByClassName(\"fas\")[i].style.display = \"block\";\n }\n \n return false;\n }\n else if (firstname.value == \"\") {\n return setErrors(\"firstname\", \"Please enter your first name\", \"0\");\n }\n else if (firstname.value.length <= 3) {\n return setErrors(\"firstname\", \"First name should be greater than 3 characters\", \"0\");\n }\n else if (lastname.value == \"\") {\n return setErrors(\"lastname\", \"please enter your last name\", \"1\");\n }\n else if (lastname.value.length <= 3) {\n return setErrors(\"lastname\", \"Last name should be greater than 3 characters\", \"1\");\n }\n else if (clientemail.value == \"\") {\n return setErrors(\"clientemail\", \"please enter your email address\", \"2\");\n }\n else if (message.value == \"\") {\n return setErrors(\"messagearea\", \"please enter your message\", \"3\");\n }\n else if (message.value.length <= 10) {\n return setErrors(\"message\", \"Message should be 10 characters long\", \"4\");\n }\n else{\n return alert(\"Messeage sent successfully\");\n }\n}", "title": "" }, { "docid": "e5f0309bbded69ddc0980f3ee95facbf", "score": "0.58857363", "text": "function validateCreateAccount()\n{\n\tlet firstName = document.getElementById(\"cfirst_name\").value;\n\tlet lastName = document.getElementById(\"clast_name\").value;\n\tlet id = document.getElementById(\"cemployee_id\").value;\n\tlet role = document.getElementById(\"crole\").value;\n\tlet password = document.getElementById(\"cuser_password\").value;\n\n let error = false;\n\n\n\tdocument.getElementById(\"fname_error\").style.display = \"none\";\n\tdocument.getElementById(\"fname_alpha\").style.display = \"none\";\n\tdocument.getElementById(\"lname_alpha\").style.display = \"none\";\n\tdocument.getElementById(\"lname_error\").style.display = \"none\";\n\tdocument.getElementById(\"uid_error\").style.display = \"none\";\n\tdocument.getElementById(\"cid_error\").style.display = \"none\";\n\tdocument.getElementById(\"crole_error\").style.display = \"none\";\n\tdocument.getElementById(\"cpassword_error\").style.display = \"none\";\n\tif(firstName === \"\"){\n\t\tdocument.getElementById(\"fname_error\").style.display = \"\";\n\t\tdocument.getElementById(\"fname_error\").style.visibility = \"visible\";\n error = true;\n\t}\n else if(isOnlyAlphabetical(firstName)){\n\t\t\tdocument.getElementById(\"fname_alpha\").style.display = \"\";\n\t\t\tdocument.getElementById(\"fname_alpha\").style.visibility = \"visible\";\n error = true;\n\t}\n\tif (lastName === \"\"){\n\t\tdocument.getElementById(\"lname_error\").style.display = \"\";\n\t\tdocument.getElementById(\"lname_error\").style.visibility = \"visible\";\n error = true;\n\t}\n else if(isOnlyAlphabetical(lastName)){\n\t\tdocument.getElementById(\"lname_alpha\").style.display = \"\";\n\t\tdocument.getElementById(\"lname_alpha\").style.visibility = \"visible\";\n error = true;\n\t}\n\tif(!isNumeric(id)){\n\t\tdocument.getElementById(\"uid_error\").style.display = \"\";\n\t\tdocument.getElementById(\"uid_error\").style.visibility = \"visible\";\n error = true;\n\t}\n else if(!(id.length ==5)){\n\t\tdocument.getElementById(\"cid_error\").style.display = \"\";\n\t\tdocument.getElementById(\"cid_error\").style.visibility = \"visible\";\n error = true;\n\t}\t\t\n\tif(!(role === \"GM\" || role === \"CS\" || role === \"SM\")){\n\t\t\tdocument.getElementById(\"crole_error\").style.display = \"\";\n\t\t\tdocument.getElementById(\"crole_error\").style.visibility = \"visible\";\n error = true;\n\t}\n\tif(password === \"\"){\n\t\t\tdocument.getElementById(\"cpassword_error\").style.display = \"\";\n\t\t\tdocument.getElementById(\"cpassword_error\").style.visibility = \"visible\";\n error = true;\n\t}\n\tif (!error){\n\t\tpayload = {employee_id : id, user_password : password, first_name : firstName, last_name : lastName, role : role};\n\t\tpost(payload, 'create_click');\n\t}\n\t\n}", "title": "" }, { "docid": "a241029511b9365fee7f408286403dd3", "score": "0.5883855", "text": "function validateStumpCreate(){\r\n $(\"#errMsg\").empty();\r\n errMsg = \"\"\r\n if (stumpObject.creator == \"\"){\r\n errMsg = errMsg + \" Sign In to select stump user | \";\r\n createErr = true; \r\n };\r\n\r\n if(stumpObject.availability == \"\"){\r\n errMsg = errMsg + \" Select availability | \";\r\n createErr = true;\r\n };\r\n if(stumpObject.locationName == \"\"){\r\n errMsg = errMsg + \" Select a location | \";\r\n createErr = true;\r\n };\r\n }", "title": "" }, { "docid": "5b60bfc10b801067a7f53b34c17d86ce", "score": "0.58817273", "text": "reset_errors (state, payload) {\n state.errors = build_error_initials(ALLOWED_FIELDNAMES);\n\n for (let key in state.formset) {\n Vue.set(state.formset[key], \"errors\", {});\n }\n }", "title": "" }, { "docid": "e7e91e8e75703a005b9e523e1b0e4c02", "score": "0.58805984", "text": "function addUser(event) {\n event.preventDefault();\n\n // Super basic validation - increase errorCount variable if any fields are blank\n var errorCount = 0;\n $('#addUser input').each(function (index, val) {\n if ($(this).val() === '') {\n errorCount++;\n }\n });\n\n // Check and make sure errorCount's still at zero\n if (errorCount === 0) {\n\n // If it is, compile all user info into one object\n var newUser = {\n 'username': $('#addUser fieldset input#inputUserName').val(),\n 'email': $('#addUser fieldset input#inputUserEmail').val(),\n 'fullname': $('#addUser fieldset input#inputUserFullname').val(),\n 'age': parseInt($('#addUser fieldset input#inputUserAge').val(), 10),\n 'location': $('#addUser fieldset input#inputUserLocation').val(),\n 'gender': $('#addUser fieldset input#inputUserGender').val()\n }\n\n\n // Use AJAX to post the object to our adduser service\n $.ajax({\n type: 'POST',\n data: newUser,\n url: '/users/adduser',\n dataType: 'JSON'\n }).done(function (response) {\n\n // Check for successful (blank) response\n if (response.msg === '') {\n\n // Clear the form inputs\n $('#addUser fieldset input').val('');\n\n // Update the table\n populateTable();\n\n } else {\n\n // If something goes wrong, alert the error message that our service returned\n alert('Error: ' + response.msg);\n\n }\n });\n } else {\n // If errorCount is more than 0, error out\n alert('Please fill in all fields');\n return false;\n }\n}", "title": "" }, { "docid": "df896a258ab8698d3c253e1a4521a8f0", "score": "0.58690774", "text": "function registerUser() {\r\n\t \r\n\t var data = \"no_password_req=true\";\r\n\t var element = document.getElementById('EMAIL_1');\r\n\t if (element != null) {\r\n\t\t data += '&email=' + element.value;\r\n\t }\r\n\t \r\n\t var element = document.getElementById('NAME_1');\r\n\t if (element != null) {\r\n\t\t data += '&name=' + element.value;\r\n\t }\r\n\t \r\n\t var element = document.getElementById('FEEDBACK_1');\r\n\t if (element != null) {\r\n\t\t data += '&feedback=' + element.value;\r\n\t }\r\n\t \r\n\t var pElement = document.getElementById('ulMessage');\r\n\t var dvError = document.getElementById('dvError');\r\n\t var dvSuccess = document.getElementById('dvSuccess');\r\n\t if (dvError != null) {\r\n\t\t$(\"#dvError ul li\").remove();\r\n\t\tdvError.style.display = 'none';\r\n\t\tdvSuccess.style.display = 'none';\r\n\t }\r\n\t \r\n\t if (dvSuccess != null) {\r\n\t\tdvSuccess.style.display = 'none';\r\n\t }\r\n\t \r\n\t if (pElement != null) {\r\n\t\t pElement.innerHTML = '';\r\n\t }\r\n\t \r\n\t showOverlay({\r\n\t\t loading: true\r\n\t });\r\n\t \r\n\t $.ajax({\r\n\t url: \"/register\",\r\n\t method: \"POST\",\r\n\t headers: {'X-HTTP-RESULT': 'json'},\r\n\t data: data\r\n\t}).done(function(data) {\r\n\t\tif (data != null \r\n\t\t\t\t&& data.register != null \r\n\t\t\t\t&& data.register.model != null) {\r\n\t\t\tif (data.register.model.success) {\r\n\t\t\t\tif (dvSuccess != null) {\r\n\t\t\t\t\tdvSuccess.style.display = 'block';\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tvar liContent = \"<li><span>Error Messages</span></li>\";\r\n\t\t\t\tfor (var i = 0; i < data.register.error.validation_error.length; i++) {\r\n\t\t\t\t\tvar error = data.register.error.validation_error[i];\t\r\n\t\t\t\t\tliContent += \"<li><span class='ng-binding'>\" + error.message + \"</span></li>\"\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$(\"#ulError\").append(liContent);\r\n\t\t\t\tif (dvError != null) {\r\n\t\t\t\t\tdvError.style.display = 'block';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tvar liContent = \"<li><span>Error Messages</span></li><li><span class='ng-binding'>Sorry!!! We encountered an unknown error. Please try again</span></li>\";\t\t\r\n\t\t\t$(\"#ulError\").append(liContent);\r\n\t\t\tif (dvError != null) {\r\n\t\t\t\tdvError.style.display = 'block';\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\thideOverlay();\r\n\t});\r\n }", "title": "" }, { "docid": "7cc661f92d3ad022536fb3737910c8c2", "score": "0.5868114", "text": "function checkFormData() {\r\n checkEmail();\r\n //For loop to select form input one by one\r\n for (var i = 0; i < $(\".input-text\").length; i++) {\r\n // variable to hold input value in terms of i\r\n typedData = $(\".input-text\")[i].value;\r\n // variable to hold input ID in terms of i\r\n targetInput = $(\".input-text\")[i].id;\r\n // variable to hold warning text element in terms of i\r\n targetWarningMessage = $(\"p.warning-text\")[i].id;\r\n // set condition to check if form input value is empty\r\n if (typedData === \"\") {\r\n //adding custom error message below empty input field\r\n $(\"#\" + targetWarningMessage).text($(\".input-text\")[i].placeholder + \" cannot be empty\");\r\n //adding class to the empty input field in order to style it(check css file)\r\n $(\"#\" + targetInput).addClass(\"warning\").css({\r\n \"background-image\": \"url('images/icon-error.svg')\",\r\n \"background-repeat\": \"no-repeat\",\r\n \"background-position\": \"95% 50%\",\r\n });\r\n }\r\n // set condition to check if email value is valid (to show different error message)\r\n else if (typedData !== \"\" && i === 2) {\r\n //if email entered wasn't valid\r\n if (isValid === false) {\r\n $(\"#\" + targetWarningMessage).text(\"Looks like this is not an email\");\r\n $(\"input#email\").addClass(\"warning\");\r\n }\r\n //if email entered was valid\r\n else if (isValid === true) {\r\n $(\"#\" + targetWarningMessage).text(\"\");\r\n $(\"input#email\").removeClass(\"warning\");\r\n $(\".signup-form\").unbind('submit');\r\n }\r\n }\r\n // If input was filled then remove error message shown below it\r\n else if (typedData !== \"\") {\r\n $(\"#\" + targetWarningMessage).text(\"\");\r\n $(\"#\" + targetInput).removeClass(\"warning\").css({\r\n \"background-image\": \"\",\r\n \"background-repeat\": \"\",\r\n \"background-position\": \"\",\r\n });\r\n }\r\n // if input was filled & email is valid then remove error message and submit form\r\n else if (typedData !== \"\" && isValid === \"true\") {\r\n $(\"#\" + targetInput).css({\r\n \"background-image\": \"\",\r\n \"background-repeat\": \"\",\r\n \"background-position\": \"\",\r\n });\r\n //Allow form submission\r\n $(\".signup-form\").unbind('submit');\r\n }\r\n }\r\n}", "title": "" }, { "docid": "b42a360bb53dc7d5d39a7eaf379850d2", "score": "0.58636755", "text": "function validateForm() {\n //retrieving the values of form elements\n var name = document.UserDetailsForm.userName.value;\n var email = document.contactForm.email.value;\n var mobile = document.contactForm.mobile.value;\n var country = document.contactForm.country.value;\n var gender = document.contactForm.gender.value;\n\n //Verifying Error var with a default values\n var userNameErr = emailErr = mobileErr = countryErr = genderErr = true;\n\n //validate name\n if(name==\"\") {\n printError(\"userNameErr\",\"please enter your name\");\n } else {\n var regex = /^[a-zA-Z\\s]+$/;\n if(regex.test(name)==false) {\n printError(\"userNameErr\",\"please enter a valid name\");\n } else {\n printError(\"userNameErr\", \"\");\n userNameErr = false;\n }\n }\n\n //validate email\n if(email==\"\") {\n printError(\"userNameErr\",\"please enter your email\");\n } else {\n var regex = /^\\S+@\\S+\\.\\S+$/;\n if(regex.test(email)==false) {\n printError(\"userEmailErr\",\"please enter a valid email\");\n } else {\n printError(\"userEmailErr\", \"\");\n userEmailErr = false;\n }\n }\n\n //validate mobile\n if(mobile==\"\") {\n printError(\"userMobileErr\",\"please enter your mobile\");\n } else {\n var regex = /^[1-9]\\d{9}$/;\n if(regex.test(mobile)==false) {\n printError(\"userMobileErr\",\"please enter a valid mobile no\");\n } else {\n printError(\"userMobileErr\", \"\");\n userMobileErr = false;\n }\n }\n\n //validate country\n if(country==\"Select\") {\n printError(\"CountryErr\",\"please select your country\");\n } else {\n printError(\"countryErr\", \"\");\n countryErr = false;\n }\n }", "title": "" }, { "docid": "fb93635cd9f3214d0cd62d7ba77d9e8d", "score": "0.5855699", "text": "createForm() {\n this.userForm = this.fb.group({\n title: ['', this.validation.onlyRequired_validator],\n first_name: ['', this.validation.onlyRequired_validator],\n last_name: ['', this.validation.onlyRequired_validator],\n email: ['', this.validation.onlyRequired_validator],\n password: ['', this.validation.onlyRequired_validator],\n mobile: [''],\n // phone_no: [''],\n international_phone_no: [''],\n // username: [''],\n dob: ['', this.validation.onlyRequired_validator],\n country_code: ['', this.validation.onlyRequired_validator],\n // address: ['', this.validation.onlyRequired_validator],\n address: [''],\n company_name: ['', this.validation.onlyRequired_validator],\n social_security_no: ['', this.validation.onlyRequired_validator],\n // apartment:['', this.validation.onlyRequired_validator],\n gender: ['', this.validation.onlyRequired_validator],\n latitude: [''],\n longitude: [''],\n nick_name: ['',],\n // middle_name: ['', this.validation.onlyRequired_validator],\n country: ['', this.validation.onlyRequired_validator],\n city: ['', this.validation.onlyRequired_validator],\n state: ['', this.validation.onlyRequired_validator],\n zipCode: ['', this.validation.onlyRequired_validator],\n timezone: ['', this.validation.onlyRequired_validator],\n other_gender: [''],\n image: ['', this.validation.onlyRequired_validator],\n ssn: [''],\n ein: [''],\n });\n }", "title": "" }, { "docid": "53746598c135abc72bcab1f99d36e6d1", "score": "0.5806319", "text": "function validateForm(){\n //This will contain all of our data form\n const data = {}\n //This will contain all of our errors\n const validationErrors = {}\n \n //we have to put in the information for our data object\n data.fullName = document.querySelector('#full-name')\n data.email = document.querySelector('#email')\n data.betreff = document.querySelector('#betreff')\n data.textarea = document.querySelector('#textarea')\n\n // After we have our data, we can validate\n \n // First Name - check if there is a value\n if(!data.fullName.value){\n console.error('Kein Name')\n validationErrors.fullName = 'Kein Name vorhanden';\n }else{\n console.info('Name vorhanden')\n }\n \n // Betreff - check if there is a value\n if(!data.betreff.value){\n console.error('kein Betreff/Anfrage')\n validationErrors.betreff = 'Kein Betreff/Anfrage vorhanden';\n }else{\n console.info('Betreff/Anfrage vorhanden')\n }\n \n // Email - check if there is a value\n if(!data.email.value){\n console.error('Keine Email')\n validationErrors.email = 'Keine Email vorhanden';\n }else{\n console.info('Email present')\n //test if the email is useing regular expressions\n let emailRegExp = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$/; \n if(!emailRegExp.test(data.email.value)){\n //Error if its not matching\n validationErrors.email = 'Invalid email address'\n }\n }\n\n // Message - check if there is a value\n if(!data.textarea.textLength){\n console.error('Deine Nachricht ist zu kurz')\n validationErrors.textarea = 'Deine Nachricht ist zu kurz';\n }else{\n console.info('First Name present')\n }\n \n // We check if the errors object is empty\n if(Object.keys(validationErrors).length > 0 ){\n console.log( 'error' )\n displayErrors (validationErrors, data)\n }else{\n // otherwise we call our sendForm object, we only need to pass the data here\n console.log('no error')\n sendForm(data)\n }\n }", "title": "" }, { "docid": "27ee4ddc151f9b44d871e3dc05b44555", "score": "0.57956344", "text": "function validate(form){\r\n var flag = true;\r\n\r\n // Check if first name is entered and it matches correct formatting\r\n // Displays error message in span or clears span based on validation\r\n if (form.firstname.value == \"\") {\r\n $(\"#msgFirstName\").html(\" &nbsp;missing first name\");\r\n flag = false;\r\n } else {\r\n if (!verifyUsername(form.firstname.value)){\r\n $(\"#msgFirstName\").html(\" &nbsp;can only contains letters\");\r\n flag = false;\r\n } else {\r\n $(\"#msgFirstName\").html(\"\");\r\n }\r\n }\r\n\r\n // Check if last name is entered and it matches correct formatting\r\n // Displays error message in span or clears span based on validation\r\n if (form.lastname.value == \"\") {\r\n $(\"#msgLastName\").html(\" &nbsp;missing last name\");\r\n flag = false;\r\n } else {\r\n if (!verifyUsername(form.lastname.value)){\r\n $(\"#msgLastName\").html(\" &nbsp;can only contains letters\");\r\n flag = false;\r\n } else {\r\n $(\"#msgLastName\").html(\"\");\r\n }\r\n }\r\n\r\n // Check if userlogin is entered and matches correct formatting\r\n // Displays error message in span or clears span based on validation\r\n if (form.userlogin.value == \"\") {\r\n $(\"#msgLoginID\").html(\" &nbsp;missing user login\");\r\n flag = false;\r\n } else {\r\n if(!verifyLogin(form.userlogin.value)){\r\n $(\"#msgLoginID\").html(\" &nbsp;only letters or numbers allowed\");\r\n flag = false;\r\n } else {\r\n $(\"#msgLoginID\").html(\"\");\r\n }\r\n }\r\n\r\n // Check if password is entered and matches correct formatting\r\n // Displays error message in span or clears span based on validation\r\n if (form.password.value == \"\") {\r\n $(\"#msgPass\").html(\" &nbsp;missing password\");\r\n flag = false;\r\n } else {\r\n if(!verifyPassword(form.password.value)){\r\n $(\"#msgPass\").html(\" &nbsp;must contains at least 8 characters\");\r\n flag = false;\r\n } else {\r\n $(\"#msgPass\").html(\"\");\r\n }\r\n }\r\n\r\n // Check if useremail is entered and matches correct formatting\r\n // Displays error message in span or clears span based on validation\r\n if (form.useremail.value == \"\") {\r\n $(\"#msgEmail\").html(\" &nbsp;missing user email\");\r\n flag = false;\r\n } else {\r\n if (!verifyEmail(form.useremail.value)) {\r\n $(\"#msgEmail\").html(\" &nbsp;incorrect email format\");\r\n flag = false;\r\n } else {\r\n $(\"#msgEmail\").html(\"\");\r\n }\r\n }\r\n\r\n // Check if userbday is entered and matches correct formatting.\r\n // Displays error message in span or clears span based on validation\r\n if (form.userbdate.value == \"\") {\r\n $(\"#msgBdate\").html(\" &nbsp;missing user birth date\");\r\n flag = false;\r\n } else {\r\n if (!verifyDate(form.userbdate.value)) {\r\n $(\"#msgBdate\").html(\" &nbsp;incorrect birth date\");\r\n flag = false;\r\n } else {\r\n $(\"#msgBdate\").html(\"\");\r\n }\r\n }\r\n\r\n return flag;\r\n}", "title": "" }, { "docid": "70ada841d8f19e1ed6508d0fd3067238", "score": "0.5782289", "text": "function resetRegisterErrors() {\n name.style.borderColor = '#ced4da';\n email.style.borderColor = '#ced4da';\n password.style.borderColor = '#ced4da';\n errorField.innerHTML = '';\n}", "title": "" }, { "docid": "22a82a9d223cf02bcad3e1408948043d", "score": "0.5780879", "text": "function clearCreateForm() {\n form_create_user.find('input[name=\"userId\"]').val('');\n form_create_user.find('input[name=\"userName\"]').val('');\n form_create_user.find('input[name=\"userEmail\"]').val('');\n\n form_create_user.find('input').removeClass(\"help-block\");\n form_create_user.find('span.help-block').remove();\n }", "title": "" }, { "docid": "d723608e3589e70d957e2971cc245be4", "score": "0.57757354", "text": "function validateAddUser(){\r\n\tvar first_name = document.getElementById('first_name').value;\r\n\tvar middle_name = document.getElementById('middle_name').value;\r\n\tvar last_name = document.getElementById('last_name').value;\r\n\tvar count = document.getElementById('count').value;\r\n\tvar company = document.getElementById('company').value;\r\n\tvar privilege = document.getElementById('privilege').value;\r\n\tvar proceed = true;\r\n\t\r\n\tif(proceed==true){\r\n\t\tif(first_name==''){\r\n\t\t\talert('Key-in user\\'s FIRST NAME!');\r\n\t\t\tdocument.getElementById('first_name').focus();\r\n\t\t\tproceed = false;\r\n\t\t} else{\r\n\t\t\tif(!first_name.match(/^[a-zA-Z\\x20]{0,25}$/)){\r\n\t\t\t\talert('Invalid FIRST NAME input!');\r\n\t\t\t\tdocument.getElementById('first_name').focus();\r\n\t\t\t\tdocument.getElementById('first_name').select();\r\n\t\t\t\tproceed = false;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tif(proceed==true){\r\n\t\tif(!middle_name.match(/^[a-zA-Z\\x20]{0,25}$/)){\r\n\t\t\talert('Invalid MIDDLE NAME input!');\r\n\t\t\tdocument.getElementById('middle_name').focus();\r\n\t\t\tdocument.getElementById('middle_name').select();\r\n\t\t\tproceed = false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tif(proceed==true){\r\n\t\tif(last_name==''){\r\n\t\t\talert('Key-in user\\'s LAST NAME!');\r\n\t\t\tdocument.getElementById('last_name').focus();\r\n\t\t\tproceed = false;\r\n\t\t} else{\r\n\t\t\tif(!last_name.match(/^[a-zA-Z\\x20]{0,25}$/)){\r\n\t\t\t\talert('Invalid LAST NAME input!');\r\n\t\t\t\tdocument.getElementById('last_name').focus();\r\n\t\t\t\tdocument.getElementById('last_name').select();\r\n\t\t\t\tproceed = false;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tif(proceed==true){\r\n\t\tif(count!='' && !count.match(/^[0-9]{0,2}$/)){\r\n\t\t\talert('Invalid COUNT input!');\r\n\t\t\tdocument.getElementById('count').focus();\r\n\t\t\tdocument.getElementById('count').select();\r\n\t\t\tproceed = false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tif(proceed==true){\r\n\t\tif(company=='' || company==0){\r\n\t\t\talert('Select COMPANY!');\r\n\t\t\tdocument.getElementById('company').focus();\r\n\t\t\tproceed = false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tif(proceed==true){\r\n\t\tif(privilege=='' || privilege==0){\r\n\t\t\talert('Select user PRIVILEGE!');\r\n\t\t\tdocument.getElementById('privilege').focus();\r\n\t\t\tproceed = false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tif(proceed==true){\r\n\t\tdocument.add_user_form.submit();\r\n\t}\r\n}", "title": "" }, { "docid": "22a8888e0fce917e21364078b3a45f15", "score": "0.5750964", "text": "static createErrors({ message, errors }) {\n const fragment = document.createDocumentFragment();\n const subheading = ValidationSummary.createMessage({ message });\n const list = document.createElement('ul');\n\n // Mark up list\n list.classList.add('coop-c-message__list');\n\n // Add each error\n errors.forEach((item) => list\n .appendChild(ValidationSummary.createError(item)));\n\n // Add subheading, error list\n fragment.appendChild(subheading);\n fragment.appendChild(list);\n\n return fragment;\n }", "title": "" }, { "docid": "03fa07eb71a4481d2a7f9e206a8345a1", "score": "0.57470834", "text": "function createUserFailureHandler() {\n\n }", "title": "" }, { "docid": "70069c1a21057caf188511d906b5d3dc", "score": "0.57374936", "text": "function addEmployee() {\n var formErrors = false;\n var tempFName = $(\"#temp-fname\").val();\n var tempLName = $(\"#temp-lname\").val();\n var tempPhone = $(\"#temp-phone\").val();\n var tempEmail = $(\"#temp-email\").val();\n var tempPosition = $(\"#temp-position\").val();\n \n if(tempFName == '') {\n $('#temp-fname').css('border', '1px solid red');\n formErrors = true;\n } else {\n $('#temp-fname').css('border', '1px solid #CCCCCC');\n }\n if(tempLName == '') {\n $('#temp-lname').css('border', '1px solid red');\n formErrors = true;\n } else {\n $('#temp-lname').css('border', '1px solid #CCCCCC');\n }\n if(tempPhone == '') {\n $('#temp-phone').css('border', '1px solid red');\n formErrors = true;\n } else {\n $('#temp-phone').css('border', '1px solid #CCCCCC');\n }\n if(tempEmail == '') {\n $('#temp-email').css('border', '1px solid red');\n formErrors = true;\n } else {\n $('#temp-email').css('border', '1px solid #CCCCCC');\n }\n if(tempPosition == '') {\n $('#temp-position').css('border', '1px solid red');\n formErrors = true;\n } else {\n $('#temp-position').css('border', '1px solid #CCCCCC');\n }\n // If ALL fields are validated insert new user\n if(formErrors != true) {\n $.ajax({\n type: \"POST\",\n url: '../../index.php/tenement/add_employee',\n data: {tempFName: tempFName, tempLName: tempLName, tempPhone: tempPhone, tempEmail: tempEmail, tempPosition: tempPosition},\n success: function(data) {\n if(data == 1) {\n $('div#success-placeholder-emp').html('<div class=\"alert alert-success\"><button type=\"button\" data-dismiss=\"alert\" class=\"close\">×</button><strong>Employee Added! You can Continue Adding New Employees.</div>');\n setTimeout('delayedRedirect()', 2000);\n }\n }, \n error: function() {\n alert('System Error! Please try again.');\n },\n complete: function() {\n console.log('completed')\n }\n }); // ***END $.ajax call\n }\n \n} // ***END addEmployee() Method", "title": "" }, { "docid": "2be24a72380b4c350260d472917e9221", "score": "0.57294244", "text": "function displayFormErrors(form_data) {\n\t\t// Reset form errors\n\t\tresetFormErrors();\n\t\t// Check if there are any errors\n\t\tif (form_data.errors.length > 0) {\n\t\t\t// Loop through errors\n\t\t\tfor (var i = 0; i < form_data.errors.length; i++) {\n\t\t\t\t// Get error container\n\t\t\t\tvar error_container = $('.form_error_container[field=\"' + $(form_data.errors[i].input).attr('name') + '\"]');\n\t\t\t\t// Empty error container\n\t\t\t\terror_container.empty();\n\t\t\t\t// Add error message\n\t\t\t\t$(error_container).append('<p>' + form_data.errors[i].error_message + '</p>');\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "92325bef91070e39e782372276e653b6", "score": "0.57272106", "text": "function reportErrors(errors) {\r\n for (let error of errors) {\r\n message(error[0], error[1]);\r\n error[0].focus();\r\n }\r\n}", "title": "" }, { "docid": "2a0c634f7c484a685cbb55d843dbb37b", "score": "0.5721974", "text": "function validation_error(error_message) {\n contactEmailStatus(50);\n $('#emailStatus_' + index).html(error_message);\n }", "title": "" }, { "docid": "9a87fdb70ac668a70e812bc825696d35", "score": "0.5715403", "text": "function checkInputs() {\n // get input VALUES\n const nameValue = name.value.trim();\n const emailValue = email.value.trim();\n const messageValue = message.value.trim();\n\n // USERNAME CHECK\n\n if (nameValue === '' || nameValue === null) {\n // add error class (analogous to ToDo project)\n\n setErrorFor(name, 'Username cannot be blank');\n event.preventDefault();\n } else {\n setSuccessFor(name)\n }\n\n // EMAIL CHECK\n\n if (emailValue === '') {\n // add error class (analogous to ToDo project)\n\n setErrorFor(email, 'E-mail cannot be blank');\n event.preventDefault();\n } else if (!emailIsValid(emailValue)) {\n setErrorFor(email, 'E-mail is not valid.');\n event.preventDefault();\n } else {\n setSuccessFor(email);\n }\n\n // MESSAGE CHECK\n\n if (messageValue === '' || messageValue === null) {\n // add error class (analogous to ToDo project)\n\n setErrorFor(message, 'Please enter a message.');\n event.preventDefault();\n }\n else {\n setSuccessFor(message);\n }\n}", "title": "" }, { "docid": "1c356073ec159d63b1ff422671088833", "score": "0.57007825", "text": "function initErrors() {\n let errorMsg = document.querySelectorAll('.error-msg');\n let errorInput = document.querySelectorAll('.glow-error');\n errorMsg.forEach((err) => err.style.display = 'none');\n errorInput.forEach((err) => err.classList.remove('glow-error'));\n}", "title": "" }, { "docid": "425678376082f1ce615bd344de5501c3", "score": "0.56994516", "text": "function form_errors(haserror, form_id, description) {\n //console.log(form_id);\n var selobj = $(\"#\"+form_id+'>span.errors');\n if (typeof description == 'undefined') description = \"<b>Error:</b> please correct the inputs highlighted below.\";\n $(\"#\"+form_id+\" button[type='submit']\").removeAttr('disabled');\n $(\"#\"+form_id+\" input\").removeClass(\"error\");\n if (haserror) {\n //console.log(\"ERROR:\",description);\n selobj.addClass('alert alert-error');\n selobj.html(description);\n } else {\n selobj.removeClass('alert alert-error');\n selobj.html('');\n }\n}", "title": "" }, { "docid": "4e3e6a1414739cf7e5f9e3172031f24d", "score": "0.569663", "text": "function preCreated(response) {\n //set the form to $pristine, clear data, allow resubmission\n vm.formSubmitted = false; //allow form submit again\n vm.resetForm(); //reset data\n vm.managePreForm.$setPristine();\n if (response.infoMsg) {\n MessagesSvc.registerInfoMsg(response.infoMsg);\n }\n }", "title": "" }, { "docid": "53f8beb98cb96cd9825401d2ba799037", "score": "0.5694259", "text": "function clearErrors() {\n \n firstname = document.getElementById(\"firstname\");\n lastname = document.getElementById(\"lastname\");\n clientemail = document.getElementById(\"clientemail\");\n message = document.getElementById(\"messagearea\");\n if (firstname.value.length >= 3) {\n \n document.getElementsByClassName(\"error\")[0].innerHTML = \"\";\n document.getElementsByClassName(\"fas\")[0].style.display = \"none\";\n }\n if (lastname.value.length >= 3) {\n \n document.getElementsByClassName(\"error\")[1].innerHTML = \"\";\n document.getElementsByClassName(\"fas\")[1].style.display = \"none\";\n }\n if (clientemail.value.length >= 3) {\n \n document.getElementsByClassName(\"error\")[2].innerHTML = \"\";\n document.getElementsByClassName(\"fas\")[2].style.display = \"none\";\n }\n if (message.value.length >= 10) {\n \n document.getElementsByClassName(\"error\")[3].innerHTML = \"\";\n document.getElementsByClassName(\"fas\")[3].style.display = \"none\";\n }\n}", "title": "" }, { "docid": "75f40ae9a358d21ef1a0a217856fe58f", "score": "0.5691332", "text": "function errorsShow(response) {\n\t\t\t\tfor (var key in response.errors) {\n\t\t\t\t\tvar $element = $(form[key]);\n\t\t\t\t\tvar type = $element.attr('type');\n\t\t\t\t\tvar $holder;\n\t\t\t\t\t\n\t\t\t\t\tif (type === 'checkbox' || type === 'radio') {\n\t\t\t\t\t\t$holder = $element.closest('.choose');\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$holder = $element.closest('.field');\n\n\t\t\t\t\t\tif (!$holder.find('.form-msg.error').length) {\n\t\t\t\t\t\t\t$('<p class=\"form-msg error\">' + response.errors[key] + '</p>').insertAfter($holder);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!$holder.hasClass('error')) {\n\t\t\t\t\t\t$holder.addClass('error');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "96256adece9c131a9b78c3f5af891291", "score": "0.56802654", "text": "function hideInputError(errorsCreateValidate){\n errorsCreateValidate.forEach(function(res) {\n $(res.label).html('');\n $(res.group).removeClass('has-error');\n });\n}", "title": "" }, { "docid": "73091e7fdeb07721e32e8cb36747d305", "score": "0.5679522", "text": "static validateCheckIfUserExistFields(user) {\n console.log(user)\n\n if (user.username.trim() == \"\" || user.userId.toString().trim() == \"\") {\n let message = \"Username and User ID must be filled\";\n ErrorType.INVALID_INPUT_FIELD.message = message;\n throw new ServerError(ErrorType.INVALID_INPUT_FIELD);\n }\n\n if (!isRegexConditionValid(numsOnlyRegex, user.userId)) {\n let message = \"Please use only numbers for user ID\";\n ErrorType.INVALID_INPUT_FIELD.message = message;\n throw new ServerError(ErrorType.INVALID_INPUT_FIELD);\n }\n\n if (!isRegexConditionValid(emailRegex, user.username)) {\n let message = \"Please enter a valid email address\";\n ErrorType.INVALID_INPUT_FIELD.message = message;\n throw new ServerError(ErrorType.INVALID_INPUT_FIELD);\n }\n\n if (user.userId.toString().length > 9) {\n let message = \"ID number is too long\";\n ErrorType.INVALID_INPUT_FIELD.message = message;\n throw new ServerError(ErrorType.INVALID_INPUT_FIELD);\n }\n\n if (user.userId.toString().length < 8) {\n let message = \"ID number is too short\";\n ErrorType.INVALID_INPUT_FIELD.message = message;\n throw new ServerError(ErrorType.INVALID_INPUT_FIELD);\n }\n\n if (user.username.length > 44) {\n let message = \"Username is too long\";\n ErrorType.INVALID_INPUT_FIELD.message = message;\n throw new ServerError(ErrorType.INVALID_INPUT_FIELD);\n }\n\n if (user.username.length < 2) {\n let message = \"Username is too short\";\n ErrorType.INVALID_INPUT_FIELD.message = message;\n throw new ServerError(ErrorType.INVALID_INPUT_FIELD);\n }\n\n }", "title": "" }, { "docid": "669212bd6afc6fb75d88ef4d8b19d6dc", "score": "0.56689537", "text": "function showValidationMessages(form){\n form.newPass.$error.validationError = true\n form.confirmPass.$error.validationError = true\n\n form.newPass.$touched = true;\n form.confirmPass.$touched = true;\n\n form.newPass.$invalid = true;\n form.confirmPass.$invalid = true;\n form.$invalid = true;\n }", "title": "" }, { "docid": "0014820ca3df8ab689c32310a010b3d5", "score": "0.56681347", "text": "function validate() {\r\n \r\n // Get the input values\r\n var first = $('#first input').val();\r\n console.log(first);\r\n var last = $('#last input').val();\r\n var gender = $('#gender input').val();\r\n var age = $('#age input').val();\r\n var email = $('#email input').val();\r\n var password = $('#password input').val();\r\n \r\n \r\n // Clear any previous error reports\r\n $('.form-group').removeClass('has-error');\r\n $('.help-block').remove();\r\n // Report an empty password\r\n if (!first) {\r\n $('#first').append('<span class=\"help-block\">First name required</span>');\r\n $('#first').addClass('has-error');\r\n $('#first input').focus();\r\n return false;\r\n }\r\n \r\n // Report an empty last name\r\n if (!last) {\r\n $('#last').append('<span class=\"help-block\">Last name required</span>');\r\n $('#last').addClass('has-error');\r\n $('#last input').focus();\r\n return false;\r\n }\r\n // Report an email that can't be a SLU student email\r\n if (!email) {\r\n $('#email').append('<span class=\"help-block\">Email required</span>');\r\n $('#email').addClass('has-error');\r\n $('#email input').focus();\r\n return false;\r\n }\r\n \r\n // Report an empty password\r\n if (!password) {\r\n $('#password').append('<span class=\"help-block\">Password required</span>');\r\n $('#password').addClass('has-error');\r\n $('#password input').focus();\r\n return false;\r\n }\r\n \r\n \r\n \r\n // Report empty gender\r\n if (!gender) {\r\n $('#gender').append('<span class=\"help-block\">Gender required</span>');\r\n $('#gender').addClass('has-error');\r\n $('#gender input').focus();\r\n return false;\r\n }\r\n \r\n // Report an empty age\r\n if (!age) {\r\n $('#age').append('<span class=\"help-block\">Age required</span>');\r\n $('#age').addClass('has-error');\r\n $('#age input').focus();\r\n return false;\r\n }\r\n \r\n // No errors\r\n return true;\r\n }", "title": "" }, { "docid": "e8fa395c0fc894881fdef7aa3da53ad8", "score": "0.56645906", "text": "function initErrorMessages() {\n $scope.hideErrorMessage = true;\n $scope.errorMessage = \"\";\n $scope.modalHideErrorMessage = true;\n $scope.modalErrorMessage = \"\";\n }", "title": "" }, { "docid": "b30f20b30e181c1d5e0445cddea0cd6f", "score": "0.5660233", "text": "function validateFormEditUser()\n{\n\t\n\tvalidator = $(\"form#editRegister\")\n\t.validate(\n\t\t\t{\n\t\t\t\terrorClass : 'error',\n\t\t\t\tvalidClass : 'success',\n\t\t\t\terrorElement : 'span',\n\t\t\t\tafterReset : resetBorders ,\n\t\t\t\terrorPlacement : function(error, element) {\n\t\t\t\t\telement.parent(\"div\").prev(\"div\")\n\t\t\t\t\t\t\t.html(error);\n\t\t\t\t},\n\t\t\t\trules : {\n\t\t\t\t\tfirstName : {\n\t\t\t\t\t\trequired : true,\n\t\t\t\t\t\tregex : /^[a-zA-Z\\-]+$/\n\t\t\t\t\t},\n\t\t\t\t\tlastName : {\n\t\t\t\t\t\trequired : true,\n\t\t\t\t\t\tregex : /^[a-zA-Z\\-]+$/\n\t\t\t\t\t},\n\t\t\t\t\tnewPassword : {\n\t\t\t\t\t\trequired : function(element)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// if condition true and apply required validation for element\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($(\"input#oldPassword\" , \"form#editRegister\").val().length > 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn true ;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t} else if ($(\"input#confirmNewPassword\" , \"form#editRegister\").val().length > 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn true ;\n\t\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\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//\tHide error message for new password feild and confirm password feild \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$('span.help-inline' , $(\"[name=newPassword]\")\n\t\t\t\t\t\t\t\t\t\t.parents('div.mainpage-content-right') ).hide();\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$('span.help-inline' , $(\"[name=confirmNewPassword]\")\n\t\t\t\t\t\t\t\t\t\t.parents('div.mainpage-content-right') ).hide();\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$(\"input#newPassword\" , \"form#editRegister\")\n\t\t\t\t\t\t\t\t.parents(\"div.mainpage-content-line\")\n\t\t\t\t\t\t\t\t.find(\".error,.success\")\n\t\t\t\t\t\t\t\t.removeClass(\"error success\");\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$(\"input#confirmNewPassword\" , \"form#editRegister\")\n\t\t\t\t\t\t\t\t\t.parents(\"div.mainpage-content-line\")\n\t\t\t\t\t\t\t\t\t.find(\".error,.success\")\n\t\t\t\t\t\t\t\t\t.removeClass(\"error success\");\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// check if element not filled , then hide validation message for old password feild\n\t\t\t\t\t\t\t\t if ( $(element).val().length == 0 ) \n\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\t$('span.help-inline' , $(\"[name=oldPassword]\")\n\t\t\t\t\t\t\t\t\t\t\t.parents('div.mainpage-content-right') ).hide();\n\t\t\n\t\t\t\t\t\t\t\t\t\t$(\"input#oldPassword\" , \"form#editRegister\")\n\t\t\t\t\t\t\t\t\t\t.parents(\"div.mainpage-content-line\")\n\t\t\t\t\t\t\t\t\t\t.find(\".error,.success\")\n\t\t\t\t\t\t\t\t\t\t.removeClass(\"error success\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\n\n\t\t\t\t\t\t\t\treturn false ;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tminlength : 8,\n\t\t\t\t\t\tmaxlength:20\n\t\t\t\t\t},\n\t\t\t\t\tconfirmNewPassword : {\n\t\t\t\t\t\trequired: function(element)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// if condition true and apply required validation for element\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($(\"input#oldPassword\" , \"form#editRegister\").val().length > 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn true ;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t} else if ($(\"input#newPassword\" , \"form#editRegister\").val().length > 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn true ;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t//\thide error message for confirm password feild\n\t\t\t\t\t\t\t\t$('span.help-inline' , $(\"[name=confirmNewPassword]\")\n\t\t\t\t\t\t\t\t\t\t.parents('div.mainpage-content-right') ).hide();\n\t\t\t\t\t\t\t\t$(\"input#confirmNewPassword\" , \"form#editRegister\")\n\t\t\t\t\t\t\t\t.parents(\"div.mainpage-content-line\")\n\t\t\t\t\t\t\t\t.find(\".error,.success\")\n\t\t\t\t\t\t\t\t.removeClass(\"error success\");\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/**\n\t\t\t\t\t\t\t\t * check if element not filled , then hide validation message for old password feild\n\t\t\t\t\t\t\t\t * as well as new password feild\n\t\t\t\t\t\t\t\t */\n \n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t if ( $(element).val().length == 0) \n\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\t$('span.help-inline' , $(\"[name=newPassword]\")\n\t\t\t\t\t\t\t\t\t\t\t\t.parents('div.mainpage-content-right') ).hide();\n\n\t\t\t\t\t\t\t\t\t\t$('span.help-inline' , $(\"[name=oldPassword]\")\n\t\t\t\t\t\t\t\t\t\t\t\t.parents('div.mainpage-content-right') ).hide();\n\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$(\"input#newPassword\" , \"form#editRegister\")\n\t\t\t\t\t\t\t\t\t\t.parents(\"div.mainpage-content-line\")\n\t\t\t\t\t\t\t\t\t\t.find(\".error,.success\")\n\t\t\t\t\t\t\t\t\t\t.removeClass(\"error success\");\n\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 $(\"input#oldPassword\" , \"form#editRegister\")\n\t\t\t\t\t\t\t\t\t\t .parents(\"div.mainpage-content-line\")\n\t\t\t\t\t\t\t\t\t\t .find(\".error,.success\")\n\t\t\t\t\t\t\t\t\t\t .removeClass(\"error success\");\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\treturn false ;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tequalTo :\t\"#newPassword\",\n\t\t\t\t\t\tminlength : 8,\n\t\t\t\t\t\tmaxlength:20\n\t\t\t\t\t},\n\t\t\t\t\toldPassword : {\n\t\t\t\t\t\trequired: function(element)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// if condition true and apply required validation for element\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($(\"input#newPassword\" , \"form#editRegister\").val().length > 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn true ;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t} else if ($(\"input#confirmNewPassword\" , \"form#editRegister\").val().length > 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn true ;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t} else {\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 * Hide validation message for old password feild , new password feild\n\t\t\t\t\t\t\t\t * and old password feild\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$('span.help-inline' , $(\"[name=oldPassword]\")\n\t\t\t\t\t\t\t\t\t\t.parents('div.mainpage-content-right') ).hide();\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$('span.help-inline' , $(\"[name=newPassword]\")\n\t\t\t\t\t\t\t\t\t\t.parents('div.mainpage-content-right') ).hide();\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$('span.help-inline' , $(\"[name=confirmNewPassword]\")\n\t\t\t\t\t\t\t\t\t\t.parents('div.mainpage-content-right') ).hide();\n\n\n\t\t\t\t\t\t\t\t$(\"input#oldPassword\" , \"form#editRegister\")\n\t\t\t\t\t\t\t\t.parents(\"div.mainpage-content-line\")\n\t\t\t\t\t\t\t\t.find(\".error,.success\")\n\t\t\t\t\t\t\t\t.removeClass(\"error success\");\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$(\"input#newPassword\" , \"form#editRegister\")\n\t\t\t\t\t\t\t\t\t.parents(\"div.mainpage-content-line\")\n\t\t\t\t\t\t\t\t\t.find(\".error,.success\")\n\t\t\t\t\t\t\t\t\t.removeClass(\"error success\");\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$(\"input#confirmNewPassword\" , \"form#editRegister\")\n\t\t\t\t\t\t\t\t\t.parents(\"div.mainpage-content-line\")\n\t\t\t\t\t\t\t\t\t.find(\".error,.success\")\n\t\t\t\t\t\t\t\t\t.removeClass(\"error success\");\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\treturn false ;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tminlength : 8,\n\t\t\t\t\t\tmaxlength:20,\n\t\t\t\t\t\tremote : {\n\t\t\t\t\t\t\turl: HOST_PATH + \"admin/user/validatepassword\",\n\t\t\t\t \ttype: \"post\" ,\n\t\t\t\t \tdata : { id : $(\"input#id\" , \"form#editRegister\").val() } ,\n\t\t\t\t \tasync: false,\n\t\t\t\t \tbeforeSend : function ( xhr ) {\n\t\t\t\t \t \n\t\t\t\t \t\t$('span[for=oldPassword]').html(__('please wait..')).addClass('validating').show()\n\t\t\t\t \t\t.parent('div').attr('class' , 'mainpage-content-right-inner-right-other focus') ;\n\t\t\t\t \t },\n\t\t\t\t \tcomplete : function(e) {\n\t\t\t\t \t\t\n\t\t\t \t\t\t$('span.help-inline' , $(\"[name=oldPassword]\").parents('div.mainpage-content-right') ).removeClass('validating') ;\n\t\t\t\t \t\t\n\t\t\t\t \t\tif(e.responseText == \"true\")\n\t\t\t\t \t\t{\n\t\t\t\t \t\t\t$(\"[name=oldPassword]\").parent('div').prev(\"div\").removeClass('focus')\n\t\t\t\t \t\t\t.removeClass('error').addClass('success');\n\t\t\t\t \t\t\t\n\t\t\t\t \t\t\t$('span.help-inline' , $(\"[name=oldPassword]\").parents('div.mainpage-content-right') )\n\t\t\t\t \t\t\t\t.html(validRules['oldPassword'])\n\t\t\t\t \t\t\t\t.attr('remote-validated' , true);\n\t\t\t\t \t\t} else\n\t\t\t\t \t\t{\n\t\t\t\t \t\t\t$('span.help-inline' , $(\"[name=oldPassword]\").parents('div.mainpage-content-right') )\n\t\t\t \t\t\t\t.attr('remote-validated' , false);\n\t\t\t\t \t\t\t\n\t\t\t\t \t\t\t\n\t\t\t\t \t\t\t\n\t\t\t\t \t\t}\n\t\t\t\t \t}\n\t\t\t\t\t\t},\t\t\t\t\t\t\n\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tmessages : {\n\t\t\t\t\temail : {\n\t\t\t\t\t\trequired : __(\"Please enter your email address\"),\n\t\t\t\t\t\temail : __(\"Please enter valid email address\")\n\t\t\t\t\t},\n\t\t\t\t\tfirstName : {\n\t\t\t\t\t\trequired : __(\"Please enter your first name\"),\n\t\t\t\t\t\tregex : __(\"First Name should be Alphabets\")\n\n\t\t\t\t\t},\n\t\t\t\t\tlastName : {\n\t\t\t\t\t\trequired : __(\"Please enter your last name\"),\n\t\t\t\t\t\tregex : __(\"Last Name should be Alphabets\")\n\t\t\t\t\t},\n\t\t\t\t\toldPassword : {\n\t\t\t\t\t\trequired : __(\"Please enter your old password\"),\n\t\t\t\t\t\tminlength : __(\"It should be minimum 8 characters\"),\n\t\t\t\t\t\tremote : __(\"Old password don't matched\"),\n\t\t\t\t\t\tmaxlength : __(\"Please enter maximum 20 characters\")\n\t\t\t\t\t},\n\t\t\t\t\tnewPassword : {\n\t\t\t\t\t\trequired : __(\"Please enter your new password\"),\n\t\t\t\t\t\tminlength : __(\"Please enter minimum 8 characters\"),\n\t\t\t\t\t\tmaxlength : __(\"Please enter maximum 20 characters\")\n\t\t\t\t\t},\n\t\t\t\t\tconfirmNewPassword : {\n\t\t\t\t\t\tequalTo : __(\"Please enter same as new password\"),\n\t\t\t\t\t\tminlength : __(\"Please enter minimum 8 characters\"),\n\t\t\t\t\t\trequired : __(\"Please re-type your new password\"),\n\t\t\t\t\t\tmaxlength : __(\"Please enter maximum 20 characters\")\n\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t},\n\n\t\t\t\tonfocusin : function(element) {\n\t\t\t\t\tif (!$(element).parent('div').prev(\"div\")\n\t\t\t\t\t\t\t.hasClass('success')) {\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 var label = this.errorsFor(element);\n\t\t\t \t\t if( $( label).attr('hasError') )\n\t\t\t \t {\n\t\t\t \t\t\t if($( label).attr('remote-validated') != \"true\")\n\t\t\t \t\t\t \t{\n\t\t\t\t\t\t\t\t\tthis.showLabel(element, focusRules[element.name]);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$(element).parent('div').removeClass(\n\t\t\t\t\t\t\t\t\t\t\t\t\tthis.settings.errorClass)\n\t\t\t\t\t\t\t\t\t\t\t.removeClass(\n\t\t\t\t\t\t\t\t\t\t\t\t\tthis.settings.validClass)\n\t\t\t\t\t\t\t\t\t\t\t.prev(\"div\")\n\t\t\t\t\t\t\t\t\t\t\t.addClass('focus')\n\t\t\t\t\t\t\t\t\t\t\t.removeClass(\n\t\t\t\t\t\t\t\t\t\t\t\t\tthis.settings.errorClass)\n\t\t\t\t\t\t\t\t\t\t\t.removeClass(\n\t\t\t\t\t\t\t\t\t\t\t\t\tthis.settings.validClass);\n\t\t\t \t\t\t \t}\n\t\t\t \t\t\t \n\t\t\t \t } else {\n\t\t\t \t \tthis.showLabel(element, focusRules[element.name]);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$(element).parent('div').removeClass(\n\t\t\t\t\t\t\t\t\t\t\tthis.settings.errorClass)\n\t\t\t\t\t\t\t\t\t.removeClass(\n\t\t\t\t\t\t\t\t\t\t\tthis.settings.validClass)\n\t\t\t\t\t\t\t\t\t.prev(\"div\")\n\t\t\t\t\t\t\t\t\t.addClass('focus')\n\t\t\t\t\t\t\t\t\t.removeClass(\n\t\t\t\t\t\t\t\t\t\t\tthis.settings.errorClass)\n\t\t\t\t\t\t\t\t\t.removeClass(\n\t\t\t\t\t\t\t\t\t\t\tthis.settings.validClass);\n\t\t\t \t }\n\t\t\t\t\t}\n\t\t\t\t},\n\n\t\t\t\thighlight : function(element,\n\t\t\t\t\t\terrorClass, validClass) {\n\n\t\t\t\t\t$(element).parent('div')\n\t\t\t\t\t\t\t.removeClass(validClass)\n\t\t\t\t\t\t\t.addClass(errorClass).prev(\n\t\t\t\t\t\t\t\t\t\"div\").removeClass(\n\t\t\t\t\t\t\t\t\tvalidClass)\n\t\t\t\t\t\t\t.addClass(errorClass);\n\n\t\t\t\t},\n\t\t\t\tunhighlight : function(element,\n\t\t\t\t\t\terrorClass, validClass) {\n\t\t\t\t\t\n\t\t\t\t\tif(! $(element).hasClass(\"passwordField\"))\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$(element).parent('div')\n\t\t\t\t\t\t\t\t.removeClass(errorClass)\n\t\t\t\t\t\t\t\t.addClass(validClass).prev(\n\t\t\t\t\t\t\t\t\t\t\"div\").addClass(\n\t\t\t\t\t\t\t\t\t\tvalidClass)\n\t\t\t\t\t\t\t\t.removeClass(errorClass);\n\t\n\t\t\t\t\t\t$(\n\t\t\t\t\t\t\t\t'span.help-inline',\n\t\t\t\t\t\t\t\t$(element).parent('div')\n\t\t\t\t\t\t\t\t\t\t.prev('div')).text(\n\t\t\t\t\t\t\t\tvalidRules[element.name]);\n\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tsuccess: function(label , element) {\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$(element).parent('div')\n\t\t\t\t\t.removeClass(this.errorClass)\n\t\t\t\t\t.addClass(this.validClass).prev(\n\t\t\t\t\t\t\t\"div\").addClass(\n\t\t\t\t\t\t\t\t\tthis.validClass)\n\t\t\t\t\t.removeClass(this.errorClass);\n\t\t\t\t\t\n\t\t\t\t $(label).append( validRules[element.name] ) ;\n\t\t\t\t label.addClass('valid') ;\n\t\t\t\t }\n\t\t\t});\n\n}", "title": "" }, { "docid": "fd2064a64114fae9c58aba17cecc8091", "score": "0.5650518", "text": "validate() {\n //this.formEl is a reference in the component to the form DOM element.\n const formEl = document.user_form;\n const formLength = formEl.length;\n\n /*\n * The checkValidity() method on a form runs the \n * html5 form validation of its elements and returns the result as a boolean.\n * It returns 'false' if at least one of the form elements does not qualify,\n * and 'true', if all form elements are filled with valid values.\n */\n if (formEl.checkValidity() === false) {\n for (let i = 0; i < formLength; i++) {\n //the i-th child of the form corresponds to the forms i-th input element\n const elem = formEl[i];\n /*\n * errorLabel placed next to an element is the container we want to use \n * for validation error message for that element\n */\n const errorLabel = elem.parentNode.querySelector(\".invalid-feedback\");\n\n /*\n * A form element contains also any buttuns contained in the form.\n * There is no need to validate a button, so, we'll skip that nodes.\n */\n if (errorLabel && elem.nodeName.toLowerCase() !== \"button\") {\n /*\n * Each note in html5 form has a validity property. \n * It contains the validation state of that element.\n * The elem.validity.valid property indicates whether the element qualifies its validation rules or no.\n * If it does not qualify, the elem.validationMessage property will contain the localized validation error message.\n * We will show that message in our error container if the element is invalid, and clear the previous message, if it is valid.\n */\n if (!elem.validity.valid) {\n console.log(elem,elem.name,elem.validationMessage);\n errorLabel.textContent = elem.validationMessage;\n } else {\n errorLabel.textContent = \"\";\n }\n }\n }\n\n //Return 'false', as the formEl.checkValidity() method said there are some invalid form inputs.\n return false;\n } else {\n //The form is valid, so we clear all the error messages\n for (let i = 0; i < formLength; i++) {\n const elem = formEl[i];\n const errorLabel = elem.parentNode.querySelector(\".invalid-feedback\");\n if (errorLabel && elem.nodeName.toLowerCase() !== \"button\") {\n errorLabel.textContent = \"\";\n }\n }\n\n //Return 'true', as the form is valid for submission\n return true;\n }\n }", "title": "" }, { "docid": "d253b8fe440b4380945a27f18ade0e23", "score": "0.5650068", "text": "createErrorMessage (errors) {\n if (!errors || !errors.length) return;\n return `${errors.length} error(s) occurred: \\n${errors.map((err) => err.error.toString()).join('\\n')}`;\n }", "title": "" }, { "docid": "df42cdb95cdc04018dba06d898e731d4", "score": "0.56464875", "text": "function insertMessage() {\n\n if (ans.result == false) {\n //ans.error\n var msg = $(\"<div>\" + ans.error + \"</div>\");\n form.before(msg).show();\n\n if (ans.result == true) {\n // ans.login\n var msg = $(\"<div>\" + ans.login + \"</div>\");\n form.before(msg).show();\n }\n }\n\n }", "title": "" }, { "docid": "00488a11b814a4fc54f59973b613ac24", "score": "0.5641861", "text": "function populateError(message) {\n $('.error-box p').text(message);\n $('.error-box').slideDown('slow');\n }", "title": "" }, { "docid": "e252b4730d65192bd8b773cd090aebd6", "score": "0.5637961", "text": "function newUser(req, res){\n\t\tvar body = req.body;\n\t\tvar ip = req.headers['x-forwarded-for'];\n\t\t//check for blank fields\n\t\tfor ( i in body ){\n\t\t\t\tvar blankFields = '';\n\t\t\t\tif (body[i] == '') blankFields += `${i} is blank. `; \n\t\t\t\tif (blankFields != '') { \n\t\t\t\t\t\tconsole.log(`${blue}invalid newUser from ${inverse + ip + reset + blue} reason:${reset} blank fields`);\n\t\t\t\t\t\tres.send({redirect: false, result: blankFields}); res.end(); return; \n\t\t\t\t}\n\t\t}\n\n\t\tif(isBad(body.userName) || isBad(body.password) || isBad(body.firstName) || isBad(body.lastName)){\n\t\t\t\tconsole.log(`${yellow}invalid newUser from ${inverse + ip + reset + yellow} reason:${reset} regex failed`);\n\t\t\t\tres.send({redirect: false, result: 'Name fields can only contain [A-Z a-z . - _], and cannot contain 0x anywhere in them'});\n\t\t\t\tres.end();\n\t\t} else if(body.firstName.length < 3 || body.firstName.length > 255 || /[^A-Za-z]/g.test(body.firstName)){\n\t\t\t\tconsole.log(`${blue}invalid newUser from ${inverse + ip + reset + blue} reason:${reset} first name invalid`);\n\t\t\t\tres.send({redirect: false, result: 'First name must be between 3-255 characters and contain only [A-Z a-z]'});\n\t\t\t\tres.end();\n\t\t} else if(body.lastName.length < 3 || body.lastName.length > 255 || /[^A-Za-z]/g.test(body.lastName)){\n\t\t\t\tconsole.log(`${blue}invalid newUser from ${inverse + ip + reset + blue} reason:${reset} last name invalid`);\n\t\t\t\tres.send({redirect: false, result: 'Last name must be between 3-255 characters and contain only [A-Z a-z]'});\n\t\t\t\tres.end();\n\t\t} else if(body.userName.length < 3 || body.userName.length > 16 || !/[A-Za-z]/g.test(body.userName)){\n\t\t\t\tconsole.log(`${blue}invalid newUser from ${inverse + ip + reset + blue} reason:${reset} user name invalid`);\n\t\t\t\tres.send({redirect: false, result: 'User names must be 3-16 characters and include at least 1 letter'});\n\t\t\t\tres.end();\n\t\t} else if(body.password.length != 128){\n\t\t\t\tconsole.log(`${yellow}invalid newUser from ${inverse + ip + reset + yellow} reason:${reset} password incorect length`);\n\t\t\t\tres.send({redirect: false, result: 'OI, do not bypass the hashing function it is for your own good'});\n\t\t\t\tres.end();\n\t\t} else{\n\t\t\t\tvar sql = `SELECT * FROM users WHERE userName='${body.userName}'`;\n\t\t\t\tpool.query(sql, function(err, result){\n\t\t\t\t\t\tif(result.length > 0) {\n\t\t\t\t\t\t\t\tconsole.log(`${blue}invalid newUser from ${inverse + ip + reset + blue} reason:${reset} user name taken`);\n\t\t\t\t\t\t\t\tres.send({redirect: false, result: 'User name is already taken'});\n\t\t\t\t\t\t\t\tres.end();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tvar sqlNew = 'INSERT INTO users (firstName, lastName, userName, salt, password)'; \n\t\t\t\t\t\t\t\tsqlNew += `VALUES ('${body.firstName}', '${body.lastName}', '${body.userName}', 'salt', '${body.password}')`;\n\t\t\t\t\t\t\t\tpool.query(sqlNew, function(err, result){\n\t\t\t\t\t\t\t\t\t\tconsole.log(`${green}successful newUser from ${inverse + ip + reset + green} on user ${underline + body.userName + reset}`);\n\t\t\t\t\t\t\t\t\t\treq.session.user = body.userName;\n\t\t\t\t\t\t\t\t\t\tres.send({redirect: true, result: 'newUser successful'});\n\t\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}\n\t\t\t\t});\n\t\t}\n}", "title": "" }, { "docid": "a4dfc1a59c5469bcbb45628b1df8ef66", "score": "0.5634238", "text": "setErrors(errors = []) {\n this.reset();\n\n const { heading, message, container: { id } } = this;\n\n this.container.appendChild(ValidationSummary.createHeading({ heading, id: `${id}-heading` }));\n this.container.appendChild(ValidationSummary.createErrors({ errors, message }));\n\n // Enable container\n this.enable();\n }", "title": "" }, { "docid": "cb6d011f73fdd8025e934493e15b9c45", "score": "0.56276923", "text": "function formErrors() {\n return (username_error || first_error || last_error || email_error \n || password_error || cpassword_error || code_error);\n }", "title": "" }, { "docid": "6d68541322bf1f3294b75ad69e69b5ef", "score": "0.5621039", "text": "function handleValidationError(err,body){\r\nfor(field in err.errors){\r\n switch(err.errors[field].path){\r\n //each field in admins form check\r\n case \"fullname\":\r\n body['fullNameError']=err.errors[field].message;\r\n break;\r\n case \"email\":\r\n body['emailError']=err.errors[field].message;\r\n break;\r\n case \"mobile\":\r\n body['mobileError']=err.errors[field].message;\r\n break;\r\n case \"password\":\r\n body['passwordError']=err.errors[field].message;\r\n break;\r\n default:\r\n break;\r\n }\r\n}\r\n}", "title": "" }, { "docid": "4136c7f606b7fb7e3487e80e70fc554e", "score": "0.56195116", "text": "function setInvalidFields (form, errors) {\n\t\t\t\n\t\t\tfor(var i = 0; i < errors.length; i++) {\n\t\t\t\t\n\t\t\t\tfor(var j = 0; j < errors[i].failed.length; j++) {\n\t\t\t\t\t\n\t\t\t\t\tform[errors[i].name].$setValidity(errors[i].failed[j], false);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\n\t\t}", "title": "" }, { "docid": "9913937fb4e958e579bce9566a71fad4", "score": "0.5617869", "text": "function validateForm() {\n var isValidate = true, isValidateFirstName = true, isValidateLastName = true;\n var isValidatePassword = true, isValidateConfirmPassword = true, isValidatePhone = true;\n var isValidateAvatar = true, isValidateEmail = true, isValidateAddress = true;\n //kiem tra firstName\n var txtFirstName = document.forms['register-form']['firstName'];\n var msgFirstName = document.querySelector(\"[class*='msgFirstName']\");\n if (txtFirstName.value == null || txtFirstName.value.length == 0) {\n msgFirstName.classList.remove('msg-success');\n msgFirstName.classList.add('msg-error');\n msgFirstName.innerHTML = 'Không được để trống mục này!';\n isValidateFirstName = false;\n } else {\n msgFirstName.classList.remove('msg-error');\n msgFirstName.classList.add('msg-success');\n msgFirstName.innerHTML = 'Hợp lệ.';\n isValidateFirstName = true;\n }\n //kiem tra lastName\n var txtLastName = document.forms['register-form']['lastName'];\n var msgLastName = document.querySelector(\"[class*='msgLastName']\");\n if (txtLastName.value == null || txtLastName.value.length == 0) {\n msgLastName.classList.remove('msg-success');\n msgLastName.classList.add('msg-error');\n msgLastName.innerHTML = 'Không được để trống mục này!';\n isValidateLastName = false;\n } else {\n msgLastName.classList.remove('msg-error');\n msgLastName.classList.add('msg-success');\n msgLastName.innerHTML = 'Hợp lệ.';\n isValidateLastName = true;\n }\n //Kiem tra password\n var pwdPassword = document.forms['register-form']['password'];\n var msgPassword = document.querySelector(\"[class*='msgPassword']\");\n if (pwdPassword.value == null || pwdPassword.value.length == 0) {\n msgPassword.classList.remove('msg-success');\n msgPassword.classList.add('msg-error');\n msgPassword.innerHTML = 'Không được để trống mục này!';\n isValidatePassword = false;\n } else if (pwdPassword.value.length < 5) {\n msgPassword.classList.add('msg-err');\n msgPassword.classList.remove('msg-success');\n msgPassword.innerHTML = 'Mật khẩu phải dài hơn 5 kí tự';\n isValidatePassword = false;\n } else {\n msgPassword.classList.remove('msg-error');\n msgPassword.classList.add('msg-success');\n msgPassword.innerHTML = 'Hợp lệ.';\n isValidatePassword = true;\n }\n //Kiem tra confirmPassword\n var pwdConfirmPassword = document.forms['register-form']['confirmPassword'];\n var msgConfirmPassword = document.querySelector(\"[class*='msgConfirmPassword']\");\n if (pwdConfirmPassword.value == null || pwdConfirmPassword.value.length == 0 || pwdConfirmPassword.value != pwdPassword.value) {\n msgConfirmPassword.classList.remove('msg-success');\n msgConfirmPassword.classList.add('msg-error');\n msgConfirmPassword.innerHTML = 'Xác nhận mật khẩu không đúng!';\n isValidateConfirmPassword = false;\n } else {\n msgConfirmPassword.classList.remove('msg-error');\n msgConfirmPassword.classList.add('msg-success');\n msgConfirmPassword.innerHTML = 'Hợp lệ.';\n isValidateConfirmPassword = true;\n }\n //Kiem tra address\n var txtAddress = document.forms['register-form']['address'];\n var msgAddress = document.querySelector(\"[class*='msgAddress']\");\n if (txtAddress.value == null || txtAddress.value.length == 0) {\n msgAddress.classList.remove('msg-success');\n msgAddress.classList.add('msg-error');\n msgAddress.innerHTML = 'Không được để trống mục này!';\n isValidateAddress = false;\n } else {\n msgAddress.classList.remove('msg-error');\n msgAddress.classList.add('msg-success');\n msgAddress.innerHTML = 'Hợp lệ.';\n isValidateAddress = true;\n }\n\n //Kiem tra phone\n var txtPhone = document.forms['register-form']['phone'];\n var msgPhone = document.querySelector(\"[class*='msgPhone']\");\n if (txtPhone.value == null || txtPhone.value.length == 0) {\n msgPhone.classList.remove('msg-success');\n msgPhone.classList.add('msg-error');\n msgPhone.innerHTML = 'Không được để trống mục này!';\n isValidatePhone = false;\n } else {\n msgPhone.classList.remove('msg-error');\n msgPhone.classList.add('msg-success');\n msgPhone.innerHTML = 'Hợp lệ.';\n isValidatePhone = true;\n }\n //Kiem tra avatar\n var txtAvatar = document.forms['register-form']['avatar'];\n var msgAvatar = document.querySelector(\"[class*='msgAvatar']\");\n if (txtAvatar.value == null || txtAvatar.value.length == 0) {\n msgAvatar.classList.remove('msg-success');\n msgAvatar.classList.add('msg-error');\n msgAvatar.innerHTML = 'Không được để trống mục này!';\n isValidateAvatar = false;\n } else {\n msgAvatar.classList.remove('msg-error');\n msgAvatar.classList.add('msg-success');\n msgAvatar.innerHTML = 'Hợp lệ.';\n isValidateAvatar = true;\n }\n //Kiem tra email\n var txtEmail = document.forms['register-form']['email'];\n var msgEmail = document.querySelector(\"[class*='msgEmail']\");\n if (txtEmail.value == null || txtEmail.value.length == 0) {\n msgEmail.classList.remove('msg-success');\n msgEmail.classList.add('msg-error');\n msgEmail.innerHTML = 'Không được để trống mục này!';\n isValidateEmail = false;\n } else {\n msgEmail.classList.remove('msg-error');\n msgEmail.classList.add('msg-success');\n msgEmail.innerHTML = 'Hợp lệ.';\n isValidateEmail = true;\n }\n //kiem tra isvalidate\n isValidate = isValidateFirstName && isValidateLastName && isValidatePassword && isValidateConfirmPassword && isValidateAddress && isValidatePhone && isValidateAvatar && isValidateEmail;\n return isValidate;\n}", "title": "" }, { "docid": "89b4e75053a9f5a0c6cfe01229b6f8f6", "score": "0.56172574", "text": "function createAccount(e) {\n e.preventDefault();\n try {\n var emailCreate = document.querySelector(\"#email\").value;\n var userNameCreate = document.querySelector(\"#name\").value;\n var passwordCreate = window.btoa(document.querySelector(\"#password\").value);\n var confirmPasswordCreate = window.btoa(document.querySelector(\"#confirm_password\").value);\n var successCreate = document.querySelector(\"#successCreate\");\n var passwordError = document.querySelector(\"#passwordError\");\n successCreate.innerHTML = \"\";\n passwordError.innerHTML = \"\";\n if (window.atob(passwordCreate) !== window.atob(confirmPasswordCreate)) {\n passwordError.innerHTML = \"Password do Not Match, please check again.\";\n return;\n }\n else if (window.atob(passwordCreate) === \"\") {\n passwordError.innerHTML = \"Please type in a password.\";\n return;\n }\n else if (checkUser(userNameCreate)) {\n passwordError.innerHTML = \"Username already exists in this group, please choose another one.\";\n return;\n }\n else {\n let user = new User(emailCreate, userNameCreate, passwordCreate);\n users.push(user);\n saveUserState();\n passwordError.innerHTML = \"\";\n successCreate.innerHTML = \"Account successfully created, welcome <span id='userNameCreate'>\" + userNameCreate + \"</span>!\";\n successCreate.style.display = \"inline-block\";\n return;\n }\n } catch (e) {\n throw new Error(e.message);\n }\n}", "title": "" }, { "docid": "370a65c02db5651c50cc53b912e2d55e", "score": "0.5606527", "text": "_processValidationError(error) {\n console.info('\\<gigya-register\\> API validation error');\n\n let notice = {};\n\n let errorCode = error.errorCode;\n let errorField = error.fieldName;\n\n notice.code = errorCode;\n\n if(errorCode === 400003) {\n notice.type = 'error';\n if(errorField === 'email') {\n notice.message = 'An account is already registered with that e-mail address.';\n } else if(errorField === 'username') {\n notice.message = 'That username already exists.';\n }\n }else {\n notice.type = 'error';\n notice.message = 'Unhandled error.';\n console.dir(error);\n }\n\n this._deDupNoticies(notice);\n // this.push('notices', notice);\n }", "title": "" }, { "docid": "df428c73dc61b74d11b5d32dd1599b84", "score": "0.56024784", "text": "generateErrorMessage(eventTarget){\n const [field, value] = [eventTarget.name, eventTarget.value];\n\n const errorMessage = this.state.errorMessage;\n // single object which can be used to apply conditions instead of using multiple if else statements\n const errorObj = {\n weight: {\n condition: value < 20 || value > 200,\n message: 'enter valid weight'\n },\n phoneNumber: {\n condition: value.length !== 10 || value === '',\n message: 'enter valid phone number'\n },\n email: {\n condition: !value.includes('@'),\n message: 'enter valid email' \n },\n address: {\n condition: value.length < 5,\n message: 'enter valid address'\n },\n city: {\n condition: value.includes(' '),\n message: 'space are not allowed use \"-\"'\n },\n pinCode:{\n condition: value.length !== 6 || value.charAt(0) === '0',\n message: 'enter valid pin code'\n }\n }\n \n // general validator for first, middle and last name\n if(field.includes('Name')){\n errorObj[field] = {\n condition: value.length < 3,\n message: 'not 3 character long'\n };\n }\n // make the input border green for every field whose value has been changed\n eventTarget.parentNode.children[1].style.borderColor = 'green';\n \n // validator using the above obj conditions which pops up error message and makes the input border red\n if(errorObj[field]){\n if(errorObj[field].condition){\n errorMessage[field] = errorObj[field].message;\n eventTarget.parentNode.children[1].style.borderColor = 'red';\n \n this.setState({\n errorMessage: errorMessage \n });\n } else{\n errorMessage[field] = false;\n this.setState({\n errorMessage: errorMessage \n });\n }\n }\n // since I used a general validator earlier(above) middle name(if changed) gets affected and shows error until validated, \n // since the field is not compulsory, the pop up message should disappear when no value is entered.\n if(field === 'middleName' && value.length === 0){\n errorMessage[field] = false;\n eventTarget.parentNode.children[1].style.borderColor = '';\n this.setState({\n errorMessage: errorMessage \n });\n }\n }", "title": "" }, { "docid": "84320129cb63cedc2cb23049be293d63", "score": "0.5600279", "text": "function do_reset_validation_messages(fields) {\r\n\r\n\tfor(var i = 0; i < fields.length; i++) {\t\r\n\t\t\r\n\t\tdo_reset_validation_message(fields[i]);\r\n\t\r\n\t}\r\n\r\n}", "title": "" }, { "docid": "129bda5ff03d931eb108844201f87c13", "score": "0.5598005", "text": "function removeValidationErrors() {\n\tremoveDobValidations();\n\tvar validator = $('#User').validate();\n\tvalidator.resetForm();\n\t$('.form-group').removeClass('error');\n}", "title": "" }, { "docid": "9d8b1c78b753c6ce63f451fe852b3fd5", "score": "0.55971783", "text": "function required_fields() {\n var errorFound = true;\n if((document.getElementById('usrnm').value.length) < 1){\n document.getElementById('usrnm_err').innerHTML='required field';\n document.getElementById('usrnm_err').style.color='#FF2222';\n errorFound = false;\n }\n if((document.getElementById('email').value.length) < 1){\n document.getElementById('email_err').innerHTML='required field';\n document.getElementById('email_err').style.color='#FF2222';\n errorFound = false;\n }\n if((document.getElementById('psw').value.length) < 1){\n document.getElementById('psw_err').innerHTML='required field';\n document.getElementById('psw_err').style.color='#FF2222';\n errorFound = false;\n }\n if((document.getElementById('psw_conf').value.length) < 1){\n document.getElementById('val_error').innerHTML='required field';\n document.getElementById('val_error').style.color='#FF2222';\n errorFound = false;\n }\n if((document.getElementById('fname').value.length) < 1){\n document.getElementById('fname_err').innerHTML='required field';\n document.getElementById('fname_err').style.color='#FF2222';\n }\n if((document.getElementById('lname').value.length) < 1){\n document.getElementById('lname_err').innerHTML='required field';\n document.getElementById('lname_err').style.color='#FF2222';\n errorFound = false;\n }\n if((document.getElementById('birthday').value.length) < 1){\n document.getElementById('birthday_err').innerHTML='required field';\n document.getElementById('birthday_err').style.color='#FF2222';\n errorFound = false;\n }\n if((document.getElementById('country').value.length) < 1){\n document.getElementById('country_err').innerHTML='required field';\n document.getElementById('country_err').style.color='#FF2222';\n errorFound = false;\n }\n if((document.getElementById('city').value.length) < 1){\n document.getElementById('city_err').innerHTML='required field';\n document.getElementById('city_err').style.color='#FF2222';\n errorFound = false;\n }\n if((document.getElementById('city').value.length) < 1){\n document.getElementById('city_err').innerHTML='required field';\n document.getElementById('city_err').style.color='#FF2222';\n errorFound = false;\n }\n if((document.getElementById('occupation').value.length) < 1){\n document.getElementById('occupation_err').innerHTML='required field';\n document.getElementById('occupation_err').style.color='#FF2222';\n errorFound = false;\n }\n if(errorFound){\n validator_ajax();\n }\n \n}", "title": "" }, { "docid": "21ba408e5c525a423960cdc6bf8f7047", "score": "0.5583558", "text": "function setCreateUserFormHandler(){\n $(document).ready(function(){\n $('#user-signup-form').on('submit', function(e) {\n console.log(e)\n e.preventDefault();\n\n var formObj = $(this).serializeObject();\n console.log(formObj);\n\n $('#user-signup-modal').closeModal();\n createUser(formObj, function(user) {\n console.log(\"form response:\", user);\n // $(\"#user-signup-form\").val();\n $( '#user-signup-form' ).each(function(){\n this.reset();\n });\n });\n });\n })\n}", "title": "" }, { "docid": "d3929366883fc3ebd627ff808a6b8a6a", "score": "0.5583125", "text": "function estateValidate() {\r\n var elementUserName = document.getElementById(\"en\");\r\n var userName = elementUserName.value;\r\n var elementUserPhone = document.getElementById(\"ef\");\r\n var userPhone = elementUserPhone.value;\r\n var elementUserMail = document.getElementById(\"em\");\r\n var userMail = elementUserMail.value;\r\n var elementUserFeed = document.getElementById(\"efd\");\r\n var userFeed = elementUserFeed.value;\r\n\r\n if (!userName) {\r\n elementUserName.classList.add(\"no-valid-form\");\r\n document.querySelector(\".estate-massage\").classList.add(\"no-valid\");\r\n document.querySelector(\".estate-label\").classList.add(\"error\");\r\n return false;\r\n } else {\r\n document.querySelector(\".estate-name\").classList.remove(\"no-valid-form\");\r\n document.querySelector(\".estate-massage\").classList.remove(\"no-valid\");\r\n document.querySelector(\".estate-label\").classList.remove(\"error\");\r\n console.log(userName);\r\n }\r\n\r\n if (userPhone.length < 13) {\r\n elementUserPhone.classList.add(\"no-valid-form\");\r\n document.querySelector(\".estate-massage-phone\").classList.add(\"no-valid\");\r\n document.querySelector(\".estate-label-phone\").classList.add(\"error\");\r\n return false;\r\n } else {\r\n document.querySelector(\".estate-phone-num\").classList.remove(\"no-valid-form\");\r\n document.querySelector(\".estate-massage-phone\").classList.remove(\"no-valid\");\r\n document.querySelector(\".estate-label-phone\").classList.remove(\"error\");\r\n console.log(userPhone);\r\n }\r\n\r\n if (!userMail) {\r\n elementUserMail.classList.add(\"no-valid-form\");\r\n document.querySelector(\".estate-massage-mail\").classList.add(\"no-valid\");\r\n document.querySelector(\".estate-label-mail\").classList.add(\"error\");\r\n return false;\r\n } else {\r\n document.querySelector(\".estate-mail\").classList.remove(\"no-valid-form\");\r\n document.querySelector(\".estate-massage-mail\").classList.remove(\"no-valid\");\r\n document.querySelector(\".estate-label-mail\").classList.remove(\"error\");\r\n console.log(userMail);\r\n }\r\n\r\n if (!userFeed) {\r\n elementUserFeed.classList.add(\"no-valid-form\");\r\n document.querySelector(\".estate-massage-feed\").classList.add(\"no-valid\");\r\n document.querySelector(\".estate-label-feed\").classList.add(\"error\");\r\n return false;\r\n } else {\r\n document.querySelector(\".estate-feed\").classList.remove(\"no-valid-form\");\r\n document.querySelector(\".estate-massage-feed\").classList.remove(\"no-valid\");\r\n document.querySelector(\".estate-label-feed\").classList.remove(\"error\");\r\n console.log(userFeed);\r\n return true;\r\n }\r\n}", "title": "" }, { "docid": "8808ff2c49f4c6f1e1cc0b578d000bbd", "score": "0.55830985", "text": "_handlePreSubmit() {\n const errors = [];\n let fields = this.state.fields;\n\n Object.keys(fields).forEach((key) => {\n if (fields[key].errorText) {\n fields[key].touched = true;\n errors.push(fields[key].errorText);\n }\n });\n\n if (this.state.bookings.length == 0) {\n errors.push('There should be at least 1 session to book');\n }\n\n if (this.state.bookedBy.length == 0) {\n errors.push('Please record who did the booking');\n }\n\n if (this.state.presentationRequired) {\n let presentNow = false;\n let hasPresentation = false;\n this.state.bookings.forEach((booking) => {\n if (booking.type == 'Presentation' || booking.type == 'Email Presentation') {\n hasPresentation = true;\n }\n\n if (booking.type == 'Session' && Moment(booking.startTime).diff(Moment({hour: 23, minute: 59})) < 1555200000) {\n presentNow = true;\n }\n\n });\n\n if (presentNow && !hasPresentation) {\n errors.push('The first session is in less than 18 days, please book a presentation at this point');\n }\n }\n\n if (errors.length) {\n this.setState({\n fields: fields,\n showErrorDialog: true,\n errorDialog: {\n errors: errors,\n actions: (\n <RaisedButton\n label='Ok'\n primary={true}\n onTouchTap={() => { this.setState({showErrorDialog: false}); } }\n />\n )\n }\n });\n } else {\n this._handleSubmit();\n }\n }", "title": "" }, { "docid": "d9007493e570424f7e7b8cb14763ee7c", "score": "0.55799925", "text": "function handleConstructErrorMessage(errorsArray){\n var errorText = '';\n\n $.each(JSON.parse(errorsArray), function(key, val){\n errorText += (key+1) + '.' + val + '<br /><br />'\n })\n\n return errorText;\n}", "title": "" }, { "docid": "44652e4f312b6404880c0f201ffdb215", "score": "0.55798465", "text": "function addAdditionalMessage() {\n if (formValid) {\n var $dup = $(DUPLICATE_CLASS),\n messageLength = 0; // instantiate at 0\n\n // clone the first element\n $dup.first().off().clone().appendTo($dup.parent()).find('.dtpicker').attr('id','').removeClass('hasDatepicker').datepicker();\n\n // get how many \"textarea\"s are on the page at this moment\n messageLength = $('textarea').length;\n\n // iterate over each group of inputs\n $.each($(DUPLICATE_CLASS), function(i, e) {\n\n // if we're on the last element\n if (i == (messageLength - 1)) {\n // get the last \"message\" element\n var $message = $(e).find('textarea');\n $(e).find('input').val('');\n // reset the message to the placeholder text\n $message.val('').attr('placeholder', 'e.g. All Enterprise Systems and applications are operational.');\n\n // re-bind textarea validation call\n $message.on('input', validateAllTextareas);\n }\n });\n // bind these new fields with our text prevention\n bindEvents();\n\n // disable add button\n disableAddButton();\n disableSubmitButton();\n disableAppendButton();\n\n // reset form to invalid\n formValid = false;\n\n // we're always adding, so we need to enable the remove button...\n enableRemoveButton();\n }\n }", "title": "" }, { "docid": "8121f38f289ce6dc79c6b894fedc0591", "score": "0.556714", "text": "function validateForm()\n{\n /** Semester Select */\n\n semesterVal = $('#semester option:selected').val();\n if (semesterVal == 'default')\n {\n $('#errorSpan').remove();\n $('#semester').after(\"<span id='errorSpan' class='red whiteBox'> Please select a semester </span>\");\n $(window).scrollTop($('#semester').offset().top -100);\n return false;\n }\n\n /** Year Select */\n\n yearVal = $('#year option:selected').val();\n if (yearVal == 'default')\n {\n $('#errorSpan').remove();\n $('#year').after(\"<span id='errorSpan' class='red whiteBox'> Please select a year </span>\");\n $(window).scrollTop($('#year').offset().top -100);\n return false;\n }\n\n /** UID Text Field*/\n\n regex = /[uU][0-9]{7}/;\n uidVal = $('#uid').val();\n\n if (uidVal == \"\")\n {\n $('#errorSpan').remove();\n $('#uid').after(\"<span id='errorSpan' class='red whiteBox'> Please enter your University ID </span>\");\n $(window).scrollTop($('#uid').offset().top -100);\n return false;\n }\n else if (!regex.test(uidVal))\n {\n $('#errorSpan').remove();\n $('#uid').after(\"<span id='errorSpan' class='red whiteBox'> Please use following UID format \\\"u1234567\\\" </span>\");\n $(window).scrollTop($('#uid').offset().top -100);\n return false;\n }\n\n\n /** Previous TA Experience Dropdown and Textfield */\n\n //Grab all of the prev_ta divs\n prevTAList = $(\"div[id^='prev_ta']\");\n\n //Loop through each to see if they're all filled out\n for (i = 0; i < prevTAList.length; i++)\n {\n //Get the ID for this div\n divID = \"#\" + prevTAList.eq(i).attr(\"id\");\n\n //Get the children of this div\n childEles = prevTAList.eq(i).children();\n\n\n //Make sure default dropdown option is not selected\n if(childEles.eq(0).val() == \"default\")\n {\n $('#errorSpan').remove();\n $(divID).after(\"<p id='errorSpan' class='red whiteBox inBlock'> Please select a course above </p>\");\n $(window).scrollTop($(divID).offset().top -100);\n return false;\n }\n\n //Make sure the textarea has been filled out\n if(childEles.eq(1).val() == \"\")\n {\n $('#errorSpan').remove();\n $(divID).after(\"<p id='errorSpan' class='red whiteBox inBlock'> Please include information about the course above </p>\");\n $(window).scrollTop($(divID).offset().top -100);\n return false;\n }\n }\n\n /** Requested TA Dropdown and Textfield */\n\n //Grab all of the req_ta divs\n reqTAList = $(\"div[id^='req_ta']\");\n\n //Loop through each to see if they're all filled out\n for (i = 0; i < reqTAList.length; i++)\n {\n //Get the ID for this div\n divID = \"#\" + reqTAList.eq(i).attr(\"id\");\n\n //Get the children of this div\n childEles = reqTAList.eq(i).children();\n\n\n //Make sure default dropdown option is not selected\n if(childEles.eq(0).val() == \"default\")\n {\n $('#errorSpan').remove();\n $(divID).after(\"<p id='errorSpan' class='red whiteBox inBlock'> Please select a course above </p>\");\n $(window).scrollTop($(divID).offset().top -100);\n return false;\n }\n\n //Make sure the textarea has been filled out\n if(childEles.eq(1).val() == \"\")\n {\n $('#errorSpan').remove();\n $(divID).after(\"<p id='errorSpan' class='red whiteBox inBlock'> Please include information about the course above </p>\");\n $(window).scrollTop($(divID).offset().top -100);\n return false;\n }\n }\n\n /** Additional Info Textarea */\n addInfoVal = $('#add_info').val();\n\n if (addInfoVal == \"\")\n {\n $('#errorSpan').remove();\n $('#add_info').before(\"<p id='errorSpan' class='red whiteBox inBlock'> Please include some additional details </p>\");\n $(window).scrollTop($('#add_info').offset().top -100);\n return false;\n }\n\n /** Optional Country of Origin Textfield */\n\n if (!$(\"#intl\").hasClass(\"dispNone\")) {\n\n originVal = $('#origin').val();\n\n if (originVal == \"\" || originVal == \"N/A\") {\n $('#errorSpan').remove();\n $('#origin').after(\"<span id='errorSpan' class='red whiteBox'> Please enter your country of origin</span>\");\n $(window).scrollTop($('#origin').offset().top - 100);\n return false;\n }\n }\n\n return true;\n}", "title": "" }, { "docid": "733b9465e52f2d4d198679978bb40a62", "score": "0.5544659", "text": "function submitForm() {\n\n //collect variables\n var fname = document.getElementById('fname');\n var lname = document.getElementById('lname');\n var email = document.getElementById('email');\n var comments = document.getElementById('comments');\n\n //first name processing\n if ( !fname.value.length ) {\n console.log(\"Fname needs a length\");\n err_fname.innerHTML = \"<strong>error: field is blank</strong>\";\n fname.className = \"bad\";\n } else if ( noSpaceAlphaValidate( fname.value ) === false ) {\n console.log(\"Fname needs Alpha chars\");\n err_fname.innerHTML = \"<strong>error: field is invalid</strong>\";\n fname.className = \"bad\";\n } else {\n console.log(\"Fname is good\");\n err_fname.innerHTML = \"\";\n fname.className = \"good\";\n }\n \n //last name processing\n if ( !lname.value.length ) {\n console.log(\"Lname needs a length\");\n err_lname.innerHTML = \"<strong>error: field is blank</strong>\";\n lname.className = \"bad\";\n } else if ( spaceAlphaValidate( lname.value ) === false ) {\n console.log(\"Lname needs Alpha chars\");\n err_lname.innerHTML = \"<strong>error: field is invalid</strong>\";\n lname.className = \"bad\";\n } else {\n console.log(\"Lname is good\");\n err_lname.innerHTML = \"\";\n lname.className = \"good\";\n }\n \n //email address processing\n if ( !email.value.length ) {\n console.log(\"email needs a length\");\n err_email.innerHTML = \"<strong>error: field is blank</strong>\";\n email.className = \"bad\";\n } else if ( emailValidate( email.value ) === false ) {\n console.log(\"email is not valid\");\n err_email.innerHTML = \"<strong>error: field is invalid</strong>\";\n email.className = \"bad\";\n } else {\n console.log(\"email is good\");\n err_email.innerHTML = \"\";\n email.className = \"good\";\n }\n \n //comments field processing\n if (comments.value.length > 150) {\n commentsSpan.innerHTML = \"<strong>comments must be less than 150 characters</strong>\";\n comments.className = \"bad\";\n } else if (comments.value.length < 1) {\n commentsSpan.innerHTML = \"<strong>comments must not be blank</strong>\";\n comments.className = \"bad\";\n } else if (comments.value.length < 150 && comments.value.length > 1) {\n commentsSpan.innerHTML = \"\";\n comments.className = \"good\";\n comments.value = strip_HTML(comments.value);\n }\n \n \n\n}", "title": "" }, { "docid": "b72863633847e92914c3bc16c2ad655f", "score": "0.55373144", "text": "function clearError() {\n $('#error-name').html(``);\n $('#error-email').html(``);\n $('#error-pass').html(``);\n $('#error-check').html(``);\n $('#name-signup').removeClass('is-invalid');\n $('#email-signup').removeClass('is-invalid');\n $('#password-signup').removeClass('is-invalid');\n $('#password-check-signup').removeClass('is-invalid');\n }", "title": "" }, { "docid": "60a9e0cfcea4fb016e6adfc0b3421138", "score": "0.55369246", "text": "createForm() {\n this.userEditForm = this.fb.group({\n first_name: ['', this.validation.name_validation],\n last_name: ['', this.validation.name_validation],\n email: [{ value: '', disabled: true }],\n mobile: ['', this.validation.onlyRequired_validator],\n address: ['', this.validation.onlyRequired_validator],\n apartment: ['', this.validation.onlyRequired_validator],\n // street:['', this.validation.onlyRequired_validator],\n gender: ['', this.validation.onlyRequired_validator],\n languageid: ['', this.validation.onlyRequired_validator],\n latitude: [''],\n longitude: [''],\n primary_lang_id: ['', this.validation.onlyRequired_validator],\n // user_role:[{value: '', disabled: true}],\n id: [''],\n rate: [''],\n image: [''],\n other_gender: [''],\n country_code: ['', this.validation.onlyRequired_validator]\n });\n }", "title": "" }, { "docid": "65181d3e6a497d63521229bde782b53c", "score": "0.55304486", "text": "function checkForm() {\n let errors = {};\n customers.find({'CustomerEmail' : email}).toArray()\n .then(doc => {\n if (doc.length != 0) {\n console.log('ERROR: EMAIL EXISTS')\n errors['emailMessage']='Email already exists'\n }\n })\n .then(() => {\n customers.find({'CustomerUserName' : username}).toArray().then(function (doc) {\n if(Object.keys(doc).length != 0){\n console.log('USER ERROR: Username already exists')\n errors['usernameMessage'] = 'The Username already exists';\n }\n })\n })\n .then(() => {\n if (password !== confirmPassword) {\n errors['passwordMessage']= 'The passwords must match';\n }\n })\n .then(() => {\n console.log(errors)\n if (Object.keys(errors).length == 0) {\n db.collection('customers').insertOne(registrationData, (err, collection) => {\n if (err) throw err;\n console.log('Record inserted Successfully');\n });\n res.render('registration', { message: 'Thank you, your registration has been successfully completed', errorMessage: '' })\n } else {\n res.render('registration', {message: '', errorMessage: errors})\n }\n })\n .catch(err => console.log(err))\n }", "title": "" }, { "docid": "5ad51b0c0f8e927834eb950c948ea5fe", "score": "0.5529929", "text": "function signUp(){\n const userData ={\n firstname:$(\"#user_firstname\").val(),\n surname: $(\"#user_surname\").val(),\n middle_name: $(\"#user_middle_name\").val(),\n gender: $('input[name=\"gender\"]:checked').val(),\n email: $(\"#user_email\").val(),\n date_of_birth: $(\"#date_of_birth\").val(),\n phone_number: $(\"#phone_number\").val(),\n password: $(\"#password\").val(),\n confirm_password: $(\"#confirm_password\").val()\n };\n\n const errorLog = {\n firstname:\"\",\n surname: \"\",\n middle_name: \"\",\n gender: \"\",\n email: \"\",\n dob:\"\",\n phone: \"\",\n password: \"\",\n confirm_password: \"\"\n };\n $.ajax({\n type: 'post',\n url: appUrl+'/create-user',\n beforeSend:function (xhr){\n xhr.setRequestHeader('Content-Type','application/json');\n xhr.setRequestHeader('Accept','application/json');\n },\n data: JSON.stringify(userData),\n success: function (data){\n if (data.status = 200){\n window.location.href ='signin.php';\n }else{\n }\n },\n error: function (xhr, status, error){\n if(xhr.status === 422){\n let errors = JSON.parse(xhr.responseText).errors;\n errorLog.firstname = errors.firstname;\n errorLog.surname = errors.surname;\n errorLog.gender = errors.gender;\n errorLog.email = errors.email;\n errorLog.phone = errors.phone;\n errorLog.password = errors.password;\n errorLog.confirm_password = errors.confirm_password;\n validateSignUp(errorLog);\n }\n },\n })\n}", "title": "" }, { "docid": "1257a53eafc4308126c3017a73b19d8d", "score": "0.5521412", "text": "function formValidator(){\r\n\r\n\r\n\r\n\t//create object that will save user inputs (empty bucket)\r\n\tlet feedback = {};\r\n\t//create array that will save error messages (empty bucket)\r\n\tlet errors = [];\r\n\r\n\t//check if full name has a value\r\n\tif (fn.value !== \"\"){\r\n\t\t//if it does, save it\r\n\t\tfeedback.cultestName = fn.value;\r\n\t}else{\r\n\t\t//if it does not, create the error message, and save that too\r\n\t\terrors.push(\"Please inform us of the name of the person.\")\r\n\t}\r\n\t\r\n\t//check if email has a value\r\n\tif (em.value !== \"\"){\r\n\t\t//if it does, save it\r\n\t\tfeedback.email = em.value;\r\n\t}else{\r\n\t\t//if it does not, create the error message, and save that too\r\n\t\terrors.push(\"Please provide the contact information.\")\r\n\t}\r\n\r\n\t//check if message has a value\r\n\tif (msg.value !== \"\"){\r\n\t//if it does, save it\r\n\t\tfeedback.messgae = msg.value;\r\n\t}else{\r\n\t\t//if it does not, create the error message and save that too\r\n\t\terrors.push(\"Please write down your mad ramblings.\")\r\n\t}\r\n\r\n\r\n\t//create either feedback, or display all errors\r\n\r\n\tif (errors.length === 0){\r\n\t\tconsole.log(feedback);\r\n\t}else{\r\n\t\tconsole.log(errors);\r\n\t}\r\n\r\n}//close your event handler", "title": "" }, { "docid": "ea3cb2ce9c580ea2df8fecd8a0a26432", "score": "0.5520671", "text": "function createAccount() {\n var msg, username = $('#username').val();\n if (username) {\n $('#username').removeClass('invalid');\n msg = '';\n $(this).dialog('close');\n alert('created a new account for ' + username);\n } else {\n $('#username').addClass('invalid');\n msg = 'Required field username is empty.';\n }\n $('#message').text(msg);\n}", "title": "" }, { "docid": "f73e17202bce2af76e1c53d4f8e0aba0", "score": "0.55183446", "text": "checkForErrors () {\n this.errors = []\n const selection = this.template.querySelector('c-lookup').getSelection()\n // Custom validation rule\n if (this.isMultiEntry && selection.length > this.maxSelectionSize) {\n this.errors.push({\n message: `You may only select up to ${this.maxSelectionSize} items.`\n })\n }\n // Enforcing required field\n if (selection.length === 0) {\n this.errors.push({ message: 'Please make a selection.' })\n }\n }", "title": "" }, { "docid": "2d476648dd0eda9f45a28a41e71f6d70", "score": "0.5511727", "text": "function validate() {\n\tif (firstName.value == \"\") {\n\t\terrorDisplay(\"#errorFirstName\", \"FirstName is required\", firstName);\n\t\treturn false;\n\n\t} else if (!firstName.value.match(/^[a-z-A-Z ]*$/)) {\n\t\terrorDisplay(\"#errorFirstName\", \"First Name can only contain letters and hyphens\", firstName);\n\t\treturn false;\n\n\t} else if (lastName.value == \"\") {\n\t\terrorDisplay(\"#errorLastName\", \"Last Name is required\", lastName);\n\t\treturn false;\n\n\t} else if (!lastName.value.match(/^[a-z-A-Z ]*$/)) {\n\t\terrorDisplay(\"#errorLastName\", \"Last Name can only contain letters and hyphens\", lastName);\n\t\treturn false;\n\n\t} else if (email.value == \"\") {\n\t\terrorDisplay(\"#errorEmail\", \"Email is required\", email);\n\t\treturn false;\n\n\t} else if (email.value.length < 4) {\n\t\terrorDisplay(\"#errorEmail\", \"Minimum length is 4 characters\", email);\n\t\treturn false;\n\n\t} else if (!email.value.match(/^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/)) {\n\t\terrorDisplay(\"#errorEmail\", \"Email format: example@gmail.com\", email);\n\t\treturn false;\n\n\t} else if (createPass.value == \"\") {\n\t\terrorDisplay(\"#errorCreatePass\", \"Password is required\", createPass);\n\t\treturn false;\n\n\t} else if (createPass.value.length < 6) {\n\t\terrorDisplay(\"#errorCreatePass\", \"Minimum length is 6 characters\", createPass);\n\t\treturn false;\n\n\t} else if (!createPass.value.match(/^[\\w]*$/)) {\n\t\terrorDisplay(\"#errorCreatePass\", \"Allowed characters are: letters, numbers, and underscores\", createPass);\n\t\treturn false;\n\n\t} else if (confPass.value == \"\") {\n\t\terrorDisplay(\"#errorConfirmPass\", \"Confirm Password is required\", confPass);\n\t\treturn false;\n\n\t} else if (confPass.value != createPass.value) {\n\t\terrorDisplay(\"#errorConfirmPass\", \"Passwords don't match!\", confPass);\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "1c80da271d18ba6bdcbd566369c30d8a", "score": "0.5508906", "text": "function RegisterValidation() \r\n{ \r\n var fname = document.forms[\"Register\"][\"fname\"]; \r\n var lname = document.forms[\"Register\"][\"lname\"]; \r\n var email = document.forms[\"Register\"][\"email\"]; \r\n var postadd = document.forms[\"Register\"][\"postadd\"]; \r\n var postcode = document.forms[\"Register\"][\"postcode\"]; \r\n var gender = document.forms[\"Register\"][\"gender\"];\r\n var datetime = document.forms[\"Register\"][\"datetime\"];\r\n var uname = document.forms[\"Register\"][\"uname\"];\r\n var pwd = document.forms[\"Register\"][\"pwd\"];\r\n \r\n if (fname.value == \"\") \r\n { \r\n window.alert(\"Please enter your first name.\"); \r\n fname.focus(); \r\n return false; \r\n } \r\n\r\n if (lname.value == \"\") \r\n { \r\n window.alert(\"Please enter your last name.\"); \r\n lname.focus(); \r\n return false; \r\n } \r\n \r\n if (postadd.value == \"\") \r\n { \r\n window.alert(\"Please enter your postal address.\"); \r\n postadd.focus(); \r\n return false; \r\n } \r\n\r\n if (postcode.value == \"\") \r\n { \r\n window.alert(\"Please enter your postal code.\"); \r\n postcode.focus(); \r\n return false; \r\n } \r\n \r\n if (email.value == \"\") \r\n { \r\n window.alert(\"Please enter a valid e-mail address.\"); \r\n email.focus(); \r\n return false; \r\n } \r\n \r\n if (email.value.indexOf(\"@\", 0) < 0) \r\n { \r\n window.alert(\"Please enter a valid e-mail address.\"); \r\n email.focus(); \r\n return false; \r\n } \r\n \r\n if (email.value.indexOf(\".\", 0) < 0) \r\n { \r\n window.alert(\"Please enter a valid e-mail address.\"); \r\n email.focus(); \r\n return false; \r\n } \r\n \r\n if (datetime.value == \"\") \r\n { \r\n window.alert(\"Please enter datetime.\"); \r\n datetime.focus(); \r\n return false; \r\n } \r\n \r\n \r\n if (gender.selectedIndex < 1) \r\n { \r\n alert(\"Please select your gender.\"); \r\n gender.focus(); \r\n return false; \r\n }\r\n \r\n if (uname.value == \"\") \r\n { \r\n window.alert(\"Please write your user name.\"); \r\n uname.focus(); \r\n return flase; \r\n } \r\n\r\n if (pwd.value == \"\") \r\n { \r\n window.alert(\"Please write your password.\"); \r\n pwd.focus(); \r\n return flase; \r\n } \r\n \r\n return true; \r\n}", "title": "" }, { "docid": "f83042db842fb1c08680cc4d2cd9857f", "score": "0.55076826", "text": "function showDataProcessError(){\n\n\t\t\t\tvar opts = $.extend({},formAlertOpts); // make a new copy of the object\n\n\t\t\t\t// change the message\n\n\t\t\t\topts.content.highlight = '<span class=\"highlight\">processing error!</span>';\n\t\t\t\topts.content.message = 'please contact me directly on my email-address, <a href=\"mailto:contact@vimalpatra.com\"> contact@vimalpatra.com </a> or through my social media channels.';\n\t\t\t\t\n\t\t\t\t// add class of success\n\t\t\t\topts.el.modal.class += ' error';\n\t\t\t\t\n\t\t\t\topts.el.modal.fadeOutBuffer = 10000;\n\n\t\t\t\t// show the alert\n\t\t\t\tformAlert.init(opts);\n\t\t\t\treenableFormForProcessing();\n\n\t\t\t}", "title": "" }, { "docid": "e287f81db97e2fffc9a82a5c419b011c", "score": "0.5507115", "text": "function renderErrors(){\n\t\t\t\t\tvar counter = 0;\n\t\t\t\t\t$.each(errors, function(key, value){\n\t\t\t\t\t\tvar selectedElement \t= $(\"[name=\"+ key +\"]\");\n\t\t\t\t\t\tvar position \t\t\t= selectedElement.position();\n\t\t\t\t\t\tvar width\t\t\t\t= selectedElement.width();\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar toolTipProperties = {\n\t\t\t\t\t\t\tmessage:\t\"\",\n\t\t\t\t\t\t\tid:\t\t\tcounter,\n\t\t\t\t\t\t\ttop:\t\tposition.top,\n\t\t\t\t\t\t\tleft:\t\tposition.left + width\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t$.each(value, function(k, v){\n\t\t\t\t\t\t\ttoolTipProperties.message += v +\"<br/>\";\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t\ttooltip.show(toolTipProperties);\n\t\t\t\t\t\tcounter++;\n\t\t\t\t\t});\n\t\t\t\t}", "title": "" }, { "docid": "59d162b40f1eb6ba32e921e23bd558e5", "score": "0.5504326", "text": "render() {\n const { errors, formType, closeBoardModal } = this.props;\n const newErrors = {};\n errors.forEach(error => {\n newErrors[Object.keys(error).shift()] = Object.values(error).shift();\n });\n return (\n <div className=\"board-form-container\">\n <div className=\"board-form-header\">\n <h5>Create Board</h5>\n <button onClick={closeBoardModal}>\n <i className=\"fas fa-times\"></i>\n </button>\n </div>\n\n <form className=\"board-form\" onSubmit={this.handleSubmit}>\n <span className=\"board-name\">\n <div className=\"input-label\">Name</div>\n <input\n className={`board-input${newErrors.title ? `-error` : ``}`}\n type=\"text\"\n value={this.state.title}\n placeholder='Like \"Places to Visit\"'\n onChange={this.update('title')}\n />\n </span>\n\n <div className={`board-error${newErrors.title ? `` : `-none`}`}>{newErrors.title}</div>\n\n <span className=\"board-description\">\n <div className=\"input-label\">Description</div>\n <textarea\n className={`board-input${newErrors.description ? `-error` : ``}`}\n value={this.state.description}\n placeholder=\"Say more about this board\"\n onChange={this.update('description')}\n />\n </span>\n\n <div className={`board-error${newErrors.description ? `` : `-none`}`}>{newErrors.description}</div>\n <div className=\"create-board-form-footer\">\n <button className=\"cancel-form\" onClick={closeBoardModal}>Cancel</button>\n <input className=\"board-submit\" type=\"submit\" value={formType} disabled={this.state.title === ''} />\n </div>\n </form>\n </div >\n );\n }", "title": "" }, { "docid": "d76b0d88541e80000e702c977cbf8d3a", "score": "0.5503842", "text": "function checkInputs() {\n const usernameValue = username.value.trim();\n const emailValue = email.value.trim();\n const passwordValue = password.value.trim();\n const password2Value = password2.value.trim();\n\n if (usernameValue === \"\") { // username value\n setErrorFor(username, \"username cannot be blank\")\n } else {\n setSuccessFor(username)\n }\n if (emailValue === \"\") { // email value\n setErrorFor(email, 'email cannot be blank')\n } else {\n setSuccessFor(email)\n }\n if (passwordValue === \"\") { // password value\n setErrorFor(password, 'password cannot be blank')\n } else if\n (passwordValue.length <= 7) { // password length \n setErrorFor(password, 'password is too short')\n } else {\n setSuccessFor(password)\n }\n if (password2Value === \"\") { // password check & validation\n setErrorFor(password2, \"password cannot be blank\")\n } else if (passwordValue !== password2Value) { // password matches\n setErrorFor(password2, \"password does not match\")\n }\n}", "title": "" }, { "docid": "d656fdd9d8c4ac7ea6bc8d62bc8b3d75", "score": "0.55030024", "text": "function clearErrors(formData) {\n\n const formFields = Object.keys(formData);\n\n $('#contact-us-errors').addClass('hidden');\n $('#contact-us-error-message').empty();\n\n /*\n Loop over all of the fields that were submitted to the server in the formData class\n */\n for (var i=0; i<formFields.length; i++) {\n\n /*\n Check to see if we should be concerned about validation for the form field\n */\n if (validateFormFields.indexOf(formFields[i])) {\n\n /*\n Empty the form help element of any contents\n */\n $('#contact-us-help-' + formFields[i]).empty().removeClass('text-danger');\n $('#contact-us-label-' + formFields[i]).removeClass('text-danger');\n }\n }\n }", "title": "" }, { "docid": "6f95f079eee29cd09acd63e41b4dae70", "score": "0.5502971", "text": "function formSubmit() {\n // console.log(\"submit\");\n var fullName = document.querySelector(\"#fullName\").value;\n var email = document.querySelector(\"#email\").value;\n var number = document.querySelector(\"#number\").value;\n\n var namePattern = /^[a-zA-Z]+\\s{0,}[a-zA-Z]{0,}$/;\n // var emailPattern = /^[a-zA-Z]+[0-9]{0,}[a-zA-Z]{0,}@[a-zA-Z]+.com$/;\n var emailPattern = /^[a-zA-Z]+[0-9]{0,}\\w{0,}@[a-zA-Z]+.com$/;\n var numberPattern = /^[1-9]{1}[0-9]{9}/;\n\n var nameCheck = false;\n var emailCheck = false;\n var numberCheck = false;\n\n // validating full name of user\n if (fullName.match(namePattern)) {\n // if invalid value was typed in previously and current value is correct\n if (\n document\n .querySelector(\".fullNameInvalid\")\n .classList.contains(\"formInvalid\")\n ) {\n document\n .querySelector(\".fullNameInvalid\")\n .classList.remove(\"formInvalid\");\n }\n nameCheck = true;\n } else {\n // adding formInvalid class\n document.querySelector(\".fullNameInvalid\").classList.add(\"formInvalid\");\n }\n\n // validating email of user\n if (email.match(emailPattern)) {\n // if invalid value was typed in previously and current value is correct\n if (\n document.querySelector(\".emailInvalid\").classList.contains(\"formInvalid\")\n ) {\n document.querySelector(\".emailInvalid\").classList.remove(\"formInvalid\");\n }\n emailCheck = true;\n } else {\n // adding formInvalid class\n document.querySelector(\".emailInvalid\").classList.add(\"formInvalid\");\n }\n\n // validating phone number of user\n if (number.match(numberPattern)) {\n // if invalid value was typed in previously and current value is correct\n if (\n document.querySelector(\".numberInvalid\").classList.contains(\"formInvalid\")\n ) {\n document.querySelector(\".numberInvalid\").classList.remove(\"formInvalid\");\n }\n numberCheck = true;\n } else {\n // adding formInvalid class\n document.querySelector(\".numberInvalid\").classList.add(\"formInvalid\");\n }\n\n if (nameCheck && emailCheck && numberCheck) {\n console.log(true);\n console.log(document.querySelector(\".successHide\"));\n document.querySelector(\".successHide\").classList.add(\"success\");\n console.log(document.querySelector(\".success\"));\n document.querySelector(\".success\").classList.remove(\"successHide\");\n }\n}", "title": "" }, { "docid": "2596f76e8f30add2ee5c858156393172", "score": "0.5502336", "text": "validateUserRolesForm() {\n const errors = [];\n if (this.state.selected[0].user.length === 0 || this.state.role.length === 0) {\n errors.push(\"Required fields have been left blank.\");\n }\n\n if (this.state.selected[0].user === this.state.currentUser) {\n errors.push(\"You cannot change your own role\");\n }\n\n return errors;\n }", "title": "" }, { "docid": "29cec1182aa5970b3a6692fa5cdb5b63", "score": "0.55016875", "text": "function validateForm(){\n\n// Firstname validation\nif(!validateName(fname.value)){\n Validation().setError(fname,fname_error,\"Enter firstname correctly\");\n}else{\n Validation().clearError(fname,fname_error);\n}\n\n// Lastname validation\nif(!validateName(lname.value)){\n Validation().setError(lname,lname_error,\"Enter lastname correctly\");\n}else{\n Validation().clearError(lname,lname_error);\n}\n\n// Email validation\nif(!validateEmail(email.value)){\n Validation().setError(email,email_error,\"Enter email correctly\");\n} else{\n Validation().clearError(email,email_error);\n}\n\n// Phone number validation\nif(!validatePhone(phone.value)){\n Validation().setError(phone,phone_error,\"Enter Ph.No correctly\");\n} else{\n Validation().clearError(phone,phone_error);\n}\n\n//Password Validation\nif(!validatePass(password.value)){\n Validation().setError(password,pass_error,\"Enter password\");\n} else{\n Validation().clearError(password,pass_error);\n}\n\nif(password.value === conpass.value){\n Validation().clearError(conpass,conpass_error);\n} else{\n Validation().setError(conpass,conpass_error,\"Passwords doesn't match\");\n\n}\n\n // Terms and Privacy validation\n if(!checkedBox.checked)\n {\n // alert('You must agree to the terms first.');\n terms_error.classList.add('error-field');\n terms_error.innerHTML='Please agree Terms of use and Privacy Policy';\n }\n else\n {\n terms_error.classList.remove('error-field');\n terms_error.innerHTML= \"\";\n }\n\n return false;\n}", "title": "" }, { "docid": "daedb38a8be0987d0f4ca232857e6db1", "score": "0.55003536", "text": "function displayErrors(messageObject) {\n\tif (!messageObject.ok){\n\t\t// Change class\n\t\taddErrorClass(messageObject.element);\n\t\t// Display the error\n\t\tif (solVersion == 'placeholder') {\n\t\t\tpalceholderDisplayer(messageObject);\n\t\t} else if (solVersion == 'error') {\n\t\t\terrorDisplayer(messageObject);\n\t\t} else if (solVersion == 'tooltip') {\n\t\t\ttooltipDisplayer(messageObject);\n\t\t}\n\t}\n}", "title": "" } ]
723db303d59f4d5281d70b84283e1764
LLENADO DE LA TABLA COMPRAS DE FECHA ELEGIDA
[ { "docid": "86a8e248cdb681e0d7b2e70f01314fba", "score": "0.0", "text": "async function cajas_dia_especifico() {\n const datos = new FormData();\n //Se obtiene el valor del dia\n const fecha = document.querySelector(\"#fecha_elegida\").value;\n console.log(\"fecha \"+fecha);\n if(fecha != 0){\n datos.append(\"fecha\", fecha);\n datos.append(\"accion\", \"buscar_fecha\");\n try {\n const URL = \"../../../inc/peticiones/cajas/funciones.php\";\n const resultado = await fetch(URL, {\n method: \"POST\",\n body: datos,\n });\n const db = await resultado.json();\n let mensaje =db.length;\n console.log(mensaje);\n \n \n const listado_pedidos = document.querySelector(\"#contenido_fecha\"); \n listado_pedidos.innerHTML = \"\";\n if (mensaje >= 1){\n db.forEach((servicio) => {\n console.log(servicio);\n const {id_caja,usuario,fecha_y_hora_abertura, fecha_y_hora_cierre, monto_inicial, monto_final , monto_final_ventas, corte } = servicio;\n \n if(corte == 1){\n listado_pedidos.innerHTML += ` \n <tr>\n <td>${usuario}</td>\n <td>${fecha_y_hora_abertura}</td>\n <td>$ ${monto_inicial}</td>\n <td>$ ${fecha_y_hora_cierre}</td>\n <td>$ ${monto_final}</td>\n <td>$ ${monto_final_ventas}</td>\n <td><div class=\"badge badge-success text-wrap\">Caja cerrada</div></td>\n </tr>\n `\n }\n else if(corte == 0){ \n listado_pedidos.innerHTML += ` \n <tr>\n <td>${usuario}</td>\n <td>${fecha_y_hora_abertura}</td>\n <td>$ ${monto_inicial}</td>\n <td>$ ${fecha_y_hora_cierre}</td>\n <td>$ ${monto_final}</td>\n <td>$ ${monto_final_ventas}</td>\n <td><div class=\"badge badge-danger text-wrap\">Caja abierta</div></td>\n </tr>\n `\n }\n });\n }\n else{\n const mensajes = document.querySelector(\"#mensaje2\");\n mensajes.innerHTML += ` \n <div class=\"alert alert-danger alert-dismissible bg-warning text-white border-0 fade show\" role=\"alert\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\">\n <span aria-hidden=\"true\">×</span>\n </button>\n <strong>¡ALERTA! </strong> No existen registros en la fecha seleccionada.\n </div>\n `;\n }\n \n //imprime el total\n //console.log(suma);\n } catch (error) {\n console.log(error);\n }\n }\n else{\n //Mensaje de alerta\n const mensajes = document.querySelector(\"#mensaje2\");\n mensajes.innerHTML += ` \n <div class=\"alert alert-danger alert-dismissible bg-danger text-white border-0 fade show\" role=\"alert\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\">\n <span aria-hidden=\"true\">×</span>\n </button>\n <strong>¡ERROR! </strong> No ha seleccionado una fecha.\n </div>\n `;\n }\n \n}", "title": "" } ]
[ { "docid": "28bd6696d68d8ef3174205c659659aec", "score": "0.6286964", "text": "function agregarColumnaUnidadYCorrerFilas(){\n \t//Si el material a agregar tiene unidad\n \tif(unidadMat){\n\t\t\t$('#item' + cantMat).prepend(\n\t\t\t\t'<td id=\"uni' + cantMat + '\">' + $('#unidad1').val() + ' ' + unidadMat + '</td>'\n\t\t\t);\n\t\t\t//Si no corri las filas todavia\n\t\t\tif(!filasCorridas){\n\t\t\t\tfilasCorridas = true;\n\t\t\t\t$('#headerMaterial1').removeClass('rounded-left');\n\t\t\t\t$('#headers1').prepend(\n\t\t\t\t\t'<th class=\"rounded-left\" id=\"headerunidad1\">Unidad </th>'\n\t\t\t\t);\n\t\t\t\tfor(var i = 0; i<cantMat; i++){\n\t\t\t\t\t$('#item' + i).prepend('<td></td>');\n\t\t\t\t}\n\t\t\t}\n\t\t}else if(filasCorridas){\n\t\t\t$('#item' + cantMat).prepend('<td></td>');\n\t\t}\n }", "title": "" }, { "docid": "b092d106556dd239717fc3a9d8a69e73", "score": "0.6215986", "text": "function getOrdenes() {\n\tvar tabla = $(\"#ordenes_trabajo\").anexGrid({\n\t class: 'table-striped table-bordered table-hover',\n\t columnas: [\n\t \t{ leyenda: 'Acciones', style: 'width:100px;', columna: 'Sueldo' },\n\t \t{ leyenda: 'ID', style:'width:20px;', columna: 'id', ordenable:true},\n\t { leyenda: 'Clave de orden de trabajo', style: 'width:200px;', columna: 'o.clave', filtro:true},\n\t { leyenda: 'Tipo de orden', style: 'width:100px;', columna: 'o.t_orden', filtro:function(){\n\t \treturn anexGrid_select({\n\t data: [\n\t { valor: '', contenido: 'Todos' },\n\t { valor: '1', contenido: 'INSPECCIÓN' },\n\t { valor: '2', contenido: 'VERIFICACIÓN' },\n\t { valor: '3', contenido: 'SUPERVISIÓN' },\n\t { valor: '4', contenido: 'INVESTIGACIÓN' },\n\t ]\n\t });\n\t }},\n\t { leyenda: 'Número de oficio', style: 'width:200px;', columna: 'of.no_oficio',filtro:true},\n\t { leyenda: 'Fecha', columna: 'o.f_creacion', filtro: function(){\n \t\treturn anexGrid_input({\n \t\t\ttype: 'date',\n \t\t\tattr:[\n \t\t\t\t'name=\"f_ot\"'\n \t\t\t]\n \t });\n\t } },\n\t //{ leyenda: 'Participantes', style: 'width:300px;', columna: 'Correo' },\n\t { leyenda: 'Estado', style: 'width:120px;', columna: 'o.estatus', filtro:function(){\n\t \treturn anexGrid_select({\n\t data: [\n\t { valor: '', contenido: 'Todos' },\n\t { valor: '1', contenido: 'Cumplida' },\n\t { valor: '2', contenido: 'Parcial sin resultado' },\n\t { valor: '3', contenido: 'Parcial con resultado' },\n\t { valor: '4', contenido: 'Cumplida sin resultado' },\n\t { valor: '5', contenido: 'Cancelada' },\n\t ]\n\t });\n\t }},\n\t \n\t ],\n\t modelo: [\n\t \t\n\t \t{ class:'',formato: function(tr, obj, valor){\n\t \t\tvar acciones = [];\n\t \t\tif (obj.estatus == 'Cancelada') {\n\t \t\t\tacciones = [\n { href: \"javascript:open_modal('modal_ot_upload',\"+obj.id+\");\", contenido: '<i class=\"glyphicon glyphicon-cloud\"></i> Adjuntar documento' },\n { href: \"javascript:open_modal('modal_add_obs');\", contenido: '<i class=\"glyphicon glyphicon-comment\"></i>Agregar observaciones' },\n { href: 'index.php?menu=detalle&ot='+obj.id, contenido: '<i class=\"glyphicon glyphicon-eye-open\"></i>Ver detalle' },\n ];\n\t \t\t}else{\n\t \t\t\tacciones = [\n { href: \"javascript:open_modal('modal_ot_upload',\"+obj.id+\");\", contenido: '<i class=\"glyphicon glyphicon-cloud\"></i> Adjuntar documento' },\n { href: \"javascript:open_modal('modal_add_obs');\", contenido: '<i class=\"glyphicon glyphicon-comment\"></i>Agregar observaciones' },\n { href: 'index.php?menu=detalle&ot='+obj.id, contenido: '<i class=\"glyphicon glyphicon-eye-open\"></i>Ver detalle' },\n { href: \"javascript:open_modal('modal_cancelar_ot',\"+obj.id+\");\", contenido: '<i class=\"fa fa-ban text-red\"></i><b class=\"text-red\">Cancelar</b> '},\n ];\n\t \t\t}\n\t return anexGrid_dropdown({\n contenido: '<i class=\"glyphicon glyphicon-cog\"></i>',\n class: 'btn btn-primary ',\n target: '_blank',\n id: 'editar',\n data: acciones\n });\n\t }},\n\t \t\n\t { class:'',formato: function(tr, obj, valor){\n\t \t\tvar acciones = [];\n\t \t\tif (obj.estatus == 'Cancelada') {\n\t \t\t\ttr.addClass('bg-red-active');\n\t \t\t}\n\t return obj.id;\n\t }},\n\t { propiedad: 'clave' },\n\t { propiedad: 't_orden' },\n\t { propiedad: 'oficio' },\n\t { propiedad: 'f_creacion' },\n\t //{ propiedad: 'id'},\n\t { propiedad: 'estatus'}\n\t \n\t \n\t ],\n\t url: 'controller/puente.php?option=8',\n\t filtrable: true,\n\t paginable: true,\n\t columna: 'id',\n\t columna_orden: 'DESC'\n\t});\n\treturn tabla;\n}", "title": "" }, { "docid": "8edb85b5de7254ce9a5a218e4d619d2d", "score": "0.6050557", "text": "formata_dados_v2( resposta_HANA ){\n const reducer = (r, row) => {\n \n const key_caminhao = `${row.ID} - ${row.Unidade} - ${row.Nome} - ${row.Placa} - ${row.Transportadora} - ${row.Modal} - ${row.Dia} - ${row.Transportadora} - ${row.Modal} -${row.Nome}`;\n const key_entrega = `${row.Item_pedido} - ${row.Cod_Material} - ${row.Material} - ${row.Remessa} - ${row.Dia} - ${row.N_nota_fiscal} - ${row.Peso}`;\n\n const caminhoes = {\n ID: parseInt(row.ID),\n Unidade: row.Unidade,\n Status: row.Status || 'Aguardando chegada do veículo',\n Nome: row.Nome,\n Placa: row.Placa,\n Transportadora: row.Transportadora,\n Modal: row.Modal,\n Dia: row.Dia,\n Material: row.Material,\n Materiais: {},\n Assinaturas: []\n };\n\n r[key_caminhao] = r[key_caminhao] || caminhoes;\n\n const entregas = {\n Item_pedido: row.Item_pedido,\n Cod_Material: row.Cod_Material,\n Material: row.Material,\n Remessa: row.Remessa,\n Dia: row.Dia,\n N_nota_fiscal: row.N_nota_fiscal,\n Peso: parseInt(row.Peso.replace('.', ''))\n };\n\n r[key_caminhao]['Materiais'][key_entrega] = r[key_caminhao]['Materiais'][key_entrega] || entregas;\n\n return r;\n };\n\n const organizado = resposta_HANA.reduce( (r, row) => reducer(r, row), {});\n\n const obj_organizado = Object.values(organizado);\n\n const obj_organizado_2 = obj_organizado.map( item => {\n item['Materiais'] = Object.values(item['Materiais']);\n\n return item\n });\n\n return obj_organizado_2;\n }", "title": "" }, { "docid": "2040495a325737d89ff75eac7906f92a", "score": "0.6010003", "text": "function impostaCausaliEntrata (list) {\n var opts = {\n aaData: list,\n oLanguage: {\n sZeroRecords: \"Nessun accertamento associato\"\n },\n aoColumnDefs: [\n {aTargets: [0], mData: defaultPerDataTable('distinta.descrizione')},\n {aTargets: [1], mData: computeStringMovimentoGestione.bind(undefined, 'accertamento', 'subAccertamento', 'capitoloEntrataGestione')},\n {aTargets: [2], mData: readData(['subAccertamento', 'accertamento'], 'descrizione')},\n {aTargets: [3], mData: readData(['subAccertamento', 'accertamento'], 'importoAttuale', 0, formatMoney), fnCreatedCell: tabRight},\n {aTargets: [4], mData: readData(['subAccertamento', 'accertamento'], 'disponibilitaIncassare', 0, formatMoney), fnCreatedCell: tabRight}\n ]\n };\n var options = $.extend(true, {}, baseOpts, opts);\n $(\"#tabellaMovimentiEntrata\").dataTable(options);\n }", "title": "" }, { "docid": "d8e76e25d541841a9fc71e199b486c2a", "score": "0.594847", "text": "function _CarregaTabelasCompostas(\n tabelas_especificas, talentos_relacionados, tabela_composta, tabela_invertida) {\n for (var i = 0; i < tabelas_especificas.length; ++i) {\n var tabela_especifica = tabelas_especificas[i];\n for (var entrada in tabela_especifica) {\n var entrada_especifica = tabela_especifica[entrada];\n // Primeiro, preenche o nome da entrada se nao houver.\n if (entrada_especifica.nome == null) {\n entrada_especifica.nome = entrada;\n }\n // Preenche os danos de outros tamanhos.\n if (entrada_especifica.dano && entrada_especifica.dano.medio) {\n var dano_medio = entrada_especifica.dano.medio;\n for (var tamanho in tabelas_tamanho) {\n if (tamanho == 'medio') {\n continue;\n }\n if (dano_medio == '-') {\n entrada_especifica.dano[tamanho] = '-';\n } else {\n entrada_especifica.dano[tamanho] = tabelas_dado_por_tamanho[dano_medio][tamanho] || 0;\n }\n }\n }\n\n entrada_especifica.talento_relacionado = talentos_relacionados[i];\n // Compoe a tabela principal.\n tabela_composta[entrada] = entrada_especifica;\n // Compoe a tabela invertida.\n tabela_invertida[Traduz(entrada_especifica.nome)] = entrada;\n }\n }\n}", "title": "" }, { "docid": "f0d301ba4a48ef293482a1c281d1b647", "score": "0.59170943", "text": "function compilar()\r\n{\r\n\t// limpar tabelas\r\n\tvar tabela = document.getElementById('tabela-binario');\r\n\ttbody = tabela.getElementsByTagName('tbody')[0];\r\n\ttbody.innerHTML = '';\r\n\tvar tabela = document.getElementById('tabela-verdade');\r\n\ttbody = tabela.getElementsByTagName('tbody')[0];\r\n\ttbody.innerHTML = '';\r\n\t\r\n\tvar instrucoes = document.getElementById('instrucoes'); // div com as instrucoes\r\n\tvar divs = instrucoes.getElementsByTagName('div'); // divs de dentro - cada uma eh uma instrucao\r\n\t\r\n\t// para cada instrucao\r\n\tfor (var i = 0; i < divs.length; i++) {\r\n\t\ttry {\r\n\t\t\t// select - operacao selecionada\r\n\t\t\tvar op_funct = divs[i].getElementsByTagName('select')[0];\r\n\t\t\top_funct_selected = op_funct.options[op_funct.selectedIndex];\r\n\t\t\tvar instrucao = op_funct_selected.value;\r\n\t\t\tvar op = Number(op_funct_selected.getAttribute('data-op'));\r\n\t\t\tvar funct = Number(op_funct_selected.getAttribute('data-funct'));\r\n\t\t\t\r\n\t\t\t// input - comando digitado\r\n\t\t\tvar comandos = divs[i].getElementsByTagName('input')[0].value;\r\n\t\t\tcomandos = comandos.replace(/\\$/g, '').replace(/\\s/g, ''); // remover espacos e $\r\n\t\t\t\r\n\t\t\tif (!empty(comandos)) {\r\n\t\t\t\tcomandos = comandos.split(','); // dividir comando pela virgula\r\n\t\t\t\t\r\n\t\t\t\tvar rd = 0;\r\n\t\t\t\tvar rs = 0;\r\n\t\t\t\tvar rt = 0;\r\n\t\t\t\tvar imm = 0;\r\n\t\t\t\tvar addr = 0;\r\n\t\t\t\t\r\n\t\t\t\tif (op == TIPO_R) {\r\n\t\t\t\t\trd = Number(comandos[0]);\r\n\t\t\t\t\trs = Number(comandos[1]);\r\n\t\t\t\t\tif (instrucao != 'not') {\r\n\t\t\t\t\t\trt = Number(comandos[2]);\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if (op == TIPO_J) {\r\n\t\t\t\t\taddr = Number(comandos[0]);\r\n\t\t\t\t} else {\r\n\t\t\t\t\trt = Number(comandos[0]);\r\n\t\t\t\t\tif (instrucao == 'lw' || instrucao == 'sw') {\r\n\t\t\t\t\t\tvar index1 = comandos[1].indexOf('(');\r\n\t\t\t\t\t\tvar index2 = comandos[1].indexOf(')');\r\n\t\t\t\t\t\timm = comandos[1].substring(0, index1);\r\n\t\t\t\t\t\trs = comandos[1].substring(index1+1, index2);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\trs = Number(comandos[1]);\r\n\t\t\t\t\t\timm = Number(comandos[2]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\timprimir(instrucao, op, rs, rt, rd, funct, imm, addr);\r\n\t\t\t} // if empty\r\n\t\t} catch (error) {}\r\n\t} // for\r\n}", "title": "" }, { "docid": "28e79faef008727f4804693cbab4c59d", "score": "0.5905553", "text": "function aterrizarElemento(e) {\n\t\t\t\te.preventDefault();\n\t\t\t\tlistaHecha.style.background = \"#99b5b9\";//cambia el color de fondo a azul cuando la tarjeta pasa por encima\n\t\t\t}", "title": "" }, { "docid": "22007926067aab66a4d642a356eaa121", "score": "0.59040976", "text": "function mostrarDescendente() {\n\n\n let listaCursos = getListaCursosActii();\n\n listaCursos.reverse(); // copiar esto abajo\n\n let cuerpoTabla = document.querySelector('#table tbody');\n cuerpoTabla.innerHTML = '';\n\n for (let i = 0; i < listaCursos.length; i++) {\n let fila = cuerpoTabla.insertRow(i);\n let cSeleccionar = fila.insertCell();\n let cNombre = fila.insertCell();\n let cCodigo = fila.insertCell();\n let cCantidad = fila.insertCell();\n let cCosto = fila.insertCell();\n\n\n let sSeleccionar = document.createTextNode(\"\");\n let sNombre = document.createTextNode(listaCursos[i][0]);\n let sCodigo = document.createTextNode(listaCursos[i][1]);\n let sCantidad = document.createTextNode(listaCursos[i][2]);\n let sCosto = document.createTextNode(listaCursos[i][3]);\n\n cSeleccionar.appendChild(sSeleccionar);\n cNombre.appendChild(sNombre);\n cCodigo.appendChild(sCodigo);\n cCantidad.appendChild(sCantidad);\n cCosto.appendChild(sCosto);\n\n\n // inicio boton Editar \n let botonEditar = document.createElement(\"button\");\n botonEditar.innerText = \"Editar\";\n botonEditar.dataset.codigo = (listaCursos[i][2]);\n botonEditar.classList.add (\"botonTabla\");\n botonEditar.classList.add (\"botonNormal\");\n\n\n botonEditar.addEventListener(\"click\", editar);\n\n cSeleccionar.appendChild(botonEditar);\n\n\n\n // inicio boton deshabilitar \n let botonDeshabilitar = document.createElement(\"button\");\n botonDeshabilitar.innerText = \"Desactivar\";\n botonDeshabilitar.dataset.codigo = (listaCursos[i][2]);\n botonDeshabilitar.classList.add(\"botonTabla\");\n botonDeshabilitar.classList.add(\"botonDesactivar\");\n\n botonDeshabilitar.addEventListener(\"click\",deshabilitar);\n \n cSeleccionar.appendChild(botonDeshabilitar);\n \n\n \n }\n }", "title": "" }, { "docid": "597f1d6ab034978f02adcfb2d3c6811d", "score": "0.5903239", "text": "function agregar_factura() {\n\n this.disabled = true;//Desactivo el boton agregar que he oprimido \n var columna_del_btn = this.parentNode;//Guardo el elemento padre del boton al que le he dado click y me saca <td>\n var fila = columna_del_btn.parentNode;//Guardo el elemento padre de la columna <td> con lo que me da un <tr>\n var elementos_fila = fila.childNodes;//Guardo los elementos hijo de la fila <tr>\n var cantidad_inventario = elementos_fila[7].textContent - 1;//Guardo la cantidad del elemento al que \n //le di click que esta en la posicion 7 y le resto 1\n elementos_fila[7].textContent = cantidad_inventario;//Actualizo el valor de mi cantidad \n var cantidad_factura = 0;//Creo una variable Cantidad Factura y la inicio en 0\n cantidad_factura++;//Cada que oprima un boton agregar se aumentara en uno este valor pero como \n //solo se llama una vez en cada elemento dara 1\n //console.log(elementos_fila[1].textContent); Saca el código del elemento al que le di click ya que esta en la posición[1]\n //Si quisiera sacar el nombre del artículo seria el indice [3]. \n \n var fila_nueva = document.createElement(\"tr\");//Me creo el elemento <tr> para una fila nueva\n\n for (var c = 0; c < elementos_fila.length; c++) {//Recorro los elementos de mi fila\n if (c == 1) {//si c llega al indice 1 quiere decir que en la tabla factura en esa posicion se va \n //A colocar la siguiente columna en el elemento fila que hemos creado\n fila_nueva.innerHTML += '<td class=\"columna\">' + elementos_fila[1].textContent + '</td>';\n //Se coloca en la columna el primer elemento de la tabla inventario que seria código en la fila\n }\n else if (c == 2) {\n fila_nueva.innerHTML += '<td class=\"columna\">' + elementos_fila[3].textContent + '</td>';\n //Se coloca en la columna el segundo elemento de la tabla inventario que seria artículo en la fila\n\n }\n else if (c == 3) {\n fila_nueva.innerHTML += '<td class=\"columna\">' + elementos_fila[5].textContent + '</td>';\n //Se coloca en la columna el segundo elemento de la tabla inventario que seria V/U en la fila\n }\n else if (c == 4) {\n fila_nueva.innerHTML += '<td class=\"columna\"><i class=\"fa fa-minus\"></i>' + cantidad_factura + '<i class=\"fa fa-plus\"></i></td>';\n //Se coloca en la columna el icono de menor la variable cantidad_factura que sera 1 y el icono mayor\n }\n else if (c == 5) {\n fila_nueva.innerHTML += '<td class=\"columna\"><button class=\"eliminar\">Eliminar</button></td>';\n //Coloco un boton en la columna llamado eliminar \n }\n //Lo que hace fila_nueva es agregar dentro de esa fila todas las columnas que hemos creado con su\n //Respectivo contenido\n\n }\n th.appendChild(fila_nueva);//Las filas de la tabla nueva las adjunto dentro del thead\n tabla_factura.appendChild(th);//En la variable tabla_factura ponemos el thead ya que en este estan las filas\n //Recorro los botones eliminar para saber cual ha sido clickeado y realizar el evento de borrar fila\n for (var b = 0; b < btn_eliminar.length; b++) {\n btn_eliminar[b].addEventListener(\"click\", eliminarfila);//evento click a un determinado boton eliminar \n //y le digo que debe hacer llamando la funcion \n\n }\n //Recorro los botones que tengas la clase fa-minus que ya guarde en una variable\n for (var menos = 0; menos < btn_minus.length; menos++) {\n\n btn_minus[menos].addEventListener(\"click\", botonmenos);//Al que haya sido clickeado le ponemos\n //un evento click y una funcionalidad llamando a la funcion\n\n }\n //Recorro los botones que tengas la clase fa-plus que ya guarde en una variable\n for (var mas = 0; mas < btn_plus.length; mas++) {\n\n btn_plus[mas].addEventListener(\"click\", botonmas)//Al que haya sido clickeado le ponemos\n //un evento click y una funcionalidad llamando a la funcion\n\n }\n}", "title": "" }, { "docid": "1e934d64f7917dc6a801cf8b1c626207", "score": "0.5887615", "text": "function etapa3() {\n countListaNomeCrianca = 0; //count de quantas vezes passou na lista de crianças\n\n //recebendo H3 e setando nela o texto com o nome do cliente\n var tituloDaEtapa = document.querySelector(\"#tituloDaEtapa\");\n tituloDaEtapa.textContent = \"3º Etapa - Colaborador\";\n\n document.getElementById('selecionarFuncionarios').style.display = ''; //habilita a etapa 3\n document.getElementById('selecionarAniversariantes').style.display = 'none'; //desabilita a etapa 2\n \n //seta a quantidade de criança que foi definida no input de controle \"qtdCrianca\"\n document.getElementById('qtdCrianca').value = quantidadeCrianca2;\n \n //percorre a lista de nomes das crianças e monta o texto de confirmação para as crianças\n var tamanhoListaNomeCrianca = listaNomeCrianca.length; //recebe o tamanho da lista em uma variavel\n\n listaNomeCrianca.forEach((valorAtualLista) => {\n if(countListaNomeCrianca == 0){\n textoConfirmacaoCrianca = \"Aniversariantes: \";\n }\n countListaNomeCrianca++;\n \n if(countListaNomeCrianca == tamanhoListaNomeCrianca){\n textoConfirmacaoCrianca = textoConfirmacaoCrianca + valorAtualLista;\n }else{\n textoConfirmacaoCrianca = textoConfirmacaoCrianca + valorAtualLista + \" / \";\n }\n \n }); \n countListaNomeCrianca = 0;\n \n if(tamanhoListaNomeCrianca == 0){\n textoConfirmacaoCrianca = \"Evento não possui aniversariante.\";\n }\n \n //seta o texto informação da crianças na ultima etapa\n var confirmacaoInfCrianca = document.querySelector(\"#criancasInf\");\n confirmacaoInfCrianca.textContent = textoConfirmacaoCrianca; \n \n }", "title": "" }, { "docid": "feb885a393fcb4b5e7fe836d211d6c61", "score": "0.5872977", "text": "function aviso_CEP(campo, escolha){\r\r\n\r\r\n //TEXTO SIMPLES\r\r\n var label = document.createElement(\"label\")\r\r\n\r\r\n //ESCOLHENDO O TIPO DE AVISO\r\r\n if (escolha == 1 ){ \r\r\n\r\r\n //TEXTO DE AVISO DE OBRIGATORIO\r\r\n var text = document.createTextNode(\"Preenchimento Obrigatório\")\r\r\n\r\r\n //COLOCANDO O ID NA LABEL E BR CRIADAS\r\r\n label.id = \"aviso_cep\"\r\r\n\r\r\n //INSERINDO O TEXTO DE AVISO NO CAMPO QUE SERA COLOCADO\r\r\n label.appendChild(text)\r\r\n }\r\r\n else if (escolha == 2){ \r\r\n\r\r\n //COLOCANDO O ID NA LABEL E BR CRIADAS\r\r\n label.id = \"aviso_cep1\"\r\r\n\r\r\n //TEXTO DE AVISO DE INVÁLIDO\r\r\n var text = document.createTextNode(\"CEP inválido!\")\r\r\n\r\r\n //INSERINDO O TEXTO DE AVISO NO CAMPO QUE SERA COLOCADO\r\r\n label.appendChild(text)\r\r\n }\r\r\n\r\r\n //REFERENCIA DE ONDE SERA COLOCADO O ITEM\r\r\n var lista = document.getElementsByTagName(\"p\")[5]\r\r\n var itens = document.getElementsByTagName(\"/p\") \r\r\n\r\r\n //INSERINDO O AVISO EM VERMELHO\r\r\n lista.insertBefore( label, itens[0]);\r\r\n label.style.color = \"red\";\r\r\n\r\r\n //MUDANDO O BACKGROUND\r\r\n erro(campo)\r\r\n}", "title": "" }, { "docid": "115a5822df8ab0682ffd27f5ebac47c9", "score": "0.5856396", "text": "function carga_logica_informe_anatomia_coronaria() {\r\n\tinicializar_variables_anatomia_coronaria();\r\n\tactualizarDibujoCanvasAnatomiaCoronaria();\r\n\treiniciar_control_seleccion_lesion();\r\n\tcargar_areas_de_seleccion_arterias();\r\n\tcargar_coordenadas_de_lesiones();\r\n}", "title": "" }, { "docid": "c85054c630917d6e98d7c958d4a66b85", "score": "0.58460563", "text": "function BdConsultaDescGeneralInmuebleComple(pFolio, pTipoConstruccion, pUsuarioOperacion) {\n let etiquetaLOG = `${ ruta } [Usuario: ${ pUsuarioOperacion }] METODO: BdConsultaDescGeneralInmuebleComple `;\n try {\n logger.info(etiquetaLOG);\n const client = new Pool(configD);\n\n let sQuery = `SELECT * FROM fConsultaInmConstrucComplemento('${pFolio}','${pTipoConstruccion}');`;\n\n logger.info(`${ etiquetaLOG } ${sQuery} `);\n\n return new Promise(function(resolve, reject) {\n client.query(sQuery)\n .then(response => {\n client.end();\n logger.info(etiquetaLOG + 'RESULTADO: ' + JSON.stringify(response.rows));\n resolve(response.rows);\n })\n .catch(err => {\n client.end()\n logger.error(etiquetaLOG + 'ERROR: ' + err.message + ' CODIGO_BD(' + err.code + ')');\n reject(err.message + ' CODIGO_BD(' + err.code + ')');\n })\n });\n } catch (err) {\n logger.error(`${ ruta } ERROR: ${ err } `);\n throw (`Se presentó un error en BdConsultaDescGeneralInmuebleComple: ${err}`);\n }\n}", "title": "" }, { "docid": "69973c04b6f4f1798a86ea0531116847", "score": "0.5840796", "text": "function agregarGuiasRelacion(codigoGuiarem,serie,numero,color){\n\t\t\n\t\tvar total=$('input[id^=\"accionAsociacionGuiarem\"][value!=\"0\"]').length;\n\t\tn = document.getElementById('idTableGuiaRelacion').rows.length;\n\t\t\n\t\tif(total==0){\n\t\t\t/***mmostramos el div tr de guias relacionadas**/\n\t\t\t$(\"#idDivGuiaRelacion\").show(200);\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tproveedor=$(\"#proveedor\").val();\n\t\tj=n;\n\t\tfila='<tr id=\"idTrDetalleRelacion_'+j+'\">';\n\t\tfila+='<td>';\n\t\tfila+='<a href=\"javascript:void(0);\" onclick=\"deseleccionarGuiaremision('+codigoGuiarem+','+j+')\" title=\"Deseleccionar Guia de remision\">';\n\t\tfila+='x';\n\t\tfila+='</a>';\n\t\tfila+='</td>';\n\t\tfila+='<td>'+j+'</td>';\n\t\tfila+='<td>'+serie+'</td>';\n\t\tfila+='<td>'+numero+'</td>';\n\t\t/**accionAsociacionGuiarem nuevo:1**/\n\t\tfila+='<td><div style=\"width:10px;height:10px;background-color:'+color+';border:1px solid black\"></div>';\n\t\tfila+='\t<input type=\"hidden\" id=\"codigoGuiaremAsociada['+j+']\" name=\"codigoGuiaremAsociada['+j+']\" value=\"'+codigoGuiarem+'\" />';\n\t\tfila+='<input type=\"hidden\" id=\"accionAsociacionGuiarem['+j+']\" name=\"accionAsociacionGuiarem['+j+']\" value=\"1\" />';\n\t\tfila+='<input type=\"hidden\" id=\"proveedorRelacionGuiarem['+j+']\" name=\"proveedorRelacionGuiarem['+j+']\" value=\"'+proveedor+'\" />';\n\t\tfila+='</td>';\n\t\tfila+='</tr>';\n\t\t$(\"#idTableGuiaRelacion\").append(fila);\n\t\t \n\t}", "title": "" }, { "docid": "f5fe1b26d49236035cec34a6be929c53", "score": "0.58226454", "text": "function alianzaMercado(){\r\n\t\tvar a = find(\"//tr[@class='rbg']\", XPFirst).parentNode;\r\n\r\n\t\t// Prepara la insercion de la nueva columna\r\n\t\tvar b = a.getElementsByTagName(\"TR\");\r\n\t\t// FIXME: Apanyo para Firefox. FF mete nodos de tipo texto vacios\r\n\t\tb[0].childNodes[b[0].childNodes.length == 3 ? 1 : 0].setAttribute('colspan', '8');\r\n\t\tb[b.length - 1].childNodes[0].setAttribute(\"colspan\", \"8\");\r\n\r\n\t\t// Crea e inserta la columna\r\n\t\tvar columna = document.createElement(\"TD\");\r\n\t\tcolumna.innerHTML = T('ALIANZA');\r\n\t\tb[1].appendChild(columna);\r\n\r\n\t\t// Rellena la columna con los nombres de las alianzas\r\n\r\n\t\tfor(var i = 2; i < b.length - 1; i++){\r\n\t\t\tvar alianza = document.createElement(\"TD\");\r\n\t\t\t// FIXME: Apanyo para Firefox. FF mete nodos de tipo texto vacios\r\n\t\t\tvar alianza_txt = b[i].childNodes[b[i].childNodes.length == 12 ? 8 : 4].getAttribute('title');\r\n\t\t\tif (alianza_txt != null) alianza.innerHTML = alianza_txt;\r\n\t\t\tb[i].appendChild(alianza);\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "109797f5cd0c9def78ebf01a6ac03ad1", "score": "0.58205897", "text": "function probar_conexion_red(){\n /*--- primero probamos la conexion a la red \n se crea un campo donde se carga una imagen, si esta carga hay conexion ---*/\n var tabla = $('#dataTable').attr(\"id\");\n addRow(tabla);\n}", "title": "" }, { "docid": "109797f5cd0c9def78ebf01a6ac03ad1", "score": "0.58205897", "text": "function probar_conexion_red(){\n /*--- primero probamos la conexion a la red \n se crea un campo donde se carga una imagen, si esta carga hay conexion ---*/\n var tabla = $('#dataTable').attr(\"id\");\n addRow(tabla);\n}", "title": "" }, { "docid": "189c849b80a3e67b04ee43876f34cff1", "score": "0.58161366", "text": "function alianzaMercado(){\n\t\tvar a = find(\"//tr[@class='rbg']\", XPFirst).parentNode;\n\n\t\t// Prepara la insercion de la nueva columna\n\t\tvar b = a.getElementsByTagName(\"TR\");\n\t\t// FIXME: Apaño para Firefox. FF mete nodos de tipo texto vacios\n\t\tb[0].childNodes[b[0].childNodes.length == 3 ? 1 : 0].setAttribute('colspan', '8');\n\t\tb[b.length - 1].childNodes[0].setAttribute(\"colspan\", \"8\");\n\n\t\t// Crea e inserta la columna\n\t\tvar columna = document.createElement(\"TD\");\n\t\tcolumna.innerHTML = T('ALIANZA');\n\t\tb[1].appendChild(columna);\n\n\t\t// Rellena la columna con los nombres de las alianzas\n\t\tfor(var i = 2; i < b.length - 1; i++){\n\t\t\tvar alianza = document.createElement(\"TD\");\n\t\t\t// FIXME: Apaño para Firefox. FF mete nodos de tipo texto vacios\n\t\t\tvar alianza_txt = b[i].childNodes[b[i].childNodes.length == 12 ? 8 : 4].getAttribute('title');\n\t\t\tif (alianza_txt != null) alianza.innerHTML = alianza_txt;\n\t\t\tb[i].appendChild(alianza);\n\t\t}\n\t}", "title": "" }, { "docid": "7e4dd0a337eb1e4f56700e70a22e0ae2", "score": "0.5806925", "text": "function agregarAlCarrito() {\n /* Función que agrega un producto al carrito. utiliza el atributo \"alt\" del botón clickeado para obtener el código del producto a agregar. Cada vez que se agrega un producto se vuelve a generar la tabla que se muestra en pantalla.*/\n var elCodigo = $(this).attr(\"alt\");\n var laPosicion = buscarCodigoProducto(elCodigo);\n var productoAgregar = listadoProductos[laPosicion];\n carrito[carrito.length] = productoAgregar;\n armarTablaCarrito();\n }", "title": "" }, { "docid": "c4fedc7efcd84926c46b58d2d1d1655a", "score": "0.57997465", "text": "function aniadirEmpleadoTabla(empleado) {\n\tvar tablaEmpleados = document.getElementById(\"tablaEmpleados\");\t\n\tvar celda;\n\tvar contadorCeldas = 0;\n\tvar fila = tablaEmpleados.insertRow(-1);\n\n\t//Vamos creando las celdas con el contenido del objeto\n\tvar newCell = fila.insertCell(contadorCeldas);\n\tnewCell.innerHTML = empleado.nombre;\n\tcontadorCeldas++;\n\t\n\tvar newCell = fila.insertCell(contadorCeldas);\n\tnewCell.innerHTML = empleado.dni;\n\tcontadorCeldas++;\n\n\tvar newCell = fila.insertCell(contadorCeldas);\n\tnewCell.innerHTML = empleado.telefono;\n\tcontadorCeldas++;\n\n\tif (empleado instanceof Fisioterapeuta){\n\t\tvar newCell = fila.insertCell(contadorCeldas);\n\t\tnewCell.innerHTML = empleado.horasConsulta;\n\t\tcontadorCeldas++;\n\t\t\n\t\t//Respetamos los huecos vacios con atributos del monitor\n\t\tvar newCell = fila.insertCell(contadorCeldas);\n\t\tnewCell.innerHTML = \"-\";\n\t\tcontadorCeldas++;\n\n\t\tvar newCell = fila.insertCell(contadorCeldas);\n\t\tnewCell.innerHTML = \"-\";\n\t\tcontadorCeldas++;\n\n\t\tvar newCell = fila.insertCell(contadorCeldas);\n\t\tnewCell.innerHTML = \"-\";\n\t\tcontadorCeldas++;\n\n\t}else{\n\t\tvar newCell = fila.insertCell(contadorCeldas);\n\t\tnewCell.innerHTML = \"-\";\n\t\tcontadorCeldas++;\n\t\t\n\t\tvar newCell = fila.insertCell(contadorCeldas);\n\t\tnewCell.innerHTML = empleado.actividades;\n\t\tcontadorCeldas++;\n\t\t\n\t\tvar newCell = fila.insertCell(contadorCeldas);\n\t\tnewCell.innerHTML = empleado.horasClase;\n\t\tcontadorCeldas++;\n\t\t\n\t\tvar newCell = fila.insertCell(contadorCeldas);\n\t\tnewCell.innerHTML = empleado.horasComun;\n\t\tcontadorCeldas++;\n\t}\n\t\n\tvar newCell = fila.insertCell(contadorCeldas);\n\tnewCell.innerHTML = \"<button onclick=\\\"mostrarDescripcion(this)\\\">DESCRIPCION</button>\";\t\t\n\n}", "title": "" }, { "docid": "9bf77069f437089eda3b368a4b1e622c", "score": "0.57859087", "text": "function accionBuscar ()\n {\n configurarPaginado (mipgndo,'DTOBuscarMatricesDTOActivas','ConectorBuscarMatricesDTOActivas',\n 'es.indra.sicc.cmn.negocio.auditoria.DTOSiccPaginacion', armarArray());\n }", "title": "" }, { "docid": "4a3e193b4fe2d6d91d8d2774511e8a67", "score": "0.5776127", "text": "function campos_fecha(tabla)\n{\n\tswitch(tabla)\n\t\t\t\t{\n\t\t\t\tcase \"facturacion\":\n\t\t\t\t\t{\n\t\t\t\t\t\tCalendar.setup({\n \t\t\tinputField : 'finicio', // id of the input field\n \t\t\tifFormat : '%d-%m-%Y', // format of the input field\n \t\t\tshowsTime : true, // will display a time selector\n \t\t\tbutton : 'f_trigger_finicio', // trigger for the calendar (button ID)\n \t\t\tsingleClick : false, // double-click mode\n \t\t\tstep : 1 // show all years in drop-down boxes (instead of every other year as default)\n\t\t\t\t\t})\n\t\t\t\t\t\tCalendar.setup({\n \t\t\tinputField : 'duracion', // id of the input field\n \t\t\tifFormat : '%d-%m-%Y', // format of the input field\n \t\t\tshowsTime : true, // will display a time selector\n \t\t\tbutton : 'f_trigger_duracion', // trigger for the calendar (button ID)\n \t\t\tsingleClick : false, // double-click mode\n \t\t\tstep : 1 // show all years in drop-down boxes (instead of every other year as default)\n\t\t\t\t\t})\n\t\t\t\t\t\tCalendar.setup({\n \t\t\tinputField : 'renovacion', // id of the input field\n \t\t\tifFormat : '%d-%m-%Y', // format of the input field\n \t\t\tshowsTime : true, // will display a time selector\n \t\t\tbutton : 'f_trigger_renovacion', // trigger for the calendar (button ID)\n \t\t\tsingleClick : false, // double-click mode\n \t\t\tstep : 1 // show all years in drop-down boxes (instead of every other year as default)\n\t\t\t\t\t})\n\t\t\t\t\t\n\t\t\t\t\t}break\n\t\t\t\t\tcase \"pcentral\":\n\t\t\t\t\t{\n\t\t\t\t\t\tCalendar.setup({\n \t\t\tinputField : 'cumple', // id of the input field\n \t\t\tifFormat : '%d-%m-%Y', // format of the input field\n \t\t\tshowsTime : true, // will display a time selector\n \t\t\tbutton : 'f_trigger_cumple', // trigger for the calendar (button ID)\n \t\t\tsingleClick : false, // double-click mode\n \t\t\tstep : 1 // show all years in drop-down boxes (instead of every other year as default)\n\t\t\t\t\t})\n\t\t\t\t\t}break\n\t\t\t\t\tcase \"pempresa\":\n\t\t\t\t\t{\n\t\t\t\t\t\tCalendar.setup({\n \t\t\tinputField : 'cumple', // id of the input field\n \t\t\tifFormat : '%d-%m-%Y', // format of the input field\n \t\t\tshowsTime : true, // will display a time selector\n \t\t\tbutton : 'f_trigger_cumple', // trigger for the calendar (button ID)\n \t\t\tsingleClick : false, // double-click mode\n \t\t\tstep : 1 // show all years in drop-down boxes (instead of every other year as default)\n\t\t\t\t\t})\n\t\t\t\t\t}break\n\t\t\t\t\tcase \"z_facturacion\":\n\t\t\t\t\t{\n\t\t\t\t\t\tCalendar.setup({\n \t\t\tinputField : 'finicio', // id of the input field\n \t\t\tifFormat : '%d-%m-%Y', // format of the input field\n \t\t\tshowsTime : true, // will display a time selector\n \t\t\tbutton : 'f_trigger_finicio', // trigger for the calendar (button ID)\n \t\t\tsingleClick : false, // double-click mode\n \t\t\tstep : 1 // show all years in drop-down boxes (instead of every other year as default)\n\t\t\t\t\t})\n\t\t\t\t\t\t\n\t\t\t\t\t\tCalendar.setup({\n \t\t\tinputField : 'renovacion', // id of the input field\n \t\t\tifFormat : '%d-%m-%Y', // format of the input field\n \t\t\tshowsTime : true, // will display a time selector\n \t\t\tbutton : 'f_trigger_renovacion', // trigger for the calendar (button ID)\n \t\t\tsingleClick : false, // double-click mode\n \t\t\tstep : 1 // show all years in drop-down boxes (instead of every other year as default)\n\t\t\t\t\t})\n\t\t\t\t\t}break\n\t\t\t\t\tcase \"empleados\":\n\t\t\t\t\t{\n\t\t\t\t\t\tCalendar.setup({\n \t\t\tinputField : 'fnac', // id of the input field\n \t\t\tifFormat : '%d-%m-%Y', // format of the input field\n \t\t\tshowsTime : true, // will display a time selector\n \t\t\tbutton : 'f_trigger_fnac', // trigger for the calendar (button ID)\n \t\t\tsingleClick : false, // double-click mode\n \t\t\tstep : 1 // show all years in drop-down boxes (instead of every other year as default)\n\t\t\t\t\t})\n\t\t\t\t\t\t\n\t\t\t\t\t\tCalendar.setup({\n \t\t\tinputField : 'fcon', // id of the input field\n \t\t\tifFormat : '%d-%m-%Y', // format of the input field\n \t\t\tshowsTime : true, // will display a time selector\n \t\t\tbutton : 'f_trigger_fcon', // trigger for the calendar (button ID)\n \t\t\tsingleClick : false, // double-click mode\n \t\t\tstep : 1 // show all years in drop-down boxes (instead of every other year as default)\n\t\t\t\t\t})\n\t\t\t\t\t}break\n case \"entradas_salidas\":\n\t\t\t\t\t{\n\t\t\t\t\t\tCalendar.setup({\n \t\t\tinputField : 'entrada', // id of the input field\n \t\t\tifFormat : '%d-%m-%Y', // format of the input field\n \t\t\tshowsTime : true, // will display a time selector\n \t\t\tbutton : 'f_trigger_entrada', // trigger for the calendar (button ID)\n \t\t\tsingleClick : false, // double-click mode\n \t\t\tstep : 1 // show all years in drop-down boxes (instead of every other year as default)\n\t\t\t\t\t})\n\n\t\t\t\t\t\tCalendar.setup({\n \t\t\tinputField : 'salida', // id of the input field\n \t\t\tifFormat : '%d-%m-%Y', // format of the input field\n \t\t\tshowsTime : true, // will display a time selector\n \t\t\tbutton : 'f_trigger_salida', // trigger for the calendar (button ID)\n \t\t\tsingleClick : false, // double-click mode\n \t\t\tstep : 1 // show all years in drop-down boxes (instead of every other year as default)\n\t\t\t\t\t})\n\t\t\t\t\t}break\n\t\t\t\t}\n\t\t\t\t//editor()\n}", "title": "" }, { "docid": "0ec8646e2fc78a31000ce49b89fdd3ff", "score": "0.5748596", "text": "function MostrarRegistro(){\n //declaramos una variable para guardar los datos\n var listaproductos=Mostrar();\n //selecciono el tbody de la tabla donde voy a guardar\n tbody = document.querySelector(\"#tbRegistro tbody\");\n tbody.innerHTML=\"\";\n //Agregamos las columnas que se registren\n for(var i=0; i<listaproductos.length;i++){\n //Declaramos una variable para la fila\n var fila=tbody.insertRow(i);\n //declaramos variables para los titulos\n var titulonombre = fila.insertCell(0);\n var tituloprecio = fila.insertCell(1);\n var titulocategoria = fila.insertCell(2);\n var titulocantidad = fila.insertCell(3);\n //agregamos valores\n titulonombre.innerHTML = listaproductos[i].nombre;\n tituloprecio.innerHTML = listaproductos[i].precio;\n titulocategoria.innerHTML = listaproductos[i].categoria;\n titulocantidad.innerHTML = listaproductos[i].cantidad;\n tbody.appendChild(fila);\n }\n}", "title": "" }, { "docid": "80a59eac2a41b880fab1afcdfae50b50", "score": "0.57401836", "text": "function nuevo() {\n try {\n var iFila;\n bCambios = true;\n var oNF = $I(\"tblCatalogo\").insertRow(-1);\n iFila = oNF.rowIndex;\n oNF.id = -$I(\"tblCatalogo\").rows.length;\n oNF.nF = iFila;\n oNF.setAttribute(\"bd\", \"I\");\n oNF.setAttribute(\"height\", \"22px\");\n oNF.setAttribute(\"sw\", \"1\");\n oNF.attachEvent(\"onclick\", mm);\n oNF.onclick = function() { activarCombo(this.rowIndex); };\n \n //Imagen del mantenimiento de bd\n var oImgFI = oNF.insertCell(-1).appendChild(document.createElement(\"img\"));\n oImgFI.style.marginLeft = \"4px\";\n oImgFI.setAttribute(\"src\", \"../../../../Images/imgFI.gif\");\n oImgFI.setAttribute(\"textAlign\", \"center\");\n\n //Denominación\n oNF.insertCell(-1); \n var oInputDenom = document.createElement(\"input\");\n oInputDenom.setAttribute(\"type\", \"text\");\n oInputDenom.setAttribute(\"id\", \"Denominacion\" + iFila);\n oInputDenom.setAttribute(\"style\", \"width:380px; text-transform:uppercase;\");\n oInputDenom.setAttribute(\"maxLength\", \"80\");\n oInputDenom.setAttribute(\"class\", \"txtM\");\n oInputDenom.setAttribute(\"value\", \"\");\n oInputDenom.onkeyup = function() { mfa(this.parentNode.parentNode, 'U') };\n oNF.cells[enumTitulacion.denom].appendChild(oInputDenom);\n\n //Celda Tipo\n oNF.insertCell(-1);\n\n //Celda Modalidad\n oNF.insertCell(-1);\n\n //Celda Tic\n oNF.insertCell(-1);\n var oChkT = document.createElement(\"input\");\n oChkT.setAttribute(\"type\", \"checkbox\");\n oChkT.setAttribute(\"id\", \"chkTituloTic\" + iFila);\n oNF.cells[enumTitulacion.tic].setAttribute(\"style\", \"text-align:center;\");\n oNF.cells[enumTitulacion.tic].appendChild(oChkT);\n\n oChkT.onclick = function() { mfa(this.parentNode.parentNode, 'U') };\n\n //Celda Validacion\n oNF.insertCell(-1);\n var oChkV = document.createElement(\"input\");\n oChkV.setAttribute(\"type\", \"checkbox\");\n oChkV.setAttribute(\"id\", \"chkValidacion\" + iFila);\n oChkV.setAttribute(\"checked\", \"checked\" + iFila);\n oNF.setAttribute(\"chkV\", \"1\");\n oNF.cells[enumTitulacion.validado].setAttribute(\"style\", \"text-align:center;\");\n oNF.cells[enumTitulacion.validado].appendChild(oChkV);\n oChkV.onclick = function() { mfa(this.parentNode.parentNode, 'U') };\n\n //Celda RH\n oNF.insertCell(-1);\n var oChk = document.createElement(\"input\");\n oChk.setAttribute(\"type\", \"checkbox\");\n oChk.setAttribute(\"id\", \"chkRH\" + iFila);\n oChk.setAttribute(\"checked\", \"checked\" + iFila);\n oNF.setAttribute(\"chk\", \"1\");\n oNF.cells[enumTitulacion.rh].setAttribute(\"style\", \"text-align:center;\");\n oNF.cells[enumTitulacion.rh].appendChild(oChk);\n oChk.onclick = function() { mfa(this.parentNode.parentNode, 'U') };\n\n //ms(oNF);\n AccionBotonera(\"grabar\", \"H\");\n if (ie) oNF.click();\n else {\n var clickEvent = window.document.createEvent(\"MouseEvent\");\n clickEvent.initEvent(\"click\", false, true);\n oNF.dispatchEvent(clickEvent);\n }\n $I(\"divCatalogo\").scrollTop = $I(\"divCatalogo\").scrollHeight;\n oNF.cells[enumTitulacion.denom].children[0].focus();\n } catch (e) {\n mostrarErrorAplicacion(\"Error al añadir nueva titulacion\", e.message);\n }\n}", "title": "" }, { "docid": "a4b1ed5f64d154dc2b3ec72f9cf5a68d", "score": "0.57358414", "text": "function crear_ayudaclientes(texto_json) {\n\tvar objeto_ayudaclientes = eval('(' + texto_json + ')');\n\tvar tabla = document.getElementById(\"tabla_clientes\");\n\t// TRATAMOS TODOS LOS CLIENTES DE LA TABLA\n\tfor (var i = 0; i < objeto_ayudaclientes.lista_clientes.length; i++) {\n\t\t// CREO UNA FILA NUEVA\n\t\tvar fila = tabla.insertRow(i);\n\t\t// INSERTAMOS UNA CELDA EN LA FILA\n\t\tvar celda_nueva = fila.insertCell(0);\n\t\tcelda_nueva.width = 60;\n\t\tvar elemento_nuevo = document.createElement('input');\n\t\telemento_nuevo.id = \"cli\" + (i + 1);\n\t\telemento_nuevo.name = \"checkito\";\n\t\telemento_nuevo.type = \"checkbox\";\n\t\telemento_nuevo.onclick = new Function('comprobar_seleccion(this)');\n\t\tcelda_nueva.appendChild(elemento_nuevo);\n\t\t// INSERTAMOS LA SEGUNDA CELDA\n\t\tcelda_nueva = fila.insertCell(1);\n\t\tcelda_nueva.width = 130;\n\t\telemento_nuevo = document.createElement('input');\n\t\telemento_nuevo.id = \"cod\" + (i + 1);\n\t\telemento_nuevo.type = \"text\";\n\t\telemento_nuevo.size = 12;\n\t\telemento_nuevo.readonly = \"readonly\";\n\t\telemento_nuevo.value = objeto_ayudaclientes.lista_clientes[i].codigoCliente;\n\t\tcelda_nueva.appendChild(elemento_nuevo);\n\t\t// INSERTAMOS LA TERCERA CELDA\n\t\tcelda_nueva = fila.insertCell(2);\n\t\tcelda_nueva.width = 130;\n\t\telemento_nuevo = document.createElement('input');\n\t\telemento_nuevo.id = \"nom\" + (i + 1);\n\t\telemento_nuevo.type = \"text\";\n\t\telemento_nuevo.readonly = \"readonly\";\n\t\telemento_nuevo.value = objeto_ayudaclientes.lista_clientes[i].nombreCliente;\n\t\tcelda_nueva.appendChild(elemento_nuevo);\n\t}\n}", "title": "" }, { "docid": "720cf016612298690ba52d698183ff90", "score": "0.57333404", "text": "adicionarElementos() {\n let tabelaPacientes = document.querySelector(\"#tabela-pacientes\");\n const linhaTabela = document.createElement(\"tr\");\n linhaTabela.classList.add(\"paciente\");\n\n let montarTabela = `\n <td class=\"info-nome\">${this.nome}</td>\n <td class=\"info-peso\">${this.peso} Kg</td>\n <td class=\"info-altura\">${this.altura} M</td>\n <td class=\"info-imc\">${this.imc}</td>\n `;\n if (!this.deletarPaciente) {\n montarTabela += `<td class=\"info-resultado\">${this.resultado}</td>`;\n } else {\n montarTabela += `\n <td class=\"info-resultado\">\n <span style=\"display: block;\">${this.resultado}</span>\n <img src=\"./src/img/delete.png\" onclick=\"`+ \"`${Bpacientes.deletarPacientes(event)}`\" + `\" alt=\"\" style=\"display: block;\">\n </td>\n `;\n }\n\n linhaTabela.innerHTML = montarTabela;\n tabelaPacientes.appendChild(linhaTabela);\n }", "title": "" }, { "docid": "f474aabf25cc3c5142d8ee6eb51e6c84", "score": "0.57292175", "text": "function empezarDibujo() {\n pintarLinea = true;\n lineas.push([]);\n }", "title": "" }, { "docid": "cc449884b38439b6464186305e748a73", "score": "0.57226884", "text": "recorrerArbolConsulta(nodo) {\n //NODO INICIO \n if (this.tipoNodo('INICIO', nodo)) {\n this.recorrerArbolConsulta(nodo.hijos[0]);\n }\n //NODO L, ES LA LISTA DE CONSULTAS \n if (this.tipoNodo('L', nodo)) {\n //SE RECORREN TODOS LOS NODOS QUE REPRESENTAN UNA CONSULTA \n for (var i = 0; i < nodo.hijos.length; i++) {\n this.recorrerArbolConsulta(nodo.hijos[i]);\n this.reiniciar();\n // this.codigoTemporal += \"xxxxxxxxxxxxxxxxxxxx-\"+this.contadorConsola+\".\"+\"\\n\";\n }\n }\n //PARA RECORRER TODOS LOS ELEMENTOS QUE COMPONEN LA CONSULTA \n if (this.tipoNodo('CONSULTA', nodo)) {\n for (var i = 0; i < nodo.hijos.length; i++) {\n this.pathCompleto = false;\n this.controladorAtributoImpresion = false;\n this.controladorDobleSimple = false;\n this.controladorPredicado = false;\n this.recorrerArbolConsulta(nodo.hijos[i]);\n }\n }\n //PARA RECORRER TODOS LOS ELEMENTOS QUE COMPONEN LA CONSULTA \n if (this.tipoNodo('VAL', nodo)) {\n for (var i = 0; i < nodo.hijos.length; i++) {\n this.pathCompleto = false;\n this.controladorAtributoImpresion = false;\n this.controladorDobleSimple = false;\n this.controladorPredicado = false;\n this.recorrerArbolConsulta(nodo.hijos[i]);\n }\n }\n //PARA VERIFICAR EL TIPO DE ACCESO, EN ESTE CASO // \n if (this.tipoNodo('DOBLE', nodo)) {\n this.controladorDobleSimple = true;\n this.recorrerArbolConsulta(nodo.hijos[0]);\n }\n //PARA VERIFICAR EL TIPO DE ACCESO, EN ESTE CASO: /\n if (this.tipoNodo('SIMPLE', nodo)) {\n //Establecemos que se tiene un acceso de tipo DOBLE BARRA \n this.controladorDobleSimple = false;\n this.recorrerArbolConsulta(nodo.hijos[0]);\n }\n //PARA VERIFICAR SI EL ELEMENTO A BUSCAR ES UN IDENTIFICADOR \n if (this.tipoNodo('identificador', nodo)) {\n const str = nodo.hijos[0];\n this.busquedaElemento(str);\n }\n //PARA VERIFICAR SI LO QUE SE VA A ANALIZAR ES UN PREDICADO \n if (this.tipoNodo('PREDICADO', nodo)) {\n this.controladorPredicado = true;\n const identificadorPredicado = nodo.hijos[0];\n //Primero se procede a la búsqueda del predicado\n this.codigoTemporal += \"//Inicio ejecucion predicado\\n\";\n this.busquedaElemento(identificadorPredicado);\n //Seguidamente se resuelve la expresión\n let resultadoExpresion = this.resolverExpresion(nodo.hijos[1]);\n let anteriorPredicado = this.temporalGlobal.retornarString();\n this.temporalGlobal.aumentar();\n this.codigoTemporal += this.temporalGlobal.retornarString() + \"=\" + anteriorPredicado + \";\\n\";\n let predicadoVariable = this.temporalGlobal.retornarString();\n this.codigoTemporal += \"PXP = \" + predicadoVariable + \";\\n\";\n this.codigoTemporal += \"ubicarPredicado();\\n\";\n //SI EL RESULTADO ES DE TIPO ETIQUETA\n if (resultadoExpresion.tipo == 4) {\n let datos = resultadoExpresion.valor;\n let a = datos[0];\n let b = datos[1];\n let c = datos[2];\n let limite = this.consolaSalidaXPATH.length;\n for (var i = this.contadorConsola; i < limite; i++) {\n // salidaXPATH.getInstance().push(this.consolaSalidaXPATH[i].dameID());\n this.auxiliarPredicado(a, b, c, this.consolaSalidaXPATH[i]);\n }\n }\n //SI EL RESULTADO ES DE TIPO ETIQUETA\n if (resultadoExpresion.tipo == 1) {\n this.consolaSalidaXPATH.push(this.consolaSalidaXPATH[(this.contadorConsola + resultadoExpresion.valor) - 1]);\n this.contadorConsola = this.consolaSalidaXPATH.length - 1;\n }\n this.controladorPredicadoInicio = false;\n }\n //PARA VERIFICAR QUE ES UN PREDICADO DE UN ATRIBUTO\n if (this.tipoNodo('PREDICADO_A', nodo)) {\n //return this.recorrer(nodo.hijos[0]);\n const identificadorPredicadoAtributo = nodo.hijos[0];\n //RECORREMOS LO QUE VA DENTRO DE LLAVES PARA OBTENER EL VALOR\n //AQUI VA EL METODO RESOLVER EXPRESION DE SEBAS PUTO \n return this.recorrerArbolConsulta(nodo.hijos[1]);\n }\n //PARA VERIFICAR SI EL ELEMENTO A BUSCAR ES UN ATRIBUTO \n if (this.tipoNodo('atributo', nodo)) {\n this.controladorAtributoImpresion = true;\n const identificadorAtributo = nodo.hijos[0];\n if (this.inicioRaiz) {\n let limite = this.consolaSalidaXPATH.length;\n for (var i = this.contadorConsola; i < limite; i++) {\n let x = this.consolaSalidaXPATH[i];\n //let nodoBuscarAtributo = this.consolaSalidaXPATH[this.consolaSalidaXPATH.length - 1];\n let nodoBuscarAtributo = x;\n //CODIGO DE 3 DIRECCIONES \n this.codigoTemporal += \"P=\" + nodoBuscarAtributo.posicion + \";\\n\";\n let inicioRaizXML = this.temporalGlobal.retornarString();\n this.temporalGlobal.aumentar();\n //Ubicamos nuestra variabel a buscar en el principio del heap \n this.codigoTemporal += this.temporalGlobal.retornarString() + \"=HXP;\\n\";\n //Escribimos dentro del heap de XPATH el nombre del identificador a buscar \n for (var z = 0; z < identificadorAtributo.length; z++) {\n this.codigoTemporal += `heapXPATH[(int)HXP] = ${identificadorAtributo.charCodeAt(z)};\\n`;\n this.codigoTemporal += `HXP = HXP+1;\\n`;\n }\n this.codigoTemporal += `heapXPATH[(int)HXP] =-1;\\n`;\n this.codigoTemporal += `HXP = HXP+1;\\n`;\n let anteriorGlobal = this.temporalGlobal.retornarString();\n this.codigoTemporal += \"stackXPATH[(int)PXP]=\" + anteriorGlobal + \";\\n\";\n this.temporalGlobal.aumentar();\n this.codigoTemporal += \"busquedaAtributo();\\n\";\n //CODIGO DE 3 DIRECCIONES \n //Se procede a la búsqueda de los atributos en todos los nodos\n for (let entry of nodoBuscarAtributo.atributos) {\n let atributoTemporal = entry;\n let nombreAbributo = atributoTemporal.dameNombre();\n if (nombreAbributo == identificadorAtributo) {\n this.atributoID = identificadorAtributo;\n this.pathCompleto = true;\n // this.contadorConsola = i;\n // this.consolaSalidaXPATH.push(nodoBuscarAtributo);\n }\n }\n /*for (let entry of nodoBuscarAtributo.hijos) {\n this.busquedaAtributo(entry, identificadorAtributo);\n }*/\n if (this.controladorDobleSimple) {\n this.busquedaAtributo(x, identificadorAtributo);\n }\n }\n }\n else {\n this.inicioRaiz = true;\n for (let entry of this.ArrayEtiquetas) {\n let temp = entry;\n //CODIGO DE 3 DIRECCIONES \n this.codigoTemporal += \"P=\" + temp.posicion + \";\\n\";\n let inicioRaizXML = this.temporalGlobal.retornarString();\n this.temporalGlobal.aumentar();\n //Ubicamos nuestra variabel a buscar en el principio del heap \n this.codigoTemporal += this.temporalGlobal.retornarString() + \"=HXP;\\n\";\n //Escribimos dentro del heap de XPATH el nombre del identificador a buscar \n for (var z = 0; z < identificadorAtributo.length; z++) {\n this.codigoTemporal += `heapXPATH[(int)HXP] = ${identificadorAtributo.charCodeAt(z)};\\n`;\n this.codigoTemporal += `HXP = HXP+1;\\n`;\n }\n this.codigoTemporal += `heapXPATH[(int)HXP] =-1;\\n`;\n this.codigoTemporal += `HXP = HXP+1;\\n`;\n let anteriorGlobal = this.temporalGlobal.retornarString();\n this.codigoTemporal += \"stackXPATH[(int)PXP]=\" + anteriorGlobal + \";\\n\";\n this.temporalGlobal.aumentar();\n this.codigoTemporal += \"busquedaAtributo();\\n\";\n //CODIGO DE 3 DIRECCIONES \n for (let entry2 of temp.atributos) {\n let aTemp = entry2;\n let nameAtt = aTemp.dameNombre();\n if (nameAtt == identificadorAtributo) {\n this.atributoID = identificadorAtributo;\n this.pathCompleto = true;\n }\n }\n if (this.controladorDobleSimple) {\n this.busquedaAtributo(entry, identificadorAtributo);\n }\n }\n }\n }\n //PARA VERIFICAR SI EL ELEMENTO A BUSCAR ES CUALQUIER ELEMENTO \n if (this.tipoNodo('any', nodo)) {\n //SIGNIFICA ACCESO DOBLE\n if (this.controladorDobleSimple) {\n let controladorNuevoInicio = -1;\n let limite = this.consolaSalidaXPATH.length;\n for (var i = this.contadorConsola; i < limite; i++) {\n let temporal = this.consolaSalidaXPATH[i];\n for (let entry of temporal.hijos) {\n //insertamos TODOS los hijos\n this.codigoTemporal += \"P =\" + entry.posicion + \";\\n\";\n this.codigoTemporal += \"imprimirContenido();\\n\";\n this.consolaSalidaXPATH.push(entry);\n if (controladorNuevoInicio == -1)\n controladorNuevoInicio = this.consolaSalidaXPATH.length - 1;\n this.complementoAnyElement(entry);\n }\n }\n this.contadorConsola = controladorNuevoInicio;\n this.pathCompleto = true;\n }\n //SIGNIFICA ACCESO SIMPLE \n else {\n //Controlamos el nuevo acceso para cuando coloquemos un nuevo elemento en la lista \n let controladorNuevoInicio = -1;\n let limite = this.consolaSalidaXPATH.length;\n for (var i = this.contadorConsola; i < limite; i++) {\n let temporal = this.consolaSalidaXPATH[i];\n for (let entry of temporal.hijos) {\n //insertamos TODOS los hijos\n this.consolaSalidaXPATH.push(entry);\n if (controladorNuevoInicio == -1)\n controladorNuevoInicio = this.consolaSalidaXPATH.length - 1;\n }\n }\n this.contadorConsola = controladorNuevoInicio;\n this.pathCompleto = true;\n }\n }\n //PARA VERIFICAR SI EL ELEMENTO A BUSCAR ES UNA PALABRA RESERVADA que simplicaria un AXE \n if (this.tipoNodo('reservada', nodo)) {\n //return this.recorrer(nodo.hijos[0]);\n const identificador = nodo.hijos[0];\n this.auxiliarAxe = identificador;\n //VERIFICAMOS EL TIPO DE ACCESO DE AXE \n if (this.controladorDobleSimple)\n this.dobleSimpleAxe = true;\n }\n if (this.tipoNodo('AXE', nodo)) {\n //return this.recorrer(nodo.hijos[0]);\n if (this.dobleSimpleAxe)\n this.controladorDobleSimple = true;\n this.temporalGlobal.aumentar();\n //Ubicamos nuestra variabel a buscar en el principio del heap \n this.codigoTemporal += this.temporalGlobal.retornarString() + \"=HXP;\\n\";\n //Escribimos dentro del heap de XPATH el nombre del identificador a buscar \n for (var i = 0; i < this.auxiliarAxe.length; i++) {\n this.codigoTemporal += `heapXPATH[(int)HXP] = ${this.auxiliarAxe.charCodeAt(i)};\\n`;\n this.codigoTemporal += `HXP = HXP+1;\\n`;\n }\n this.codigoTemporal += `heapXPATH[(int)HXP] =-1;\\n`;\n this.codigoTemporal += `HXP = HXP+1;\\n`;\n this.codigoTemporal += \"PXP =\" + this.temporalGlobal.retornarString() + \";\\n\";\n this.codigoTemporal += \"ejecutarAxe();\\n\";\n //Si Solicita implementar el axe child\n if (this.auxiliarAxe == \"child\") {\n //ESCRIBIMOS LOS IFS RESPECTIVOS \n this.recorrerArbolConsulta(nodo.hijos[0]);\n }\n //Si necesitsa implementar el axe attribute\n if (this.auxiliarAxe == \"attribute\") {\n //Le cambiamos la etiqueta de identificador a atributo para fines de optimizacion de codigo\n nodo.hijos[0].label = \"atributo\";\n //Escribimos el codigo en C3D para la ejecución del axe atributo \n this.recorrerArbolConsulta(nodo.hijos[0]);\n }\n //Si necesitsa implementar el ancestor\n if (this.auxiliarAxe == \"ancestor\") {\n //Va a resolver el predicado o identificador que pudiese venir \n this.recorrerArbolConsulta(nodo.hijos[0]);\n }\n if (this.auxiliarAxe == \"descendant\") {\n this.controladorDobleSimple = true;\n this.recorrerArbolConsulta(nodo.hijos[0]);\n }\n //Reiniciamos la variable cuando ya se acabe el axe\n this.auxiliarAxe = \"\";\n }\n //PARA VERIFICAR SI EL ELEMENTO A BUSCAR ES UN ATRIBUTO \n if (this.tipoNodo('X', nodo)) {\n //return this.recorrer(nodo.hijos[0]);\n //const identificadorAtributo = nodo.hijos[0] as string;\n this.controladorDobleSimple = true;\n this.recorrerArbolConsulta(nodo.hijos[0]);\n /*\n EN ESTA PARTE SE VA A PROCEDER PARA IR A BUSCAR EL ELEMENTO SEGÚN TIPO DE ACCESO\n */\n }\n //PARA VERIFICAR SI SE NECESITAN TODOS LOS ATRIBUTOS DEL NODO ACTUAL \n if (this.tipoNodo('any_att', nodo)) {\n this.controladorText = true;\n const identificadorAtributo = nodo.hijos[0];\n //Verificamos el tipo de acceso\n //Significa acceso con prioridad\n if (this.controladorDobleSimple) {\n //VERIFICAMOS DESDE DONDE INICIAMOS\n if (!this.inicioRaiz) {\n this.inicioRaiz = true;\n for (let entry of this.ArrayEtiquetas) {\n this.codigoTemporal += \"P =\" + entry.posicion + \";\\n\";\n this.codigoTemporal += \"imprimirAtributoAny();\\n\";\n for (let att of entry.atributos) {\n // salidaXPATH.getInstance().push(att.dameNombre()+\"=\"+att.dameValor());\n }\n this.complementoAnnyAtributte(entry);\n }\n }\n else {\n let limite = this.consolaSalidaXPATH.length;\n for (var i = this.contadorConsola; i < limite; i++) {\n let entry = this.consolaSalidaXPATH[i];\n this.codigoTemporal += \"P =\" + entry.posicion + \";\\n\";\n this.codigoTemporal += \"imprimirAtributoAny();\\n\";\n for (let att of entry.atributos) {\n // salidaXPATH.getInstance().push(att.dameNombre()+\"=\"+att.dameValor());\n }\n this.complementoAnnyAtributte(entry);\n }\n }\n }\n //Acceso sin prioridad\n else {\n if (!this.inicioRaiz) {\n for (let entry of this.ArrayEtiquetas) {\n this.codigoTemporal += \"P =\" + entry.posicion + \";\\n\";\n this.codigoTemporal += \"imprimirAtributoAny();\\n\";\n for (let att of entry.atributos) {\n // salidaXPATH.getInstance().push(att.dameNombre()+\"=\"+att.dameValor());\n }\n }\n }\n else {\n let limite = this.consolaSalidaXPATH.length;\n for (var i = this.contadorConsola; i < limite; i++) {\n let entry = this.consolaSalidaXPATH[i];\n this.codigoTemporal += \"P =\" + entry.posicion + \";\\n\";\n this.codigoTemporal += \"imprimirAtributoAny();\\n\";\n for (let att of entry.atributos) {\n // salidaXPATH.getInstance().push(att.dameNombre()+\"=\"+att.dameValor());\n }\n }\n }\n }\n } //FIN ANNY ATT\n //PARA VERIFICAR SI SE ESTÁ INVOCANDO A LA FUNCIÓN TEXT() \n if (this.tipoNodo('text', nodo)) {\n this.controladorText = true;\n const identificadorAtributo = nodo.hijos[0];\n //Si se necesita el texto de el actual y los descendientes\n if (this.controladorDobleSimple) {\n for (var i = this.contadorConsola; i < this.consolaSalidaXPATH.length; i++) {\n /*if (this.consolaSalidaXPATH[i].dameValor() == \"\" || this.consolaSalidaXPATH[i].dameValor() == \" \") {\n \n } else {\n // salidaXPATH.getInstance().push(this.consolaSalidaXPATH[i].dameValor());\n }*/\n this.codigoTemporal += \"P=\" + this.consolaSalidaXPATH[i].posicion + \";\\n\";\n this.codigoTemporal += \"text();\\n\";\n this.complementoText(this.consolaSalidaXPATH[i]);\n }\n }\n else {\n //si necesita solo el texto del actual \n for (var i = this.contadorConsola; i < this.consolaSalidaXPATH.length; i++) {\n /* if (this.consolaSalidaXPATH[i].dameValor() == \"\" || this.consolaSalidaXPATH[i].dameValor() == \" \") {\n \n } else {\n //salidaXPATH.getInstance().push(this.consolaSalidaXPATH[i].dameValor());\n }*/\n this.codigoTemporal += \"P=\" + this.consolaSalidaXPATH[i].posicion + \";\\n\";\n this.codigoTemporal += \"text();\\n\";\n }\n }\n }\n //PARA VERIFICAR SI ES EL TIPO DE ACCESO AL PADRE: \":\" \n if (this.tipoNodo('puntos', nodo)) {\n const cantidad = nodo.hijos[0];\n //DOSPUNTOSSSSSSSSS\n if (cantidad.length == 2) {\n this.pathCompleto = true;\n if (this.auxiliarArrayPosicionPadres == -1) {\n this.auxiliarArrayPosicionPadres = this.arrayPosicionPadres.length - 1;\n }\n for (var i = this.auxiliarArrayPosicionPadres; i >= 0; i--) {\n let contadorHermanos = this.arrayPosicionPadres[i];\n let controladorInicio = 0;\n if (i > 0) {\n while (contadorHermanos != this.arrayPosicionPadres[i - 1]) {\n this.consolaSalidaXPATH.push(this.consolaSalidaXPATH[contadorHermanos]);\n this.codigoTemporal += \"P =\" + this.consolaSalidaXPATH[contadorHermanos].posicion + \";\\n\";\n if (controladorInicio == 0) {\n this.contadorConsola = this.consolaSalidaXPATH.length - 1;\n }\n controladorInicio++;\n contadorHermanos--;\n this.auxiliarArrayPosicionPadres = contadorHermanos;\n }\n }\n else {\n while (contadorHermanos >= 0) {\n this.consolaSalidaXPATH.push(this.consolaSalidaXPATH[contadorHermanos]);\n this.codigoTemporal += \"P =\" + this.consolaSalidaXPATH[contadorHermanos].posicion + \";\\n\";\n if (controladorInicio == 0) {\n this.contadorConsola = this.consolaSalidaXPATH.length - 1;\n }\n controladorInicio++;\n contadorHermanos--;\n this.auxiliarArrayPosicionPadres = contadorHermanos;\n }\n }\n break;\n }\n this.codigoTemporal += \"busquedaSimple();\\n\";\n }\n //SIGNIFICA QUE TIENE SOLO UN PUNTO \n else {\n this.pathCompleto = true;\n }\n ///DOS PUNTOOOOOOOOOOOOOOOOS\n }\n }", "title": "" }, { "docid": "81ea26534148afb66f52cafb98e12030", "score": "0.5713719", "text": "function fCidadeF10(opc,codCdd,foco,topo,objeto){\r\n let clsStr = new concatStr();\r\n clsStr.concat(\"SELECT A.CDD_CODIGO AS CODIGO,A.CDD_NOME AS DESCRICAO\" );\r\n clsStr.concat(\" ,A.CDD_CODEST AS UF\" ); \r\n clsStr.concat(\" FROM CIDADE A\" );\r\n \r\n let tblCdd = \"tblCdd\";\r\n let tamColNome = \"29em\";\r\n if( typeof objeto === 'object' ){\r\n for (var key in objeto) {\r\n switch( key ){\r\n case \"ativo\":\r\n clsStr.concat( \" {AND} (A.CDD_ATIVO='\"+objeto[key]+\"')\",true); \r\n break; \r\n case \"codcdd\":\r\n clsStr.concat( \" {WHERE} (A.CDD_CODIGO='\"+objeto[key]+\"')\",true); \r\n break; \r\n case \"tamColNome\": \r\n tamColNome=objeto[key]; \r\n break; \r\n case \"tbl\": \r\n tblCdd=objeto[key];\r\n break; \r\n case \"where\": \r\n clsStr.concat(objeto[key],true); \r\n break; \r\n }; \r\n }; \r\n };\r\n sql=clsStr.fim();\r\n console.log(sql);\r\n // \r\n if( opc == 0 ){ \r\n //////////////////////////////////////////////////////////////////////////////\r\n // localStorage eh o arquivo .php onde estao os select/insert/update/delete //\r\n //////////////////////////////////////////////////////////////////////////////\r\n var bdCdd=new clsBancoDados(localStorage.getItem('lsPathPhp'));\r\n bdCdd.Assoc=false;\r\n bdCdd.select( sql );\r\n if( bdCdd.retorno=='OK'){\r\n var jsCddF10={\r\n \"titulo\":[\r\n {\"id\":0 ,\"labelCol\":\"OPC\" ,\"tipo\":\"chk\" ,\"tamGrd\":\"3em\" ,\"fieldType\":\"chk\"} \r\n ,{\"id\":1 ,\"labelCol\":\"CODIGO\" ,\"tipo\":\"edt\" ,\"tamGrd\":\"6em\" ,\"fieldType\":\"str\",\"ordenaColuna\":\"S\",\"align\":\"center\"}\r\n ,{\"id\":2 ,\"labelCol\":\"DESCRICAO\" ,\"tipo\":\"edt\" ,\"tamGrd\":tamColNome ,\"fieldType\":\"str\",\"ordenaColuna\":\"S\"}\r\n ,{\"id\":3 ,\"labelCol\":\"UF\" ,\"tipo\":\"edt\" ,\"tamGrd\":\"2em\" ,\"fieldType\":\"str\",\"ordenaColuna\":\"N\"} \r\n ]\r\n ,\"registros\" : bdCdd.dados // Recebe um Json vindo da classe clsBancoDados\r\n ,\"opcRegSeek\" : true // Opção para numero registros/botão/procurar \r\n ,\"checarTags\" : \"N\" // Somente em tempo de desenvolvimento(olha as pricipais tags)\r\n ,\"tbl\" : tblCdd // Nome da table\r\n ,\"div\" : \"cdd\"\r\n ,\"prefixo\" : \"Cdd\" // Prefixo para elementos do HTML em jsTable2017.js\r\n ,\"tabelaBD\" : \"MODELO\" // Nome da tabela no banco de dados \r\n ,\"width\" : \"52em\" // Tamanho da table\r\n ,\"height\" : \"39em\" // Altura da table\r\n ,\"indiceTable\" : \"DESCRICAO\" // Indice inicial da table\r\n };\r\n if( objCddF10 === undefined ){ \r\n objCddF10 = new clsTable2017(\"objCddF10\");\r\n objCddF10.tblF10 = true;\r\n if( (foco != undefined) && (foco != \"null\") ){\r\n objCddF10.focoF10=foco; \r\n };\r\n }; \r\n var html = objCddF10.montarHtmlCE2017(jsCddF10);\r\n var ajudaF10 = new clsMensagem('Ajuda',topo);\r\n ajudaF10.divHeight= '410px'; /* Altura container geral*/\r\n ajudaF10.divWidth = '54em';\r\n ajudaF10.tagH2 = false;\r\n ajudaF10.mensagem = html;\r\n ajudaF10.Show('ajudaCdd');\r\n document.getElementById('tblCdd').rows[0].cells[2].click();\r\n delete(ajudaF10);\r\n delete(objCddF10);\r\n };\r\n }; \r\n if( opc == 1 ){\r\n var bdCdd=new clsBancoDados(localStorage.getItem(\"lsPathPhp\"));\r\n bdCdd.Assoc=true;\r\n bdCdd.select( sql );\r\n return bdCdd.dados;\r\n }; \r\n}", "title": "" }, { "docid": "73559168352614a3109c81e7a9aba7d3", "score": "0.5711544", "text": "function AdicionaNivelFeiticoConhecido(\n chave_classe, precisa_conhecer, div_conhecidos, indice_filho) {\n var nivel = indice_filho + (tabelas_feiticos[chave_classe].possui_nivel_zero ? 0 : 1);\n var feiticos_conhecidos =\n gPersonagem.feiticos[chave_classe].conhecidos[nivel];\n // Se não precisa conhecer, o jogador pode adicionar feiticos como se fosse um grimório.\n if (feiticos_conhecidos.length == 0 && precisa_conhecer) {\n return;\n }\n var div_nivel = CriaDiv();\n div_nivel.appendChild(CriaSpan(Traduz('Nível') + ' ' + nivel + ':'));\n if (!precisa_conhecer) {\n div_nivel.appendChild(CriaBotao('+', null, null, function() {\n if (gEntradas.feiticos_conhecidos[chave_classe] == null) {\n gEntradas.feiticos_conhecidos[chave_classe] = {};\n }\n if (gEntradas.feiticos_conhecidos[chave_classe][nivel] == null) {\n gEntradas.feiticos_conhecidos[chave_classe][nivel] = [];\n }\n gEntradas.feiticos_conhecidos[chave_classe][nivel].push('');\n AtualizaGeralSemLerEntradas();\n }));\n }\n div_nivel.appendChild(CriaBr());\n div_nivel.appendChild(CriaDiv('div-feiticos-conhecidos-' + chave_classe + '-' + nivel));\n div_conhecidos.appendChild(div_nivel);\n}", "title": "" }, { "docid": "87045d6b8c2653ad985d9a6151103aef", "score": "0.5699161", "text": "function empezarDibujo() {\n pintarLinea = true;\n lineas.push([]);\n }", "title": "" }, { "docid": "341ec4a8363c843319493a8d46a1def3", "score": "0.569909", "text": "function crearTablaTransicion(entrada,alfabeto,tablaTransicion){\n var tablaPadre = document.createElement('table'),\n filaTitulo = document.createElement('tr');\n for(let i=0; i<transiciones.length ; i++){\n var columnaTitulo = document.createElement('td');\n columnaTitulo.className='formatoTablaTitulo';\n columnaTitulo.textContent = transiciones[i];\n filaTitulo.appendChild(columnaTitulo);\n }\n tablaPadre.appendChild(filaTitulo);\n for(let i=0; i<entrada.length; i++){\n for(let j=0; j<alfabeto.length; j++){\n var filaDatos = document.createElement('tr'), \n columnaEstados = document.createElement('td'), \n columnaAlfabeto = document.createElement('td'),\n columnaInput = document.createElement('td'),\n input = document.createElement('input');\n //estilos y contenido a las columnas\n columnaEstados.className='formatoTabla';\n columnaEstados.textContent = entrada[i];\n columnaAlfabeto.className='formatoTabla';\n columnaAlfabeto.textContent = alfabeto[j];\n input.className='form-control';\n input.setAttribute('placeholder','Estado Destino');\n input.setAttribute('type','text');\n input.id=`${entrada[i]}-${alfabeto[j]}`;\n //agrego los elementos a sus nodos padres\n columnaInput.appendChild(input);\n filaDatos.appendChild(columnaEstados);\n filaDatos.appendChild(columnaAlfabeto);\n filaDatos.appendChild(columnaInput);\n tablaPadre.appendChild(filaDatos);\n }\n }\n tablaTransicion.appendChild(tablaPadre);\n}", "title": "" }, { "docid": "c8921067558c5567bf69605856833113", "score": "0.5694568", "text": "function agregarFila(usuario) {\n let row = document.createElement('tr');\n let columnauserName = document.createElement('td');\n let columnalevelUser = document.createElement('td');\n let columnaresetUser = document.createElement('td');\n let columnaviplevelUser = document.createElement('td');\n let columnaAcciones = document.createElement('td');\n columnaAcciones.classList.add('row');\n columnaAcciones.classList.add('table-acciones');\n columnaAcciones.classList.add('d-flex');\n columnaAcciones.classList.add('justify-content-between');\n columnaAcciones.id = 'table-acciones';\n columnauserName.innerHTML = usuario.thing.userName;\n columnalevelUser.innerHTML = usuario.thing.levelUser;\n columnaresetUser.innerHTML = usuario.thing.resetsUser;\n columnaviplevelUser.innerHTML = usuario.thing.viplevelUser;\n let btnEliminar = document.createElement('button');\n btnEliminar.innerHTML = \"Eliminar\";\n btnEliminar.id = 'btnEliminar';\n btnEliminar.classList.add('btn');\n btnEliminar.classList.add('btn-danger');\n btnEliminar.classList.add('col-xs-12');\n btnEliminar.classList.add('col-md-6');\n btnEliminar.addEventListener('click', (e) => {\n e.preventDefault();\n eliminar(usuario._id);\n });\n columnaAcciones.appendChild(btnEliminar);\n let btnEditar = document.createElement('button');\n btnEditar.innerHTML = \"Editar\";\n btnEditar.id = 'btnEditar';\n btnEditar.classList.add('btn');\n btnEditar.classList.add('btn-warning');\n btnEditar.classList.add('col-xs-12');\n btnEditar.classList.add('col-md-6');\n btnEditar.addEventListener('click', (e) => {\n e.preventDefault();\n editando = true;\n columnauserName.innerHTML = \"<input type='text' id='userNameedit' class='col' value=\" + `${usuario.thing.userName}` + \">\";\n columnalevelUser.innerHTML = \"<input type='text' id='levelUseredit' class='col' value=\" + `${usuario.thing.levelUser}` + \">\";\n columnaresetUser.innerHTML = \"<input type='text' id='resetUseredit' class='col' value=\" + `${usuario.thing.resetsUser}` + \">\";\n columnaviplevelUser.innerHTML = \"<input type='text' id='viplevelUseredit' class='col' value=\" + `${usuario.thing.viplevelUser}` + \">\";\n let btnTerminar = document.createElement('button');\n btnTerminar.innerHTML = \"Terminar\";\n btnTerminar.id = 'btnTerminar';\n btnTerminar.classList.add('btn');\n btnTerminar.classList.add('btn-success');\n btnTerminar.classList.add('col-xs-12');\n btnTerminar.classList.add('col-md-6');\n btnTerminar.addEventListener('click', (e) => {\n e.preventDefault();\n editando = false;\n let nuevousuario = {\n \"userName\": document.querySelector(\"#userNameedit\").value,\n \"levelUser\": parseInt(document.querySelector(\"#levelUseredit\").value),\n \"resetsUser\": parseInt(document.querySelector(\"#resetUseredit\").value),\n \"viplevelUser\": parseInt(document.querySelector(\"#viplevelUseredit\").value),\n }\n editar(usuario._id, nuevousuario);\n\n });\n columnaAcciones.appendChild(btnTerminar);\n btnEditar.style.display = \"none\";\n });\n columnaAcciones.appendChild(btnEditar);\n row.appendChild(columnauserName);\n row.appendChild(columnalevelUser);\n row.appendChild(columnaresetUser);\n row.appendChild(columnaviplevelUser);\n row.appendChild(columnaAcciones);\n tableBody.appendChild(row);\n\n //oculta los botones si la sesion no esta iniciada\n if (sesioniniciada === false) {\n let acc = document.querySelector(\"#table-acciones\");\n acc.style.display = 'none';\n let btnsEliminar = document.querySelectorAll(\"#btnEliminar\");\n btnsEliminar.forEach(botonEL => {\n botonEL.style.display = \"none\";\n });\n let btnsEditar = document.querySelectorAll(\"#btnEditar\");\n btnsEditar.forEach(botonED => {\n botonED.style.display = \"none\"\n });\n };\n }", "title": "" }, { "docid": "7aaa9fd97419284550cfe58f3e33b21f", "score": "0.5675088", "text": "function limpiarListaClientes1() {\n\t\tvar indexCliente = 1; \n\t\tvar indexValidacion = 2; \n\t\t//tomamos la lista actual del rowset \n\t\tvar listaClientes = listado1.datos; \n\t\t//realizamos la tranformaion \n\t\tfor (var i=0; i < listaClientes.length; i++){\n\t\t\tlistaClientes[i][indexCliente] = \"\"; \n\t\t\tlistaClientes[i][indexValidacion] = \"\"; \n\t\t}\n\t\tlistado1.repinta();\n\t\t//focalizo en el primer campo de la lista\n\t\t if (listado1.datos.length > 0) {\n\t\t \t\teval(\"listado1.preparaCamposDR()\");\n\t\t\t\tfocaliza('frmlistado1.Texto1_0',''); \n\t\t }\n\n\t}", "title": "" }, { "docid": "6e35f1f5950b49816f41f83f1890fab7", "score": "0.56559", "text": "function agregarComentario(id_miembro){\n\n\n res= document.getElementById(\"comentar\").value; //Se toma a traves del id, el comentario realizado(valor).\n document.getElementById(\"mostrarComentario\").innerHTML+= res + \"<br>\"; //Hace visible el comentario relizado.\n\tres= document.getElementById(\"comentar\").value= \"\";//Despues que se genera el click vuelve al valor original.\n}", "title": "" }, { "docid": "0ffdfc7b03677720f3db2aadaeaa5890", "score": "0.56514275", "text": "function IndicadorRangoEdad () {}", "title": "" }, { "docid": "702a79b23da3bb781f903b20245cc7b5", "score": "0.56418097", "text": "formata_dados( resposta_HANA ){\n const reducer = (r, row) => {\n const key_caminhao = `${row.ID} - ${row.Unidade} - ${row.Nome} - ${row.Placa} - ${row.Transportadora} - ${row.Modal} - ${row.Dia}`;\n const key_entrega = `${row.Item_pedido} - ${row.Cod_Material} - ${row.Material} - ${row.Remessa} - ${row.Dia} - ${row.N_nota_fiscal} - ${row.Peso}`;\n\n const caminhoes = {\n ID: parseInt(row.ID),\n Unidade: row.Unidade,\n Nome: row.Nome,\n Placa: row.Placa,\n Transportadora: row.Transportadora,\n Modal: row.Modal,\n Dia: row.Dia,\n Material: row.Material,\n Materiais: {}\n };\n\n r[key_caminhao] = r[key_caminhao] || caminhoes;\n\n const entregas = {\n Item_pedido: row.Item_pedido,\n Cod_Material: row.Cod_Material,\n Material: row.Material,\n Remessa: row.Remessa,\n Dia: row.Dia,\n N_nota_fiscal: row.N_nota_fiscal,\n Peso: parseInt(row.Peso.replace('.', ''))\n };\n\n r[key_caminhao]['Materiais'][key_entrega] = r[key_caminhao]['Materiais'][key_entrega] || entregas;\n\n return r;\n };\n\n const organizado = resposta_HANA.reduce( (r, row) => reducer(r, row), {});\n\n const obj_organizado = Object.values(organizado);\n\n const obj_organizado_2 = obj_organizado.map( item => {\n item['Materiais'] = Object.values(item['Materiais']);\n\n return item\n });\n\n return obj_organizado_2;\n }", "title": "" }, { "docid": "d6cd8206927aa38f8382b086f2df1701", "score": "0.5630319", "text": "function compruebaTablero(filaycolor1, filaycolor2, filaycolor3, filaycolor4, filaycolor5, filaycolor6) {\r\n\r\n console.log(filaycolor1);\r\n console.log(filaycolor2);\r\n console.log(filaycolor3);\r\n console.log(filaycolor4);\r\n console.log(filaycolor5);\r\n console.log(filaycolor6);\r\n \r\n\r\n}", "title": "" }, { "docid": "e6253a68d996f897a41766288eaba12e", "score": "0.5624591", "text": "function filtrosMercado(){\n\t\tvar table = document.createElement(\"TABLE\");\n\t\ttable.setAttribute(\"class\", \"tbg\");\n\t\ttable.setAttribute(\"style\", \"width:100%\");\n\t\ttable.setAttribute(\"cellspacing\", \"1\");\n\t\ttable.setAttribute(\"cellpadding\", \"2\");\n\n\t\t// Se crea la tabla con 3 filas, Ofrezco, Busco y Tipo\n\t\tvar etiquetas = [T('OFREZCO'), T('BUSCO')];\n\t\tfor (var j = 0; j < 2; j++){\n\t\t\tvar tr = document.createElement(\"TR\");\n\t\t\ttr.appendChild(elem(\"TD\", etiquetas[j]));\n\t\t\t// Para Ofrezco y Busco se muestran 4 materiales y un quinto comodin\n\t\t\tfor (var i = 0; i < 4; i++){\n\t\t\t\tvar td = document.createElement(\"TD\");\n\t\t\t\ttd.setAttribute(\"id\", \"filtro\" + j + i);\n\t\t\t\tvar ref = elem(\"A\", \"<img src='\" + img('r/' + (i+1) + '.gif') + \"' width='18' height='12' border='0' title='\" + T('RECURSO' + (i+1)) + \"'>\");\n\t\t\t\ttd.addEventListener(\"click\", funcionFiltrosMercado(j, i+1), 0);\n\t\t\t\ttd.appendChild(ref);\n\t\t\t\ttr.appendChild(td);\n\t\t\t}\n\t\t\tvar td = document.createElement(\"TD\");\n\t\t\ttd.setAttribute(\"style\", \"background-color:#F5F5F5\");\n\t\t\ttd.setAttribute(\"id\", \"filtro\" + j + \"4\");\n\t\t\tvar ref = elem(\"A\", T('CUALQUIERA'));\n\t\t\tref.setAttribute(\"href\", \"javascript:void(0)\");\n\t\t\ttd.addEventListener(\"click\", funcionFiltrosMercado(j, 5), 0);\n\t\t\ttd.appendChild(ref);\n\t\t\ttr.appendChild(td);\n\t\t\ttable.appendChild(tr);\n\t\t}\n\n\t\t// La fila del tipo especifica transacciones 1:1 o 1:x\n\t\tvar tr = document.createElement(\"TR\");\n\t\ttr.appendChild(elem(\"TD\", T('TIPO')));\n\t\ttable.appendChild(tr);\n\t\tvar etiquetas_tipo = [\"1:1\", \"1:>1\", \"1:<1\", \"1:x\"];\n\t\tfor (var i = 0; i < 4; i++){\n\t\t\tvar td = document.createElement(\"TD\");\n\t\t\ttd.setAttribute(\"id\", \"filtro\" + 2 + i);\n\t\t\tif (i == 3) td.setAttribute(\"style\", \"background-color:#F5F5F5\");\n\t\t\tvar ref = elem(\"A\", etiquetas_tipo[i]); \n\t\t\tref.setAttribute(\"href\", \"javascript:void(0)\"); \n\t\t\ttd.addEventListener(\"click\", funcionFiltrosMercado(2, (i+1)), 0);\n\t\t\ttd.appendChild(ref); \n\t\t\ttr.appendChild(td);\n\t\t}\n\t\ttr.appendChild(document.createElement(\"TD\"));\n\n\t\tvar tr = document.createElement(\"TR\");\n\t\ttr.appendChild(elem(\"TD\", T('MAXTIME')));\n\t\ttable.appendChild(tr);\n\t\tvar etiquetas_tipo = [\"1\", \"2\", \"3\", \">3\"];\n\t\tfor (var i = 0; i < 4; i++){\n\t\t\tvar td = document.createElement(\"TD\");\n\t\t\ttd.setAttribute(\"id\", \"filtro\" + 4 + i);\n\t\t\tif (i == 3) td.setAttribute(\"style\", \"background-color:#F5F5F5\");\n\t\t\tvar ref = elem(\"A\", etiquetas_tipo[i]); \n\t\t\tref.setAttribute(\"href\", \"javascript:void(0)\"); \n\t\t\ttd.addEventListener(\"click\", funcionFiltrosMercado(4, (i+1)), 0);\n\t\t\ttd.appendChild(ref); \n\t\t\ttr.appendChild(td);\n\t\t}\n\t\ttr.appendChild(document.createElement(\"TD\"));\n\n\t\tvar tr = document.createElement(\"TR\");\n\t\ttr.appendChild(elem(\"TD\", T('DISPONIBLE')));\n\t\ttable.appendChild(tr);\n\t\tvar etiquetas_carencia = [T('SI'), T('NO')];\n\t\tfor (var i = 0; i < 2; i++){\n\t\t\tvar td = document.createElement(\"TD\");\n\t\t\ttd.setAttribute(\"colspan\", \"2\");\n\t\t\ttd.setAttribute(\"id\", \"filtro\" + 3 + i);\n\t\t\tif (i == 1) td.setAttribute(\"style\", \"background-color:#F5F5F5\");\n\t\t\tvar ref = elem(\"A\", etiquetas_carencia[i]);\n\t\t\tref.setAttribute(\"href\", \"javascript:void(0)\");\n\t\t\ttd.addEventListener(\"click\", funcionFiltrosMercado(3, (i+1)), 0);\n\t\t\ttd.appendChild(ref);\n\t\t\ttr.appendChild(td);\n\t\t}\n\t\ttr.appendChild(document.createElement(\"TD\"));\n\n\t\t// Busca la tabla de ofertas y la inserta justo antes\n\t\tvar a = find(\"//table[@cellspacing='1' and @cellpadding='2' and @class='tbg' and not(@style)]\", XPFirst);\n\t\tvar p = document.createElement(\"P\");\n\t\tp.appendChild(table);\n\t\ta.parentNode.insertBefore(p, a);\n\t}", "title": "" }, { "docid": "279b5bc27a0610cb6f7b4410f5e16c8f", "score": "0.56223756", "text": "function crearTablaTransicionResultados(automata,resultado){ \n let transiciones = ['Entrada','Lectura','Destino'];\n var tablaPadre = document.createElement('table'),\n filaTitulo = document.createElement('tr'); \n\n for(let i=0; i<transiciones.length ; i++){\n var columnaTitulo = document.createElement('td');\n columnaTitulo.className='tablatransicion';\n columnaTitulo.textContent = transiciones[i];\n filaTitulo.appendChild(columnaTitulo);\n }\n tablaPadre.appendChild(filaTitulo);\n for(let i=0; i<automata.est_entrada.length; i++){\n for(let j=0; j<automata.arr_alfabeto.length; j++){\n var filaDatos = document.createElement('tr'), \n columnaEstados = document.createElement('td'),\n columnaAlfabeto = document.createElement('td'),\n columnaDestinos = document.createElement('td');\n \n if(automata.arr_estados[i].estado_to[j] != null){\n //estilos y contenido a las columnas\n columnaEstados.className='tablatransicionHijos';\n columnaEstados.textContent = automata.est_entrada[i];\n columnaAlfabeto.className='tablatransicionHijos';\n columnaAlfabeto.textContent = automata.arr_alfabeto[j];\n columnaDestinos.className='tablatransicionHijos';\n columnaDestinos.textContent = automata.arr_estados[i].estado_to[j];\n //agrego los elementos a sus nodos padres\n filaDatos.appendChild(columnaEstados);\n filaDatos.appendChild(columnaAlfabeto);\n filaDatos.appendChild(columnaDestinos);\n tablaPadre.appendChild(filaDatos);\n }\n }\n }\n resultado.appendChild(tablaPadre);\n}", "title": "" }, { "docid": "77674327865e72ab99c197328b6c5bde", "score": "0.56196266", "text": "function MostrarRegistro(){\n // declaramos una variable para guardar los datos\n var listaregistro=Mostrar();\n // selecciono el tbody de la tabla donde voy a guardar\n tbody=document.querySelector(\"#tbRegistro tbody\");\n tbody.innerHTML=\"\";\n // agregamos las columnas que se registren\n for(var i=0; i<listaregistro.length;i++){\n // declaramos una variable para la fila\n var fila=tbody.insertRow(i);\n // declaramos variables para los titulos\n var titulonombre=fila.insertCell(0);\n var tituloprecio=fila.insertCell(1);\n var titulocategoria=fila.insertCell(2);\n var titulocantidad=fila.insertCell(3);\n // agregamos los valores\n titulonombre.innerHTML=listaregistro[i].nombre;\n tituloprecio.innerHTML=listaregistro[i].precio;\n titulocategoria.innerHTML=listaregistro[i].categoria\n titulocantidad.innerHTML=listaregistro[i].cantidad;\n tbody.appendChild(fila);\n }\n}", "title": "" }, { "docid": "1205a3db91f147f8f61bc7e3874d1d61", "score": "0.56195664", "text": "function Filtro() {\n \n obj = this; \n\n // Public methods \n this.consultar = consultar;\n// this.consultarDetalhe = consultarDetalhe;\n this.merge = merge;\n \n \n this.incluir = incluir; \n this.confirmar = confirmar; \n this.alterar = alterar; \n this.cancelar = cancelar; \n this.excluir = excluir; \n \n this.changeDataInicial = changeDataInicial;\n this.changeDataFinal = changeDataFinal;\n this.changeDataCorrente = changeDataCorrente;\n \n this.Modal = Modal; \n \n this.ORDER_BY = 'ID*1';\n this.INCLUINDO = false;\n this.ALTERANDO = false;\n this.DADOS = [];\n this.DADOS_RENDER = [];\n\n this.DADOS = [];\n this.DADOS_DETALHES = [];\n \n this.TOTAL_GERAL = 0;\n this.SELECTEDS = [];\n this.SELECTED = {};\n this.SELECTED_BACKUP = {};\n \n\t }", "title": "" }, { "docid": "4a02f6fe23aca6666ef9754049c0fe3e", "score": "0.5610749", "text": "function CrearRegistro(Titulo){\n\n var ElementoCajaTabla=document.createElement('div');\n ElementoCajaTabla.setAttribute('class','CajaTabla');\n var ElementoTituloTab=document.createElement('h1');\n ElementoTituloTab.setAttribute('class','TituloTabla');\n var contenidoTitulo=document.createTextNode(Titulo);\n ElementoTituloTab.appendChild(contenidoTitulo);\n var ElementoSubMenu=document.createElement('div');\n ElementoSubMenu.setAttribute('class','Csubmenu');\n var CajaBoton=document.createElement('div');\n CajaBoton.setAttribute('class','btns');\n var btnmenu=document.createElement('button');\n btnmenu.setAttribute('class','btnmenu');\n btnmenu.setAttribute('id','btnagregar');\n //btnmenu.setAttribute('type','button');\n //btnmenu.setAttribute('value','Agregar');\n var icon=document.createElement('i');\n icon.setAttribute('class','fas fa-plus-square');\n icon.setAttribute('id','btnagregar');\n btnmenu.appendChild(icon);\n CajaBoton.appendChild(btnmenu);\n ElementoSubMenu.appendChild(CajaBoton);\n CrearEventoBtn(btnmenu);\n var ElementoTabla=document.createElement('table');\n ElementoTabla.setAttribute('class','tabla');\n ElementoTabla.setAttribute('id','tablaRegistros');\n var fil=[],col=[],valor='';\n let filas=1,columnas=7;\n for (let i=0; i<filas; i++){\n fil[i]=document.createElement('tr');\n fil[i].setAttribute('class','fila');\n ElementoTabla.appendChild(fil[i]);\n for(let j=0; j<columnas; j++){\n if(i===0){\n col[j]=document.createElement('th');\n if(j>0 && j<6){\n valor=document.createTextNode('Nota '+(j));\n }else if(j===0){\n valor=document.createTextNode('NOMBRE');\n }else{valor=document.createTextNode('PROMEDIO');\n }}\n else{\n col[j]=document.createElement('td');\n if(j>0 && j<6){\n valor=document.createElement('input');\n valor.setAttribute('id','campo'+i+j);\n valor.setAttribute('type','number');\n valor.setAttribute('min','0');\n valor.setAttribute('max','100');\n Eventos.eventoInput(valor,i,columnas);\n Eventos.eventoPromedio(valor,i);\n }else if(j===0){\n valor=document.createElement('label');\n valor.setAttribute('id','Promedio'+i);\n }else{\n valor=document.createElement('label');\n valor.appendChild(document.createTextNode('0'));\n valor.setAttribute('id','Promedio'+i);\n }\n \n }\n \n\n \n col[j].setAttribute('class','columna fil-'+i+' col-'+j);\n col[j].appendChild(valor);\n fil[i].appendChild(col[j]);\n \n }\n }\n ElementoCajaTabla.appendChild(ElementoTituloTab);\n ElementoCajaTabla.appendChild(ElementoSubMenu);\n ElementoCajaTabla.appendChild(ElementoTabla);\n return ElementoCajaTabla;\n}", "title": "" }, { "docid": "11c8c4cb990c3b848ddae3b1196c592e", "score": "0.5609", "text": "function fPadraoF10(padrao){\r\n var sql=\"SELECT \"+padrao.fieldCod+\" AS CODIGO,\"+padrao.fieldDes+\" AS DESCRICAO FROM \"+padrao.tableBd+\" A \";\r\n //\r\n //////////////////////////////////////////////////////////////////////////////////////////////////////\r\n // a tbl eh padrao \"tblPas\" mas quando em um mesmo form existir duas chamadas o obj padrao deve ter //\r\n // a propriedade tbl:\"tblXxx\" devido funcao function RetF10tblXxx(arr) que naum pode ser repetida //\r\n ////////////////////////////////////////////////////////////////////////////////////////////////////// \r\n var tblPad=\"tblPad\";\r\n // \r\n if( padrao.opc == 0 ){ \r\n sql+=\"WHERE (\"+padrao.fieldAtv+\"='S')\";\r\n let tamColCodigo = \"6em\"; \r\n let tamColNome = \"30em\";\r\n let divWidth = \"42%\";\r\n for (var key in padrao) {\r\n switch( key ){\r\n case \"tbl\" : tblPad=padrao[key] ;break; \r\n case \"where\" : sql+=padrao[key] ;break; \r\n case \"tamColCodigo\" : tamColCodigo=padrao[key] ;break; \r\n case \"tamColNome\" : tamColNome=padrao[key] ;break; \r\n case \"divWidth\" : divWidth=padrao[key] ;break; \r\n }; \r\n };\r\n //////////////////////////////////////////////////////////////////////////////\r\n // localStorage eh o arquivo .php onde estao os select/insert/update/delete //\r\n //////////////////////////////////////////////////////////////////////////////\r\n var bdPad=new clsBancoDados(localStorage.getItem('lsPathPhp'));\r\n bdPad.Assoc=false;\r\n bdPad.select( sql );\r\n if( bdPad.retorno=='OK'){\r\n var jsPadF10={\r\n \"titulo\":[\r\n {\"id\":0 ,\"labelCol\":\"OPC\" ,\"tipo\":\"chk\" ,\"tamGrd\":\"3em\" ,\"fieldType\":\"chk\"} \r\n ,( padrao.typeCod==\"int\" ? \r\n {\"id\":1 ,\"labelCol\":\"CODIGO\" ,\"tipo\":\"edt\" ,\"tamGrd\":\"6em\" ,\"fieldType\":\"int\",\"formato\":['i4'],\"ordenaColuna\":\"S\",\"align\":\"center\"} : \r\n {\"id\":1 ,\"labelCol\":\"CODIGO\" ,\"tipo\":\"edt\" ,\"tamGrd\":tamColCodigo ,\"fieldType\":\"str\",\"ordenaColuna\":\"S\"} )\r\n ,{\"id\":2 ,\"labelCol\":\"DESCRICAO\" ,\"tipo\":\"edt\" ,\"tamGrd\":tamColNome ,\"fieldType\":\"str\",\"ordenaColuna\":\"S\"}\r\n ]\r\n ,\"registros\" : bdPad.dados // Recebe um Json vindo da classe clsBancoDados\r\n ,\"opcRegSeek\" : true // Opção para numero registros/botão/procurar \r\n ,\"checarTags\" : \"N\" // Somente em tempo de desenvolvimento(olha as pricipais tags)\r\n ,\"tbl\" : tblPad // Nome da table\r\n ,\"prefixo\" : \"pad\" // Prefixo para elementos do HTML em jsTable2017.js\r\n ,\"tabelaBD\" : padrao.tableBd // Nome da tabela no banco de dados \r\n ,\"width\" : \"52em\" // Tamanho da table\r\n ,\"height\" : \"38em\" // Altura da table\r\n ,\"indiceTable\" : \"DESCRICAO\" // Indice inicial da table\r\n };\r\n if( objPadF10 === undefined ){ \r\n objPadF10 = new clsTable2017(\"objPadF10\");\r\n objPadF10.tblF10 = true;\r\n }; \r\n \r\n if( (padrao.foco != undefined) && (padrao.foco != \"null\") ){\r\n objPadF10.focoF10=padrao.foco; \r\n };\r\n \r\n var html = objPadF10.montarHtmlCE2017(jsPadF10);\r\n var ajudaF10 = new clsMensagem('Ajuda',padrao.topo);\r\n ajudaF10.divHeight= '400px'; /* Altura container geral*/\r\n ajudaF10.divWidth = divWidth;\r\n ajudaF10.tagH2 = false;\r\n ajudaF10.mensagem = html;\r\n ajudaF10.Show('ajudaPad');\r\n document.getElementById(tblPad).rows[0].cells[2].click();\r\n };\r\n }; \r\n if( padrao.opc == 1 ){\r\n sql+=\" WHERE (\"+padrao.fieldCod+\"='\"+document.getElementById(padrao.edtCod).value.toUpperCase()+\"')\"\r\n +\" AND (\"+padrao.fieldAtv+\"='S')\";\r\n var bdPad=new clsBancoDados(localStorage.getItem(\"lsPathPhp\"));\r\n bdPad.Assoc=true;\r\n bdPad.select( sql );\r\n return bdPad.dados;\r\n }; \r\n}", "title": "" }, { "docid": "2d6c2aa631f313744bd0650ed7b6ee4a", "score": "0.5597529", "text": "function mostrar() {\n const divTabela = document.getElementById(\"tabela\");\n let conteudo = \"<table class>\";\n let indice = 0;\n let contador = 1;\n for (const valor of lista) {\n conteudo += `\n <tr>\n <td class=\"col-1\">${contador}</td>\n <td class=\"col-3\">${valor.des}</td>\n <td class=\"col-6\">${valor.deta}</td> \n <td class=\"col-2 text-end\"><button onclick='editar(${indice})' type=\"button\" class=\"btn btn-primary btn-sm\" onclick=\"criarconta()\"> Editar </button>\n <button onclick='apagar(${indice})' type=\"button\" class=\"btn btn-dark btn-sm\" onclick=\"entrar()\">Apagar</button></td> \n </tr> \n `;\n indice++;\n contador++;\n }\n conteudo += \"</table>\"\n divTabela.innerHTML = conteudo;\n}", "title": "" }, { "docid": "161cfd30cdb0ef1422ae071c20f42321", "score": "0.5597358", "text": "function mostrarEjAlumnos(){\r\n limpiar(); //limpio campos de texto y mensajes al usuario\r\n document.querySelector(\"#bodyHome\").style.display = \"none\"; // oculto bodyhome\r\n document.querySelector(\"#divEstAlumnos\").style.display = \"none\"; // oculto plantear tarea\r\n document.querySelector(\"#divEntAlumno\").style.display = \"none\"; // oculto entregas\r\n document.querySelector(\"#homeAlumno\").style.display = \"block\"; // habilito la div homealumno\r\n document.querySelector(\"#divEjalumnos\").style.display = \"block\"; // habilito la div divejalumnos\r\n document.querySelector(\"#divBuscadorEj\").style.display = \"block\"; // habilito la div buscadorEj\r\n generarTablaEj();\r\n}", "title": "" }, { "docid": "c205acef7f74bac5cf9af2153a316b20", "score": "0.5593027", "text": "function botonagregar(){\n if (opcion() == \"Ingreso\") {\n contenedor_Ingreso.innerHTML = \"\";\n let descripcion=document.getElementById('descripcion').value;\n let monto=document.getElementById('monto').value;\n let suma=(parseFloat(tIngreso) + parseFloat(monto));\n tIngreso= suma;\n pIngreso.innerHTML= \"+\" + tIngreso.toFixed(2)\n //Creacion de cadena par crear Array Ingreso\n let tabla=\"<tr> <th>\" + descripcion + \"</th> <th>\" + monto + \"</th> </tr>\"; \n vIngreso.push(tabla);\n console.log(vIngreso);\n\n //Bucle para escribir datos en el array Ingreso\n for (let i = 0; i < vIngreso.length; i++) {\n contenedor_Ingreso.innerHTML = vIngreso.join(\"\");\n };\n\n \n }\n \n\n\nif(opcion()==\"Egreso\"){\ncontenedor_Egreso.innerHTML=\"\";\n let descripcion= document.getElementById('descripcion').value;\n let monto= document.getElementById('monto').value;\n let suma= (parseFloat(tEgreso) + parseFloat(monto));\n tEgreso=suma;\n pEgreso.innerHTML=\"-\" + tEgreso.toFixed(2)\n \n //Calculando porcentaje\n portotal= (tEgreso *100)/tIngreso;\n porcentajetotal.innerHTML= Math.ceil(portotal) + \" % \" \n \n // Calcular porcentaje por cada egreso\n var porcentaje_Egreso= (monto * 100)/ tIngreso;\n // Creacion de cadena para array Egreso\n let tabla=\"<tr> <th>\" + descripcion + \"</th> <th>\" + monto + \"</th> <td class='text-white bg-dark'>\" + Math.ceil(porcentaje_Egreso) + \" % </td> </tr>\";\n vEgreso.push(tabla);\n \n //Bucle para escribir datos en el array de Egresos\n for(let i=0; i <vEgreso.length; i++){\n contenedor_Egreso.innerHTML= vEgreso.join(\"\");\n };\n}\n //dinero total calculados\n pTotal=document.getElementById('montoTotal');\ntotalMonto=(parseFloat(tIngreso)-parseFloat(tEgreso));\n pTotal.innerHTML= \"$\" + totalMonto.toFixed(2)\n}", "title": "" }, { "docid": "ece4d2e6eb1d4fc23a5f63583365f4f2", "score": "0.55897593", "text": "function mostrarEstAlumnosParaDocente(){\r\n let contadorEjXNivel = 0;//variable para contar cuantos ejercicios planteo el docente para el nivel del alumno\r\n let contadorEntXNivel = 0;//variable para contar cuantos ejercicios de su nivel entrego el alumno\r\n let alumnoSeleccionado = document.querySelector(\"#selEstAlumnos\").value;\r\n let posicionUsuario = alumnoSeleccionado.charAt(1);\r\n let usuario = usuarios[posicionUsuario];\r\n let nivelAlumno = usuario.nivel;\r\n for (let i = 0; i < ejercicios.length; i++){\r\n const element = ejercicios[i].Docente.nombreUsuario;\r\n if(element === usuarioLoggeado){\r\n if(ejercicios[i].nivel === nivelAlumno){\r\n contadorEjXNivel ++;\r\n }\r\n }\r\n }\r\n for (let i = 0; i < entregas.length; i++) {\r\n const element = entregas[i].Alumno.nombreUsuario;\r\n if(element === usuario.nombreUsuario){\r\n if(entregas[i].Ejercicio.nivel === nivelAlumno){\r\n contadorEntXNivel++;\r\n }\r\n }\r\n }\r\n document.querySelector(\"#pMostrarEstAlumnos\").innerHTML = `El alumno ${usuario.nombre} tiene ${contadorEjXNivel} ejercicios planteados para su nivel (${nivelAlumno}) sobre los cuales a realizado ${contadorEntXNivel} entrega/s. `;\r\n}", "title": "" }, { "docid": "dc84095bcbacfa3ac42e51bc2dffbca7", "score": "0.5584993", "text": "agregarEventosDeClick() {\n this.colores.celeste.addEventListener(\"click\", this.elegirColor);\n this.colores.violeta.addEventListener(\"click\", this.elegirColor);\n this.colores.naranja.addEventListener(\"click\", this.elegirColor);\n this.colores.verde.addEventListener(\"click\", this.elegirColor);\n }", "title": "" }, { "docid": "d94b2f714437a3fdea98498f490e448f", "score": "0.5578717", "text": "function mostrarEntAlumnos(){\r\n limpiar(); //limpio campos de texto y mensajes al usuario\r\n document.querySelector(\"#bodyHome\").style.display = \"none\"; // oculto bodyhome\r\n document.querySelector(\"#divEstAlumnos\").style.display = \"none\"; // oculto plantear tarea\r\n document.querySelector(\"#homeAlumno\").style.display = \"block\"; // habilito la div homealumno\r\n document.querySelector(\"#divEntAlumno\").style.display = \"block\"; // habilito la div homealumno\r\n document.querySelector(\"#divEjalumnos\").style.display = \"none\"; // oculto la div divejalumnos\r\n document.querySelector(\"#divBuscadorEj\").style.display = \"none\"; // oculto la div buscadorEj\r\n generarTablaEnt();\r\n}", "title": "" }, { "docid": "8e24fb854c80eeb58bce7140c02e9a66", "score": "0.5574589", "text": "function obtieneDatosCbo(campo, tipo) { \n\t\t\t\tvar l=combo_get(campo,'L');\n\t\t\t\tvar ar=new Array();\n\t\t\t\tfor(var i=0;i<l;i++) {\n\t\t\t\t\tar[i]=combo_get(campo,tipo,i);\n\t\t\t\t}\n\t\t\t\treturn ar;\n\t\t\t}", "title": "" }, { "docid": "06d0e21ff61ebbb2d330920c7d7f1ee3", "score": "0.55646485", "text": "function build(params) {\n /*\n {\n \"key\": \"chave do catalogo\", //obrigatorio\n \"label\": \"label do catalogo\", //obrigatorio\n \"sql\": \"sql do catalogo\", //obrigatorio\n \"paths\": { //opcional\n \"entidade\": \"se definido substituira todos os valores da entidade\",\n \"entidade.coluna\": \"se definido substituira o caminho da coluna\"\n }\n }\n */\n \n // validando os dados obrigatorios\n if (!params.key)\n return {\"erro\": 'Propriedade \"key\" não informada.'};\n else if (!params.label)\n return {\"erro\": 'Propriedade \"label\" não informada.'};\n else if (!params.sql)\n return {\"erro\": 'Propriedade \"sql\" não informada.'};\n \n // valores padroes\n params = objUtils.merge({\"paths\": {}}, params);\n \n var doFields = function(objeto) {\n var fields = [];\n \n var defaults = {\n \"select\": true,\n \"filter\": true,\n \"sort\": true,\n \"group\": true,\n \"eval\": \"F\",\n \"objetobdfk\": null,\n \"querykeyfk\": null,\n \"campobdds\": null,\n \"functionsql\": null,\n \"functionresult\": null\n };\n \n // rodando as colunas\n objeto.colunas.forEach(function(coluna, i){\n // verifica se a coluna esta nos campos\n if (objeto.campos.indexOf(coluna.field.toLowerCase()) >= 0) {\n // define o caminho\n var path = params.paths[objeto.nome] || params.key;\n \n // adiciona ao fields\n fields.push(objUtils.merge(coluna, defaults, {\n \"key\": params.key + '.' + coluna.key,\n \"path\": params.paths[coluna.key] || path\n }));\n }\n });\n \n return fields;\n };\n \n var dados = {};\n var tabelas = {};\n \n var idxs = {\n \"select\": null,\n \"from\": null,\n \"where\": null,\n \"entity\": null\n };\n \n // quebra o sql em partes\n var sqls = params.sql.toLowerCase().split(' ');\n \n // percorre para encontrar os indices\n sqls.forEach(function(valor, i) {\n if (valor == 'select')\n idxs.select = i;\n else if (valor == 'from')\n idxs.from = i;\n else if (valor == 'where')\n idxs.where = i;\n });\n \n // forca o where ao ultimo registro\n idxs.where = idxs.where || sqls.length;\n \n // percorre a faixa dos campos\n for (var i = idxs.select + 1; i < idxs.from; i++) {\n // somente se nao tiver em branco\n if (sqls[i].trim() != '') {\n var item = sqls[i].replace(',', '').split('.');\n \n // cria a chave da tabela se nao existir\n if (!tabelas[item[0]]) {\n tabelas[item[0]] = {\n \"nome\": item[0],\n \"juncao\": null,\n \"campos\": []\n };\n }\n \n tabelas[item[0]].campos.push(item[1]);\n }\n }\n \n // identifica a entidade\n for (i = idxs.from + 1; i < sqls.length; i++) {\n if (sqls[i].trim() != '') {\n dados.entidade = sqls[i].trim();\n \n idxs.entity = i;\n break;\n }\n }\n \n // percore as tabelas para encontrar as juncoes\n var itensTabela = {};\n for (i = idxs.entity + 1; i < idxs.where; i++) {\n // variavel de quebra\n if (\n // quebra por left\n (sqls[i] == 'left') ||\n \n // quebra por join\n (sqls[i] == 'join' && itensTabela.qtde > 1)\n ) {\n // verifica se tem a tabela para armazenar\n if (itensTabela.tabela)\n tabelas[itensTabela.tabela].juncao = itensTabela.juncao.trim();\n \n itensTabela = {\n 'quebra': true,\n 'juncao': sqls[i],\n 'qtde': 1\n };\n }\n \n else {\n itensTabela.juncao += ' ' + sqls[i];\n itensTabela.qtde++;\n \n // precedente da tabela\n if (sqls[i] == 'join')\n itensTabela.precedente = true;\n \n // nome da tabela\n else if (!itensTabela.tabela && itensTabela.precedente)\n itensTabela.tabela = sqls[i];\n }\n }\n \n // verifica se tem a tabela para armazenar\n if (itensTabela.tabela)\n tabelas[itensTabela.tabela].juncao = itensTabela.juncao.trim();\n \n // roda as tabelas\n for (var tabela in tabelas) {\n // lista as colunas da tabela\n tabelas[tabela].colunas = dao.getDao(tabela.toUpperCase()).find(\n \"SELECT \" +\n \"LOWER(table_name + '.' + column_name) as [key], \" +\n \"LOWER('label.' + table_name + '.' + column_name) as label, \" +\n \"A.COLUMN_NAME AS field, \" +\n \"CASE \" +\n \"WHEN A.DATA_TYPE IN ('date', 'datetime') THEN 'T' \" +\n \"WHEN A.DATA_TYPE IN ('bigint', 'decimal', 'int') THEN 'N' \" +\n \"ELSE 'G' \" +\n \"END AS type \" +\n \"FROM INFORMATION_SCHEMA.COLUMNS A \" +\n \"WHERE \" +\n \"TABLE_NAME = '\" + tabela.toUpperCase() + \"'\"\n );\n }\n \n // montando a entidade principal\n var entidade = {\n \"name\": dados.entidade.toUpperCase(),\n \"join\": null,\n \"alias\": dados.entidade.toUpperCase(),\n \"entity\": dados.entidade.toUpperCase(),\n \"fields\": doFields(tabelas[dados.entidade]),\n \"children\": []\n };\n \n // remove a entidade principal\n delete tabelas[dados.entidade];\n \n // roda as tabelas para acrescentar ao child\n for (tabela in tabelas) {\n entidade.children.push({\n \"name\": tabelas[tabela].nome.toUpperCase(),\n \"join\": tabelas[tabela].juncao,\n \"alias\": tabelas[tabela].nome.toUpperCase(),\n \"entity\": tabelas[tabela].nome.toUpperCase(),\n \"fields\": doFields(tabelas[tabela])\n });\n }\n \n return {\n \"key\": params.key,\n \"label\": params.label,\n \"entity\": dados.entidade.toUpperCase(),\n \"inactive\": false,\n \"alias\": [entidade]\n };\n }", "title": "" }, { "docid": "5b3f0d99602b3991078bc2502548954b", "score": "0.55613595", "text": "function User_Insert_Comptes_auxiliaires_Liste_des_comptes_auxiliaires0(Compo_Maitre)\n{\n\n/*\n***** INFOS ******\n\nNbr d'esclaves = 5\n\nId dans le tab: 128;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 129;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 130;\nsimple\nNbr Jointure: 1;\n Joint n° 0 = acces,ac_numero,ac_numero\n\nId dans le tab: 131;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 132;\ncomplexe\nNbr Jointure: 1;\n Joint n° 0 = ecriture,ca_numero,ca_numero\n\n******************\n*/\n\n var Table=\"compteaux\";\n var CleMaitre = TAB_COMPO_PPTES[123].NewCle;\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var ca_numcompte=GetValAt(128);\n if (!ValiderChampsObligatoire(Table,\"ca_numcompte\",TAB_GLOBAL_COMPO[128],ca_numcompte,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ca_numcompte\",TAB_GLOBAL_COMPO[128],ca_numcompte))\n \treturn -1;\n var ca_libelle=GetValAt(129);\n if (!ValiderChampsObligatoire(Table,\"ca_libelle\",TAB_GLOBAL_COMPO[129],ca_libelle,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ca_libelle\",TAB_GLOBAL_COMPO[129],ca_libelle))\n \treturn -1;\n var ac_numero=GetValAt(130);\n if (ac_numero==\"-1\")\n ac_numero=\"null\";\n if (!ValiderChampsObligatoire(Table,\"ac_numero\",TAB_GLOBAL_COMPO[130],ac_numero,true))\n \treturn -1;\n var ca_debit=GetValAt(131);\n if (!ValiderChampsObligatoire(Table,\"ca_debit\",TAB_GLOBAL_COMPO[131],ca_debit,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ca_debit\",TAB_GLOBAL_COMPO[131],ca_debit))\n \treturn -1;\n var Req=\"insert into \"+Table+\" \";\nvar TabInsertionEnPlus=new Array();\nvar Asso11=false;\nvar TabAsso11=new Array();\nvar CompoLie = GetSQLCompoAt(113);\nvar CompoLieMaitre = CompoLie.my_Affichable.my_MaitresLiaison.getAttribut().GetComposant();\nvar CleLiasonForte = CompoLieMaitre.getCleVal();\nif (CleLiasonForte!=-1)\n{\n\tAsso11=GenererAssociation11(CompoLie,CleMaitre,CleLiasonForte,TabAsso11);\n}\nelse\n{\n\talert(\"Vous devez d'abord valider \"+CompoLieMaitre.getLabel()+\" puis mettre à jour.\");\n\treturn -1;\n}\n Req+=\"(\"+NomCleMaitre+\",ca_numcompte,ca_libelle,ac_numero,ca_debit\"+(Asso11?\",\"+TabAsso11[0]:\"\")+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[0]:\"\")+\")\";\n Req+=\" values (\"+CleMaitre+\",\"+(ca_numcompte==\"\" ? \"null\" : \"'\"+ValiderChaine(ca_numcompte)+\"'\" )+\",\"+(ca_libelle==\"\" ? \"null\" : \"'\"+ValiderChaine(ca_libelle)+\"'\" )+\",\"+ac_numero+\",\"+(ca_debit==\"true\" ? \"true\" : \"false\")+\"\"+(Asso11?\",\"+TabAsso11[1]:\"\")+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[1]:\"\")+\")\";\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de l'insertion\");\nif (CleLiasonForte!=-1 && !Asso11)\n{\n\tAjouterAssociation(CompoLie,CleMaitre,CleLiasonForte);\n}\nelse\n{\n\tif (CleLiasonForte==-1)\n\t{\n\t\talert(\"Attention votre enregistrement ne peux être relié à \"+CompoLieMaitre.getLabel()+\". Vous devez d'abord ajouter un enregistrement à \"+CompoLieMaitre.getLabel()+\" puis le mettre à jour\");\n\t\treturn -1;\n\t}\n}\nreturn CleMaitre;\n\n}", "title": "" }, { "docid": "0955b78669a5f24552dc4df2205fbf43", "score": "0.5560042", "text": "constructor(linha, coluna) {\n\t\tthis.linha = linha;\n\t\tthis.coluna = coluna;\n\t}", "title": "" }, { "docid": "0f64ff94b127901a068b16fae630b40a", "score": "0.5544561", "text": "function listarCargos_processResponse(res) {\n\n try {\n var info = eval('(' + res + ')');\n var divTerceros = document.getElementById('divListadoCargos');\n if (res != '0') {\n var datosRows = info.data;\n var l = info.cols;\n var ctl = true, claseAplicar = \"\", claseAplicar1 = \"\", claseAplicar2 = \"\";\n\n var id = \"\";\n var nombre = \"\";\n var descripcion = \"\";\n var area = \"\";\n\n var tabla = \"<table class='tbListado centrar' style='text-align: center;'><tr><td class='encabezado' colspan='5'>CARGOS EXISTENTES</td></tr>\";\n tabla += \"<tr><td class='encabezado' colspan='2'>NOMBRE</td><td class='encabezado'>DETALLE</td><td class='encabezado'>EDITAR</td><td class='encabezado'>ELIMINAR</td></tr>\";\n\n for (var i = 0; i < datosRows.length; i += l) {\n id = datosRows[i]\n nombre = datosRows[i + 1];\n descripcion = datosRows[i + 2];\n area = datosRows[i + 3];\n nombreArea = datosRows[i + 4];\n\n if (ctl) {\n claseAplicar = \"cuerpoListado9\";\n claseAplicar2 = \"cuerpoListado3\";\n } else {\n claseAplicar = \"cuerpoListado10\";\n claseAplicar2 = \"cuerpoListado5\";\n }\n\n ctl = !ctl;\n tabla += '<tr><td colspan=\"2\" class=\"' + claseAplicar + '\" align=\"center\">' + unescape(nombre).toUpperCase() + '</td>';\n tabla += '<td class=\"' + claseAplicar2 + '\"><div id=\"imgDetalle\" class=\"linkIconoLateral botonDetalle\" onclick=\"detalle( \\'' + nombre.toUpperCase() + '\\',\\'' + descripcion.toUpperCase() + '\\',\\'' + nombreArea.toUpperCase() + '\\' )\"><img height=\"16px\" width=\"16px\" src=\"../../Recursos/imagenes/administracion/listar.png\"><p>Detalle</p></div></td>'; //copia los datos de la fila seleccionada \n tabla += '<td class=\"' + claseAplicar2 + '\"><div id=\"imgEditar\" class=\"linkIconoLateral botonEditar\" onclick=\"editarCargo( \\'' + id + '\\',\\'' + nombre.toUpperCase() + '\\',\\'' + descripcion.toUpperCase() + '\\',\\'' + area + '\\')\"><img height=\"16px\" width=\"16px\" src=\"../../Recursos/imagenes/administracion/editar_24x24.png\"><p>Editar</p></div></td>'; //copia los datos de la fila seleccionada \n tabla += '<td class=\"' + claseAplicar2 + '\"><div id=\"imgEliminar\" class=\"linkIconoLateral botonEliminar\" onclick=\"eliminarCargo(\\'' + id + '\\')\"><img height=\"16px\" width=\"16px\" src=\"../../Recursos/imagenes/administracion/eliminar_24x24.png\"><p>Eliminar</p></div></td></tr>';\n }\n tabla += '</table>'\n divTerceros.innerHTML = tabla;\n divTerceros.innerHTML += pieDePaginaListar(info, 'listarCargos');\n var idMenuForm = document.getElementById('idMenuForm').innerHTML; // se adiciona esta linea para que se de el permiso de visualizar el editar despues de cargar\n permisosParaMenu(idMenuForm); // se adiciona esta linea para que se el permiso de visualizar el editar despues de cargar\n } else {\n divTerceros.innerHTML = mensajecero;\n }\n } catch (elError) {\n }\n $.fancybox.close();\n}", "title": "" }, { "docid": "6a0081d4481b8e9d68ea1fecb63c70c8", "score": "0.5538822", "text": "function cargarCuerpoElectrico(data, fila, enfoque, bandera) {\n var tr = '<tr id=\"detalles-tr-' + fila + '\" data-value=\"' + fila + '0\" >';\n tr = tr + ' <th class=\"text-center\" data-encabezado=\"Número\" scope=\"row\" id=\"row-' + fila + '\">' + fila + '</th>';\n tr = tr + ' <td data-encabezado=\"Columna 01\">';\n tr = tr + ' <div class=\"form-group m-0\">';\n tr = tr + ' <select class=\"form-control form-control-sm text-right\" id=\"cbo-det-1-' + fila + '\" onchange=\"fn_calcular(' + fila + ')\">';\n tr = tr + ' <option value=\"2018\">2018</option>';\n tr = tr + cargarAnio();\n tr = tr + ' </select>';\n tr = tr + ' </div>';\n tr = tr + ' </td>';\n tr = tr + ' <td data-encabezado=\"Columna 04\">';\n tr = tr + ' <div class=\"form-group m-0\">';\n tr = tr + ' <input class=\"form-control form-control-sm text-right\" type=\"date\" placeholder=\"\" id=\"dat-det-1-' + fila + '\" onBlur=\"fn_calcular(' + fila + ')\">';\n tr = tr + ' </div>';\n tr = tr + ' </td>';\n tr = tr + ' <td data-encabezado=\"Columna 02\">';\n tr = tr + ' <div class=\"form-group m-0\">';\n tr = tr + ' <select class=\"form-control form-control-sm text-right\" id=\"cbo-det-2-' + fila + '\" onchange=\"fn_calcular(' + fila + ')\">';\n tr = tr + ' <option value=\"0\">Seleccione</option>';\n tr = tr + ' </select>';\n tr = tr + ' </div>';\n tr = tr + ' </td>';\n tr = tr + ' <td data-encabezado=\"Columna 03\">';\n tr = tr + ' <div class=\"form-group m-0\">';\n tr = tr + ' <select class=\"form-control form-control-sm text-right\" id=\"cbo-det-3-' + fila + '\" onchange=\"fn_calcular(' + fila + ')\">';\n tr = tr + ' <option value=\"0\">Seleccione</option>';\n tr = tr + ' </select>';\n tr = tr + ' </div>';\n tr = tr + ' </td>';\n tr = tr + ' <td data-encabezado=\"Columna 04\">';\n tr = tr + ' <div class=\"form-group m-0\">';\n tr = tr + ' <input class=\"form-control form-control-sm text-right\" type=\"text\" placeholder=\"\" id=\"txt-det-1-' + fila + '\" onBlur=\"fn_calcular(' + fila + ')\">';\n tr = tr + ' </div>';\n tr = tr + ' </td>';\n tr = tr + ' <td data-encabezado=\"Columna 05\">';\n tr = tr + ' <div class=\"form-group m-0\">';\n tr = tr + ' <input class=\"form-control form-control-sm text-right\" type=\"text\" placeholder=\"\" id=\"txt-det-2-' + fila + '\" onBlur=\"fn_calcular(' + fila + ')\">';\n tr = tr + ' </div>';\n tr = tr + ' </td>';\n tr = tr + ' <td data-encabezado=\"Columna 06\">';\n tr = tr + ' <div class=\"form-group m-0\">';\n tr = tr + ' <input class=\"form-control form-control-sm text-right\" type=\"text\" placeholder=\"\" id=\"txt-det-3-' + fila + '\" onBlur=\"fn_calcular(' + fila + ')\">';\n tr = tr + ' </div>';\n tr = tr + ' </td>';\n tr = tr + ' <td data-encabezado=\"Columna 04\">';\n tr = tr + ' <div class=\"form-group m-0\">';\n tr = tr + ' <input class=\"form-control form-control-sm text-right\" type=\"text\" placeholder=\"\" id=\"txt-det-4-' + fila + '\">';\n tr = tr + ' </div>';\n tr = tr + ' </td>';\n tr = tr + ' <td data-encabezado=\"Columna 07\">';\n tr = tr + ' <div class=\"form-group m-0\">';\n tr = tr + ' <input class=\"form-control form-control-sm text-right\" type=\"text\" placeholder=\"\" id=\"txt-det-5-' + fila + '\" disabled>';\n tr = tr + ' </div>';\n tr = tr + ' </td>';\n tr = tr + ' <td data-encabezado=\"Columna 07\">';\n tr = tr + ' <div class=\"form-group m-0\">';\n tr = tr + ' <input class=\"form-control form-control-sm text-right\" type=\"text\" placeholder=\"\" id=\"txt-det-6-' + fila + '\" disabled>';\n tr = tr + ' </div>';\n tr = tr + ' </td>';\n tr = tr + ' <td data-encabezado=\"Subtotal\">';\n tr = tr + ' <div class=\"form-group m-0\">';\n tr = tr + ' <input class=\"form-control form-control-sm text-right\" type=\"text\" id=\"txt-det-7-' + fila + '\" disabled>';\n tr = tr + ' </div>';\n tr = tr + ' </td>';\n tr = tr + ' <td class=\"text-center text-xs-right\" data-encabezado=\"Acciones\">';\n tr = tr + ' <div class=\"btn-group\">';\n tr = tr + ' <div class=\"acciones fase-01 dropdown-toggle\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\"><i class=\"fas fa-ellipsis-h\"></i></div>';\n tr = tr + ' <div class=\"dropdown-menu dropdown-menu-right\">';\n tr = tr + ' <a class=\"dropdown-item agregarFila\" href=\"#\">';\n tr = tr + ' <i class=\"fas fa-plus-circle\"></i>&nbsp;Agregar';\n tr = tr + ' </a><a class=\"dropdown-item quitarCampos\" href=\"#\" onclick=\"fn_restarTotal(7, 8);\">';\n tr = tr + ' <i class=\"fas fa-minus-circle\"></i>&nbsp;Eliminar';\n tr = tr + ' </a>';\n tr = tr + ' </div>';\n tr = tr + ' </div>';\n tr = tr + ' </td>';\n\n tr = tr + ' <td class=\"text-hide\" data-encabezado=\"ID_INDICADOR\" style=\"display:none;\">';\n tr = tr + ' <div class=\"form-group m-0\">';\n tr = tr + ' <input class=\"form-control form-control-sm text-right\" type=\"text\" id=\"txt-det-8-' + fila + '\" disabled>';\n tr = tr + ' </div>';\n tr = tr + ' </td>';\n\n tr = tr + '</tr>';\n $(\"#cuerpoTablaIndicador\").append(tr);\n if (bandera == 1) {\n fn_CargarListaTipoVehiculo(data, (fila - 1), enfoque);\n }\n //return tr;\n}", "title": "" }, { "docid": "a1b2e718d9f5bc0db75f0c751896898b", "score": "0.5538147", "text": "function escribir(bd){\n\n\t\tvar transaction = bd.transaction(['libros'], \"readonly\");//obre la taula que es vol utilitzar i la manera de treballar, en aques cas nomes lectura.\n\t\tvar store = transaction.objectStore('libros');\n\t\tvar data = [];//array on es guardara els objectes.\n\t\tvar html=\"\";\n\n\t\tvar request = store.openCursor();//obrim un cursor per recorre el indexedDB agafan els objectes.\n\t\trequest.onsuccess = function (event) {\n \t\tvar cursor = event.target.result;\n \t\tif (cursor) {\n\t\t\t\tconsole.log(cursor.value);\n \t\t data.push(cursor.value);\n \t\t cursor.continue();//continue lo que fa es que si existeix un seguent objecte al curos executa el onsucces un altre vegada.\n \t\t} else {\n \t\t for(var i=0;i<data.length;i++){\n\n\t\t\t\t\thtml+=\"<div class=\\\"tablaI\\\"><div class=\\\"indexI\\\">\"+data[i].num+\n\t\t\t\t\t\"</div><div class=\\\"imagenI\\\"><img src=\\\"\" +\n \t\t\t\tdata[i].img +\n \t\t\t\t\"\\\"/></div><div class=\\\"tituloI\\\">\" +\n \t\t\t\tdata[i].titulo +\n\t\t\t\t\t\"</div><div class=\\\"autorI\\\">\" +\n \t\t\t\tdata[i].autor +\n \t\t\t\t\"</div><div class=\\\"descipcionI\\\">\" +\n \t\t\t\tdata[i].desc +\n \t\t\t\t\"</div></div>\";\n\n\t\t\t\t}\n\n\t\t\t\tdocument.getElementById(\"DataBase\").innerHTML=html;\n\t\t\t\tdocument.getElementById(\"content\").style.display=\"block\";//faig visible la zona de deposició de la informació\n\n\t\t\t\tdocument.getElementById(\"buttons\").innerHTML=\"<input id=\\\"buttonCrearBD\\\" type=\\\"button\\\" value=\\\"CrearBD\\\"><input id=\\\"buttonEliminarBD\\\" type=\\\"button\\\" value=\\\"VaciarBD\\\">\";\n\n\t\t\t\tdocument.getElementById(\"buttonEliminarBD\").onclick=eliminar;//conector per al div creat a la instruccio precedent.\n\t\t\t}\n\t\t};\n}", "title": "" }, { "docid": "67a75fa42211e792a83de03a0613e2dc", "score": "0.5535505", "text": "function generarFilaTabla(rel){\n console.log('generar',rel);\n const fecha = rel.fecha_envio_fiscalizar;\n const tipo_mov = rel.descripcion;\n const casino = rel.nombre;\n const nota = noTieneValor(rel.identificacion_nota)? '---' : rel.identificacion_nota;\n\n let fila = $('#filaEjemploRelevamiento').clone().attr('id',rel.id_fiscalizacion_movimiento);\n fila.find('.movimiento').text(rel.id_log_movimiento).attr('title',rel.id_log_movimiento);\n fila.find('.fecha').text(fecha).attr('title',fecha);\n fila.find('.nota').text(nota).attr('title',nota);\n fila.find('.tipo').text(tipo_mov).attr('title',tipo_mov);\n fila.find('.casino').text(casino).attr('title',casino);\n fila.find('.maquinas').text(rel.maquinas).attr('title',rel.maquinas);\n fila.find('button').attr('value',rel.id_fiscalizacion_movimiento);\n\n if(rel.es_controlador != 1){fila.find('.btn-eliminarFiscal').hide();}\n\n const estado = rel.id_estado_relevamiento;\n if(estado > 2){\n fila.find('.btn-cargarRelMov').hide();\n }\n\n fila.find('.btn-imprimirRelMov').show();\n fila.find('.btn-eliminarFiscal').show();\n\n let iclass = 'fa-exclamation';\n let color = 'rgb(255,255,0)';\n let icon = fila.find('.estado i');\n icon.removeClass('fa-exclamation');\n if(estado == 1) { iclass = 'fa-plus' ; color = 'rgb(150,150,150)';} // Generado\n else if(estado == 2) { iclass = 'fa-pencil-alt'; color = 'rgb(244,160,0)' ;} // Cargando\n else if(estado == 3) { iclass = 'fa-check' ; color = 'rgb(66,133,244)' ;} // Finalizado\n else if(estado == 4) { iclass = 'fa-check' ; color = 'rgb(76,175,80)' ;} // Validado\n else { iclass = 'fa-minus' ; color = 'rgb(0,0,0)' ;} // Cualquier otro\n fila.find('.estado').attr('title',rel.estado_descripcion);\n icon.addClass(iclass).css('color',color);\n\n //Si el tipo de mov tiene direccion o es deprecado lo pongo en gris\n if(rel.puede_reingreso != 0 || rel.puede_egreso_temporal != 0 || rel.deprecado == 1){\n fila.find('button').not('.btn-imprimirRelMov,.btn-eliminarFiscal,.btn-verRelMov').remove();\n fila.find('td').css('color','rgb(150,150,150)').css('font-style','italic');\n }\n\n return fila;\n}", "title": "" }, { "docid": "6c0499a40b247d75d702bd5ac58c26c0", "score": "0.55341893", "text": "function mostrarArreglo() { //carga en la tabla html los elementos que ya se encuentran \"precargados\" en el arreglo\n for (const pedido of pedidos) {\n mostrarItem(pedido);\n }\n}", "title": "" }, { "docid": "17c6ad9897910ee3b047a70309d75c46", "score": "0.55310595", "text": "function cargaCombosClientes() {\n\tvar idioma = get(FORMULARIO+'.idioma').toString();\n\tvar pais = get(FORMULARIO+'.pais').toString();\n\t\n\tvar tipoCliente = get(FORMULARIO+'.hTipoCliente').toString();\n\tvar subtipoCliente = get(FORMULARIO+'.hSubtipoCliente').toString();\n\tvar tipoClasificacion = get(FORMULARIO+'.hTipoClasificacion').toString();\n\tvar clasificacion = get(FORMULARIO+'.hClasificacion').toString();\n\t\n\t// Se carga el combo de subtipos de cliente\n\tif (tipoCliente != '') {\n\t\tvar parametros = new Array(5);\n \tparametros[0] = FORMULARIO+'.ValorSubtipoCliente'; \n \tparametros[1] = \"CMNObtieneSubtiposCliente\";\n \tparametros[2] = DTODruidaBusqueda;\n \tparametros[3] = \"[['oidTipoCliente', \" + tipoCliente + \"], ['oidIdioma',\" + idioma + \"], ['oidPais',\" + pais + \"]]\";\n \tparametros[4] = \"seleccionaSubtipoCliente(datos)\";\n \tparametrosRecargaCombos[parametrosRecargaCombos.length] = parametros;\n\t\t/*gestionaCombo(FORMULARIO+'.ValorSubtipoCliente', 'CMNObtieneSubtiposCliente', DTODruidaBusqueda,\n\t\t\t[['oidTipoCliente', tipoCliente], ['oidIdioma',idioma], ['oidPais',pais]],\n\t\t\t'seleccionaSubtipoCliente(datos)',subtipoCliente); */\n\t}\n\t\n\t// Se carga el combo de tipos de clasificación\n\tif (subtipoCliente != '') {\n\t\tvar parametros = new Array(5);\n \tparametros[0] = FORMULARIO+'.ValorTipoClasificacion'; \n \tparametros[1] = \"CMNObtieneTiposClasificacion\";\n \tparametros[2] = DTODruidaBusqueda;\n \tparametros[3] = \"[['oidSubtipoCliente', \" + subtipoCliente + \"], ['oidIdioma',\" + idioma + \"], ['oidPais',\" + pais + \"]]\";\n \tparametros[4] = \"seleccionaTipoClasificacion(datos)\";\n \tparametrosRecargaCombos[parametrosRecargaCombos.length] = parametros;\n\t\t/*gestionaCombo(FORMULARIO+'.ValorTipoClasificacion', 'CMNObtieneTiposClasificacion', DTODruidaBusqueda,\n\t\t\t[['oidSubtipoCliente', subtipoCliente], ['oidIdioma',idioma], ['oidPais',pais]],\n\t\t\t'seleccionaTipoClasificacion(datos)',tipoClasificacion);*/\n\t}\n\t\n\t// Se recarga el combo de clasificaciones\n\tif (tipoClasificacion != '' && subtipoCliente != '') {\n\t\tvar parametros = new Array(5);\n \tparametros[0] = FORMULARIO+'.ValorClasificacion'; \n \tparametros[1] = \"CMNObtieneClasificaciones\";\n \tparametros[2] = DTODruidaBusqueda;\n \tparametros[3] = \"[['oidTipoClasificacion', \" + tipoClasificacion + \"], ['oidSubtipoCliente', \" + subtipoCliente + \"], ['oidIdioma',\" + idioma + \"], ['oidPais',\" + pais + \"]]\";\n \tparametros[4] = \"seleccionaClasificacion(datos)\";\n \tparametrosRecargaCombos[parametrosRecargaCombos.length] = parametros;\n\t\t/*recargaCombo(FORMULARIO+'.ValorClasificacion', 'CMNObtieneClasificaciones', DTODruidaBusqueda, \n\t\t\t[['oidTipoClasificacion', tipoClasificacion], ['oidSubtipoCliente', subtipoCliente], \n\t\t\t['oidIdioma',idioma], ['oidPais',pais]],'seleccionaClasificacion(datos)',clasificacion);*/\n\t}\n}", "title": "" }, { "docid": "4f1fea01682580566a44ddd766f46c8b", "score": "0.5529006", "text": "function borraContenidoCeldas(grid,fila,posxinicio,posxfinal)\n{\n\tvar objCelda,objHeader,tipo,objCampo;\n\tfor(var i=posxinicio; i<=posxfinal; i++)\n\t{\n\t\tobjCelda=document.getElementById(grid+\"_\"+i+\"_\"+fila);\n\t\tif(!objCelda)\n\t\t\treturn false;\n\t\tobjHeader=document.getElementById(\"H_\"+grid+i);\n\t\tif(!objHeader)\n\t\t\treturn false;\n\t\ttipo=(objHeader.tipo)?objHeader.tipo:objHeader.getAttribute(\"tipo\");\n\t\tif(tipo==\"checkbox\")\n\t\t{\n\t\t\tobjCampo=document.getElementById(grid+\"_\"+i+\"_\"+fila);\n\t\t\tif(!objCampo)\n\t\t\t\treturn false;\n\t\t\tobjCampo.checked=false;\n\t\t\tobjCelda.valor=\"\";\n\t\t\tobjCelda.setAttribute(\"valor\",\"\");\n\t\t}\n\t\telse if(tipo == \"decimal\")\n\t\t{\n\t\t\tobjCelda.valor=0;\n\t\t\tobjCelda.setAttribute(\"valor\",0);\n\t\t}\n\t\telse if(tipo!=\"libre\" && tipo !=\"eliminador\" && tipo !=\"formula\")\n\t\t{\n\t\t\tobjCelda.valor=\"\";\n\t\t\tobjCelda.setAttribute(\"valor\",\"\");\n\t\t}\n\t\t\t\n\t\tif(tipo!=\"libre\" && tipo !=\"eliminador\" && tipo != \"oculto\")\n\t\t{\n\t\t\tobjCelda.innerHTML=\"&nbsp;\";\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\tAplicaFormula(objCelda);\t\t\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "b8775cb688952bca3d3122aefecf6524", "score": "0.5524027", "text": "function ClickComprarArmaArmadura(dom, tipo, tabela) {\n var lido = LeEntradaArmaArmadura(dom);\n var preco = PrecoArmaArmaduraEscudo(\n tipo, tabela, lido.chave, lido.material, lido.obra_prima, lido.bonus, true);\n if (preco == null) {\n Mensagem(\"Arma ou armadura mágica inválida\");\n return;\n }\n if (!EntradasAdicionarMoedas(preco)) {\n Mensagem('Não há fundos para compra do item');\n return;\n }\n AtualizaGeralSemLerEntradas();\n}", "title": "" }, { "docid": "3fa86f9dc19090c9c35d70550554d7c7", "score": "0.55240214", "text": "function mostrarXDocente(){\r\n let alumnosDocente = buscarAlumnosPorDocente(usuarioLoggeado);\r\n let mensaje = alumnosDocente;\r\n if (mensaje !== \"\"){\r\n document.querySelector(\"#divMostrarTablaXDocente\").innerHTML = mensaje;\r\n let filasDeTabla = document.querySelectorAll(\".tabFilaAsignarNivel\"); //Sumo funcionalidad para que pueda seleccionar un alumno de la tabla para asignar nivel\r\n for(let i=0; i<filasDeTabla.length; i++){\r\n const element = filasDeTabla[i];\r\n element.addEventListener(\"click\", setValuetxtNomAlumno);\r\n }\r\n }else{\r\n document.querySelector(\"#errorMostrarAlumnosXDocente\").innerHTML = \"No tiene alumnos asignados\";\r\n }\r\n}", "title": "" }, { "docid": "379cdaa22995356f28d24a352bb1f526", "score": "0.55237687", "text": "function agregar() { \n \n // Máximo pueden haber 4 personas a cargo\n if (props.personasaCargo.length < 4){ \n let result = [...props.personasaCargo];\n result.push([,\"\", \"\",])\n cambiarPersonasaCargo(result);\n }\n }", "title": "" }, { "docid": "eb1050c71c68ff4e9e851e12ed5ac726", "score": "0.55210334", "text": "function iniciarArrastre(e) {\n\t\t\t\tlistaHecha.style.background = \"#fcedc4\";//cambiar el color de la lista a amarillo cuando se toma una tarjeta\n\t\t\t\te.dataTransfer.setData(\"text\",e.target.id);\n\t\t\t\tlistaHecha.addEventListener(\"dragend\", terminarArrastre);\n\t\t\t\tfunction terminarArrastre(e){\n\t\t\t\t\tlistaHecha.style.background = \"#d9baa6\";//cambiar el color de la lista a rosa cuando se suelta la tarjeta en otra lista\t\n\t\t\t\t}\t\n\t\t\t}", "title": "" }, { "docid": "139e8b92c7794aa8a6bb60e5abc9aeb3", "score": "0.5519096", "text": "function addCadastro(el) {\n var display = document.getElementById(el).style.display;\n if (display == \"none\")\n document.getElementById(el).style.display = 'block';\n else\n document.getElementById(el).style.display = 'none';\n}", "title": "" }, { "docid": "dc27c64ce0c23657a490581e01e2ca44", "score": "0.5518923", "text": "function addEventsTablaEj(){\r\n let filasDeTabla = document.querySelectorAll(\".filaEjercicioAlumno\"); //Sumo funcionalidad para mostrar ejercicio al alumno\r\n for(let i=0; i<filasDeTabla.length; i++){\r\n const element = filasDeTabla[i];\r\n element.addEventListener(\"click\", mostrarEjElegido);\r\n }\r\n}", "title": "" }, { "docid": "f394ade3fadf5850774f8090eb3318ab", "score": "0.5516085", "text": "function etapa2() {\n countEtapa2++;\n\n //recebendo H3 e setando nela o texto com o nome do cliente\n var tituloDaEtapa = document.querySelector(\"#tituloDaEtapa\");\n tituloDaEtapa.textContent = \"2º Etapa - Crianças\"; \n\n //recebe o controlador com total e todos os aniversariantes e salva em uma variavel \n var totalCriancas = document.getElementById('totalCriancas').value;\n var listaConcatenadaCrianca = document.getElementById('listaConcatenadaCrianca').value; \n\n document.getElementById('confirmacaoCliente').style.display = 'none'; //desabilita a confirmação da etapa 1\n document.getElementById('selecionarAniversariantes').style.display = ''; //habilita a etapa 2\n\n //pega a lista concatenada das crianças e faz um split e salva o resultado na lista resultado\n var resultado = listaConcatenadaCrianca.split(\"/\");\n\n //percorre essa lista resultado\n resultado.forEach((valorAtual) => {\n\n //variaveis \n var idCrianca = 0;\n var nomeCrianca = \"\";\n var idClienteCrianca = 0;\n var countResultado = 0;\n\n //faz novamente um split em cada objeto da lista \n var resultado2 = valorAtual.split(\",\");\n\n //salva nas variaveis os valores da criança\n resultado2.forEach((valorAtual2) => {\n countResultado++;\n //se é a primeira vez que passa na lista, salva o id\n if (countResultado == 1) {\n idCrianca = valorAtual2;\n } \n if (countResultado == 2){\n nomeCrianca = valorAtual2;\n }\n if(countResultado == 3){\n idClienteCrianca = valorAtual2;\n }\n });\n\n //verifica se a criança atual do laço, tem o mesmo idCliente que foi selecionado\n if(idCliente == idClienteCrianca){\n //condição para verificar se alguma vez já passou pela etapa 2 e criou os elementos \n if(countEtapa2 == 1){\n quantidadeCrianca++;\n quantidadeCrianca2++;\n\n document.getElementById('tabelaAniversariante').style.display = ''; //habilita a tabela de listagem de criança\n \n //COMEÇO DA CRIAÇÃO DA TABELA DAS CRIANÇAS\n //cria um elemento do tipo TR e salva ele em uma variavel\n var aniversariantesTr = document.createElement(\"tr\");\n aniversariantesTr.id = \"tdAniversariante\" + quantidadeCrianca;\n\n //cria elementos do tipo TD e salva eles em uma variavel\n var aniversarianteTd = document.createElement(\"td\");\n var removerAniversarianteTd = document.createElement(\"td\");\n\n //criando elemento button para remover\n var removerAniversarianteBotao = document.createElement(\"button\");\n removerAniversarianteBotao.textContent = \"Remover\";\n removerAniversarianteBotao.type = \"button\";\n removerAniversarianteBotao.classList.add(\"btn\", \"btn-info\");\n removerAniversarianteBotao.id = \"idRemoverAniversarianteBotao\";\n removerAniversarianteBotao.name = \"nameRemoverAniversarianteBotao\" + quantidadeCrianca;\n \n //criando atributo onclick para o botão remover\n removerAniversarianteBotao.onclick = function (){\n quantidadeCrianca--; //remove 1 da quantidade de criança\n \n //remove o elemento tr da table\n document.getElementById(aniversariantesTr.id).remove();\n \n //remove o input \n document.getElementById(inputCrianca.id).remove();\n \n //remove da lista de nome a criança removida\n listaNomeCrianca.splice(listaNomeCrianca.indexOf(nomeCrianca), 1); \n \n //se não ficou nenhuma criança oculta a table\n if(quantidadeCrianca == 0){\n document.getElementById('tabelaAniversariante').style.display = 'none';\n quantidadeCriancaBotaoRemover = 0;\n quantidadeCrianca2 = 0;\n textoConfirmacaoCrianca = \"\";\n \n var subTituloEtapa2 = document.querySelector(\"#subTituloEtapa2\");\n subTituloEtapa2.textContent = \"Nenhuma criança selecionada! Por favor, siga para a 3° Etapa ou clique no botão 'Recarregar crianças' para selecionar novamente.\"; \n }\n };\n \n //colocando o botão de remover dentro do td de remover\n removerAniversarianteTd.appendChild(removerAniversarianteBotao);\n\n //seta o texto das td com o nome da criança\n aniversarianteTd.textContent = nomeCrianca;\n\n //coloca os TDS criados que estão com os valores do form dentro do TR\n aniversariantesTr.appendChild(aniversarianteTd);\n aniversariantesTr.appendChild(removerAniversarianteTd);\n\n //pega o elemento table do html através do id e seta nele o TR criado\n var tabelaTbodyAniversariante = document.querySelector(\"#tbodyAniversariantes\");\n tabelaTbodyAniversariante.appendChild(aniversariantesTr);\n //FIM DA CRIAÇÃO DA TABELA DAS CRIANÇAS\n \n //COMEÇO DA CRIAÇÃO O INPUT DO CADASTRO DE FESTA\n //cria um elemento html input\n var inputCrianca = document.createElement(\"input\");\n \n //seta os atributos do input\n inputCrianca.type = \"hidden\";\n inputCrianca.value = idCrianca;\n inputCrianca.name = \"idCrianca\"+quantidadeCrianca;\n inputCrianca.id = \"idCrianca\"+quantidadeCrianca;\n \n //buscando o form de cadastro e setando nele o input criado\n var formCadastroDeFesta = document.querySelector('#cadastrarFestaForm');\n formCadastroDeFesta.appendChild(inputCrianca);\n //FIM DA CRIAÇÃO O INPUT DO CADASTRO DE FESTA\n \n //adiciona o nome da criança na lista de nome da criança\n listaNomeCrianca.push(nomeCrianca);\n \n }\n \n }\n \n });\n \n quantidadeCriancaBotaoRemover = quantidadeCrianca;\n \n //se o cliente não tiver criança\n if(quantidadeCrianca < 1){\n \n if(possuiCrianca == 1){\n var subTituloEtapa2 = document.querySelector(\"#subTituloEtapa2\");\n subTituloEtapa2.textContent = \"Nenhuma criança selecionada! Por favor, siga para a 3° Etapa ou clique no botão 'Recarregar crianças' para selecionar novamente.\"; \n }else{\n var subTituloEtapa2 = document.querySelector(\"#subTituloEtapa2\");\n subTituloEtapa2.textContent = \"Esse cliente não possui nenhuma criança vinculada ao seu cadastro. Por favor, siga para a 3° Etapa ou atualize as informações no cadastro de cliente.\"; \n }\n \n }else{\n possuiCrianca = 1;\n \n var subTituloEtapa2 = document.querySelector(\"#subTituloEtapa2\");\n subTituloEtapa2.textContent = \"Por favor, clique em remover caso alguma criança não faça parte do cadastro: \";\n }\n \n }", "title": "" }, { "docid": "2941d301c2bb293b0ad0c1d138bee1d0", "score": "0.55125207", "text": "function agregarOrden(columna, tipo) {\n return ' ORDER BY p.' + columna + ' ' + tipo; \n}", "title": "" }, { "docid": "bccd85cff1620a89fd33d72b564d74c9", "score": "0.5503887", "text": "function dibujar_tier(){\n\n var aux=0;\n var padre=$(\"#ordenamientos\"); // CONTENEDOR DE TODOS LOS TIER Y TABLAS\n for(var i=0;i<tier_obj.length;i++){ // tier_obj = OBJETO CONTENEDOR DE TODOS LOS TIER DE LA NAVE\n if(i==0) { // PRIMER CASO\n aux=tier_obj[0].id_bodega;\n aux=tier_obj[i].id_bodega;\n var titulo1= $(\"<h4 id='bodega' > BODEGA \"+tier_obj[i].num_bodega+\"</h4>\");\n padre.append(titulo1);\n }\n if(aux!=tier_obj[i].id_bodega){\n aux=tier_obj[i].id_bodega;\n var titulo1= $(\"<h4 id='bodega' > BODEGA \"+tier_obj[i].num_bodega+\"</h4>\");\n padre.append(titulo1);\n }\n\n // DIV CONTENEDOR DEL TITULO, TABLA DE DATOS Y TIER\n var tier_div= $(\"<div class='orden_tier_div'></div>\");\n padre.append( tier_div );\n\n // DIV CON EL TITULO Y LA TABLA VACIA\n var titulo2= $(\"<div id='div\"+tier_obj[i].id_tier+\"'><h4 id='tier'> M/N. \"+tier_obj[i].nombre+\" ARROW . . . . .HOLD Nº \"+tier_obj[i].num_bodega+\" </h4><table class='table table-bordered dat'></table></div>\");\n tier_div.append( titulo2 );\n\n // DIV CON EL TIER Y SUS DIMENSIONES\n var dibujo_tier=$(\"<div class='dibujo1_tier'></div>\");\n\n //DIV DEL RECTANGULO QUE SIMuLA UN TIER\n\n // LARGO AL LADO DERECHO DEL TIER\n var largo_tier=$(\"<div class='largo_tier'><p>\"+tier_obj[i].largo+\" mts</p></div>\");\n dibujo_tier.append( largo_tier );\n\n // EL ID DEL DIV, SERA EL ID DEL TIER EN LA BASE DE DATOS\n var cuadrado_tier=$(\"<div class='dibujo_tier' id=\"+tier_obj[i].id_tier+\"></div>\");\n dibujo_tier.append( cuadrado_tier );\n\n // ANCHO DEBAJO DEL TIER\n var ancho_tier=$(\"<div class='ancho_tier'><p>\"+tier_obj[i].ancho+\" mts</p></div>\");\n dibujo_tier.append( ancho_tier );\n\n tier_div.append( dibujo_tier );\n }\n\n datos_tier(); // ASIGNAR DATOS A LA TABLE DE CADA TIER\n}", "title": "" }, { "docid": "5af209a87261a97a6018823a28ae6860", "score": "0.55033404", "text": "function accionCrear()\n\t{\n\n//\t\talert(\"accionCrear\");\n\t\tif(listado1.datos.length != 0)\n\t\t{\n\t\t\tvar orden = listado1.codSeleccionados();\n//\t\t\talert(\"Linea seleccionada \" + orden);\n\t\t\tset('frmPBuscarTiposError.hidOidCabeceraMatrizSel', orden);\n\t\t\tset('frmPBuscarTiposError.accion', 'crear');\n\t\t\tenviaSICC('frmPBuscarTiposError');\n\n\t\t}else\n\t\t{\n\t\t\talert(\"no hay seleccion: \" + listado1.datos.length);\n\t\t}\n\t}", "title": "" }, { "docid": "a65ea47da2e9513de4701d19126cccff", "score": "0.5502996", "text": "function getDesempenho(){\n init(1200, 500,\"#infos2\");\n executa(dados_atuais, 0,10,4);\n showLegendasRepetencia(false);\n showLegendasDesempenho(true);\n showLegendasAgrupamento(false);\n}", "title": "" }, { "docid": "afeb23a5667648a884db60e762a96b1f", "score": "0.550014", "text": "function cargarCgg_gem_informacion_laboralCtrls(){\n\t\tif(inRecordCgg_gem_informacion_laboral){\n\t\t\ttxtCginf_codigo.setValue(inRecordCgg_gem_informacion_laboral.get('CGINF_CODIGO'));\n\t\t\ttxtCrper_codigo.setValue(inRecordCgg_gem_informacion_laboral.get('CRPER_CODIGO'));\n\t\t\ttxtCginf_disponibilidad.setValue(inRecordCgg_gem_informacion_laboral.get('CGINF_DISPONIBILIDAD'));\n\t\t\tcbxCginf_Calificacion.setValue(inRecordCgg_gem_informacion_laboral.get('CGINF_VEHICULO'))||0;\n\t\t\tsetCalificacion(cbxCginf_Calificacion.getValue());\n\t\t\ttxtCginf_licencia_conducir.setValue(inRecordCgg_gem_informacion_laboral.get('CGINF_LICENCIA_CONDUCIR'));\n\t\t\tchkCginf_discapacidad.setValue(inRecordCgg_gem_informacion_laboral.get('CGINF_DISCAPACIDAD'));\n\t\t\ttxtCginf_estado_laboral.setValue(inRecordCgg_gem_informacion_laboral.get('CGINF_ESTADO_LABORAL'));\n\t\t\ttxtCginf_observaciones.setValue(inRecordCgg_gem_informacion_laboral.get('CGINF_OBSERVACIONES'));\n\t\t\tisEdit = true;\t\t\n\t}}", "title": "" }, { "docid": "9623e6aba079cbe556576ffbc2aa8c23", "score": "0.54977375", "text": "function dibujarFresado126(modelo,di,pos,document){\n\t\n\t\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\t//Puntos trayectoria \n\t\n\t\n\tvar fresado1 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior)\n\tvar fresado2 = new RVector(pos.x+alaIzquierda+pliegueIzq,pos.y+alaInferior)\n\tvar fresado3 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchuraPlaca,pos.y+alaInferior)\n\t\n\tvar fresado4 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+alturaPlaca)\n\tvar fresado5 = new RVector(pos.x+alaIzquierda+pliegueIzq,pos.y+alaInferior+alturaPlaca)\n\tvar fresado6 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchuraPlaca,pos.y+alaInferior+alturaPlaca)\n\t\n\n\t\n\t\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado3 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado4 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado2 , fresado5 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado3 , fresado6 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado4 , fresado6 ));\n\t\top_fresado.addObject(line,false);\n\n\t\n\n\treturn op_fresado; \n\n\t\n}", "title": "" }, { "docid": "33fbad4e880ab75a3206b3936c0bbb53", "score": "0.54971915", "text": "function generarTablaEj (){\r\n buscarEjXNivDocEntrega();\r\n document.querySelector(\"#divEjalumnos\").innerHTML = `<table id=\"tabEjAlumno\" border='2px' style='background-color: #FA047F; position: relative;'>\r\n <th>Título</th><th>Docente</th><th>Nivel</th>`;\r\n for(let iterador = 0; iterador<= ejerciciosAMostrar.length-1; iterador ++){\r\n document.querySelector(\"#tabEjAlumno\").innerHTML += `<tr id=\"${iterador}\" class=\"filaEjercicioAlumno\"> <td style=\"padding: 10px\"> ${ejerciciosAMostrar[iterador].titulo} </td> <td style=\"padding: 10px\"> ${ejerciciosAMostrar[iterador].Docente.nombre} </td><td style=\"padding: 10px\"> ${ejerciciosAMostrar[iterador].nivel} </td> </tr>`;\r\n }\r\n addEventsTablaEj();\r\n}", "title": "" }, { "docid": "ef1a3b62f6ca2165179f841e2c075eaf", "score": "0.54969454", "text": "function etapa5() {\n \n msgTratamentoEtapa4.innerHTML = \"\";\n \n //recebe\n var pacoteSelecionado = document.getElementById('jsPacote').value;\n \n if(pacoteSelecionado !== \"\"){\n \n //recebendo H3 e setando nela o texto com o nome do cliente\n var tituloDaEtapa = document.querySelector(\"#tituloDaEtapa\");\n tituloDaEtapa.textContent = \"5º Etapa - Valores Adicionais & Desconto\";\n\n document.getElementById('inserirValorAdicional').style.display = ''; //habilita a etapa 5\n document.getElementById('selecionarPacotes').style.display = 'none'; //desabilita a etapa 4 \n \n //recebe a string de pacote selecionado e faz um split e salva em uma lista\n resultado = pacoteSelecionado.split(\"¬\");\n\n //variavel utilizada para percorrer a lista\n var countResultado = 0;\n var idPacoteSelecionado = 0; \n\n //percorre essa lista\n resultado.forEach((valorAtual) => {\n countResultado++;\n\n //se é a primeira vez que passa na lista, pega o valorAtual e adiciona na variavel idPacoteSelecionado\n if (countResultado == 1) {\n idPacoteSelecionado = valorAtual;\n }\n //se é a segunda vez que passa na lista, pega o valorAtual e adiciona na variavel nomePacote\n if (countResultado == 2) {\n nomePacote = valorAtual;\n }\n //se é a terceira vez que passa na lista, pega o valorAtual e adiciona na variavel valorPacote\n if (countResultado == 3) {\n valorPacote = valorAtual;\n countResultado = 0;\n }\n\n }); \n\n //define o texto informação do pacote na ultima etapa\n var confirmacaoInfPacote = document.querySelector(\"#pacoteInf\");\n confirmacaoInfPacote.textContent = \"Pacote: \"+nomePacote+\" - Valor: R$\"+valorPacote; \n\n //SETA O ID DO PACOTE NO INPUT DO CADASTRO DE FESTA\n document.getElementById('idPacoteF').value = idPacoteSelecionado;\n \n }else{\n \n msgTratamentoEtapa4.innerHTML = \"É necessario informar o campo \\\"Pacote\\\" antes de seguir para a 5° Etapa!\";\n\n }\n \n }", "title": "" }, { "docid": "4a207b7ed84e95da371b7c57e8e293b7", "score": "0.54930246", "text": "function impostaCausaliSpesa (list) {\n var opts = {\n aaData: list,\n oLanguage: {\n sZeroRecords: \"Nessun impegno associato\"\n },\n aoColumnDefs: [\n {aTargets: [0], mData: computeStringMovimentoGestione.bind(undefined, 'impegno', 'subImpegno', 'capitoloUscitaGestione')},\n {aTargets: [1], mData: readData(['subImpegno', 'impegno'], 'descrizione')},\n {aTargets: [2], mData: readData(['subImpegno', 'impegno'], 'importoAttuale', 0, formatMoney), fnCreatedCell: tabRight},\n {aTargets: [3], mData: readData(['subImpegno', 'impegno'], 'disponibilitaPagare', 0, formatMoney), fnCreatedCell: tabRight}\n ]\n };\n var options = $.extend(true, {}, baseOpts, opts);\n $(\"#tabellaMovimentiSpesa\").dataTable(options);\n }", "title": "" }, { "docid": "a0c930c901b70c9dc058997b0880fe72", "score": "0.54928154", "text": "llistarAlumnesHores(){\n let conta = 0;\n this.llistaArr.forEach((e) => {\n const {nom, horesFetes} = e;\n const hores = horesFetes > 0 ? `${horesFetes}`.green : `${horesFetes}`.red;\n conta += 1;\n console.log(\n `Alumne: `.yellow+` ${nom.magenta} ${\"::\".cyan} ${'Hores'.yellow} ${hores}`\n );\n });\n }", "title": "" }, { "docid": "c245a9dc207bb84d70eb8744b28ca5cb", "score": "0.5489783", "text": "function MostrarLista(){\n //declaramos una viable para guardar los datos\n var listaregistro=Mostrar();\n //selecciono el tbody de la tabla donde voy a mostrar la informacion\n var tbody=document.querySelector(\"#tbAlumno tbody\");\n tbody.innerHTML=\"\";\n //agregamos al tbody las filas que se registren\n for(var i=0;i<listaregistro.length;i++){\n //declaramos una variable para las filas\n var fila=tbody.insertRow(i);\n //declaramos variables para los titulos\n var titulonom=fila.insertCell(0);\n var tituloape=fila.insertCell(1);\n var titulodni=fila.insertCell(2);\n var titulocur=fila.insertCell(3);\n var titulotur=fila.insertCell(4);\n var tituloest=fila.insertCell(5);\n //agregamos los valores\n titulonom.innerHTML=listaregistro[i].nombre;\n tituloape.innerHTML=listaregistro[i].apellido;\n titulodni.innerHTML=listaregistro[i].dni;\n titulocur.innerHTML=listaregistro[i].curso;\n titulotur.innerHTML=listaregistro[i].turno;\n tituloest.innerHTML=listaregistro[i].estado;\n tbody.appendChild(fila); \n }\n}", "title": "" }, { "docid": "244ee5682744b00e5f7c388e52b78792", "score": "0.5488236", "text": "function construye() {\n let base = [];\n for (let i = 0; i < numCajas; i++) {\n base.push(angular.copy(cajaDefecto));\n }\n return base;\n }", "title": "" }, { "docid": "cfa201c6a9b02c6898b01ca2bb5d3ae0", "score": "0.54872686", "text": "function escoltaCopia () {\r\n if(this.validate) {\r\n this.capa.innerHTML=\"\";\r\n this.putImg (this.dirImg+\"/\"+this.paraules[index].imatge);\r\n this.capa.innerHTML += \"<br>\" + this.correcte.toUpperCase();\r\n this.putSound (this.paraules[index].so);\r\n }\r\n else {\r\n tabla =insertTable (this.correcte + \"&nbsp;\",this.actual + this.putCursor ('black'), this.estil);\r\n this.capa.innerHTML = tabla;\r\n this.putSound (this.paraules[index].so);\r\n }\r\n}", "title": "" }, { "docid": "75209b1b137f35d7aec22a76f9149095", "score": "0.5484156", "text": "function construirTabla() {\n let tabla = document.createElement(\"table\");\n let body = document.getElementById(\"paraTablas\");\n body.appendChild(tabla);\n tabla.setAttribute(\"id\", \"table\");\n tabla.setAttribute(\"class\", \"table table-hover\");\n let trheadcabeza = document.createElement(\"thead\");\n tabla.appendChild(trheadcabeza);\n trheadcabeza.setAttribute(\"class\", \"tabla_primerFila\");\n let trhead = document.createElement(\"tr\");\n trheadcabeza.appendChild(trhead);\n let tdhead0 = document.createElement(\"td\");\n tdhead0.innerHTML = \"Número de cuota\";\n trhead.appendChild(tdhead0);\n let tdhead1 = document.createElement(\"td\");\n tdhead1.innerHTML = \"Saldo pendiente al inicio\";\n trhead.appendChild(tdhead1);\n let tdhead2 = document.createElement(\"td\");\n tdhead2.innerHTML = \"Intereses sobre saldo\";\n trhead.appendChild(tdhead2);\n let tdhead3 = document.createElement(\"td\");\n tdhead3.innerHTML = \"Saldo con intereses\";\n trhead.appendChild(tdhead3);\n let tdhead4 = document.createElement(\"td\");\n tdhead4.innerHTML = \"Cuota a pagar\";\n trhead.appendChild(tdhead4);\n let tdhead5 = document.createElement(\"td\");\n tdhead5.innerHTML = \"Remanente post pago\";\n trhead.appendChild(tdhead5);\n let tbody = document.createElement(\"tbody\");\n tabla.appendChild(tbody);\n let prestamo = datosDePrestamo.length;\n for (let i = 0; i < prestamo; i++) {\n let tr1 = document.createElement(\"tr\");\n tbody.appendChild(tr1);\n let info0 = document.createElement(\"td\");\n info0.innerHTML = i + 1;\n tr1.appendChild(info0);\n let info = document.createElement(\"td\");\n info.innerHTML = redondear(datosDePrestamo[i].capital);\n tr1.appendChild(info);\n let info4 = document.createElement(\"td\");\n info4.innerHTML = redondear(datosDePrestamo[i].intereses);\n tr1.appendChild(info4);\n let info5 = document.createElement(\"td\");\n info5.innerHTML = redondear(datosDePrestamo[i].capitalPostInt);\n tr1.appendChild(info5);\n let info2 = document.createElement(\"td\");\n info2.innerHTML = redondear(datosDePrestamo[i].cuota);\n tr1.appendChild(info2);\n let info3 = document.createElement(\"td\");\n info3.innerHTML = redondear(datosDePrestamo[i].saldoRem);\n tr1.appendChild(info3);\n }\n $(\"#paraTablas\").append(`<button id=\"solicitarPrestamo\" class=\"btn btn-dark btn-align btn-margin\" onclick=\"solicitarPrestamo()\">Solicitar prestamo</button>`)\n $(\".tablaa\").fadeIn(\"slow\");\n}", "title": "" }, { "docid": "1878aa786248161f1d90efbb5ceb2726", "score": "0.548406", "text": "function tabla_funciones() {\n\n var nota = \"<a style=\\\"color: #fff;\\\" href=\\\"javascript:void(muestrafigura({file:'TEOS10notation',label:'Notation',ancho:'75%'}))\\\">Notation</a>\";\n\t\r\n var html = \"<table id=\\\"TABLA\\\" border=\\\"1px\\\" style=\\\"width:100%;font-size:90%;\\\">\\n\";\r\n\t\r\n for (var i=0; i < sect.length; i++) {\r\n\t html +=\"<tr><td class=\\\"b\\\" colspan=\\\"2\\\" style=\\\"padding-left:1ex;padding-right:2ex;background: #555; color:#fff;\\\">\" + sect[i] + \"<span style=\\\"float:right;\\\">\" + nota+\" </span></td></tr>\\n\";\r\n\t\tfor (var j=0; j < sectfunc[i].functions.length; j++) {\r\n\t\tvar ids =\"in_\" + j;\r\n\t\tvar boton = \"<input type=\\\"submit\\\" value=\\\" COMPUTE \\\" onclick=\\\"res=TEOS10.\" + sectfunc[i].functions[j] + \"(parametros);alert(res)\\\"> \";\r\n\t\t html += \"<td style=\\\"vertical-align:middle;padding-left:1ex;\\\">\" + boton + \"<a href=\\\"javascript:void(helprutine({tipo:'\"+sectfunc[i].functions[j]+\"',label:'cabecera', file:'TEOS10help',section:\"+i+\"}))\" + \"\\\">\" + sectfunc[i].funcdesc[j] + \"</a></td><td>\";\r\n\t\t var cadena = \"$('#\"+ids+\"_\"+sectfunc[i].funcpara[j][0]+\"').val()\";\r\n\t\t var cadenahelp = \"<span class=\\\\'azul\\\\'>\" + sectfunc[i].functions[j] + \"</span> (<span class=\\\\'ora\\\\'>\" + sectfunc[i].funcpara[j][0];\r\n\t\t for (var k=1; k < sectfunc[i].funcpara[j].length; k++) {\r\n\t\t cadena += \",\" + \"$('#\"+ids+\"_\" + sectfunc[i].funcpara[j][k] + \"').val()\";\r\n\t\t cadenahelp += \", \" + sectfunc[i].funcpara[j][k];\r\n\t\t }\r\n\t\t cadenahelp += \"</span>)\";\r\n\t\t html = html.replace('cabecera',cadenahelp);\r\n\t\t html = html.replace('parametros',cadena);\r\n\t\t for (var k=0; k < sectfunc[i].funcpara[j].length; k++) {\r\n\t\t if (sectfunc[i].functions[j] == \"gsw_gibbs\" && ( k==0 || k==1 || k==2 ) ) {\r\n\t\t html += sectfunc[i].funcpara[j][k] +\r\n\t\t\t \"<input type=\\\"text\\\" size=\\\"2\\\" id=\\\"\" + ids + \"_\" + sectfunc[i].funcpara[j][k] + \"\\\"> \";\r\n\t\t } else\r\n\t\t html += sectfunc[i].funcparat[j][k] +\r\n\t\t\t \"<input type=\\\"text\\\" size=\\\"8\\\" id=\\\"\" + ids + \"_\" + sectfunc[i].funcpara[j][k] + \"\\\"> \";\r\n\t\t }\r\n\t\t html +=\"</td></tr>\\n\";\r\n\t\t}\t\r\n\t}\r\n\thtml +='</table>\\n';\r\n\n document.write(html);\n\n}", "title": "" }, { "docid": "4b88d440f459ddfb134238febdf00c00", "score": "0.5482612", "text": "function renderizarTabla(datos){\n elementoId = datos.atributos.elementoId;\n url = `${datos.config.ENTORNO.URL_BASE}Vistas/tabla_estructura.php`;\n xhr = new XMLHttpRequest();\n xhr.open('POST', url, true);\n xhr.setRequestHeader('content-type', 'application/json; charset=UTF-8');\n xhr.send(JSON.stringify(datos));\n xhr.onreadystatechange = () => {\n if(xhr.readyState == 4){\n document.getElementById(`tabla${elementoId}`).innerHTML = xhr.responseText;\n barraCargando(`barra-cargando${elementoId}`, false);\n }\n }\n}", "title": "" }, { "docid": "8847e8b9668b98c4fbf6a2dc6933393c", "score": "0.54779714", "text": "function cargarlistaproductos() {\n //posicionarlos dedbajo de la cabezera\n var tabla = document.getElementById('tbl_listaproductos')\n var contador = 0;\n listaproductos = cargarproductos(); //cargo el array\n listaproductos.forEach(producto => {\n contador++;\n var fila = tabla.insertRow(-1); //creo la fila\n var celda0 = fila.insercell(0); //inserto la celada0\n celda0.innerHTML = producto.nombre; //cargo el dato en la\n var celda1 = fila.insercell(1);\n celda1.innerHTML = producto.precio\n var celda2 = fila.insercell(2);\n celda2.innerHTML = 'inpuy type =\"text\"/>';\n var celda3 = fila.insercell(3);\n celda3.innerHTML = '<inpuy tag=\"' + contador + '\"type =\"checkbox onclick=\"javascrip\"/>';\n })\n return;\n}", "title": "" }, { "docid": "81e561a6745226bee4a8b27f7bd4ed56", "score": "0.54777586", "text": "function forPantallaCajero(modulo, empleado){\n\tvar txt =forEncabezado(modulo, empleado);\n\n\ttxt +='<div id=\"cont_centro\"><table class=\"table table-hover table-striped\">';\n\ttxt +='<thead><tr><th>Pedido</th><th>Valor</th><th>Ver Pedido</th></tr></thead>';\n\ttxt +='<tbody id = \"tablaCajero\"></tbody></table></div>';\n\treturn txt;\n}", "title": "" }, { "docid": "c779dc170d5e54b8edf57bbff20163e6", "score": "0.5476981", "text": "creaTabella(result){\n\t\tthis.data = this.ricreaArrJson(result);\t\n\t\tthis.createColumn();\n\t\tthis.myTable = $('#flussi').DataTable({\n\t\t \"sPaginationType\": \"full_numbers\",\n\t\t data: this.data,\n\t\t columns: this.ArrCol,\n\t\t\tdom: 'Bfrtip', // Needs button container\n\t\t select: 'single',\n\t\t responsive: true,\n\t\t altEditor: true, // Enable altEditor\n\t\t onDeleteRow:this.deleteRow,\n\t\t onEditRow: this.editRow,\n\t\t onAddRow: this.addRow,\n\t\t buttons: [{\n\t\t text: 'Add',\n\t\t name: 'add' // do not change name\n\t\t },\n\n\t\t {\n\t\t extend: 'selected', // Bind to Selected row\n\t\t text: 'Edit',\n\t\t name: 'edit' // do not change name\n\t\t },\n\n\t\t {\n\t\t extend: 'selected', // Bind to Selected row\n\t\t text: 'Delete',\n\t\t name: 'delete' // do not change name\n\t\t }]\n\t\t });\n\t}", "title": "" }, { "docid": "aae0a0378ccb3bd24755be33503d2d5a", "score": "0.54768264", "text": "function Bloqueia_Linhas(actpos,div){\n\t//BLOQUEIA AS LINHAS MENOS A LINHA QUE ESTOU EDITANDO\n\t$(div + ' input').attr('disabled',true);\n\t//DESBLOQUEIA OS INPUTS DA LINHA QUE EU ESTOU EDITANDO, POREM NAO DESABILITA OS QUE TEM A CLASSE INATIVO\n\t$(div + \" tr[posicao=\"+actpos+\"] td input\").attr('disabled',false);\n\t$(div + \" tr[posicao=\"+actpos+\"] td.inativo input\").attr('readonly',true);\n}", "title": "" }, { "docid": "1713b9db9bf6f0a101e2ff0c275f22e6", "score": "0.5470775", "text": "function golist() {\n /*Ajustar la petición para mostrar la tabla de resultados procesos*/\n var columnasdata = [{ \"data\": \"AA\" },\n { \"data\": \"BB\" },\n { \"data\": \"CC\" },\n { \"data\": \"ACCIONES\" }];\n\n /*Consultar procesos y mostrar*/\n autogenDatatablesminHeaders(columnasdata, \"DT_listado\", \"JFunctionData\", \"listas\", \"{}\");\n document.getElementById(\"FW_resultados\").style.display = \"block\";\n}", "title": "" }, { "docid": "a72b9c4643b71b48e2c11c68af9441f0", "score": "0.54681", "text": "function getEmpleadosTabla() {\n $http.post(\"EmpleadosTabla/getEmpleadosTabla\").then(function (r) {\n if (r.data.cod == \"OK\") {\n vm.lista.data = r.data.d.tablaEmpleado\n vm.lista.disp = [].concat(vm.lista.data);\n }\n })\n }", "title": "" }, { "docid": "fdfd6de0dbe8a835fbb10e63ecf35331", "score": "0.5465142", "text": "function colorCordenadas(e) { // Si al clickear se encuentra con un barco enemigo se vuelve rojo\n\tif (contador >= 1) {\n\t\tlet coordenadas = e.target.id;\n\t\t//console.log(coordenadas)\n\t\tif (miTraduccion.includes(coordenadas)) {\n\t\t\te.target.style.background = \"red\";\n\t\t} else {\n\t\t\te.target.style.background = \"gray\";\n\t\t}\n\t\tcontador--;\n\t}\n}", "title": "" }, { "docid": "e0daec4b0e6fa8e23cda86f8f4c8d6cd", "score": "0.5461964", "text": "function listar() {\n tabla = $(\"#inventario\").DataTable({\n serverSide: true,\n responsive: true,\n ajax: \"api/reporte/inventario\",\n dom: \"Bfrtip\",\n iDisplayLength: 10,\n buttons: [\n \"pageLength\",\n \"copyHtml5\",\n {\n extend: \"excelHtml5\",\n autoFilter: true,\n sheetnombre: \"Exported data\"\n },\n \"csvHtml5\",\n {\n extend: \"pdfHtml5\",\n orientation: \"landscape\",\n pageSize: \"LEGAL\"\n }\n ],\n columns: [\n { data: \"nombre\", name: \"ingrediente.nombre\" },\n { data: \"disponible\", name: \"inventario.disponible\" },\n { data: \"costo\", name: \"inventario.costo\"},\n { data: \"nota\", name: \"inventario.nota\"},\n { data: \"fecha_ingreso\", name: \"inventario.fecha_ingreso\"},\n ],\n order: [[1, \"asc\"]]\n // rowGroup: {\n // dataSrc: \"role\"\n // }\n });\n }", "title": "" }, { "docid": "9674cf46dd33dd3649b3f8b08d1a1301", "score": "0.546166", "text": "function tablaresultadosordencompra(limite)\r\n{\r\n \r\n \r\n var decimales = document.getElementById('decimales').value;\r\n var base_url = document.getElementById('base_url').value;\r\n var controlador = base_url+'orden_compra/buscar_ordenescompra';\r\n let parametro = \"\";\r\n if(limite == 2){\r\n parametro = document.getElementById('filtrar').value;\r\n }else if(limite == 3){\r\n parametro = \"\";\r\n }\r\n //document.getElementById('loader').style.display = 'block'; //muestra el bloque del loader\r\n $.ajax({url: controlador,\r\n type:\"POST\",\r\n data:{parametro:parametro},\r\n success:function(respuesta){\r\n var registros = JSON.parse(respuesta);\r\n var color = \"\";\r\n if (registros != null){\r\n //var formaimagen = document.getElementById('formaimagen').value;\r\n var n = registros.length; //tamaño del arreglo de la consulta\r\n $(\"#encontrados\").html(n);\r\n html = \"\";\r\n for (var i = 0; i < n ; i++){\r\n html += \"<tr>\";\r\n html += \"<td style='padding: 2px;' class='text-center'>\"+(i+1)+\"</td>\";\r\n html += \"<td style='padding: 2px;'>\"+registros[i]['usuario_nombre']+\"</td>\";\r\n html += \"<td style='padding: 2px;' class='text-center'>\"+registros[i]['ordencompra_id']+\"</td>\";\r\n html += \"<td style='padding: 2px;' class='text-center'>\";\r\n html += moment(registros[i][\"ordencompra_fecha\"]).format(\"DD/MM/YYYY\");\r\n html += \"</td>\";\r\n html += \"<td style='padding: 2px;' class='text-center'>\"+registros[i]['ordencompra_hora']+\"</td>\";\r\n html += \"<td style='padding: 2px;' class='text-center'>\";\r\n html += moment(registros[i][\"ordencompra_fechaentrega\"]).format(\"DD/MM/YYYY\");\r\n html += \"</td>\";\r\n html += \"<td style='padding: 2px;' class='text-center'>\"+registros[i]['proveedor_nombre']+\"</td>\";\r\n html += \"<td style='padding: 2px;' class='text-right'>\"+Number(registros[i]['ordencompra_totalfinal']).toFixed(decimales)+\"</td>\";\r\n html += \"<td style='padding: 2px;' class='text-center'>\"+registros[i]['estado_descripcion']+\"</td>\";\r\n html += \"<td style='padding: 2px;' class='no-print'>\";\r\n html += \"<a href='\"+base_url+\"orden_compra/edit/\"+registros[i][\"ordencompra_id\"]+\"' class='btn btn-info btn-xs' title='Modificar orden compra' ><span class='fa fa-pencil'></span></a>&nbsp;\";\r\n html += \"<a class='btn btn-success btn-xs' onclick='mostrar_reciboorden(\"+registros[i]['ordencompra_id']+\")' title='Ver reporte orden compra'><fa class='fa fa-print'></fa></a>&nbsp;\";\r\n html += \"<a class='btn btn-facebook btn-xs' onclick='mostrar_reciboordenp(\"+registros[i]['ordencompra_id']+\")' title='Ver reporte orden compra para proveedor'><fa class='fa fa-print'></fa></a>&nbsp;\";\r\n if(registros[i]['estado_id'] == 33){\r\n html += \"<a class='btn btn-danger btn-xs' onclick='modal_ejecutarordencompra(\"+registros[i]['ordencompra_id']+\")' title='Ejecutar orden compra'><fa class='fa fa-bolt'></fa></a>&nbsp;\";\r\n html += \"<a class='btn btn-warning btn-xs' onclick='modal_anularordencompra(\"+registros[i]['ordencompra_id']+\")' title='Anular orden compra'><fa class='fa fa-minus-circle'></fa></a>\";\r\n }/*else if(registros[i]['estado_id'] == 35){\r\n html += \"<a class='btn btn-warning btn-xs' onclick='modal_anularordencmpra(\"+registros[i]['ordencompra_id']+\")' title='Anular orden compra'><fa class='fa fa-minus-circle'></fa></a>\";\r\n }*/\r\n \r\n html += \"</td>\";\r\n html += \"</tr>\";\r\n }\r\n $(\"#tablaresultados\").html(html);\r\n //document.getElementById('loader').style.display = 'none';\r\n }\r\n //document.getElementById('loader').style.display = 'none'; //ocultar el bloque del loader\r\n },\r\n error:function(respuesta){\r\n // alert(\"Algo salio mal...!!!\");\r\n html = \"\";\r\n $(\"#tablaresultados\").html(html);\r\n },\r\n complete: function (jqXHR, textStatus) {\r\n //document.getElementById('loader').style.display = 'none'; //ocultar el bloque del loader \r\n //tabla_inventario();\r\n }\r\n });\r\n}", "title": "" }, { "docid": "ecd6ee7d606ee95ff234b84637d03ae7", "score": "0.5459127", "text": "function maketable_allof(icaos, type, how) {\n\t\ticaos = icaos.filter(d=>icaodb[d][type] == how);\n\t\td3.select(\"#colorbar\")\n\t\t\t.transition()\n\t\t\t.duration(300)\n\t\t\t.styleTween(\"background-color\", function(d){\n\t\t\t\t return d3.interpolateLab(d3.select(this)\n\t\t\t\t \t\t\t\t\t\t\t .style(\"background-color\"),\n\t\t\t\t \t\t\t\t\t\t\tfiltercss[type].fillcol);\n\t\t\t})\n\t\tmaketable_icaos(icaos);\n\t}", "title": "" }, { "docid": "93256ec6566fffa58245c2a1d10b0a10", "score": "0.5458972", "text": "function escolta () {\r\n text = this.ant;\r\n if(this.validate) {\r\n \tthis.capa.innerHTML=\"\";\r\n index = cerca (this.paraules, text); \r\n if (index == -1) {\r\n this.capa.innerHTML=this.putCursor(\"black\");\r\n }\r\n else {\r\n this.putImg (this.dirImg+\"/\"+this.paraules[index].imatge);\r\n this.capa.innerHTML += \"<br>\" + this.paraules[index].paraula;\r\n this.putSound (this.paraules[index].so);\r\n }\r\n }\r\n \r\n\r\n}", "title": "" }, { "docid": "6b6fbe80138503517774569a31703575", "score": "0.5457357", "text": "function iniciarListaBusqueda(){\n var ciclos = selectDatoErasmu();\n for(var aux = 0, help = 0 ; aux < erasmu.length ; aux++){\n if(ciclos.indexOf(erasmu[aux].ciclo) != -1){\n crearListErasmu(erasmu[aux]);\n }\n }\n}", "title": "" }, { "docid": "b79da7842b4c295bd315e46845d5dcf7", "score": "0.5451992", "text": "function InicializarSeleccionDificultad()\n{\n const spanSingle = document.getElementById(\"span_single\");\n var btnsDif = document.getElementsByClassName(\"boton_dificultad\");\n\n spanSingle.innerHTML = \"1 JUGADOR\";\n spanSingle.style.backgroundColor = \"#a2feff\";\n spanSingle.style.color = \"black\";\n document.getElementById(\"span_jugar\").innerHTML = \"2 JUGADORES\";\n document.getElementById(\"nombre\").readOnly = false;\n\n for (var i = 0 ; i < btnsDif.length ; i++)\n {\n var lunares = btnsDif[i].getElementsByClassName(\"lunares\")[0].getElementsByClassName(\"lunar\");\n\n for (var j = 0 ; j < lunares.length ; j++)\n {\n lunares[j].style.backgroundColor = \"#03c4d0\";\n }\n\n btnsDif[i].style.backgroundColor = \"#a2feff\";\n btnsDif[i].style.color = \"black\";\n btnsDif[i].classList.add(\"clickable\");\n }\n}", "title": "" }, { "docid": "a51513602352da0a7f7e9f26389b2abc", "score": "0.5449994", "text": "get icaos() {\n return this.rows.reduce((result, {icao}) => icao ? result.concat(icao) : result, []);\n }", "title": "" }, { "docid": "4c2a0e438306c808defbadcea9a7b1c3", "score": "0.5446242", "text": "function _AdicionaArmaArmadura(nome, tabelas, rotulos_tabelas, div_pai) {\n // Tabela sera usada na compra e venda.\n var tabela;\n if (nome == 'arma') {\n tabela = tabelas_armas;\n } else if (nome == 'armadura') {\n tabela = tabelas_armaduras;\n } else if (nome == 'escudo') {\n tabela = tabelas_escudos;\n } else {\n Mensagem('Nome invalido, esperando arma ou armadura.');\n return null;\n }\n\n var id_div_equipamentos = div_pai.id;\n var id_gerado = GeraId('div-' + nome, div_pai);\n var input_em_uso = null;\n if (nome == 'armadura' || nome == 'escudo') {\n input_em_uso = CriaRadio(null, null, null, nome + '-em-uso', null);\n input_em_uso.addEventListener(\n 'click',\n {\n input: input_em_uso,\n handleEvent: function(evt) {\n ClickUsarArmaduraEscudo(this.input);\n }\n },\n false);\n }\n var select = CriaSelect();\n select.setAttribute('name', 'select-principal');\n select.addEventListener('change', AtualizaGeral);\n for (var i = 0; i < tabelas.length; ++i) {\n var optgroup = CriaOptGroup(rotulos_tabelas[i]);\n var items_ordenados = [];\n for (var corrente in tabelas[i]) {\n items_ordenados.push(corrente);\n }\n items_ordenados.sort(function(ie, id) {\n return Traduz(tabelas[i][ie].nome).localeCompare(Traduz(tabelas[i][id].nome));\n });\n items_ordenados.forEach(function(corrente) {\n var option = CriaOption(Traduz(tabelas[i][corrente].nome), corrente);\n option.setAttribute('name', corrente);\n option.selected = false;\n optgroup.appendChild(option);\n });\n select.appendChild(optgroup);\n }\n\n var select_material = CriaSelect();\n select_material.setAttribute('name', 'select-material');\n select_material.addEventListener('change', AtualizaGeral);\n for (var corrente in tabelas_materiais_especiais) {\n var option = CriaOption(Traduz(tabelas_materiais_especiais[corrente].nome), corrente);\n option.selected = false;\n select_material.appendChild(option);\n }\n\n\n var span_obra_prima = CriaSpan(Traduz(' OP'));\n\n var input_obra_prima = CriaInputCheckbox(false, null, null, AtualizaGeral);\n input_obra_prima.setAttribute('name', 'obra-prima');\n\n var input_bonus = CriaInputNumerico(null, null, null, AtualizaGeral);\n input_bonus.setAttribute('name', 'bonus-magico');\n input_bonus.setAttribute('maxlength', 2);\n input_bonus.setAttribute('size', 2);\n input_bonus.value = 0;\n TituloSimples(Traduz('bonus mágico'), input_bonus);\n var button_remover = CriaBotao('-', null, null, {\n id: id_gerado,\n id_div_equipamentos: id_div_equipamentos,\n handleEvent: function(evt) {\n ClickRemoverFilho(this.id, this.id_div_equipamentos);\n }\n });\n\n var div = CriaDiv(id_gerado);\n if (input_em_uso) {\n div.appendChild(input_em_uso);\n }\n div.appendChild(select);\n div.appendChild(select_material);\n div.appendChild(span_obra_prima);\n div.appendChild(input_obra_prima);\n div.appendChild(input_bonus);\n div.appendChild(button_remover);\n\n var button_vender = CriaBotao(Traduz('Vender'), null, 'venda', {\n div: div,\n tipo: nome,\n tabela: tabela,\n handleEvent: function(evt) {\n ClickVenderArmaArmadura(this.div, this.tipo, this.tabela);\n }\n });\n var button_comprar = CriaBotao(Traduz('Comprar'), null, 'compra', {\n div: div,\n tipo: nome,\n tabela: tabela,\n handleEvent: function(evt) {\n ClickComprarArmaArmadura(this.div, this.tipo, this.tabela);\n }\n });\n\n div.appendChild(button_vender);\n div.appendChild(button_comprar);\n div_pai.appendChild(div);\n return div;\n}", "title": "" }, { "docid": "c4a4a276bc6f46f540aede367977402b", "score": "0.5443872", "text": "function limpiarControles(){ //REVISAR BIEN ESTO\n clearControls(obtenerInputsIdsProducto());\n clearControls(obtenerInputsIdsTransaccion());\n htmlValue('inputEditar', 'CREACION');\n htmlDisable('txtCodigo', false);\n htmlDisable('btnAgregarNuevo', true);\n}", "title": "" }, { "docid": "b1cc2b2f6d7879d2b0c88544ad0cf622", "score": "0.5443206", "text": "function configurar()\n{\n\talert (\"en proceso...\");\n\treturn;\n\tvar rows = oTable._('tr', {\"filter\": \"applied\"});// oTable.fnGetNodes();\n\tvar total = rows.length;\n\tvar ids= [];\n\tfor (m in marcadores) {\n\t\tmarcadores[m].marca.map = null;\n }\n\tfor (var i = 0; i < rows.length; i++)\n\t{\n\t\t// cells.push($(rows[i]).find(\"td:eq(8)\" ).html());\n\t\tvar texto = rows[i];\n\t\tids.push( texto[0] );\n\t\tfor (m in marcadores) {\n\t\t\tif (marcadores[m].titulo === texto[0])\n\t\t\t{\n\t\t\t\tmarcadores[m].marca.map = map;\n\t\t\t\tbreak;\n\t\t\t}\n\t }\n\t\t\n\t}\n\t// alert( ids );\n\twindow.open(\"admin/orden.php?id=\"+ids,'','width=600,height=400,toolbar=no,location=no,left=200,top=200');\n}", "title": "" } ]
e18a45b0cb543d21db2b25de06ebab82
hashing input, shorter output unique each time, also consistent create math op, take index of given character string.length of original allCharaters.length => choices num let url =
[ { "docid": "30f6f3282ff447b560598b5e6b2278d1", "score": "0.5896071", "text": "function myUrlShortener(url){\n let allCharacters = 'abcdefghijklmnopqrstuvqxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'\n let urlMid = Math.floor(url.length / 3)\n let halfUrl = url.slice(urlMid * 2)\n // store original url to server/database\n // check if DB has seen this url, if so, return shortUrl stored with it\n\n let shortUrl = 'www.tiny.com/'\n for (let i = 0; i < halfUrl.length; i++) {\n let idx = allCharacters.indexOf(halfUrl[i])\n shortUrl = `${shortUrl}${idx}`\n }\n return shortUrl\n}", "title": "" } ]
[ { "docid": "db449cd6781671a68c86902754c82d22", "score": "0.63104194", "text": "function hash(input)\n{\n\t//variabelen\n\tvar tehashen = input;\n\tvar hash = \"Hash mislukt\";\n\tvar lijst = [\"p\",\"q\",\"t\",\"a\",\"z\",\"b\",\"y\",\"m\",\"e\",\"w\",\"s\",\"l\",\"j\",\"d\",\"c\",\"r\",\"h\",\"f\",\"k\",\"o\",\"g\",\"i\",\"v\",\"x\",\"n\",\"u\"];\n\tvar random = 0;\n\t\n\t//als er geen string is om te hashen\n\tif (tehashen.length === 0) \n\t{\n\t\treturn hash;\n\t}\n\t\n\t//maak er een lege string van\n\thash = \"\";\n\t//loop over de string, elke letter heeft een waarde\n\tfor (var i = 0; i < tehashen.length; i++) \n\t{\n\t\t//random getal om een random letter uit lijst te krijgen\n\t\t//random = Math.floor((Math.random() * lijst.length) + 1);\n\t\trandom = Math.floor((Math.random() * lijst.length));\n\t\t//voeg toe aan de string\n\t\thash += (tehashen.charCodeAt(i)*3076);\n\t\thash += lijst[random];\n\t}\n\treturn hash;\n}", "title": "" }, { "docid": "bd7b56da9dc68f880cc53aa430710124", "score": "0.63034743", "text": "hash(key) {\n // \n let asciiSum = key.split('').reduce((acc, char) => { // this gives us all characters separately\n return acc + char.charCodeAt(0); //this is something to convert string characters into ascii values - at 0 because we split it\n }, 0);\n\n return (asciiSum * 599) % this.size;\n }", "title": "" }, { "docid": "0335627b4c43a67e63dc292ab81af276", "score": "0.6292026", "text": "hash(key){\n // let ascii= key.split('').reduce((acc,n)=>{\n // return acc+n.charCodeAt(0);\n // },0)* 599 % this.size\n // return ascii\n const asciiSum = key.split('').reduce((acc, val) => {\n return acc * val.charCodeAt(0);\n }, 1);\n return (asciiSum * 71) % this.table.length;\n }", "title": "" }, { "docid": "fddb86df2687646758e7ff8d86bf9f14", "score": "0.6284265", "text": "function hash(str,size)\n {\n exp.push({\"text\":\"Hashing inputed key \"+ str,\"color\":\"black\"});\n var sum=0;\n var string=\"\";\n for(var i=0;i<str.length;i++)\n {\n sum+=str.charCodeAt(i);\n }\n exp.push({\"text\":\"Sum of the values of each letter is: \"+sum,\"color\":'blue'});\n exp.push({\"text\":\"Hash number is the sum mod the Size\",\"color\":'black'});\n exp.push({\"text\":sum + \" mod \" + size + \" = \"+sum%size, \"color\":'blue'});\n return sum%size; \n }", "title": "" }, { "docid": "d4f6b0f232f1415a15b5d386a56dfe55", "score": "0.6191842", "text": "hash(key){\n let chars = key.split('');\n console.log(chars);\n let aggVal = chars.reduce((acc, val) => acc + val.charCodeAt(0), 0);\n return aggVal % this.size;\n\n }", "title": "" }, { "docid": "f46ed0fc7f8ca4a6f5ee26a209f1f824", "score": "0.60296553", "text": "function generateHash(len) {\n var symbols = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890';\n var hash = '';\n for (var i = 0; i < len; i++) {\n var symIndex = Math.floor(Math.random() * symbols.length);\n hash += symbols.charAt(symIndex);\n }\n console.log(hash)\n return hash;\n}", "title": "" }, { "docid": "dfa99fee7c767b99d2c58991cac723f5", "score": "0.6023208", "text": "calculate(text) {\n if (text.length === 0)\n return \"0\".repeat(8);\n let hash = 0;\n for (let i = -1; ++i < text.length;) {\n const char = text.charCodeAt(i);\n hash = (hash << 5) - hash + char;\n hash %= 2 ** 32;\n }\n return (hash + Math.pow(2, 31)).toString(16).toUpperCase();\n }", "title": "" }, { "docid": "8e2b7dbfd7bd624ad13c51c175c27a6f", "score": "0.5977146", "text": "function UrlShortener() {\n this.urlAllowedChars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"+\n \"abcdefghijklmnopqrstuvwxyz\"+\n \"0123456789-_.~!*'();:@&=+$,/?#[]\";\n\n this.lettertTostrIndex = function(letter) { \n const idx = this.urlAllowedChars.indexOf(letter); \n const strIndex = idx < 10 ? `0${idx}` : `${idx}`; \n return strIndex; \n } \n \n \n this.strIndexToLetter = function(strIndex) { \n const idx = parseInt(strIndex); \n return this.urlAllowedChars[idx]; \n }\n}", "title": "" }, { "docid": "e1a568c4ebaf02eb85fd6491ae9f8f4e", "score": "0.5968767", "text": "function betterHash(string) {\n const H = 41;\n let total = 0;\n for (let i = 0; i < string.length; ++i) {\n total += H * total + string.charCodeAt(i);\n }\n total = total % this.table.length;\n if (total < 0) {\n total += this.table.length-1;\n }\n return parseInt(total);\n}", "title": "" }, { "docid": "0de10a18bdf3d8cf497ead0afd8f007c", "score": "0.5951405", "text": "hash(key) {\n let sumOfKeyLetters = key.split('').reduce((acc, val) => {\n let cc = val.charCodeAt(0);\n let num = acc + cc;\n return num;\n }, 0);\n\n let hash = sumOfKeyLetters * 599 % this.size;\n\n return hash;\n }", "title": "" }, { "docid": "e2e23a17725852bc33433a9183899155", "score": "0.59091884", "text": "function urlGenerator() {\n let text = \"\";\n let chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n for (let i = 0; i < 6; i++){\n text += chars.charAt(Math.floor(Math.random() * chars.length));\n }\n return text;\n}", "title": "" }, { "docid": "c5710b7516a8a09eedc81de3cac4d658", "score": "0.5890006", "text": "hash(key) {\n // hashing algorithm\n return key.split('').reduce((acc, char)=> {\n console.log(\"char.charCodeAt(0) =====> \", char.charCodeAt(0))\n return acc + char.charCodeAt(0);\n }, 0) * 599 % this.size;\n // return the value of the hashed key\n}", "title": "" }, { "docid": "c9752806577484469c7a51bed6d237da", "score": "0.5880895", "text": "async function transformStr() {\n if (arguments.length < 3 || !(arguments.length % 2)) {\n console.log(\"Error: invalid arguments in funcion hashDelStrings\");\n return;\n }\n\n\n var minRep = [];\n for (var i = 1; i < arguments.length; i+=2) {\n minRep[Math.floor(i/3)] = arguments[i].innerHTML.length - arguments[i+1].length;\n if (arguments[0] < Math.abs(minRep[Math.floor(i/3)])) {\n console.log(\"Error: argument[0] of hashDelStrings must be bigger!\");\n return;\n }\n }\n\n for (var i = 0; i < arguments[0]; i++) { // shuttle\n for (var j = 0; j < ((arguments.length-1)/2); j++) {\n var str = arguments[j*2+1];\n var required = arguments[(j*2)+2].length;\n str.innerHTML = randomStr(str.innerHTML.length)\n\n if (required >= 0) { // decide whenever add char or delete\n if (str.innerHTML.length > required) { // delete one char if needed\n str.innerHTML = str.innerHTML.slice(0,str.innerHTML.length - 1);\n }\n } else {\n if (str.innerHTML.length < required) {\n str.innerHTML = str.innerHTML + randomStr(1);\n }\n }\n }\n await sleep(80);\n }\n\n for (var i = 0; i < arguments[0]; i++) { // display required\n for (var j = 0; j < ((arguments.length-1)/2); j++) {\n var str = arguments[j*2+1];\n str.innerHTML = arguments[(j*2)+2];\n }\n }\n\n return new Promise(resolve => setTimeout(resolve, 0));\n}", "title": "" }, { "docid": "065de714ac4ce4ef3f9611d84dbe4d3a", "score": "0.5868877", "text": "function generateHash(length) {\n var result = '';\n var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n var charactersLength = characters.length;\n for ( var i = 0; i < length; i++ ) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength));\n }\n\n console.log(result);\n return result;\n }", "title": "" }, { "docid": "f985ed5fe7052eca329aaea50b021604", "score": "0.5821586", "text": "function hashLevel2(str, length) {\n if (str.length == 32) {\n if (length > 16) {\n length = 16;\n }\n if (!length) {\n length = 2;\n }\n var pass = '';\n for (var i = 0; i < length; i++) {\n var symbol = 0;\n symbol = Math.floor((str[i].charCodeAt(0) + str[i + 16].charCodeAt(0)) / 2);\n symbol = symbol + (symbol * 32 * i);\n while (symbol > 123) {\n symbol = symbol - 123;\n if (symbol < 33) {\n symbol = symbol + (32 * i);\n }\n if (symbol >= 91 && symbol <= 96) {\n symbol = symbol + (32 * i);\n }\n }\n pass = pass + String.fromCharCode(symbol);\n }\n return pass;\n } else {\n return 'holy guacamole';\n }\n}", "title": "" }, { "docid": "0fa2e46eebe7eb1d3d64d269a6ce6161", "score": "0.5818768", "text": "function optimized(index, n) {\n\tvar hashStr = \"\";\n\tfor (let j = 0; j < n; j++) {\n\t\tif (j <= index) {\n\t\t\thashStr = hashStr + \"#\";\n\t\t} else {\n\t\t\thashStr = hashStr + \" \";\n\t\t}\n\t}\n\treturn hashStr;\n}", "title": "" }, { "docid": "27a3940df841dbf1662503e37ec1a42f", "score": "0.57944053", "text": "hash(key) {\n let keyArr = key.split('');\n let numbers = keyArr.reduce((acc, val, idx) => {\n return acc += val.charCodeAt(0);\n }, 0);\n return Math.floor((numbers % 19) * this.size / 19);\n }", "title": "" }, { "docid": "4f1f3de249a293410352a4568f932302", "score": "0.5762418", "text": "function generateURL() {\n var url = \"\";\n var possible = \"abcdefghijklmnopqrstuvwxyz1234567890\";\n for (var i = 0; i < 5; i++) {\n url += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n return url;\n}", "title": "" }, { "docid": "cbf8fd2fc44512f3b3779cc02eb65bda", "score": "0.5755316", "text": "hash(key) {\n let hash = key.split('').reduce((acc, char) => {\n return acc + char.charCodeAt(0)\n }, 0) * 599 % this.size;\n\n return hash;\n }", "title": "" }, { "docid": "bbe05ef7a9ccd3a4236f5e1c41556fd5", "score": "0.5732616", "text": "function hash(str){\n\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n for (var i = 0; i < 5; i++)\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n\n var hash = 0;\n if (text.length == 0) return hash;\n for (i = 0; i < text.length; i++) {\n char = text.charCodeAt(i);\t\thash = ((hash<<5)-hash)+char;\t\thash = hash & hash; // Convert to 32bit integer\n }\n if (hash < 0) {\n hash = hash * -1;\n }\n return hash;\n}", "title": "" }, { "docid": "bb56a6d1947113515254c3c4372335f8", "score": "0.57270896", "text": "function hashighpoint(string) {\n\n}", "title": "" }, { "docid": "ab6f014dcac63621cd952a8176578937", "score": "0.57208663", "text": "function hash_function (str) {\n if(typeof str !== \"string\")\n return -1;\n var hash = 5391;\n var c;\n for(var i = 0; i < str.length; i++) {\n hash = ((hash << 5) + hash) + str.charCodeAt(i);\n }\n return Math.abs(hash)%table_size;\n }", "title": "" }, { "docid": "df26299e6b34cfe2701ec0a89202c808", "score": "0.5670977", "text": "_shorten(components) {\n const { base, rest } = components;\n let shortKey;\n do { //while not previously created\n const shortened = Math.floor(MAX_RAND * Math.random()).toString(36);\n shortKey = `${this.base}/${shortened}`;\n } while (this.urls[shortKey]);\n return shortKey;\n }", "title": "" }, { "docid": "2b5a566d994e2ebd94b30bbe0973bbcf", "score": "0.56586695", "text": "function calcKurnUrl(color) {\n\n let secretKey = \"123456789\";\n let nameapp =\"F4C\";\n let hash = md5(nameapp + color + secretKey);\n\n\n\n return \"https://www.arteamicalights.it/bulgari/addscore.php?ID=33&NOME=\" + nameapp + \"&SCORE=\" + color + \"&hash=\" + hash;\n}", "title": "" }, { "docid": "e24c99363eaa294b64ac0b97b0593bf2", "score": "0.5656049", "text": "function polybius(input, encode = true) {\n // your solution code here\n const sort = parseInt(input)\n const low = input.toLowerCase()\n const shorten = input.replace(\" \", \"\")\n const long = input.replace(\" \", \" \")\n let results = \"\"\n if(isNaN(sort) === false && (shorten.length % 2) != 0) return false\n\n if(isNaN(sort)) {//converting a string of letters to numbers\n for(let i = 0; i < low.length; i++) {\n const code = low.charAt(i)\n switch (code) {\n case \"a\":\n results += \"11\"\n break\n case \"b\":\n results += \"21\"\n break\n case \"c\":\n results += \"31\"\n break\n case \"d\":\n results += \"41\"\n break\n case \"e\":\n results += \"51\"\n break\n case \"f\":\n results += \"12\"\n break\n case \"g\":\n results += \"22\"\n break\n case \"h\":\n results += \"32\"\n break \n case \"i\":\n results += \"42\"\n break\n case \"j\":\n results += \"42\"\n break\n case \"k\":\n results += \"52\"\n break\n case \"l\":\n results += \"13\"\n break\n case \"m\":\n results += \"23\"\n break\n case \"n\":\n results += \"33\"\n break\n case \"o\":\n results += \"43\"\n break\n case \"p\":\n results += \"53\"\n break\n case \"q\":\n results += \"14\"\n break\n case \"r\":\n results += \"24\"\n break\n case \"s\":\n results += \"34\"\n break\n case \"t\":\n results += \"44\"\n break\n case \"u\":\n results += \"54\"\n break\n case \"v\":\n results += \"15\"\n break\n case \"w\":\n results += \"25\"\n break\n case \"x\":\n results += \"35\"\n break\n case \"y\":\n results += \"45\"\n break\n case \"z\":\n results += \"55\"\n break\n default:\n results += \" \"\n }\n }\n }\n\n else{//code to convert these numbers to letters\n let scramble = []\n for(let i = 0; i < long.length; i+=2) {scramble.push(long.slice(i, i + 2))}\n for(let i = 0; i < scramble.length; i++) {\n const code = scramble[i]\n switch (code) {\n case \"11\":\n results += \"a\"\n break\n case \"21\":\n results += \"b\"\n break\n case \"31\":\n results += \"c\"\n break\n case \"41\":\n results += \"d\"\n break\n case \"51\":\n results += \"e\"\n break\n case \"12\":\n results += \"f\"\n break\n case \"22\":\n results += \"g\"\n break\n case \"32\":\n results += \"h\"\n break \n case \"42\":\n results += \"(i/j)\"\n break\n case \"52\":\n results += \"k\"\n break\n case \"13\":\n results += \"l\"\n break\n case \"23\":\n results += \"m\"\n break\n case \"33\":\n results += \"n\"\n break\n case \"43\":\n results += \"o\"\n break\n case \"53\":\n results += \"p\"\n break\n case \"14\":\n results += \"q\"\n break\n case \"24\":\n results += \"r\"\n break\n case \"34\":\n results += \"s\"\n break\n case \"44\":\n results += \"t\"\n break\n case \"54\":\n results += \"u\"\n break\n case \"15\":\n results += \"v\"\n break\n case \"25\":\n results += \"w\"\n break\n case \"35\":\n results += \"x\"\n break\n case \"45\":\n results += \"y\"\n break\n case \"55\":\n results += \"z\"\n break\n default:\n results += \" \"\n }\n }\n }\n return results\n }", "title": "" }, { "docid": "32f1d97c4c553ef1b60078701c33635d", "score": "0.5655328", "text": "function pseudohachage(chaine) {\n condensat=0\n for (let i = 0; i < chaine.length; i++) {\n console.log(chaine.charCodeAt(i))\n condensat =(condensat + chaine.charCodeAt(i) * 10**(i+1)) % (2**256)\n }\n return condensat.toString(16)\n }", "title": "" }, { "docid": "dfca849bc5bffed54c500c8e4e0f301a", "score": "0.5620244", "text": "function hashStringToInt(s, tableSize) {\n//start with a prime number because it will spread out where the keys are stored\n let hash = 17;\n\n for (let i = 0; i < s.length; i++) {\n hash = (13 * hash * s.chart(i)) % tableSize;\n }\n return hash;\n}", "title": "" }, { "docid": "602ef2d90d271b211bad4429a0cfed6a", "score": "0.56162024", "text": "function computeInputVariants(str, n) {\n var variants = [ str ];\n for (var i = 1; i < n; i++) {\n var pos = Math.floor(Math.random() * str.length);\n var chr = String.fromCharCode((str.charCodeAt(pos) + Math.floor(Math.random() * 128)) % 128);\n variants[i] = str.substring(0, pos) + chr + str.substring(pos + 1, str.length);\n }\n return variants;\n}", "title": "" }, { "docid": "c60a0a4348787ddd6b9c05431a45813c", "score": "0.5613935", "text": "function makeItAnagram(input) {\n\t\n}", "title": "" }, { "docid": "eea7288277aad3d680a99d278b7786da", "score": "0.55917317", "text": "function hash(s)\n{\n\n //hash is initially set to 0\n var hash = s;\n\n // loop to get the value of each index\n for(var i = 0; i < 8; i++)\n {\n var numberHash = parseInt(s);\n\n // does not divide the initial hash when finding first index\n if ([i] == 0){\n\n var hash1 = (numberHash % 23);\n newWord.push(hash1);\n }\n //runs on each but the initial value\n else {\n // takes in the initial hash and divides it by 23 and assigns it back to hash\n hash = (hash) / 23;\n\n // takes the new hash and rounds it to the nearest integer and fins the remainder\n // the remainder is then assigned to arrayEntry\n var arrayEntry= (parseInt(hash)) % 23;\n\n // the arrayEntry is put in the back of hte new wordArray defined above\n\n newWord.push( arrayEntry);\n\n\n\n\n }\n\n\n }\n\n //The newWord entry is flipped reversing the order of the word\n\n\n for(var i = 0; i < newWord.length; i++) {\n var getNewWoldData = newWord[i];\n var putIntoReversed = letters[getNewWoldData];\n reversedWord.unshift(putIntoReversed);\n\n\n }\n\n}", "title": "" }, { "docid": "1a9754f4f95e1f6e6523e2ed46c8c90f", "score": "0.5571093", "text": "function hash(key, arrLen){\n let total = 0;\n // for(let i = 0; i < key.length; i++){\n // let char = key[i];\n // }\n for(let char of key){\n //map a to 1, b to 2, c to 3\n let value = char.charCodeAt(0) - 96;\n total = (total + value) % arrLen;\n }\n return total;\n }", "title": "" }, { "docid": "2e97e38eafb07de7625539af7117bfc4", "score": "0.557017", "text": "function passwCombination(q, value) {\n let initial_num = 0;\n let max_limit = max_Combination(q);\n\n let wordlist = value.split(regExp1);\n // let arr = [];\n let map = new Map();\n for (let i = 0; i < wordlist.length; i++) {\n map.set(`${i}`, wordlist[i])\n }\n\n let regExp3 = new RegExp(`[${wordlist.length}-9]`, '');\n do {\n initial_num = `${initial_num}`.padStart(q, '0');\n if (!initial_num.match(regExp2) && !(regExp3.test(`${initial_num}`))) {\n let ar = initial_num.split('');\n for (let g = 0; g < ar.length; g++) {\n pass += map.get(ar[g])\n }\n if (pass.length > 8 && pass.length <= 16) {\n arr.push(pass + '\\n')\n }\n pass = ''\n //document.write(`${n}<br>`)\n }\n } while (initial_num++ < max_limit)\n}", "title": "" }, { "docid": "4a1db5f61aa7c9a40b02bcdf77f60c31", "score": "0.55393773", "text": "function everything(a){\n var result = \"\";\n for(var i = 0; i < a; i++){\n var letters = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*\";\n var result = result + letters.charAt(Math.floor(Math.random() * 70));\n }\n return result;\n }", "title": "" }, { "docid": "5d7a1245e95dcfa9975fe401d702569f", "score": "0.5539254", "text": "function generatePass() \n {\n var result = '';\n for(var i =0; i < PossibleChars; i++) \n {\n result+= PossibleChars[Math.floor(Math.random() * PossibleChars.length)];\n \n }\n return result;\n }", "title": "" }, { "docid": "8a4e104eea754db749273e43d12cd39d", "score": "0.5531899", "text": "function hash(text){if(!text){return '';}var hashValue=5381;var index=text.length-1;while(index){hashValue=hashValue*33^text.charCodeAt(index);index-=1;}return (hashValue>>>0).toString(16);}", "title": "" }, { "docid": "4f55c21db18f34ae0b494942341f43e8", "score": "0.5528865", "text": "function luhn(curp){\n\tvar esNumero=/\\d/;\n\tdocument.getElementById('res').innerHTML='Evaluando '+curp+'<br>';\n\tvar map = new Array();\n\tmap['A']=10; map['B']=11; map['C']=12; map['D']=13; map['E']=14; map['F']=15; map['G']=16;\n\tmap['H']=17; map['I']=18; map['J']=19; map['K']=20; map['L']=21; map['M']=22; map['N']=23;\n\t/*map['?']=24;*/ map['O']=24; map['P']=25; map['Q']=26;\tmap['R']=27; map['S']=28; map['T']=29;\n\tmap['U']=30; map['V']=31; map['W']=32; map['X']=33;\tmap['Y']=34; map['Z']=35;\n\t/*map['A']=1; map['B']=2; map['C']=3; map['D']=4; map['E']=5; map['F']=6; map['G']=7;\n\tmap['H']=8; map['I']=9; map['J']=1; map['K']=2; map['L']=3; map['M']=4; map['N']=5;\n\tmap['?']=6; map['O']=7; map['P']=8; map['Q']=9;\tmap['R']=1; map['S']=2; map['T']=3;\n\tmap['U']=4; map['V']=5; map['W']=6; map['X']=7;\tmap['Y']=8; map['Z']=9;*/\n\t\n\tvar flip = true;\n\tdocument.getElementById('res').innerHTML='long '+curp.length+'<br>';\n\tvar suma = 0;\n\tfor(i=curp.length;i>=1;i--){\n\t\tflip = !flip;\n\t\t\n\t\tif(flip){\n\t\t\tif(!esNumero.test(curp.charAt(i))){evaluando = map[curp.charAt(i)];}else{evaluando = curp.charAt(i);}\n\t\t\tdigito = evaluando*2;\n\t\t\tdig = digito;\n\t\t\tsp=0;\n\t\t\twhile (digito) {\n\t\t\t\tsp += digito % 10;\n \t\t\tsuma += digito % 10;\n \t\t\tdigito = parseInt(digito / 10);\n\t\t\t}\n\t\t\t\n\t\t\tdocument.getElementById('res').innerHTML=document.getElementById('res').innerHTML + 'Evaluando '+curp.charAt(i) + ' como '+ evaluando + ' En '+i+' -> '+ dig+' parcial '+sp+' -> suma '+suma+'<br>' ;\n\t\t}\n\t}\n\tvar valido = (suma % 10==0);\n\tdocument.getElementById('res').innerHTML=document.getElementById('res').innerHTML + \"Es Curp? \"+ valido;\n}", "title": "" }, { "docid": "abbf1fcf12dede2aaefff8d9461c7258", "score": "0.55151576", "text": "computeHash(key, tableLength) {\n let hash = 11;\n for (let i = 0; i < key.length; i++) {\n hash = (hash * key.charCodeAt(i)) % tableLength;\n }\n return hash;\n }", "title": "" }, { "docid": "80a444a1da85d0c76a4cda93ce55aebd", "score": "0.55139524", "text": "function betterHash(string) {\n\tvar primeConstant = 31;\t// constant should be a prime #\n\tvar total = 0;\n\tfor (var i = 0; i < string.length; ++i)\n\t\ttotal += primeConstant * total + string.charCodeAt(i);\n\n\ttotal = total % this.table.length;\n\tif (total < 0)\n\t\ttotal += this.table.length - 1;\n\t\n\treturn parseInt(total, 10);\n}", "title": "" }, { "docid": "00180c700958f01807f4225213114156", "score": "0.5487767", "text": "colorize(str) {\r\n let hash = 5381;\r\n let i = str.length;\r\n\r\n while (i) {\r\n hash = (hash * 33) ^ str.charCodeAt(--i);\r\n }\r\n\r\n switch ((hash >>> 0) % 6) {\r\n case 0:\r\n return 'orange';\r\n case 1:\r\n return 'green';\r\n case 2:\r\n return 'red';\r\n case 3:\r\n return 'teal';\r\n case 4:\r\n return 'blue';\r\n case 5:\r\n return 'yellow';\r\n default:\r\n return 'secondary';\r\n }\r\n }", "title": "" }, { "docid": "7a89ff00999d89ec4a2db3b95cfc37c0", "score": "0.54811066", "text": "hashMethod(key) {\n let hash = 0;\n //generar un numero random\n for (let i = 0; i < key.length; i++) {\n hash = (hash + key.charCodeAt(i) - i) % this.data.length;\n this.data.length;\n }\n return hash;\n }", "title": "" }, { "docid": "ca3efc6b34836b371b2fa0855abc407d", "score": "0.546896", "text": "function hash(str, len) {\n let pos = 0;\n for (let c of str) {\n const res = c.charCodeAt(0) - 96;\n pos = (pos + res) % len;\n }\n return pos\n}", "title": "" }, { "docid": "616acc7c0b8b19dc8acb58400e83f853", "score": "0.54633", "text": "function makecode() {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n for( var i=0; i < 5; i++ )\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n\n text += \"#-\";\n\n for( var j=0; j < 5; j++ )\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n\n return text;\n }", "title": "" }, { "docid": "b66fe0f8f0c8aa60e155d1f6e39aa12b", "score": "0.5456758", "text": "function hash(message) {\n // Set the output length to the selected value\n outputLength = document.getElementById('sha-value').selectedOptions[0].value;\n let A;\n // The message in bits with the SHA3 suffix 01 appended to it\n let inputBits = stringToBitArray(message).concat([0, 1]);\n // An array of the chunks which will be used to make the states\n let chunks = [];\n // Break message into chunks of 2 * outputLength bits (i.e. the rate)\n for (let i = 0; i < Math.floor(inputBits.length / (b - 2 * outputLength)) + 1; i++) chunks.push(inputBits.slice(i * (b - 2 * outputLength), (i + 1) * (b - 2 * outputLength)));\n // Iterate over all chunks\n for (chunk of chunks) {\n let aA = messageBitsToState(chunk);\n // If it isn't the first chunk, XOR the new state with the old state\n if (A) {\n for (let x = 0; x < 5; x++) {\n for (let y = 0; y < 5; y++) {\n for (let z = 0; z < w; z++) aA[x][y][z] ^= A[x][y][z];\n }\n }\n }\n A = aA;\n // Performing all five step mappings on the state nr times\n \tfor (let i = 0; i < nr; i++) A = keccakRound(A, i);\n }\n // Set the textContent of the hash paragraph to the generated hash value to let the user see what his hashed message is\n document.getElementById('hash').textContent = stateToLittleEndianHexString(A).slice(0, outputLength / 4);\n}", "title": "" }, { "docid": "0ad381e09ae325b4f27d8d414460d0b7", "score": "0.5453742", "text": "function generateRandomString() {\r\n let alphnum = 'qwertyuiopasdfghjklzxcvbnm1234567890';\r\n let randomURL = '';\r\n for (let i = 0; i < 6; i++) {\r\n randomURL += alphnum[Math.floor(Math.random()*36)];\r\n }\r\n return randomURL;\r\n}", "title": "" }, { "docid": "92b748c607ca748f2aa55f088dd8e51f", "score": "0.5450585", "text": "function hash(a) {\n if (isNumber(a)) {\n return a;\n }\n\n const str = isString(a) ? a : fastJsonStableStringify(a); // short strings can be used as hash directly, longer strings are hashed to reduce memory usage\n\n if (str.length < 250) {\n return str;\n } // from http://werxltd.com/wp/2010/05/13/javascript-implementation-of-javas-string-hashcode-method/\n\n\n let h = 0;\n\n for (let i = 0; i < str.length; i++) {\n const char = str.charCodeAt(i);\n h = (h << 5) - h + char;\n h = h & h; // Convert to 32bit integer\n }\n\n return h;\n }", "title": "" }, { "docid": "0af4a7e09c65415e4bf00d36b381b8cb", "score": "0.54438496", "text": "function hash(key, arrayLen) {\n let total = 0;\n for (let char of key) {\n // map \"a\" to 1, \"b\" to 2, \"c\" to 3, etc.\n let value = char.charCodeAt(0) - 96\n //UTF = \"h\".charCodeAt() - 96 // will give us number place in alphabet\n // map through each letter and add them together \n total = (total + value) % arrayLen;\n }\n return total;\n }", "title": "" }, { "docid": "9e901e5013800f637be64729f7447a35", "score": "0.54339784", "text": "function processPasswordGenerator(length, lower, upper, numeric, symbol){\n\tlet tempPass =\"\";\n\t for (let counter = 1; counter<=length; counter++)\n\t {\n\t\t tempPass += lower ? getRandomLower():\"\";\n\t\t tempPass += upper? getRandomUpper():\"\"; \n\t\t tempPass += numeric ? getRandomNumber():\"\";\n\t\t tempPass += symbol ? getRandomSymbol():\"\";\n\t }\n\n\t return tempPass \n\t .slice(0,length)\n\t .split(\"\")\n\t .sort(() => {\n\t\tMath.random() * -0.5;\n\t\t})\n\t\t.join(\"\");\n\t\t}", "title": "" }, { "docid": "dfec2da9bb40bc0fcfc90254f3356975", "score": "0.5432189", "text": "function generateScramble(length) {\n if (scrambleSelection.options[scrambleSelection.selectedIndex].value == \"fast\") {\n var s = \"\";\n\n var previous = null;\n for (var i = 0; i < length; i++) {\n var finished = false;\n while (!finished) {\n var current = null;\n switch (Math.floor(Math.random()*6)) {\n case 0:\n current = \"U\";\n break;\n case 1:\n current = \"F\";\n break;\n case 2:\n current = \"R\";\n break;\n case 3:\n current = \"B\";\n break;\n case 4:\n current = \"L\";\n break;\n case 5:\n current = \"D\";\n break;\n }\n\n if (current != previous) {\n finished = true;\n previous = current;\n s += current;\n }\n }\n\n if (Math.random() >= 0.5) {\n s += \"2\";\n } else if (Math.random() >= 0.5) {\n s += \"'\";\n }\n\n s += \" \"\n }\n\n return s;\n }\n\n console.log(\"Generating a WCA official scramble...\");\n if (scrambleSelection.options[scrambleSelection.selectedIndex].value == \"wca\") {\n return new Scrambo().type('333').get(1);\n } else {\n return new Scrambo().type('222').get(1);\n }\n}", "title": "" }, { "docid": "2e9eeaf11f9768f8595f08f4ece70bc8", "score": "0.5431812", "text": "_hash(key) {\n\n let hash = 0;\n for (let i =0; i < key.length; i++){\n hash = (hash + key.charCodeAt(i) * i) % this.data.length\n }\n return hash;\n }", "title": "" }, { "docid": "35dcf2869746d8e7e21e5e657a541c25", "score": "0.5428587", "text": "function createAllStringCombinationIndexes(fetchString) {\n //VARIABLE DECLARATION\n let string = fetchString; //ORIGINAL STRING\n let stringLength = string.length - 1; //STRING LENGTH VARIABLE\n let combinationIndexArray = []; //COMBINATION INDEX ARRAY VARIABLE\n let tempArray1 = []; //TEMP ARRAY 1 TO CREATE COMBINATION INDEX ARRAY\n let tempArray2 = []; //TEMP ARRAY 2 TO CREATE COMBINATION INDEX ARRAY\n //CODE TO GENERATE COMBINATION ARRAY INDEXES\n for (let i = 0; i < string.length; i++) {\n tempArray2.push(i);\n tempArray1.push(tempArray2);\n combinationIndexArray.push(tempArray2);\n for (let j = 0; j < tempArray1.length; j++) {\n tempArray2 = [];\n let a = Math.max.apply(null, tempArray1[j]);\n let diff = stringLength - a;\n for (let l = 0; l < diff; l++) {\n tempArray2 = [];\n for (let k = 0; k < tempArray1[j].length; k++) tempArray2.push(tempArray1[j][k]);\n a++;\n tempArray2.push(a);\n tempArray1.push(tempArray2);\n combinationIndexArray.push(tempArray2);\n }\n }\n tempArray1 = [];\n tempArray2 = [];\n }\n return combinationIndexArray;\n}", "title": "" }, { "docid": "35dcf2869746d8e7e21e5e657a541c25", "score": "0.5428587", "text": "function createAllStringCombinationIndexes(fetchString) {\n //VARIABLE DECLARATION\n let string = fetchString; //ORIGINAL STRING\n let stringLength = string.length - 1; //STRING LENGTH VARIABLE\n let combinationIndexArray = []; //COMBINATION INDEX ARRAY VARIABLE\n let tempArray1 = []; //TEMP ARRAY 1 TO CREATE COMBINATION INDEX ARRAY\n let tempArray2 = []; //TEMP ARRAY 2 TO CREATE COMBINATION INDEX ARRAY\n //CODE TO GENERATE COMBINATION ARRAY INDEXES\n for (let i = 0; i < string.length; i++) {\n tempArray2.push(i);\n tempArray1.push(tempArray2);\n combinationIndexArray.push(tempArray2);\n for (let j = 0; j < tempArray1.length; j++) {\n tempArray2 = [];\n let a = Math.max.apply(null, tempArray1[j]);\n let diff = stringLength - a;\n for (let l = 0; l < diff; l++) {\n tempArray2 = [];\n for (let k = 0; k < tempArray1[j].length; k++) tempArray2.push(tempArray1[j][k]);\n a++;\n tempArray2.push(a);\n tempArray1.push(tempArray2);\n combinationIndexArray.push(tempArray2);\n }\n }\n tempArray1 = [];\n tempArray2 = [];\n }\n return combinationIndexArray;\n}", "title": "" }, { "docid": "3bd131cabb5dc8c17fbdcf54b205c7bd", "score": "0.5423481", "text": "function buildHash(inString) {\n var i;\n var hashOut = [];\n for (i=0; i<inString.length; i++) {\n hashOut.push(inString.charCodeAt(i));\n }\n hashOut.push(17); hashOut.push(31); hashOut.push(73); hashOut.push(47); hashOut.push(23);\n return hashOut;\n}", "title": "" }, { "docid": "2ad9724cb842b028ea2e9ef82611739a", "score": "0.5408568", "text": "function newExercice() {\n // Read how many values have to be generated\n let howmany = document.getElementById(\"howmany\").value * 1;\n\n // Create the results\n for (let i = 0; i < howmany; i++) {\n results[i] = Math.floor(Math.random() * 256);\n }\n\n generateHTML();\n}", "title": "" }, { "docid": "b7de00a1be553174802b307d429191dd", "score": "0.54047316", "text": "function optimalHashes(size, length) {\n return Math.ceil((size / length) * Math.log(2));\n }", "title": "" }, { "docid": "facea49e7d62c0cc92541696ca039825", "score": "0.53888315", "text": "_stringHash(str) {\n const MAX_ASCII = 122;\n let hash = 0;\n for (const letter of str) {\n const code = letter.charCodeAt(0);\n hash = (hash * MAX_ASCII + code) % this.prime;\n }\n return this._integerHash(hash);\n }", "title": "" }, { "docid": "e956dcf73629097b1be3da3dc7962190", "score": "0.5386095", "text": "function makeAnagram(a, b) {\r\n let lettersa=[];\r\n let lettersb=[];\r\n let delchars=0;\r\n for(let i=10;i<36;i++){\r\n lettersa[i]=lettersb[i]=0;\r\n }\r\n\r\n a.split(\"\").forEach(char=>{\r\n lettersa[parseInt(char,36)]++;\r\n });\r\n b.split(\"\").forEach(char=>{\r\n lettersb[parseInt(char,36)]++;\r\n });\r\n\r\n for(let i=10;i<36;i++){\r\n delchars+=Math.abs(lettersa[i]-lettersb[i]);\r\n }\r\n return delchars;\r\n}", "title": "" }, { "docid": "2a8b83175afb0cfaf7d11ff10d39f97e", "score": "0.53754973", "text": "static hashIt(inSequence) {\r\n\r\n // inicializace pole hashovacich hodnot\r\n // prvnich 32 bitu zlomkovych casti druhych odmocnin prvnich 8 prvocisel (2,3,5,7,11,13,17,19)\r\n let H0 = 0x6a09e667;\r\n let H1 = 0xbb67ae85;\r\n let H2 = 0x3c6ef372;\r\n let H3 = 0xa54ff53a;\r\n let H4 = 0x510e527f;\r\n let H5 = 0x9b05688c;\r\n let H6 = 0x1f83d9ab;\r\n let H7 = 0x5be0cd19;\r\n\r\n // inicializace pole zaokrouhlovacich konstant\r\n // prvnich 32 bitu zlomkovych casti tretich odmocnin prvnich 64 prvocisel (2,3,5,7,...,311)\r\n const K = [\r\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\r\n 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\r\n 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\r\n 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\r\n 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\r\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\r\n 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\r\n 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\r\n ];\r\n\r\n // zakodovani vstupniho retezce do UTF8\r\n inSequence = unescape(encodeURIComponent(inSequence));\r\n\r\n // predpriprava\r\n inSequence = inSequence.concat(String.fromCharCode(0x80)); // na konec retezce pridam jednickovy bit\r\n\r\n // prevedeni rezetce do (vice) bloku o velikosti 512 bitu\r\n // retezec se sklada z 8 bitovych charu\r\n // vysledkem pole sestnacti 32 bitovych celych cisel\r\n const len = (inSequence.length / 4) + 1 + 1; // delka zpravy v 32 bitovych celych cislech + jednickovy bit + prirazena delka\r\n const numberOfBlocks = Math.ceil(len / 16); // pocet potrebnych 512 bitu velkych bloku na uchovani sestnacti celych cisel - zaokrouhleni na cele cislo nahoru\r\n const arr = new Array(numberOfBlocks); // vytvoreni pole o velikosti N dalsich poli pro uchovavani 32 bitovych celych cisel\r\n // cyklim pres vsechny 512 bitove bloky\r\n for (let i = 0; i < numberOfBlocks; i++) {\r\n arr[i] = new Array(16); // vytvoreni pole v poli o velikosti 16 prvku\r\n for (let j = 0; j < 16; j++) { // zakodovani 4 znaku do jednoho celeho cisla (tj. 64 znaku do 512 bitoveho bloku) - BIG-ENDIAN\r\n let position = i*64 + j*4;\r\n arr[i][j] = (inSequence.charCodeAt(position + 0) << 24) \r\n | (inSequence.charCodeAt(position + 1) << 16)\r\n | (inSequence.charCodeAt(position + 2) << 8)\r\n | (inSequence.charCodeAt(position + 3) << 0);\r\n }\r\n }\r\n\r\n // do posledni dvojice 32 bitovych cisel umistim delku retezce v bitech - BIG-ENDIAN\r\n const lengthLow = ((inSequence.length-1) * 8) >>> 0;\r\n const lengthHigh = ((inSequence.length-1) * 8) >>> 16 >>> 16;\r\n arr[numberOfBlocks-1][14] = Math.floor(lengthHigh);\r\n arr[numberOfBlocks-1][15] = lengthLow;\r\n\r\n // proces vypoctu hashe\r\n for (let i = 0; i < numberOfBlocks; i++) {\r\n // vytvoreni pole o velikosti 64 prvků\r\n const W = new Array(64);\r\n\r\n // prvnich 16 prvku z puvodniho pole se zkopiruje \r\n for (let j = 0; j < 16; j++) {\r\n W[j] = arr[i][j];\r\n }\r\n\r\n // zkopirovanych 16 prvku se rozsiri do zbyvajicich 48 prvku (64-16=48) \r\n for (let j = 16; j < 64; j++) {\r\n const s0 = MySha256.rotateRight(7, W[j-15]) ^ MySha256.rotateRight(18, W[j-15]) ^ (W[j-15] >>> 3);\r\n const s1 = MySha256.rotateRight(17, W[j-2]) ^ MySha256.rotateRight(19, W[j-2]) ^ (W[j-2] >>> 10);\r\n W[j] = (W[j-16] + s0 + W[j-7] + s1) >>> 0;\r\n }\r\n\r\n // inicializace pracovnich promennych na aktualni hashovaci hodnotu\r\n let a = H0;\r\n let b = H1;\r\n let c = H2;\r\n let d = H3;\r\n let e = H4;\r\n let f = H5;\r\n let g = H6;\r\n let h = H7;\r\n\r\n // hlavni smycka kompresni funkce\r\n for (let j = 0; j < 64; j++) {\r\n const S1 = MySha256.rotateRight(6, e) ^ MySha256.rotateRight(11, e) ^ MySha256.rotateRight(25, e);\r\n const ch = (e & f) ^ (~e & g);\r\n const temp1 = h + S1 + ch + K[j] + W[j];\r\n const S0 = MySha256.rotateRight(2, a) ^ MySha256.rotateRight(13, a) ^ MySha256.rotateRight(22, a);\r\n const maj = (a & b) ^ (a & c) ^ (b & c);\r\n const temp2 = S0 + maj;\r\n \r\n h = g;\r\n g = f;\r\n f = e;\r\n e = (d + temp1) >>> 0;\r\n d = c;\r\n c = b;\r\n b = a;\r\n a = (temp1 + temp2) >>> 0;\r\n }\r\n\r\n // vypocet nove hashovaci hodnoty (soucet puvodni a nove hodnoty)\r\n H0 = (H0 + a) >>> 0;\r\n H1 = (H1 + b) >>> 0;\r\n H2 = (H2 + c) >>> 0;\r\n H3 = (H3 + d) >>> 0;\r\n H4 = (H4 + e) >>> 0;\r\n H5 = (H5 + f) >>> 0;\r\n H6 = (H6 + g) >>> 0;\r\n H7 = (H7 + h) >>> 0;\r\n }\r\n\r\n // konverze H0 az H7 na hexadecimalni retezce\r\n const nullSeq = '00000000';\r\n H0 = (nullSeq + H0.toString(16)).slice(-8);\r\n H1 = (nullSeq + H1.toString(16)).slice(-8);\r\n H2 = (nullSeq + H2.toString(16)).slice(-8);\r\n H3 = (nullSeq + H3.toString(16)).slice(-8);\r\n H4 = (nullSeq + H4.toString(16)).slice(-8);\r\n H5 = (nullSeq + H5.toString(16)).slice(-8);\r\n H6 = (nullSeq + H6.toString(16)).slice(-8);\r\n H7 = (nullSeq + H7.toString(16)).slice(-8);\r\n\r\n return H0.concat(H1, H2, H3, H4, H5, H6, H7);\r\n }", "title": "" }, { "docid": "b6874f10a9f0f434ce90a23be2794f9d", "score": "0.53731066", "text": "function getPassword(){\n var base;\n do{\n var adjective = adjectives[randomInt(adjectives.length)];\n var noun = nouns[randomInt(nouns.length)];\n base = adjective+noun;\n }\n while(combinations_to_avoid.indexOf(base)!=-1);\n var number;\n do {\n number = Math.floor(Math.random() * 88) + 11;\n }\n while(numbers_to_avoid.indexOf(number)!=-1);\n\nreturn base+number;\n}", "title": "" }, { "docid": "e2b98f5a15e8fac663acf93568fdec18", "score": "0.5372065", "text": "function generatePassword() {\n var length = parseInt(prompt(\"Password must be between 8 and 128 characters.\"))\n var confirmLower = confirm(\"Do you want lower case letters?\")\n var confirmUpper = confirm(\"Do you want UPPER case letters?\")\n var confirmNumber = confirm(\"Do you want a number?\")\n var confirmSymbol = confirm(\"Do you want to include special characters?\")\n\n if (length <128 || length >8) {\n\n } else {\n window.alert(\"Password must be between 8 and 128 characters.\")\n }\n var lowerChars = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\"]\n var upperChars = [\"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\", \"I\", \"J\", \"K\", \"L\", \"M\", \"N\", \"O\", \"P\", \"Q\", \"R\", \"S\", \"T\", \"U\", \"V\", \"W\", \"X\", \"Y\", \"Z\"]\n var numberChars = [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\"]\n var symbolChars = [\"!\", \"@\", \"#\", \"$\", \"%\", \"^\", \"&\", \"*\", \"(\"]\n\n var possibleChars = [];\n\n if (confirmLower){\n for(let i= 0; i<lowerChars.length; i++){\n possibleChars.push( lowerChars[i] )\n }\n }\n if (confirmUpper){\n for(let i= 0; i<upperChars.length; i++){\n possibleChars.push( upperChars[i] )\n }\n }\n if (confirmNumber){\n for(let i= 0; i<numberChars.length; i++){\n possibleChars.push( numberChars[i] )\n }\n }\n if (confirmSymbol){\n for(let i= 0; i<symbolChars.length; i++){\n possibleChars.push( symbolChars[i] )\n }\n }\n console.log(possibleChars)\n //start building a string.\n var finalPassword = \"\";\n // something with the length\n for(let i= 0; i<length; i++){\n var random = Math.floor(Math.random()* possibleChars.length)\n // random char from possibleChars\n finalPassword = finalPassword + possibleChars[random];\n }\n return finalPassword;\n\n \n}", "title": "" }, { "docid": "f2829b35d368934009ac806eb80435e6", "score": "0.53698134", "text": "function generate(length, constraint, cb) {\n\tvar hash = '';\n\tfor (var i = 0; i < length; i++) {\n\t\tvar randomChar = validHashChars.charAt(Math.floor(Math.random() * validHashChars.length));\n\t\tvar hash = hash + randomChar;\n\t}\n\n\tconstraint(hash, (isValid) => {\n\t\tif (isValid) {\n\t\t\treturn cb(hash)\n\t\t} else {\n\t\t\tgenerate(constraint, cb);\n\t\t}\n\t});\n\n}", "title": "" }, { "docid": "a6eccb7255c8d15ec35b4ecd8ce80af1", "score": "0.5364223", "text": "function randomHash() {\n var chars = \"ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz0123456789\";\n var str = \"\";\n for (var i = 0; i < 16; i++) {\n var num = Math.floor(Math.random() * chars.length);\n str += chars.substring(num, num+1);\n }\n return str;\n }", "title": "" }, { "docid": "68f81b2071d5bd574db17de21ba8c6d8", "score": "0.5360658", "text": "function ftnGeneradorContrasenna() {\n\n let length = 5,\n charset = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\",\n retVal = \"\";\n for (let i = 0, n = charset.length; i < length; ++i) {\n retVal += charset.charAt(Math.floor(Math.random() * n));\n }\n return retVal;\n}", "title": "" }, { "docid": "aa7a3870c1be31b3754d9baaa5f309b6", "score": "0.53539264", "text": "function characters(newCharacters) { // 79\n if (newCharacters !== undefined) { // 80\n ShortId.alphabet.characters(newCharacters); // 81\n } // 82\n // 83\n return ShortId.alphabet.shuffled(); // 84\n} // 85", "title": "" }, { "docid": "dcf2292912daa1123b9a5bd2b5063b00", "score": "0.5348426", "text": "_hash(key) {\n let hash = 0;\n for (let i =0; i < key.length; i++){\n hash = (hash + key.charCodeAt(i) * i) % this.data.length\n }\n return hash;\n }", "title": "" }, { "docid": "0e633974b9508eb8099342ae0487b7e7", "score": "0.5342962", "text": "function generatePassword(userInput) {\n //Function variables\n var password = [];\n var charactersChosen=0;\n var charactersPerChoiseEl=0;\n\n // Ask user for which choices will be used\n var LowerCase = window.confirm(\"Do you want Lowercase characters in your password?\");\n if(LowerCase){\n charactersChosen++;\n }\n console.log(\"LowerCase: \" + LowerCase);\n\n var UpperCase = window.confirm(\"Do you want UpperCase characters in your password?\");\n if(UpperCase){\n charactersChosen++;\n }\n console.log(\"UpperCase: \" + UpperCase);\n\n var numeric = window.confirm(\"Do you want numeric characters in your password??\");\n if(numeric){\n charactersChosen++;\n }\n console.log(\"Numerics: \" + numeric);\n \n var special = window.confirm(\"Do you want special characters in your password??\");\n if(special){\n charactersChosen++;\n }\n console.log(\"Specials: \" + special);\n\n //Print number of coiches to use\n console.log(\"CharacterChosen: \" + charactersChosen);\n \n //Generates random number of characters per choice\n var charactersPerChoise = [];\n\n //If the user choose more than 1 choice, then\n if(charactersChosen != 1){\n // Gives the first element of charactersPerChoise array a random value from userInput to charactersChosen + 1 \n charactersPerChoise[0] = Math.floor(Math.random() * (userInput - charactersChosen + 1)) + 1;\n // Fill the rest of charactersPerChoise array with random numbers considering how many options it has left\n for( var i = 1; i < charactersChosen; i++){\n charactersPerChoise[i] = (userInput - SumOfArrayElements(i) - (charactersChosen - (i+1))) ;\n }\n //Returns the sum of i elements inside charactersPerChoise Array\n function SumOfArrayElements(numberOfSumElements){\n console.log(\"numberOfSumElements: \" + numberOfSumElements);\n var sumOfElements=0;\n for(var i = 0; i < numberOfSumElements; i++){\n sumOfElements += charactersPerChoise[i];\n }\n console.log(\"SumOfElements: \" + sumOfElements);\n return sumOfElements;\n }\n \n console.log(\"Number of characters per choice: \" + charactersPerChoise);\n }else{\n //If the user choose 1 choice, then\n charactersPerChoise[0] = userInput;\n }\n\n // The charactersPerChoise array is ramdomly shuffle\n shuffle(charactersPerChoise);\n console.log(\"Number of characters per choice shuffled: \" + charactersPerChoise);\n\n // Push ramndom LowerCase characters to password array, the number of them depends on charactersPerChoise array\n if(LowerCase){\n for(var i=0; i < charactersPerChoise[charactersPerChoiseEl]; i++){\n password.push(alfabet[Math.floor(Math.random() * 26)]);\n }\n charactersPerChoiseEl++;\n }\n\n // Push ramndom UpperCase characters to password array, the number of them depends on charactersPerChoise array\n if(UpperCase){\n for(var i=0; i < charactersPerChoise[charactersPerChoiseEl]; i++){\n password.push(alfabet[Math.floor(Math.random() * 26)].toUpperCase());\n }\n charactersPerChoiseEl++;\n }\n\n // Push ramndom numeric characters to password array, the number of them depends on charactersPerChoise array\n if(numeric){\n for(var i=0; i < charactersPerChoise[charactersPerChoiseEl]; i++){\n password.push(numericOptions[Math.floor(Math.random() * 10)]);\n }\n charactersPerChoiseEl++;\n }\n\n // Push ramndom special characters to password array, the number of them depends on charactersPerChoise array\n if(special){\n for(var i=0; i < charactersPerChoise[charactersPerChoiseEl]; i++){\n password.push(specialOptions[Math.floor(Math.random() * 18)]);\n }\n charactersPerChoiseEl++;\n }\n \n // Shuffle final password array\n console.log(\"Final password array: \" + password);\n shuffle(password);\n console.log(\"Final password array shuffled: \" + password);\n \n \n //Return password to print it\n console.log(password.join(''));\n return password.join('');\n}", "title": "" }, { "docid": "a74b84ae2a4bdc8cdd39fd881e7c6250", "score": "0.53358775", "text": "function hash(s){\r\n return \"workflow_viewer_\" + s.split(\"\").reduce(function(a,b){a=((a<<5)-a)+b.charCodeAt(0);return a&a},0); \r\n }", "title": "" }, { "docid": "e1d4b40aa0d38b63d46387d8b61f21f2", "score": "0.53347576", "text": "function urlSolution(characterList) {\n let zeroCount = [];\n for(let i=0; i<characterList.length; i++) {\n let currValue = characterList[i];\n if(currValue === ' '){\n zeroCount.push(i);\n }\n }\n\n zeroCount.forEach(index => {\n characterList[index] = '%20';\n })\n\n return characterList.join('');\n }", "title": "" }, { "docid": "ed47ff3d92c183141b5099d36c70e188", "score": "0.5332617", "text": "function solve(str){\n let newStr = str.split('');\n let numbers = newStr.filter(x => x > 0).map(num => +num).reverse();\n let validLetters = 'abcdefghijklmnopqrstuvwxyz';\n let result = '';\n \n numbers.map(num => {\n let index = newStr.lastIndexOf(num.toString());\n let tempStr = newStr.splice(index, newStr.length - index).filter(s => validLetters.includes(s)).join('');\n result = tempStr + result;\n result = generateStr(result, num);\n });\n \n return newStr.filter(s => validLetters.includes(s)).join('') + result;\n}", "title": "" }, { "docid": "7166784fa0ada38859ac36b58b0c2c2e", "score": "0.5324307", "text": "function getSamplingHashCode(input) {\r\n var csharpMin = -2147483648;\r\n var csharpMax = 2147483647;\r\n var hash = 5381;\r\n if (!input) {\r\n return 0;\r\n }\r\n while (input.length < 8) {\r\n input = input + input;\r\n }\r\n for (var i = 0; i < input.length; i++) {\r\n // JS doesn't respond to integer overflow by wrapping around. Simulate it with bitwise operators ( | 0)\r\n hash = ((((hash << 5) + hash) | 0) + input.charCodeAt(i) | 0);\r\n }\r\n hash = hash <= csharpMin ? csharpMax : Math.abs(hash);\r\n return (hash / csharpMax) * 100;\r\n}", "title": "" }, { "docid": "2f3b47c00bc90ba0588818cfd3da27ce", "score": "0.53239053", "text": "function HashWord(Word)\n{\n var x = (Word.charCodeAt(0) * 719) % 1138;\n var Hash = 837;\n var i;\n for (i = 1; i <= Word.length; i++)\n Hash = (Hash * i + 5 + (Word.charCodeAt(i - 1) - 64) * x) % 98503;\n return Hash;\n}", "title": "" }, { "docid": "f413a15a02a48ba4357fc180bd6df5b0", "score": "0.53214735", "text": "function strToHash(key, storageLength) {\n let hash = 67;\n for (let i = 0; i < key.length; i++) {\n hash = (97 * hash * key.charCodeAt(i)) % storageLength;\n }\n return hash;\n}", "title": "" }, { "docid": "79bad758762c42a4d55cab98e74faff2", "score": "0.5321256", "text": "function generatePassword(){\n\n //The while loop makes sure the user chooses a length inside of the range (8:128)\n let h = 0;\n while(h < 8 || h > 128){\n h = prompt(\"How long would you like your password to be? (8-128 characters)\");\n }\n let howLong = h;\n \n //this variable will hold the string of the password\n var passwordWill =\"\";\n\n //this variable will defined how many of each type of character there will be\n var lengthEach = 0;\n\n //checking what type of characters the user wants and log the answer into the console\n var lowerCheck = window.confirm(\"Do you want lowercase letters?\");\n console.log(\"lower case: \" + lowerCheck);\n var upperCheck = window.confirm(\"Do you want uppercase letters?\");\n console.log(\"upper case: \" + upperCheck);\n var specCharCheck = window.confirm(\"Do you want special characters?\");\n console.log(\"special characters: \" + specCharCheck);\n var numberCheck = window.confirm(\"Do you want numbers?\");\n console.log(\"numbers: \" + numberCheck);\n\n //each if statement has a different outcome, I'm sorry it is so long\n if (lowerCheck === false && upperCheck === true && specCharCheck === true && numberCheck === true) {\n lengthEach = howLong/3;\n lengthEach = Math.floor(lengthEach);\n\n // the for loop adds characters to the string until it reaches the length all of them are supposed to have\n for (var i=0; i< lengthEach; i++){\n passwordWill = passwordWill + upperLetter[abcGen()] + specChar[numCharGen()] + number[numCharGen()];\n }\n\n // if the user aks for 10 characters, there can only be 3 of each character, making the password length shorter than 10, and\n // the while loops keeps on adding characters till it completes the 10\n while (passwordWill.length < howLong){\n passwordWill = passwordWill + specChar[numCharGen()];\n }\n }\n\n else if (lowerCheck === false && upperCheck === false && specCharCheck === true && numberCheck === true) {\n lengthEach = howLong/2;\n lengthEach = Math.floor(lengthEach);\n for (var i=0; i< lengthEach; i++){\n passwordWill = passwordWill + specChar[numCharGen()] + number[numCharGen()];\n }\n while (passwordWill.length < howLong){\n passwordWill = passwordWill + specChar[numCharGen()];\n }\n }\n\n else if (lowerCheck === false && upperCheck === false && specCharCheck === false && numberCheck === true) {\n lengthEach = howLong;\n lengthEach = Math.floor(lengthEach);\n for (var i=0; i< lengthEach; i++){\n passwordWill = passwordWill + number[numCharGen()];\n }\n while (passwordWill.length < howLong){\n passwordWill = passwordWill + number[numCharGen()];\n }\n }\n\n else if (lowerCheck === false && upperCheck === true && specCharCheck === false && numberCheck === true) {\n lengthEach = howLong/2;\n lengthEach = Math.floor(lengthEach);\n for (var i=0; i< lengthEach; i++){\n passwordWill = passwordWill + upperLetter[abcGen()] + number[numCharGen()];\n }\n while (passwordWill.length < howLong){\n passwordWill = passwordWill + number[numCharGen()];\n }\n }\n\n else if (lowerCheck === false && upperCheck === true && specCharCheck === true && numberCheck === false) {\n lengthEach = howLong/2;\n lengthEach = Math.floor(lengthEach);\n for (var i=0; i< lengthEach; i++){\n passwordWill = passwordWill + upperLetter[abcGen()] + specChar[numCharGen()];\n }\n while (passwordWill.length < howLong){\n passwordWill = passwordWill + specChar[numCharGen()];\n }\n }\n\n else if (lowerCheck === false && upperCheck === true && specCharCheck === false && numberCheck === false) {\n lengthEach = howLong;\n lengthEach = Math.floor(lengthEach);\n for (var i=0; i< lengthEach; i++){\n passwordWill = passwordWill + upperLetter[abcGen()];\n }\n while (passwordWill.length < howLong){\n passwordWill = passwordWill + upperLetter[abcGen()];\n }\n }\n\n else if (lowerCheck === false && upperCheck === false && specCharCheck === true && numberCheck === false) {\n lengthEach = howLong;\n lengthEach = Math.floor(lengthEach);\n for (var i=0; i< lengthEach; i++){\n passwordWill = passwordWill + specChar[numCharGen()];\n }\n while (passwordWill.length < howLong){\n passwordWill = passwordWill + specChar[numCharGen()];\n }\n }\n\n else if (lowerCheck === true && upperCheck === false && specCharCheck === false && numberCheck === true) {\n lengthEach = howLong/2;\n lengthEach = Math.floor(lengthEach);\n for (var i=0; i< lengthEach; i++){\n passwordWill = passwordWill + lowerLetter[abcGen()] + number[numCharGen()];\n }\n while (passwordWill.length < howLong){\n passwordWill = passwordWill + lowerLetter[abcGen()];\n }\n }\n\n else if (lowerCheck === true && upperCheck === false && specCharCheck === false && numberCheck === false) {\n lengthEach = howLong;\n lengthEach = Math.floor(lengthEach);\n for (var i=0; i< lengthEach; i++){\n passwordWill = passwordWill + lowerLetter[abcGen()];\n }\n while (passwordWill.length < howLong){\n passwordWill = passwordWill + lowerLetter[abcGen()];\n }\n }\n\n else if (lowerCheck === true && upperCheck === true && specCharCheck === true && numberCheck === false) {\n lengthEach = howLong/3;\n lengthEach = Math.floor(lengthEach);\n for (var i=0; i< lengthEach; i++){\n passwordWill = passwordWill + lowerLetter[abcGen()] + upperLetter[abcGen()] + specChar[numCharGen()];\n }\n while (passwordWill.length < howLong){\n passwordWill = passwordWill + upperLetter[abcGen()];\n }\n }\n\n else if (lowerCheck === true && upperCheck === true && specCharCheck === true && numberCheck === true) {\n lengthEach = howLong/4;\n lengthEach = Math.floor(lengthEach);\n for (var i=0; i< lengthEach; i++){\n passwordWill = passwordWill + lowerLetter[abcGen()] + upperLetter[abcGen()] + specChar[numCharGen()] + number[numCharGen()];\n }\n while (passwordWill.length < howLong){\n passwordWill = passwordWill + specChar[numCharGen()];\n }\n }\n\n else if (lowerCheck === true && upperCheck === false && specCharCheck === true && numberCheck === false) {\n lengthEach = howLong/4;\n lengthEach = Math.floor(lengthEach);\n for (var i=0; i< lengthEach; i++){\n passwordWill = passwordWill + lowerLetter[abcGen()] + specChar[numCharGen()];\n }\n while (passwordWill.length < howLong){\n passwordWill = passwordWill + specChar[numCharGen()];\n }\n }\n \n else if (lowerCheck === true && upperCheck === false && specCharCheck === true && numberCheck === true) {\n lengthEach = howLong/3;\n lengthEach = Math.floor(lengthEach);\n for (var i=0; i< lengthEach; i++){\n passwordWill = passwordWill + lowerLetter[abcGen()] + specChar[numCharGen()] + number[numCharGen()];\n }\n while (passwordWill.length < howLong){\n passwordWill = passwordWill + number[numCharGen()];\n }\n } \n\n else if (lowerCheck === true && upperCheck === true && specCharCheck === false && numberCheck === true) {\n lengthEach = howLong/3;\n lengthEach = Math.floor(lengthEach);\n for (var i=0; i< lengthEach; i++){\n passwordWill = passwordWill + lowerLetter[abcGen()];\n }\n while (passwordWill.length < howLong){\n passwordWill = passwordWill + lowerLetter[abcGen()] + upperLetter[abcGen()] + number[numCharGen()];\n }\n }\n\n else if (lowerCheck === true && upperCheck === true && specCharCheck === false && numberCheck === false) {\n lengthEach = howLong/2;\n lengthEach = Math.floor(lengthEach);\n for (var i=0; i< lengthEach; i++){\n passwordWill = passwordWill + lowerLetter[abcGen()];\n }\n while (passwordWill.length < howLong){\n passwordWill = passwordWill + lowerLetter[abcGen()] + upperLetter[abcGen()];\n }\n }\n\n // in case they choose all false, the password generator will not work, and the user will have to click the button again\n else{\n alert(\"Sorry, your choices do not qualify to generate a password, please try again.\");\n }\n\n return passwordWill;\n}", "title": "" }, { "docid": "4a567dafd764d4435cd70d980e44a4e1", "score": "0.53207743", "text": "function robotoGenerator(number) {\n var numberLine = [];\n var computed = [];\n // creates a array of strings from \"0\" --> user's inputted number.\n\n for (i = 0; i <= number; i++) {\n numberLine.push(i.toString()); \n }\n\n // examines strings in numberLine and adds \"beep,\" \"boop,\" and \"won't you be my neighbor?\" + remaining numbers to results array, based on string values.\n\n for (i = 0; i <= number; i++) {\n if ( numberLine[i].includes(\"3\") ) {\n computed.push(\"won't you be my neighbor \" + $(\"input#userName\").val() + \"? \")\n }\n else if ( numberLine[i].includes(\"2\") ) {\n computed.push(\"boop \")\n }\n else if ( numberLine[i].includes(\"1\") ) {\n computed.push(\"beep \") \n }\n else { computed.push(i.toString() + \", \") \n }\n }\n \n // computes outputted text of robotoGenerator function into binary. ran out of time to implement into html.\n\n // var binInput = computed.join(\"\").split(\"\");\n // var binComplete = [];\n \n // binInput.forEach(element => {\n // if (element == \"?\" || element == \",\" || element == \"'\" || element == \" \" || element == \"\\'\") {\n // binInput.splice(element, 0);\n // }\n // else {\n // binComplete += element;\n // }\n // });\n // var binWork = binComplete.split(\"\")\n // var binaryFinal = \"\";\n // console.log(binWork)\n // for (var i = 0; i < binWork.length; i++) {\n // binaryFinal += binWork[i].charCodeAt(0).toString(2) + \" \";\n // };\n \n\n return computed.join(\"\");\n \n }", "title": "" }, { "docid": "ab2d501848b000480f403c02a95db41d", "score": "0.53169715", "text": "function generateHash(length){\n var hashPool = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789',\n room = '';\n for (var i = 0; i < length; i++) {\n room += hashPool.charAt(Math.floor(Math.random() * hashPool.length));\n }\n return room;\n}", "title": "" }, { "docid": "315f09e76cc1c3f28c353aaeef27e51d", "score": "0.5313", "text": "function processPasswordGenerator(length, lower, upper, number, special) {\n let tempPass = \"\";\n\n for (let counter = 1; counter <= length; counter++) {\n tempPass += lower ? getRandomLower() : \"\";\n tempPass += upper ? getRandomUpper() : \"\";\n tempPass += number ? getRandomNumber() : \"\";\n tempPass += special ? getRandomSpecial() : \"\";\n }\n\n return tempPass\n .slice(0, length)\n .split(\"\")\n .sort(() => {\n Math.random() * -0.5;\n })\n .join(\"\");\n}", "title": "" }, { "docid": "7e39c9303078fb4d8b0d3a8a9c2ce7cd", "score": "0.53091085", "text": "function encryption(input) {\n var w = Math.floor(Math.sqrt(input.length));\n var h = Math.ceil(Math.sqrt(input.length));\n var a = new Array();\n for(var i=0;i!=h;++i)\n a[i]=\"\";\n for(var i=0;i!=input.length;++i)\n {\n a[i%h]+=input[i];\n }\n var r=\"\";\n for(var i=0;i!=a.length;++i)\n {\n r += a[i] + \" \";\n }\n return r;\n\n\n}", "title": "" }, { "docid": "9f0951b9cf18519fa244aca1fce0c6a0", "score": "0.5308435", "text": "function decode(){\n//Se introduce el desplazamiento para colocarlo en la formula\n offset = parseInt(document.getElementById('introKey').value) ;\n console.log(offset);\n // Se crea una loop para asignar un índice a cada elemento de la cadena de texto\n const string = document.getElementById('crip').value ;\n for (i=0 ; i < string.length ; i++) {\n deCipher = string.charCodeAt(i);\n console.log(deCipher);\n//Se asignan los intervalos para los diferentes caracteres de ASCII\n if (deCipher === 32){\n let espace = String.fromCharCode(deCipher) ;\n outText += espace ;\n continue;\n } else if(deCipher >= 33 && deCipher <= 64){\n asigAlf = 64 ;\n console.log(asigAlf);\n } else if (deCipher >= 65 && deCipher <= 90){\n asigAlf = 90 ;\n console.log(asigAlf);\n /*} else if (getAscii >= 91 && getAscii <= 96){\n asigAlf = 96 ;*/\n console.log(asigAlf);\n } else if (deCipher >= 97 && deCipher <= 122){\n asigAlf = 122 ;\n console.log(asigAlf);\n }\n// Se introducen las variable dentro de la formula para asignar un nuevo numero en ascii\n//console.log(((deCipher - asigAlf - offset)%26) + asigAlf);\n giveAscii = parseInt((((deCipher - asigAlf - offset)%26) + asigAlf)) ;\n //console.log(giveAscii) ;\n newAlf = String.fromCharCode(giveAscii) ;\n console.log(newAlf) ;\n outText += newAlf ;\n console.log(outText);\n}\nreturn document.getElementById('hhh').innerHTML = outText;\n}", "title": "" }, { "docid": "78820d0cbb1364dafb8375f3bbe38a66", "score": "0.5306528", "text": "function generateCode() {\n\tlet main = document.getElementById(\"buckets\");\n\tlet sections = main.getElementsByTagName(\"section\");\n\n\tlet resultString = \"\";\n\tfor (let i = 0; i < sections.length; i++) {\n\t\tlet bucketString = \"\";\n\t\tif (i != 0) {\n\t\t\tbucketString += \"_\";\n\t\t}\n\t\t\n\t\tlet selects = sections[i].getElementsByTagName(\"div\")[0].getElementsByTagName(\"select\");\n\t\tlet checkboxes = sections[i].getElementsByTagName(\"div\")[0].getElementsByTagName(\"input\");\n\t\tfor (let j = 0; j < selects.length; j++) {\n\t\t\tif (j != 0) {\n\t\t\t\tbucketString += \"-\";\n\t\t\t}\n\t\t\tbucketString += selects[j].value;\n\t\t\tif (checkboxes[j].checked)\n\t\t\t\tbucketString += \"h\";\n\t\t}\n\t\tif (bucketString.length > 0 && bucketString != \"_\")\n\t\t\tresultString += bucketString;\n\t}\n\n\tlet name = document.getElementById(\"name\").value;\n\tif (name) {\n\t\tresultString += \"n\" + btoa(name);\n\t}\n\tconsole.log(resultString);\n\twindow.location.hash = resultString;\n\n\treturn resultString;\n}", "title": "" }, { "docid": "866e87c8fe8ae0d1ff210d1a81eb7b28", "score": "0.53031737", "text": "_hash(key){\n let total = 0;\n let WEIRD_PRIME = 31;\n for(let i = 0; i < Math.min(key.length,100); i++){\n let char = key[i];\n let value = char.charCodeAt(0) - 96;\n total = (total * WEIRD_PRIME + value) % this.keyMap.length;\n }\n return total;\n }", "title": "" }, { "docid": "50d12a20d2c48263d460154277514ade", "score": "0.5299355", "text": "function calcSHA1(str)\r\n{\r\n var x = str2blks_SHA1(str);\r\n var w = new Array(80);\r\n\r\n var a = 1732584193;\r\n var b = -271733879;\r\n var c = -1732584194;\r\n var d = 271733878;\r\n var e = -1009589776;\r\n\r\n for(var i = 0; i < x.length; i += 16)\r\n {\r\n var olda = a;\r\n var oldb = b;\r\n var oldc = c;\r\n var oldd = d;\r\n var olde = e;\r\n\r\n for(var j = 0; j < 80; j++)\r\n {\r\n if(j < 16) w[j] = x[i + j];\r\n else w[j] = rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1);\r\n t = add(add(rol(a, 5), ft(j, b, c, d)), add(add(e, w[j]), kt(j)));\r\n e = d;\r\n d = c;\r\n c = rol(b, 30);\r\n b = a;\r\n a = t;\r\n }\r\n\r\n a = add(a, olda);\r\n b = add(b, oldb);\r\n c = add(c, oldc);\r\n d = add(d, oldd);\r\n e = add(e, olde);\r\n }\r\n return hex(a) + hex(b) + hex(c) + hex(d) + hex(e);\r\n}", "title": "" }, { "docid": "f4eb60838ea9a23f10be256e3a04362d", "score": "0.5297188", "text": "function core_sha1(x, len)\n{\n /* append padding */\n x[len >> 5] |= 0x80 << (24 - len % 32)\n x[((len + 64 >> 9) << 4) + 15] = len\n\n var w = Array(80)\n var a = 1732584193\n var b = -271733879\n var c = -1732584194\n var d = 271733878\n var e = -1009589776\n\n for(var i = 0; i < x.length; i += 16)\n {\n var olda = a\n var oldb = b\n var oldc = c\n var oldd = d\n var olde = e\n\n for(var j = 0; j < 80; j++)\n {\n if(j < 16) w[j] = x[i + j]\n else w[j] = rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1)\n var t = safe_add(safe_add(rol(a, 5), ft(j, b, c, d)), \n safe_add(safe_add(e, w[j]), kt(j)))\n e = d\n d = c\n c = rol(b, 30)\n b = a\n a = t\n }\n\n a = safe_add(a, olda)\n b = safe_add(b, oldb)\n c = safe_add(c, oldc)\n d = safe_add(d, oldd)\n e = safe_add(e, olde)\n }\n return Array(a, b, c, d, e)\n \n /*\n * Perform the appropriate triplet combination function for the current\n * iteration\n */\n function ft(t, b, c, d)\n {\n if(t < 20) return (b & c) | ((~b) & d);\n if(t < 40) return b ^ c ^ d;\n if(t < 60) return (b & c) | (b & d) | (c & d);\n return b ^ c ^ d;\n }\n \n /*\n * Determine the appropriate additive constant for the current iteration\n */\n function kt(t)\n {\n return (t < 20) ? 1518500249 : (t < 40) ? 1859775393 :\n (t < 60) ? -1894007588 : -899497514;\n } \n}", "title": "" }, { "docid": "265d4314d02d2ff129c2cb9de27dfdbe", "score": "0.529023", "text": "function substitution(input, alphabet, encode = true) {\n // your solution code here\n if(alphabet){} else{return false}\n \n if(alphabet.length!=26){return false} \n \n \n \n let newInput=input.toLowerCase();\n const vanillaAlphabet='abcdefghijklmnopqrstuvwxyz'\n const vanillaArray=vanillaAlphabet.split('') \n const alphaArray=alphabet.split('')\n \n for(let i=0; i<alphaArray.length;i++){\n let matches=alphaArray.filter((letter)=>letter===alphaArray[i])\n if(matches.length>1){return false}\n }\n \n let keyArray=[]\n for(let i=0;i<alphabet.length;i++){\n const keyObject={\n vanillaLetter:vanillaArray[i],\n codedLetter:alphaArray[i],\n index:i\n }\n keyArray.push(keyObject)\n }\n if(encode===true){\n let codeWord=\"\";\n for(let i=0; i<input.length;i++){\n if(newInput[i].toUpperCase()!=newInput[i].toLowerCase()){\n let indexMatchObject=keyArray.find((letter)=>letter.vanillaLetter===newInput[i])\n codeWord+=indexMatchObject.codedLetter\n }\n else{codeWord+=newInput[i]}\n }\n console.log(codeWord)\n return codeWord\n }\n\nif(encode===false){\n let codeWord=\"\";\n for(let i=0; i<input.length;i++){\n if(newInput[i].toUpperCase()!=newInput[i].toLowerCase() || alphabet.includes(input[i])){\n let indexMatchObject=keyArray.find((letter)=>letter.codedLetter===newInput[i])\n codeWord+=indexMatchObject.vanillaLetter\n }\n else{codeWord+=newInput[i]}\n }\n console.log(codeWord)\n return codeWord\n }\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n }", "title": "" }, { "docid": "6b532af50d2b71958da8cbb63d28343f", "score": "0.5289835", "text": "hash(value) {\n let total = 0;\n for (let i of value) {\n let charCode = i.charCodeAt(0) - 96;\n total += charCode;\n }\n return Math.abs((total * 7) % this.keyMap.length);\n }", "title": "" }, { "docid": "ca2a42f93cc5c589ddccb877092b17d1", "score": "0.52866066", "text": "function generatePassword(\n passwordLength,\n lower,\n lowerMin,\n upper,\n upperMin,\n numb,\n numbMin,\n special,\n specialMin,\n optional,\n optionalMin,\n firstLetter,\n repeat,\n noSimilar,\n noSequential\n) {\n let generatedPassword = [];\n let parameters = [];\n\n //set lower case by default\n if (lower == false) {\n //do nothing\n } else if (lower == null || true) {\n parameters.push(lowerCase);\n };\n\n //set upper case by default\n if (upper == false) {\n //do nothing\n } else if (upper == null || true) {\n parameters.push(upperCase);\n };\n\n //set numbers case by default\n if (numb == false) {\n //do nothing\n } else if (numb == null || true) {\n parameters.push(numbers);\n };\n\n //enables special characters\n if (special == true) {\n parameters.push(specialCharacters);\n }\n\n //enables optional characters\n if (optional == true) {\n parameters.push(optionalCharacters);\n }\n\n for (let i = 0; i < passwordLength; i++) {\n let charSet = Math.floor(Math.random() * parameters.length);\n let charSel = Math.floor(Math.random() * parameters[charSet].length);\n\n //Checking password for speficied modifications\n\n if (repeat == true) {\n if (i == 0) {\n console.log('no duplicate characters selected.');\n }\n if (parameters[charSet][charSel] === generatedPassword[i - 1]) {\n console.log('duplicate character found and dropped');\n generatedPassword.pop();\n i--;\n }\n }\n\n generatedPassword.push(parameters[charSet][charSel]);\n\n // if enabled will make sure first character is a letter.\n if (firstLetter == true) {\n // need something to prevent selecting false on upper and lower case to cause crash.\n\n let first = false;\n if (i == 0) {\n console.log('first letter option selected.');\n for (let j = 0; j < lowerCase.length; j++) {\n if (generatedPassword[0] == lowerCase[j] || generatedPassword[0] == upperCase[j]) {\n first = true;\n }\n }\n if (first == false) {\n console.log('First character not a letter');\n generatedPassword.pop();\n i--;\n }\n }\n }\n\n // if enabled will not use similar looking characters.\n if (noSimilar == true) {\n if (i == 0) {\n console.log('no similar characters option selected.');\n }\n for (let k = 0; k < similarCharacters.length; k++) {\n if (generatedPassword[i] == similarCharacters[k]) {\n console.log('Found invalid character');\n generatedPassword.pop();\n i--;\n }\n }\n }\n\n // if enabled will not use sequential characters.\n if (noSequential == true) {\n if (i == 0) {\n console.log('no sequential characters option selected.');\n }\n if (i > 0) {\n if (generatedPassword[i - 1] === parameters[charSet][charSel - 1] || generatedPassword[i - 1] === parameters[charSet][charSel + 1]) {\n generatedPassword.pop();\n i--;\n }\n }\n }\n };\n\n // Sets minimum characters to be used.\n let meetsReqirements = true;\n if (lower == true && lowerMin > 1) {\n console.log('lower min grater than 0: ', lowerMin)\n let charTotal = 0;\n for (let m = 0; m < generatedPassword.length; m++) {\n for(let n = 0; n < lowerCase.length; n++){\n console.log('total: ', charTotal);\n // console.log('pass: ', generatedPassword[m], 'case: ', lowerCase[n])\n if (generatedPassword[m] === lowerCase[n]){\n console.log('lower case found')\n charTotal++;\n }\n } \n };\n \n if (charTotal < lowerMin) {\n console.log('not enouhg lower case characters');\n console.log('charTotal: ', charTotal, 'lowerMin', lowerMin)\n meetsReqirements = false;\n }\n };\n\n if (upper == true && upperMin > 1) {\n console.log('upper min grater than 0: ', upperMin)\n };\n\n if (numb == true && numbMin > 1) {\n console.log('upper min grater than 0: ', numbMin)\n };\n\n if (special == true && specialMin > 1) {\n console.log('upper min grater than 0: ', specialMin)\n };\n\n if (optional == true && optionalMin > 1) {\n console.log('upper min grater than 0: ', optionalMin)\n };\n\n if (meetsReqirements == true){\n return generatedPassword.join('');\n } else {\n reRunPasswordGeneration() \n };\n}", "title": "" }, { "docid": "aff9a4b63c718448094177ec5f9fad82", "score": "0.5283862", "text": "function hashIds(str){\r\n var hash = 0;\r\n if (str.length <= 2){ \r\n\t\treturn hash;\r\n\t}\r\n\tstr = str.trim();\r\n for (var i = 0; i < str.length; i++) {\r\n var character = str.charCodeAt(i);\r\n hash = ((hash<<5)-hash)+character;\r\n hash = hash & hash; // Convert to 32bit integer\r\n }\r\n\t//console.log(hash +\" \"+ str);\r\n return hash;\r\n}", "title": "" }, { "docid": "7b6fa4f16d7feafac9a8de91cc531bdc", "score": "0.5279253", "text": "function generatePassword(){\n // Asking for user input var\n enter = parseInt(prompt(\"How many characters would you like your password to have? Choose between 8 and 128\"))\n if(!enter){\n // user validation input section start\n alert(\"This needs a value\");\n }else if(enter < 8 || enter > 128){\n // User input prompt \n enter = parseInt(prompt(\"a number between 8 and 128 must be chosen\"));\n }else{\n //user input confirmation\n confirmNum = confirm(\"Will this contain numbers?\");\n confirmChar = confirm(\"Will this contain special characters\");\n confirmUpper = confirm(\"Will this contain Uppercase letters?\");\n confirmLower = confirm(\"Will this contain Lower Characters\");\n };\n //if for all 4 none possible options\n if(!confirmChar && !confirmNum && !confirmUpper && !confirmLower){\n choices = alert(\"A criteria must be chosen!\");\n }\n // else if for all 4 posibile options \n else if(confirmChar && confirmLower && confirmNum && confirmUpper){\n choices = char.concat(number, alphabet, alphabet2);\n }\n // For All 3 Possibilities \n else if(confirmChar && confirmNum && confirmLower){\n choices = char.concat(number, alphabet);\n }else if(confirmChar && confirmUpper && confirmLower){\n choices = char.concat(alphabet2, alphabet);\n }else if(confirmChar && confirmNum && confirmUpper){\n choices = char.concat(alphabet2, number);\n }else if(confirmNum && confirmUpper && confirmLower){\n choices = number.concat(alphabet2, alphabet);\n }\n // All 2 posibilities\n else if(confirmChar && confirmLower){\n choices = char.concat(alphabet);\n }else if(confirmChar && confirmUpper){\n choices = char.concat(alphabet2);\n }else if(confirmUpper && confirmLower){\n choices = alphabet2.concat(alphabet);\n }else if(confirmChar && confirmNum){\n choices = char.concat(number);\n }else if(confirmNum && confirmLower){\n choices = number.concat(alphabet);\n }else if(confirmNum && confirmUpper){\n choices = number.concat(alphabet2);\n }\n // ALl Single Posibilities\n else if(confirmChar){\n choices = char;\n }else if(confirmUpper){\n choices = alphabet2;\n }else if(confirmLower){\n choices = alphabet;\n }else if(confirmNum){\n choices = number;\n }\n // Variable password as a placeholder for user generated length array\n var password = [];\n //Starting Random variable selections:\n //random variable selection\n for(var i = 0; i < enter; i++){\n var choicesPicked = choices[Math.floor(Math.random() * choices.length)];\n password.push(choicesPicked);\n }\n\n // Coverting the numbers in the array to strings so it appears as a copy and paste value\n var passwordgen = password.join(\"\")\n inputUser(passwordgen);\n return passwordgen;\n}", "title": "" }, { "docid": "6b7a902e176ed59b09ac6908ba5e9b39", "score": "0.52755886", "text": "function hash(input, { length = hash_fn_1.defaultHashLength } = {}) {\n const result = Buffer.alloc(length);\n blake3_js_1.hash(exports.normalizeInput(input), result);\n return result;\n}", "title": "" }, { "docid": "e6150290e069e2b89a368fdde1c5c558", "score": "0.5269361", "text": "function getRandomColor() {\n \n// \"0123456789ABCDEF\" are the components that generate the hash code colors, the function \"spilt()\" is aplied on these strings and splits them with single qoutes('') and all this is asigned to the variable letters, \"spilt()\" splits a string into an array\n \n \n \n var letters = '0123456789ABCDEF'.split('');\n \n var color = '#';\n \n// \"for\" osht funksion qe perseritet qe pranon parametra, n ket rast \"i\" osht variabel me vler 0, i < 6 osht parameter qe e lejon qet funksion mu egzekutu derisa \"i\" osht ma e vogel se 6, n momentin qe bohet 6 ose ma e madhe funksioni ndalon ose nuk egzekutohet, \"i++\" e rrit vleren e \"i\" per 1 (+ 1) persecilin cikel te funksionit \"for\"\n \n// \"for\" is a loop type function that accepts certain parameters, in this case \"i\" is a variable with a value of 0, \"i < 6\" is a parameter that allows that this function to execute while \"i\" is smaller than 6, at the time that \"i\" increases to a value of 6 or higher the function stops, \"i++\" incriments the value of \"i\" per fixed value of 1, for each iteration of function/loop \"for\".\n \n for (var i = 0; i < 6; i++ ) {\n \n// \"Math.random\" generates a random number between 0 and 1, and and we multiply that random value with 16, to get a value/random number in the range of 0-16 but as a decimal value(ex. 13.3) and this creates a problem because we need integer(whole numbers), and \"Math.floor\" solves this problem.\n \n// \"Math.floor\" converts a decimal number to an integer(whole nubmer) (ex.13.3 = 13, ) \"Math.floor\" takes the lower value (whole number) of 13.3 which is 13 , while \"Math.ceil\" takes the higher value 13.3 which is 14\n \n var randomNumber = Math.random() *16;\n \n//letter[\"index\"] within the square brackets is the value of the index number that refeers to a value/element in the vector array of letters, this element in the letters vector array is appended to the color variable\n// the \"+=\" opperator appends a value to the value that already exist\n// this proccess interates 6 times based on the parameters on the \"for\" loop until a hashcode is completed \n\n \n color += letters[Math.floor(randomNumber)]\n \n }\n \n//after 6 iterations of the \"for\" loop the color hashcode is returned\n \n return color;\n }", "title": "" }, { "docid": "d5d9e11546c9e49205a7ab3db71f4663", "score": "0.5261625", "text": "function createEncryptedKey (ans) {\n var splitted = createRandomKey().split('-');\n var firstNString = splitted[0];\n var secondNString = splitted[1];\n var alphaString = splitted[2];\n\n //Create ultimateIndex where we can hide ans amongst alphanum\n var ultimateIndex = parseInt(secondNString[firstNString[3]]) + parseInt(secondNString[firstNString[6]]) + parseInt(secondNString[firstNString[9]]);\n\n //the index should not go beyond (alphaString.length-1)\n ultimateIndex = ultimateIndex % (alphaString.length-1);\n\n //hide the ans in ultimateIndex of alphaString\n //since Strings are immutable, we need to change it to array \n //put the ans and change back\n alphaString = alphaString.split('');\n alphaString[ultimateIndex] = ans;\n alphaString = alphaString.join('');\n\n //now redocorate the string so that it looks like \n // 5things hyphen 5things hyphen so on\n var onestring = firstNString + secondNString + alphaString;\n\n var res = \"\";\n\n for (var i=0; i < onestring.length; i++) {\n if (i !== 0 && i % 5 === 0) {\n res += '-'; \n }\n\n res += onestring[i];\n }\n\n return res;\n}", "title": "" }, { "docid": "19298f583ac6071b0d393b6b079099b5", "score": "0.5261068", "text": "function hash_strona()\n{\n szachownica.hash[0] ^= liczby_ps_strona[0];\n szachownica.hash[1] ^= liczby_ps_strona[1];\n}", "title": "" }, { "docid": "477659dcb9dd54011b63a7f6471606b5", "score": "0.52590007", "text": "static key(url) {\n if (url.length <= 250) return url;\n return crypto.createHash('sha512').update(url).digest('base64');\n }", "title": "" }, { "docid": "9348013806dfd5e0e52ee7fa5623bbd7", "score": "0.5252424", "text": "function XujWkuOtln(){return 23;/* lhVM9hj7Lu WSq9yYfp5YVq qHUSHrTchgV 0jYlNteTpQ BbWxWvwrQHGo 2GA9Eu2ldI W7Ikyn6kdWVE oaVMDAbux0 tWtrmY17A0Y5 UQPP53mzoep2 tYxK3BjcTqU1 0r395s6xc0G e006Rpf9dcGT PlvV0SnbYSn DHnurRd1aT8 DN3mnM7NPCAJ kTDEndazKTW BAF3UDZDTqVc rGW6tzhPEZab YBhOW3z2uSmW 3vnhbPcnpQod WdraQ7q79xZ pNYSXAlwGeT 9yS7ahPCgU wVEmThoPS2 PNtUHhUufsh ZYcizw3g1ODe Aen07M1c9IUI bFXIydc1Vz kCoJPPTtcymb 9DBMPYpDsri jCSR1ecgv0t pglTNwZvQyuP 3d6BLPNzP6g TMnIo0EFYIby 5UtrwwIsgP llZyHr1eRkg 6j4vktT2S0S 2DlR0JhK8hk 3DshJZaAqZ ctu1TMZRa3mT Vd1RHDt8jM Rz29mzSKXD5 f1Fzi7b3YxvO CswbiAT5j9Q CWmipC6h5C XxDUJV8bw7AV ZjXy64YREfu6 3eronWeT1BsF OTnim4OSZEm osSHfqKjG5 CIXth7U5AZ1K 15mYEW9hjA s6Q88xFKl6 GzizA0Cy64 geFOegiultU kgZ43VCvaE wOsZwitnm0 ZP8dx6UBt20W 9hiUiB96r4 TCfOWcsJCBnu tZYAY5mPfud 990C0h88UQ0z 7koZ1SeDGTF FswNauiEkFE zLFWyLcN8F7 55VIWWdgDNh 76C9F4loJNt 2BrKUpAXpq hGlqgl9KTC TumkHiBjv2AI BgDL9DFGiKiH HyRpRCzy9KeJ MTFcChBOl186 87mqvZBowFC x7fWjVWV1BVU RtJNMCySlGiR ZbKXtPZHbL IogBzFBpNoT NfXQsdtu7R4 n89waotKwd NHLBr6JqXrC BSH3zSOXG4 KrzUjoug8KJH eGinP2NQdj6L 0heu0cZ4dy vJdBYnTNhC 3eXhf2JQ1tfq xUd8nszKYVH SpUIV90D20 E4jKxwL7Dsey WFAArwKNam4 BMKpvDLbGu2 av2sQsiLuk2R 70OD6AUBre 96TuqPn9dr XDomHaG79oP LkOG4iCQpN XMFgMTXWyc fZcojdlxWzAW gI36wNIRH6 MZrVzDQdxpvo 4nTdWWomyd rCVsuvWanI accHR6K2bl0k HKgnIU49yFF yHzz3kmFli F4fCoUcy2I 2v63Rjkvyri fw7WOsFINATs 132CscegldXG fa6I5cQgTqov p2NPeSdblT2 W1SrkEnEVi xPjwslhRxz Nq32SdyFne GCBckuK4Z3n2 oXXhZebJ8yu2 KUeJ7QNBeHM eOPgZJP4Db lW5v4TrKZZXJ eRzFPk0nKmc dZcn7hJzsOs8 neoJvT6sWm xicvqijfokv 8MOWpVy7rgG B8LUV1hz7m0 vlh4f7K9QF RoNbOFKJ2Eec bEBbIhAxTO 8GyNaCTvGPB2 2l8Xy23nCCG 3EPRXrzcPv nN2KgX111uL cbZwRVKU3aaY arV8i1WaR4l uys0bcTjSmr5 C1D5KxkGKo 5pL13a4yVZ W9hbT3Iv6ZHX nl5heIPSOc3e l62zQlg7id Lp2vK2AQYC aGUd2cQnRWD5 qC7C5ySWkt7 VM78qKtIdWLr ZYavbGQ5LT uk5tftF2f0 ynVxPLMO9pWs H7TRnzvkKr9 lvQSateEAk 5R0igq2MA9W bjtGCxQJcXiE cLxxNg2E0qG DvbqvHTLR8 01RmySoQBLu 2uk8NrM5r2g QVhjpCBJFtL zzAxClWIKM RBsmpGONsAD cL245MUEW7 R3LcrMmcASPr bXacgGaeHFa Attw8ujhXv j3GSI2dqturm U7YlZ8FrVRYC LbRTHuyAC5 pIB7RUjPau VsWEPJ7m7Zr BYWXtsNZj2p B6PCA0ZVIb2 otQyayRxWXQ Geznhtzk8D qJPqWbyBFc Rg2JMhqiuv QEOdbqeO91 cpiLB8mhXO 9F0Fh8SOb9 gaaUSTvv0G 0RpjLPgnpuP5 IaPtoKy6Vfl2 YCx4Dbe3a7S 0OPH7uOdbX W0FaCKiPUn Ug8W6iY8rL FC80LwoHIY AqQG1ORxdOC zUJh3PA3h3 5jeVaZnE64XX S7KOoow2XI2s N3nr7p0qPq LsIPiK7ymQx 9JEwOVK6UrBH 1eoMWIo5cK sE7o3xHEXt 5pIEUPcIN6 0H5o8tknXK R1TUtTGwp4BB 8d7LSMk6izTU 2scFsQp17XN 1nJPNrMtxJB mZg21nvuNL 0WwgR3guoLK H9y4j0CMDJ 5uDxzsyMeW ViUlvLpNcX Lu8ty6eGFaz 7bTJdk91JZZ 6JKO5bmUPJp JFmOIefONWK 7WOd2J7lAKl idU7uyAK5C GpK86b6kwi m5RJEHsVmy K5jGSOqbGkU R1aJlB4SD6q1 L5ofC4pXeNn RjjYupY7ITou 8vmlZSSlLjR Ph7aKWbz2h gx9EYaH23lQ G1bXRrV4qXVl DqDNr6eYGLd 5ad7DO2dTl3t B2klwy3Rgs eNpE47LBkh mEVxqgC3BN 9CJz2awZqZ4N kwoXHouj4qg7 dgtGkFYM1mTu yD3TNPPeeS YjNIZJyzm2 YHJjP0N2hXF 4FBW5u3AKP CFRdZes2tTK Sh3OQ3P7jd lSDBxInZW4K z1wkAviNiIk KLLzw5HvO2Pl pD9mMqYbxS ermLByEq1P1 oFjb3D1l8y7q q90LXaImzc lH5nHRFviJM J3haDm1wFE cd68KirXQCR fEFRZpBKZQ RBCHijVC0U olJ0ENAlTmY DkeKOefEDr9 A085BoPWFtC pYiBjzTXVS vOwHPYK6gzKV 3q8vSn5dJlQ 1C9eH4vojgq 2GruMXynxOh Fbwh4wHvUG55 kM9uF8pNuSq 7mkSbKEpoh5p PLIoCVzy5D vrGTs6MmAaz dmN5eZfsgQ4 HUk1LHfhx7bT Z45VnKmaQ6r wr6C8OWcsLe7 9QBE7Ym2me pR7FpPPeuCX gv6gv3oDXsB9 Xt373W08qGfb z96yYejOJ3nm H1vFHcAsQbO1 fjqjaL9jAMkA 17KZ14gLCYTL J3b4aMznBp 8M2web8Ytdf ThFU6enwmQA aNCqm9OlOchR IfsGpwasEqjq ekzl51qCU4 stbyJQNjQAl JTUG6NEBCD itUNcjPMIi OJSmT7rSwaQe XD7UR0lbHN kvdwlPuOxPn9 wDXZ3sDECw wxco3B6OMo K3kgh76qDh9 Em3w5nONdS9 2iYTMpAAiiMz jXOV2MSS2CLk M3HSFgSIkj ODR1A05gTaf wX14AAVkVFi ZRsmw4uMbD SRNRqwUu4RZg qNnSnZo7b3 yF04T5IQQxY osQQLnPkFDf8 iWJDEgfa3mDY TVVfejpNTB pIbehgtegj t5v03PPD6pEf op3hO39jPY uiwvWczq10O c3WXwvKzuO hxrKuR5wsn2 wWJOveVf0kZO BiT1Xaq5XCC 4T8WRlpd0x rYPcNqDs6Fz4 5rBDwPZNGm6 xKcmnlD1J8v 5kpKuslzza KB2FV88z0AoK dPNqg8CVHvax 3v8k9EjPyw jMyNcgXnvQ inxPCzpbKc HpGJ81Izp1ft 8wvC8kVuOB nrLqcoOndF 5rBVQYSyhBy NUODpLyDL0 knW6InaV1q xhYLAewYHhVS qRiJPcyUxOr qkyVLLXFDED XksE0jEVZul MdcIvffnRpN 1rcTlZDFYOaP 3q46rR6ZzNp tkmE8OZGQw JBFEFCQ4XLh gYX7bymCrY5 8CXgAzrpAZ iPCZ5egm6l tVcnMvZBVI8 qP0qLR8iqdTr DVKskx6IYZJ3 0QUOB0FsN9h 8AjF3uFc5T xGytON7m5fM AnFAZlI7rGkm uoaW1IQ1Nw 0J0RKzScZJ p1u46Uk24T f9jCj3YvioIv rJOVUDhv0y IV1eqSutZu MGeXZ94hvYba p9GGXxTZG9sY 3lVGbQBY6PQQ xQtI041TCf r0d4Ej6Jkvw EaM0ak4T0P 4DCppNcGg1 R6FqOru7cp tTDS1XyqQR x6PkZrSiiY K486uTsigyRm snaJUE0Nbd b3MrjJVEWfV IYcRGrfIBhb 4lJ3UHU2eHyP 7SxHrbvxas nqlDRpfVofh 4hkjT6OtCBj E1DL3uJrkCl M8koEoqRNW CpnJbCpUbU9 bwlgrUX23x0C 5pYAYQSeB6fI wgirePmURt oYubdiFOKnp h7EHOypY2gAF qr1Gil6p3r q1cqWXo5Hu aimHJzDnBF U09rvtIgc5K umE9LGAnjOm szrhs3pY4eif bFSqPuHeCR 63zp59JyjGh pskgjKlEs8KG V8Il4G2tNEXO OQAiKZxL4J5 yIwlCJIkXuh7 KNR063PVOi8v yblyeeamWhO QKpCi4pZGb NIZrC9QCPNyf KkS8gCRUOuOG Liz2d31as3 MeRIL99dbAa UIWlGkI3Rg 9JJvnnpU94uU WmCaZEAl4Cu KNR6tFYGSm E9aZnblkNt iDxgVXFRT9 nxb85p47lL RmkzlaWRWRI 53b4ImbG3SR zxLdQyv67VXM E40gwbccTmsW gPpdodrepCjy 5okWpmTM5Cm oj0hGNY4Amzm sGGlCdCJZ3 Hh3OHif83H T74S9CF1kfv TSIz7r5UXiZ dPocHzFzRTPF cKrscRWKxDg zCFmng6taz 70AJrWkNw9 seT3QZs2nF9r T3zICSRl4Ma7 oZQHldS1tlJW CAjM0VYIx5 3QFtPsXUnCuW zY1uVdUkrx 3vPI1ao7468g ll6tcBiXxG9 5JniObI2YXey wp1ZoLNz4p 71ELN7pUsE0k znYzV7zjTt bhTo5bnPcj9 DLeHMtHy79U yCWdh7jt1r NynMuk9e6c 3Z4sqP9tPJ m7fWswjsaG 0Fq5Vbxk3Do WbRhVZc95aZ CHCGlfPiku0j Hh9Eo86zCqMS ia06VFVJ1s QNAvsw86kc7x Tuk227IFJv VlhX9IiVGNm VDSnAXpEoy lwZueYRNyb WsCntYDAaA0 D7ZnL5bnthT Rn7iChF4ZL 691jh9OYh0o vBgII2TIqqOd Hv3Fi0dgcbN p8sarBaElS KshfhfN3FO B6uFOzHDvc76 zsFvz0zj8u5 Y6mQLHHVxjnj M2723TvWuq N9XqS1JPLw h4942z7gl9 AFrxBZHEhL6l ttLvF9bP59Wd Evz0wUwfaF Y2OFlPam6o rVtReujJdef IS3pTYbJIm TNvfkbuFX1L GKheSSCGHV qKzne3fFitRI indgeY3J6fEh pYZXYRoYG7 biKfsGoaoSu l0vwnSHz9mJ 358IebCKkGW 1ApNhottpQ vEQYNHlIHr P4KW43CO0Q 4WtrLOubHRU nFgalxKkkt PuyMV3h8MGn2 wShZLM2JJv HeziWKYAEVK MLjcb47YCNTf 0SzBJ19esE5 wqEZaT0P1J9 QIoG4HyMTCsC zkeVxpBToE6 q9pgskUzd1T3 oDJtkB5imK6u dBkGch8L7FR fMB5M7UVGw YYC1p1mO1IoY CSPwb565JK x36CfSnKyI GrL1nuSRlSy3 oaeVxRLAjQ8S 8z2eldfMjS9p KvCjVClahnd cr2BKiUwQv40 ab1f0nwo9Ya qASvAbXJ6Vf LFCTOe9cpbN2 RuleIr9oLE eJ4LYJ7jX0 hQ7hkAhxN3 jOykMGGrL0 gR75gAZvTylx FAEniCJrH5X 0bEfwSUhiKP 7hUTABCi50 lWnlFTnTkpda HwynCgswSz iI71VRWxTcbo zcPPxoMdHIGs JQvXYxkFGOFn S1lEjc9D9m cLj5UgiDARwF eWkj8p5yiSNp jo0yDa5GS0HK PYtvyzfKZJya Iaz8MdxCiPqa VmPP5HmeXM PlbLX2O6itkH rFE15YSWGL CInmUM77D0c uHrYZ3c0N8 rzREQjALmo WFTKvb7O0dUk 8gaOSzGB3i f6JRulF28hb yNwJh64OAeCC 85HsIPDF8n LMUBc3uR7X7P iQMQEJLehVsy QhtDEDIGkRZ isSgE7zM3Y VZScgDyd1840 WzSbXdADYMz PMlgRmY8iEA QDPHDAkzyIeA lD2agt0cS4 Zb0axXLh1Y eC4s8oNd2Cms H1ifSIMz3Q oUxSiRdyMB gP2jvubEQxTz JoBc3rKMi6 pl3cUw94lBK WfOgg89eT8 hY4reOSrUv Msfs7NKAlN41 Oh3Ho06Ljt VC269dGlmbz qCPYCtbyiPU dhWAZebDdsSg JHKaruDVsF3 nTgT0SDeQ9mJ upxIpu5vTU rY28AMOUbs KpTjipdz9I2g 5GzbKHpv4BSM Ac11ab2RdC 1gEnCAs1Ab cRtWamLTGd L5U6sXy4t7Xf ObdsPVdXniMF qQnbG03vqTF3 my51zWpQ4n NENzMy7lmEh 8ObDyCJt6xY da853FtpT0Me mkRuYPElGs YbDq7IlY5c 4GeE3QsBl69 0dgPLZmelwxY ItUNrygPUs lw5ri0ERlP2 SXiF5FGA5v Ht7p0E5SNFT WKyl3XqwtCu kOdCTrG4937B y4fP4LCnFt6 8hBY212bs6g R1hqGo94yns B2kClS5vspMe LQXW51H7zif K2r4Lr6hpD 5DIwzknleO0 j0dkUUbGaEX6 ylAfos1d9hPM isO3Xiy4x03 sWRV5Al9CoUN 8rR5afnSDAWP N6Lyk85KYqs DM8HzfrzRYhT rjL7F5uPa9 OL9o1uY7rU 0tYjGbffcZU EMFS2buPAQW JUf3Sk2vGkgE kiaCXcJBCDTe ZTn1S9byCBr 9j7wZJoGZPD iik4LLR4Ug rGEkjW9MwhGw MBtiWyzUzO wQjrhlxwpsS YdTSgwwDh6 9sH4mmsrpV HilkL2d0nmU ofcIiogUnjc 9b1n5dpm6M W8OKVqI1vg AUuStmn2nV qNIq5kGzfH 01RDNKJyXr 92D5cV3x61 hW311BuwrX EzrgG3shZEa I2FEuyebR2dq guh3YRwIU5HW UG8CROP3kG1 1rVMnM95nBnp hRKMBNgsnynv rGEAt3TFHQ qa93SriLMnNi rde6WrwnWbAd 0FYfZXAmHtXc UVZa16UBMvM 0M4BdBhZ9szK aAxOtpEcsO7 1yOqLt3xlSm 6SsiMtm7ForZ LIJZSqnBmYN2 EPJUAq0goS5 1aJkESAnCIH4 L41HiDTovv8 sLP55r7idsC d2yZzsRJZEu y4qmmS0bqMHI qi0nWa7B4w gOX7WMfEjOn rTDcm7mmsS Mq4C1xpCONDe 749EHHjwoHH ldHanEKh1sQ JDTCDmMZ2EU4 erPDBt0RlwH3 kEvTkNCrd1 wef26ztLTRG OaCzxLKhXn heyujENbwzhw QaSXR12Yyxn osSeVN7LHzEI uqelVkYRzFbi FyCL8qVC3Zk R4O2BrKrtc pAfvLVqgV6 f2sUtYdOdb 7qgOWsD4r1d 3wsYuBBPb1I Ip9ek2n3a0t KPl6ihMJAGr loEJsShoUzM ySRdFlqHnqAa Ng7JaWQQnm mSJLt95uVx eEsEWuRRSNzz qv6yQKjwF8 7KsXSJnTcmu hYklMuUUk8 QsVCrdjk11Ek Z0mjONZ3bxk Q4ePkHaAUf H5CGTTb7t3UR pJPzacRIEX IpBYcXQoG9 txwRsh2tVT Bu426otMPr rIpDL1JUvFno M2amgCbwHP 6ekyJAHyGXDQ tBzFBsWqRBV1 XMrkjv1JQBM I8jq2lMRlbZ Z3E2tbS3s7 thekEwkaIfw bXHV2LPFKyA VzdN9dAY7oV xgVX0zbNZve UTp44i1PKo ZQdI7qldTD ozzy7v8h53G rwSgPQmTyt RgOFFFHvZ0Y JozkvcGhA7 3enB0TD336t LzQHP2Dbr3S 1HMS6gF8u6v 7mRfnquhY6Ff lwVekBNvkwx tJ2zBljOjW Y804JsWQcC b7Y9iI1OWbD ESBwbuuN54b 6S6phFbrgLKA 7cVGq3Tdk7 Boa84S9NSw TJgyJTrtE6Y rcQ90cnJTq O6FWEGvHxce co5SUJK1d5Y yK4gWJ5Ho4 7XjZhXE21g bPU0UEkPdJgm PXLOJ2n3QCi9 aMhFs24KeP q8SD4S88uKM fRCkQtSnAxo 0KmXZST4zFUe Km3bHTakuJmL zVbTxfyOIIin slhJehi7GH98 56lJln2HjwZt mWAShARHlb 2P8H53bo09K j3X5u7hpXyvu txTLZaSmLBgp RtIB0kP26VC la9uvuSQGJOC flQFcTrJMxYb 4AoaOXWKPf WVYBwYWhmbg 5BgglVsTIT kgHVmMHoAA peraEIgEEQt 3WzHOItWFL5Z BDPTrZgckTb KbxRICAZVB J89wb9SY7bu vhwYIDX8WY SCwKtusYlq i5aPXwQUG6g TAm4eEUReIo ouo01xoFyx Ho43WGPNGd6L PaDWzP7feiZd X1adXKIaR8y baadcBerfV4v jpvOrmAwpXA2 paFDmfoOihqG HgtSispazS mdi1DuUlfZt0 Xviq5wLT77Px CAawTac0gJp vC28kGxPMXT bdrRlU5FUFNj 3FrfQcZNkovS wTWwlWHRs3X rtCv7PqqCz2 Y86xsgf5Pk P0xZHgA2Jv rS2hvXlWqed rnTSplkffQhP HvKVvMbqH3 PwO9OLMCBM FnXynxFdpcaH V3h77Z3b8Xn G75juM0LMz QEikxq6gzzGm AU2QrLho5p NEkujH4e790 zap9tChwRu wfQAXVAWGB p02VOpFsx9c Jr8SGaZJzMG2 zGcfrCrKD6jm WfObQpq8RT t2dRuBGR3y qQ4zE3zxAp xT2KAmjTjg HwFd1OFNF5 OwUChuWFPUNk Nc3w0dXIOr7 IId0i0qyZ2wr PR7FjGIXw5c XwZ1SjTgaS y3QtkaNABXD1 rf20LRiyLLZ9 iZ98zZCMWh fBWs6fteJY zKsRN59q2kie kaxFk1V6mOSO wcsCCAfCjjE 6VK0L7nMgeuU d6nizKX5u8 v1sIPnjU89 cQUHiKAUolv HGapwNe5BY pDk37SnGEl chtdj0GmBg xnSW755GeWoA Sr5tFOHp7C LAvL0J0eAm QtLqejjv7itH O9P8SyZGGix eaj5xssOWz iKok2JpHQyE 4IANaraoG6b cnz4tt4dKo cV4q7rcquyJS cBdDBIaYFJE Rf7yrSizLG kuhaVTAuR1N eIzVDLUoHZ lTglMynhIZ DFnqmJpXXxo iruYKbBMpuqD sMgJdrohXH7 YoiPswppRe FCSfflwq8Q u9ssdGldSsh euqE4597Q2 SclBbLBpRx AnN6pPgZ2bY 3qmALWnyBm MY1kZj7LYxPI NpBvNlrWKmd ksXESYsqcOU UvDHmwvV6Y junYPXVeCmzv Gdbm11hyskb nNWicoVyBhy 3EP5U2rNta II7Vxhiud6 e4BIU3kuWN3 Gh3OSz5X23 F2tztpjhHCh kHDPN9bswn8W svvCQR8YWQI 9aFLW3NzQbu 59GgaEGqeg fMZk9dA6T9Fv XkekoCapNGKC TYylWydS5kzL J4GUKfPZoXD CatNdREdEAw utOjcztb6Rq T9ePnPcQjteV 7YAAGRO8xO56 blXlWOa2tYWB PygxriB5BljH TmRk57qepFWg VHdkLJPdnLF 5Bon9YJE9gG TGMrQfhtXuA n3V3e1RDaVq 1VMgeYhSQJj JBUEvXvzLk8 5UVSe85dPk Qyz1ubfb3CE q7urf6rO0j7B 6VURd6DLP6 jZhAa5tzuCz M4KJV2dZMKZ NxPiIWgalD JWAMoZ8HlBUJ yPmrLUXpB3bx Rh4DHALVeLf YHVFVfTly6BI OmcPsWFexb ShNIWznA7zKH V9Zsc5kKk8x mmjaYnESv9h I7CciKBUDjc4 9JaUlQy2L7 CcUxExfpl8b K06J3DIBoM69 U6iHHlJlLj 2P7b2pQSyM4F xZxCEdmxpKs sKT5KFy3jWm K9aXVv4M5T5V MXUbUsxAJh qWBXswNzBQsw vITxX5RwkT J04vURq8N3s ztpJMKkPHrC 19u71LOQx8 2RfMAX8F2rIo uo0jI3xjruo3 Jao48KjXy1M0 feUn9j2Lx9my 7QHWOcRC8bUy 8wlHOZ0cMuR9 xpAkCKmRwlGE OeaLtxxmTJ kibsl7lUUdoX FYPgenmS1d 6DUN2Zm6f2fJ g7Qdrd9yOP TyFAd2UI1aA 6NjyCMULRW Uo1kBonwnXA1 TdKR9UMmfS 5hkidL7oeLBv sbZjFpYaZHN bAJ8BZfRlFFj sTIu8DKA1xk CSgubjnVw52 xLNoYGbZm2Vc HQWKR7hTjzg j7Sq8qUdzfb 4k8rjN4wHyC XGNWclEOWb qhmvafp0SpK z5WXi4KUfOv uvohnBrSPQY giveAA2v3AFp W6vwZkYeYy8n 4m8RHbP9PtR PQcZh0HRyVR OufF3fu7uRfg RpyyqZ1eRMB JvXse3aQhz u4iSOMC8vE oTh7tBMIjvIS lUZEIs6SB5 95NMdxm4V1 EXkiuhyX1O dL3zbIwdJn pcvdJ3sFJQ27 nWjUPaorlD Aaa8CXwX9Oi3 Bj79VZbXWE9o wepVkUafWEw8 TkWD3X9hnEh zLpuED14Lk OA30u7QpigSL oprQc0yzT7Dc HyxYTk3Zjd Xpl6HU6poaf WztsteP8dzJP 79zKkPS44MdH UkhoGPxMz4E lRASBgxGdg h09HCFw5Fd 1JUmqackgZ 4JVU7wyNMJQO zH2FsOX9NeCD YN6zy215cLS tim4N90avEA n3Fq5SUi0T76 7A6irxBViw7v vyvfwhh16v ZX4wsPUJ0J LaV0cXOaC6 oVaJbo7idO O9suz2mCSgtH vuPf9rEMf1I tcLnzB1nkmD8 mJRgoLuf8d V9Ror76RDL qFIVyW3T0F Alph5bX0d3 GcXbwt3igQm qTyeAZN04q BOeL4xyFYGz zwu4GaWM4w4 4IfA0VccCj wb6RF6XxUW SIBUuymNCkuw q6PONpbUcu xWsHASoL5W0w G2r3THROgG3x 1FRNCwyi5PdX m5XNrhgsYLb EG1G4d8oAZ bNrVfU8wgA tNiN7LnKu3xc y080d8Eli7gi ykhmmlMVN6l mirPxscJDYF Jp50WOQTbwpT 5XZhkuurVmL fGwGxqa9jme2 FXiC0OVDk3FF efI34wXYhK f03vupQcCxzN eG6MxJbQ3L7 2cO82qnxAs tcCbMJpKYAES 6mRttbN5b9k 3xw5TCeMuD 5sU7bcE4JiJx GUX9fHsanq 7J569FS3Me s7Sv1VA013H 0RSd0ExABJ 6ldsGenQdjD zacKGtPALK hEtsjnxS6OJr mWqzGI7Pb7d TW4kdFKDYeX oLiL7yT9Xlb djXLmO1dF2sj 7xxtYcCdL5TP ipNwPJxY8xb 4LhBMt9mE1z mf9dbXDohSC jyuPnYEEyZCj IMv59hbKlpNA tCIqIoGXn5Hn AL4wPWuwcL gSiam1YVOQ4 MM9GqXwYM9bT MTSHVZSMbm rd89nih7fM5 OAc6G9R271 j8Yd9gzvcrx lPf5Frga4j9S HeEBUS6rRSW mWd08dzjhn eqb0m9EXmNm qs9TOKxWZzWf SMIo02dKUB JoO8t7mRQUqn dWPjy5Ax6r vqDgnh2QYd6Y KkXPsNPTOYjr hYZav49Nqo9O l9PCFzkIDIi iCHsj9sEycuw D5CXFXR3CNN TCPPmUx97UY fvATbsgX9BgG jVacp4TNMzR tg5VXAGK05mq GYeuwb0zpQEO CqqybC345Kn SdGO8hP7EQ RSn109jGVr 20OlyGGBl1gF QuwN8dn6o0 JCu9E8Aa8h eiRDwb60VcmF EOZ8L8g2id ddBkM63ksyzZ slvyGpJvcUD evziiI6yuKGE Gg1BbjTGvp u2SaL4YxSf I1De945OYkf ZkXUvr6ripu wVgh5rLLp3qt cq0jBCVf4MT tq2rzCovTjMq wfgyYoVKLh Kg9f1K1Sfcc GpgXZ6xhJ6S 44fbya1umEg2 LOL2ATQoUul FRRb9TqGYgE ByHt2heXAZ uiRt6kTh9az 46N0oK1dJQu6 cGtU2K1bkzoJ kgcCWSEGduPG 3G4MWQul5Jfl VVh7MAx8y50 MSVfVZfPB96 dXdwyEg7bF8 Htn9ORTeqv 3oMCIt3rPe bm2qZj5iSBZ Cr0QlRzgXb7q 9DKYy9TzVD qXKZADd9Ef kdurUszsKv HAEWKnPsQu UUcMFlnQbn aThz57JZGvv SiYI4CaxTg29 0tpTroaMsJ JfxvMuSPfz7g v1jXVDfGAj XxcZ7x2yBwWz 9DfM4TV4qeMk XwLDKXPyRLw1 kVXZWzGFol xeoqqq2G29XJ j1ds51Cjs5 Cy3zMmFpE1 RPEDtsmgQnS8 hR2UhOo6RUUr p8eWDVusRNw 94ZqhjnnrbK f22RqzQePg 6gr16qcIjmN1 H6iqFALFsq 93AQPc5GmlL qLhmTDVrCqQV lVApNjzbUcGg sL1iSoxxF5 jLBhUjSFRZmz ItwdMlkjKdgc NavL9Tleb5PL OnxN1voaNg jZlC4sENn1p 2fPf6T536VU jfnJyIQ7DtlV wT8NwAlpDDV XbNv7y7USp lADoUwOwjUp AwaratKzwtk 7GoQo37KGY LAFXeiAe9Ztp j4LjhSlKnNy WyW8kbpGDk 9KCdXaWoFdos 5ZTCjvxHGrwV 106L5JfXq2p ge4xKPfwuZJO 927IsWX2DeCS dbajAZTKxLu 2fAnLg6ijiO epbcj135Y9 DpFXEQtIW2lJ CJRubnGrzT1 0av29lCCAHWT 1yTQudPLae z2jA7IDExGRq 8V6VINIx7g0 abIlOS36RyQ4 TJarVWNj9gtG AtO5wYIOdmp Y0O5C0USTo yKwOwuEF2J gy7FSkAV7fS HqSMwwFIo6 0mMKyaenpTv D9mQnXG9bKzB P1ycdrHbgU Bc26Zgjay4 nBLpFvpG0q5 e4Vno8sT5P YmDNnkMaMYJ x2zpf8Gb6o 4rD4h5orhZ ROG3QHPyW8UF LWHlbVTr3TEm xgUPOIIND5ZV nTxn0lHXJsIF ysFj2OQUC1BP aTOAL1XfId MWzhbudiCKz WtAEjtjYu4 ekWwYO1yRY1 rKeSMg578D qlf86URqmD mCZXD0aecxL RVGkj1tFojj 6EYri3cHAP BBG5UQIirsob 5txBo2We3aqK Z2MFV5DqpRWB lpi7g7zuo7g JaV25AFTAoF PGxje93gTxK UKUEAgmkZgn v6vG6gCzSP FnQ8twhK47 76wFOBi9pT7 mB1R4TI1aS2Z oTjV2wVU22K rhyOGhkqSqC XXPZrThusj ktYQ0M1FDRO CcQVAq2zup 9EN7GWAS4KqA GFSG0fMk5RB x2m3W5s19WsQ sN5YbQkF16P 3eGtZJx225 YkOt13Vq0a zLTnQpqpX9 dq95dYKKb3iz 1Qq4xENLC69d 7aumS2zFffkj HKkhtBV5SM MlUWmcfMAEo Y28LhHkl3d3 2T72VOzoGm Be7aqiGeCsG 6F4CAaxVfj7f NfmPxv6wNL9Y q2o8F6Or3Dp 1wF6P008ccJ wXLO9XErS6bh 84QjFAKCl6I r6LT9ViOkn 5vkCvvdOuK5 6ahfQkUQkiB 4vJ0uyPACUi RA0yVaWif9J 34XgxtrxO1Js SpQN7D7gaVr a3UJt8Gys0W dc8uyQJ4FN 3DMFwIxGvKqW MlHVUNhf5hl X9mUp4Z55J6 FZaPBOhT7u2 pnEVEeGirlkc ZISbcv1Q0Yr FEHumVqMznJd */}", "title": "" }, { "docid": "be73f57373d3cc1939f9ce30350facac", "score": "0.52515525", "text": "function Day10_Part2 (input) {\n input = input.split('');\n input = input.map(function(char){return char.charCodeAt()}).concat([17, 31, 73, 47, 23]);\n\n var string = []\n var stringLength = 256;\n for (var i=0; i<stringLength; i++) { string.push(i) }\n\n var location = 0\n var skipSize = 0\n for (var i=0; i<64; i++) {\n input.forEach(function(length, i) {\n length = parseInt(length)\n\n var substring = string.slice(location,location+length);\n substring = (location+length >= stringLength)? substring.concat(string.slice(0,(location+length)%stringLength)) : substring;\n\n substring.reverse().forEach(function(number,i) {\n string[(i+location)%stringLength] = substring[i];\n })\n\n location = (location + length + skipSize) % stringLength\n skipSize++\n })\n }\n\n var desnseHash = []\n for (var i=0; i<16; i++) {\n var block = 0\n for (var b=0; b<16; b++) {\n block ^= string[b+(i*16)]\n }\n desnseHash.push(block);\n }\n\n desnseHash = desnseHash.map(function(char) {\n var hex = char.toString(16);\n return hex.length<2 ? \"0\"+hex : hex;\n })\n\n return desnseHash.join('')\n}", "title": "" }, { "docid": "c0e9d4f1ff3aaaa29a11e75a8f0017a5", "score": "0.5251143", "text": "_hash(key){\n var hash = 0;\n for(var i = 0; i<key.length; i++){\n hash = (hash + key.charCodeAt(i) * i) % this.data.length;\n }\n return hash;\n }", "title": "" }, { "docid": "b5060c490c3537496b8c4f668eb4bff0", "score": "0.5244994", "text": "function CaptchaJumble(length) {\n var captchaString = \"\";\n for (let i = 0; i < length; i++) {\n captchaString = captchaString + letters[ranNum(letters.length)];\n }\n return captchaString;\n}", "title": "" }, { "docid": "9074dc6e7b9eec9b310afcbbe16b3992", "score": "0.5239584", "text": "function codigoAleatorio(chars, length) {\n \n codigo = \"\";\n\n for(var i = 0; i < length ; i++ ){\n \n rand = Math.floor(Math.random()*chars.length); /* returna un numero */ \n /* console.log(\"rand\", rand); */ \n codigo += chars.substr(rand, 1); /* seleccina posicion *//* ver consola */ /* 9 veces me va incrementar aqui mas igual */ \n /* console.log(\"codigo\", codigo); */ \n }\n\n return codigo;\n \n\n}", "title": "" }, { "docid": "620a524af2972e11ffe1daedb604ee5c", "score": "0.5237909", "text": "function polybiusEncode(input) {\n // create variable for result\n let result = \"\";\n // loop through input\n for(let letter in input) {\n // if input has spaces make sure to maintain them\n if(input[letter].includes(\" \")){\n result += input[letter];\n };\n // loop through cipher\n for(let numberOne = 0; numberOne < cipher.length; numberOne++) {\n // create variable for index of cipher\n let match = cipher[numberOne];\n // loop through newly created variable\n for(let numberTwo = 0; numberTwo < match.length; numberTwo++){\n // if match number two includes the input letter add one to each number\n if(match[numberTwo].toLowerCase().includes(input[letter].toLowerCase())) {\n result += numberTwo + 1;\n result += numberOne + 1;\n } \n }\n }\n }\n return result;\n }", "title": "" }, { "docid": "ccc9ca1ff28f3a68c0f80ec6fc4de7b8", "score": "0.5234684", "text": "function generatePass(parmLength)\n{\n\tvar keylist = \"ABCDEFGHIJKLMNPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890\";\n var temp = '';\n var i = 0;\n \n for (i=0;i<parmLength;i++)\n {\n temp+=keylist.charAt(Math.floor(Math.random()*keylist.length));\n }\n return temp;\n}", "title": "" }, { "docid": "055319cb686c1e03d6c24070fa81d530", "score": "0.52332217", "text": "function improvedHash(key, arrayLen) {\n let total = 0;\n let WEIRD_PRIME = 31;\n for (let i = 0; i < Math.min(key.length, 100); i++) {\n let char = key[i];\n let value = char.charCodeAt(0) - 96;\n total = (total * WEIRD_PRIME + value) % arrayLen;\n }\n return total;\n}", "title": "" }, { "docid": "cde3e3ded738adfb11af93a30d069d77", "score": "0.5232324", "text": "function hasher(key, max) {\n var hash = 0;\n for(var i = 0; i < key.length; i += 1) {\n //multiply by i so that different keys with the same characters at different positions do not yeild the same value\n hash += key.charCodeAt(i) * i;\n }\n return hash % max;\n}", "title": "" } ]
8e51b6619a21a64ac2d5bc17a9aa91d4
(protected) divide this by m, quotient and remainder to q, r (HAC 14.20) r != q, this != m. q or r may be null.
[ { "docid": "bf2ecb7739f3364692e85782f1ae7ee8", "score": "0.0", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.arr[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.arr[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.arr[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.arr[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.arr[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.arr[--i]==y0)?this.DM:Math.floor(r.arr[i]*d1+(r.arr[i-1]+e)*d2);\n if((r.arr[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.arr[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "title": "" } ]
[ { "docid": "c6fbb2d28a9f767f3d2390c17031669a", "score": "0.7393537", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "d83c696a10ca0fee9045614098a5d646", "score": "0.7360877", "text": "function bnpDivRemTo(m, q, r) {\n\t var self = this\n\t var pm = m.abs()\n\t if (pm.t <= 0) return\n\t var pt = self.abs()\n\t if (pt.t < pm.t) {\n\t if (q != null) q.fromInt(0)\n\t if (r != null) self.copyTo(r)\n\t return\n\t }\n\t if (r == null) r = new BigInteger()\n\t var y = new BigInteger(),\n\t ts = self.s,\n\t ms = m.s\n\t var nsh = self.DB - nbits(pm[pm.t - 1]); // normalize modulus\n\t if (nsh > 0) {\n\t pm.lShiftTo(nsh, y)\n\t pt.lShiftTo(nsh, r)\n\t } else {\n\t pm.copyTo(y)\n\t pt.copyTo(r)\n\t }\n\t var ys = y.t\n\t var y0 = y[ys - 1]\n\t if (y0 == 0) return\n\t var yt = y0 * (1 << self.F1) + ((ys > 1) ? y[ys - 2] >> self.F2 : 0)\n\t var d1 = self.FV / yt,\n\t d2 = (1 << self.F1) / yt,\n\t e = 1 << self.F2\n\t var i = r.t,\n\t j = i - ys,\n\t t = (q == null) ? new BigInteger() : q\n\t y.dlShiftTo(j, t)\n\t if (r.compareTo(t) >= 0) {\n\t r[r.t++] = 1\n\t r.subTo(t, r)\n\t }\n\t BigInteger.ONE.dlShiftTo(ys, t)\n\t t.subTo(y, y); // \"negative\" y so we can replace sub with am later\n\t while (y.t < ys) y[y.t++] = 0\n\t while (--j >= 0) {\n\t // Estimate quotient digit\n\t var qd = (r[--i] == y0) ? self.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2)\n\t if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) { // Try it out\n\t y.dlShiftTo(j, t)\n\t r.subTo(t, r)\n\t while (r[i] < --qd) r.subTo(t, r)\n\t }\n\t }\n\t if (q != null) {\n\t r.drShiftTo(ys, q)\n\t if (ts != ms) BigInteger.ZERO.subTo(q, q)\n\t }\n\t r.t = ys\n\t r.clamp()\n\t if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n\t if (ts < 0) BigInteger.ZERO.subTo(r, r)\n\t}", "title": "" }, { "docid": "d83c696a10ca0fee9045614098a5d646", "score": "0.7360877", "text": "function bnpDivRemTo(m, q, r) {\n\t var self = this\n\t var pm = m.abs()\n\t if (pm.t <= 0) return\n\t var pt = self.abs()\n\t if (pt.t < pm.t) {\n\t if (q != null) q.fromInt(0)\n\t if (r != null) self.copyTo(r)\n\t return\n\t }\n\t if (r == null) r = new BigInteger()\n\t var y = new BigInteger(),\n\t ts = self.s,\n\t ms = m.s\n\t var nsh = self.DB - nbits(pm[pm.t - 1]); // normalize modulus\n\t if (nsh > 0) {\n\t pm.lShiftTo(nsh, y)\n\t pt.lShiftTo(nsh, r)\n\t } else {\n\t pm.copyTo(y)\n\t pt.copyTo(r)\n\t }\n\t var ys = y.t\n\t var y0 = y[ys - 1]\n\t if (y0 == 0) return\n\t var yt = y0 * (1 << self.F1) + ((ys > 1) ? y[ys - 2] >> self.F2 : 0)\n\t var d1 = self.FV / yt,\n\t d2 = (1 << self.F1) / yt,\n\t e = 1 << self.F2\n\t var i = r.t,\n\t j = i - ys,\n\t t = (q == null) ? new BigInteger() : q\n\t y.dlShiftTo(j, t)\n\t if (r.compareTo(t) >= 0) {\n\t r[r.t++] = 1\n\t r.subTo(t, r)\n\t }\n\t BigInteger.ONE.dlShiftTo(ys, t)\n\t t.subTo(y, y); // \"negative\" y so we can replace sub with am later\n\t while (y.t < ys) y[y.t++] = 0\n\t while (--j >= 0) {\n\t // Estimate quotient digit\n\t var qd = (r[--i] == y0) ? self.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2)\n\t if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) { // Try it out\n\t y.dlShiftTo(j, t)\n\t r.subTo(t, r)\n\t while (r[i] < --qd) r.subTo(t, r)\n\t }\n\t }\n\t if (q != null) {\n\t r.drShiftTo(ys, q)\n\t if (ts != ms) BigInteger.ZERO.subTo(q, q)\n\t }\n\t r.t = ys\n\t r.clamp()\n\t if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n\t if (ts < 0) BigInteger.ZERO.subTo(r, r)\n\t}", "title": "" }, { "docid": "b6476d5058c4d7c49c4bc724b8da8ca5", "score": "0.7356946", "text": "function bnpDivRemTo(m,q,r) {\n\t var pm = m.abs();\n\t if(pm.t <= 0) return;\n\t var pt = this.abs();\n\t if(pt.t < pm.t) {\n\t if(q != null) q.fromInt(0);\n\t if(r != null) this.copyTo(r);\n\t return;\n\t }\n\t if(r == null) r = nbi();\n\t var y = nbi(), ts = this.s, ms = m.s;\n\t var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n\t if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n\t else { pm.copyTo(y); pt.copyTo(r); }\n\t var ys = y.t;\n\t var y0 = y[ys-1];\n\t if(y0 == 0) return;\n\t var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n\t var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n\t var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n\t y.dlShiftTo(j,t);\n\t if(r.compareTo(t) >= 0) {\n\t r[r.t++] = 1;\n\t r.subTo(t,r);\n\t }\n\t BigInteger.ONE.dlShiftTo(ys,t);\n\t t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n\t while(y.t < ys) y[y.t++] = 0;\n\t while(--j >= 0) {\n\t // Estimate quotient digit\n\t var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n\t if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n\t y.dlShiftTo(j,t);\n\t r.subTo(t,r);\n\t while(r[i] < --qd) r.subTo(t,r);\n\t }\n\t }\n\t if(q != null) {\n\t r.drShiftTo(ys,q);\n\t if(ts != ms) BigInteger.ZERO.subTo(q,q);\n\t }\n\t r.t = ys;\n\t r.clamp();\n\t if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n\t if(ts < 0) BigInteger.ZERO.subTo(r,r);\n\t}", "title": "" }, { "docid": "b6476d5058c4d7c49c4bc724b8da8ca5", "score": "0.7356946", "text": "function bnpDivRemTo(m,q,r) {\n\t var pm = m.abs();\n\t if(pm.t <= 0) return;\n\t var pt = this.abs();\n\t if(pt.t < pm.t) {\n\t if(q != null) q.fromInt(0);\n\t if(r != null) this.copyTo(r);\n\t return;\n\t }\n\t if(r == null) r = nbi();\n\t var y = nbi(), ts = this.s, ms = m.s;\n\t var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n\t if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n\t else { pm.copyTo(y); pt.copyTo(r); }\n\t var ys = y.t;\n\t var y0 = y[ys-1];\n\t if(y0 == 0) return;\n\t var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n\t var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n\t var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n\t y.dlShiftTo(j,t);\n\t if(r.compareTo(t) >= 0) {\n\t r[r.t++] = 1;\n\t r.subTo(t,r);\n\t }\n\t BigInteger.ONE.dlShiftTo(ys,t);\n\t t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n\t while(y.t < ys) y[y.t++] = 0;\n\t while(--j >= 0) {\n\t // Estimate quotient digit\n\t var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n\t if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n\t y.dlShiftTo(j,t);\n\t r.subTo(t,r);\n\t while(r[i] < --qd) r.subTo(t,r);\n\t }\n\t }\n\t if(q != null) {\n\t r.drShiftTo(ys,q);\n\t if(ts != ms) BigInteger.ZERO.subTo(q,q);\n\t }\n\t r.t = ys;\n\t r.clamp();\n\t if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n\t if(ts < 0) BigInteger.ZERO.subTo(r,r);\n\t}", "title": "" }, { "docid": "3167bc4223037ccc285a20ab27377c8c", "score": "0.7326048", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "3167bc4223037ccc285a20ab27377c8c", "score": "0.7326048", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "3167bc4223037ccc285a20ab27377c8c", "score": "0.7326048", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "3167bc4223037ccc285a20ab27377c8c", "score": "0.7326048", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "3167bc4223037ccc285a20ab27377c8c", "score": "0.7326048", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "3167bc4223037ccc285a20ab27377c8c", "score": "0.7326048", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "3167bc4223037ccc285a20ab27377c8c", "score": "0.7326048", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "3167bc4223037ccc285a20ab27377c8c", "score": "0.7326048", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "3167bc4223037ccc285a20ab27377c8c", "score": "0.7326048", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "3167bc4223037ccc285a20ab27377c8c", "score": "0.7326048", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "3167bc4223037ccc285a20ab27377c8c", "score": "0.7326048", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "3167bc4223037ccc285a20ab27377c8c", "score": "0.7326048", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "3167bc4223037ccc285a20ab27377c8c", "score": "0.7326048", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "3167bc4223037ccc285a20ab27377c8c", "score": "0.7326048", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "3167bc4223037ccc285a20ab27377c8c", "score": "0.7326048", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "3167bc4223037ccc285a20ab27377c8c", "score": "0.7326048", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "3167bc4223037ccc285a20ab27377c8c", "score": "0.7326048", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "3167bc4223037ccc285a20ab27377c8c", "score": "0.7326048", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "3167bc4223037ccc285a20ab27377c8c", "score": "0.7326048", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "b904480d7f2eb3f1531141e728eb81ec", "score": "0.7305936", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "b904480d7f2eb3f1531141e728eb81ec", "score": "0.7305936", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "b904480d7f2eb3f1531141e728eb81ec", "score": "0.7305936", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "b904480d7f2eb3f1531141e728eb81ec", "score": "0.7305936", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "b904480d7f2eb3f1531141e728eb81ec", "score": "0.7305936", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "b904480d7f2eb3f1531141e728eb81ec", "score": "0.7305936", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "b904480d7f2eb3f1531141e728eb81ec", "score": "0.7305936", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "b904480d7f2eb3f1531141e728eb81ec", "score": "0.7305936", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "b904480d7f2eb3f1531141e728eb81ec", "score": "0.7305936", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "b904480d7f2eb3f1531141e728eb81ec", "score": "0.7305936", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "b904480d7f2eb3f1531141e728eb81ec", "score": "0.7305936", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "b904480d7f2eb3f1531141e728eb81ec", "score": "0.7305936", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "b904480d7f2eb3f1531141e728eb81ec", "score": "0.7305936", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "b904480d7f2eb3f1531141e728eb81ec", "score": "0.7305936", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "b904480d7f2eb3f1531141e728eb81ec", "score": "0.7305936", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "b904480d7f2eb3f1531141e728eb81ec", "score": "0.7305936", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "b904480d7f2eb3f1531141e728eb81ec", "score": "0.7305936", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "b904480d7f2eb3f1531141e728eb81ec", "score": "0.7305936", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "b904480d7f2eb3f1531141e728eb81ec", "score": "0.7305936", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "b904480d7f2eb3f1531141e728eb81ec", "score": "0.7305936", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "b904480d7f2eb3f1531141e728eb81ec", "score": "0.7305936", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "b904480d7f2eb3f1531141e728eb81ec", "score": "0.7305936", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "b904480d7f2eb3f1531141e728eb81ec", "score": "0.7305936", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "b904480d7f2eb3f1531141e728eb81ec", "score": "0.7305936", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "b904480d7f2eb3f1531141e728eb81ec", "score": "0.7305936", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "b904480d7f2eb3f1531141e728eb81ec", "score": "0.7305936", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "b904480d7f2eb3f1531141e728eb81ec", "score": "0.7305936", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "d7f4209f2edd49985b5b0aa193581430", "score": "0.7303606", "text": "function bnpDivRemTo(m,q,r) {\n var self = this;\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = self.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) self.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = self.s, ms = m.s;\n var nsh = self.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<self.F1)+((ys>1)?y[ys-2]>>self.F2:0);\n var d1 = self.FV/yt, d2 = (1<<self.F1)/yt, e = 1<<self.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?self.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "title": "" }, { "docid": "9fada3c4b543388530fed9a3c0360820", "score": "0.7303301", "text": "function bnpDivRemTo(m,q,r) {\n\t var pm = m.abs();\n\t if(pm.t <= 0) return;\n\t var pt = this.abs();\n\t if(pt.t < pm.t) {\n\t if(q != null) q.fromInt(0);\n\t if(r != null) this.copyTo(r);\n\t return;\n\t }\n\t if(r == null) r = nbi();\n\t var y = nbi(), ts = this.s, ms = m.s;\n\t var nsh = this.DB-nbits(pm.data[pm.t-1]);\t// normalize modulus\n\t if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); }\n\t var ys = y.t;\n\t var y0 = y.data[ys-1];\n\t if(y0 == 0) return;\n\t var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n\t var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n\t var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n\t y.dlShiftTo(j,t);\n\t if(r.compareTo(t) >= 0) {\n\t r.data[r.t++] = 1;\n\t r.subTo(t,r);\n\t }\n\t BigInteger.ONE.dlShiftTo(ys,t);\n\t t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n\t while(y.t < ys) y.data[y.t++] = 0;\n\t while(--j >= 0) {\n\t // Estimate quotient digit\n\t var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n\t if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n\t y.dlShiftTo(j,t);\n\t r.subTo(t,r);\n\t while(r.data[i] < --qd) r.subTo(t,r);\n\t }\n\t }\n\t if(q != null) {\n\t r.drShiftTo(ys,q);\n\t if(ts != ms) BigInteger.ZERO.subTo(q,q);\n\t }\n\t r.t = ys;\n\t r.clamp();\n\t if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n\t if(ts < 0) BigInteger.ZERO.subTo(r,r);\n\t}", "title": "" }, { "docid": "adde954cda44c8aa27400e944654a23e", "score": "0.73022085", "text": "function bnpDivRemTo(m, q, r) {\n var pm = m.abs();\n if (pm.t <= 0) return;\n var pt = this.abs();\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0);\n if (r != null) this.copyTo(r);\n return;\n }\n if (r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB - nbits(pm[pm.t - 1]);\t// normalize modulus\n if (nsh > 0) { pm.lShiftTo(nsh, y); pt.lShiftTo(nsh, r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys - 1];\n if (y0 == 0) return;\n var yt = y0 * (1 << this.F1) + ((ys > 1) ? y[ys - 2] >> this.F2 : 0);\n var d1 = this.FV / yt, d2 = (1 << this.F1) / yt, e = 1 << this.F2;\n var i = r.t, j = i - ys, t = (q == null) ? nbi() : q;\n y.dlShiftTo(j, t);\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t, r);\n }\n BigInteger.ONE.dlShiftTo(ys, t);\n t.subTo(y, y);\t// \"negative\" y so we can replace sub with am later\n while (y.t < ys) y[y.t++] = 0;\n while (--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i] == y0) ? this.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2);\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) {\t// Try it out\n y.dlShiftTo(j, t);\n r.subTo(t, r);\n while (r[i] < --qd) r.subTo(t, r);\n }\n }\n if (q != null) {\n r.drShiftTo(ys, q);\n if (ts != ms) BigInteger.ZERO.subTo(q, q);\n }\n r.t = ys;\n r.clamp();\n if (nsh > 0) r.rShiftTo(nsh, r);\t// Denormalize remainder\n if (ts < 0) BigInteger.ZERO.subTo(r, r);\n }", "title": "" }, { "docid": "65c38fc5f732e2d19d3fd08d6be79784", "score": "0.7294447", "text": "function bnpDivRemTo(m, q, r) {\n var pm = m.abs();\n if (pm.t <= 0) return;\n var pt = this.abs();\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0);\n if (r != null) this.copyTo(r);\n return;\n }\n if (r == null) r = nbi();\n var y = nbi(),\n ts = this.s,\n ms = m.s;\n var nsh = this.DB - nbits(pm[pm.t - 1]); // normalize modulus\n if (nsh > 0) {\n pm.lShiftTo(nsh, y);pt.lShiftTo(nsh, r);\n } else {\n pm.copyTo(y);pt.copyTo(r);\n }\n var ys = y.t;\n var y0 = y[ys - 1];\n if (y0 == 0) return;\n var yt = y0 * (1 << this.F1) + (ys > 1 ? y[ys - 2] >> this.F2 : 0);\n var d1 = this.FV / yt,\n d2 = (1 << this.F1) / yt,\n e = 1 << this.F2;\n var i = r.t,\n j = i - ys,\n t = q == null ? nbi() : q;\n y.dlShiftTo(j, t);\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t, r);\n }\n BigInteger.ONE.dlShiftTo(ys, t);\n t.subTo(y, y); // \"negative\" y so we can replace sub with am later\n while (y.t < ys) y[y.t++] = 0;\n while (--j >= 0) {\n // Estimate quotient digit\n var qd = r[--i] == y0 ? this.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2);\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) {\n // Try it out\n y.dlShiftTo(j, t);\n r.subTo(t, r);\n while (r[i] < --qd) r.subTo(t, r);\n }\n }\n if (q != null) {\n r.drShiftTo(ys, q);\n if (ts != ms) BigInteger.ZERO.subTo(q, q);\n }\n r.t = ys;\n r.clamp();\n if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n if (ts < 0) BigInteger.ZERO.subTo(r, r);\n }", "title": "" }, { "docid": "4f18565327a0e5df7f8207ab0c838a8e", "score": "0.72924936", "text": "function bnpDivRemTo(m,q,r) {\n\t var pm = m.abs();\n\t if(pm.t <= 0) return;\n\t var pt = this.abs();\n\t if(pt.t < pm.t) {\n\t if(q != null) q.fromInt(0);\n\t if(r != null) this.copyTo(r);\n\t return;\n\t }\n\t if(r == null) r = nbi();\n\t var y = nbi(), ts = this.s, ms = m.s;\n\t var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n\t if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n\t else { pm.copyTo(y); pt.copyTo(r); }\n\t var ys = y.t;\n\t var y0 = y[ys-1];\n\t if(y0 == 0) return;\n\t var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n\t var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n\t var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n\t y.dlShiftTo(j,t);\n\t if(r.compareTo(t) >= 0) {\n\t r[r.t++] = 1;\n\t r.subTo(t,r);\n\t }\n\t BigInteger.ONE.dlShiftTo(ys,t);\n\t t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n\t while(y.t < ys) y[y.t++] = 0;\n\t while(--j >= 0) {\n\t // Estimate quotient digit\n\t var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n\t if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n\t y.dlShiftTo(j,t);\n\t r.subTo(t,r);\n\t while(r[i] < --qd) r.subTo(t,r);\n\t }\n\t }\n\t if(q != null) {\n\t r.drShiftTo(ys,q);\n\t if(ts != ms) BigInteger.ZERO.subTo(q,q);\n\t }\n\t r.t = ys;\n\t r.clamp();\n\t if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n\t if(ts < 0) BigInteger.ZERO.subTo(r,r);\n\t }", "title": "" }, { "docid": "4f18565327a0e5df7f8207ab0c838a8e", "score": "0.72924936", "text": "function bnpDivRemTo(m,q,r) {\n\t var pm = m.abs();\n\t if(pm.t <= 0) return;\n\t var pt = this.abs();\n\t if(pt.t < pm.t) {\n\t if(q != null) q.fromInt(0);\n\t if(r != null) this.copyTo(r);\n\t return;\n\t }\n\t if(r == null) r = nbi();\n\t var y = nbi(), ts = this.s, ms = m.s;\n\t var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n\t if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n\t else { pm.copyTo(y); pt.copyTo(r); }\n\t var ys = y.t;\n\t var y0 = y[ys-1];\n\t if(y0 == 0) return;\n\t var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n\t var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n\t var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n\t y.dlShiftTo(j,t);\n\t if(r.compareTo(t) >= 0) {\n\t r[r.t++] = 1;\n\t r.subTo(t,r);\n\t }\n\t BigInteger.ONE.dlShiftTo(ys,t);\n\t t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n\t while(y.t < ys) y[y.t++] = 0;\n\t while(--j >= 0) {\n\t // Estimate quotient digit\n\t var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n\t if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n\t y.dlShiftTo(j,t);\n\t r.subTo(t,r);\n\t while(r[i] < --qd) r.subTo(t,r);\n\t }\n\t }\n\t if(q != null) {\n\t r.drShiftTo(ys,q);\n\t if(ts != ms) BigInteger.ZERO.subTo(q,q);\n\t }\n\t r.t = ys;\n\t r.clamp();\n\t if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n\t if(ts < 0) BigInteger.ZERO.subTo(r,r);\n\t }", "title": "" }, { "docid": "4f18565327a0e5df7f8207ab0c838a8e", "score": "0.72924936", "text": "function bnpDivRemTo(m,q,r) {\n\t var pm = m.abs();\n\t if(pm.t <= 0) return;\n\t var pt = this.abs();\n\t if(pt.t < pm.t) {\n\t if(q != null) q.fromInt(0);\n\t if(r != null) this.copyTo(r);\n\t return;\n\t }\n\t if(r == null) r = nbi();\n\t var y = nbi(), ts = this.s, ms = m.s;\n\t var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n\t if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n\t else { pm.copyTo(y); pt.copyTo(r); }\n\t var ys = y.t;\n\t var y0 = y[ys-1];\n\t if(y0 == 0) return;\n\t var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n\t var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n\t var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n\t y.dlShiftTo(j,t);\n\t if(r.compareTo(t) >= 0) {\n\t r[r.t++] = 1;\n\t r.subTo(t,r);\n\t }\n\t BigInteger.ONE.dlShiftTo(ys,t);\n\t t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n\t while(y.t < ys) y[y.t++] = 0;\n\t while(--j >= 0) {\n\t // Estimate quotient digit\n\t var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n\t if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n\t y.dlShiftTo(j,t);\n\t r.subTo(t,r);\n\t while(r[i] < --qd) r.subTo(t,r);\n\t }\n\t }\n\t if(q != null) {\n\t r.drShiftTo(ys,q);\n\t if(ts != ms) BigInteger.ZERO.subTo(q,q);\n\t }\n\t r.t = ys;\n\t r.clamp();\n\t if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n\t if(ts < 0) BigInteger.ZERO.subTo(r,r);\n\t }", "title": "" }, { "docid": "4f18565327a0e5df7f8207ab0c838a8e", "score": "0.72924936", "text": "function bnpDivRemTo(m,q,r) {\n\t var pm = m.abs();\n\t if(pm.t <= 0) return;\n\t var pt = this.abs();\n\t if(pt.t < pm.t) {\n\t if(q != null) q.fromInt(0);\n\t if(r != null) this.copyTo(r);\n\t return;\n\t }\n\t if(r == null) r = nbi();\n\t var y = nbi(), ts = this.s, ms = m.s;\n\t var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n\t if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n\t else { pm.copyTo(y); pt.copyTo(r); }\n\t var ys = y.t;\n\t var y0 = y[ys-1];\n\t if(y0 == 0) return;\n\t var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n\t var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n\t var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n\t y.dlShiftTo(j,t);\n\t if(r.compareTo(t) >= 0) {\n\t r[r.t++] = 1;\n\t r.subTo(t,r);\n\t }\n\t BigInteger.ONE.dlShiftTo(ys,t);\n\t t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n\t while(y.t < ys) y[y.t++] = 0;\n\t while(--j >= 0) {\n\t // Estimate quotient digit\n\t var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n\t if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n\t y.dlShiftTo(j,t);\n\t r.subTo(t,r);\n\t while(r[i] < --qd) r.subTo(t,r);\n\t }\n\t }\n\t if(q != null) {\n\t r.drShiftTo(ys,q);\n\t if(ts != ms) BigInteger.ZERO.subTo(q,q);\n\t }\n\t r.t = ys;\n\t r.clamp();\n\t if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n\t if(ts < 0) BigInteger.ZERO.subTo(r,r);\n\t }", "title": "" }, { "docid": "4f18565327a0e5df7f8207ab0c838a8e", "score": "0.72924936", "text": "function bnpDivRemTo(m,q,r) {\n\t var pm = m.abs();\n\t if(pm.t <= 0) return;\n\t var pt = this.abs();\n\t if(pt.t < pm.t) {\n\t if(q != null) q.fromInt(0);\n\t if(r != null) this.copyTo(r);\n\t return;\n\t }\n\t if(r == null) r = nbi();\n\t var y = nbi(), ts = this.s, ms = m.s;\n\t var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n\t if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n\t else { pm.copyTo(y); pt.copyTo(r); }\n\t var ys = y.t;\n\t var y0 = y[ys-1];\n\t if(y0 == 0) return;\n\t var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n\t var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n\t var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n\t y.dlShiftTo(j,t);\n\t if(r.compareTo(t) >= 0) {\n\t r[r.t++] = 1;\n\t r.subTo(t,r);\n\t }\n\t BigInteger.ONE.dlShiftTo(ys,t);\n\t t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n\t while(y.t < ys) y[y.t++] = 0;\n\t while(--j >= 0) {\n\t // Estimate quotient digit\n\t var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n\t if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n\t y.dlShiftTo(j,t);\n\t r.subTo(t,r);\n\t while(r[i] < --qd) r.subTo(t,r);\n\t }\n\t }\n\t if(q != null) {\n\t r.drShiftTo(ys,q);\n\t if(ts != ms) BigInteger.ZERO.subTo(q,q);\n\t }\n\t r.t = ys;\n\t r.clamp();\n\t if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n\t if(ts < 0) BigInteger.ZERO.subTo(r,r);\n\t }", "title": "" }, { "docid": "6613a46fbf46427d5dfcd7547f522993", "score": "0.7287951", "text": "function bnpDivRemTo(m, q, r) {\n var pm = m.abs();\n if (pm.t <= 0) return;\n var pt = this.abs();\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0);\n if (r != null) this.copyTo(r);\n return;\n }\n if (r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB - nbits(pm[pm.t - 1]); // normalize modulus\n if (nsh > 0) {\n pm.lShiftTo(nsh, y);\n pt.lShiftTo(nsh, r);\n }\n else {\n pm.copyTo(y);\n pt.copyTo(r);\n }\n var ys = y.t;\n var y0 = y[ys - 1];\n if (y0 == 0) return;\n var yt = y0 * (1 << this.F1) + ((ys > 1) ? y[ys - 2] >> this.F2 : 0);\n var d1 = this.FV / yt, d2 = (1 << this.F1) / yt, e = 1 << this.F2;\n var i = r.t, j = i - ys, t = (q == null) ? nbi() : q;\n y.dlShiftTo(j, t);\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t, r);\n }\n BigInteger.ONE.dlShiftTo(ys, t);\n t.subTo(y, y); // \"negative\" y so we can replace sub with am later\n while (y.t < ys) y[y.t++] = 0;\n while (--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i] == y0) ? this.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2);\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) { // Try it out\n y.dlShiftTo(j, t);\n r.subTo(t, r);\n while (r[i] < --qd) r.subTo(t, r);\n }\n }\n if (q != null) {\n r.drShiftTo(ys, q);\n if (ts != ms) BigInteger.ZERO.subTo(q, q);\n }\n r.t = ys;\n r.clamp();\n if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n if (ts < 0) BigInteger.ZERO.subTo(r, r);\n }", "title": "" }, { "docid": "df699ff95deadb13d16b38cae1f8d166", "score": "0.7284825", "text": "function bnpDivRemTo(m, q, r) {\n var self = this\n var pm = m.abs()\n if (pm.t <= 0) return\n var pt = self.abs()\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0)\n if (r != null) self.copyTo(r)\n return\n }\n if (r == null) r = new BigInteger()\n var y = new BigInteger(),\n ts = self.s,\n ms = m.s\n var nsh = self.DB - nbits(pm[pm.t - 1]); // normalize modulus\n if (nsh > 0) {\n pm.lShiftTo(nsh, y)\n pt.lShiftTo(nsh, r)\n } else {\n pm.copyTo(y)\n pt.copyTo(r)\n }\n var ys = y.t\n var y0 = y[ys - 1]\n if (y0 == 0) return\n var yt = y0 * (1 << self.F1) + ((ys > 1) ? y[ys - 2] >> self.F2 : 0)\n var d1 = self.FV / yt,\n d2 = (1 << self.F1) / yt,\n e = 1 << self.F2\n var i = r.t,\n j = i - ys,\n t = (q == null) ? new BigInteger() : q\n y.dlShiftTo(j, t)\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1\n r.subTo(t, r)\n }\n BigInteger.ONE.dlShiftTo(ys, t)\n t.subTo(y, y); // \"negative\" y so we can replace sub with am later\n while (y.t < ys) y[y.t++] = 0\n while (--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i] == y0) ? self.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2)\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) { // Try it out\n y.dlShiftTo(j, t)\n r.subTo(t, r)\n while (r[i] < --qd) r.subTo(t, r)\n }\n }\n if (q != null) {\n r.drShiftTo(ys, q)\n if (ts != ms) BigInteger.ZERO.subTo(q, q)\n }\n r.t = ys\n r.clamp()\n if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n if (ts < 0) BigInteger.ZERO.subTo(r, r)\n}", "title": "" }, { "docid": "df699ff95deadb13d16b38cae1f8d166", "score": "0.7284825", "text": "function bnpDivRemTo(m, q, r) {\n var self = this\n var pm = m.abs()\n if (pm.t <= 0) return\n var pt = self.abs()\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0)\n if (r != null) self.copyTo(r)\n return\n }\n if (r == null) r = new BigInteger()\n var y = new BigInteger(),\n ts = self.s,\n ms = m.s\n var nsh = self.DB - nbits(pm[pm.t - 1]); // normalize modulus\n if (nsh > 0) {\n pm.lShiftTo(nsh, y)\n pt.lShiftTo(nsh, r)\n } else {\n pm.copyTo(y)\n pt.copyTo(r)\n }\n var ys = y.t\n var y0 = y[ys - 1]\n if (y0 == 0) return\n var yt = y0 * (1 << self.F1) + ((ys > 1) ? y[ys - 2] >> self.F2 : 0)\n var d1 = self.FV / yt,\n d2 = (1 << self.F1) / yt,\n e = 1 << self.F2\n var i = r.t,\n j = i - ys,\n t = (q == null) ? new BigInteger() : q\n y.dlShiftTo(j, t)\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1\n r.subTo(t, r)\n }\n BigInteger.ONE.dlShiftTo(ys, t)\n t.subTo(y, y); // \"negative\" y so we can replace sub with am later\n while (y.t < ys) y[y.t++] = 0\n while (--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i] == y0) ? self.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2)\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) { // Try it out\n y.dlShiftTo(j, t)\n r.subTo(t, r)\n while (r[i] < --qd) r.subTo(t, r)\n }\n }\n if (q != null) {\n r.drShiftTo(ys, q)\n if (ts != ms) BigInteger.ZERO.subTo(q, q)\n }\n r.t = ys\n r.clamp()\n if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n if (ts < 0) BigInteger.ZERO.subTo(r, r)\n}", "title": "" }, { "docid": "df699ff95deadb13d16b38cae1f8d166", "score": "0.7284825", "text": "function bnpDivRemTo(m, q, r) {\n var self = this\n var pm = m.abs()\n if (pm.t <= 0) return\n var pt = self.abs()\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0)\n if (r != null) self.copyTo(r)\n return\n }\n if (r == null) r = new BigInteger()\n var y = new BigInteger(),\n ts = self.s,\n ms = m.s\n var nsh = self.DB - nbits(pm[pm.t - 1]); // normalize modulus\n if (nsh > 0) {\n pm.lShiftTo(nsh, y)\n pt.lShiftTo(nsh, r)\n } else {\n pm.copyTo(y)\n pt.copyTo(r)\n }\n var ys = y.t\n var y0 = y[ys - 1]\n if (y0 == 0) return\n var yt = y0 * (1 << self.F1) + ((ys > 1) ? y[ys - 2] >> self.F2 : 0)\n var d1 = self.FV / yt,\n d2 = (1 << self.F1) / yt,\n e = 1 << self.F2\n var i = r.t,\n j = i - ys,\n t = (q == null) ? new BigInteger() : q\n y.dlShiftTo(j, t)\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1\n r.subTo(t, r)\n }\n BigInteger.ONE.dlShiftTo(ys, t)\n t.subTo(y, y); // \"negative\" y so we can replace sub with am later\n while (y.t < ys) y[y.t++] = 0\n while (--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i] == y0) ? self.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2)\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) { // Try it out\n y.dlShiftTo(j, t)\n r.subTo(t, r)\n while (r[i] < --qd) r.subTo(t, r)\n }\n }\n if (q != null) {\n r.drShiftTo(ys, q)\n if (ts != ms) BigInteger.ZERO.subTo(q, q)\n }\n r.t = ys\n r.clamp()\n if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n if (ts < 0) BigInteger.ZERO.subTo(r, r)\n}", "title": "" }, { "docid": "df699ff95deadb13d16b38cae1f8d166", "score": "0.7284825", "text": "function bnpDivRemTo(m, q, r) {\n var self = this\n var pm = m.abs()\n if (pm.t <= 0) return\n var pt = self.abs()\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0)\n if (r != null) self.copyTo(r)\n return\n }\n if (r == null) r = new BigInteger()\n var y = new BigInteger(),\n ts = self.s,\n ms = m.s\n var nsh = self.DB - nbits(pm[pm.t - 1]); // normalize modulus\n if (nsh > 0) {\n pm.lShiftTo(nsh, y)\n pt.lShiftTo(nsh, r)\n } else {\n pm.copyTo(y)\n pt.copyTo(r)\n }\n var ys = y.t\n var y0 = y[ys - 1]\n if (y0 == 0) return\n var yt = y0 * (1 << self.F1) + ((ys > 1) ? y[ys - 2] >> self.F2 : 0)\n var d1 = self.FV / yt,\n d2 = (1 << self.F1) / yt,\n e = 1 << self.F2\n var i = r.t,\n j = i - ys,\n t = (q == null) ? new BigInteger() : q\n y.dlShiftTo(j, t)\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1\n r.subTo(t, r)\n }\n BigInteger.ONE.dlShiftTo(ys, t)\n t.subTo(y, y); // \"negative\" y so we can replace sub with am later\n while (y.t < ys) y[y.t++] = 0\n while (--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i] == y0) ? self.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2)\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) { // Try it out\n y.dlShiftTo(j, t)\n r.subTo(t, r)\n while (r[i] < --qd) r.subTo(t, r)\n }\n }\n if (q != null) {\n r.drShiftTo(ys, q)\n if (ts != ms) BigInteger.ZERO.subTo(q, q)\n }\n r.t = ys\n r.clamp()\n if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n if (ts < 0) BigInteger.ZERO.subTo(r, r)\n}", "title": "" }, { "docid": "df699ff95deadb13d16b38cae1f8d166", "score": "0.7284825", "text": "function bnpDivRemTo(m, q, r) {\n var self = this\n var pm = m.abs()\n if (pm.t <= 0) return\n var pt = self.abs()\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0)\n if (r != null) self.copyTo(r)\n return\n }\n if (r == null) r = new BigInteger()\n var y = new BigInteger(),\n ts = self.s,\n ms = m.s\n var nsh = self.DB - nbits(pm[pm.t - 1]); // normalize modulus\n if (nsh > 0) {\n pm.lShiftTo(nsh, y)\n pt.lShiftTo(nsh, r)\n } else {\n pm.copyTo(y)\n pt.copyTo(r)\n }\n var ys = y.t\n var y0 = y[ys - 1]\n if (y0 == 0) return\n var yt = y0 * (1 << self.F1) + ((ys > 1) ? y[ys - 2] >> self.F2 : 0)\n var d1 = self.FV / yt,\n d2 = (1 << self.F1) / yt,\n e = 1 << self.F2\n var i = r.t,\n j = i - ys,\n t = (q == null) ? new BigInteger() : q\n y.dlShiftTo(j, t)\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1\n r.subTo(t, r)\n }\n BigInteger.ONE.dlShiftTo(ys, t)\n t.subTo(y, y); // \"negative\" y so we can replace sub with am later\n while (y.t < ys) y[y.t++] = 0\n while (--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i] == y0) ? self.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2)\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) { // Try it out\n y.dlShiftTo(j, t)\n r.subTo(t, r)\n while (r[i] < --qd) r.subTo(t, r)\n }\n }\n if (q != null) {\n r.drShiftTo(ys, q)\n if (ts != ms) BigInteger.ZERO.subTo(q, q)\n }\n r.t = ys\n r.clamp()\n if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n if (ts < 0) BigInteger.ZERO.subTo(r, r)\n}", "title": "" }, { "docid": "df699ff95deadb13d16b38cae1f8d166", "score": "0.7284825", "text": "function bnpDivRemTo(m, q, r) {\n var self = this\n var pm = m.abs()\n if (pm.t <= 0) return\n var pt = self.abs()\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0)\n if (r != null) self.copyTo(r)\n return\n }\n if (r == null) r = new BigInteger()\n var y = new BigInteger(),\n ts = self.s,\n ms = m.s\n var nsh = self.DB - nbits(pm[pm.t - 1]); // normalize modulus\n if (nsh > 0) {\n pm.lShiftTo(nsh, y)\n pt.lShiftTo(nsh, r)\n } else {\n pm.copyTo(y)\n pt.copyTo(r)\n }\n var ys = y.t\n var y0 = y[ys - 1]\n if (y0 == 0) return\n var yt = y0 * (1 << self.F1) + ((ys > 1) ? y[ys - 2] >> self.F2 : 0)\n var d1 = self.FV / yt,\n d2 = (1 << self.F1) / yt,\n e = 1 << self.F2\n var i = r.t,\n j = i - ys,\n t = (q == null) ? new BigInteger() : q\n y.dlShiftTo(j, t)\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1\n r.subTo(t, r)\n }\n BigInteger.ONE.dlShiftTo(ys, t)\n t.subTo(y, y); // \"negative\" y so we can replace sub with am later\n while (y.t < ys) y[y.t++] = 0\n while (--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i] == y0) ? self.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2)\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) { // Try it out\n y.dlShiftTo(j, t)\n r.subTo(t, r)\n while (r[i] < --qd) r.subTo(t, r)\n }\n }\n if (q != null) {\n r.drShiftTo(ys, q)\n if (ts != ms) BigInteger.ZERO.subTo(q, q)\n }\n r.t = ys\n r.clamp()\n if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n if (ts < 0) BigInteger.ZERO.subTo(r, r)\n}", "title": "" }, { "docid": "df699ff95deadb13d16b38cae1f8d166", "score": "0.7284825", "text": "function bnpDivRemTo(m, q, r) {\n var self = this\n var pm = m.abs()\n if (pm.t <= 0) return\n var pt = self.abs()\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0)\n if (r != null) self.copyTo(r)\n return\n }\n if (r == null) r = new BigInteger()\n var y = new BigInteger(),\n ts = self.s,\n ms = m.s\n var nsh = self.DB - nbits(pm[pm.t - 1]); // normalize modulus\n if (nsh > 0) {\n pm.lShiftTo(nsh, y)\n pt.lShiftTo(nsh, r)\n } else {\n pm.copyTo(y)\n pt.copyTo(r)\n }\n var ys = y.t\n var y0 = y[ys - 1]\n if (y0 == 0) return\n var yt = y0 * (1 << self.F1) + ((ys > 1) ? y[ys - 2] >> self.F2 : 0)\n var d1 = self.FV / yt,\n d2 = (1 << self.F1) / yt,\n e = 1 << self.F2\n var i = r.t,\n j = i - ys,\n t = (q == null) ? new BigInteger() : q\n y.dlShiftTo(j, t)\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1\n r.subTo(t, r)\n }\n BigInteger.ONE.dlShiftTo(ys, t)\n t.subTo(y, y); // \"negative\" y so we can replace sub with am later\n while (y.t < ys) y[y.t++] = 0\n while (--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i] == y0) ? self.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2)\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) { // Try it out\n y.dlShiftTo(j, t)\n r.subTo(t, r)\n while (r[i] < --qd) r.subTo(t, r)\n }\n }\n if (q != null) {\n r.drShiftTo(ys, q)\n if (ts != ms) BigInteger.ZERO.subTo(q, q)\n }\n r.t = ys\n r.clamp()\n if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n if (ts < 0) BigInteger.ZERO.subTo(r, r)\n}", "title": "" }, { "docid": "df699ff95deadb13d16b38cae1f8d166", "score": "0.7284825", "text": "function bnpDivRemTo(m, q, r) {\n var self = this\n var pm = m.abs()\n if (pm.t <= 0) return\n var pt = self.abs()\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0)\n if (r != null) self.copyTo(r)\n return\n }\n if (r == null) r = new BigInteger()\n var y = new BigInteger(),\n ts = self.s,\n ms = m.s\n var nsh = self.DB - nbits(pm[pm.t - 1]); // normalize modulus\n if (nsh > 0) {\n pm.lShiftTo(nsh, y)\n pt.lShiftTo(nsh, r)\n } else {\n pm.copyTo(y)\n pt.copyTo(r)\n }\n var ys = y.t\n var y0 = y[ys - 1]\n if (y0 == 0) return\n var yt = y0 * (1 << self.F1) + ((ys > 1) ? y[ys - 2] >> self.F2 : 0)\n var d1 = self.FV / yt,\n d2 = (1 << self.F1) / yt,\n e = 1 << self.F2\n var i = r.t,\n j = i - ys,\n t = (q == null) ? new BigInteger() : q\n y.dlShiftTo(j, t)\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1\n r.subTo(t, r)\n }\n BigInteger.ONE.dlShiftTo(ys, t)\n t.subTo(y, y); // \"negative\" y so we can replace sub with am later\n while (y.t < ys) y[y.t++] = 0\n while (--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i] == y0) ? self.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2)\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) { // Try it out\n y.dlShiftTo(j, t)\n r.subTo(t, r)\n while (r[i] < --qd) r.subTo(t, r)\n }\n }\n if (q != null) {\n r.drShiftTo(ys, q)\n if (ts != ms) BigInteger.ZERO.subTo(q, q)\n }\n r.t = ys\n r.clamp()\n if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n if (ts < 0) BigInteger.ZERO.subTo(r, r)\n}", "title": "" }, { "docid": "df699ff95deadb13d16b38cae1f8d166", "score": "0.7284825", "text": "function bnpDivRemTo(m, q, r) {\n var self = this\n var pm = m.abs()\n if (pm.t <= 0) return\n var pt = self.abs()\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0)\n if (r != null) self.copyTo(r)\n return\n }\n if (r == null) r = new BigInteger()\n var y = new BigInteger(),\n ts = self.s,\n ms = m.s\n var nsh = self.DB - nbits(pm[pm.t - 1]); // normalize modulus\n if (nsh > 0) {\n pm.lShiftTo(nsh, y)\n pt.lShiftTo(nsh, r)\n } else {\n pm.copyTo(y)\n pt.copyTo(r)\n }\n var ys = y.t\n var y0 = y[ys - 1]\n if (y0 == 0) return\n var yt = y0 * (1 << self.F1) + ((ys > 1) ? y[ys - 2] >> self.F2 : 0)\n var d1 = self.FV / yt,\n d2 = (1 << self.F1) / yt,\n e = 1 << self.F2\n var i = r.t,\n j = i - ys,\n t = (q == null) ? new BigInteger() : q\n y.dlShiftTo(j, t)\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1\n r.subTo(t, r)\n }\n BigInteger.ONE.dlShiftTo(ys, t)\n t.subTo(y, y); // \"negative\" y so we can replace sub with am later\n while (y.t < ys) y[y.t++] = 0\n while (--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i] == y0) ? self.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2)\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) { // Try it out\n y.dlShiftTo(j, t)\n r.subTo(t, r)\n while (r[i] < --qd) r.subTo(t, r)\n }\n }\n if (q != null) {\n r.drShiftTo(ys, q)\n if (ts != ms) BigInteger.ZERO.subTo(q, q)\n }\n r.t = ys\n r.clamp()\n if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n if (ts < 0) BigInteger.ZERO.subTo(r, r)\n}", "title": "" }, { "docid": "df699ff95deadb13d16b38cae1f8d166", "score": "0.7284825", "text": "function bnpDivRemTo(m, q, r) {\n var self = this\n var pm = m.abs()\n if (pm.t <= 0) return\n var pt = self.abs()\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0)\n if (r != null) self.copyTo(r)\n return\n }\n if (r == null) r = new BigInteger()\n var y = new BigInteger(),\n ts = self.s,\n ms = m.s\n var nsh = self.DB - nbits(pm[pm.t - 1]); // normalize modulus\n if (nsh > 0) {\n pm.lShiftTo(nsh, y)\n pt.lShiftTo(nsh, r)\n } else {\n pm.copyTo(y)\n pt.copyTo(r)\n }\n var ys = y.t\n var y0 = y[ys - 1]\n if (y0 == 0) return\n var yt = y0 * (1 << self.F1) + ((ys > 1) ? y[ys - 2] >> self.F2 : 0)\n var d1 = self.FV / yt,\n d2 = (1 << self.F1) / yt,\n e = 1 << self.F2\n var i = r.t,\n j = i - ys,\n t = (q == null) ? new BigInteger() : q\n y.dlShiftTo(j, t)\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1\n r.subTo(t, r)\n }\n BigInteger.ONE.dlShiftTo(ys, t)\n t.subTo(y, y); // \"negative\" y so we can replace sub with am later\n while (y.t < ys) y[y.t++] = 0\n while (--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i] == y0) ? self.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2)\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) { // Try it out\n y.dlShiftTo(j, t)\n r.subTo(t, r)\n while (r[i] < --qd) r.subTo(t, r)\n }\n }\n if (q != null) {\n r.drShiftTo(ys, q)\n if (ts != ms) BigInteger.ZERO.subTo(q, q)\n }\n r.t = ys\n r.clamp()\n if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n if (ts < 0) BigInteger.ZERO.subTo(r, r)\n}", "title": "" }, { "docid": "df699ff95deadb13d16b38cae1f8d166", "score": "0.7284825", "text": "function bnpDivRemTo(m, q, r) {\n var self = this\n var pm = m.abs()\n if (pm.t <= 0) return\n var pt = self.abs()\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0)\n if (r != null) self.copyTo(r)\n return\n }\n if (r == null) r = new BigInteger()\n var y = new BigInteger(),\n ts = self.s,\n ms = m.s\n var nsh = self.DB - nbits(pm[pm.t - 1]); // normalize modulus\n if (nsh > 0) {\n pm.lShiftTo(nsh, y)\n pt.lShiftTo(nsh, r)\n } else {\n pm.copyTo(y)\n pt.copyTo(r)\n }\n var ys = y.t\n var y0 = y[ys - 1]\n if (y0 == 0) return\n var yt = y0 * (1 << self.F1) + ((ys > 1) ? y[ys - 2] >> self.F2 : 0)\n var d1 = self.FV / yt,\n d2 = (1 << self.F1) / yt,\n e = 1 << self.F2\n var i = r.t,\n j = i - ys,\n t = (q == null) ? new BigInteger() : q\n y.dlShiftTo(j, t)\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1\n r.subTo(t, r)\n }\n BigInteger.ONE.dlShiftTo(ys, t)\n t.subTo(y, y); // \"negative\" y so we can replace sub with am later\n while (y.t < ys) y[y.t++] = 0\n while (--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i] == y0) ? self.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2)\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) { // Try it out\n y.dlShiftTo(j, t)\n r.subTo(t, r)\n while (r[i] < --qd) r.subTo(t, r)\n }\n }\n if (q != null) {\n r.drShiftTo(ys, q)\n if (ts != ms) BigInteger.ZERO.subTo(q, q)\n }\n r.t = ys\n r.clamp()\n if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n if (ts < 0) BigInteger.ZERO.subTo(r, r)\n}", "title": "" }, { "docid": "df699ff95deadb13d16b38cae1f8d166", "score": "0.7284825", "text": "function bnpDivRemTo(m, q, r) {\n var self = this\n var pm = m.abs()\n if (pm.t <= 0) return\n var pt = self.abs()\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0)\n if (r != null) self.copyTo(r)\n return\n }\n if (r == null) r = new BigInteger()\n var y = new BigInteger(),\n ts = self.s,\n ms = m.s\n var nsh = self.DB - nbits(pm[pm.t - 1]); // normalize modulus\n if (nsh > 0) {\n pm.lShiftTo(nsh, y)\n pt.lShiftTo(nsh, r)\n } else {\n pm.copyTo(y)\n pt.copyTo(r)\n }\n var ys = y.t\n var y0 = y[ys - 1]\n if (y0 == 0) return\n var yt = y0 * (1 << self.F1) + ((ys > 1) ? y[ys - 2] >> self.F2 : 0)\n var d1 = self.FV / yt,\n d2 = (1 << self.F1) / yt,\n e = 1 << self.F2\n var i = r.t,\n j = i - ys,\n t = (q == null) ? new BigInteger() : q\n y.dlShiftTo(j, t)\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1\n r.subTo(t, r)\n }\n BigInteger.ONE.dlShiftTo(ys, t)\n t.subTo(y, y); // \"negative\" y so we can replace sub with am later\n while (y.t < ys) y[y.t++] = 0\n while (--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i] == y0) ? self.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2)\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) { // Try it out\n y.dlShiftTo(j, t)\n r.subTo(t, r)\n while (r[i] < --qd) r.subTo(t, r)\n }\n }\n if (q != null) {\n r.drShiftTo(ys, q)\n if (ts != ms) BigInteger.ZERO.subTo(q, q)\n }\n r.t = ys\n r.clamp()\n if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n if (ts < 0) BigInteger.ZERO.subTo(r, r)\n}", "title": "" }, { "docid": "df699ff95deadb13d16b38cae1f8d166", "score": "0.7284825", "text": "function bnpDivRemTo(m, q, r) {\n var self = this\n var pm = m.abs()\n if (pm.t <= 0) return\n var pt = self.abs()\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0)\n if (r != null) self.copyTo(r)\n return\n }\n if (r == null) r = new BigInteger()\n var y = new BigInteger(),\n ts = self.s,\n ms = m.s\n var nsh = self.DB - nbits(pm[pm.t - 1]); // normalize modulus\n if (nsh > 0) {\n pm.lShiftTo(nsh, y)\n pt.lShiftTo(nsh, r)\n } else {\n pm.copyTo(y)\n pt.copyTo(r)\n }\n var ys = y.t\n var y0 = y[ys - 1]\n if (y0 == 0) return\n var yt = y0 * (1 << self.F1) + ((ys > 1) ? y[ys - 2] >> self.F2 : 0)\n var d1 = self.FV / yt,\n d2 = (1 << self.F1) / yt,\n e = 1 << self.F2\n var i = r.t,\n j = i - ys,\n t = (q == null) ? new BigInteger() : q\n y.dlShiftTo(j, t)\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1\n r.subTo(t, r)\n }\n BigInteger.ONE.dlShiftTo(ys, t)\n t.subTo(y, y); // \"negative\" y so we can replace sub with am later\n while (y.t < ys) y[y.t++] = 0\n while (--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i] == y0) ? self.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2)\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) { // Try it out\n y.dlShiftTo(j, t)\n r.subTo(t, r)\n while (r[i] < --qd) r.subTo(t, r)\n }\n }\n if (q != null) {\n r.drShiftTo(ys, q)\n if (ts != ms) BigInteger.ZERO.subTo(q, q)\n }\n r.t = ys\n r.clamp()\n if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n if (ts < 0) BigInteger.ZERO.subTo(r, r)\n}", "title": "" }, { "docid": "df699ff95deadb13d16b38cae1f8d166", "score": "0.7284825", "text": "function bnpDivRemTo(m, q, r) {\n var self = this\n var pm = m.abs()\n if (pm.t <= 0) return\n var pt = self.abs()\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0)\n if (r != null) self.copyTo(r)\n return\n }\n if (r == null) r = new BigInteger()\n var y = new BigInteger(),\n ts = self.s,\n ms = m.s\n var nsh = self.DB - nbits(pm[pm.t - 1]); // normalize modulus\n if (nsh > 0) {\n pm.lShiftTo(nsh, y)\n pt.lShiftTo(nsh, r)\n } else {\n pm.copyTo(y)\n pt.copyTo(r)\n }\n var ys = y.t\n var y0 = y[ys - 1]\n if (y0 == 0) return\n var yt = y0 * (1 << self.F1) + ((ys > 1) ? y[ys - 2] >> self.F2 : 0)\n var d1 = self.FV / yt,\n d2 = (1 << self.F1) / yt,\n e = 1 << self.F2\n var i = r.t,\n j = i - ys,\n t = (q == null) ? new BigInteger() : q\n y.dlShiftTo(j, t)\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1\n r.subTo(t, r)\n }\n BigInteger.ONE.dlShiftTo(ys, t)\n t.subTo(y, y); // \"negative\" y so we can replace sub with am later\n while (y.t < ys) y[y.t++] = 0\n while (--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i] == y0) ? self.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2)\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) { // Try it out\n y.dlShiftTo(j, t)\n r.subTo(t, r)\n while (r[i] < --qd) r.subTo(t, r)\n }\n }\n if (q != null) {\n r.drShiftTo(ys, q)\n if (ts != ms) BigInteger.ZERO.subTo(q, q)\n }\n r.t = ys\n r.clamp()\n if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n if (ts < 0) BigInteger.ZERO.subTo(r, r)\n}", "title": "" }, { "docid": "f8ccb2f3da47cc732ff9eb33c38f4299", "score": "0.7281665", "text": "function bnpDivRemTo(m, q, r) {\n var pm = m.abs();\n if (pm.t <= 0) return;\n var pt = this.abs();\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0);\n if (r != null) this.copyTo(r);\n return;\n }\n if (r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB - nbits(pm[pm.t - 1]); // normalize modulus\n if (nsh > 0) { pm.lShiftTo(nsh, y); pt.lShiftTo(nsh, r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys - 1];\n if (y0 == 0) return;\n var yt = y0 * (1 << this.F1) + ((ys > 1) ? y[ys - 2] >> this.F2 : 0);\n var d1 = this.FV / yt, d2 = (1 << this.F1) / yt, e = 1 << this.F2;\n var i = r.t, j = i - ys, t = (q == null) ? nbi() : q;\n y.dlShiftTo(j, t);\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t, r);\n }\n BigInteger.ONE.dlShiftTo(ys, t);\n t.subTo(y, y); // \"negative\" y so we can replace sub with am later\n while (y.t < ys) y[y.t++] = 0;\n while (--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i] == y0) ? this.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2);\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) { // Try it out\n y.dlShiftTo(j, t);\n r.subTo(t, r);\n while (r[i] < --qd) r.subTo(t, r);\n }\n }\n if (q != null) {\n r.drShiftTo(ys, q);\n if (ts != ms) BigInteger.ZERO.subTo(q, q);\n }\n r.t = ys;\n r.clamp();\n if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n if (ts < 0) BigInteger.ZERO.subTo(r, r);\n }", "title": "" }, { "docid": "f8ccb2f3da47cc732ff9eb33c38f4299", "score": "0.7281665", "text": "function bnpDivRemTo(m, q, r) {\n var pm = m.abs();\n if (pm.t <= 0) return;\n var pt = this.abs();\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0);\n if (r != null) this.copyTo(r);\n return;\n }\n if (r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB - nbits(pm[pm.t - 1]); // normalize modulus\n if (nsh > 0) { pm.lShiftTo(nsh, y); pt.lShiftTo(nsh, r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys - 1];\n if (y0 == 0) return;\n var yt = y0 * (1 << this.F1) + ((ys > 1) ? y[ys - 2] >> this.F2 : 0);\n var d1 = this.FV / yt, d2 = (1 << this.F1) / yt, e = 1 << this.F2;\n var i = r.t, j = i - ys, t = (q == null) ? nbi() : q;\n y.dlShiftTo(j, t);\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t, r);\n }\n BigInteger.ONE.dlShiftTo(ys, t);\n t.subTo(y, y); // \"negative\" y so we can replace sub with am later\n while (y.t < ys) y[y.t++] = 0;\n while (--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i] == y0) ? this.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2);\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) { // Try it out\n y.dlShiftTo(j, t);\n r.subTo(t, r);\n while (r[i] < --qd) r.subTo(t, r);\n }\n }\n if (q != null) {\n r.drShiftTo(ys, q);\n if (ts != ms) BigInteger.ZERO.subTo(q, q);\n }\n r.t = ys;\n r.clamp();\n if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n if (ts < 0) BigInteger.ZERO.subTo(r, r);\n }", "title": "" }, { "docid": "f8ccb2f3da47cc732ff9eb33c38f4299", "score": "0.7281665", "text": "function bnpDivRemTo(m, q, r) {\n var pm = m.abs();\n if (pm.t <= 0) return;\n var pt = this.abs();\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0);\n if (r != null) this.copyTo(r);\n return;\n }\n if (r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB - nbits(pm[pm.t - 1]); // normalize modulus\n if (nsh > 0) { pm.lShiftTo(nsh, y); pt.lShiftTo(nsh, r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys - 1];\n if (y0 == 0) return;\n var yt = y0 * (1 << this.F1) + ((ys > 1) ? y[ys - 2] >> this.F2 : 0);\n var d1 = this.FV / yt, d2 = (1 << this.F1) / yt, e = 1 << this.F2;\n var i = r.t, j = i - ys, t = (q == null) ? nbi() : q;\n y.dlShiftTo(j, t);\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t, r);\n }\n BigInteger.ONE.dlShiftTo(ys, t);\n t.subTo(y, y); // \"negative\" y so we can replace sub with am later\n while (y.t < ys) y[y.t++] = 0;\n while (--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i] == y0) ? this.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2);\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) { // Try it out\n y.dlShiftTo(j, t);\n r.subTo(t, r);\n while (r[i] < --qd) r.subTo(t, r);\n }\n }\n if (q != null) {\n r.drShiftTo(ys, q);\n if (ts != ms) BigInteger.ZERO.subTo(q, q);\n }\n r.t = ys;\n r.clamp();\n if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n if (ts < 0) BigInteger.ZERO.subTo(r, r);\n }", "title": "" }, { "docid": "f8ccb2f3da47cc732ff9eb33c38f4299", "score": "0.7281665", "text": "function bnpDivRemTo(m, q, r) {\n var pm = m.abs();\n if (pm.t <= 0) return;\n var pt = this.abs();\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0);\n if (r != null) this.copyTo(r);\n return;\n }\n if (r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB - nbits(pm[pm.t - 1]); // normalize modulus\n if (nsh > 0) { pm.lShiftTo(nsh, y); pt.lShiftTo(nsh, r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys - 1];\n if (y0 == 0) return;\n var yt = y0 * (1 << this.F1) + ((ys > 1) ? y[ys - 2] >> this.F2 : 0);\n var d1 = this.FV / yt, d2 = (1 << this.F1) / yt, e = 1 << this.F2;\n var i = r.t, j = i - ys, t = (q == null) ? nbi() : q;\n y.dlShiftTo(j, t);\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t, r);\n }\n BigInteger.ONE.dlShiftTo(ys, t);\n t.subTo(y, y); // \"negative\" y so we can replace sub with am later\n while (y.t < ys) y[y.t++] = 0;\n while (--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i] == y0) ? this.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2);\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) { // Try it out\n y.dlShiftTo(j, t);\n r.subTo(t, r);\n while (r[i] < --qd) r.subTo(t, r);\n }\n }\n if (q != null) {\n r.drShiftTo(ys, q);\n if (ts != ms) BigInteger.ZERO.subTo(q, q);\n }\n r.t = ys;\n r.clamp();\n if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n if (ts < 0) BigInteger.ZERO.subTo(r, r);\n }", "title": "" }, { "docid": "bc9e9366b6188489e8303ae88df6614c", "score": "0.7277565", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "title": "" }, { "docid": "e7e1b26a2bd7533497271519d63d2eb5", "score": "0.7277424", "text": "function bnpDivRemTo(m, q, r) {\n var pm = m.abs();\n if (pm.t <= 0) return;\n var pt = this.abs();\n\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0);\n if (r != null) this.copyTo(r);\n return;\n }\n\n if (r == null) r = nbi();\n var y = nbi(),\n ts = this.s,\n ms = m.s;\n var nsh = this.DB - nbits(pm[pm.t - 1]); // normalize modulus\n\n if (nsh > 0) {\n pm.lShiftTo(nsh, y);\n pt.lShiftTo(nsh, r);\n } else {\n pm.copyTo(y);\n pt.copyTo(r);\n }\n\n var ys = y.t;\n var y0 = y[ys - 1];\n if (y0 == 0) return;\n var yt = y0 * (1 << this.F1) + (ys > 1 ? y[ys - 2] >> this.F2 : 0);\n var d1 = this.FV / yt,\n d2 = (1 << this.F1) / yt,\n e = 1 << this.F2;\n var i = r.t,\n j = i - ys,\n t = q == null ? nbi() : q;\n y.dlShiftTo(j, t);\n\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t, r);\n }\n\n BigInteger.ONE.dlShiftTo(ys, t);\n t.subTo(y, y); // \"negative\" y so we can replace sub with am later\n\n while (y.t < ys) y[y.t++] = 0;\n\n while (--j >= 0) {\n // Estimate quotient digit\n var qd = r[--i] == y0 ? this.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2);\n\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) {\n // Try it out\n y.dlShiftTo(j, t);\n r.subTo(t, r);\n\n while (r[i] < --qd) r.subTo(t, r);\n }\n }\n\n if (q != null) {\n r.drShiftTo(ys, q);\n if (ts != ms) BigInteger.ZERO.subTo(q, q);\n }\n\n r.t = ys;\n r.clamp();\n if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n\n if (ts < 0) BigInteger.ZERO.subTo(r, r);\n } // (public) this mod a", "title": "" }, { "docid": "87f5300938138514c72c83b12d626521", "score": "0.7271593", "text": "function bnpDivRemTo(m, q, r) {\n var pm = m.abs();\n if (pm.t <= 0) return;\n var pt = this.abs();\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0);\n if (r != null) this.copyTo(r);\n return;\n }\n if (r == null) r = nbi();\n var y = nbi(),\n ts = this.s,\n ms = m.s;\n var nsh = this.DB - nbits(pm[pm.t - 1]); // normalize modulus\n if (nsh > 0) {\n pm.lShiftTo(nsh, y);pt.lShiftTo(nsh, r);\n } else {\n pm.copyTo(y);pt.copyTo(r);\n }\n var ys = y.t;\n var y0 = y[ys - 1];\n if (y0 == 0) return;\n var yt = y0 * (1 << this.F1) + (ys > 1 ? y[ys - 2] >> this.F2 : 0);\n var d1 = this.FV / yt,\n d2 = (1 << this.F1) / yt,\n e = 1 << this.F2;\n var i = r.t,\n j = i - ys,\n t = q == null ? nbi() : q;\n y.dlShiftTo(j, t);\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t, r);\n }\n BigInteger.ONE.dlShiftTo(ys, t);\n t.subTo(y, y); // \"negative\" y so we can replace sub with am later\n while (y.t < ys) {\n y[y.t++] = 0;\n }while (--j >= 0) {\n // Estimate quotient digit\n var qd = r[--i] == y0 ? this.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2);\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) {\n // Try it out\n y.dlShiftTo(j, t);\n r.subTo(t, r);\n while (r[i] < --qd) {\n r.subTo(t, r);\n }\n }\n }\n if (q != null) {\n r.drShiftTo(ys, q);\n if (ts != ms) BigInteger.ZERO.subTo(q, q);\n }\n r.t = ys;\n r.clamp();\n if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n if (ts < 0) BigInteger.ZERO.subTo(r, r);\n }", "title": "" }, { "docid": "139a5a304424fec3bb5f8ba30c62ba7b", "score": "0.725301", "text": "function bnpDivRemTo(m, q, r)\n {\n var pm = m.abs();\n if (pm.t <= 0) return;\n var pt = this.abs();\n if (pt.t < pm.t)\n {\n if (q != null) q.fromInt(0);\n if (r != null) this.copyTo(r);\n return;\n }\n if (r == null) r = nbi();\n var y = nbi(),\n ts = this.s,\n ms = m.s;\n var nsh = this.DB - nbits(pm[pm.t - 1]); // normalize modulus\n if (nsh > 0)\n {\n pm.lShiftTo(nsh, y);\n pt.lShiftTo(nsh, r);\n }\n else\n {\n pm.copyTo(y);\n pt.copyTo(r);\n }\n var ys = y.t;\n var y0 = y[ys - 1];\n if (y0 == 0) return;\n var yt = y0 * (1 << this.F1) + ((ys > 1) ? y[ys - 2] >> this.F2 : 0);\n var d1 = this.FV / yt,\n d2 = (1 << this.F1) / yt,\n e = 1 << this.F2;\n var i = r.t,\n j = i - ys,\n t = (q == null) ? nbi() : q;\n y.dlShiftTo(j, t);\n if (r.compareTo(t) >= 0)\n {\n r[r.t++] = 1;\n r.subTo(t, r);\n }\n BigInteger.ONE.dlShiftTo(ys, t);\n t.subTo(y, y); // \"negative\" y so we can replace sub with am later\n while (y.t < ys) y[y.t++] = 0;\n while (--j >= 0)\n {\n // Estimate quotient digit\n var qd = (r[--i] == y0) ? this.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2);\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd)\n { // Try it out\n y.dlShiftTo(j, t);\n r.subTo(t, r);\n while (r[i] < --qd) r.subTo(t, r);\n }\n }\n if (q != null)\n {\n r.drShiftTo(ys, q);\n if (ts != ms) BigInteger.ZERO.subTo(q, q);\n }\n r.t = ys;\n r.clamp();\n if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n if (ts < 0) BigInteger.ZERO.subTo(r, r);\n }", "title": "" }, { "docid": "c520806d5f2f62019046252dde3e8e4a", "score": "0.7242742", "text": "function bnpDivRemTo(m, q, r) {\n var pm = m.abs();\n if (pm.t <= 0) return;\n var pt = this.abs();\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0);\n if (r != null) this.copyTo(r);\n return;\n }\n if (r == null) r = nbi();\n var y = nbi(),\n ts = this.s,\n ms = m.s;\n var nsh = this.DB - nbits(pm[pm.t - 1]); // normalize modulus\n if (nsh > 0) {\n pm.lShiftTo(nsh, y);\n pt.lShiftTo(nsh, r);\n } else {\n pm.copyTo(y);\n pt.copyTo(r);\n }\n var ys = y.t;\n var y0 = y[ys - 1];\n if (y0 == 0) return;\n var yt = y0 * (1 << this.F1) + ((ys > 1) ? y[ys - 2] >> this.F2 : 0);\n var d1 = this.FV / yt,\n d2 = (1 << this.F1) / yt,\n e = 1 << this.F2;\n var i = r.t,\n j = i - ys,\n t = (q == null) ? nbi() : q;\n y.dlShiftTo(j, t);\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t, r);\n }\n BigInteger.ONE.dlShiftTo(ys, t);\n t.subTo(y, y); // \"negative\" y so we can replace sub with am later\n while (y.t < ys) y[y.t++] = 0;\n while (--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i] == y0) ? this.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2);\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) { // Try it out\n y.dlShiftTo(j, t);\n r.subTo(t, r);\n while (r[i] < --qd) r.subTo(t, r);\n }\n }\n if (q != null) {\n r.drShiftTo(ys, q);\n if (ts != ms) BigInteger.ZERO.subTo(q, q);\n }\n r.t = ys;\n r.clamp();\n if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n if (ts < 0) BigInteger.ZERO.subTo(r, r);\n }", "title": "" }, { "docid": "3ac0bdf35fade326a71f2d536e045afb", "score": "0.7239546", "text": "function bnpDivRemTo(m, q, r) {\n var self = this;\n var pm = m.abs();\n if (pm.t <= 0) return\n var pt = self.abs();\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0);\n if (r != null) self.copyTo(r);\n return\n }\n if (r == null) r = new BigInteger$1();\n var y = new BigInteger$1(),\n ts = self.s,\n ms = m.s;\n var nsh = self.DB - nbits(pm[pm.t - 1]); // normalize modulus\n if (nsh > 0) {\n pm.lShiftTo(nsh, y);\n pt.lShiftTo(nsh, r);\n } else {\n pm.copyTo(y);\n pt.copyTo(r);\n }\n var ys = y.t;\n var y0 = y[ys - 1];\n if (y0 == 0) return\n var yt = y0 * (1 << self.F1) + ((ys > 1) ? y[ys - 2] >> self.F2 : 0);\n var d1 = self.FV / yt,\n d2 = (1 << self.F1) / yt,\n e = 1 << self.F2;\n var i = r.t,\n j = i - ys,\n t = (q == null) ? new BigInteger$1() : q;\n y.dlShiftTo(j, t);\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t, r);\n }\n BigInteger$1.ONE.dlShiftTo(ys, t);\n t.subTo(y, y); // \"negative\" y so we can replace sub with am later\n while (y.t < ys) y[y.t++] = 0;\n while (--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i] == y0) ? self.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2);\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) { // Try it out\n y.dlShiftTo(j, t);\n r.subTo(t, r);\n while (r[i] < --qd) r.subTo(t, r);\n }\n }\n if (q != null) {\n r.drShiftTo(ys, q);\n if (ts != ms) BigInteger$1.ZERO.subTo(q, q);\n }\n r.t = ys;\n r.clamp();\n if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n if (ts < 0) BigInteger$1.ZERO.subTo(r, r);\n}", "title": "" }, { "docid": "652345e2913360c2c3a25626292cc8d2", "score": "0.7230528", "text": "function bnpDivRemTo(m,q,r) {\r\n var pm = m.abs();\r\n if(pm.t <= 0) return;\r\n var pt = this.abs();\r\n if(pt.t < pm.t) {\r\n if(q != null) q.fromInt(0);\r\n if(r != null) this.copyTo(r);\r\n return;\r\n }\r\n if(r == null) r = nbi();\r\n var y = nbi(), ts = this.s, ms = m.s;\r\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\r\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\r\n else { pm.copyTo(y); pt.copyTo(r); }\r\n var ys = y.t;\r\n var y0 = y[ys-1];\r\n if(y0 == 0) return;\r\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\r\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\r\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\r\n y.dlShiftTo(j,t);\r\n if(r.compareTo(t) >= 0) {\r\n r[r.t++] = 1;\r\n r.subTo(t,r);\r\n }\r\n BigInteger.ONE.dlShiftTo(ys,t);\r\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\r\n while(y.t < ys) y[y.t++] = 0;\r\n while(--j >= 0) {\r\n // Estimate quotient digit\r\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\r\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\r\n y.dlShiftTo(j,t);\r\n r.subTo(t,r);\r\n while(r[i] < --qd) r.subTo(t,r);\r\n }\r\n }\r\n if(q != null) {\r\n r.drShiftTo(ys,q);\r\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\r\n }\r\n r.t = ys;\r\n r.clamp();\r\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\r\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\r\n}", "title": "" }, { "docid": "7e547e6218c07506f9a6dc4a5f349585", "score": "0.72067934", "text": "function bnpDivRemTo(m, q, r) {\n var pm = m.abs();\n if (pm.t <= 0) return;\n var pt = this.abs();\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0);\n if (r != null) this.copyTo(r);\n return;\n }\n if (r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB - nbits(pm[pm.t - 1]);\t// normalize modulus\n if (nsh > 0) {\n pm.lShiftTo(nsh, y);\n pt.lShiftTo(nsh, r);\n }\n else {\n pm.copyTo(y);\n pt.copyTo(r);\n }\n var ys = y.t;\n var y0 = y[ys - 1];\n if (y0 === 0) return;\n var yt = y0 * (1 << this.F1) + ((ys > 1) ? y[ys - 2] >> this.F2 : 0);\n var d1 = this.FV / yt, d2 = (1 << this.F1) / yt, e = 1 << this.F2;\n var i = r.t, j = i - ys, t = (q == null) ? nbi() : q;\n y.dlShiftTo(j, t);\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t, r);\n }\n BigInteger.ONE.dlShiftTo(ys, t);\n t.subTo(y, y);\t// \"negative\" y so we can replace sub with am later\n while (y.t < ys) y[y.t++] = 0;\n while (--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i] == y0) ? this.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2);\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) {\t// Try it out\n y.dlShiftTo(j, t);\n r.subTo(t, r);\n while (r[i] < --qd) r.subTo(t, r);\n }\n }\n if (q != null) {\n r.drShiftTo(ys, q);\n if (ts != ms) BigInteger.ZERO.subTo(q, q);\n }\n r.t = ys;\n r.clamp();\n if (nsh > 0) r.rShiftTo(nsh, r);\t// Denormalize remainder\n if (ts < 0) BigInteger.ZERO.subTo(r, r);\n}", "title": "" }, { "docid": "7e547e6218c07506f9a6dc4a5f349585", "score": "0.72067934", "text": "function bnpDivRemTo(m, q, r) {\n var pm = m.abs();\n if (pm.t <= 0) return;\n var pt = this.abs();\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0);\n if (r != null) this.copyTo(r);\n return;\n }\n if (r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB - nbits(pm[pm.t - 1]);\t// normalize modulus\n if (nsh > 0) {\n pm.lShiftTo(nsh, y);\n pt.lShiftTo(nsh, r);\n }\n else {\n pm.copyTo(y);\n pt.copyTo(r);\n }\n var ys = y.t;\n var y0 = y[ys - 1];\n if (y0 === 0) return;\n var yt = y0 * (1 << this.F1) + ((ys > 1) ? y[ys - 2] >> this.F2 : 0);\n var d1 = this.FV / yt, d2 = (1 << this.F1) / yt, e = 1 << this.F2;\n var i = r.t, j = i - ys, t = (q == null) ? nbi() : q;\n y.dlShiftTo(j, t);\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t, r);\n }\n BigInteger.ONE.dlShiftTo(ys, t);\n t.subTo(y, y);\t// \"negative\" y so we can replace sub with am later\n while (y.t < ys) y[y.t++] = 0;\n while (--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i] == y0) ? this.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2);\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) {\t// Try it out\n y.dlShiftTo(j, t);\n r.subTo(t, r);\n while (r[i] < --qd) r.subTo(t, r);\n }\n }\n if (q != null) {\n r.drShiftTo(ys, q);\n if (ts != ms) BigInteger.ZERO.subTo(q, q);\n }\n r.t = ys;\n r.clamp();\n if (nsh > 0) r.rShiftTo(nsh, r);\t// Denormalize remainder\n if (ts < 0) BigInteger.ZERO.subTo(r, r);\n}", "title": "" }, { "docid": "f42261d38ed51efab9e38cb41c3c13e6", "score": "0.7202629", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m._abs();\n if(pm.t <= 0) return;\n var pt = this._abs();\n if(pt.t < pm.t) {\n if(q != null) q._fromInt(0);\n if(r != null) this._copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this._DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm._lShiftTo(nsh,y); pt._lShiftTo(nsh,r); }\n else { pm._copyTo(y); pt._copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this._F1)+((ys>1)?y[ys-2]>>this._F2:0);\n var d1 = this._FV/yt, d2 = (1<<this._F1)/yt, e = 1<<this._F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y._dlShiftTo(j,t);\n if(r._compareTo(t) >= 0) {\n r[r.t++] = 1;\n r._subTo(t,r);\n }\n BigInteger._ONE._dlShiftTo(ys,t);\n t._subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this._DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y._am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y._dlShiftTo(j,t);\n r._subTo(t,r);\n while(r[i] < --qd) r._subTo(t,r);\n }\n }\n if(q != null) {\n r._drShiftTo(ys,q);\n if(ts != ms) BigInteger._ZERO._subTo(q,q);\n }\n r.t = ys;\n r._clamp();\n if(nsh > 0) r._rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger._ZERO._subTo(r,r);\n}", "title": "" }, { "docid": "63cd5f628a35e643af7a34ed692ba377", "score": "0.7200726", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "title": "" }, { "docid": "63cd5f628a35e643af7a34ed692ba377", "score": "0.7200726", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "title": "" }, { "docid": "63cd5f628a35e643af7a34ed692ba377", "score": "0.7200726", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "title": "" }, { "docid": "63cd5f628a35e643af7a34ed692ba377", "score": "0.7200726", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "title": "" }, { "docid": "63cd5f628a35e643af7a34ed692ba377", "score": "0.7200726", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "title": "" }, { "docid": "63cd5f628a35e643af7a34ed692ba377", "score": "0.7200726", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "title": "" }, { "docid": "63cd5f628a35e643af7a34ed692ba377", "score": "0.7200726", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "title": "" }, { "docid": "63cd5f628a35e643af7a34ed692ba377", "score": "0.7200726", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "title": "" }, { "docid": "23ab0c403a189327deda9895884c3141", "score": "0.71794426", "text": "function bnpDivRemTo(m, q, r) {\n var pm = m.abs();\n if (pm.t <= 0) return;\n var pt = this.abs();\n\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0);\n if (r != null) this.copyTo(r);\n return;\n }\n\n if (r == null) r = nbi();\n var y = nbi(),\n ts = this.s,\n ms = m.s;\n var nsh = this.DB - nbits(pm[pm.t - 1]); // normalize modulus\n\n if (nsh > 0) {\n pm.lShiftTo(nsh, y);\n pt.lShiftTo(nsh, r);\n } else {\n pm.copyTo(y);\n pt.copyTo(r);\n }\n\n var ys = y.t;\n var y0 = y[ys - 1];\n if (y0 == 0) return;\n var yt = y0 * (1 << this.F1) + (ys > 1 ? y[ys - 2] >> this.F2 : 0);\n var d1 = this.FV / yt,\n d2 = (1 << this.F1) / yt,\n e = 1 << this.F2;\n var i = r.t,\n j = i - ys,\n t = q == null ? nbi() : q;\n y.dlShiftTo(j, t);\n\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t, r);\n }\n\n BigInteger.ONE.dlShiftTo(ys, t);\n t.subTo(y, y); // \"negative\" y so we can replace sub with am later\n\n while (y.t < ys) {\n y[y.t++] = 0;\n }\n\n while (--j >= 0) {\n // Estimate quotient digit\n var qd = r[--i] == y0 ? this.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2);\n\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) {\n // Try it out\n y.dlShiftTo(j, t);\n r.subTo(t, r);\n\n while (r[i] < --qd) {\n r.subTo(t, r);\n }\n }\n }\n\n if (q != null) {\n r.drShiftTo(ys, q);\n if (ts != ms) BigInteger.ZERO.subTo(q, q);\n }\n\n r.t = ys;\n r.clamp();\n if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n\n if (ts < 0) BigInteger.ZERO.subTo(r, r);\n} // (public) this mod a", "title": "" }, { "docid": "6e02c262781f80a293699a85adc936ff", "score": "0.7170715", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "title": "" }, { "docid": "62f54cb7e36e9a8d595994f571243273", "score": "0.71656245", "text": "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "title": "" }, { "docid": "6d1636fe748d83bfad96e7e642b14f92", "score": "0.71539336", "text": "function bnpDivRemTo(m, q, r) {\n var pm = m.abs();\n if (pm.t <= 0) return;\n var pt = this.abs();\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0);\n if (r != null) this.copyTo(r);\n return;\n }\n if (r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var pm_array = pm.array;\n var nsh = BI_DB - nbits(pm_array[pm.t - 1]);\t// normalize modulus\n if (nsh > 0) { pm.lShiftTo(nsh, y); pt.lShiftTo(nsh, r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n \n var y_array = y.array;\n var y0 = y_array[ys - 1];\n if (y0 == 0) return;\n var yt = y0 * (1 << BI_F1) + ((ys > 1)?y_array[ys - 2] >> BI_F2:0);\n var d1 = BI_FV / yt, d2 = (1 << BI_F1) / yt, e = 1 << BI_F2;\n var i = r.t, j = i - ys, t = (q == null)?nbi():q;\n y.dlShiftTo(j, t);\n \n var r_array = r.array;\n if (r.compareTo(t) >= 0) {\n r_array[r.t++] = 1;\n r.subTo(t, r);\n }\n BigInteger.ONE.dlShiftTo(ys, t);\n t.subTo(y, y);\t// \"negative\" y so we can replace sub with am later\n while (y.t < ys) y_array[y.t++] = 0;\n while (--j >= 0) {\n // Estimate quotient digit\n var qd = (r_array[--i] == y0)?BI_DM:Math.floor(r_array[i] * d1 + (r_array[i - 1] + e) * d2);\n if ((r_array[i] += y.am(0, qd, r, j, 0, ys)) < qd) {\t// Try it out\n y.dlShiftTo(j, t);\n r.subTo(t, r);\n while (r_array[i] < --qd) r.subTo(t, r);\n }\n }\n if (q != null) {\n r.drShiftTo(ys, q);\n if (ts != ms) BigInteger.ZERO.subTo(q, q);\n }\n r.t = ys;\n r.clamp();\n if (nsh > 0) r.rShiftTo(nsh, r);\t// Denormalize remainder\n if (ts < 0) BigInteger.ZERO.subTo(r, r);\n }", "title": "" } ]
20e5318233e1f230420906713a46ab64
Get what they intersect with...
[ { "docid": "5f099f60a156e588f01053b7ee8a44da", "score": "0.0", "text": "function Collision_Manager( ){\n\n\n\n}", "title": "" } ]
[ { "docid": "4d63d0a9eaba1bdd7ef422ce7e537113", "score": "0.7855951", "text": "get intersection() {}", "title": "" }, { "docid": "cbfac027213be0a7e251ba540dcb45a6", "score": "0.7115639", "text": "Intersect() {\n\n }", "title": "" }, { "docid": "76503ad3e7510c647ff8ff9de447933e", "score": "0.7068007", "text": "function intersection() {\n \n}", "title": "" }, { "docid": "131081be88981e02c60db6e0eeec3b47", "score": "0.69168174", "text": "function intersect(arr1,arr2){\n\n}", "title": "" }, { "docid": "f45e9452a56f3b5448c8f2dfbc7aff99", "score": "0.6894359", "text": "function intersect(a, b) {\n return a.filter(function(e) {\n return b.indexOf(e) !== -1;\n });\n}", "title": "" }, { "docid": "cc190ef88a7256c0d2b77990628d8cb9", "score": "0.68299913", "text": "function intersect(a, b) {\n console.log(a.filter(Set.prototype.has, new Set(b)));\n}", "title": "" }, { "docid": "1081ba3ce4ff9b95a5386d41c5b1c239", "score": "0.67934966", "text": "function intersection(list){\n \n}", "title": "" }, { "docid": "27cc49e2bf7f78720a7fb158b3d7e8e1", "score": "0.66659474", "text": "function Intersect() {\n this.result = new Point();\n}", "title": "" }, { "docid": "f7fae7449da10fa2e9546ffe4f40f911", "score": "0.66608536", "text": "intersect (other) {\n return this.y + this.height > other.y &&\n this.y < other.y + other.height &&\n this.x + this.width > other.x &&\n this.x < other.x + other.width\n }", "title": "" }, { "docid": "dd8b1936ef87c9f9eb5f0217c0967d44", "score": "0.6646748", "text": "intersect(r) {\n r = cobalt.range(r);\n return this.exclude(r.invert(Math.max(this.end,r.end)));\n }", "title": "" }, { "docid": "c8dd28b7bb022e92657f45b5b7032628", "score": "0.66375756", "text": "function intersect() {\n var i;\n mt=99999; mo=-1;\n\n for (i=0; i<numob; i++) ob[i].intersect(i);\n\n // Incident point & eye vector\n if (mo>=0) {\n ndir = mndir;\n ob[mo].hit(mt);\tez=iz-eyez;\n idoti = ix*ix + iy*iy + iz*iz;\n }\n return mo;\n}", "title": "" }, { "docid": "76f9ba9f4b71a7b240bb243d4b39604a", "score": "0.66179913", "text": "function intersect(a, b) {\n return !(a.x2 - 1 < b.x1 || a.x1 + 1 > b.x2 || a.y2 - 1 < b.y1 || a.y1 + 1 > b.y2);\n}", "title": "" }, { "docid": "c48f393b5784a50e455b978ab1b4b6d0", "score": "0.6604586", "text": "intersection(otherSet) {\n const intersectionSet = new CustomSet();\n const firstSet = this.values();\n firstSet.forEach(e => {\n if (otherSet.has(e)) {\n intersectionSet.add(e);\n }\n });\n return intersectionSet;\n }", "title": "" }, { "docid": "148e90be22b840b5e7f9ef831149bb2c", "score": "0.65895826", "text": "intersect(other) {\n return this.y + this.height > other.y &&\n this.y < other.y + other.height &&\n this.x + this.width > other.x &&\n this.x < other.x + other.width\n }", "title": "" }, { "docid": "84cead9affa1b0fcff63b1ce48adebba", "score": "0.6575883", "text": "function intersect(a, b) {\n var t;\n // Swap a and b (to use shortest for loop iteration)\n if (b.length > a.length) {\n t = b, b = a, a = t;\n }\n\n return a.filter(function (e) {\n if (b.indexOf(e) !== -1) return true;\n });\n}", "title": "" }, { "docid": "4e2da813f8ea86cee24481746b77099d", "score": "0.6558178", "text": "intersection(otherSet){\n return this.collection.filter(el => otherSet.includes(el));\n }", "title": "" }, { "docid": "61d164cc1d18b59cd93324091e04000e", "score": "0.6536775", "text": "function intersect(a, b) {\n return !(\n a.x2 - 1 < b.x1 ||\n a.x1 + 1 > b.x2 ||\n a.y2 - 1 < b.y1 ||\n a.y1 + 1 > b.y2\n );\n}", "title": "" }, { "docid": "63dcf3b66621fa30b1e23378aea65fe4", "score": "0.65171623", "text": "function intersect(a,b) {\n return a.x < b.x + b.w && a.x + a.w > b.x && a.y < b.y + b.h && a.y + a.h > b.y\n}", "title": "" }, { "docid": "0d160e1324b13efb99e7bcc90c332b37", "score": "0.65139276", "text": "function getIntersect(arr1, arr2) {\n var r = [], o = {}, l = arr2.length, i, v;\n for (i = 0; i < l; i++) {\n o[arr2[i]] = true;\n }\n l = arr1.length;\n for (i = 0; i < l; i++) {\n v = arr1[i];\n if (v in o) {\n r.push(v);\n }\n }\n return r;\n }", "title": "" }, { "docid": "8b10e46d1c993f8d59a34fbb535134ff", "score": "0.6492773", "text": "function intersection(first, second) {\n var intersected = [];\n for (var i = 0; i < first.length; i++) {\n if (second.includes(first[i])) {\n intersected.push(first[i]);\n }\n }\n return intersected;\n\n}", "title": "" }, { "docid": "b0f2cc42cd5e7766e9ad69d408b6eda8", "score": "0.6484117", "text": "function intersect(a, b) {\n var tmp;\n if (b.length > a.length)\n tmp = b, b = a, a = tmp; // indexOf to loop over shorter\n return a.filter(\n function (e) {\n if (b.indexOf(e) !== -1)\n return true;\n }\n );\n}", "title": "" }, { "docid": "0e76b74c9bb26608fbf68a0b3c391313", "score": "0.64781034", "text": "intersection(otherSet) {\n const intersectionSet = new MySet();\n this.values.forEach(val => {\n if (otherSet.has(val)) {\n this.intersection.add(val)\n }\n })\n\n return intersectionSet;\n }", "title": "" }, { "docid": "9af2498c9b96dfc9fb59b252e45e800a", "score": "0.641446", "text": "function Intersect() {\n var intersectees = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n intersectees[_i] = arguments[_i];\n }\n var self = { tag: 'intersect', intersectees: intersectees };\n return runtype_1.create(function (value, visited) {\n var e_1, _a;\n try {\n for (var intersectees_1 = __values(intersectees), intersectees_1_1 = intersectees_1.next(); !intersectees_1_1.done; intersectees_1_1 = intersectees_1.next()) {\n var targetType = intersectees_1_1.value;\n var result = runtype_1.innerValidate(targetType, value, visited);\n if (!result.success)\n return result;\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (intersectees_1_1 && !intersectees_1_1.done && (_a = intersectees_1.return)) _a.call(intersectees_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return util_1.SUCCESS(value);\n }, self);\n}", "title": "" }, { "docid": "b501e3737e232c25839b03ac8a57303f", "score": "0.6407332", "text": "set intersection(value) {}", "title": "" }, { "docid": "31bacf6d23ae4240496283694e9bfa79", "score": "0.64037484", "text": "function intersect$1(a, b) {\n return !(\n a.x2 - 1 < b.x1 ||\n a.x1 + 1 > b.x2 ||\n a.y2 - 1 < b.y1 ||\n a.y1 + 1 > b.y2\n );\n}", "title": "" }, { "docid": "275b4d5ee42e92ac8475eb8a3781e059", "score": "0.63815844", "text": "function PayloadIntersect(inSet1, inSet2)\r\n{\r\n\tvar result = new Array();\r\n\tfor (p1 in inSet1)\r\n\t{\r\n\t\tfor (p2 in inSet2)\r\n\t\t{\r\n\t\t\tif (inSet1[p1].GetAdobeCode() == inSet2[p2].GetAdobeCode())\r\n\t\t\t{\r\n\t\t\t\tresult.push(inSet1[p1]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn result;\r\n}", "title": "" }, { "docid": "65c896cc0d343c63d372a9124988157c", "score": "0.6377985", "text": "function intersect(a,b)\n{\n if(!a || !b) return false;\n for(var i=0;i<a.length;i++)\n {\n for(var j=0;j<b.length;j++)\n {\n if(a[i] == b[j]) return a[i];\n }\n }\n return false;\n}", "title": "" }, { "docid": "7402e90e3728088de5a46c889b35da22", "score": "0.6327215", "text": "function intersection(){\n\t\tif(arguments.length===0) return []; \n\t\tif(arguments.length===1) return arguments[0].slice(); \n\t\tvar a,b,c,d,e,f,g=[],h={},i;\n\t\ti=arguments.length-1;\n\t\td=arguments[0].length;\n\t\tc=0;\n\t\tfor(a=0;a<=i;a++){\n\t\t\te=arguments[a].length;\n\t\t\tif(e<d){c=a;d=e}\n\t\t}\n\t\tfor(a=0;a<=i;a++){\n\t\t\te=a===c?0:a||c;f=arguments[e].length;\n\t\t\tfor(var j=0;j<f;j++){\n\t\t\t\tvar k=arguments[e][j];\n\t\t\t\tif(h[k]===a-1){\n\t\t\t\t\tif(a===i){\n\t\t\t\t\t\tg.push(k);h[k]=0\n\t\t\t\t\t} else {\n\t\t\t\t\t\th[k]=a\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(a===0){\n\t\t\t\t\th[k]=0\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn g;\n\t}", "title": "" }, { "docid": "47d6e170f6ff64c436d36d3d3d4b0011", "score": "0.6327084", "text": "function intersection() {\n let result = [];\n let lists = (arguments.length === 1) ? arguments[0] : arguments;\n\n for (let i = 0; i < lists.length; i++) {\n let currentList = lists[i];\n for (let y = 0; y < currentList.length; y++) {\n let currentValue = currentList[y];\n if (result.indexOf(currentValue) !== -1) {\n continue;\n }\n if (lists.filter(function (obj) { return obj.indexOf(currentValue) == -1 }).length == 0) {\n result.push(currentValue);\n }\n }\n }\n return result;\n}", "title": "" }, { "docid": "5e1338596e2baf588f8511eaba16759b", "score": "0.6307747", "text": "intersection(otherSet) {\n const intersectionSet = new Set();\n const values = this.values();\n\n for (let i = 0; i < values.length; i++) {\n if (otherSet.has(values[i])) {\n intersectionSet.add(values[i]);\n }\n }\n\n return intersectionSet;\n }", "title": "" }, { "docid": "7b341bc1272a07807e3e671f4b3b5dd5", "score": "0.6280678", "text": "getIntersection(set1, set2) {\n let intersection = new Set();\n for (let element of set1) {\n if (set2.has(element)) {\n intersection.add(element);\n }\n }\n return intersection;\n }", "title": "" }, { "docid": "e8cc01bf7dcae9020f9acf0fad1fa09f", "score": "0.6272738", "text": "intersection(set) {\n const newSet = new Set();\n\n let largeSet;\n let smallSet;\n if (this.dictionary.length > set.length) {\n largeSet = this;\n smallSet = set;\n } else {\n largeSet = set;\n smallSet = this;\n }\n\n smallSet.values().forEach(value => {\n if (largeSet.dictionary[value]) {\n newSet.add(value);\n }\n })\n\n return newSet;\n }", "title": "" }, { "docid": "3e7092d534a980ab711172828f8bf528", "score": "0.623119", "text": "function intersect(a, b, c, d) {\r\n return ccw(a, c, d) !== ccw(b, c, d) && ccw(a, b, c) !== ccw(a, b, d);\r\n }", "title": "" }, { "docid": "b7356914bc5091d7c75247da260e041d", "score": "0.62274206", "text": "function intersection(a1, a2) {\n return a1.filter(function (el) {\n return a2.indexOf(el) !== -1;\n });\n }", "title": "" }, { "docid": "43a93029d291a7e008d7f0dac4e9cc4f", "score": "0.62207407", "text": "function intersection(a, b){\n let arry=[];\n\n for(let i=0;i<a.length;i++){\n for(let x=0;x<b.length;x++){\n\n if(a[i]===b[x]){\n if(arry.indexOf(a[i])<0){\n arry.push(a[i])\n }\n }\n }\n }\n\n return arry;\n}", "title": "" }, { "docid": "0547acbc6939be35629bd832fc542192", "score": "0.61933863", "text": "function intersection() {\n var\n arrays = arguments,\n i = arrays.length;\n return Array.prototype.filter.call(arrays[0], function (elem) {\n while (--i) {\n var arr = arrays[i];\n if (arr.indexOf(elem) === -1) {\n return false;\n }\n }\n return true;\n });\n }", "title": "" }, { "docid": "da9426d3ac132232e1830c7ef3321782", "score": "0.6190952", "text": "function intersection(a, b) {\r\n var t;\r\n if (b.length > a.length) t = b, b = a, a = t; // indexOf to loop over shorter\r\n return a.filter(function (e) {\r\n if (b.indexOf(e) !== -1) return true;\r\n });\r\n}", "title": "" }, { "docid": "559ba603f058382ad91f5f3057200e64", "score": "0.6187723", "text": "function setIntersect( set1, set2) {\r\n var finalset = new Set();\r\n set1.forEach(function(value) {\r\n if(set2.has(value)) {\r\n finalset.add(value);\r\n }\r\n });\r\n return finalset;\r\n}", "title": "" }, { "docid": "32f2a7c686d9957fa69dfb90170afafa", "score": "0.61835396", "text": "function intersect(array) {\n return this.uniq().findAll(function(item) {\n return array.detect(function(value) { return item === value });\n });\n }", "title": "" }, { "docid": "7fc7b99d02d031aed5b6c35577593261", "score": "0.6166521", "text": "objectsNearBoundingBox(box) {\n var objs = new Set()\n\n for (var c of this.cellsIntersectingWith(box))\n for (var o of this.map.get(this.hashCell(c)))\n objs.add(o)\n\n return objs\n }", "title": "" }, { "docid": "f4d5a202600707f14b390fb350b28677", "score": "0.6139254", "text": "function intersect(array1, array2) {\n return array1.filter(e1 => array2.some(e2 => e2 == e1));\n}", "title": "" }, { "docid": "2dbd4e6de8cd73c6ccacc238d5116683", "score": "0.61214095", "text": "function intersect(obj1, obj2){\n\t\t var objBounds1 = obj1.nominalBounds.clone();\n\t\t var objBounds2 = obj2.nominalBounds.clone();\n\t\t\n\t\t var pt = obj1.globalToLocal(obj2.x, obj2.y);\n\t\t\t\n\t\t \n\t\t var h1 = -(objBounds1.height / 2 + objBounds2.height);\n\t\t var h2 = objBounds2.height / 8;\n\t\t var w1 = -(objBounds1.width / 2 + objBounds2.width);\n\t\t var w2 = objBounds2.width / 8;\n\t\t \n\t\t \n\t\t if(pt.x > w2 || pt.x < w1){ //too left or too right\n\t\t spliceThis(hitTestArray, obj2);\n\t\t return false;\n\t\t } \n\t\t if(pt.y > h2 || pt.y < h1){ //too high or too low\n\t\t spliceThis(hitTestArray, obj2);\n\t\t return false;\n\t\t } \n\t\t if(hitTestArray.indexOf(obj2) < 0){ //Obj2 not found\n\t\t hitTestArray.push(obj2);\n\t\t }\n\t\t return true;\n\t\t}", "title": "" }, { "docid": "9ee57fc01dbd3443033bcad8b9fd770a", "score": "0.61198825", "text": "function intersect_safe(a, b) {\n if(!a||!b)\n return 1000;\n var ai = 0, bi = 0;\n var result = [];\n /*console.log(a);\n console.log(b);*/\n for(var i =0; i< a.length;i++)\n {\n\n for(var j =0; j< b.length;j++)\n {\n /*console.log(a[i]);\n console.log(b[j]);\n console.log(\"eval: \"+(a[i]==b[j]));*/\n if(a[i]==b[j])\n result.push(a[ai]);\n }\n }\n /*\n while (ai < a.length) {\n\n while (bi < b.length) {\n {\n console.log(a[ai]);\n console.log(b[bi]);\n console.log(a[ai]==b[bi]);\n if (String(a[ai]) == String(b[bi])) {\n result.push(a[ai]);\n\n }\n\n bi++;\n }\n ai++;\n }\n\n return result;\n }*/\n return result;\n }", "title": "" }, { "docid": "9a88f03de857cf87241c80bd871083a1", "score": "0.6119463", "text": "function intersection(first, second) {\n var newArray = [];\n for (var i = 0; i < first.length; i++) {\n for (var j = 0; j < second.length; j++) {\n if (first[i] === second[j]) {\n newArray.push(first[i]);\n }\n }\n }\n return newArray;\n}", "title": "" }, { "docid": "08b4348a104c4508a482ba88ec2dfeb3", "score": "0.61127704", "text": "function intersect(x1,y1,x2,y2,x3,y3,x4,y4){\r\n\t\tvar d = (x1-x2)*(y3-y4) - (y1-y2)*(x3-x4);\r\n\t\tif (d == 0) return null;\r\n\t\t\r\n\t\tvar xi = ((x3-x4)*(x1*y2-y1*x2)-(x1-x2)*(x3*y4-y3*x4))/d;\r\n\t\tvar yi = ((y3-y4)*(x1*y2-y1*x2)-(y1-y2)*(x3*y4-y3*x4))/d;\r\n\t\t\r\n\t\treturn {x:xi,y:yi};\r\n\t}", "title": "" }, { "docid": "d058a4346aa5752efb6ef4e0f3d91c87", "score": "0.611109", "text": "function intersection(a, b) {\n let set = new Set(a);\n let intesect = [];\n for ( let item of b ) {\n if ( set.has(item) ) {\n intesect.push(item);\n }\n } \n return(\n intesect\n );\n}", "title": "" }, { "docid": "1b6cc064e18cab8e48e732bca014f64b", "score": "0.6102038", "text": "function intersect(p0_x, p0_y, p1_x, p1_y, p2_x, p2_y, p3_x, p3_y) {\n var s1_x, s1_y, s2_x, s2_y;\n s1_x = p1_x - p0_x;\n s1_y = p1_y - p0_y;\n s2_x = p3_x - p2_x;\n s2_y = p3_y - p2_y;\n\n var s, t;\n s = (-s1_y * (p0_x - p2_x) + s1_x * (p0_y - p2_y)) / (-s2_x * s1_y + s1_x * s2_y);\n t = ( s2_x * (p0_y - p2_y) - s2_y * (p0_x - p2_x)) / (-s2_x * s1_y + s1_x * s2_y);\n\n return (s >= 0 && s <= 1 && t >= 0 && t <= 1);\n }", "title": "" }, { "docid": "ada49cf7a7f4b478b7500939123915dd", "score": "0.6094589", "text": "intersection(bounds) {\n return b2(Math.max(this.minX, bounds.minX), Math.max(this.minY, bounds.minY), Math.min(this.maxX, bounds.maxX), Math.min(this.maxY, bounds.maxY));\n }", "title": "" }, { "docid": "6cd7df2b79ceea2fe5e8df5416b5407b", "score": "0.6087043", "text": "intersection (set) {\n let intersection = new Set();\n \n this._storage.forEach(v => { \n if (set.has(v))\n intersection.add(v);\n });\n return intersection;\n }", "title": "" }, { "docid": "98134e69c09bedbe65d17ec5003e96f0", "score": "0.60737705", "text": "function intersect(start0, end0, start1, end1) {\n if (start0.equals(start1) || start0.equals(end1) || end0.equals(start1) || end1.equals(start1)) return null;\n var x1 = start0[0],\n y1 = start0[1],\n x2 = end0[0],\n y2 = end0[1],\n x3 = start1[0],\n y3 = start1[1],\n x4 = end1[0],\n y4 = end1[1];\n var denom = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4);\n if (denom == 0) return null;\n return [((x1 * y2 - y1 * x2) * (x3 - x4) - (x1 - x2) * (x3 * y4 - y3 * x4)) / denom, ((x1 * y2 - y1 * x2) * (y3 - y4) - (y1 - y2) * (x3 * y4 - y3 * x4)) / denom];\n}", "title": "" }, { "docid": "fd068f1088a91725346de03c509337aa", "score": "0.606198", "text": "function intersection(arr1, arr2) {\n\tvar rtn = [];\n\n\tif (arr1.length > arr2.length) {\n\t\tvar t = arr1;\n\n\t\tarr1 = arr2;\n\t\tarr2 = t;\n\t}\n\n\tfor (var i = 0, c = arr1.length; i < c; i++) {\n\t\tvar d = arr1[i];\n\n\t\tif (arr2.indexOf(d) !== -1) {\n\t\t\trtn.push(d);\n\t\t}\n\t}\n\n\treturn rtn;\n}", "title": "" }, { "docid": "82682b091602c29a8abc9fc37531028f", "score": "0.6058241", "text": "function intersect(a, b) {\n const setA = new Set(a);\n const setB = new Set(b);\n\n const smallerSet = setA.size < setB.size ? setA : setB;\n const largerSet = setA.size > setB.size ? setA : setB;\n\n let intersection = new Set();\n for (const value of smallerSet) {\n if (largerSet.has(value)) {\n intersection.add(value);\n }\n }\n\n return intersection;\n}", "title": "" }, { "docid": "f0dcc72410461e865600f0983726834c", "score": "0.60128254", "text": "function getIntersections(objects) {\n var raycaster = new THREE.Raycaster();\n var vector = new THREE.Vector3( 0, 0, -1);\n vector.applyQuaternion(camera.quaternion);\n raycaster.set(camera.position, vector);\n return raycaster.intersectObjects(objects, true);\n}", "title": "" }, { "docid": "e66526ba1067575b09ffab0a42fd656a", "score": "0.6007534", "text": "function intersection(c1, c2) {\n var values1 = facetValues.from(c1);\n var values2 = facetValues.from(c2);\n var commonValues = values1.filter(function (v1) {\n return 0 <= Object(lodash_es_findIndex__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(values2, function (v2) { return Object(_facets__WEBPACK_IMPORTED_MODULE_0__[\"facetValuesEqual\"])(v1, v2); });\n });\n return facetValues.to(commonValues);\n}", "title": "" }, { "docid": "7ab53d25cab24ebd0e0b8ea2c94990fc", "score": "0.60072374", "text": "function intersect(arr1, arr2) {\n if (arr1.length === 0) {\n return arr2;\n }\n return arr1.filter(i => arr2.includes(i));\n}", "title": "" }, { "docid": "b1e6c5240a6a21bd40e78e86e6327767", "score": "0.59646237", "text": "function intersection(...arrays) {\n \tlet helperArray = [];\n\t\tlet mutatedArray = reduce(arrays, (firstArray, secondArray) => {\n if(!firstArray.length) {\n firstArray = secondArray;\n return firstArray;\n } else {\n forEach(secondArray, item => {\n \tif((firstArray.indexOf(item) > -1) && (helperArray.indexOf(item) == -1)) {\n \thelperArray.push(item);\n \t}\n \t});\n return helperArray;\n }\n }, []);\n \treturn mutatedArray;\n}", "title": "" }, { "docid": "3b3804b0edd528c42d10b07f11f334de", "score": "0.59559363", "text": "function getIntersection() {\n var newArr = Array.from(arguments);\n\n return newArr.reduce(function(accumulator, array) {\n return accumulator.filter(function(num) {\n return array.indexOf(num) !== -1;\n });\n });\n}", "title": "" }, { "docid": "9fa8f41f2b7a4d5bc6087e7bc66653a5", "score": "0.5952685", "text": "_intersection() {\n var arr1 = [3,5,6,5,7,8,3]\n var arr2 = [5,6,7,8]\n var arr3 = [2,5]\n\n var result = _.intersection(arr1, arr2, arr3)\n console.log('intersection', result)\n }", "title": "" }, { "docid": "2a4ebaadb2fa2de2b58c4777597499d4", "score": "0.5945058", "text": "function getIntersects(x, y) {\n x = (x / window.innerWidth) * 2 - 1;\n y = - (y / window.innerHeight) * 2 + 1;\n mouseVector.set(x, y, 0.5);\n raycaster.setFromCamera(mouseVector, camera);\n return raycaster.intersectObject(GROUP, true);\n }", "title": "" }, { "docid": "10087857fe528facfbc255a0c0c8928d", "score": "0.594466", "text": "cellsIntersectingWith(box) {\n var cells = []\n var start = this.cellFromPoint(box)\n var end = this.cellFromPoint({x: box.x + box.width,\n y: box.y + box.height})\n\n for (var x = start.x; x <= end.x; ++x)\n for (var y = start.y; y <= end.y; ++y)\n cells.push({x,y})\n\n return cells\n }", "title": "" }, { "docid": "17014562bb3affac7219b5c50559271a", "score": "0.59392536", "text": "intersect(r1, r2) {\n const r3 = {\n left: Math.max(r1.left, r2.left),\n top: Math.max(r1.top, r2.top),\n right: Math.min(r1.right, r2.right),\n bottom: Math.min(r1.bottom, r2.bottom)\n };\n r3.width = r3.right - r3.left;\n r3.height = r3.bottom - r3.top;\n return r3;\n }", "title": "" }, { "docid": "cde6d0252ec90125f6c03c75d2808725", "score": "0.59161156", "text": "function intersect(o1, d1, o2, d2) {\n return o1.plus(d1.times(o2.minus(o1).dot(d2.perp()) / d1.dot(d2.perp())));\n }", "title": "" }, { "docid": "8de233e0ac3753214aa6fc86e8c9467b", "score": "0.58811474", "text": "function intersects(x1, y1, w1, h1, x2, y2, w2, h2)\n{\n if(y2 + h2 < y1 ||\n x2 + w2 < x1 ||\n x2 > x1 + w1 ||\n y2 > y1 + h1)\n {\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "c8b4f51a50c3db262c9c0757dd60753e", "score": "0.58780843", "text": "function intersect(a, b, edge, bbox) {\n return edge & 8 ? [a[0] + (b[0] - a[0]) * (bbox[3] - a[1]) / (b[1] - a[1]), bbox[3]] : // top\n edge & 4 ? [a[0] + (b[0] - a[0]) * (bbox[1] - a[1]) / (b[1] - a[1]), bbox[1]] : // bottom\n edge & 2 ? [bbox[2], a[1] + (b[1] - a[1]) * (bbox[2] - a[0]) / (b[0] - a[0])] : // right\n edge & 1 ? [bbox[0], a[1] + (b[1] - a[1]) * (bbox[0] - a[0]) / (b[0] - a[0])] : // left\n null;\n }", "title": "" }, { "docid": "c4a01bc83a840f363f5e62ba70fd53f1", "score": "0.5876153", "text": "overlap(a){\n if(!Array.isArray(a))a=[a];\n a.forEach(o=>{\n \n if(!o.rect||!o.rect.overlaps(this.rect))return;//return if not overlapping\n\n this.hit(o);\n });\n }", "title": "" }, { "docid": "de9fd432a481123a3e984da6aac42302", "score": "0.58601856", "text": "function intersect(a, b){\n\tvar common = [];\n\t\n\tfor(var i=0 ; i<a.length ; ++i) {\n for(var j=0 ; j<b.length ; ++j) {\n if(a[i] == b[j]) {\n common.push(b[j]);\n\t\t\t\t// Remove element\n index = b.indexOf(b[j]);\n b.splice(index, 1);\n\t\t\t\tbreak;\n }\n }\n }\n\treturn common;\n}", "title": "" }, { "docid": "19d4571ddb0abb4e1ae6a5603d99a10a", "score": "0.5858138", "text": "function ppIntersect(h1, k1, p1, h2, k2, p2) {\n // Check for degenerate parabolas\n // WATCH VALUE\n const EPSILON = 0.00000001;\n if (Math.abs(p1) < EPSILON) {\n if (Math.abs(p2) < EPSILON) {\n // Both parabolas have no width\n return [];\n }\n var x = h1;\n var y = parabola_f(x, h2, k2, p2);\n return [vec2(x, y), vec2(x, y)];\n } else if (Math.abs(p2) < EPSILON) {\n var x = h2;\n var y = parabola_f(x, h1, k1, p1);\n return [vec2(x, y), vec2(x, y)];\n }\n\n var a = 0.25*(1/p1 - 1/p2);\n var b = 0.5*(h2/p2 - h1/p1);\n var c = 0.25*(h1*h1/p1 - h2*h2/p2) + k1 - k2;\n var disc = b*b - 4*a*c;\n var xintersections = [];\n if (a == 0) {\n // One solution -- no quadratic term\n xintersections.push(-c/b);\n } else if (disc < 0) {\n // No real solutions\n } else {\n // One or two solutions.\n var x1 = (-b + Math.sqrt(disc))/(2*a);\n var x2 = (-b - Math.sqrt(disc))/(2*a);\n if (x1 < x2) {\n xintersections.push(x1);\n xintersections.push(x2);\n } else {\n xintersections.push(x2);\n xintersections.push(x1);\n }\n }\n // return xintersections;\n var ret = [];\n xintersections.forEach(function (x) {\n var y = parabola_f(x, h1, k1, p1);//(x-h1)*(x-h1)/(4*p1) + k1;\n ret.push(vec2(x, y));\n });\n return ret;\n}", "title": "" }, { "docid": "5ce979f8757615991991a9fb417884b3", "score": "0.58472174", "text": "function colliding(obj1, obj2){\n\n\t//get bounding box area\n\tvar xArea1 = [];\n\tfor(var z=0;z<obj1.width;z++){\n\t\txArea1.push(obj1.x+z);\n\t}\n\tvar yArea1 = [];\n\tfor(var z=0;z<obj1.height;z++){\n\t\tyArea1.push(obj1.y+z);\n\t}\n\n\tvar xArea2 = [];\n\tfor(var z=0;z<obj2.width;z++){\n\t\txArea2.push(obj2.x+z);\n\t}\n\tvar yArea2 = [];\n\tfor(var z=0;z<obj2.height;z++){\n\t\tyArea2.push(obj2.y+z);\n\t}\n\n\t//find overlap\n\tvar xOver = false;\n\tfor(var a=0;a<xArea1.length;a++){\n\t\tif(inArr(xArea2, xArea1[a])){\n\t\t\txOver = true;\n\t\t\tbreak;\n\t\t}\n\t}\n\tvar yOver = false;\n\tfor(var b=0;b<yArea1.length;b++){\n\t\tif(inArr(yArea2, yArea1[b])){\n\t\t\tyOver = true;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn xOver && yOver;\n}", "title": "" }, { "docid": "794a36117b66c89d0d48d9097238f32f", "score": "0.58389425", "text": "function intersection(a,b){\n let i = 0;\n let j = 0;\n const result = [];\n while(i < a.length && j < b.length){\n const valueA = a[i];\n const valueB = b[j];\n if(valueA === valueB){\n result.push(valueA);\n i++;\n j++;\n }\n else if(valueA < valueB){\n i++;\n }\n else {\n j++;\n }\n }\n return result;\n\n}", "title": "" }, { "docid": "4c7152a89e7d125539eedfdb156b4d67", "score": "0.582722", "text": "function intersects(data, p1, q1, p2, q2) {\n return orient(data, p1, q1, p2) !== orient(data, p1, q1, q2) &&\n orient(data, p2, q2, p1) !== orient(data, p2, q2, q1);\n}", "title": "" }, { "docid": "4c7152a89e7d125539eedfdb156b4d67", "score": "0.582722", "text": "function intersects(data, p1, q1, p2, q2) {\n return orient(data, p1, q1, p2) !== orient(data, p1, q1, q2) &&\n orient(data, p2, q2, p1) !== orient(data, p2, q2, q1);\n}", "title": "" }, { "docid": "87194e11426582626a4cef5d6cc453e3", "score": "0.5803911", "text": "function drawIntersect() {\n if (!intersect) return;\n g.strokeStyle = colors.intersectStroke;\n g.fillStyle = colors.intersectFill;\n intersect.stroke(g);\n new Circle(intersect.start().x, intersect.start().y, 2.5).fill(g).stroke(g);\n new Circle(intersect.end().x, intersect.end().y, 2.5).fill(g).stroke(g);\n }", "title": "" }, { "docid": "8045ac641083c45612110b61e61ff515", "score": "0.5798466", "text": "function intersection(...arrays) {\n return arrays.reduce((acc, cur) =>\n acc.filter(p => cur.includes(p))\n );\n }", "title": "" }, { "docid": "4ff7a7598f5801c90c2f65fe3c39d713", "score": "0.5795107", "text": "function intersection(nums1, nums2) {\n return [...new Set(nums1.filter((el) => nums2.includes(el)))];\n}", "title": "" }, { "docid": "0486e8b2da8005afcb2123b7a90cc6a1", "score": "0.57912976", "text": "async function m$1(m,n,p$1,f){const y=n[0].spatialReference,a=r$2(m),g={...a.query,f:\"json\",sr:JSON.stringify(y.toJSON()),geometries:JSON.stringify(r$3(n)),geometry:JSON.stringify({geometryType:d(p$1),geometry:p$1.toJSON()})},u=e$1(g,f);return U(a.path+\"/intersect\",u).then((({data:e})=>(e.geometries||[]).map((e=>p(e).set({spatialReference:y})))))}", "title": "" }, { "docid": "05c141347cf7f3f055337488aeb28214", "score": "0.5788865", "text": "function intersect(a, b, edge, bbox) {\n return edge & 8 ? [a[0] + (b[0] - a[0]) * (bbox[3] - a[1]) / (b[1] - a[1]), bbox[3]] : // top\n edge & 4 ? [a[0] + (b[0] - a[0]) * (bbox[1] - a[1]) / (b[1] - a[1]), bbox[1]] : // bottom\n edge & 2 ? [bbox[2], a[1] + (b[1] - a[1]) * (bbox[2] - a[0]) / (b[0] - a[0])] : // right\n edge & 1 ? [bbox[0], a[1] + (b[1] - a[1]) * (bbox[0] - a[0]) / (b[0] - a[0])] : // left\n null;\n}", "title": "" }, { "docid": "03663a164ae42364174f072e47e615f2", "score": "0.57853425", "text": "function getIntersection(a, b) {\n\tvar c = b.slice();\n\tvar res = Array();\n\tvar i;\n\tfor (i = 0; i < a.length; i++) {\n\t\tif (c.indexOf(a[i]) > -1) {\n\t\t\tres.push(a[i]);\n\t\t\tc.splice(c.indexOf(a[i]), 1);\n\t\t}\n\t}\n\treturn res;\n}", "title": "" }, { "docid": "165b0e38b50b28669e5f86f1ed62f1af", "score": "0.5753699", "text": "intersect() {\n for (let i = 0; i < platforms.length; i++) {\n if (\n this.y > platforms[i].height &&\n this.x + this.size / 2 > platforms[i].x &&\n this.x < platforms[i].x + platforms[i].w\n ) {\n return true;\n }\n }\n }", "title": "" }, { "docid": "8e2b5a102b0725431b78e5a07b20d75d", "score": "0.5752025", "text": "function intersect(a, b) {\n var c = [];\n var _iteratorNormalCompletion11 = true;\n var _didIteratorError11 = false;\n var _iteratorError11 = undefined;\n\n try {\n for (var _iterator11 = a[Symbol.iterator](), _step11; !(_iteratorNormalCompletion11 = (_step11 = _iterator11.next()).done); _iteratorNormalCompletion11 = true) {\n var x = _step11.value;\n var _iteratorNormalCompletion12 = true;\n var _didIteratorError12 = false;\n var _iteratorError12 = undefined;\n\n try {\n for (var _iterator12 = b[Symbol.iterator](), _step12; !(_iteratorNormalCompletion12 = (_step12 = _iterator12.next()).done); _iteratorNormalCompletion12 = true) {\n var y = _step12.value;\n\n if (x === y) {\n c.push(x);\n break;\n }\n }\n } catch (err) {\n _didIteratorError12 = true;\n _iteratorError12 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion12 && _iterator12.return != null) {\n _iterator12.return();\n }\n } finally {\n if (_didIteratorError12) {\n throw _iteratorError12;\n }\n }\n }\n }\n } catch (err) {\n _didIteratorError11 = true;\n _iteratorError11 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion11 && _iterator11.return != null) {\n _iterator11.return();\n }\n } finally {\n if (_didIteratorError11) {\n throw _iteratorError11;\n }\n }\n }\n\n return c;\n}", "title": "" }, { "docid": "93397c798aee39b7c622c209ae44726e", "score": "0.5750826", "text": "closestCommonAncestor(vampire) {\n let vampCreator1 = this;\n let vampCreator2 = vampire;\n let ancestors1 = [];\n let ancestors2 = [];\n //create array of vamp1 ancestors\n while (vampCreator1) {\n ancestors1.push(vampCreator1);\n vampCreator1 = vampCreator1.creator;\n }\n //create array of vamp2 ancestors\n while (vampCreator2) {\n ancestors2.push(vampCreator2);\n vampCreator2 = vampCreator2.creator;\n }\n //compare arrays for first common ancestor\n for (let i = 0; i < ancestors1.length; i++) {\n for (let j = 0; j < ancestors2.length; j++) {\n if (ancestors1[i] === ancestors2[j]) {\n return ancestors2[j]\n }\n }\n }\n }", "title": "" }, { "docid": "6fdf7b85f519e2fbc9f4c46be815d633", "score": "0.5738573", "text": "function findIntersection(a, b, c) {\n let result = [];\n let x = 0,\n y = 0,\n z = 0;\n while (x < a.length && y < b.length && z < c.length) {\n if (a[x] === b[y] && b[y] === c[z]) {\n result.push(a[x]);\n x++, y++, z++;\n } else if (a[x] < b[y]) {\n ++x;\n } else if (b[y] < c[z]) {\n ++y;\n } else ++z;\n }\n console.log(result);\n}", "title": "" }, { "docid": "1af6fa906d9135b8a1822d5814317cac", "score": "0.57221615", "text": "getIntersections(top = false) {\n let rcs;\n if (top)\n rcs = this.topRaycasters;\n else\n rcs = this.bottomRaycasters;\n \n let intersects = [];\n for (let i = 0; i < 5; i++) {\n let rc = rcs[i];\n let collision = [...this.scene.platforms.collision];\n collision.push(this.scene.ceiling.ceiling);\n intersects = rc.intersectObjects(collision);\n if (intersects.length > 0) {\n break;\n }\n }\n return intersects;\n }", "title": "" }, { "docid": "b427aac3ba2e0adab0e88787be3ec190", "score": "0.5721308", "text": "function intersect(a, b, sep) {\n return sep > Math.max(\n b.x1 - a.x2,\n a.x1 - b.x2,\n b.y1 - a.y2,\n a.y1 - b.y2\n );\n}", "title": "" }, { "docid": "515db3bfb7081a392a742fee724c9cd3", "score": "0.57209235", "text": "function intersect_green(){\r\n\t wkt =( greenbuffer.features[0].geometry );\r\n\t MDAG.intersect_geom(wkt,pointbuffer,null);\r\n }", "title": "" }, { "docid": "86fd59b6707e42f8e268b9ce3b0d01e2", "score": "0.57194024", "text": "function determineIntersect(userShapes)\n{\n try{\n for (var i = 0; i < userShapes.length; i++){\n var userShape = userShapes[i];\n intersect(userShape,tracts)\n }\n for (var i = 0; i < userShapes.length; i++){\n var userShape = userShapes[i];\n intersect(userShape,commAreas)\n }\n return true\n }\n catch(err) {\n alert(\"Invalid shape. Please try again\");\n return false\n }\n\n}", "title": "" }, { "docid": "88cc1c1d29982a1e92a117a8a70b9436", "score": "0.5716859", "text": "function intersect_safe(a, b) {\n\n a.sort();\n b.sort();\n var ai = 0, bi = 0;\n var result = [];\n\n while (ai < a.length && bi < b.length) {\n if (a[ai] < b[bi]) { ai++; }\n else if (a[ai] > b[bi]) { bi++; }\n else /* they're equal */ {\n result.push(a[ai]);\n ai++;\n bi++;\n }\n }\n return result;\n}", "title": "" }, { "docid": "e07cfb8785f23db4f4d44ba3661f4d10", "score": "0.571536", "text": "function intersect$1(a, b, edge, bbox) {\n\t return edge & 8 ? [a[0] + (b[0] - a[0]) * (bbox[3] - a[1]) / (b[1] - a[1]), bbox[3]] : // top\n\t edge & 4 ? [a[0] + (b[0] - a[0]) * (bbox[1] - a[1]) / (b[1] - a[1]), bbox[1]] : // bottom\n\t edge & 2 ? [bbox[2], a[1] + (b[1] - a[1]) * (bbox[2] - a[0]) / (b[0] - a[0])] : // right\n\t edge & 1 ? [bbox[0], a[1] + (b[1] - a[1]) * (bbox[0] - a[0]) / (b[0] - a[0])] : // left\n\t null;\n\t}", "title": "" }, { "docid": "a4051cf4db7f00e0f9a81d097505c236", "score": "0.5712353", "text": "function AABBIntersect(ax, ay, aw, ah, bx, by, bw, bh) {\n return ax < bx+bw && bx < ax+aw && ay < by+bh && by < ay+ah; \n}", "title": "" }, { "docid": "1cdf23720d4b8feadb99bff18a6eb61c", "score": "0.57108337", "text": "function twoCirclesIntersections(c0, r0, c1, r1) {\r\n\t\tvar D = distanceTwoPoints(c0, c1);\r\n\t\tvar delta = 0.25 * Math.sqrt((D + r0 + r1) * (D + r0 - r1) * (D - r0 + r1) * (-D + r0 + r1));\r\n\t\tvar xPart1 = (c0[0] + c1[0]) / 2 + (c1[0] - c0[0]) * (r0 * r0 - r1 * r1) / 2 / D / D;\r\n\t\tvar xPart2 = 2 * (c0[1] - c1[1]) / D / D * delta;\r\n\t\tvar yPart1 = (c0[1] + c1[1]) / 2 + (c1[1] - c0[1]) * (r0 * r0 - r1 * r1) / 2 / D / D;\r\n\t\tvar yPart2 = 2 * (c0[0] - c1[0]) / D / D * delta;\r\n\t\treturn {\r\n\t\t\tp0: [\r\n\t\t\t\txPart1 + xPart2, \r\n\t\t\t\tyPart1 - yPart2\r\n\t\t\t],\r\n\t\t\tp1: [\r\n\t\t\t\txPart1 - xPart2, \r\n\t\t\t\tyPart1 + yPart2\r\n\t\t\t]\r\n\t\t};\r\n\t}", "title": "" }, { "docid": "ac28fcd343cbc6e2d834947791d95658", "score": "0.5708704", "text": "function intersection(array) {\n var result = [];\n var argsLength = arguments.length;\n for (var i = 0, length = getLength(array); i < length; i++) {\n var item = array[i];\n if (contains(result, item)) continue;\n var j;\n for (j = 1; j < argsLength; j++) {\n if (!contains(arguments[j], item)) break;\n }\n if (j === argsLength) result.push(item);\n }\n return result;\n }", "title": "" }, { "docid": "5cac4e85af100573127194bce68c90d7", "score": "0.5698384", "text": "function findIntersect(x, y, r) {\n var M = (y[1]-x[1])/(y[0]-x[0]);\n var signX = Math.sign(y[0]-x[0]);\n var signY = Math.sign(y[1]-x[1]);\n return [x[0] + signX*(r/Math.sqrt(1+M*M)), x[1] + signY*(r/Math.sqrt(1+1/(M*M)))];\n}", "title": "" }, { "docid": "6c50f97924c8e149e2305f8596072056", "score": "0.56977135", "text": "function getHVEdgeIntersections(pt1, pt2) {\n var out = [];\n var ptInt1 = onlyConstrainedPoint(pt1);\n var ptInt2 = onlyConstrainedPoint(pt2);\n if(ptInt1 && ptInt2 && sameEdge(ptInt1, ptInt2)) return out;\n\n if(ptInt1) out.push(ptInt1);\n if(ptInt2) out.push(ptInt2);\n return out;\n }", "title": "" }, { "docid": "f4a1b51a3854852ab7a3361430fd7745", "score": "0.5696115", "text": "function intersection( setA, setB ) {\n let _intersection = new Set();\n for ( let elem of setB ) {\n if ( setA.has( elem ) ) {\n _intersection.add( elem );\n }\n }\n return _intersection;\n}", "title": "" }, { "docid": "b965f201b13ae3e7a11500e768be9b05", "score": "0.56896466", "text": "get isIntersecting(): boolean {\n return this._nativeEntry.isIntersectingAboveThresholds;\n }", "title": "" }, { "docid": "2226de0ad7cfbccfafc762b7c8f5e2c4", "score": "0.56839263", "text": "function vecIntersection(p1,g1,p2,g2){ // get intersection point\n\tlet t1=g2.x*(p2.y-p1.y)-g2.y*(p2.x-p1.x);\n\tlet t2=g2.x*g1.y-g2.y*g1.x;\n\tlet t=t1/t2;\n\treturn {x:p1.x+t*g1.x,y:p1.y+t*g1.y};\n}", "title": "" }, { "docid": "20b90fd7f2f7d8efa1c43eafc4a2bd8d", "score": "0.56823146", "text": "function getIntersectingDisplayAreas(feature) {\n var parser = new jsts.io.OL3Parser();\n var boundaryFeatures = getFeaturesFromLayer(\"boundaryVector\");\n var jstsGeomOfFeature = parser.read(feature.getGeometry());\n var intersectingFeatures = [];\n boundaryFeatures.forEach(boundaryFeature => {\n var boundaryName = boundaryFeature.get(\"Name\");\n var jstsGeomOfBoundary = parser.read(boundaryFeature.getGeometry());\n var intersection = jstsGeomOfFeature.intersection(jstsGeomOfBoundary);\n var newFeature = new ol.Feature();\n newFeature.setGeometry(parser.write(intersection));\n newFeature.set(\"Name\", boundaryName);\n intersectingFeatures.push(newFeature);\n })\n return intersectingFeatures;\n}", "title": "" }, { "docid": "74e31b99d515da478e76742af9fd071f", "score": "0.5680174", "text": "function intersects(a, b) {\n var i = 0, j = 0;\n while (i < a.length && j < b.length) {\n if (a[i] < b[j]) i++;\n else if (a[i] > b[j]) j++;\n else return true;/* they're equal */\n }\n return false;\n}", "title": "" }, { "docid": "29deda25f9c2fae26794a11a10bcb8d3", "score": "0.5672525", "text": "function intersection(arr) {\n var arrs = slice_1(arguments, 1),\n result = filter_1(unique_1(arr), function(needle){\n return every_1(arrs, function(haystack){\n return contains_1(haystack, needle);\n });\n });\n return result;\n }", "title": "" }, { "docid": "c6bda644d97b5efc7020e4937d201ebc", "score": "0.5671212", "text": "function intersect(start0, end0, start1, end1) {\n if (equalArrays$1(start0, start1) || equalArrays$1(start0, end1) || equalArrays$1(end0, start1) || equalArrays$1(end1, start1)) return null;\n var x0 = start0[0],\n y0 = start0[1],\n x1 = end0[0],\n y1 = end0[1],\n x2 = start1[0],\n y2 = start1[1],\n x3 = end1[0],\n y3 = end1[1];\n var denom = (x0 - x1) * (y2 - y3) - (y0 - y1) * (x2 - x3);\n if (denom === 0) return null;\n var x4 = ((x0 * y1 - y0 * x1) * (x2 - x3) - (x0 - x1) * (x2 * y3 - y2 * x3)) / denom;\n var y4 = ((x0 * y1 - y0 * x1) * (y2 - y3) - (y0 - y1) * (x2 * y3 - y2 * x3)) / denom;\n return [x4, y4];\n }", "title": "" }, { "docid": "962ba5dc11bc35881a841db42b465794", "score": "0.56703025", "text": "function intersection(a, b) {\n (0, _invariant2.default)(!!a, 'intersection: Set a is not defined');\n (0, _invariant2.default)(!!b, 'intersection: Set b is not defined');\n return new _set2.default([].concat((0, _toConsumableArray3.default)(a)).filter(function (element) {\n return b.has(element);\n }));\n}", "title": "" }, { "docid": "c1a4f5f3fa02d5de9532e6b6853414bf", "score": "0.56698006", "text": "isIntersection() {\r\n return this.compilerType.isIntersection();\r\n }", "title": "" } ]
c30286f5e4bf33f0699632c0c925b597
Handle the DOM events for the widget.
[ { "docid": "250e1fcde8011e70241563add4b0ce49", "score": "0.0", "text": "handleEvent(event) {\n switch (event.type) {\n case 'paste':\n this._evtPaste(event);\n break;\n case 'dragenter':\n event.preventDefault();\n break;\n case 'dragover':\n event.preventDefault();\n break;\n case 'drop':\n this._evtNativeDrop(event);\n break;\n case 'lm-dragover':\n this._evtDragOver(event);\n break;\n case 'lm-drop':\n this._evtDrop(event);\n break;\n default:\n break;\n }\n }", "title": "" } ]
[ { "docid": "67bb676ef0a109c147735d1bcb522df1", "score": "0.70530957", "text": "function handleDomEvent () {\n\t\t\tthis._ractive.binding.handleChange();\n\t\t}", "title": "" }, { "docid": "d655b25ecca2d477f6f641cd85174874", "score": "0.66538393", "text": "function handleDomEvent() {\n this._ractive.binding.handleChange();\n}", "title": "" }, { "docid": "2973b2395ead417e2935932a59499038", "score": "0.6422982", "text": "_handleEvents() {\n\t\t// Container events\n\t\tthis.addEventListener('focusout', () => this.isFocused = false);\n\t\twindow.addEventListener('click', () => {\n\t\t\tthis.isFocused = false;\n\t\t});\n\n\t\t// Input events\n\t\tthis.$input.addEventListener('focusin', () => {\n\t\t\tthis.isInitialized = true;\n\t\t\tthis.isFocused = true;\n\t\t});\n\n\t\tthis.$input.addEventListener('click', e => {\n\t\t\te.stopPropagation();\n\t\t\tconst {left} = e.target.getBoundingClientRect();\n\t\t\tthis.$bar.style.transformOrigin = `${e.clientX - left}px center`;\n\t\t\tthis.isInitialized = true;\n\t\t\tthis.isFocused = true;\n\t\t});\n\n\t\tthis.$input.addEventListener('input', () => this.value = this.$input.value);\n\n\t\t// Submit form when user press Enter key in the input others than textarea\n\t\tif (this.type !== 'textarea') {\n\t\t\tthis.$input.addEventListener('keydown', e => e.key === 'Enter' ? this._submitForm() : null);\n\t\t} else {\n\t\t\t//@formatter:off\n\t\t\tthis.$input.addEventListener('focus', (this._onFocusTextarea).bind(this));\n\t\t\t//@formatter:on\n\t\t}\n\t}", "title": "" }, { "docid": "3ff3ce048aee50342705b53e0c675134", "score": "0.63625383", "text": "function initEventListeners(self){\n\t\tvar customBody = self.rootElem.find(\".cmeditor-main .customBody\");\n\n\t\t//switch tabs\n\t\tself.rootElem.find(\".tabs\").delegate(\"li\", \"click\", function(e) {\n\t\t\tvar target = $(e.target);\n\t\t\tif(!target.is(\"li\")){\n\t\t\t\ttarget = target.parent();\n\t\t\t}\n\t\t\tselectDocumentByIndex(self, self.rootElem.find(\".tabs li\").index(target));\n\t\t});\n\n\t\t//changes in custom inputs\n\t\tcustomBody.find(\".cmeditor-field\").on(\"change input blur\", function() { customElementChanged(self, $(this));});\n\t\tcustomBody.find(\"select.cmeditor-field\").on(\"change input blur\", function() {customElementChanged(self, $(this));});\n\t\tcustomBody.find(\"input[type='checkbox'].cmeditor-field\").on(\"change input blur\", function() { customElementChanged(self, $(this));});\n\t}", "title": "" }, { "docid": "4d518b274e8440fc949b181738b9f928", "score": "0.6162685", "text": "function mainController() {\r\n document.getElementById(\"widgIDInput\").addEventListener(\"input\", widgetName);\r\n document.getElementById(\"widgComment\").addEventListener(\"input\", widgetComment);\r\n document.getElementById(\"widgHeightInput\").addEventListener(\"input\", widgetHeight);\r\n document.getElementById(\"widgWidthInput\").addEventListener(\"input\", widgetWidth);\r\n document.getElementById(\"widgXPosInput\").addEventListener(\"input\", widgetXPos);\r\n document.getElementById(\"widgYPosInput\").addEventListener(\"input\", widgetYPos);\r\n document.getElementById(\"widgRadiusInput\").addEventListener(\"input\", widgetRadius);\r\n\r\n // Event Listeners for the mouse.\r\n canvas.addEventListener(\"mousemove\", positionManager);\r\n canvas.addEventListener(\"mouseout\", hideCoordinates);\r\n canvas.addEventListener(\"mousedown\", mouseDown);\r\n canvas.addEventListener(\"mouseup\", mouseUp);\r\n}", "title": "" }, { "docid": "79952ba10e47898002a7256d371674eb", "score": "0.6132583", "text": "attachDomElementEvents(){\n\n\t\t const $self = this;\n\n\t\t $self._logoutButton.addEvent('click', function () {\n\n\t\t\t $self.attemptLogout();\n\t\t });\n\n\t\t $self._openSidebarButton.addEvent('click', function () {\n\n\t\t \t$self.toggleSidebar();\n\t\t });\n\t }", "title": "" }, { "docid": "b72f3b3c387ccccdadd12b2ac47ad805", "score": "0.5974175", "text": "function addHandlers()\n {\n $valuesBox.on('change keyup blur', handleBoxChange);\n $chooserBox.on('click', 'button', chooseWinner);\n }", "title": "" }, { "docid": "6e694e485608dc3c28da07b814797516", "score": "0.5968811", "text": "addEventHandlers(){\n\n\n\t}", "title": "" }, { "docid": "7fc50a388e16145f1335226af98499fe", "score": "0.5964872", "text": "_bindEvents() {\n if (this._editor) {\n // Change event.\n this._editor.onDidChangeModelContent(event => this._onValueChanged(event));\n\n // Focus\n this._addDomEventListener(\"focus\", fn => this._editor.onDidFocusEditorWidget(fn));\n this._addDomEventListener(\"blur\", fn => this._editor.onDidBlurEditorWidget(fn));\n\n // Paste\n this._addDomEventListener(\"paste\", fn => this._editor.onDidPaste(fn));\n\n // Mouse\n this._addDomEventListener(\"mousedown\", fn => this._editor.onMouseDown(fn));\n this._addDomEventListener(\"mousemove\", fn => this._editor.onMouseMove(fn));\n this._addDomEventListener(\"mouseup\", fn => this._editor.onMouseUp(fn));\n\n // Key\n this._addDomEventListener(\"keydown\", fn => this._editor.onKeyDown(fn));\n this._addDomEventListener(\"keyup\", fn => this._editor.onKeyUp(fn));\n\n // Scroll\n this._editor.onDidScrollChange(event => this._onScrollChanged(event));\n }\n }", "title": "" }, { "docid": "2a5a705b5370659a12be9a836a8b7cdb", "score": "0.5933175", "text": "addEventHandlers(){\n\t\tthis.domElements.addButton.click(this.handleAdd);\n\t\tthis.domElements.cancelButton.click(this.handleCancel);\n\t}", "title": "" }, { "docid": "075c1b51645c9d682282ba1fc1b32f25", "score": "0.59265745", "text": "handleEvent(event) {\n if (this.isHidden || !this._editor) {\n return;\n }\n switch (event.type) {\n case 'keydown':\n this._evtKeydown(event);\n break;\n case 'mousedown':\n this._evtMousedown(event);\n break;\n case 'scroll':\n this._evtScroll(event);\n break;\n default:\n break;\n }\n }", "title": "" }, { "docid": "17d943a481bed3c3ec5522a814c1af66", "score": "0.5913479", "text": "events() {\n\t\tthis.openButton.on(\"click\", this.openOverlay.bind(this));\n\t\tthis.closeButton.on(\"click\", this.closeOverlay.bind(this));\n\t\t$(document).on(\"keydown\", this.keyPressDispatcher.bind(this));\t\t\n\t\tthis.searchField.on(\"keyup\", this.typingLogic.bind(this));\n\t}", "title": "" }, { "docid": "9a5473e5c93de77d82bb7addf38cbf6e", "score": "0.58890164", "text": "function init() {\n setDomEvents();\n }", "title": "" }, { "docid": "f2eca4129aa6e0bf3b386e83b80c78d6", "score": "0.58593786", "text": "async firstUpdated() {\n const mashupWidget = this.getRenderRoot();\n if (mashupWidget) {\n mashupWidget.addEventListener('click', this.clickHandler);\n mashupWidget.addEventListener('focusin', this.focusHandler);\n mashupWidget.addEventListener('change', this.changeHandler);\n mashupWidget.addEventListener('keyup', this.keyupHandler);\n }\n }", "title": "" }, { "docid": "eb9695e85d668d71de1ab29de5fb24bc", "score": "0.58506656", "text": "addEventHandlers() {\n\t\t$(\"#addButton\").on(\"click\",this.handleAdd);\n\t\t$(\"#cancelButton\").on(\"click\",this.handleCancel);\n\t\t$(\"#retrieveData\").on(\"click\",this.retrieveStudentDataFromServer);\n\t}", "title": "" }, { "docid": "809821479d535d47043042f0dae10152", "score": "0.58253443", "text": "function addClickEventToElems() {\n view.dishView.on(\"click\", \".dishPic\", function() {\n model.setCurrentSelectedDish(this.id);\n model.setCurrentName(this.innerText);\n overallController.showDishDetails(this.id);\n });\n }", "title": "" }, { "docid": "06d6982bee0a35a72449b93ebe30b309", "score": "0.5816877", "text": "bindEvents() { }", "title": "" }, { "docid": "c22eada1cfb1d2e9c74e1aa968084394", "score": "0.5778004", "text": "_initEvents() {\r\n\t\t\tthis.$el.addEventListener('click', this._onClick.bind(this));\r\n\t\t}", "title": "" }, { "docid": "a50c9c80d1c8ce71394da2936a9c9978", "score": "0.5776338", "text": "_addEventListeners() {\n this.__addDomEventListener(window, \"resize\", e => this._onResize(e));\n this.__addDomEventListener(window, \"mouseup\", e => this._onMouseUp(e));\n\n // Calendar container listeners, essencially for days elements\n const domElement = this._dom.element;\n\n this.__addDomEventListener(domElement, \"click\", e =>\n this._onCalendarEvent(e)\n );\n this.__addDomEventListener(domElement, \"mouseover\", e =>\n this._onCalendarEvent(e)\n );\n this.__addDomEventListener(domElement, \"mousedown\", e =>\n this._onCalendarEvent(e)\n );\n this.__addDomEventListener(domElement, \"mouseup\", e =>\n this._onCalendarEvent(e)\n );\n\n // Other elements\n if (this.viewModel.showNavigationToolBar) {\n this.__addDomEventListener(this._dom.buttonNavPreviousYear, \"click\", e =>\n this.viewModel.decrementCurrentYear(e)\n );\n\n this.__addDomEventListener(this._dom.buttonNavNextYear, \"click\", e =>\n this.viewModel.incrementCurrentYear(e)\n );\n }\n }", "title": "" }, { "docid": "f5b114920c507aa171e8abfab44df2c6", "score": "0.5763934", "text": "function handler(evt){\n\t\t// Poor man's event propagation. Don't propagate event to ancestors of evt.relatedTarget,\n\t\t// to avoid processing mouseout events moving from a widget's domNode to a descendant node;\n\t\t// such events shouldn't be interpreted as a mouseleave on the widget.\n\t\tif(!dom.isDescendant(evt.relatedTarget, evt.target)){\n\t\t\tfor(var node = evt.target; node && node != evt.relatedTarget; node = node.parentNode){\n\t\t\t\t// Process any nodes with _cssState property. They are generally widget root nodes,\n\t\t\t\t// but could also be sub-nodes within a widget\n\t\t\t\tif(node._cssState){\n\t\t\t\t\tvar widget = registry.getEnclosingWidget(node);\n\t\t\t\t\tif(widget){\n\t\t\t\t\t\tif(node == widget.domNode){\n\t\t\t\t\t\t\t// event on the widget's root node\n\t\t\t\t\t\t\twidget._cssMouseEvent(evt);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t// event on widget's sub-node\n\t\t\t\t\t\t\twidget._subnodeCssMouseEvent(node, node._cssState, evt);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "61491667401e71539f3df4f2068f2611", "score": "0.5756931", "text": "handleEvents() {\n }", "title": "" }, { "docid": "27ce334d7ec76c8694cc72dca05c1219", "score": "0.5736409", "text": "function wireEvents() {\r\n $(\".multiselect\").on(\"change\", handleQueryChange);\r\n $(QUERY_EDITOR).on(\"blur\", \"input[type=text]\", handleQueryChange); \r\n $(DOWNLOAD_QUERY).on(\"click\", handleQueryDownload);\r\n $(DOWNLOAD_DATA).on(\"click\", handleDataDownload);\r\n $(COUNTID).on(\"change\", handleQueryChange);\r\n }", "title": "" }, { "docid": "f8f4bcaded887ecc6c45a19c68670880", "score": "0.56914395", "text": "_events() {\n var _this = this;\n\n this._updateMqHandler = this._update.bind(this);\n\n $(window).on('changed.zf.mediaquery', this._updateMqHandler);\n\n this.$toggler.on('click.zf.responsiveToggle', this.toggleMenu.bind(this));\n }", "title": "" }, { "docid": "72b42453121989d283904fa79128392d", "score": "0.56559014", "text": "addEventHandlers(){\n\t this.elementConfig.addButton.click(this.handleAdd);\n\t this.elementConfig.cancelButton.click(this.handleCancel);\n\t this.elementConfig.serverButton.click(this.getDataFromServer);\n }", "title": "" }, { "docid": "41c67e4f6f7f7ff84f501056dcb0f2c1", "score": "0.5653", "text": "function handleLoad(_event) {\n document.addEventListener(\"mousemove\", setInfoBox);\n document.addEventListener(\"click\", logInfo);\n document.addEventListener(\"keyup\", logInfo);\n myBody.addEventListener(\"click\", logInfo);\n myBody.addEventListener(\"keyup\", logInfo);\n div0.addEventListener(\"click\", logInfo);\n div0.addEventListener(\"keyup\", logInfo);\n div1.addEventListener(\"click\", logInfo);\n div1.addEventListener(\"keyup\", logInfo);\n }", "title": "" }, { "docid": "fc5cfd9a1770891bee3e5bd7d66713db", "score": "0.5643619", "text": "_events() {\n \tthis._addKeyHandler();\n \tthis._addClickHandler();\n \tthis._addFullscreenHandler();\n }", "title": "" }, { "docid": "70a5eb02bbc82f9241bb97e4c423aa8e", "score": "0.56423897", "text": "function addEventListeners() {\n orderUtils.eventHandler(\".js-enterDrink\", \"click\", createDrink);\n orderUtils.eventHandler(\".js-submitRound\", \"click\", submitRound);\n orderUtils.eventHandler(\".js-reset\", \"click\", resetData);\n orderUtils.eventHandler(\".js-savePlace\", \"click\", savePlace);\n orderUtils.eventHandler(\".js-loadPlace\", \"click\", loadPlace);\n orderUtils.eventHandler(\".js-sumModal\", \"click\", showSum);\n orderUtils.eventHandler(\".js-mainButton\", \"click\", modalShow);\n orderUtils.eventHandler(\".js-backButton\", \"click\", stepBack);\n orderUtils.eventHandler(\".js-languageChange \", \"click\", languageChange);\n orderUtils.eventHandler(\".js-splitModal \", \"click\", toggleSplitModal);\n }", "title": "" }, { "docid": "ce3cca8e9b67583b047076bb7ad6d07d", "score": "0.5631697", "text": "triggerDomChangedEvent () {\n $(window).trigger(DOM_CHANGED_EVENT);\n }", "title": "" }, { "docid": "295f9f79f9d591f8c4e6aa954bbcb552", "score": "0.5622386", "text": "eventListeners() {\n this.handleLoad();\n this.constructor.handleInView();\n this.handleEnd();\n }", "title": "" }, { "docid": "b53c21c4550980fa6be2b4950db9465d", "score": "0.56214285", "text": "selectWidgetManager() {\n this.selectButton.addEventListener(\"keydown\", (event) => {\n this.handleSelectWidgetInteraction(event.keyCode);\n });\n this.selectButton.addEventListener(\"click\", (event) => {\n event.preventDefault();\n this.toggleDisplayManager(this.expanded);\n this.toggleSelectOptions(\"null\");\n });\n this.selectList.addEventListener(\"keydown\", (event) => {\n this.handleSelectWidgetInteraction(event.keyCode);\n });\n this.selectList.addEventListener(\"click\", (event) => {\n event.preventDefault();\n this.updateOptionAndButton(event.target);\n this.closeSelectBox(event.target);\n this.onOptionSelect();\n });\n }", "title": "" }, { "docid": "4abe3693a0ca0185099d8da37e3246ee", "score": "0.56017005", "text": "registerEvents() {\n this.eventManager.addEventListener(this.hot.rootElement, 'change', (e) => this.clickCheckbox(e));\n this.eventManager.addEventListener(this.hot.rootElement, 'change', () => this.getSelectedValues());\n }", "title": "" }, { "docid": "c9435936768631a494cb58fc417cf2ce", "score": "0.5585927", "text": "function bindToEvents() {\n $el.on('click', '.close', hide)\n $el.on('click', '.edit', edit)\n $el.on('click', '.destroy', destroy)\n $el.on('click', '.marker h3 a', show)\n $el.on('click', '.marker header .comment a', show)\n $el.on('change', 'select[name=template]', setTemplate)\n $el.on('submit', 'form.marker', save)\n $el.on('submit', 'form.message', saveMessage)\n\n //$document.on('marker:edit', edit)\n $document.on('marker:show', show)\n $document.on('marker:activate', show)\n\n hoodie.store.on('marker:add', handleNewMarker )\n hoodie.store.on('message:add', handleNewMessage )\n hoodie.account.on('signout', hide )\n }", "title": "" }, { "docid": "780f7d5668ac73f320b2ce21948348a5", "score": "0.55759376", "text": "bindEvents() {\n document.addEventListener('click', this.handleClickEvent.bind(this));\n document.addEventListener('keydown', this.handleKeydownEvent.bind(this));\n }", "title": "" }, { "docid": "5f516ef3073c46c4be0d26136973371d", "score": "0.5575049", "text": "bind() {\n this.addButtonsHandler();\n this.removeButtonsHandler();\n this.ticketHandler();\n }", "title": "" }, { "docid": "7a23071aee05cd2c56c61c43ca36b79e", "score": "0.5566125", "text": "registerEvents() {\n\t\tthis.container = $('#page');\n\t\tthis.registerRecordEvents();\n\t\tthis.registerWidgetsEvents();\n\t\tthis.registerRelatedListEvents();\n\t\tthis.registerKeyboardShortcutsEvent();\n\t}", "title": "" }, { "docid": "57435a5cdf77aa8150a2b764a8809757", "score": "0.5565279", "text": "bindEventHandlers() {\n\t\tthis.vent.sub('save', () => this.save());\n\t\tthis.vent.sub('player:nameChanged', () => {\n\t\t\tthis.render();\n\t\t\tthis.save();\n\t\t});\n\t\tthis.vent.sub('render', () => this.render());\n\t\tthis.vent.sub('drawCardComplete', () => this.onDrawCardComplete());\n\t\tthis.vent.sub('error', (error) => this.error(error));\n\n\t\tthis.vent.sub('startTurn', () => this.startTurn());\n\t\tthis.vent.sub('endTurn', () => this.endTurn());\n\n\t\tvar self = this;\n\t\tthis.$body.on('keydown', (event) => {\n\t\t\tthis.processKeydownEvent(event);\n\t\t\treturn;\n\t\t});\n\n\t\t$('.deck__card--draw-pile').on('click', function(event) {\n\t\t\tevent.preventDefault();\n\t\t\tvar $this = $(this);\n\t\t\t//prevent rapid fire clicks from triggering multiple draws, and ignore if game is over or turn in progress.\n\t\t\tif (!$this.hasClass('clicked') && !self.$body.hasClass(GAME_OVER_CLASS) && !self.$body.hasClass(TURN_IN_PROGRESS_CLASS)) {\n\t\t\t\tself.onDrawPileClick();\n\t\t\t}\n\t\t\t$this.addClass('clicked');\n\t\t\tsetTimeout(() => {\n\t\t\t\t$this.removeClass('clicked');\n\t\t\t}, 1500);\n\t\t});\n\n\t\t$('.guess__buttons .button').on('click', function(event) {\n\t\t\tevent.preventDefault();\n\t\t\tvar $this = $(this);\n\t\t\tif ($this.hasClass('button-pass')) {\n\t\t\t\tself.pass();\n\t\t\t} else {\n\t\t\t\tself.submitGuess($this.hasClass('button-lower') ? GUESS_LO : GUESS_HI);\n\t\t\t}\n\t\t});\n\n\t\t$(document).on('click', '.modal-link--alert', function(event) {\n\t\t\tevent.preventDefault();\n\t\t\tvex.dialog.alert($(this).attr('data-alert-content'));\n\t\t});\n\t}", "title": "" }, { "docid": "1df90145e6c500bff0c67c9f0d3811c5", "score": "0.55506057", "text": "_eventListener(){\n\t\t// Expose event listeners for controller plugins\n\t\telectron.ipcMain.on('glasscord_refresh', () => {\n\t\t\tthis._log('IPC requested update', 'log');\n\t\t\tthis._updateVariables();\n\t\t});\n\t\t// Everything else can be controlled via CSS styling\n\t\t\n\t\t// Hook when the window is loaded\n\t\tthis.win.webContents.on('dom-ready', () => {\n\t\t\tthis._hook();\n\t\t});\n\t}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.55489963", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.55489963", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.55489963", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.55489963", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.55489963", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.55489963", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.55489963", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.55489963", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.55489963", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.55489963", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.55489963", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.55489963", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.55489963", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.55489963", "text": "function EventHandlers() {}", "title": "" }, { "docid": "6c3ef03817fd9157c120d48c3f5b9ba3", "score": "0.5541214", "text": "_bindEvents() {\n this._getContainer()\n .delegate('.btn.edit-contact', 'click', this._onEditClick.bind(this))\n .delegate('.btn.delete-contact', 'click', this._onDeleteClick.bind(this))\n .delegate('.sort-column', 'click', this._onSortColumnClick.bind(this))\n ;\n }", "title": "" }, { "docid": "98f35c82e63e27a139d0cb48f93167d0", "score": "0.5535545", "text": "bindEvents() {\n\t\t// Listen for addition/removal of child nodes amd update toggler height\n\t\tconst observer = new MutationObserver(mutations => {\n\t\t\tmutations.forEach(mutation => {\n\t\t\t\tif (mutation.type === 'childList') {\n\t\t\t\t\tthis.updateHeight();\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t\tobserver.observe(this.el, { childList: true });\n\n\t\t// Global events\n\t\tif (this.options.globalEvent) {\n\t\t\tthis.registerEvent('{{this.options.globalEvent}}', 'toggle', true);\n\t\t}\n\t}", "title": "" }, { "docid": "ae2300333b8e86beae5c9c3dfb607ff5", "score": "0.5534636", "text": "bindUI() {\n super.bindUI();\n\n this.on('focus', this.onFocus);\n this.on('blur', this.onBlur);\n this.on('change', this.onNodeChange);\n this.on('keydown', this.onKeyDown);\n this.on('mousedown', this.onMouseDown);\n this.on(['mouseup', 'mouseout'], this.deactivate);\n this.on('click', this.onClick);\n }", "title": "" }, { "docid": "51fb7dee014b7ae0b3d07fb07a7f8305", "score": "0.552809", "text": "function bindDomEvents() {\n\n $(document).bind(\"click\", function (e) {\n\n var $obj = $(e.target),\n item = $obj.is(\"div.item\") ? $obj : $obj.parents(\"div.item\");\n\n if ($obj.not(\"a\") && item.length !== 0) {\n router.go(document.location.hash + \"/edit/\" + item.attr(\"data-id\"));\n } else if ($obj.is(\"input[name=delete]\")) {\n $(\"#deleteform\").submit();\n } else if ($obj.is(\"button.syncbtn\")) {\n $(\"#syncaction\").val($obj.attr(\"data-action\"));\n }\n });\n\n $(document).bind(\"change\", function(e) {\n if ($(e.target).attr(\"data-gravatar\")) {\n $(\"#avapreview\")\n .attr(\"src\", getProfile($(e.target).val()).gravatar_url);\n }\n });\n\n $(\"input\").live(\"blur\", function (e) {\n var $name = $(\"#signup_name\"), $obj = $(e.target);\n if ($obj.attr(\"id\") === \"signup_email\") {\n $(\"#gravatar_preview\")\n .attr(\"src\", 'http://www.gravatar.com/avatar/'\n + hex_md5($obj.val()) + '.jpg?s=40&d=identicon');\n if ($name.val() === \"\") {\n $name.val($obj.val().split(\"@\")[0]);\n }\n }\n });\n }", "title": "" }, { "docid": "a0172f0715ace369bf8236cb196ac101", "score": "0.55268276", "text": "function _onDomChange() {\n // setup the main menu\n _initializePages();\n\n // listen for Chrome messages\n Chrome.Msg.listen(_onChromeMessage);\n\n // listen for changes to localStorage\n addEventListener('storage', _onStorageChanged, false);\n\n // listen for changes to chrome.storage\n chrome.storage.onChanged.addListener(_onChromeStorageChanged);\n\n // listen for messages from the service worker\n navigator.serviceWorker.addEventListener('message', _onSWMessage);\n\n // listen for changes to highlighted tabs\n chrome.tabs.onHighlighted.addListener(_onHighlighted);\n\n // check for optional permissions\n _checkOptionalPermissions();\n }", "title": "" }, { "docid": "9d8f148593705ea5ae81a5bdf403c745", "score": "0.5518485", "text": "_listenWidgetsEvents() {\n this.addEventListener('notification', (e) => {\n this.notification(e.detail);\n });\n this.addEventListener('notification.close', (e) => {\n var _a;\n this.notification(Object.assign({ action: 'hide' }, ((_a = e.detail) !== null && _a !== void 0 ? _a : {})));\n });\n this.addEventListener('dashboard.hide', (e) => {\n this.close();\n });\n this.addEventListener('dashboard.show', (e) => {\n this.open();\n });\n }", "title": "" }, { "docid": "c3f3995ee9a94c82c92e77296f41606e", "score": "0.55068237", "text": "function addEventListeners() {\n // window event\n\n $(window).resize(callbacks.windowResize);\n $(window).keydown(callbacks.keyDown);\n\n // click handler\n $(document.body).mousemove(callbacks.mouseMove, false);\n $(document.body).mousedown(callbacks.mouseDown);\n $(document.body).mouseup(callbacks.mouseUp);\n $(document.body).click(callbacks.mouseClick);\n\n var container = $container[0];\n\n container.addEventListener('dragover', cancel, false);\n container.addEventListener('dragenter', cancel, false);\n container.addEventListener('dragexit', cancel, false);\n }", "title": "" }, { "docid": "b8689e31d57a5b3f4a29601010ad9a2d", "score": "0.5496707", "text": "setupUI() {\n\n this.renderCanvas.addEventListener('mousedown', (e) => this.onMouseDownCanvas(e));\n this.renderCanvas.addEventListener('mousemove', (e) => this.onMouseMoveCanvas(e));\n this.renderCanvas.addEventListener('mouseup', (e) => this.onMouseUpCanvas(e));\n this.renderCanvas.addEventListener('mouseout', (e) => this.onMouseOutCanvas(e));\n }", "title": "" }, { "docid": "df53e526c3fa380f1725ec397d9e28ad", "score": "0.5495724", "text": "function bindEvents() {\n\t\t$('.ck-filter-close, .ck-filters').on('click', togglePanel);\n\t\t$('.ck-save').on('click', onSave);\n\t}", "title": "" }, { "docid": "2f95572ea4a936f41bbdcd077395afa5", "score": "0.54846495", "text": "function bindEvents() {\n if (self.config.wrap) {\n [\"open\", \"close\", \"toggle\", \"clear\"].forEach(function (evt) {\n Array.prototype.forEach.call(self.element.querySelectorAll(\"[data-\" + evt + \"]\"), function (el) {\n return bind(el, \"click\", self[evt]);\n });\n });\n }\n if (self.isMobile) {\n setupMobile();\n return;\n }\n var debouncedResize = debounce(onResize, 50);\n self._debouncedChange = debounce(triggerChange, DEBOUNCED_CHANGE_MS);\n if (self.daysContainer && !/iPhone|iPad|iPod/i.test(navigator.userAgent))\n bind(self.daysContainer, \"mouseover\", function (e) {\n if (self.config.mode === \"range\")\n onMouseOver(e.target);\n });\n bind(window.document.body, \"keydown\", onKeyDown);\n if (!self.config.inline && !self.config.static)\n bind(window, \"resize\", debouncedResize);\n if (window.ontouchstart !== undefined)\n bind(window.document, \"touchstart\", documentClick);\n else\n bind(window.document, \"mousedown\", onClick(documentClick));\n bind(window.document, \"focus\", documentClick, { capture: true });\n if (self.config.clickOpens === true) {\n bind(self._input, \"focus\", self.open);\n bind(self._input, \"mousedown\", onClick(self.open));\n }\n if (self.daysContainer !== undefined) {\n bind(self.monthNav, \"mousedown\", onClick(onMonthNavClick));\n bind(self.monthNav, [\"keyup\", \"increment\"], onYearInput);\n bind(self.daysContainer, \"mousedown\", onClick(selectDate));\n }\n if (self.timeContainer !== undefined &&\n self.minuteElement !== undefined &&\n self.hourElement !== undefined) {\n var selText = function (e) {\n return e.target.select();\n };\n bind(self.timeContainer, [\"increment\"], updateTime);\n bind(self.timeContainer, \"blur\", updateTime, { capture: true });\n bind(self.timeContainer, \"mousedown\", onClick(timeIncrement));\n bind([self.hourElement, self.minuteElement], [\"focus\", \"click\"], selText);\n if (self.secondElement !== undefined)\n bind(self.secondElement, \"focus\", function () { return self.secondElement && self.secondElement.select(); });\n if (self.amPM !== undefined) {\n bind(self.amPM, \"mousedown\", onClick(function (e) {\n updateTime(e);\n triggerChange();\n }));\n }\n }\n }", "title": "" }, { "docid": "b3560c2fe37ad563371a04ace6f3d886", "score": "0.5481959", "text": "function _HookEvents() {\n var el = _id('list_search_text');\n el.tabIndex = 1;\n el.addEventListener('keypress', listSearchKP , false);\n el.addEventListener('input' , listSearchChg, false);\n\n el = _id('toc_search_text');\n el.tabIndex = 2;\n el.addEventListener('keypress', tocSearchKP , false);\n el.addEventListener('input' , tocSearchChg, false);\n\n _id('list_header').addEventListener('click', listClkHeader, false);\n _id('toc_header' ).addEventListener('click', tocClkHeader, false);\n\n oList.nav.addEventListener('click', paneClk.bind(oList), false);\n oToc.nav.addEventListener('click', paneClk.bind(oToc) , false);\n\n _id('list_sizer').addEventListener('mousedown', oList.resizeMD, false);\n _id('toc_sizer' ).addEventListener('mousedown', oToc.resizeMD, false);\n\n if (isTouch) {\n _id('list_sizer').addEventListener('touchstart', oList.resizeTS, false);\n _id('toc_sizer' ).addEventListener('touchstart', oToc.resizeTS, false);\n }\n}", "title": "" }, { "docid": "1f28ab99273d7c01a60b6e9615228c99", "score": "0.5479993", "text": "function eventHandlers(){\n\t$('.logo, .up-arrow').on('click', scrollToTop);\n\t$('header nav a').on('click', scrollTo);\n\t$('.sticky').sticky({ topSpacing: 0 });\n\t$('#contact-form').submit(formSubmission);\n}", "title": "" }, { "docid": "abbd5e2ddcefcbc8f3e446e12ac0210f", "score": "0.5471726", "text": "setupEvents(){\n this.saveHolder.addEventListener('click', this.handelDelete.bind(this)); // delete event on recycle bin logo \n // this.saveHolder.querySelector('li').addEventListener('click', this.handlePopup.bind(this)); // handle popup event on article(li) \n }", "title": "" }, { "docid": "4a5712a34ccc6494b47c6ac4cc84ad59", "score": "0.5440563", "text": "function initEvents(){\n\t\t\n\t\t//strip mouse down - drag start\n\t\tg_objStrip.bind(\"mousedown touchstart\",onTouchStart);\n\n\t\t\n\t\t//on body mouse up - drag end\n\t\tjQuery(window).add(\"body\").bind(\"mouseup touchend\",onTouchEnd);\n\t\t\t\t\n\t\t//on body move\n\t\tjQuery(\"body\").bind(\"mousemove touchmove\", onTouchMove);\n\t\t\n\t}", "title": "" }, { "docid": "4a5712a34ccc6494b47c6ac4cc84ad59", "score": "0.5440563", "text": "function initEvents(){\n\t\t\n\t\t//strip mouse down - drag start\n\t\tg_objStrip.bind(\"mousedown touchstart\",onTouchStart);\n\n\t\t\n\t\t//on body mouse up - drag end\n\t\tjQuery(window).add(\"body\").bind(\"mouseup touchend\",onTouchEnd);\n\t\t\t\t\n\t\t//on body move\n\t\tjQuery(\"body\").bind(\"mousemove touchmove\", onTouchMove);\n\t\t\n\t}", "title": "" }, { "docid": "4a5a94be7247961ae7579f62e57c8690", "score": "0.5439536", "text": "_initEvents () {\n this.el.addEventListener('submit', e => this._submitForm(e));\n }", "title": "" }, { "docid": "8c5a55934ec3e0abb78de0b983a320d9", "score": "0.543371", "text": "function addEvents() {\n\t\taddEvent(chart.container, MOUSEDOWN, mouseDownHandler);\n\t\taddEvent(chart.container, MOUSEMOVE, mouseMoveHandler);\n\t\taddEvent(document, MOUSEUP, mouseUpHandler);\n\t}", "title": "" }, { "docid": "f918c03036a690ebdee43e2c9cbd8566", "score": "0.542802", "text": "initializeEvents() {\n this.controlPanel.on(\"click\", this.selector, (event) => {\n this.open = !this.open;\n this.refresh();\n });\n }", "title": "" }, { "docid": "5179157c3c056df2830a976718da4c2a", "score": "0.54273736", "text": "function registerEvents() {\n var elm, nodes, i, x;\n \n // top-level buttons\n elm = dom.find(\"task-button\");\n if(elm) {\n elm.onclick = showTasks;\n }\n \n elm = dom.find(\"category-button\");\n if(elm) {\n elm.onclick = showCategories;\n }\n \n elm = dom.find(\"user-button\");\n if(elm) {\n elm.onclick = showUsers;\n }\n \n //filter links\n nodes = dom.classNodes(\"filter-link\");\n for(i=0, x=nodes.length; i<x; i++) {\n nodes[i].onclick = selectFilter;\n } \n \n // filter forms\n nodes = dom.classNodes(\"filter\");\n for(i=0, x=nodes.length; i<x; i++) {\n if(nodes[i].nodeName===\"FORM\") {\n nodes[i].onsubmit = sendFilter;\n }\n }\n\n // cancel buttons forms\n nodes = dom.classNodes(\"cancel-button\");\n for(i=0, x=nodes.length; i<x; i++) {\n nodes[i].onclick = hideDialogs;\n } \n }", "title": "" }, { "docid": "ee5e6d553196a00933eb86984c9a1fb1", "score": "0.542651", "text": "function bindEvents() {\n getGraphSelectElement().find('a').on('click', onClickGraphSelectItem)\n getSettingsSelectElement().find('div.item').on('click', onClickSettingsSelectItem)\n }", "title": "" }, { "docid": "73c8c1e793dc8aaee05e35d0e90c1f69", "score": "0.54200137", "text": "newElementCallback(event){\n\n }", "title": "" }, { "docid": "d040afaaa5648db2653c6340a9473ace", "score": "0.54113865", "text": "function plugInHandlers(){\n console.log('selectExperimentDisplayImagesAndLabelCtrl:plugInHandlers')\n $('#btnLoadExperiments').on('click', btnLoadExperimentsHandler);\n $('#btnLoadTag').on('click', btnLoadTagHandler);\n $('#btnSaveTag').on('click', btnSaveTagHandler);\n\n internalPaginationCtrl = paginationCtrl;\n if (internalPaginationCtrl)\n {\n internalPaginationCtrl.setCallBacks(refreshMainPage, btnLoadExperimentsHandler, null)\n internalPaginationCtrl.postProcess(viewHTML);\n }\n\n resetCtrl(); \n }", "title": "" }, { "docid": "d649e38098eef4143c56dc4c32b1af1e", "score": "0.54037315", "text": "setHandlers() {\n this.$form.on('submit', (e) => {\n e.preventDefault();\n var words = this.createList(this.$textarea.val());\n this.render(words);\n });\n this.$cancelButton.on('mousedown', (e) => {\n e.preventDefault();\n this.$textarea.val('').focus();\n this.render([]);\n });\n }", "title": "" }, { "docid": "54f35423f1e82378b16374736f5e871e", "score": "0.54010755", "text": "function bindEvents() {\n if (self.config.wrap) {\n [\"open\", \"close\", \"toggle\", \"clear\"].forEach(function (evt) {\n Array.prototype.forEach.call(self.element.querySelectorAll(\"[data-\" + evt + \"]\"), function (el) {\n return bind(el, \"click\", self[evt]);\n });\n });\n }\n\n if (self.isMobile) {\n setupMobile();\n return;\n }\n\n var debouncedResize = debounce(onResize, 50);\n self._debouncedChange = debounce(triggerChange, DEBOUNCED_CHANGE_MS);\n if (self.daysContainer && !/iPhone|iPad|iPod/i.test(navigator.userAgent)) bind(self.daysContainer, \"mouseover\", function (e) {\n if (self.config.mode === \"range\") onMouseOver(e.target);\n });\n bind(window.document.body, \"keydown\", onKeyDown);\n if (!self.config.static) bind(self._input, \"keydown\", onKeyDown);\n if (!self.config.inline && !self.config.static) bind(window, \"resize\", debouncedResize);\n if (window.ontouchstart !== undefined) bind(window.document, \"click\", documentClick);else bind(window.document, \"mousedown\", onClick(documentClick));\n bind(window.document, \"focus\", documentClick, {\n capture: true\n });\n\n if (self.config.clickOpens === true) {\n bind(self._input, \"focus\", self.open);\n bind(self._input, \"mousedown\", onClick(self.open));\n }\n\n if (self.daysContainer !== undefined) {\n bind(self.monthNav, \"mousedown\", onClick(onMonthNavClick));\n bind(self.monthNav, [\"keyup\", \"increment\"], onYearInput);\n bind(self.daysContainer, \"mousedown\", onClick(selectDate));\n }\n\n if (self.timeContainer !== undefined && self.minuteElement !== undefined && self.hourElement !== undefined) {\n var selText = function (e) {\n return e.target.select();\n };\n\n bind(self.timeContainer, [\"increment\"], updateTime);\n bind(self.timeContainer, \"blur\", updateTime, {\n capture: true\n });\n bind(self.timeContainer, \"mousedown\", onClick(timeIncrement));\n bind([self.hourElement, self.minuteElement], [\"focus\", \"click\"], selText);\n if (self.secondElement !== undefined) bind(self.secondElement, \"focus\", function () {\n return self.secondElement && self.secondElement.select();\n });\n\n if (self.amPM !== undefined) {\n bind(self.amPM, \"mousedown\", onClick(function (e) {\n updateTime(e);\n triggerChange();\n }));\n }\n }\n }", "title": "" }, { "docid": "81e250354c9ffac129bb92a565e69f77", "score": "0.54010123", "text": "_handler() {\n // only clicks on menu links. i.e. ignore clicks on the parent div\n if (!event.target.classList.contains('menu__link')) return;\n\n event.preventDefault(); // prevent std link jump\n\n const index = Number(event.target.dataset[\"index\"]);\n if (this.onClick) {\n this.onClick(this.elements[index], this.navbar);\n } else {\n console.warn(`Navigation .onClick callback has not been set.`);\n }\n }", "title": "" }, { "docid": "8f102e905b95e6495fb1c28d462a079c", "score": "0.5399583", "text": "_uiEvents() {\n // Auto-popup\n if( this._pstate )\n setTimeout( () => { this.open( this._popup ); }, 300 );\n\n // Listen starter button clicks\n this.$btn.addEventListener( 'click', (e) => {\n e.preventDefault();\n\n if( !this._pstate )\n this.open();\n else\n this.close();\n });\n\n // Listen menu link clicks\n this.$menu.addEventListener( 'click', (e) => {\n e.preventDefault();\n this.open( 'cnv' );\n });\n\n // Update \"last seen\" data when visitor hovers the popup\n this.$popup.addEventListener( 'mouseenter', () => { \n this.readChat();\n });\n\n // \n // Listen window resizes\n // \n const fn_resize = () => {\n var width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;\n\n if( width <= this.opts.mobileBreakpoint ) {\n this._widget.classList.add( 'lcx-mobileView' );\n this._d.body.classList.add( 'lcx-mobileView' );\n \n this._isMobile = true;\n\n } else {\n this._widget.classList.remove( 'lcx-mobileView' );\n this._d.body.classList.remove( 'lcx-mobileView' );\n \n this._isMobile = false;\n }\n };\n fn_resize();\n window.addEventListener( 'resize', fn_resize, true );\n }", "title": "" }, { "docid": "cfdc41342112f3d44f311952088c3bf0", "score": "0.5398263", "text": "function bindElements() {\r\n document\r\n .querySelector('#' + PAGE_ID + ' .clickable-layer')\r\n .addEventListener('click', onLayerClick);\r\n \r\n deleteButton.addEventListener('click', onDeleteInput);\r\n confirmButton.addEventListener('click', onConfirmInput);\r\n \r\n page.addEventListener('pagebeforeshow', onPageBeforeShow);\r\n }", "title": "" }, { "docid": "7ac2ddbec42889139feaf763bb32a70b", "score": "0.5391206", "text": "setEventHandler() {\n this.textInput.on('click', (e) => {\n if (!e.target.value) {\n this.fileInput.click();\n }\n });\n\n // add event handler to action button.\n this.action.on('click', (e) => {\n if (!this.textInput.val()) {\n this.fileInput.click();\n } else {\n // When upload is complete a JS action can be send to set an ID\n // to the uploaded file via the jQuery data property.\n // Check if that ID exist and send it with\n // delete callback, If not, default to file name.\n let id = this.$el.data().fileId;\n if (id === '' || id === undefined || id === null) {\n id = this.textInput.val();\n }\n this.doFileDelete(id);\n }\n });\n\n // add event handler to file input.\n this.fileInput.on('change', (e) => {\n if (e.target.files.length > 0) {\n this.textInput.val(e.target.files[0].name);\n this.doFileUpload(e.target.files);\n }\n });\n }", "title": "" }, { "docid": "bc8e08e5f89757a8a55f7b43834efcad", "score": "0.53833514", "text": "initWidgets(){\n const thisBooking = this;\n\n thisBooking.peopleAmount = new AmountWidget(thisBooking.dom.peopleAmount);\n thisBooking.hoursAmount = new AmountWidget(thisBooking.dom.hoursAmount);\n thisBooking.datePicker = new DatePicker(thisBooking.dom.datePicker);\n thisBooking.hourPicker = new HourPicker(thisBooking.dom.hourPicker);\n thisBooking.dom.wrapper.addEventListener('updated', function(){\n thisBooking.updateDOM();\n });\n\n /* Module 10.1 */\n\n thisBooking.dom.submitButton.addEventListener('click', function(event) {\n event.preventDefault();\n thisBooking.sendBooking();\n console.log('Reservation sent!');\n alert('Reservation was successfully sent!');\n });\n }", "title": "" }, { "docid": "59df66316a4bc1b45db057458754e3c8", "score": "0.5376955", "text": "function setupUIEvents() {\n\n // checkbox\n this.root.addEventListener(events.opentypeChanged, function() {\n var val = ui.getOpentype()\n ui.setInputOpentype(val)\n })\n\n // dropdowns\n var that = this\n this.root.addEventListener(events.fontChanged, function(e) {\n if (e.detail.font) {\n if (typeof(this.currentFont) === \"undefined\") {\n that.showFont(e.detail.font)\n }\n }\n })\n }", "title": "" }, { "docid": "8aee6e97969d0722dbee23cb9dedd21d", "score": "0.5367556", "text": "wireEvents() {\n for (const input of (this.inputElements)) {\n if (FormValidator_1.isCheckable(input)) {\n _syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"EventHandler\"].add(input, 'click', this.clickHandler, this);\n }\n else if (input.tagName === 'SELECT') {\n _syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"EventHandler\"].add(input, 'change', this.changeHandler, this);\n }\n else {\n _syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"EventHandler\"].add(input, 'focusout', this.focusOutHandler, this);\n _syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"EventHandler\"].add(input, 'keyup', this.keyUpHandler, this);\n }\n }\n _syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"EventHandler\"].add(this.element, 'submit', this.submitHandler, this);\n _syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"EventHandler\"].add(this.element, 'reset', this.resetHandler, this);\n }", "title": "" }, { "docid": "5f95f9a83c50fd444916867168b86858", "score": "0.53675", "text": "function bindEvents() {\n if (self.config.wrap) {\n [\"open\", \"close\", \"toggle\", \"clear\"].forEach(function (evt) {\n Array.prototype.forEach.call(self.element.querySelectorAll(\"[data-\" + evt + \"]\"), function (el) {\n return bind(el, \"click\", self[evt]);\n });\n });\n }\n if (self.isMobile) {\n setupMobile();\n return;\n }\n var debouncedResize = debounce(onResize, 50);\n self._debouncedChange = debounce(triggerChange, DEBOUNCED_CHANGE_MS);\n if (self.daysContainer && !/iPhone|iPad|iPod/i.test(navigator.userAgent))\n bind(self.daysContainer, \"mouseover\", function (e) {\n if (self.config.mode === \"range\")\n onMouseOver(getEventTarget(e));\n });\n bind(window.document.body, \"keydown\", onKeyDown);\n if (!self.config.inline && !self.config.static)\n bind(window, \"resize\", debouncedResize);\n if (window.ontouchstart !== undefined)\n bind(window.document, \"touchstart\", documentClick);\n else\n bind(window.document, \"click\", documentClick);\n bind(window.document, \"focus\", documentClick, { capture: true });\n if (self.config.clickOpens === true) {\n bind(self._input, \"focus\", self.open);\n bind(self._input, \"click\", self.open);\n }\n if (self.daysContainer !== undefined) {\n bind(self.monthNav, \"click\", onMonthNavClick);\n bind(self.monthNav, [\"keyup\", \"increment\"], onYearInput);\n bind(self.daysContainer, \"click\", selectDate);\n }\n if (self.timeContainer !== undefined &&\n self.minuteElement !== undefined &&\n self.hourElement !== undefined) {\n var selText = function (e) {\n return getEventTarget(e).select();\n };\n bind(self.timeContainer, [\"increment\"], updateTime);\n bind(self.timeContainer, \"blur\", updateTime, { capture: true });\n bind(self.timeContainer, \"click\", timeIncrement);\n bind([self.hourElement, self.minuteElement], [\"focus\", \"click\"], selText);\n if (self.secondElement !== undefined)\n bind(self.secondElement, \"focus\", function () { return self.secondElement && self.secondElement.select(); });\n if (self.amPM !== undefined) {\n bind(self.amPM, \"click\", function (e) {\n updateTime(e);\n triggerChange();\n });\n }\n }\n if (self.config.allowInput)\n bind(self._input, \"blur\", onBlur);\n }", "title": "" }, { "docid": "5f95f9a83c50fd444916867168b86858", "score": "0.53675", "text": "function bindEvents() {\n if (self.config.wrap) {\n [\"open\", \"close\", \"toggle\", \"clear\"].forEach(function (evt) {\n Array.prototype.forEach.call(self.element.querySelectorAll(\"[data-\" + evt + \"]\"), function (el) {\n return bind(el, \"click\", self[evt]);\n });\n });\n }\n if (self.isMobile) {\n setupMobile();\n return;\n }\n var debouncedResize = debounce(onResize, 50);\n self._debouncedChange = debounce(triggerChange, DEBOUNCED_CHANGE_MS);\n if (self.daysContainer && !/iPhone|iPad|iPod/i.test(navigator.userAgent))\n bind(self.daysContainer, \"mouseover\", function (e) {\n if (self.config.mode === \"range\")\n onMouseOver(getEventTarget(e));\n });\n bind(window.document.body, \"keydown\", onKeyDown);\n if (!self.config.inline && !self.config.static)\n bind(window, \"resize\", debouncedResize);\n if (window.ontouchstart !== undefined)\n bind(window.document, \"touchstart\", documentClick);\n else\n bind(window.document, \"click\", documentClick);\n bind(window.document, \"focus\", documentClick, { capture: true });\n if (self.config.clickOpens === true) {\n bind(self._input, \"focus\", self.open);\n bind(self._input, \"click\", self.open);\n }\n if (self.daysContainer !== undefined) {\n bind(self.monthNav, \"click\", onMonthNavClick);\n bind(self.monthNav, [\"keyup\", \"increment\"], onYearInput);\n bind(self.daysContainer, \"click\", selectDate);\n }\n if (self.timeContainer !== undefined &&\n self.minuteElement !== undefined &&\n self.hourElement !== undefined) {\n var selText = function (e) {\n return getEventTarget(e).select();\n };\n bind(self.timeContainer, [\"increment\"], updateTime);\n bind(self.timeContainer, \"blur\", updateTime, { capture: true });\n bind(self.timeContainer, \"click\", timeIncrement);\n bind([self.hourElement, self.minuteElement], [\"focus\", \"click\"], selText);\n if (self.secondElement !== undefined)\n bind(self.secondElement, \"focus\", function () { return self.secondElement && self.secondElement.select(); });\n if (self.amPM !== undefined) {\n bind(self.amPM, \"click\", function (e) {\n updateTime(e);\n triggerChange();\n });\n }\n }\n if (self.config.allowInput)\n bind(self._input, \"blur\", onBlur);\n }", "title": "" }, { "docid": "24f184fa3e12effda6fd73937efa4f35", "score": "0.53660136", "text": "_generateEventListeners() {\n if(!this._mainRow) return;\n\n let self = this;\n for(let iconDiv of this._mainRow.childNodes) {\n iconDiv.addEventListener('click', (e)=>{this._onClick.call(self, e);});\n }\n }", "title": "" }, { "docid": "75a6aeab3389195a45203bea46ffbf3c", "score": "0.53622913", "text": "function initUI()\n{\n\t$(document).on('click', '#curtain', toggleSide);\n $(document).on('click', '.toggle-side', toggleSide);\n $(document).on('click', '.toggle-edit', toggleEdit);\n $(document).on('click', '.toggle-upload', toggleUpload);\n\n $(document).on('click', '.toggle-list', toggleList);\n $(document).on('click', '.toggle-graph', toggleGraph);\n \n //events\n $(document).on('click', '.logout', logout);\n $(document).on('click', '.rename-butotn', renameClicked);\n $(document).on('click', '.delete-button', deleteClicked);\n $(document).on('change', '#csv-file', changeClicked);\n $(document).on('click', '#csv-upload', uploadClicked);\n\n}", "title": "" }, { "docid": "4d194b4fca3b1b88b2d3d3d49ca4fd6a", "score": "0.5356939", "text": "function bindEvents(){\n $(\"body\").on(\"click\", \".slot\", slotClickHandler);\n $(\"body\").on(\"click\", \".slot-paper\", paperSlotClickHandler);\n if (Features.chair)\n $(\"body\").on(\"click\", \".slot-chair\", chairSlotClickHandler);\n }", "title": "" }, { "docid": "07e683b179c7976a1cd7be78ce25d5ea", "score": "0.53506243", "text": "function _events() {\n $form.on('submit', submit);\n\n if (config.validate) {\n $.listen('parsley:form:validated', _isValid);\n $.listen('parsley:field:init', _cacheField);\n }\n }", "title": "" }, { "docid": "e514f5ec791c2bffa6a6d2c398adf26b", "score": "0.53484434", "text": "function setupEventHandlers(){\n\t// setup input for new posts\n\t$(\"#btn-send-main\").click(function(){\n\t\tprefix = \"n|\"; // set prefix to new post\n\t\tPostF($(\"#forum-textarea-main\").val());\n\t\t$(\"#forum-input-btns-main\").addClass(\"hidden\");\n\t\t$(\"#forum-textarea-main\").val(\"\");\n\t});\n\t$(\"#forum-textarea-main\").focus(function(){\n\t\tvar elem = document.getElementById(\"forum-input-btns-main\");\n\t\tif(elem.classList.contains(\"hidden\"))\n\t\t\telem.classList.remove(\"hidden\");\n\t});\n\t$(\"#btn-cancel-main\").click(function(){\n\t\t$(\"#forum-input-btns-main\").addClass(\"hidden\");\n\t});\n\t\n\t// setup input for replies\n\t$(\"#btn-send-reply\").click(function(){\n\t\tprefix = $(this).parent().parent().parent().attr(\"id\") + \"|\"; // set prefix to post being replied\n\t\tPostF($(\"#forum-textarea-reply\").val());\n\t\t$(\"#forum-input-reply\").addClass(\"hidden\");\n\t\t$(\"#forum-textarea-reply\").val(\"\");\n\t});\n\t$(\"#btn-cancel-reply\").click(function(){\n\t\t$(\"#forum-input-reply\").addClass(\"hidden\");\n\t});\n}", "title": "" }, { "docid": "19ca44abe5d6e69439866e1add063f3a", "score": "0.5339644", "text": "wireEvents() {\n _syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"EventHandler\"].add(this.pagerElement, 'click', this.clickHandler, this);\n }", "title": "" }, { "docid": "20857d2312d62174c4d471c1fabd5ec9", "score": "0.5338665", "text": "function bindEvents(){\r\n\t\t\t// Popup\r\n $(table).bind('mouseenter', function(){\r\n $(id).stop().slideDown();\r\n });\r\n $(\"input[name='menuType']\").change(function(){\r\n \t$(idHelper(_conf.idColumnMenu)).stop().slideDown();\r\n \t$(id).stop().slideUp();\r\n });\r\n \r\n // Column Menu\r\n $(id + ' span').bind('click', function(){\r\n $('#' + _conf.idColumnMenu).stop().slideUp();\r\n });\r\n \r\n // Buttons\r\n $(id +' img.close').bind('mouseup', function(){\r\n $(this).attr('src', 'choosable/images/close.png');\r\n $(id).stop().slideUp();\r\n });\r\n $(id +' img.close').bind('mousedown', function(){\r\n $(this).attr('src', 'choosable/images/close-press.png');\r\n });\r\n }", "title": "" }, { "docid": "d2529fc1fd9c9c16199038bd3fb7c12f", "score": "0.53351945", "text": "addEventHandlers () {\n this.taskbar.addEventListener('click', this.boundAddCustomEvent)\n this.taskbar.parentNode.addEventListener('mouseenter', this.boundShowOrHideTaskbar)\n this.taskbar.parentNode.addEventListener('mouseleave', this.boundShowOrHideTaskbar)\n }", "title": "" }, { "docid": "6d179036bf91b76f62aeac0b438ac975", "score": "0.53262883", "text": "function gk_widget_control_init_events(id, inner) {\n var form = jQuery(id);\n\n if (inner) {\n form.parent().find('select:last-child').css('opacity', '0.5');\n\n setTimeout(function () {\n var btn = form.parent().parent().parent().find('*[name=\"savewidget\"]');\n btn.click();\n }, 1000);\n }\n\n if (form.attr('data-state') !== 'initialized') {\n form.attr('data-state', 'initialized');\n var firstSelect = form.parent().find('.gk_widget_rules_select');\n var select = form.children('.gk_widget_rules_form_select');\n var btn = form.find('.gk_widget_rules_btn');\n var form_inputs = {};\n var form_inputs_names = ['page', 'post', 'category', 'tag', 'template', 'taxonomy', 'taxonomy_term', 'posttype', 'author'];\n jQuery.each(form_inputs_names, function (i, el) {\n form_inputs[el] = form.find('.gk_widget_rules_form_input_' + el).parent();\n });\n // hide unnecesary form\n if (firstSelect.children('option:selected').val() === 'all') {\n form.css('display', 'none');\n }\n // change event\n firstSelect.change(function () {\n var value = firstSelect.children('option:selected').val();\n\n if (value === 'all') {\n form.css('display', 'none');\n } else {\n form.css('display', 'block');\n }\n });\n // refresh the list\n gk_widget_control_refresh(form);\n // add onChange event to the selectbox\n select.change(function () {\n var value = select.children('option:selected').val();\n\n if (value === 'homepage' || value === 'page404' || value === 'search' || value === 'archive') {\n jQuery.each(form_inputs, function (i, el) {\n el.css('display', 'none');\n });\n } else {\n jQuery.each(form_inputs_names, function (i, el) {\n \tif(el !== 'taxonomy_term') {\n\t if (value.replace(':', '') !== el) {\n\t form_inputs[el].css('display', 'none');\n\t \n\t if(value.replace(':', '') !== 'taxonomy') {\n\t \tform_inputs['taxonomy_term'].css('display', 'none');\n\t }\n\t } else {\n\t form_inputs[el].css('display', 'block');\n\t \n\t if(value.replace(':', '') === 'taxonomy') {\n\t \tform_inputs['taxonomy_term'].css('display', 'block');\n\t }\n\t }\n }\n });\n }\n });\n // add the onClick event to the button\n btn.click(function (event) {\n event.preventDefault();\n\n var output = form.find('.gk_widget_rules_output');\n var value = select.children('option:selected').val();\n\n if (\n value === 'homepage' ||\n value === 'search' ||\n value === 'archive' ||\n value === 'page404'\n ) {\n output.val(output.val() + ',' + value);\n } else if (\n value === 'page:' ||\n value === 'post:' ||\n value === 'format:' ||\n value === 'template:' ||\n value === 'category:' ||\n value === 'tag:' ||\n value === 'author:'\n ) {\n output.val(output.val() + ',' + value + form.find('.gk_widget_rules_form_input_' + value.replace(':', '')).val());\n } else if (value === 'taxonomy:') {\n var tax = form.find('.gk_widget_rules_form_input_taxonomy').val();\n var term = form.find('.gk_widget_rules_form_input_taxonomy_term').val();\n output.val(output.val() + ',taxonomy:' + tax + ((term !== '') ? ';' + term : ''));\n } else if (value === 'posttype:') {\n var type = form.find('.gk_widget_rules_form_input_posttype').val();\n //\n if (type !== '') {\n output.val(output.val() + ',posttype:' + type);\n }\n }\n\n gk_widget_control_refresh(form);\n });\n // event to remove the page tags\n form.find('.gk_widget_rules_pages div').click(function (event) {\n if (event.target.nodeName.toLowerCase() === 'strong') {\n var output = form.find('.gk_widget_rules_output');\n var parent = jQuery(event.target).parent();\n parent.find('strong').remove();\n var text = parent.text();\n //\n if (text === 'All pages') {\n text = 'page:';\n } else if (text === 'All posts pages') {\n text = 'post:';\n } else if (text === 'All category pages') {\n text = 'category:';\n } else if (text === 'All tag pages') {\n text = 'tag:';\n } else if (text === 'All author pages') {\n text = 'author:';\n } else if (text === 'All taxonomy pages') {\n text = 'taxonomy:';\n } else if (text === 'All post format pages') {\n text = 'format:';\n } else if (text === 'All page template pages') {\n text = 'template:';\n }\n //\n if (text.indexOf(':') === text.length - 1) {\n var startlen = output.val().length;\n output.val(output.val().replace(\",\" + text, \"\"));\n // if previous regexp didn't changed the value\n if (startlen === output.val().length) {\n var regex = new RegExp(',' + text + '$', 'gmi');\n output.val(output.val().replace(regex, \"\"));\n }\n } else {\n output.val(output.val().replace(\",\" + text, \"\"));\n }\n //\n gk_widget_control_refresh(form);\n }\n });\n // event to display the custom CSS class field \n var selectStyles = jQuery(document).find('.gk_widget_rules_select_styles');\n selectStyles.each(function (i, select) {\n select = jQuery(select);\n\n if (!select.hasClass('initialized')) {\n select.change(function () {\n var value = select.children('option:selected').val();\n var field = select.parent().parent().next('p');\n\n if (value !== 'gkcustom') {\n if (!field.hasClass('gk-unvisible')) {\n field.addClass('gk-unvisible');\n }\n } else {\n if (field.hasClass('gk-unvisible')) {\n field.removeClass('gk-unvisible');\n }\n }\n });\n\n select.addClass('initialized');\n }\n });\n }\n}", "title": "" }, { "docid": "75c6b3b8d7aab5661afdcacf356ee96c", "score": "0.5323131", "text": "_addListeners() {\n document.addEventListener('click', this._handleEvent, false);\n }", "title": "" }, { "docid": "88fc2dbaeac9bff7e2d4a87f59c90d44", "score": "0.53006744", "text": "_addEventHandlers() {\n\t\tthis.ui.closeButton = $('<a />');\n\t\tthis.ui.closeButton.addClass(this.options.closeBtnClass);\n\t\tthis.ui.closeButton.attr('href', '#close');\n\t\tthis.ui.closeButton.attr('title', this.options.closeBtnText);\n\t\tthis.ui.closeButton.text(this.options.closeBtnText);\n\t\tthis.ui.modal.prepend(this.ui.closeButton);\n\t\tthis.ui.modal.on('click.' + this.instance.namespace, '.' + this.options.closeBtnClass, $.proxy(this._onCloseBtnClick, this));\n\n\t\tthis.ui.overlay.on('click.' + this.instance.namespace, function() {\n\t\t\tif (this.state.isOpen) {\n\t\t\t\tthis._closeModal();\n\t\t\t}\n\t\t}.bind(this));\n\n\t\tthis.ui.window.on('keydown.' + this.instance.namespace, $.proxy(this._onWindowKeydown, this));\n\n\t\tthis.ui.document.on('focusin.' + this.instance.namespace, function(event) {\n\t\t\tlet $curTarget = $(event.target);\n\n\t\t\t// If modal is open and the focus leaves the modal\n\t\t\tif (this.state.isOpen) {\n\t\t\t\tif (!$curTarget.is(this.ui.modal) && !this.ui.modal.find($curTarget).length) {\n\t\t\t\t\t// Return focus to the close button\n\t\t\t\t\tthis.ui.closeButton.focus();\n\t\t\t\t}\n\t\t\t}\n\t\t}.bind(this));\n\t}", "title": "" }, { "docid": "bef7b705ec212984f2e2b4a328c07544", "score": "0.52955455", "text": "launch() {\n this._setGeometry();\n _lumino_widgets__WEBPACK_IMPORTED_MODULE_1__[\"Widget\"].attach(this, document.body);\n this.update();\n this._anchor.addClass(_style_statusbar__WEBPACK_IMPORTED_MODULE_3__[\"clickedItem\"]);\n this._anchor.removeClass(_style_statusbar__WEBPACK_IMPORTED_MODULE_3__[\"interactiveItem\"]);\n }", "title": "" }, { "docid": "4123801f4638c71d5c58ee4c062f144b", "score": "0.52944434", "text": "postCreateDom() {\n }", "title": "" }, { "docid": "139d406f33e3454ba3c0abb565a95601", "score": "0.5290234", "text": "bindEvents() {\n this.node.addEventListener('change', this.update.bind(this));\n }", "title": "" }, { "docid": "9b10674101949b7ef3291e7b51db1c6c", "score": "0.5285964", "text": "_setEventListeners() {\n this._card.addEventListener(\"click\", (evt) => {\n if (evt.target.classList.contains(\"place__delete\")) {\n this._handleDeleteClick(this._id, this._card);\n } else if (evt.target.classList.contains(\"place__like\")) {\n evt.target.classList.contains(\"place__like_theme_like\")\n ? this._handleLikeClick(false, evt.target)\n : this._handleLikeClick(true, evt.target);\n } else if (evt.target.classList.contains(\"place__image\")) {\n this._handleImageClick(evt);\n }\n });\n }", "title": "" }, { "docid": "92d4d2f1e4317cff377b51e8836f78a3", "score": "0.5284971", "text": "function handleEventButton() {\n _q('#diggyPopup .btn-add').addEventListener('click', function (e) {\n e.preventDefault();\n\n appendParamIntoUrl(e.currentTarget.dataset.btnid || 'btnadd');\n upgradeProduct();\n });\n\n Array.prototype.slice.call(_qAll('#diggyPopup .btn-cancel, #diggyPopup .icon-close')).forEach(closeElm => {\n closeElm.addEventListener('click', function (e) {\n e.preventDefault();\n\n appendParamIntoUrl(_q('#diggyPopup .btn-cancel').dataset.btnid || 'btncancel');\n cancelUpgradeProduct();\n });\n });\n\n // ! Render price on change product item\n // Array.prototype.slice.call(_qAll('.productRadioListItem input')).forEach(inputElm => {\n // inputElm.addEventListener('change', function (e) {\n // renderPrice();\n // });\n // });\n }", "title": "" }, { "docid": "b99d4040543d7dded931a8cdbfdcc418", "score": "0.5274199", "text": "function bindEvents() {\n if (that._elements[\"previous\"]) {\n that._elements[\"previous\"].addEventListener(\"click\", function() {\n var index = getPreviousIndex();\n navigate(index);\n if (dataLayerEnabled) {\n dataLayer.push({\n event: \"cmp:show\",\n eventInfo: {\n path: \"component.\" + getDataLayerId(that._elements.item[index].dataset.cmpDataLayer)\n }\n });\n }\n });\n }\n\n if (that._elements[\"next\"]) {\n that._elements[\"next\"].addEventListener(\"click\", function() {\n var index = getNextIndex();\n navigate(index);\n if (dataLayerEnabled) {\n dataLayer.push({\n event: \"cmp:show\",\n eventInfo: {\n path: \"component.\" + getDataLayerId(that._elements.item[index].dataset.cmpDataLayer)\n }\n });\n }\n });\n }\n\n var indicators = that._elements[\"indicator\"];\n if (indicators) {\n for (var i = 0; i < indicators.length; i++) {\n (function(index) {\n indicators[i].addEventListener(\"click\", function(event) {\n navigateAndFocusIndicator(index);\n });\n })(i);\n }\n }\n\n if (that._elements[\"pause\"]) {\n if (that._properties.autoplay) {\n that._elements[\"pause\"].addEventListener(\"click\", onPauseClick);\n }\n }\n\n if (that._elements[\"play\"]) {\n if (that._properties.autoplay) {\n that._elements[\"play\"].addEventListener(\"click\", onPlayClick);\n }\n }\n\n that._elements.self.addEventListener(\"keydown\", onKeyDown);\n\n if (!that._properties.autopauseDisabled) {\n that._elements.self.addEventListener(\"mouseenter\", onMouseEnter);\n that._elements.self.addEventListener(\"mouseleave\", onMouseLeave);\n }\n }", "title": "" } ]
18497e4a08e7d97317f71bb692158172
Copyright (c) 2016present, Nicolas Gallagher. Copyright (c) 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.
[ { "docid": "777b8ed53e4b63fbd1e0430e26d98cab", "score": "0.0", "text": "function emptyFunction() {}", "title": "" } ]
[ { "docid": "d0397bee367c92d401d7b158927d4cc0", "score": "0.59543705", "text": "function FacebookGraph() {}", "title": "" }, { "docid": "062442a86816f7def17d43e9692e63f9", "score": "0.54704374", "text": "function facebookInit() {\n\n window.fbAsyncInit = function() {\n FB.init({\n appId : '1138328379582618',\n cookie : false, // enable cookies to allow the server to access\n // the session\n xfbml : true, // parse social plugins on this page\n version : 'v2.5' // use graph api version 2.5\n });\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); 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\n}", "title": "" }, { "docid": "c7ef060853deeb4fbdf6db90a388095b", "score": "0.53422487", "text": "function FacebookSocialShare () {}", "title": "" }, { "docid": "b19f12b25b251cbdfb62f1515c43b1d4", "score": "0.5260774", "text": "testAPI() {\n const { token } = this.state\n const { dispatch } = this.props\n window.FB.api('/me?fields=id,name,email,picture', function(response) {\n const oauth = {\n token,\n name: response.name,\n email: response.email,\n picture: response.picture.data.url,\n provider_user_id: response.id,\n }\n dispatch(handleLoginOAuth(oauth, 'facebook'))\n });\n }", "title": "" }, { "docid": "61d4c65926633a6a8ff29d7b9c8f9f57", "score": "0.5251303", "text": "_loadFacebook(url, context, cb) {\n\n const apiBase = `https://www.facebook.com/plugins/post/oembed.json?url=${encodeURIComponent(url)}&omitscript=true`\n\n let postId = uuidv5('url', 'https://facebook.com')\n const matches = /.*[/=](\\d+)/.exec(url);\n\n if (matches && matches.length === 2) {\n postId = matches[1];\n }\n //<div class=\"fb-page\" data-href=\"https://www.facebook.com/Paras-Design-393209377418188\" data-tabs=\"timeline\" data-small-header=\"false\" data-adapt-container-width=\"true\" data-hide-cover=\"false\" data-show-facepile=\"false\"></div>\n\n api.router.get('/api/resourceproxy', {url: apiBase})\n .then(response => api.router.checkForOKStatus(response))\n .then(response => api.router.toJson(response))\n .then(json => {\n\n cb(null, {\n author: json.author_url,\n html: json.html,\n oembed: json,\n uri: `im://facebook-post/${postId}`,\n url: json.url,\n linkType: 'x-im/facebook-post',\n socialChannel: 'Facebook',\n socialChannelIcon: 'fa-facebook'\n }, {\n history: false\n })\n })\n .catch((error) => {\n cb(error)\n })\n\n\n }", "title": "" }, { "docid": "19798c6724e792c320f9aed56ad3a065", "score": "0.51972973", "text": "fb_login() {\n user_fb_login().then(() => {\n console.log('facebook connected');\n });\n }", "title": "" }, { "docid": "21c53a5c2b2cd27f2e9f20f6a597d8f0", "score": "0.5193892", "text": "initFacebook(){\n this.fb.init(this.config.getLangCode());\n }", "title": "" }, { "docid": "3eb3aa10a3cd8d8f4b62862d0718fd33", "score": "0.5173745", "text": "onShareAppMessage() {\n\n }", "title": "" }, { "docid": "fd19774c6e6679d4e166c71905243a8c", "score": "0.5150881", "text": "loadFacebookSDK() {\n var js,\n fjs = document.getElementsByTagName(\"script\")[0];\n if (document.getElementById(\"facebook-jssdk\")) {\n return;\n }\n js = document.createElement(\"script\");\n js.id = \"facebook-jssdk\";\n js.src = \"https://connect.facebook.net/en_US/sdk.js\";\n fjs.parentNode.insertBefore(js, fjs);\n }", "title": "" }, { "docid": "2f47a3c6b1f5b3d13568cb387aafcf19", "score": "0.514794", "text": "fbAuth(props){\n LoginManager.logInWithReadPermissions(['public_profile', 'email'])\n .then(loginResult => {\n if (loginResult.isCancelled) {\n props.dispatch(ACTIONS.UPDATE_SHOW_LOGGIN_CONTENT(true))\n return;\n }\n AccessToken.getCurrentAccessToken()\n .then(accessTokenData => {\n const credential = provider.credential(accessTokenData.accessToken);\n return auth.signInWithCredential(credential);\n })\n .then(credData => {\n //...\n })\n .catch(err => {\n\n\n });\n });\n }", "title": "" }, { "docid": "41e45651560bc15b690b9143ed812e8f", "score": "0.5131005", "text": "renderAvatar(){\n return \"http://graph.facebook.com/\"+this.state.avatar+\"/picture/?type=large\";\n }", "title": "" }, { "docid": "7502a7d2239ae026a290e70024e5acc5", "score": "0.5122222", "text": "_FBPReady(){super._FBPReady();this.canvas=this.shadowRoot.querySelector(\"canvas\");this.signaturePad=new SignaturePad(this.canvas,{onBegin:this._onBegin.bind(this),onEnd:this._onEnd.bind(this)});setTimeout(()=>{this.resize();if(this.getAttribute(\"image\")){this.setImage(this.getAttribute(\"image\"))}},1);this.signaturePad.clear()}", "title": "" }, { "docid": "56f92bf7daf596194ab1c5c6919c19c6", "score": "0.510358", "text": "temporaryFacebookLogin() {\n fbAuth(result => {\n Actions.registerPassword({email: this.state.email});\n }, error => console.log(error));\n }", "title": "" }, { "docid": "ce483d07bb976c9f0931fec90212313a", "score": "0.50840414", "text": "static Facebook() {\n\n if (Meteor.user()) {\n Meteor.call('permissionsServicesController', 'facebook');\n }\n\n Meteor.loginWithFacebook({\n loginStyle: loginStyle,\n requestPermissions: ['email', 'publish_actions', 'user_about_me', 'user_birthday', 'user_education_history', 'user_friends', 'user_likes', 'user_location',\n 'user_photos', 'user_posts', 'user_relationships', 'user_religion_politics', 'user_videos', 'user_website', 'user_work_history',\n 'manage_pages', 'publish_pages']\n }, function (e) {\n\n if (e) console.log('Error at loginWithFacebook', e);\n })\n }", "title": "" }, { "docid": "60b03f8ca41ee209cba65c143354657f", "score": "0.506279", "text": "function Widget() {\n return (\n <div className=\"widgets\"> \n <iframe \n src=\"https://www.facebook.com/plugins/page.php?href=https%3A%2F%2Fwww.facebook.com%2FCodingTreeFoundation&tabs=timeline&width=340&height=1500&small_header=false&adapt_container_width=true&hide_cover=false&show_facepile=true&appId\"\n width=\"340\"\n height=\"100%\"\n style={{ border: 'none', overflow: 'hidden' }}\n scrolling=\"no\"\n frameborder=\"0\"\n allowTransparency=\"true\"\n allow=\"encrypted-media\"> \n </iframe>\n </div>\n )\n}", "title": "" }, { "docid": "d4e2e773a4c286003842ac0f05c57e22", "score": "0.5053368", "text": "function facebookSDK(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 = 'https://connect.facebook.net/uk_UA/sdk.js#xfbml=1&version=v2.11';\n fjs.parentNode.insertBefore(js, fjs);\n }", "title": "" }, { "docid": "6aa10d6da3025b1f4bc3a57bddcb5d00", "score": "0.5029787", "text": "function facebook(){\n\t\t window.fbAsyncInit = function() {\n\t\t\tFB.init({\n\t\t\t appId : '443508415694320', // App ID\n\t\t\t channelUrl : 'ridezu.com/channel.html', // Channel File\n\t\t\t status : true, // check login status\n\t\t\t cookie : true, // enable cookies to allow the server to access the session\n\t\t\t xfbml : true // parse XFBML\n\t\t\t});\n\t\t\n\t\t\tFB.Event.subscribe('auth.statusChange', handleStatusChange);\n\t\t };\n\t\t\n\t\t// Load the SDK Asynchronously\n\t\t (function(d){\n\t\t\t var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];\n\t\t\t if (d.getElementById(id)) {return;}\n\t\t\t js = d.createElement('script'); js.id = id; js.async = true;\n\t\t\t js.src = \"//connect.facebook.net/en_US/all.js\";\n\t\t\t ref.parentNode.insertBefore(js, ref);\n\t\t }(document));\n\t\t\n\t\t function handleStatusChange(response) {\n\t\t\t document.body.className = response.authResponse ? 'connected' : 'not_connected';\n\t\t\t if (response.authResponse) {\n\t\t\t }\n\t\t\t}\n\t\t function updateUserInfo(response) {\n\t\t }\n\t\t}", "title": "" }, { "docid": "53dde811cad31a0e17ff82982b57f10f", "score": "0.5016082", "text": "function init()\n {\n var inAppBrowserRef;\n var debug = true;\n //debugger;\n jso_registerRedirectHandler(function(url) {\n debugger;\n inAppBrowserRef = window.open(url, \"_blank\");\n inAppBrowserRef.addEventListener('loadstop', function(e) {\n LocationChange(e.url)\n }, false);\n });\n \n function LocationChange(url) {\n url = decodeURIComponent(url);\n\n jso_checkfortoken('facebook', url, function() {\n inAppBrowserRef.close();\n });\n };\n\n /*\n * Configure the OAuth providers to use.\n */\n jso_configure({\n \"facebook\": {\n client_id: \"1404823266416277\", //->your client_id goes here!!!\n redirect_uri: \"http://www.facebook.com/connect/login_success.html\",\n authorization: \"https://www.facebook.com/dialog/oauth\",\n presenttoken: \"qs\"\n }\n }, {\"debug\": debug});\n \n // jso_dump displays a list of cached tokens using outputlog if debugging is enabled.\n jso_dump();\n }", "title": "" }, { "docid": "0f1e12201240380f7a2cb852aefb46e8", "score": "0.5005295", "text": "_FBPReady(){super._FBPReady()}", "title": "" }, { "docid": "092b99ddceaf10734f244151e63ec81d", "score": "0.49768698", "text": "signInWithFacebook() {\n if (!FB) {\n return;\n }\n FB.login(response => {\n if (response.authResponse) {\n this.props.signIn(response.authResponse.userID, 'FACEBOOK', response.authResponse.accessToken, () => {\n try {\n FB.logout(response.authResponse.accessToken);\n } catch (err) { console.log(err);};\n });\n } else {\n console.log('User cancelled login or did not fully authorize.');\n }\n });\n }", "title": "" }, { "docid": "1d61406ffbe33f9665aa620d12ba99d2", "score": "0.49749443", "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": "23c456980a5333ec250339bb791b0946", "score": "0.49631864", "text": "static from() { return undefined; }", "title": "" }, { "docid": "a405430ae3c664b958ca025d407c3bf4", "score": "0.49564648", "text": "function facebookTokenCallback( token ){\r\n console.error('function facebookTokenCallback() not defined as expected.');\r\n}", "title": "" }, { "docid": "d3902ae5861ca5393f960a664444e200", "score": "0.4924945", "text": "_FBPReady(){super._FBPReady();// this._FBPTraceWires();\nif(this.drawer){/**\n * @event connect-to-drawer-requested\n * Fired when drawer name is set\n * detail payload: {name}\n */const customEvent=new Event(\"connect-to-drawer-requested\",{composed:!0,bubbles:!0});customEvent.detail={name:this.drawer};this.dispatchEvent(customEvent);this._drawer=customEvent.detail.drawer;if(this._drawer){// add regular event listener to the drawer\nthis._drawer.addEventListener(\"is-floating\",()=>{this.showNavigationIcon()});this._drawer.addEventListener(\"is-pinned\",()=>{this.hideNavigationIcon()});if(this._drawer.__isFloating){this.showNavigationIcon()}else{this.hideNavigationIcon()}}}/**\n * Register hook on wire --navigationClicked to\n * open the drawer\n */this._FBPAddWireHook(\"--navigationClicked\",()=>{if(\"menu\"===this._navigationIcon){this._drawer.open();/**\n * @event navigation-clicked\n * Fired when navigation icon is clicked\n */ /**\n * @event navigation-menu-clicked\n * Fired when icon is menu and navigation is clicked\n */const customEvent=new Event(\"navigation-menu-clicked\",{composed:!0,bubbles:!0});this.dispatchEvent(customEvent)}})}", "title": "" }, { "docid": "15311399eefafe80568c4fb4a61e4061", "score": "0.4909216", "text": "function isFacebookApp() {\n\tvar ua = navigator.userAgent;// || navigator.vendor || window.opera;\n\treturn (ua.indexOf(\"FBAN\") > -1) || (ua.indexOf(\"FBAV\") > -1) || (ua.indexOf(\"FB_IAB\") > -1);\n}", "title": "" }, { "docid": "051394f48952603957b41c143e5be03b", "score": "0.4897326", "text": "function facebook(){\n\twindow.open('../../facebookapi/?setting=1','','toolbar=no,menubar=no,location=no,height=1,width=1');\t\n}", "title": "" }, { "docid": "89f0fcc52f1291b2f45ceef66b715d03", "score": "0.48945114", "text": "function _iOS()\n{\n return 0;\n}", "title": "" }, { "docid": "b48a974b6fac766132ce24cc15197a2e", "score": "0.48920614", "text": "render(){ \n        let facebookData;\n console.log(this.state.picture); \n        this.state.auth ? \n        facebookData = ( \n //access token and the user id is passed to the Home component through props\n <Home access_tkn={this.state.accessToken} id={this.state.id} picture={this.state.picture}/>\n            ) :  \n            facebookData = (<FacebookLogin // Request is sent throigh the FacebookLogin component to the to get the autherization access token\n                appId=\"845402736341872\" \n                scope=\"user_photos,user_posts,email,pages_show_list,pages_read_engagement,public_profile,pages_manage_posts\" \n                autoLoad={true} \n                fields=\"name,picture\" \n                onClick={this.componentClicked} \n                callback={this.responseFacebook} />\n ); \n\n        return ( \n            <> \n                {facebookData} \n            </> \n        ); \n\n    }", "title": "" }, { "docid": "3eaee9c13f1653004f1b13d1a9853431", "score": "0.48761573", "text": "function getfacebookUserName(webAuthResultResponseData) {\n\n var responseData = webAuthResultResponseData.substring(webAuthResultResponseData.indexOf(\"access_token\"));\n var keyValPairs = responseData.split(\"&\");\n var access_token;\n var expires_in;\n for (var i = 0; i < keyValPairs.length; i++) {\n var splits = keyValPairs[i].split(\"=\");\n switch (splits[0]) {\n case \"access_token\":\n access_token = splits[1]; //You can store access token locally for further use. See \"Account Management\" scenario for usage.\n break;\n case \"expires_in\":\n expires_in = splits[1];\n break;\n }\n }\n\n document.getElementById(\"FacebookDebugArea\").value += \"\\r\\naccess_token = \" + access_token + \"\\r\\n\";\n var client = new Windows.Web.Http.HttpClient();\n client.getStringAsync(new Windows.Foundation.Uri(\"https://graph.facebook.com/me?access_token=\" + access_token)).done(function(result)\n {\n var userInfo = JSON.parse(result);\n document.getElementById(\"FacebookDebugArea\").value += userInfo.name + \" is connected!! \\r\\n\";\n });\n }", "title": "" }, { "docid": "7e38c83579eddac55376ac505ff823b2", "score": "0.48758584", "text": "componentDidMount() {\n this.getAsyncData(LocalStoreKey.FACE_ID)\n this.getAsyncData(LocalStoreKey.TOUCH_ID)\n this.getAsyncData(LocalStoreKey.PASSCODE)\n // Set default language\n I18n.locale = this.props.language // get user default language from store\n // Add Listeners for deep linking\n Linking.addEventListener('url', this.handleOpenURL)\n // Check conditon to open entry screen or sign up thanks screen based on deep link response\n Linking.getInitialURL().then((url) => {\n if (url) {\n this.handleOpenURL({ url })\n } else {\n this.navigateTimer()\n }\n })\n }", "title": "" }, { "docid": "19bd440913313d2c6b3ec88f108f0b4d", "score": "0.48487875", "text": "get Native() {\n return processPathConstants(NativeModules.RNFBStorageModule);\n }", "title": "" }, { "docid": "51431cc9b35f054b26da7ee87bf10148", "score": "0.48481897", "text": "signInWithFacebook() {\n const provider = new firebase.auth.FacebookAuthProvider();\n firebase.auth().signInWithPopup(provider).then((data) => {\n console.log(data.user);\n });\n }", "title": "" }, { "docid": "3c283d98b8eca72fc32eb5ab802664a2", "score": "0.48083967", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "title": "" }, { "docid": "3c283d98b8eca72fc32eb5ab802664a2", "score": "0.48083967", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "title": "" }, { "docid": "3c283d98b8eca72fc32eb5ab802664a2", "score": "0.48083967", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "title": "" }, { "docid": "3c283d98b8eca72fc32eb5ab802664a2", "score": "0.48083967", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "title": "" }, { "docid": "2e5bed7d50d326c81ca3d2226e54bac4", "score": "0.48056996", "text": "didOpen() {}", "title": "" }, { "docid": "536b208e26467dcecdaa0c8c51ffc21e", "score": "0.48019823", "text": "function testAPI() {\r\n\tconsole.log('Welcome! Fetching your information... ');\r\n\tFB.api('/me', function(response) {});\r\n\tFB.api(\"/me/picture?width=180&height=180\", function(messageEvent) {\r\n\t\tconsole.log(messageEvent.data)\r\n\t});\r\n}", "title": "" }, { "docid": "36937d2f37e119c329f6ada63720dfd5", "score": "0.47984925", "text": "loginToFacebookToGetPhotos() {\n window.FB.getLoginStatus((response) => {\n console.log(response);\n if (response.status === 'connected') {\n localStorage.setItem('fb_token', response.authResponse.accessToken);\n this.fetchFbCurrentProfilePic();\n }\n else {\n window.FB.login((response) => {\n if (response.authResponse) {\n console.log('Welcome! Fetching your information.... ');\n this.fetchFbCurrentProfilePic();\n }\n else {\n console.log('User cancelled login or did not fully authorize.');\n }\n }, { scope: 'email, public_profile, user_photos, user_gender,user_birthday, user_hometown, user_location' });\n } // Returns the login status.\n });\n }", "title": "" }, { "docid": "36937d2f37e119c329f6ada63720dfd5", "score": "0.47984925", "text": "loginToFacebookToGetPhotos() {\n window.FB.getLoginStatus((response) => {\n console.log(response);\n if (response.status === 'connected') {\n localStorage.setItem('fb_token', response.authResponse.accessToken);\n this.fetchFbCurrentProfilePic();\n }\n else {\n window.FB.login((response) => {\n if (response.authResponse) {\n console.log('Welcome! Fetching your information.... ');\n this.fetchFbCurrentProfilePic();\n }\n else {\n console.log('User cancelled login or did not fully authorize.');\n }\n }, { scope: 'email, public_profile, user_photos, user_gender,user_birthday, user_hometown, user_location' });\n } // Returns the login status.\n });\n }", "title": "" }, { "docid": "482b7fcc48141810e476b2377c968b76", "score": "0.47950295", "text": "_twitterSignIn(props) {\n const RNTwitterSignIn = NativeModules.RNTwitterSignIn;\n\n RNTwitterSignIn.init(Constants.TWITTER_COMSUMER_KEY, Constants.TWITTER_CONSUMER_SECRET);\n RNTwitterSignIn.logIn()\n .then((loginData)=>{\n \n const { authToken, authTokenSecret } = loginData;\n if (authToken && authTokenSecret) {\n // we are loged successfull\n \n const credential = providerTwitter.credential(authToken, authTokenSecret);\n return auth.signInWithCredential(credential);\n }\n }).then(credData => {\n //..\n }).catch((error)=>{\n \n props.dispatch(ACTIONS.UPDATE_SHOW_LOGGIN_CONTENT(true))\n });\n }", "title": "" }, { "docid": "a8e82e854424b266199e6ff74f14e718", "score": "0.47901458", "text": "_FBPReady(){super._FBPReady();this._snackbar=this.shadowRoot.getElementById(\"snackbar\");this._FBPAddWireHook(\"--actionClicked\",()=>{if(this.displayObj.snackbar){this.displayObj.snackbar._action()}this._close()});this._FBPAddWireHook(\"--closeClicked\",()=>{if(this.displayObj.snackbar){this.displayObj.snackbar._dismiss()}this._close()});/**\n * listen to keyboard events\n */document.addEventListener(\"keydown\",event=>{const key=event.key||event.keyCode;if(\"Escape\"===key||\"Esc\"===key||27===key){if(this.displayObj.closeOnEscape){this._close()}}});// when display not wired with show method, listening open event from window\nif(!this._isWiredWithShow()){window.addEventListener(\"open-furo-snackbar-requested\",e=>{e.stopPropagation();this.show(e.detail)})}}", "title": "" }, { "docid": "f38f601b36177f810621ca53545ef6af", "score": "0.47791788", "text": "_FBPReady(){super._FBPReady();// this._FBPTraceWires()\n}", "title": "" }, { "docid": "f38f601b36177f810621ca53545ef6af", "score": "0.47791788", "text": "_FBPReady(){super._FBPReady();// this._FBPTraceWires()\n}", "title": "" }, { "docid": "f38f601b36177f810621ca53545ef6af", "score": "0.47791788", "text": "_FBPReady(){super._FBPReady();// this._FBPTraceWires()\n}", "title": "" }, { "docid": "f38f601b36177f810621ca53545ef6af", "score": "0.47791788", "text": "_FBPReady(){super._FBPReady();// this._FBPTraceWires()\n}", "title": "" }, { "docid": "f38f601b36177f810621ca53545ef6af", "score": "0.47791788", "text": "_FBPReady(){super._FBPReady();// this._FBPTraceWires()\n}", "title": "" }, { "docid": "f38f601b36177f810621ca53545ef6af", "score": "0.47791788", "text": "_FBPReady(){super._FBPReady();// this._FBPTraceWires()\n}", "title": "" }, { "docid": "f38f601b36177f810621ca53545ef6af", "score": "0.47791788", "text": "_FBPReady(){super._FBPReady();// this._FBPTraceWires()\n}", "title": "" }, { "docid": "724abc4d4ba0e65549ccc2c19dddcd0f", "score": "0.4774175", "text": "static fbResp(fbRespObj) {\n if (!isObject(fbRespObj))\n return false;\n if (!fbRespObj.status || fbRespObj.status === \"unknown\")\n return false;\n if (!fbRespObj.hasOwnProperty('authResponse') || !isObject(fbRespObj.authResponse))\n return false;\n let authResponse = fbRespObj.authResponse;\n return {\n type: 'fb',\n user_id: authResponse.userID,\n access_token: authResponse.accessToken,\n expires_in: authResponse.expiresIn,\n signed_request: authResponse.signedRequest\n };\n }", "title": "" }, { "docid": "1fe801f63a05a46cc3029067d6b1c0ed", "score": "0.4770125", "text": "function initializeFacebook() {\n window.fbAsyncInit = function () {\n FB.init({\n appId: APP_ID,\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.2' // use version 2.2\n })\n }\n }", "title": "" }, { "docid": "acbd188e52c73a82cda1b5a3d10bcdd1", "score": "0.47612765", "text": "function y0(e){let{basename:t,children:n,window:r}=e,o=le.exports.useRef();o.current==null&&(o.current=Xp({window:r}));let l=o.current,[i,u]=le.exports.useState({action:l.action,location:l.location});return le.exports.useLayoutEffect(()=>l.listen(u),[l]),le.exports.createElement(p0,{basename:t,children:n,location:i.location,navigationType:i.action,navigator:l})}", "title": "" }, { "docid": "ba5934421e3bc3923ca6d12123da5030", "score": "0.4760776", "text": "connectedCallback() {\n super.connectedCallback();\n }", "title": "" }, { "docid": "ba5934421e3bc3923ca6d12123da5030", "score": "0.4760776", "text": "connectedCallback() {\n super.connectedCallback();\n }", "title": "" }, { "docid": "ba5934421e3bc3923ca6d12123da5030", "score": "0.4760776", "text": "connectedCallback() {\n super.connectedCallback();\n }", "title": "" }, { "docid": "ba5934421e3bc3923ca6d12123da5030", "score": "0.4760776", "text": "connectedCallback() {\n super.connectedCallback();\n }", "title": "" }, { "docid": "ba5934421e3bc3923ca6d12123da5030", "score": "0.4760776", "text": "connectedCallback() {\n super.connectedCallback();\n }", "title": "" }, { "docid": "ba5934421e3bc3923ca6d12123da5030", "score": "0.4760776", "text": "connectedCallback() {\n super.connectedCallback();\n }", "title": "" }, { "docid": "ba5934421e3bc3923ca6d12123da5030", "score": "0.4760776", "text": "connectedCallback() {\n super.connectedCallback();\n }", "title": "" }, { "docid": "ba5934421e3bc3923ca6d12123da5030", "score": "0.4760776", "text": "connectedCallback() {\n super.connectedCallback();\n }", "title": "" }, { "docid": "ba5934421e3bc3923ca6d12123da5030", "score": "0.4760776", "text": "connectedCallback() {\n super.connectedCallback();\n }", "title": "" }, { "docid": "ba5934421e3bc3923ca6d12123da5030", "score": "0.4760776", "text": "connectedCallback() {\n super.connectedCallback();\n }", "title": "" }, { "docid": "ba5934421e3bc3923ca6d12123da5030", "score": "0.4760776", "text": "connectedCallback() {\n super.connectedCallback();\n }", "title": "" }, { "docid": "ba5934421e3bc3923ca6d12123da5030", "score": "0.4760776", "text": "connectedCallback() {\n super.connectedCallback();\n }", "title": "" }, { "docid": "6b1058340f927cec4da531568795c919", "score": "0.47507483", "text": "supportsPlatform() {\n return true;\n }", "title": "" }, { "docid": "ccaae98eabc2ee6d4d110a65a8869c0d", "score": "0.47497204", "text": "loginWithFacebook(){\n LoginManager.logInWithReadPermissions(['public_profile','email'])\n .then(\n (res)=>{\n if(res.isCancelled)\n return\n //alert('Login success with permissions: ' +res.grantedPermissions.toString());\n //alert(res.grantedPermissions())\n \n AccessToken.getCurrentAccessToken().then(\n (data) => {\n \n //alert(data.accessToken.toString())\n body = JSON.stringify({access_token:data.accessToken.toString()})\n this.state.auth_service.post(body,'/auth/login_facebook')\n .then(\n (response)=>{\n if(response.status ==200){\n response.json().then(\n (res_json)=>{\n this.state.auth_service.handleToken(res_json)\n this.props.navigation.navigate('App',res_json.user)\n }\n )\n }\n else{\n\n }\n //alert(\"success\")\n }\n ,(error)=>{\n //alert(error.message)\n }\n )\n \n }\n )\n \n },\n (error)=>{}\n )\n }", "title": "" }, { "docid": "562798b5f28ed8a517390da3b00593ee", "score": "0.4749441", "text": "appShareFunc() {\n Share.share({\n message: 'Please Download Near-me app from play store',\n title: 'Near-me App',\n url: 'http://google.com'\n })\n .then((result) => {\n console.log(\"Result\", result);\n }).catch(err => console.log(err))\n\n }", "title": "" }, { "docid": "42cb38ed15c7ff3c1c4b9e9a054efb43", "score": "0.47408032", "text": "statusChangeCallback(response) {\n if (response.status === 'connected') {\n // Logged into your app and Facebook.\n const token = response.authResponse\n // Logged into your app and Facebook.\n this.setState(() => ({\n token,\n }))\n this.testAPI()\n // const provider = 'facebook'\n // return dispatch(handleLoginOAuth(token, provider))\n } else {\n // The person is not logged into your app or we are unable to tell.\n\n }\n }", "title": "" }, { "docid": "88a3d87639737356ea830ace34260be6", "score": "0.47407368", "text": "$onCreate () {}", "title": "" }, { "docid": "77d338ca8f707f2e23aa9693bee319f4", "score": "0.47404292", "text": "function openFacebook() {\n\twindow.open(\"https://www.facebook.com/StitchedRecordingsLLC\");\n}", "title": "" }, { "docid": "739509efcd851c88b01c330dd365d846", "score": "0.47243598", "text": "_FBPDebug(wire,openDebugger){const self=this;this._FBPAddWireHook(wire,e=>{if(openDebugger){// eslint-disable-next-line no-debugger\ndebugger}else{const ua=navigator.userAgent.toLowerCase();let agent=!0;if(-1!==ua.indexOf(\"safari\")){if(-1<ua.indexOf(\"chrome\")){agent=!0;// Chrome\n}else{agent=!1;// Safari\n}}if(agent){// eslint-disable-next-line no-console\nconsole.group(\"Debug\",`${this.nodeName}: ${wire}`);// eslint-disable-next-line no-console\nconsole.group(\"Target Elements\");// eslint-disable-next-line no-console\nconsole.table(self.__wirebundle[wire]);// eslint-disable-next-line no-console\nconsole.groupEnd();// eslint-disable-next-line no-console\nconsole.groupCollapsed(\"Data\");// eslint-disable-next-line no-console\nconsole.log(e);// eslint-disable-next-line no-console\nconsole.groupEnd();// eslint-disable-next-line no-console\nconsole.groupCollapsed(\"Call Stack\");// eslint-disable-next-line no-console\nconsole.log(new Error().stack);// eslint-disable-next-line no-console\nconsole.groupEnd();// eslint-disable-next-line no-console\nconsole.groupEnd()}}},!0)}", "title": "" }, { "docid": "223985bf00d8d8fb7079556a470e8fe6", "score": "0.4722678", "text": "_getCodeLocation() {\n \n }", "title": "" }, { "docid": "58fe069fc2fa0e6ee6abd596ca89d694", "score": "0.47204465", "text": "testAPI() {\n console.log('Welcome! Fetching your information.... ');\n FB.api('/me', function(response) {\n console.log('Successful login for: ' + response.name);\n // document.getElementById('status').innerHTML =\n // 'Thanks for logging in, ' + response.name + '!';\n });\n }", "title": "" }, { "docid": "f269e69ecc3c11d20eae334650cc731d", "score": "0.4705941", "text": "function testAPI() {\n\n FB.api('/me', function(response) {\n console.log('Successful login for: ' + response.name);\n \n // 登入\n facebookLogin(response.name);\n\n // 人的名子\n $('#personalName').text(response.name);\n\n document.getElementById('sign-status').innerHTML =\n '歡迎來到 StoryScaner , ' + response.name + ' !';\n });\n}", "title": "" }, { "docid": "107c594b0c2a0791a5eeb1210c1f4ccd", "score": "0.470088", "text": "componentDidMount() {\n this.generateToken();\n if (process.browser && !this.state.scriptVidyoSDK) {\n setVideoChatComponent(this);\n this.defineBrowserCompatability();\n }\n }", "title": "" }, { "docid": "07b808949028ed401a1647037ee2325b", "score": "0.4689363", "text": "componentDidMount() {\n window.scrollTo(0, 0);\n\n // Janky way of dealing with Facebook Oauth url issue\n if (window.location.hash === '#_=_') {\n history.replaceState\n ? history.replaceState(null, null, window.location.href.split('#')[0])\n : window.location.hash = '';\n }\n\n // Pull all articles, listings, and videos from the database\n axios.get('/api/home/')\n .then(resp => {\n this.setState({\n banner: resp.data.banner,\n components: resp.data.components,\n pending: false,\n error: '',\n });\n })\n .catch(error => {\n this.setState({\n pending: false,\n error: error.response.data.error || error.response.data || 'Something went wrong. Please try again later.',\n });\n });\n }", "title": "" }, { "docid": "39f9003a8eef1aeab2c6f593efb4572f", "score": "0.46892384", "text": "function follow() {\n\t\n}", "title": "" }, { "docid": "cd695e1f60e2df9edc38f0dead19766d", "score": "0.46818635", "text": "function be(e){let{basename:n,children:t,window:r}=e,a=f.exports.useRef();a.current==null&&(a.current=re({window:r}));let i=a.current,[l,c]=f.exports.useState({action:i.action,location:i.location});return f.exports.useLayoutEffect(()=>i.listen(c),[i]),f.exports.createElement(Ce,{basename:n,children:t,location:l.location,navigationType:l.action,navigator:i})}", "title": "" }, { "docid": "f205ec42e194f9a6252eab9a06829573", "score": "0.4678868", "text": "function FB_connected_callback( cbsuccess ) {\n console.log('Welcome! Fetching your information.... ');\n FB.api('/me', cbsuccess\n );\n }", "title": "" }, { "docid": "795da796a742ee585dfbf280a52d2062", "score": "0.46781048", "text": "function fbShare() {\n //alert(\"yes\");\n FB.ui({\n method: 'share_open_graph',\n action_type: 'og.likes',\n action_properties: JSON.stringify({\n object: 'https://kevindupreez.github.io/sadWallabies/',\n })\n }, function(response) {\n // Debug response (optional)\n console.log(response);\n });\n}", "title": "" }, { "docid": "ad348fa0c3bacd0000edbaf5dbd90270", "score": "0.46729726", "text": "function testAPI() {\n// console.log('Welcome! Fetching your information.... ');\n FB.api('/me', function (response) {\n// console.log('Successful login for: ' + response.name);\n document.getElementById('status').innerHTML =\n 'Thanks for logging in, ' + response.name + '!';\n callFCallback(response, 'facebook');\n });\n}", "title": "" }, { "docid": "9f5df2b9de1e46e59079358274837276", "score": "0.46702254", "text": "function seeFacebookLogin()\r\n{\r\n // clear #seeForm (we may write an error there)\r\n $( '#seeForm' ).html('');\r\n\r\n player.UserRegistration.login( {method: 'Facebook'} );\r\n}", "title": "" }, { "docid": "a5734ea83a5194a5840b481afdc48a0f", "score": "0.46647328", "text": "_FBPTraceWires(){const self=this;// eslint-disable-next-line guard-for-in,no-restricted-syntax\nfor(const wire in this.__wirebundle){this._FBPAddWireHook(wire,e=>{const ua=navigator.userAgent.toLowerCase();let agent=!0;if(-1!==ua.indexOf(\"safari\")){if(-1<ua.indexOf(\"chrome\")){agent=!0;// Chrome\n}else{agent=!1;// Safari\n}}if(agent){// eslint-disable-next-line no-console\nconsole.group(\"Trace for\",`${this.nodeName}: ${wire}`);// eslint-disable-next-line no-console\nconsole.table([{host:self,wire,data:e}]);// eslint-disable-next-line no-console\nconsole.groupCollapsed(\"Data\");// eslint-disable-next-line no-console\nconsole.log(e);// eslint-disable-next-line no-console\nconsole.groupEnd();// eslint-disable-next-line no-console\nconsole.groupCollapsed(\"Target Elements\");// eslint-disable-next-line no-console\nconsole.table(self.__wirebundle[wire]);// eslint-disable-next-line no-console\nconsole.groupEnd();// eslint-disable-next-line no-console\nconsole.groupCollapsed(\"Call Stack\");// eslint-disable-next-line no-console\nconsole.log(new Error().stack);// eslint-disable-next-line no-console\nconsole.groupEnd();// eslint-disable-next-line no-console\nconsole.groupEnd()}},!0)}}", "title": "" }, { "docid": "184463920d9f3d16b4abf30a902e70ce", "score": "0.46625414", "text": "function fbLogin() {\n\n FB.login(function (response) {\n\n // Check if the user logged in successfully.\n if (response.authResponse) {\n\n console.log('You are now logged in.');\n\n // Add the Facebook access token to the Cognito credentials login map.\n AWS.config.credentials = new AWS.CognitoIdentityCredentials({\n IdentityPoolId: 'us-east-1:f26d69b9-c2fe-4a0c-8e96-35791897537e',\n Logins: {\n 'graph.facebook.com': response.authResponse.accessToken\n }\n });\n\n // Obtain AWS credentials\n AWS.config.credentials.get(function(){\n // Credentials will be available when this function is called.\n var accessKeyId = AWS.config.credentials.accessKeyId;\n var secretAccessKey = AWS.config.credentials.secretAccessKey;\n var sessionToken = AWS.config.credentials.sessionToken;\n });\n\n } else {\n console.log('There was a problem logging you in.');\n }{scope: 'public_profile','email'};\n\n });\n}", "title": "" }, { "docid": "0453b16d4cacfdb0531a0886c9c14ab0", "score": "0.46598256", "text": "connectedCallback() {\n \n }", "title": "" }, { "docid": "a2c50636b59f65d12f4c7af151e0d408", "score": "0.4654489", "text": "function shareOnFacebook(){\n //https://www.facebook.com/dialog/share?app_id=573772579411776&display=popup&href=http://qmusic.be/playlist&redirect_uri=http://qmusic.be/playlist\n FB.ui({\n method: 'feed',\n name: 'Facebook Dialogs',\n link: sessionStorage.youtubeIDs ,\n picture: 'http://verenavertonghen.mctantwerpen.kdg.be/img/mix4.png',\n caption: 'Flippin\\' mixtape',\n description: 'Mixtape!',\n message: 'I made this mixtape, check it out! \\n' + sessionStorage.youtubeIDs}\n ,function(response) {});\n}", "title": "" }, { "docid": "0341ce2df9ee1f659393adc33b620912", "score": "0.46533948", "text": "function seeFacebookConnect()\r\n{\r\n // clear #seeForm (we may write an error there)\r\n $( '#seeForm' ).html('');\r\n\r\n player.UserRegistration.connectSocial( 'Facebook' );\r\n}", "title": "" }, { "docid": "e3f41308c1a2c6ae76fb30fec87c427c", "score": "0.46476084", "text": "connectFB() {\n // Initialize Firebase\n var config = {\n apiKey: \"AIzaSyCFUk71bXvRglH9gFkSaLKLG_HqNMEECYk\",\n authDomain: \"dbteste-c3ff5.firebaseapp.com\",\n databaseURL: \"https://dbteste-c3ff5.firebaseio.com\",\n projectId: \"dbteste-c3ff5\",\n storageBucket: \"dbteste-c3ff5.appspot.com\",\n messagingSenderId: \"729588647234\"\n };\n firebase.initializeApp(config);\n var rootRef = firebase.database().ref();\n\n }", "title": "" }, { "docid": "1319a8f25ace0bdae027b98333b4adb9", "score": "0.46401662", "text": "async componentDidMount() {\n await Camera.requestPermissionsAsync();\n\n }", "title": "" }, { "docid": "b4bcbbe61ae307fb01e7e6d93a95f9a3", "score": "0.4633799", "text": "clickShare_facebook() {\n return this\n .waitForElementVisible('@facebookShareLinkIcon')\n .assert.visible('@facebookShareLinkIcon')\n .click('@facebookShareLinkIcon');\n }", "title": "" }, { "docid": "a81cf2b02b23788eceb0c3c3ab31da96", "score": "0.4620172", "text": "function componentDidMount ()\n {\n\n }", "title": "" }, { "docid": "a81cf2b02b23788eceb0c3c3ab31da96", "score": "0.4620172", "text": "function componentDidMount ()\n {\n\n }", "title": "" }, { "docid": "a81cf2b02b23788eceb0c3c3ab31da96", "score": "0.4620172", "text": "function componentDidMount ()\n {\n\n }", "title": "" }, { "docid": "81c23075e2a6e4e1cef5ac4a2333cb3c", "score": "0.46084747", "text": "async facebookSignIn() {\n const { type, token, permissions } = await Facebook.logInWithReadPermissionsAsync('1056365824552520', {\n permissions: ['public_profile', 'email'],\n });\n if (type === 'success') {\n // Get the user's name using Facebook's Graph API\n const response = await fetch(\n `https://graph.facebook.com/me?access_token=${token}&fields=id,name,email`);\n const fbUser = await response.json();\n // console.log({ fbUser, permissions });\n AuthService.externalLogIn('Facebook', fbUser.email).then(response => response.json())\n .then(responseJSON => {\n // console.log(\"fb ok \", {responseJSON});\n\n switch (responseJSON._statusCode) {\n case 400:\n // No user given...\n this.props.navigation.navigate(\"SignUp\", {\n email: fbUser.email,\n firstName: fbUser.name,\n })\n return;\n\n case undefined:\n // No status code should mean the object retrieved has the user\n break;\n\n case 200:\n // best case\n break;\n\n default:\n // Any other error\n break;\n }\n let user = responseJSON;\n\n if (user.applicationUser.token) {\n // TODO Check if with social login credentials saved are needed\n // this.saveCredentialsLocally(email, password);\n this.saveTokenLocally(user.applicationUser.token, user.applicationUser.refreshToken);\n this.saveUserLocally(user);\n this.props.navigation.navigate(\"Main\");\n }\n else Alert.alert(\"Login inválido\");\n // this.saveUserLocally(result.user);\n\n // TODO: pass token to Backend\n // this.props.navigation.navigate(\"Main\");\n })\n .catch(error => {\n Alert.alert(`Hubo un problema con nuestros servidores`);\n // console.log({error});\n\n });\n\n }\n else {\n Alert.alert(\"Ha habido un problema iniciando sesión con facebook\");\n }\n // this.props.navigation.navigate(\"Main\");\n }", "title": "" }, { "docid": "f79194e13cf59bfbe79cb02b2a4051c9", "score": "0.46074855", "text": "function fbLog() {}", "title": "" }, { "docid": "6f9caf0a9d7bd28848857ec478e90365", "score": "0.4590201", "text": "render() {\n return (\n <html lang=\"en\" dir=\"ltr\">\n <Head>\n <title>{appName}</title>\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n <meta charSet=\"utf-8\" />\n\n <link\n rel=\"stylesheet\"\n href=\"https://fonts.googleapis.com/css?family=Roboto:300,400,500\"\n />\n\n <meta name=\"application-name\" content=\"monsieur-robot\" />\n <link rel=\"manifest\" href=\"static/manifest.json\" />\n\n <link\n rel=\"icon\"\n type=\"image/png\"\n sizes=\"32x32\"\n href=\"static/favicon-32x32.png\"\n />\n <link\n rel=\"icon\"\n type=\"image/png\"\n sizes=\"16x16\"\n href=\"static/favicon-16x16.png\"\n />\n <meta name=\"theme-color\" content=\"#00897b\" />\n\n <link\n rel=\"mask-icon\"\n href=\"static/safari-pinned-tab.svg\"\n color=\"#00897b\"\n />\n <meta name=\"apple-mobile-web-app-title\" content=\"M. robot\" />\n <link\n rel=\"apple-touch-icon\"\n sizes=\"180x180\"\n href=\"static/apple-touch-icon.png\"\n />\n <link\n rel=\"apple-touch-startup-image\"\n href=\"static/apple-touch-icon.png\"\n />\n <meta name=\"apple-mobile-web-app-capable\" content=\"yes\" />\n <meta name=\"apple-mobile-web-app-title\" content=\"M. robot\" />\n {/* <meta name=\"apple-mobile-web-app-status-bar-style\" content=\"black-translucent\" /> */}\n <meta name=\"apple-mobile-web-app-status-bar-style\" content=\"black\" />\n <style jsx>{`\n {\n /* next js fix for div surrounding #__next */\n }\n html,\n body,\n body > div:first-child,\n #__next,\n #__next > div:first-child {\n height: 100%;\n margin: 0;\n }\n `}</style>\n </Head>\n <body>\n <Main />\n <NextScript />\n </body>\n </html>\n );\n }", "title": "" }, { "docid": "3ce230d2ee78d953367e7c7dabb1b198", "score": "0.45887473", "text": "componentDidMount() {\n fetch(`https://www.instagram.com/${this.state.accountName}/?__a=1`)\n .then(results => {\n return results.json();\n }).then(data => {\n let pictures = data.graphql.user.edge_owner_to_timeline_media.edges;\n this.setState({ pictures: pictures });\n }).catch(error => {\n console.log(error);\n });\n }", "title": "" }, { "docid": "2ea93d842d2905e7f566e92c125ce67e", "score": "0.45879552", "text": "function fbLoginAuthCode(callback) {\n FB.login(function(response) {\n if (response.authResponse) {\n var accessToken = FB.getAuthResponse()['accessToken'];\n var expiresIn = FB.getAuthResponse()['expiresIn'];\n var authCode = accessToken.toString() + \"&expires_in=\" + expiresIn.toString();\n callback(authCode)\n }\n }, {scope: 'public_profile,email,user_location,user_hometown,user_birthday'});\n}", "title": "" }, { "docid": "a4601c4e8929adf004d1070126c9930d", "score": "0.45867053", "text": "createdCallback() {\n \n }", "title": "" }, { "docid": "49aaecf12537ce53ece5e8ed0b43dbf7", "score": "0.45861828", "text": "_FBPReady(){super._FBPReady();// this._FBPTraceWires();\n/**\n * Is fired if native input change event is fired\n * @event input-changed Payload: target element\n */this._FBPAddWireHook(\"--changed\",e=>{this.dispatchEvent(new CustomEvent(\"input-changed\",{detail:e.target,bubbles:!0,composed:!0}))})}", "title": "" }, { "docid": "70f0471ddcbddd4bd50ea1b23f5d78de", "score": "0.45859095", "text": "onReady() {\n }", "title": "" } ]
b5f83787c6c7713cc536cc0e78ac3f9b
defines an instance method with the same name as a prototype mehtod
[ { "docid": "67bacf798ec7946a1d0bbad17275cfc8", "score": "0.0", "text": "function Ninja() {\n this.swung = true;\n this.swingSword = function() {\n return !this.swung;\n };\n}", "title": "" } ]
[ { "docid": "1694907e949908190a62aade7709b0d6", "score": "0.6638741", "text": "function MyFunc() {\n this.message = \"Hello from prototype declared function\";\n}", "title": "" }, { "docid": "7591d13c0222ab6afdd5daaaf9a9c180", "score": "0.64807415", "text": "function Emp(id, name) {\n this.id = id;\n this.name = name;\n\n this.print = function () {\n console.log(\"instance function\");\n }\n\n Emp.prototype.commonPrint = function () {\n console.log(\"stored in prototype, once only\");\n }\n\n Emp.count = 10;\n Emp.prototype.count1 = 100;\n}", "title": "" }, { "docid": "dba473dd36edc42db669d5af36bb1d4b", "score": "0.63863647", "text": "draw() {\n console.log('draw is a prototype method because it is outside constructor');\n }", "title": "" }, { "docid": "44b65ae8f82407d0a5440615b97cf2e0", "score": "0.62273544", "text": "function PersonWithMethodsInPrototype(name, age) {\n this.name = name\n this.age = age\n}", "title": "" }, { "docid": "86c6d7b45e975426736f860d86752cb5", "score": "0.6199363", "text": "function classCtor() {} // Define prototype for class", "title": "" }, { "docid": "6e8c209c61ea98c52e9cac54a3d4ba10", "score": "0.61762303", "text": "function defineMethod(name,func){var old=nodePrototype[name];// Pass undefined as func to delete nodePrototype[name].\nif(isUndefined.check(func)){delete nodePrototype[name];}else{isFunction.assert(func);Object.defineProperty(nodePrototype,name,{enumerable:true,configurable:true,value:func});}return old;}", "title": "" }, { "docid": "971fa59a188375348ec70f263b710a35", "score": "0.611621", "text": "function V(a){var b=function(){};return b.prototype=a,new b}", "title": "" }, { "docid": "c384721b0ee89a323b934838e5187d3b", "score": "0.60784537", "text": "override( replacement ) { return this.helper( replacement, Object.create( this.constructor.prototype ) ) }", "title": "" }, { "docid": "016ee0166c641714edea1b7bdf8b18b0", "score": "0.6008515", "text": "function PrototypeConstructor() {\n this.constructor = extension.constructor;\n }", "title": "" }, { "docid": "65dbe6b40d911391bda0f114cd49cdb5", "score": "0.5822601", "text": "function Person_prototype(name,age) {\n this.name=name;\n this.age=age;\n}", "title": "" }, { "docid": "aed3defbdb3efe80f50706f362c5460a", "score": "0.5813501", "text": "function add(name, method) {\n\t\tif( !Date.prototype[name] ) {\n\t\t\tDate.prototype[name] = method;\n\t\t}\n\t}", "title": "" }, { "docid": "aed3defbdb3efe80f50706f362c5460a", "score": "0.5813501", "text": "function add(name, method) {\n\t\tif( !Date.prototype[name] ) {\n\t\t\tDate.prototype[name] = method;\n\t\t}\n\t}", "title": "" }, { "docid": "bfaf8a75ec65f6874fd3edc2a7fc0221", "score": "0.57783693", "text": "function Foo() {\n\n this.a = 1;\n this.b = 2;\n\n this.mymethod = function(a) {\n console.log('I will not print what you say!');\n };\n}", "title": "" }, { "docid": "93cffbea5ba4a7ed8d20a90b511dbb26", "score": "0.57460207", "text": "function\tclass_add_method(newClass, name, fn, encoding)\n\t{\n\t\t__jsc__.add({ instanceMethod : name, 'class' : newClass, jsFunction : fn, encoding : encoding })\n\t}", "title": "" }, { "docid": "6e046f448830d874f6d9d3a406b92c88", "score": "0.5714388", "text": "function add(name, method) {\n\t\tif( !String.prototype[name] ) {\n\t\t\tString.prototype[name] = method;\n\t\t}\n\t}", "title": "" }, { "docid": "185b782c3c2455652f8aa6a8228b315b", "score": "0.56457055", "text": "function defineIteratorMethods(prototype) {\n\t\t\t\t\t\t[\"next\", \"throw\", \"return\"].forEach(function (method) {\n\t\t\t\t\t\t\tprototype[method] = function (arg) {\n\t\t\t\t\t\t\t\treturn this._invoke(method, arg);\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t});\n\t\t\t\t\t}", "title": "" }, { "docid": "8d2c581c8af173aebbaa6d556e1a2004", "score": "0.5642064", "text": "function defineIteratorMethods(prototype) { // 93\n [\"next\", \"throw\", \"return\"].forEach(function(method) { // 94\n prototype[method] = function(arg) { // 95\n return this._invoke(method, arg); // 96\n }; // 97\n }); // 98\n } // 99", "title": "" }, { "docid": "6a391ea1ecd1dafb6bf77e76d299e612", "score": "0.5618822", "text": "function Class() { } // 1724", "title": "" }, { "docid": "36a676de3bfce159a3eeb2fc4e5db5f9", "score": "0.5612879", "text": "function defineIteratorMethods(prototype) {\n ;['next', 'throw', 'return'].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg)\n }\n })\n }", "title": "" }, { "docid": "f2646bf8437422c4d9dc92b02927645e", "score": "0.55954456", "text": "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "title": "" }, { "docid": "72ecff493a7a35dcafe1fe704b89b25f", "score": "0.55939007", "text": "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }", "title": "" }, { "docid": "842b29593615da4567589b7e23c6c299", "score": "0.5583358", "text": "wrapMethod(methodName) {\n this[methodName] = function () {\n return this.getOriginalInstance()[methodName].apply(this, arguments);\n };\n }", "title": "" }, { "docid": "c17145b1ee2ca6bbce03b5ad69e2b2bd", "score": "0.5572102", "text": "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }", "title": "" }, { "docid": "c17145b1ee2ca6bbce03b5ad69e2b2bd", "score": "0.5572102", "text": "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }", "title": "" }, { "docid": "51e6d6f51a2b72cc23238131418246cf", "score": "0.5560216", "text": "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }", "title": "" }, { "docid": "51e6d6f51a2b72cc23238131418246cf", "score": "0.5560216", "text": "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }", "title": "" }, { "docid": "51e6d6f51a2b72cc23238131418246cf", "score": "0.5560216", "text": "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }", "title": "" }, { "docid": "51e6d6f51a2b72cc23238131418246cf", "score": "0.5560216", "text": "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }", "title": "" }, { "docid": "51e6d6f51a2b72cc23238131418246cf", "score": "0.5560216", "text": "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }", "title": "" }, { "docid": "51e6d6f51a2b72cc23238131418246cf", "score": "0.5560216", "text": "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }", "title": "" }, { "docid": "51e6d6f51a2b72cc23238131418246cf", "score": "0.5560216", "text": "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }", "title": "" }, { "docid": "fd9e80054b71cd0b7efd25c3957f379a", "score": "0.5552415", "text": "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "title": "" }, { "docid": "fd9e80054b71cd0b7efd25c3957f379a", "score": "0.5552415", "text": "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "title": "" }, { "docid": "fd9e80054b71cd0b7efd25c3957f379a", "score": "0.5552415", "text": "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "title": "" }, { "docid": "fd9e80054b71cd0b7efd25c3957f379a", "score": "0.5552415", "text": "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "title": "" }, { "docid": "2ddb7c3a2817814338c6e0b590b6e330", "score": "0.55443305", "text": "function createMethod(name, fn) {\n\t\t\treturn function(){\n\t\t\t\tvar self = this, tmp = self._super, ret;\n\n\t\t\t\tself._super = _super[name];\n\t\t\t\tret = fn.apply(self, arguments);\n\t\t\t\tself._super = tmp;\n\n\t\t\t\treturn ret;\n\t\t\t};\n\t\t}", "title": "" }, { "docid": "0032216aff7e980ddfc20bb8306aa0b1", "score": "0.553862", "text": "function defineIteratorMethods(prototype) {\n\t\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t\t prototype[method] = function(arg) {\n\t\t return this._invoke(method, arg);\n\t\t };\n\t\t });\n\t\t }", "title": "" }, { "docid": "9111bad8ba88e930235d48b7809b55ac", "score": "0.5532342", "text": "function defineIteratorMethods(prototype) {\n [\n \"next\",\n \"throw\",\n \"return\"\n ].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }", "title": "" }, { "docid": "75407e4aa2393b408de21529f3fdc452", "score": "0.55302894", "text": "function __proto__() {\n ;\n}", "title": "" }, { "docid": "aa7fcd564d2be5c38bb5c7971b0e9ea2", "score": "0.5526567", "text": "locate() {\n console.log('prototype');\n }", "title": "" }, { "docid": "4e447b93a5940a074ecff89d6d695091", "score": "0.55213946", "text": "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "title": "" }, { "docid": "ccb0676f588dde1c84c36b49d8a81ecc", "score": "0.5519041", "text": "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "title": "" }, { "docid": "5e93563dc66756122691eb9cbd164169", "score": "0.5516756", "text": "function defineIteratorMethods(prototype) {\n [ \"next\", \"throw\", \"return\" ].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }", "title": "" }, { "docid": "526f0d797184ce2bd5cc63cf4a4377c1", "score": "0.5510868", "text": "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "title": "" }, { "docid": "e9afe2ef6d450e57faee346dced74709", "score": "0.5509548", "text": "_$kind() {\n super._$kind();\n this._value.kind = 'function';\n }", "title": "" }, { "docid": "187f3150ed043a76a3aee3c0763028de", "score": "0.5506677", "text": "function defineOnPrototype(ctor, methods) {\n var proto = ctor.prototype;\n forEachProperty(methods, function(val, key) {\n proto[key] = val;\n });\n }", "title": "" }, { "docid": "187f3150ed043a76a3aee3c0763028de", "score": "0.5506677", "text": "function defineOnPrototype(ctor, methods) {\n var proto = ctor.prototype;\n forEachProperty(methods, function(val, key) {\n proto[key] = val;\n });\n }", "title": "" }, { "docid": "187f3150ed043a76a3aee3c0763028de", "score": "0.5506677", "text": "function defineOnPrototype(ctor, methods) {\n var proto = ctor.prototype;\n forEachProperty(methods, function(val, key) {\n proto[key] = val;\n });\n }", "title": "" }, { "docid": "8cb6906db4778c7411e16005b00f504a", "score": "0.5504052", "text": "function defineIteratorMethods(prototype) {\n [ \"next\", \"throw\", \"return\" ].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.5501453", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.5501453", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.5501453", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.5501453", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.5501453", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.5501453", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.5501453", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.5501453", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.5501453", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.5501453", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.5501453", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.5501453", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.5501453", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.5501453", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.5501453", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.5501453", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.5501453", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.5501453", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.5501453", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.5501453", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.5501453", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.5501453", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.5501453", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.5501453", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.5501453", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.5501453", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.5501453", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.5501453", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.5501453", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.5501453", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.5501453", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.5501453", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.5501453", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.5501453", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.5501453", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.5501453", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.5501453", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.5501453", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.5501453", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.5501453", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.5501453", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.5501453", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.5501453", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "48637fe809ee2def8d434575f544242c", "score": "0.54974073", "text": "function createMethod(name, fn) {\n\t\t\treturn function() {\n\t\t\t\tvar self = this, tmp = self._super, ret;\n\n\t\t\t\tself._super = _super[name];\n\t\t\t\tret = fn.apply(self, arguments);\n\t\t\t\tself._super = tmp;\n\n\t\t\t\treturn ret;\n\t\t\t};\n\t\t}", "title": "" }, { "docid": "48637fe809ee2def8d434575f544242c", "score": "0.54974073", "text": "function createMethod(name, fn) {\n\t\t\treturn function() {\n\t\t\t\tvar self = this, tmp = self._super, ret;\n\n\t\t\t\tself._super = _super[name];\n\t\t\t\tret = fn.apply(self, arguments);\n\t\t\t\tself._super = tmp;\n\n\t\t\t\treturn ret;\n\t\t\t};\n\t\t}", "title": "" }, { "docid": "48637fe809ee2def8d434575f544242c", "score": "0.54974073", "text": "function createMethod(name, fn) {\n\t\t\treturn function() {\n\t\t\t\tvar self = this, tmp = self._super, ret;\n\n\t\t\t\tself._super = _super[name];\n\t\t\t\tret = fn.apply(self, arguments);\n\t\t\t\tself._super = tmp;\n\n\t\t\t\treturn ret;\n\t\t\t};\n\t\t}", "title": "" }, { "docid": "48637fe809ee2def8d434575f544242c", "score": "0.54974073", "text": "function createMethod(name, fn) {\n\t\t\treturn function() {\n\t\t\t\tvar self = this, tmp = self._super, ret;\n\n\t\t\t\tself._super = _super[name];\n\t\t\t\tret = fn.apply(self, arguments);\n\t\t\t\tself._super = tmp;\n\n\t\t\t\treturn ret;\n\t\t\t};\n\t\t}", "title": "" }, { "docid": "01b9a6ea81043fdca3dafe4f7d16002a", "score": "0.54940516", "text": "function defineIteratorMethods(prototype) {\r\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\r\n prototype[method] = function(arg) {\r\n return this._invoke(method, arg);\r\n };\r\n });\r\n }", "title": "" }, { "docid": "081d57df440f4a874b068d32e0ee43da", "score": "0.54887193", "text": "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }", "title": "" }, { "docid": "081d57df440f4a874b068d32e0ee43da", "score": "0.54887193", "text": "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }", "title": "" }, { "docid": "081d57df440f4a874b068d32e0ee43da", "score": "0.54887193", "text": "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }", "title": "" }, { "docid": "081d57df440f4a874b068d32e0ee43da", "score": "0.54887193", "text": "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }", "title": "" } ]
19b7da72a7a2f210f256e49f276e3a79
Applies the saturate effect to a sprite, saturates the color according to hsl
[ { "docid": "bb85046c28073577c757b7458234b291", "score": "0.6704035", "text": "saturate(factor = 0.1) {\n this.addEffect(new _SpriteEffects__WEBPACK_IMPORTED_MODULE_0__[\"Saturate\"](factor));\n }", "title": "" } ]
[ { "docid": "ebb037e7a12f9d4b6cd8f3bc6718e00c", "score": "0.64732206", "text": "function calculateColorFilter(color) {\n var spriteBase = \"f89850\"; // Assumes a base color of a reddish orange\n var spriteHSL = hexToHsl(spriteBase);\n var targetColorHSL = hexToHsl(color); // User's selected color HSL\n\n var hueDeg = Math.abs(spriteHSL[0]-targetColorHSL[0]);\n var saturate = 100 + (spriteHSL[1] - targetColorHSL[1]);\n var lightness = 100 + (spriteHSL[2] - targetColorHSL[2]);\n return \"hue-rotate(\"+hueDeg+\"deg) saturate(\"+saturate+\"%) brightness(\"+lightness+\"%);\"\n}", "title": "" }, { "docid": "879743ca1d719080a005ebe35266c152", "score": "0.64719695", "text": "function _desaturate(color,amount){amount=amount===0?0:amount||10;var hsl=tinycolor(color).toHsl();hsl.s-=amount/100;hsl.s=clamp01(hsl.s);return tinycolor(hsl);}", "title": "" }, { "docid": "c32a67803bd0bed4b14405f77aa290dd", "score": "0.6209638", "text": "function hsl(h, s, l) {\r\n\treturn \"hsl(\" + h + \",\" + s + \"%,\" + l +\"%)\";\r\n}", "title": "" }, { "docid": "5609334054a76af90c62131dbb66671a", "score": "0.6175584", "text": "saturate(factor = 0.1) {\n const temp = HSLColor.fromRGBA(this.r, this.g, this.b, this.a);\n temp.s += temp.s * factor;\n return temp.toRGBA();\n }", "title": "" }, { "docid": "8e9ae1d2bb4ab50299b90e38c1ba7e8c", "score": "0.61154175", "text": "oppositeHSL() {\n\t\tconst { h, s, l } = this;\n\t\tlet newHue = (h + 180) % 360;\n\t\tlet newSaturation = (s + 50) % 100;\n\t\treturn `hsl(${newHue}, ${newSaturation}%, ${l}%)`;\n }", "title": "" }, { "docid": "bc259906f222178da592a7e2909a6edd", "score": "0.61143196", "text": "adjustSaturation(sat) {\n sat += 1\n\n const { LUMA_R, LUMA_G, LUMA_B } = this\n const invSat = 1 - sat\n const invLumR = invSat * LUMA_R\n const invLumG = invSat * LUMA_G\n const invLumB = invSat * LUMA_B\n\n this.concatValues(\n invLumR + sat,\n invLumG,\n invLumB,\n 0,\n 0,\n invLumR,\n invLumG + sat,\n invLumB,\n 0,\n 0,\n invLumR,\n invLumG,\n invLumB + sat,\n 0,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0\n )\n }", "title": "" }, { "docid": "fb6d93771dda1eff96acdf5d39710774", "score": "0.606872", "text": "function hsl(h, s, l) {\n return \"hsl(\" + h + \",\" + s + \"%,\" + l + \"%)\";\n}", "title": "" }, { "docid": "fb6d93771dda1eff96acdf5d39710774", "score": "0.606872", "text": "function hsl(h, s, l) {\n return \"hsl(\" + h + \",\" + s + \"%,\" + l + \"%)\";\n}", "title": "" }, { "docid": "aad177720fd89043cbe5a78e800e7812", "score": "0.6062009", "text": "function hsl(h, s, l) {\r\n return \"hsl(\"+h+\",\"+s+\"%,\"+l+\"%)\"\r\n}", "title": "" }, { "docid": "788996f669f3420bb3f8a9dd1507518a", "score": "0.6061642", "text": "function updateHsValue(h, l,s) {\r\n //update the values\r\n document.getElementById(\"rgb-Alpha-value\").value = Math.round(l)/100;\r\n document.getElementById(\"rgb-Saturation-value\").value = Math.round(s)/100;\r\n }", "title": "" }, { "docid": "5633ff2cf520a6700e22e31a6fcd00e4", "score": "0.60530496", "text": "saturate(amount) {\n amount = amount === 0 ? 0 : amount || 10;\n const hsl = this.toHsl();\n hsl.s += amount / 100;\n hsl.s = Math.min(1, Math.max(0, hsl.s));\n return Color.fromHSL(this.a, hsl.h, hsl.s, hsl.l);\n }", "title": "" }, { "docid": "c08c4a4a1d1c4e1d1acb0a21f8cdab92", "score": "0.6037199", "text": "function hslColor(h, s, l) {\n var hue = h;\n var saturation = s + \"%\";\n var luminance = l + \"%\";\n\n var color = \"hsl(\" + hue + \",\" + saturation + \",\" + luminance + \")\";\n\n return color;\n}", "title": "" }, { "docid": "c08c4a4a1d1c4e1d1acb0a21f8cdab92", "score": "0.6037199", "text": "function hslColor(h, s, l) {\n var hue = h;\n var saturation = s + \"%\";\n var luminance = l + \"%\";\n\n var color = \"hsl(\" + hue + \",\" + saturation + \",\" + luminance + \")\";\n\n return color;\n}", "title": "" }, { "docid": "640d9b66ad1286e538115b6f354648c8", "score": "0.60164195", "text": "hsl () {\n\n\t}", "title": "" }, { "docid": "28f1a002687cb4ea1b21c42049d29534", "score": "0.60056233", "text": "setHSL(h, s, l) {\n // h,s,l ranges are in 0.0 - 1.0\n h = MathUtils_1.MathUtils.euclideanModulo(h, 1);\n s = MathUtils_1.MathUtils.clamp(s, 0, 1);\n l = MathUtils_1.MathUtils.clamp(l, 0, 1);\n if (s === 0) {\n this.r = this.g = this.b = l;\n }\n else {\n let p = l <= 0.5 ? l * (1 + s) : l + s - (l * s);\n let q = (2 * l) - p;\n this.r = this.hue2rgb(q, p, h + 1 / 3);\n this.g = this.hue2rgb(q, p, h);\n this.b = this.hue2rgb(q, p, h - 1 / 3);\n }\n return this;\n }", "title": "" }, { "docid": "a0e3930270cff93ddea313f22da4b0f1", "score": "0.5999527", "text": "darken(factor = 0.1) {\n this.addEffect(new _SpriteEffects__WEBPACK_IMPORTED_MODULE_0__[\"Darken\"](factor));\n }", "title": "" }, { "docid": "a0e3930270cff93ddea313f22da4b0f1", "score": "0.5999527", "text": "darken(factor = 0.1) {\n this.addEffect(new _SpriteEffects__WEBPACK_IMPORTED_MODULE_0__[\"Darken\"](factor));\n }", "title": "" }, { "docid": "1df5bd3d9d60aa914dbe8f0ae6dd9c92", "score": "0.5980133", "text": "function getHSLColor(glassContent, sweeperWidth){\n var maxValueGlass = sweeperWidth * sweeperWidth;\n var normalizedColor = glassContent / maxValueGlass;\n // invert Color\n var hue = 120 - (normalizedColor * 120);\n // if color turns green, scale lightness so that it fades to white\n if(hue > 100){\n var index = hue - 100;\n var lightness = 50 + (index * 3)\n return 'hsl(' + hue +', 100%, '+ lightness + '%)';\n } \n return 'hsl(' + hue +', 100%, '+ '50%)';\n }", "title": "" }, { "docid": "468e9d3a65729dc9c5215c23e79be98d", "score": "0.594888", "text": "calcHSL() {\n\t\tlet { r, g, b } = this;\n\t\t// Make r, g, and b fractions of 1\n\t\tr /= 255;\n\t\tg /= 255;\n\t\tb /= 255;\n\n\t\t// Find greatest and smallest channel values\n\t\tlet cmin = Math.min(r, g, b),\n\t\t\tcmax = Math.max(r, g, b),\n\t\t\tdelta = cmax - cmin,\n\t\t\th = 0,\n\t\t\ts = 0,\n\t\t\tl = 0;\n\t\t// Calculate hue\n\t\t// No difference\n\t\tif (delta == 0) h = 0;\n\t\telse if (cmax == r)\n\t\t\t// Red is max\n\t\t\th = ((g - b) / delta) % 6;\n\t\telse if (cmax == g)\n\t\t\t// Green is max\n\t\t\th = (b - r) / delta + 2;\n\t\telse\n\t\t\t// Blue is max\n\t\t\th = (r - g) / delta + 4;\n\n\t\th = Math.round(h * 60);\n\n\t\t// Make negative hues positive behind 360°\n\t\tif (h < 0) h += 360;\n\n\t\t// Calculate lightness\n\t\tl = (cmax + cmin) / 2;\n\n\t\t// Calculate saturation\n\t\ts = delta == 0 ? 0 : delta / (1 - Math.abs(2 * l - 1));\n\n\t\t// Multiply l and s by 100\n\t\ts = +(s * 100).toFixed(1);\n\t\tl = +(l * 100).toFixed(1);\n\t\tthis.h = h;\n\t\tthis.s = s;\n\t\tthis.l = l;\n\t}", "title": "" }, { "docid": "ec43d191e23d4fa6083639d37c00a409", "score": "0.59287256", "text": "function saturate(rgb, saturation) {\n if (rgb == null || saturation == 1) {\n return rgb;\n }\n var hsl = rgbToHsl(rgb);\n hsl.s = saturation;\n return hslToRgb(hsl);\n}", "title": "" }, { "docid": "bbc4024e80cae41a6e35260b2f53622b", "score": "0.5912786", "text": "hsl() {\n\t\tconst { h, s, l } = this;\n\t\treturn `hsl(${h}, ${s}%, ${l}%)`;\n }", "title": "" }, { "docid": "7846907a911ebeb451862d5e6ac98b4f", "score": "0.59061414", "text": "function saturation(data,val){\r\n if(val<=-1){\r\n val=-1;\r\n }\r\n for(let i=0;i<data.length;i+=4){\r\n let gray=0.2989*data[i]+0.1140*data[i+2]+0.5870*data[i+1];\r\n data[i]= -gray*val+data[i]*(1+val);\r\n data[i+1]= -gray*val+data[i+1]*(1+val);\r\n data[i+2]= -gray*val+data[i+2]*(1+val);\r\n }\r\n}", "title": "" }, { "docid": "9bd40d5729657f994ea1bbca9d4c82c1", "score": "0.5877863", "text": "function HSL(h,s,l) {\n\tthis.h=h;\n\tthis.s=s;\n\tthis.l=l;\n\tthis.v=\"hsl(\"+Math.round(h)+\",\"+Math.round(s*100)+\"%,\"+Math.round(l*100)+\"%)\";\n}", "title": "" }, { "docid": "0997a01d6d4821cbf7b1d9c16b6c63ff", "score": "0.5854247", "text": "function shader(e) {\n if(e.target.style.backgroundColor.match(/rgba/)){\n let currentColor = e.target.style.backgroundColor;\n let cut = currentColor.match(/\\.\\w/gm);\n if(cut===null) cut = 0\n let shadedColor = currentColor.replace(/\\.\\w/gm, cut[0]-.1)\n e.target.style.backgroundColor = shadedColor;\n }\n}", "title": "" }, { "docid": "00d0e8147ddc4754cfeace1e6e7e7a71", "score": "0.58202064", "text": "static hsl(h, s, l) {\n let r, g, b;\n\n function hue2rgb(p, q, t) {\n if (t < 0) t += 1;\n if (t > 1) t -= 1;\n if (t < 1 / 6) return p + (q - p) * 6 * t;\n if (t < 1 / 2) return q;\n if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;\n return p;\n }\n\n if (s === 0) {\n r = g = b = l;\n } else {\n let q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n let p = 2 * l - q;\n\n r = hue2rgb(p, q, h + 1 / 3);\n g = hue2rgb(p, q, h);\n b = hue2rgb(p, q, h - 1 / 3);\n }\n\n return Colour.rgb(Math.round(r * 255), Math.round(g * 255), Math.round(b * 255));\n }", "title": "" }, { "docid": "72a46aec273994aa1413030eed5080ba", "score": "0.581693", "text": "saturate(factor = 0.1) {\n this.addEffect(new Effects.Saturate(factor));\n }", "title": "" }, { "docid": "c3d60be98fd08fb69d1ed13d0f1145d9", "score": "0.5814051", "text": "function updateHsRange(h, l,s) {\r\n //update the values\r\n document.getElementById(\"rgb-Alpha\").value = Math.round(l)/100;\r\n document.getElementById(\"rgb-Saturation\").value = Math.round(s)/100;\r\n }", "title": "" }, { "docid": "471300a7b032191232ad945d3e9ec0c9", "score": "0.58138275", "text": "function favor_hue(r,g,b) {\r\n return (Math.abs(r-g)*Math.abs(r-g) + Math.abs(r-b)*Math.abs(r-b) + Math.abs(g-b)*Math.abs(g-b))/65535*50+1;\r\n }", "title": "" }, { "docid": "139b920c43cd80b870b944fa96ad0992", "score": "0.5806319", "text": "updateHsl() {\n var re = this.rgbToHsl(this.state.R);\n var gr = this.rgbToHsl(this.state.G);\n var bl = this.rgbToHsl(this.state.B);\n var al = this.rgbToHsl(this.state.A);\n var min = Math.min(re, bl, gr);\n var max = Math.max(re, bl, gr);;\n var Sa;\n var hue;\n\n var li = ((min + max) / 2);\n if (max === min) {\n Sa = 0;\n hue = 0;\n }\n else {\n if (li >= 0.5) {\n Sa = (max - min) / (2.0 - max - min);\n }\n else if (li < 0.5) {\n Sa = (max - min) / (max + min);\n }\n if (re == max) {\n hue = ((gr - bl) / (max - min)) * 60;\n }\n else if (gr == max) {\n hue = ((bl - re) / (max - min) + 2) * 60;\n }\n else if (bl == max) {\n hue = (((re - gr) / (max - min)) + 4) * 60;\n }\n\n if (hue < 0) {\n hue = hue + 360;\n }\n\n }\n\n this.setState({\n HUE: Math.round(hue),\n L: (li * 100).toFixed(1),\n S: (Sa * 100).toFixed(1),\n\n })\n\n\n }", "title": "" }, { "docid": "67d5b1de7e868da4c796a0ab58ebf06b", "score": "0.5799502", "text": "function desaturate(color, amount) {\n amount = amount === 0 ? 0 : amount || 10;\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n }", "title": "" }, { "docid": "3d3f26752bffc142f1d09392f2509ed6", "score": "0.5771297", "text": "colorize(color) {\n this.addEffect(new _SpriteEffects__WEBPACK_IMPORTED_MODULE_0__[\"Colorize\"](color));\n }", "title": "" }, { "docid": "3d3f26752bffc142f1d09392f2509ed6", "score": "0.5771297", "text": "colorize(color) {\n this.addEffect(new _SpriteEffects__WEBPACK_IMPORTED_MODULE_0__[\"Colorize\"](color));\n }", "title": "" }, { "docid": "05cd5a38bc13c8c5750df981c5efb868", "score": "0.5761657", "text": "function hsl(hue) {\n return function(start, end) {\n var h = hue((start = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_d3_color__[\"c\" /* hsl */])(start)).h, (end = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_d3_color__[\"c\" /* hsl */])(end)).h),\n s = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__color__[\"b\" /* default */])(start.s, end.s),\n l = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__color__[\"b\" /* default */])(start.l, end.l),\n opacity = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__color__[\"b\" /* default */])(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.s = s(t);\n start.l = l(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n}", "title": "" }, { "docid": "b7ed321a7ad0b26efc45d108232c45be", "score": "0.5731779", "text": "function hsla(hue, saturation, lightness, alpha) {\n let q, p, onethird, Tr, Tg, Tb;\n if (lightness < 0.5)\n q = lightness * (1.0 + saturation);\n else\n q = lightness + saturation - (lightness * saturation);\n p = 2.0 * lightness - q;\n onethird = 1.0/3.0;\n Tr = _wrappy(hue + onethird);\n Tg = hue;\n Tb = _wrappy(hue - onethird);\n\n return new Color(_hsl_Tc(Tr,p,q), _hsl_Tc(Tg,p,q), _hsl_Tc(Tb,p,q), alpha);\n}", "title": "" }, { "docid": "fce5c9c402c9410ce45ca144e0b78c2d", "score": "0.57317513", "text": "getFragmentShader()\n {\n return dedent\n `#version 300 es\n precision mediump float;\n uniform sampler2D ColorMap;\n in vec2 frgTexCoord;\n\n // conversion RGB en HSV\n vec3 rgb2hsv(vec3 c)\n {\n vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\n vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));\n vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));\n float d = q.x - min(q.w, q.y);\n float e = 1.0e-10;\n return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);\n }\n\n // conversion HSV en RGB\n vec3 hsv2rgb(vec3 c)\n {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n }\n\n uniform float strength;\n\n out vec4 glFragColor;\n\n void main()\n {\n vec4 color = texture(ColorMap, frgTexCoord);\n vec3 hsv = rgb2hsv(color.rgb);\n /// modification de la saturation (décommenter la ligne suivante)\n hsv.y = clamp(hsv.y * strength, 0.0, 1.0);\n /// sépia (décommenter la ligne suivante)\n //hsv.xy = vec2(0.1, 0.5);\n /// vignettage (décommenter les deux lignes suivantes)\n //float dist = distance(frgTexCoord, vec2(0.5, 0.5));\n //hsv.z *= 1.0 - smoothstep(0.2, 0.9, dist);\n glFragColor = vec4(hsv2rgb(hsv), color.a);\n }`;\n }", "title": "" }, { "docid": "e5454e558fc974a56ebd7626d359c8d1", "score": "0.57081234", "text": "function hsl2hsv(h, s, l) {\n s *= (l < 50 ? l : 100 - l) / 100;\n var v = l + s;\n return {\n h: h,\n s: v === 0 ? 0 : ((2 * s) / v) * 100,\n v: v\n };\n}", "title": "" }, { "docid": "2ebe51799cc07abdcdd1fd7922d65c55", "score": "0.5705888", "text": "function HSLColor(hue, saturation, lightness) {\n this.hue = hue;\n this.saturation = saturation;\n this.lightness = lightness;\n}", "title": "" }, { "docid": "a14be6993cf5c05764306c9ccddf24f7", "score": "0.5698944", "text": "desaturate(factor = 0.1) {\n this.addEffect(new _SpriteEffects__WEBPACK_IMPORTED_MODULE_0__[\"Desaturate\"](factor));\n }", "title": "" }, { "docid": "a14be6993cf5c05764306c9ccddf24f7", "score": "0.5698944", "text": "desaturate(factor = 0.1) {\n this.addEffect(new _SpriteEffects__WEBPACK_IMPORTED_MODULE_0__[\"Desaturate\"](factor));\n }", "title": "" }, { "docid": "a478b11ed4fdffe825d7766325f1f28b", "score": "0.5696279", "text": "function desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}", "title": "" }, { "docid": "a478b11ed4fdffe825d7766325f1f28b", "score": "0.5696279", "text": "function desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}", "title": "" }, { "docid": "a478b11ed4fdffe825d7766325f1f28b", "score": "0.5696279", "text": "function desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}", "title": "" }, { "docid": "a478b11ed4fdffe825d7766325f1f28b", "score": "0.5696279", "text": "function desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}", "title": "" }, { "docid": "a478b11ed4fdffe825d7766325f1f28b", "score": "0.5696279", "text": "function desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}", "title": "" }, { "docid": "a478b11ed4fdffe825d7766325f1f28b", "score": "0.5696279", "text": "function desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}", "title": "" }, { "docid": "a478b11ed4fdffe825d7766325f1f28b", "score": "0.5696279", "text": "function desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}", "title": "" }, { "docid": "a478b11ed4fdffe825d7766325f1f28b", "score": "0.5696279", "text": "function desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}", "title": "" }, { "docid": "a478b11ed4fdffe825d7766325f1f28b", "score": "0.5696279", "text": "function desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}", "title": "" }, { "docid": "a478b11ed4fdffe825d7766325f1f28b", "score": "0.5696279", "text": "function desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}", "title": "" }, { "docid": "a478b11ed4fdffe825d7766325f1f28b", "score": "0.5696279", "text": "function desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}", "title": "" }, { "docid": "a478b11ed4fdffe825d7766325f1f28b", "score": "0.5696279", "text": "function desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}", "title": "" }, { "docid": "a478b11ed4fdffe825d7766325f1f28b", "score": "0.5696279", "text": "function desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}", "title": "" }, { "docid": "a478b11ed4fdffe825d7766325f1f28b", "score": "0.5696279", "text": "function desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}", "title": "" }, { "docid": "a478b11ed4fdffe825d7766325f1f28b", "score": "0.5696279", "text": "function desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}", "title": "" }, { "docid": "a478b11ed4fdffe825d7766325f1f28b", "score": "0.5696279", "text": "function desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}", "title": "" }, { "docid": "a478b11ed4fdffe825d7766325f1f28b", "score": "0.5696279", "text": "function desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}", "title": "" }, { "docid": "a478b11ed4fdffe825d7766325f1f28b", "score": "0.5696279", "text": "function desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}", "title": "" }, { "docid": "a478b11ed4fdffe825d7766325f1f28b", "score": "0.5696279", "text": "function desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}", "title": "" }, { "docid": "a478b11ed4fdffe825d7766325f1f28b", "score": "0.5696279", "text": "function desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}", "title": "" }, { "docid": "a478b11ed4fdffe825d7766325f1f28b", "score": "0.5696279", "text": "function desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}", "title": "" }, { "docid": "a478b11ed4fdffe825d7766325f1f28b", "score": "0.5696279", "text": "function desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}", "title": "" }, { "docid": "a478b11ed4fdffe825d7766325f1f28b", "score": "0.5696279", "text": "function desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}", "title": "" }, { "docid": "a478b11ed4fdffe825d7766325f1f28b", "score": "0.5696279", "text": "function desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}", "title": "" }, { "docid": "a478b11ed4fdffe825d7766325f1f28b", "score": "0.5696279", "text": "function desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}", "title": "" }, { "docid": "a478b11ed4fdffe825d7766325f1f28b", "score": "0.5696279", "text": "function desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}", "title": "" }, { "docid": "a478b11ed4fdffe825d7766325f1f28b", "score": "0.5696279", "text": "function desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}", "title": "" }, { "docid": "a478b11ed4fdffe825d7766325f1f28b", "score": "0.5696279", "text": "function desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}", "title": "" }, { "docid": "a478b11ed4fdffe825d7766325f1f28b", "score": "0.5696279", "text": "function desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}", "title": "" }, { "docid": "a478b11ed4fdffe825d7766325f1f28b", "score": "0.5696279", "text": "function desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}", "title": "" }, { "docid": "a478b11ed4fdffe825d7766325f1f28b", "score": "0.5696279", "text": "function desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}", "title": "" }, { "docid": "a478b11ed4fdffe825d7766325f1f28b", "score": "0.5696279", "text": "function desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}", "title": "" }, { "docid": "a478b11ed4fdffe825d7766325f1f28b", "score": "0.5696279", "text": "function desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}", "title": "" }, { "docid": "a478b11ed4fdffe825d7766325f1f28b", "score": "0.5696279", "text": "function desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}", "title": "" }, { "docid": "a478b11ed4fdffe825d7766325f1f28b", "score": "0.5696279", "text": "function desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}", "title": "" }, { "docid": "a478b11ed4fdffe825d7766325f1f28b", "score": "0.5696279", "text": "function desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}", "title": "" }, { "docid": "a478b11ed4fdffe825d7766325f1f28b", "score": "0.5696279", "text": "function desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}", "title": "" }, { "docid": "a478b11ed4fdffe825d7766325f1f28b", "score": "0.5696279", "text": "function desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}", "title": "" }, { "docid": "a478b11ed4fdffe825d7766325f1f28b", "score": "0.5696279", "text": "function desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}", "title": "" }, { "docid": "a478b11ed4fdffe825d7766325f1f28b", "score": "0.5696279", "text": "function desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}", "title": "" }, { "docid": "a478b11ed4fdffe825d7766325f1f28b", "score": "0.5696279", "text": "function desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}", "title": "" }, { "docid": "a478b11ed4fdffe825d7766325f1f28b", "score": "0.5696279", "text": "function desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}", "title": "" }, { "docid": "6833565bfff0298bb84baee9e5e1c603", "score": "0.5695817", "text": "artisticToScientificSmooth(hue) {\n return (\n hue < 60 ? hue * (35 / 60):\n hue < 122 ? this.mapRange(hue, 60, 122, 35, 60):\n hue < 165 ? this.mapRange(hue, 122, 165, 60, 120):\n hue < 218 ? this.mapRange(hue, 165, 218, 120, 180):\n hue < 275 ? this.mapRange(hue, 218, 275, 180, 240):\n hue < 330 ? this.mapRange(hue, 275, 330, 240, 300):\n this.mapRange(hue, 330, 360, 300, 360));\n }", "title": "" }, { "docid": "82f65b64a6cdadcd889dc59dab0ae262", "score": "0.5693658", "text": "function makeSprite() {\n var shaded = [\n // 0 +10 -10 -20\n ['#c1c1c1', '#dddddd', '#a6a6a6', '#8b8b8b'],\n ['#25bb9b', '#4cd7b6', '#009f81', '#008568'],\n ['#3397d9', '#57b1f6', '#007dbd', '#0064a2'],\n ['#e67e23', '#ff993f', '#c86400', '#a94b00'],\n ['#efc30f', '#ffdf3a', '#d1a800', '#b38e00'],\n ['#9ccd38', '#b9e955', '#81b214', '#659700'],\n ['#9c5ab8', '#b873d4', '#81409d', '#672782'],\n ['#e64b3c', '#ff6853', '#c62c25', '#a70010'],\n ['#898989', '#a3a3a3', '#6f6f6f', '#575757'],\n ];\n var glossy = [\n //25 37 52 -21 -45\n ['#ffffff', '#ffffff', '#ffffff', '#888888', '#4d4d4d'],\n ['#7bffdf', '#9fffff', '#ccffff', '#008165', '#00442e'],\n ['#6cdcff', '#93feff', '#c2ffff', '#00629f', '#002c60'],\n ['#ffc166', '#ffe386', '#ffffb0', '#aa4800', '#650500'],\n ['#ffff6a', '#ffff8c', '#ffffb8', '#b68a00', '#714f00'],\n ['#efff81', '#ffffa2', '#ffffcd', '#6b9200', '#2c5600'],\n ['#dc9dfe', '#ffbeff', '#ffe9ff', '#5d287e', '#210043'],\n ['#ff9277', '#ffb497', '#ffe0bf', '#a7000a', '#600000'],\n ['#cbcbcb', '#ededed', '#ffffff', '#545454', '#1f1f1f'],\n ];\n var tgm = [\n ['#7b7b7b', '#303030', '#6b6b6b', '#363636'],\n ['#f08000', '#a00000', '#e86008', '#b00000'],\n ['#00a8f8', '#0000b0', '#0090e8', '#0020c0'],\n ['#f8a800', '#b84000', '#e89800', '#c85800'],\n ['#e8e000', '#886800', '#d8c800', '#907800'],\n ['#f828f8', '#780078', '#e020e0', '#880088'],\n ['#00e8f0', '#0070a0', '#00d0e0', '#0080a8'],\n ['#78f800', '#007800', '#58e000', '#008800'],\n ['#7b7b7b', '#303030', '#6b6b6b', '#363636'],\n ];\n var world = [];\n world[0] = tgm[0];\n world[1] = tgm[6];\n world[2] = tgm[2];\n world[3] = tgm[3];\n world[4] = tgm[4];\n world[5] = tgm[7];\n world[6] = tgm[5];\n world[7] = tgm[1];\n world[8] = tgm[8];\n\n spriteCanvas.width = cellSize * 9;\n spriteCanvas.height = cellSize;\n for (var i = 0; i < 9; i++) {\n var x = i * cellSize;\n if (settings.Block === 0) {\n // Shaded\n spriteCtx.fillStyle = shaded[i][1];\n spriteCtx.fillRect(x, 0, cellSize, cellSize);\n\n spriteCtx.fillStyle = shaded[i][3];\n spriteCtx.fillRect(x, cellSize / 2, cellSize, cellSize / 2);\n\n spriteCtx.fillStyle = shaded[i][0];\n spriteCtx.beginPath();\n spriteCtx.moveTo(x, 0);\n spriteCtx.lineTo(x + cellSize / 2, cellSize / 2);\n spriteCtx.lineTo(x, cellSize);\n spriteCtx.fill();\n\n spriteCtx.fillStyle = shaded[i][2];\n spriteCtx.beginPath();\n spriteCtx.moveTo(x + cellSize, 0);\n spriteCtx.lineTo(x + cellSize / 2, cellSize / 2);\n spriteCtx.lineTo(x + cellSize, cellSize);\n spriteCtx.fill();\n } else if (settings.Block === 1) {\n // Flat\n spriteCtx.fillStyle = shaded[i][0];\n spriteCtx.fillRect(x, 0, cellSize, cellSize);\n } else if (settings.Block === 2) {\n // Glossy\n var k = Math.max(~~(cellSize * 0.083), 1);\n\n var grad = spriteCtx.createLinearGradient(x, 0, x + cellSize, cellSize);\n grad.addColorStop(0.5, glossy[i][3]);\n grad.addColorStop(1, glossy[i][4]);\n spriteCtx.fillStyle = grad;\n spriteCtx.fillRect(x, 0, cellSize, cellSize);\n\n var grad = spriteCtx.createLinearGradient(x, 0, x + cellSize, cellSize);\n grad.addColorStop(0, glossy[i][2]);\n grad.addColorStop(0.5, glossy[i][1]);\n spriteCtx.fillStyle = grad;\n spriteCtx.fillRect(x, 0, cellSize - k, cellSize - k);\n\n var grad = spriteCtx.createLinearGradient(\n x + k,\n k,\n x + cellSize - k,\n cellSize - k,\n );\n grad.addColorStop(0, shaded[i][0]);\n grad.addColorStop(0.5, glossy[i][0]);\n grad.addColorStop(0.5, shaded[i][0]);\n grad.addColorStop(1, glossy[i][0]);\n spriteCtx.fillStyle = grad;\n spriteCtx.fillRect(x + k, k, cellSize - k * 2, cellSize - k * 2);\n } else if (settings.Block === 3 || settings.Block === 4) {\n // Arika\n if (settings.Block === 4) tgm = world;\n var k = Math.max(~~(cellSize * 0.125), 1);\n\n spriteCtx.fillStyle = tgm[i][1];\n spriteCtx.fillRect(x, 0, cellSize, cellSize);\n spriteCtx.fillStyle = tgm[i][0];\n spriteCtx.fillRect(x, 0, cellSize, ~~(cellSize / 2));\n\n var grad = spriteCtx.createLinearGradient(x, k, x, cellSize - k);\n grad.addColorStop(0, tgm[i][2]);\n grad.addColorStop(1, tgm[i][3]);\n spriteCtx.fillStyle = grad;\n spriteCtx.fillRect(x + k, k, cellSize - k * 2, cellSize - k * 2);\n\n var grad = spriteCtx.createLinearGradient(x, k, x, cellSize);\n grad.addColorStop(0, tgm[i][0]);\n grad.addColorStop(1, tgm[i][3]);\n spriteCtx.fillStyle = grad;\n spriteCtx.fillRect(x, k, k, cellSize - k);\n\n var grad = spriteCtx.createLinearGradient(x, 0, x, cellSize - k);\n grad.addColorStop(0, tgm[i][2]);\n grad.addColorStop(1, tgm[i][1]);\n spriteCtx.fillStyle = grad;\n spriteCtx.fillRect(x + cellSize - k, 0, k, cellSize - k);\n }\n }\n}", "title": "" }, { "docid": "23a039d01f2b0f652bb4c8132c16f049", "score": "0.5691438", "text": "function desaturate(color, amount) {\n\t amount = (amount === 0) ? 0 : (amount || 10);\n\t var hsl = tinycolor(color).toHsl();\n\t hsl.s -= amount / 100;\n\t hsl.s = clamp01(hsl.s);\n\t return tinycolor(hsl);\n\t}", "title": "" }, { "docid": "23a039d01f2b0f652bb4c8132c16f049", "score": "0.5691438", "text": "function desaturate(color, amount) {\n\t amount = (amount === 0) ? 0 : (amount || 10);\n\t var hsl = tinycolor(color).toHsl();\n\t hsl.s -= amount / 100;\n\t hsl.s = clamp01(hsl.s);\n\t return tinycolor(hsl);\n\t}", "title": "" }, { "docid": "23a039d01f2b0f652bb4c8132c16f049", "score": "0.5691438", "text": "function desaturate(color, amount) {\n\t amount = (amount === 0) ? 0 : (amount || 10);\n\t var hsl = tinycolor(color).toHsl();\n\t hsl.s -= amount / 100;\n\t hsl.s = clamp01(hsl.s);\n\t return tinycolor(hsl);\n\t}", "title": "" }, { "docid": "6ab52ce87709e6a65ddb0d4a52042285", "score": "0.5688651", "text": "function hsla(hue, saturation, lightness, opacity) {\n return new ColorHelper(HSL, modDegrees(hue), Object(__WEBPACK_IMPORTED_MODULE_0__utils__[\"c\" /* ensurePercent */])(saturation), Object(__WEBPACK_IMPORTED_MODULE_0__utils__[\"c\" /* ensurePercent */])(lightness), Object(__WEBPACK_IMPORTED_MODULE_0__utils__[\"c\" /* ensurePercent */])(opacity), true);\n}", "title": "" }, { "docid": "6a61b4b8e9ec6de9acfa69c73ddaa4f1", "score": "0.56869715", "text": "function hsla(hue, saturation, lightness, opacity) {\n return new ColorHelper(HSL, modDegrees(hue), formatting_1.ensurePercent(saturation), formatting_1.ensurePercent(lightness), formatting_1.ensurePercent(opacity), true);\n}", "title": "" }, { "docid": "f5d0e5549643c6a76faa662a6e8ec5fb", "score": "0.56776154", "text": "saturation(value) {\n this._shared.var_lips_saturation_brightness.x(value);\n }", "title": "" }, { "docid": "b641edcc1da60343fca9220555982be1", "score": "0.566731", "text": "function desaturate(color, amount) {\n amount = amount === 0 ? 0 : amount || 10;\n var hsl = colorsinspo(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return colorsinspo(hsl);\n }", "title": "" }, { "docid": "29189b0be8ee898bcc942c1061b7d342", "score": "0.5666447", "text": "function desaturate(color, amount) {\n amount = amount === 0 ? 0 : amount || 10;\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n }", "title": "" }, { "docid": "980c45fd3f82dd9c6629ac6cde61b8d0", "score": "0.5650952", "text": "function desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n }", "title": "" }, { "docid": "980c45fd3f82dd9c6629ac6cde61b8d0", "score": "0.5650952", "text": "function desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n }", "title": "" }, { "docid": "980c45fd3f82dd9c6629ac6cde61b8d0", "score": "0.5650952", "text": "function desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n }", "title": "" }, { "docid": "980c45fd3f82dd9c6629ac6cde61b8d0", "score": "0.5650952", "text": "function desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n }", "title": "" }, { "docid": "2721b548c00056e1b4200ec73e2b3ced", "score": "0.5648334", "text": "function hsl(hue) {\n return function(start, end) {\n var h = hue((start = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_d3_color__[\"d\" /* hsl */])(start)).h, (end = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_d3_color__[\"d\" /* hsl */])(end)).h),\n s = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__color__[\"a\" /* default */])(start.s, end.s),\n l = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__color__[\"a\" /* default */])(start.l, end.l),\n opacity = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__color__[\"a\" /* default */])(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.s = s(t);\n start.l = l(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n}", "title": "" }, { "docid": "0a5852cf8f8a77335d82eb95758f46fb", "score": "0.5647217", "text": "function desaturate(color, amount) {\n amount = amount === 0 ? 0 : amount || 10;\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n }", "title": "" }, { "docid": "d667e601155f2342d96a83bf03e8f29f", "score": "0.56426746", "text": "function desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n }", "title": "" }, { "docid": "c9a564f7d1f66961ebe5aece1cbba772", "score": "0.5641822", "text": "setColor() { \n if (this.domElem !== null) {\n this.domElem.style.backgroundColor = \n \"hsl(\" + this.hue + \", 100%, 50%\";\n }\n }", "title": "" } ]
c7befd6fadb88a9bf6f10dece18a2eb8
BigO (3 + 4n) =>> (n)
[ { "docid": "b7bb907f23a87d4f09eeca738bf22bfa", "score": "0.6204027", "text": "function anotherFunChallenge(input) {\n let a = 5; // O(1)\n let b = 10; // O(1)\n let c = 50; // O(1)\n for (let i = 0; i < input; i++) { // O(n)\n let x = i + 2; // O(n)\n let y = i + 3; // O(n)\n let z = i + 1; // O(n)\n }\n\n for (let j = 0; j < input; j++) { // O(n)\n let p = j * 2; // O(n)\n let q = j * 3; // O(n)\n }\n\n let whoAmI = 'I do not know'; // O(1)\n}", "title": "" } ]
[ { "docid": "bd410f16cc549b471207c74b26abf3c9", "score": "0.7270963", "text": "function n$4O(n){return n}", "title": "" }, { "docid": "cc24423315e1885ae5091983f626afff", "score": "0.6905368", "text": "function solution(n) {\n\n}", "title": "" }, { "docid": "e36e331f57cb22659d60045aae12978c", "score": "0.673998", "text": "function anotherFunChallenge(input) {\n let a = 5;//O(1)\n let b = 10;//O(1)\n let c = 50;//O(1)\n for (let i = 0; i < input; i++) {//O(n)\n let x = i + 1;//O(n)\n let y = i + 2;//O(n)\n let z = i + 3;//O(n)\n\n }\n for (let j = 0; j < input; j++) {//O(n)\n let p = j * 2;//O(n)\n let q = j * 2;//O(n)\n }\n let whoAmI = \"I don't know\";//O(1)\n}//BigO O(n) or O(4 + 7n)", "title": "" }, { "docid": "3c89c7a4b13a1775b998467fb3e73a52", "score": "0.6653507", "text": "function slowFun(n) {\n let x = 2;\n let y = 3;\n let z = 0;\n\n for (let i = 0; i < n; i++) {\n for (let j = 0; j < n; j++) {\n z = x * y;\n }\n }\n return z + n;\n}", "title": "" }, { "docid": "3454df37ba05a0564b0d01bcd5da2bcb", "score": "0.6648388", "text": "function getN2(n) {\n let cache = [0, 1];\n\n let fn = function (n) {\n if (n < 0) {\n return -1;\n }\n if (n < cache.length) {\n return cache[n];\n }\n for (let i = cache.length; i <= n; i++) {\n cache[i] = cache[i - 1] + cache[i - 2];\n }\n return cache[n];\n };\n\n return fn(n);\n}", "title": "" }, { "docid": "8caeee262ecd5b77bb09996b17dfd250", "score": "0.6639818", "text": "function n(n,f,i){var u;const c=n.byteLength/(4*f),s=new Uint32Array(n,0,c*f);let a=new Uint32Array(c);const h=null!=(u=null==i?void 0:i.minReduction)?u:0,d=(null==i?void 0:i.originalIndices)||null,g=d?d.length:0,y=(null==i?void 0:i.componentOffsets)||null;let U=0;if(y)for(let t=0;t<y.length-1;t++){const n=y[t+1]-y[t];n>U&&(U=n)}else U=c;const w=Math.floor(1.1*U)+1;(null==o||o.length<2*w)&&(o=new Uint32Array((0,_core_mathUtils_js__WEBPACK_IMPORTED_MODULE_0__.nextHighestPowerOfTwo)(2*w)));for(let t=0;t<2*w;t++)o[t]=0;let A=0;const m=!!y&&!!d,b=m?g:c,p=m?new Uint32Array(g):null,v=1.96;let M=0!==h?Math.ceil(4*v*v/(h*h)*h*(1-h)):b,q=1,x=y?y[1]:b;for(let t=0;t<b;t++){if(t===M){const n=1-A/t;if(n+v*Math.sqrt(n*(1-n)/t)<h)return null;M*=2}if(t===x){for(let t=0;t<2*w;t++)o[t]=0;if(d)for(let t=y[q-1];t<y[q];t++)p[t]=a[d[t]];x=y[++q]}const n=m?d[t]:t,l=n*f,i=r(s,l,f);let u=i%w,c=A;for(;0!==o[2*u+1];){if(o[2*u]===i){const t=o[2*u+1]-1;if(e(s,l,t*f,f)){c=a[t];break}}u++,u>=w&&(u-=w)}c===A&&(o[2*u]=i,o[2*u+1]=n+1,A++),a[n]=c}if(0!==h&&1-A/c<h)return null;if(m){for(let t=y[q-1];t<p.length;t++)p[t]=a[d[t]];a=p}const j=new Uint32Array(f*A);A=0;for(let t=0;t<b;t++)if(a[t]===A){l(s,(m?d[t]:t)*f,j,A*f,f),A++}if(d&&!m){const t=new Uint32Array(g);for(let n=0;n<t.length;n++)t[n]=a[d[n]];a=t}return{buffer:j.buffer,indices:a,uniqueCount:A}}", "title": "" }, { "docid": "ab78aebdb0d91781d878838ef60b9e2e", "score": "0.66306794", "text": "function n$4z(n){const r=s$4f(100*(1-n));return Math.max(0,Math.min(r,100))}", "title": "" }, { "docid": "4fd87fcd9794f923628be15b72c0c796", "score": "0.6617126", "text": "function O(t,e,n,r,i){var o,s,a,u,c=1,l=t.precision,p=Math.ceil(l/Rt);for(_t=!1,u=n.times(n),a=new t(r);;){if(s=Ft(a.times(u),new t(e++*e++),l,1),a=i?r.plus(s):r.minus(s),r=Ft(s.times(u),new t(e++*e++),l,1),s=a.plus(r),void 0!==s.d[p]){for(o=p;s.d[o]===a.d[o]&&o--;);if(-1==o)break}o=a,a=r,r=s,s=o,c++}return _t=!0,s.d.length=p+1,s}", "title": "" }, { "docid": "37cb200202277a9dca0f9c1fcba16883", "score": "0.65842193", "text": "function funChallenge(input) {\n let a = 10;//O(1)\n a = 50 + 3;//O(1)\n\n for (let i = 0; i < input.length; i++) { //O(n)\n anotherFunction();//O(n)\n let stranger = true;//O(n)\n a++;//O(n)\n }\n return a;//O(1)\n} //O(n) Linear Time Real Answer is O(3 + 4n)", "title": "" }, { "docid": "57b14872f372cd4bfa668c513ba16e98", "score": "0.6568989", "text": "function solution(N) {\n // write your code in JavaScript (Node.js 8.9.4)\n var result = 0;\n var counter = 0;\n var isStarted = false;\n while (N != 0) {\n var bit = N % 2;\n N = N >> 1;\n if (bit) {\n if (isStarted) {\n if (result < counter) {\n result = counter;\n }\n counter = 0;\n } else {\n isStarted = true;\n }\n } else if (isStarted) {\n counter++;\n }\n }\n return result;\n}", "title": "" }, { "docid": "21ed33fe08cbc15b81c52e44caba52b9", "score": "0.6554324", "text": "function foo4(x, n) {\n return x[n] + x[n + 1] + x[n + 2];\n}", "title": "" }, { "docid": "fcdb30e66ad3777349823deb0ac2e224", "score": "0.65497947", "text": "function problem2() {\n let res = 0;\n let arr = [0,1];\n let n=2;\n let accumulator = 0\n while (res <= 40000000) {\n res = arr[n-2] + arr[n-1];\n arr.push(res);\n n++;\n if (res%2 === 0 ){\n accumulator += res;\n }\n }\nreturn accumulator; // arr.filter(n => n % 2 === 0).reduce((accumulator, currentValue) => accumulator + currentValue);\n}", "title": "" }, { "docid": "f70e9512f7b2c4a3bcd60b08e8f949f8", "score": "0.6521287", "text": "function anotherFunChallenge(input) {\n let a = 5; //O(1)\n let b = 10; //O(1)\n let c = 50; //O(1)\n for (let i = 0; i < input; i++) { //O(n)\n let x = i + 1; //O(n)\n let y = i + 2; //O(n)\n let z = i + 3; //O(n)\n \n }\n for (let j = 0; j < input; j++) { //O(n)\n let p = j * 2; //O(n)\n let q = j * 2; //O(n)\n }\n let whoAmI = \"I don't know\"; //O(1)\n }", "title": "" }, { "docid": "7aab0f97e7bdf944c43041d517f5ba65", "score": "0.6519339", "text": "function anotherFunChallenge(input) {\n let a = 5;// O(1)\n let b = 10;// O(1)\n let c = 50;// O(1)\n for (let i = 0; i < input; i++) {//O(n)\n let x = i + 1;//O(n)\n let y = i + 2;//O(n)\n let z = i + 3;//O(n)\n \n }\n for (let j = 0; j < input; j++) {//O(n)\n let p = j * 2;//O(n)\n let q = j * 2;//O(n)\n }\n let whoAmI = \"I don't know\";//O(1)\n }", "title": "" }, { "docid": "e4ae3b5246da8935f04a777574fccd36", "score": "0.6459849", "text": "function t$a(t,o,n){const r=o/3,c=new Uint32Array(n+1),e=new Uint32Array(n+1),s=(t,o)=>{t<o?c[t+1]++:e[o+1]++;};for(let x=0;x<r;x++){const o=t[3*x],n=t[3*x+1],r=t[3*x+2];s(o,n),s(n,r),s(r,o);}let f=0,l=0;for(let x=0;x<n;x++){const t=c[x+1],o=e[x+1];c[x+1]=f,e[x+1]=l,f+=t,l+=o;}const i=new Uint32Array(6*r),a=c[n],w=(t,o,n)=>{if(t<o){const r=c[t+1]++;i[2*r]=o,i[2*r+1]=n;}else {const r=e[o+1]++;i[2*a+2*r]=t,i[2*a+2*r+1]=n;}};for(let x=0;x<r;x++){const o=t[3*x],n=t[3*x+1],r=t[3*x+2];w(o,n,x),w(n,r,x),w(r,o,x);}const y=(t,o)=>{const n=2*t,r=o-t;for(let c=1;c<r;c++){const t=i[n+2*c],o=i[n+2*c+1];let r=c-1;for(;r>=0&&i[n+2*r]>t;r--)i[n+2*r+2]=i[n+2*r],i[n+2*r+3]=i[n+2*r+1];i[n+2*r+2]=t,i[n+2*r+3]=o;}};for(let x=0;x<n;x++)y(c[x],c[x+1]),y(a+e[x],a+e[x+1]);const A=new Int32Array(3*r),U=(o,n)=>o===t[3*n]?0:o===t[3*n+1]?1:o===t[3*n+2]?2:-1,u=(t,o)=>{const n=U(t,o);A[3*o+n]=-1;},p=(t,o,n,r)=>{const c=U(t,o);A[3*o+c]=r;const e=U(n,r);A[3*r+e]=o;};for(let x=0;x<n;x++){let t=c[x];const o=c[x+1];let n=e[x];const r=e[x+1];for(;t<o&&n<r;){const o=i[2*t],r=i[2*a+2*n];o===r?(p(x,i[2*t+1],r,i[2*a+2*n+1]),t++,n++):o<r?(u(x,i[2*t+1]),t++):(u(r,i[2*a+2*n+1]),n++);}for(;t<o;)u(x,i[2*t+1]),t++;for(;n<r;){u(i[2*a+2*n],i[2*a+2*n+1]),n++;}}return A}", "title": "" }, { "docid": "80ea1c4acd35294ec42b1582b2095e49", "score": "0.6453554", "text": "function n(n,f,i){var u;const c=n.byteLength/(4*f),s=new Uint32Array(n,0,c*f);let a$1=new Uint32Array(c);const h=null!=(u=null==i?void 0:i.minReduction)?u:0,d=(null==i?void 0:i.originalIndices)||null,g=d?d.length:0,y=(null==i?void 0:i.componentOffsets)||null;let U=0;if(y)for(let t=0;t<y.length-1;t++){const n=y[t+1]-y[t];n>U&&(U=n);}else U=c;const w=Math.floor(1.1*U)+1;(null==o||o.length<2*w)&&(o=new Uint32Array(a(2*w)));for(let t=0;t<2*w;t++)o[t]=0;let A=0;const m=!!y&&!!d,b=m?g:c,v=m?new Uint32Array(g):null,p=1.96;let M=0!==h?Math.ceil(4*p*p/(h*h)*h*(1-h)):b,q=1,j=y?y[1]:b;for(let t=0;t<b;t++){if(t===M){const n=1-A/t;if(n+p*Math.sqrt(n*(1-n)/t)<h)return null;M*=2;}if(t===j){for(let t=0;t<2*w;t++)o[t]=0;if(d)for(let t=y[q-1];t<y[q];t++)v[t]=a$1[d[t]];j=y[++q];}const n=m?d[t]:t,l=n*f,i=r(s,l,f);let u=i%w,c=A;for(;0!==o[2*u+1];){if(o[2*u]===i){const t=o[2*u+1]-1;if(e(s,l,t*f,f)){c=a$1[t];break}}u++,u>=w&&(u-=w);}c===A&&(o[2*u]=i,o[2*u+1]=n+1,A++),a$1[n]=c;}if(0!==h&&1-A/c<h)return null;if(m){for(let t=y[q-1];t<v.length;t++)v[t]=a$1[d[t]];a$1=v;}const k=new Uint32Array(f*A);A=0;for(let t=0;t<b;t++)if(a$1[t]===A){l(s,(m?d[t]:t)*f,k,A*f,f),A++;}if(d&&!m){const t=new Uint32Array(g);for(let n=0;n<t.length;n++)t[n]=a$1[d[n]];a$1=t;}return {buffer:k.buffer,indices:a$1,uniqueCount:A}}", "title": "" }, { "docid": "55e611d76b80bde717e7ef9790142836", "score": "0.6416597", "text": "function getNthFib4(n) {\n let lastTwo = [0, 1];\n let counter = 2;\n while (counter < n) {\n let nextFib = lastTwo[0] + lastTwo[1];\n lastTwo[1] = nextFib;\n lastTwo[0] = lastTwo[1];\n counter++;\n }\n return n > 1 ? lastTwo[1] : lastTwo[0];\n}", "title": "" }, { "docid": "5347c7ad96c4e6a4b9810541c20cd4e0", "score": "0.64020944", "text": "function t(t,o,n){const r=o/3,c=new Uint32Array(n+1),e=new Uint32Array(n+1),s=(t,o)=>{t<o?c[t+1]++:e[o+1]++;};for(let x=0;x<r;x++){const o=t[3*x],n=t[3*x+1],r=t[3*x+2];s(o,n),s(n,r),s(r,o);}let f=0,l=0;for(let x=0;x<n;x++){const t=c[x+1],o=e[x+1];c[x+1]=f,e[x+1]=l,f+=t,l+=o;}const i=new Uint32Array(6*r),a=c[n],w=(t,o,n)=>{if(t<o){const r=c[t+1]++;i[2*r]=o,i[2*r+1]=n;}else {const r=e[o+1]++;i[2*a+2*r]=t,i[2*a+2*r+1]=n;}};for(let x=0;x<r;x++){const o=t[3*x],n=t[3*x+1],r=t[3*x+2];w(o,n,x),w(n,r,x),w(r,o,x);}const y=(t,o)=>{const n=2*t,r=o-t;for(let c=1;c<r;c++){const t=i[n+2*c],o=i[n+2*c+1];let r=c-1;for(;r>=0&&i[n+2*r]>t;r--)i[n+2*r+2]=i[n+2*r],i[n+2*r+3]=i[n+2*r+1];i[n+2*r+2]=t,i[n+2*r+3]=o;}};for(let x=0;x<n;x++)y(c[x],c[x+1]),y(a+e[x],a+e[x+1]);const A=new Int32Array(3*r),U=(o,n)=>o===t[3*n]?0:o===t[3*n+1]?1:o===t[3*n+2]?2:-1,u=(t,o)=>{const n=U(t,o);A[3*o+n]=-1;},p=(t,o,n,r)=>{const c=U(t,o);A[3*o+c]=r;const e=U(n,r);A[3*r+e]=o;};for(let x=0;x<n;x++){let t=c[x];const o=c[x+1];let n=e[x];const r=e[x+1];for(;t<o&&n<r;){const o=i[2*t],r=i[2*a+2*n];o===r?(p(x,i[2*t+1],r,i[2*a+2*n+1]),t++,n++):o<r?(u(x,i[2*t+1]),t++):(u(r,i[2*a+2*n+1]),n++);}for(;t<o;)u(x,i[2*t+1]),t++;for(;n<r;){u(i[2*a+2*n],i[2*a+2*n+1]),n++;}}return A}", "title": "" }, { "docid": "f9fa59388ae1f0fd66cc989009e39d3d", "score": "0.63939327", "text": "function getResult (n) {\n var dp = [];\n dp[1] = 1;\n dp[2] = 2;\n var i = 3;\n while(i <= n) {\n dp[i] = dp[i - 1] + dp[i - 2] + 2;\n i++;\n }\n return dp[n];\n}", "title": "" }, { "docid": "ea8e4ba23e3cea0fac77e006b2447095", "score": "0.6382723", "text": "function n$1(n,f,i){var u;const c=n.byteLength/(4*f),s=new Uint32Array(n,0,c*f);let a=new Uint32Array(c);const h=null!=(u=null==i?void 0:i.minReduction)?u:0,d=(null==i?void 0:i.originalIndices)||null,g=d?d.length:0,y=(null==i?void 0:i.componentOffsets)||null;let U=0;if(y)for(let t=0;t<y.length-1;t++){const n=y[t+1]-y[t];n>U&&(U=n);}else U=c;const w=Math.floor(1.1*U)+1;(null==o$1||o$1.length<2*w)&&(o$1=new Uint32Array(u$3(2*w)));for(let t=0;t<2*w;t++)o$1[t]=0;let A=0;const m=!!y&&!!d,b=m?g:c,p=m?new Uint32Array(g):null,v=1.96;let M=0!==h?Math.ceil(4*v*v/(h*h)*h*(1-h)):b,q=1,x=y?y[1]:b;for(let t=0;t<b;t++){if(t===M){const n=1-A/t;if(n+v*Math.sqrt(n*(1-n)/t)<h)return null;M*=2;}if(t===x){for(let t=0;t<2*w;t++)o$1[t]=0;if(d)for(let t=y[q-1];t<y[q];t++)p[t]=a[d[t]];x=y[++q];}const n=m?d[t]:t,l=n*f,i=r$1(s,l,f);let u=i%w,c=A;for(;0!==o$1[2*u+1];){if(o$1[2*u]===i){const t=o$1[2*u+1]-1;if(e$2(s,l,t*f,f)){c=a[t];break}}u++,u>=w&&(u-=w);}c===A&&(o$1[2*u]=i,o$1[2*u+1]=n+1,A++),a[n]=c;}if(0!==h&&1-A/c<h)return null;if(m){for(let t=y[q-1];t<p.length;t++)p[t]=a[d[t]];a=p;}const j=new Uint32Array(f*A);A=0;for(let t=0;t<b;t++)if(a[t]===A){l$2(s,(m?d[t]:t)*f,j,A*f,f),A++;}if(d&&!m){const t=new Uint32Array(g);for(let n=0;n<t.length;n++)t[n]=a[d[n]];a=t;}return {buffer:j.buffer,indices:a,uniqueCount:A}}", "title": "" }, { "docid": "60357f6aea10495ec6e8a259222778e8", "score": "0.63681686", "text": "function countZeroToN(n) {\n if (n == 0) { return 0; }\n if (n == 1) { return 1; }\n\n var res = 0;\n var order = Math.ceil(Math.log(n) / Math.log(2)); // 30\n for (var i = order; i >= 0; i--) {\n var bit = 1 << i;\n // process.stdout.write('-- ' +i + ' ' + n + ' ' + bit + ' ' + (n & bit) + '\\n');\n if ((n & bit) != 0) {\n res = countToOrder(i) + (n - bit + 1) + countZeroToN(n - bit);\n break;\n }\n }\n\n return res;\n}", "title": "" }, { "docid": "94136fe7ebc8b760b0daa1c1413d024e", "score": "0.636731", "text": "function deljivSaTri(n, m){\n let brDelj = 0;\n for(let i = n; i <= m; i++){\n if(i % 3 == 0){\n brDelj += 1;\n }\n }\n return brDelj;\n}", "title": "" }, { "docid": "16d288c2610f923c4c9e947def761181", "score": "0.63134915", "text": "function b$N(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}", "title": "" }, { "docid": "2645380995f2e542ce0e6bb24e2343c1", "score": "0.6301067", "text": "function spaceComplexityDemo(n) {\n return Array(n)\n .fill()\n .map((_, i) => i);\n}", "title": "" }, { "docid": "7e95c48a6875176548b1637dba90ca37", "score": "0.62756157", "text": "function anotherFunChallenge(input) {\n let a = 5; // O(1)\n let b = 10; // O(1)\n let c = 50; // O(1)\n for (let i = 0; i < input; i++) { // O(n)\n let x = i + 1; // O(n)\n let y = i + 2; // O(n)\n let z = i + 3; // O(n)\n }\n for (let j = 0; j < input; j++) { // O(n)\n let p = j * 2; // O(n)\n let q = j * 2; // O(n)\n }\n let whoAmI = \"I don't know\"; // O(1)\n }", "title": "" }, { "docid": "adb850452c15de88d369353c5a6544bb", "score": "0.62724745", "text": "function fiboncciaIterative(n) {\n let arr = [0, 1]\n for(let i = 2; i < n; i++) {\n arr.push(arr[i-2] + arr[i-1])\n }\n return arr[n];\n} // O(n)", "title": "" }, { "docid": "67b6b28fbdd5bba6a70e61b9739746c1", "score": "0.6260416", "text": "function d(n) {\n var sum = 1;\n for (let i = 2; i <= Math.sqrt(n); i++) {\n if (n % i === 0) {\n sum += (i + n / i);\n }\n }\n return sum;\n }", "title": "" }, { "docid": "0a5ff05c7b0ef79f08a821008db8ff49", "score": "0.62558323", "text": "function logMultiples(n) {\n\tfor (var num1 = 1; num2 <= n; num2++) { // if this is O(n)\n\t\tfor (var somethingElse; num2 < 10; num1++) { // length is hardcoded ~ O(1)\n\t\tconsole.log(num1 * num2);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "1f007c061bd00aa9fdc6ad7f5a3001cc", "score": "0.6247567", "text": "function solution(N) {\n var result = 0;\n \n for (var i = 1; i*i < N; i++) {\n if (N % i === 0) result += 2;\n }\n \n if (i*i === N) result += 1;\n \n return result;\n}", "title": "" }, { "docid": "9ed0bae79d1beedf6ccd6444c1e13b0f", "score": "0.623544", "text": "function going(n) {\n let r =1, a = 1;\n for(let i=0; i < n-1; i++) {\n a = a/(n-i);\n r = r+a;\n }\n return Math.floor(r*1000000)/1000000;\n}", "title": "" }, { "docid": "71bf6088a121a51fa26dc1ef6c4e440f", "score": "0.6230015", "text": "function fib4(n) {\n if (n <= 2) return 1;\n var fibNums = [0,1,1];\n for (var i=3; i<=n; i++) {\n fibNums[i] = fibNums[i-1] + fibNums[i-2];\n }\n return fibNums[n];\n}", "title": "" }, { "docid": "6513660a1b5ceca3d82357a5c5ac6f87", "score": "0.6199199", "text": "function fbnq(n) {\n if(n<=1) return 1;\n return fbnq(n-1) + fbnq(n-2);\n}", "title": "" }, { "docid": "3cabef865e0339a9b369e7dc7fc1b158", "score": "0.61907446", "text": "e78() {\n let answer = 0;\n let n = 3;\n // memoized partition list MEM[i] = p(i)\n const MEM = [1, 1, 2];\n while (!answer) {\n let i = 1;\n let term = penta(i);\n let currentPartition = 0;\n // sum all terms p(n-1), p(n-2), p(n-5), etc.\n while (term <= n) {\n const sign = (i - 1) % 4 > 1 ? -1 : 1;\n currentPartition += sign * MEM[n - term];\n i++;\n term = penta(i);\n }\n currentPartition %= 1000000;\n if (currentPartition === 0) {\n answer = n;\n break;\n }\n MEM[n] = currentPartition;\n n++;\n }\n\n return answer;\n\n // generalized pentagonal number generator\n function penta(k) {\n if (k & 1) {\n const m = (k + 1) / 2;\n return m * (3 * m - 1) / 2;\n }\n const m = k / 2;\n return m * (3 * m + 1) / 2;\n }\n }", "title": "" }, { "docid": "7e6d0c1a7daa506cff97108be2cd4557", "score": "0.6183851", "text": "function i$2(n,r,i,o){if(1===o.length){if(Z$2(o[0]))return l$2(n,o[0],-1);if(E$6(o[0]))return l$2(n,o[0].toArray(),-1)}return l$2(n,o,-1)}", "title": "" }, { "docid": "e4d74d17256d14a4995fbe3b0d32680a", "score": "0.6173193", "text": "function nthFibo(n) {\n var n1=0;\n var n2=1;\n if(n==1)return n1;\n if(n==2)return n2;\n var count =2;\n while(count!==n)\n {\n var temp=n2;\n n2+=n1;\n n1=temp;\n count++;\n }\n return n2;\n}", "title": "" }, { "docid": "ff209043471b95d0bc08071d881cba31", "score": "0.61669177", "text": "function perimeter(n) {\n //my solution\n let sequence = []\n for(let i = 0 ; i <= n ; i++){\n if(i > 1){\n let oke = sequence[i-1] + sequence[i-2] \n sequence.push(oke)\n }else {\n sequence.push(1)\n }\n }\n let reducer = (accumulator, current) => accumulator + current\n return 4 * sequence.reduce(reducer)\n\n //best solution #1\n // let arr = [1, 1];\n // for(let i = 0; i < n - 1; i++) {\n // arr.push(arr[arr.length - 1] + arr[arr.length - 2]);\n // }\n // return 4 * arr.reduce((sum, num) => sum + num, 0);\n\n //best solution #2\n //function fib(n)\n// var a = 1, b = 1, tmp;\n// while (n-- > 0) {\n// tmp = a;\n// a = b;\n// b += tmp;\n// }\n// return a\n\n// //hit another function \n// return 4 * (fib(n + 2) -1)\n}", "title": "" }, { "docid": "b520924506c8f30df4277730473d4647", "score": "0.6163615", "text": "function n(A,t){0}", "title": "" }, { "docid": "b520924506c8f30df4277730473d4647", "score": "0.6163615", "text": "function n(A,t){0}", "title": "" }, { "docid": "b520924506c8f30df4277730473d4647", "score": "0.6163615", "text": "function n(A,t){0}", "title": "" }, { "docid": "43702e27c385240f7d6ee71ae5520119", "score": "0.6148306", "text": "function anotherFunction(input) {\n let a = 5; // O(1)\n let b = 10; // O(1)\n let c = 15; // O(1)\n\n for (let i = 0; i < input; i++) { // O(n)\n let x = i + 1; // O(n)\n let y = i + 2; // O(n)\n let z = i + 3; // O(n)\n }\n for (let j = 0; j < input; j++) { // O(n)\n let p = j + 1; // O(n)\n let q = j + 2; // O(n)\n let r = j + 3; // O(n)\n }\n let string = 'I dont know' // O(1)\n}", "title": "" }, { "docid": "4e749574907905fdb285d5bbd04ab801", "score": "0.614705", "text": "function triple(n) {\n return n * 3;\n}", "title": "" }, { "docid": "c22240ec29cd016209cd2a41490e37f0", "score": "0.6144695", "text": "function improved_foo(n){\n function square(x){\n return x * x;\n }\n function helper(count, req, acc){\n return count > req ? acc\n : helper(count + 1,\n req,\n acc + (n - count + 1) * count);\n }\n return n % 2 === 0 ? 2 * helper(1, n / 2, 0)\n : square((n + 1) / 2) + 2 * helper(1, (n - 1) / 2, 0);\n}", "title": "" }, { "docid": "dcb3c0654d8fcae3e62ff4493775e578", "score": "0.61401045", "text": "function f(i){var a=j=0,b=1,h=~~i-1>>1;for(;j<h;++j,b+=(a+=b)){}return i%2==0?b:a}", "title": "" }, { "docid": "3545955319423fb6f693f1948199baa1", "score": "0.6133844", "text": "function nLength(n) { \n return (Math.log(Math.abs(n+1)) * 0.43429448190325176 | 0) + 1; \n}", "title": "" }, { "docid": "b8f9b575f1e9901be2d38a200dfb1e07", "score": "0.6132913", "text": "function getPrimes(n){\n let k = (n-2)/2;\n let arr = [k+1];\n for(let i = 1;i<k+1;i++){\n let j = i;\n while((i+j+2*i*j)<= k){//can optimize ?\n arr[i+j+2*i*j] = 1;\n j++;\n }\n }\n let fixedArray = [];\n let count = 0;\n for(let i = 0; i < k+1;i++){\n if(arr[i] != 1){\n fixedArray[count++] = 2*i+1;\n }\n }\n return fixedArray;\n}", "title": "" }, { "docid": "29a1274fb807cdf5535c1c11bebd51ad", "score": "0.61208975", "text": "function n$5(n,o){const t=-n[0],c=-n[1],f=-n[2],i=o[3],s=o[7],u=o[11],e=o[15];o[0]+=i*t,o[1]+=i*c,o[2]+=i*f,o[4]+=s*t,o[5]+=s*c,o[6]+=s*f,o[8]+=u*t,o[9]+=u*c,o[10]+=u*f,o[12]+=e*t,o[13]+=e*c,o[14]+=e*f;}", "title": "" }, { "docid": "7a17d635b395a6a070294dd3dfd4401e", "score": "0.6107668", "text": "function maximizeProductOfSummands(n) {\n if(n === 2) {\n return 1\n }\n if(n === 3) {\n return 2\n }\n\n var quotient = Math.floor(n / 3);\n var remainder = n % 3;\n\n if(remainder === 0) {\n return Math.pow(3, quotient);\n }\n if(remainder === 1) {\n return Math.pow(3, (quotient - 1)) * 4;\n }\n return Math.pow(3, quotient) * 2;\n}", "title": "" }, { "docid": "b7c4060f41fee3f407c89ea2a11d6815", "score": "0.6102036", "text": "function n$4S(n){const o=[];return function*(){yield*o;for(const t of n)o.push(t),yield t;}}", "title": "" }, { "docid": "60ed4ad0ed24b9e4c30d199207bd0ba1", "score": "0.6091798", "text": "function getSumAgain(arr) {\n var sum = 0; // constant = c = O(1)\n for (let i = 0; i < arr.length; i++) { // linear = n = O(n) because it grows with the growth of input\n sum += arr[i]; //constant = c = O(1) // this line will repeat n times based on input because of for loop above\n }\n return sum; // constant = c = O(1)\n}", "title": "" }, { "docid": "7b9706aed552dd003aef1c2657e7a872", "score": "0.6090972", "text": "function i$4F(n){return n}", "title": "" }, { "docid": "3b3c47bdf03b89610a45eaccb21f605d", "score": "0.60814756", "text": "function save4(pv,int,n){\n\tif(n<=0) return pv;\n\telse return save4(pv,int,n-1)*(1+int);\n}", "title": "" }, { "docid": "339e16a7532d7923f3a9e05e281418a6", "score": "0.6073426", "text": "function n$32(n){return 32+n.length}", "title": "" }, { "docid": "f3aada163acf749ccf28cc89edd06f06", "score": "0.60705954", "text": "function tripleStepIter(n) {\n if (n < 0) return 0;\n if (n <= 1) return 1;\n const memoTable = Array(n + 1).fill();\n memoTable[0] = 1;\n memoTable[1] = 1;\n for (let i = 2; i < n + 1; i++) {\n const firstPriorStep = i - 1 >= 0 ? memoTable[i - 1] : 0;\n const secondPriorStep = i - 2 >= 0 ? memoTable[i - 2] : 0;\n const thirdPriorStep = i - 3 >= 0 ? memoTable[i - 3] : 0;\n memoTable[i] = firstPriorStep + secondPriorStep + thirdPriorStep;\n }\n return memoTable[memoTable.length - 1];\n}", "title": "" }, { "docid": "01546af51ee99fc221b48d31d70f8e6f", "score": "0.6055467", "text": "function tri(n) {\n let arr = [0,1,1];\n for ( let i = 3; i <= n; i ++) {\n arr.push(arr[i-1]+arr[i-2]+arr[i-3]);\n }\n return arr[n];\n}", "title": "" }, { "docid": "ec96f4ffce599b2d2e1ab669d3c7c0ef", "score": "0.6049504", "text": "function n$Z(n,f,i){const u=n.byteLength/(4*f),c=new Uint32Array(n,0,u*f);let s=new Uint32Array(u);const a=i?.minReduction??0,h=i?.originalIndices||null,g=h?h.length:0,y=i?.componentOffsets||null;let U=0;if(y)for(let t=0;t<y.length-1;t++){const n=y[t+1]-y[t];n>U&&(U=n);}else U=u;const w=Math.floor(1.1*U)+1;(null==o$P||o$P.length<2*w)&&(o$P=new Uint32Array(i$5l(2*w)));for(let t=0;t<2*w;t++)o$P[t]=0;let A=0;const m=!!y&&!!h,b=m?g:u,d=m?new Uint32Array(g):null,p=1.96;let M=0!==a?Math.ceil(4*p*p/(a*a)*a*(1-a)):b,q=1,j=y?y[1]:b;for(let t=0;t<b;t++){if(t===M){const n=1-A/t;if(n+p*Math.sqrt(n*(1-n)/t)<a)return null;M*=2;}if(t===j){for(let t=0;t<2*w;t++)o$P[t]=0;if(h)for(let t=y[q-1];t<y[q];t++)d[t]=s[h[t]];j=y[++q];}const n=m?h[t]:t,r=n*f,i=l$Y(c,r,f);let u=i%w,g=A;for(;0!==o$P[2*u+1];){if(o$P[2*u]===i){const t=o$P[2*u+1]-1;if(e$V(c,r,t*f,f)){g=s[t];break}}u++,u>=w&&(u-=w);}g===A&&(o$P[2*u]=i,o$P[2*u+1]=n+1,A++),s[n]=g;}if(0!==a&&1-A/u<a)return null;if(m){for(let t=y[q-1];t<d.length;t++)d[t]=s[h[t]];s=d;}const k=new Uint32Array(f*A);A=0;for(let t=0;t<b;t++)if(s[t]===A){r$S(c,(m?h[t]:t)*f,k,A*f,f),A++;}if(h&&!m){const t=new Uint32Array(g);for(let n=0;n<t.length;n++)t[n]=s[h[n]];s=t;}return {buffer:k.buffer,indices:s,uniqueCount:A}}", "title": "" }, { "docid": "0c6e225fee53d794aa6006fc934448b6", "score": "0.6045653", "text": "function getInsertSortBetterThanCombinedMaxN() {\n let maxNumber = 2;\n for (let n = 2; ; n++) {\n let insertSortTime = 8*Math.pow(n,2);\n let combinedSortTime = 64*n*Math.log2(n);\n logger.info(\"n:\"+n);\n logger.info(\"insertSortTime:\"+insertSortTime);\n logger.info(\"combinedSortTime\"+combinedSortTime)\n if (insertSortTime > combinedSortTime) {\n maxNumber = n;\n break;\n }\n }\n\n return maxNumber;\n}", "title": "" }, { "docid": "70817a8aaf1db460c0c71754d7eac739", "score": "0.6041097", "text": "function solution() {\n var aNumbers = [];\n\n for (i = 0; fibonacci(i) < 4000000; i++) aNumbers.push(fibonacci(i));\n\n return aNumbers.filter((x) => x % 2 === 0).reduce((x, y) => x + y, 0);\n}", "title": "" }, { "docid": "90a1d038b9bac9cd43e7f3f3424bba21", "score": "0.60402715", "text": "function solve(n, p) {\n // Complete this function\n var startCount = 0;\n var endCount = 0;\n\n if (n / 2 >= p) {\n if (n === 2 && p === 1) {\n return startCount;\n }\n for (var i = 0; i <= n; i += 2) {\n if (i === p || i + 1 === p) {\n return startCount;\n }\n startCount++;\n }\n } else {\n if (n % 2 === 0 && p === n - 1) {\n endCount++;\n return endCount;\n }\n for (var i = n; i > 0; i -= 2) {\n if (i === p || i - 1 === p) {\n return endCount;\n }\n endCount++;\n }\n }\n}", "title": "" }, { "docid": "f0e273d11e9ebbb0d716bf6c3c355d78", "score": "0.603635", "text": "function revNumPairs(n, p) {\r\n\tconst a = 2*n-1;\r\n\tconst r = a**2 - 8*p;\r\n\tif (r < 0) return n-1;\r\n\treturn Math.floor(0.5 * (a - Math.sqrt(a**2 - 8*p)));\r\n}", "title": "" }, { "docid": "2d8021e2fa20fbdbf5fe4ef10520266b", "score": "0.6030377", "text": "function funChallenge(input) {\n let a = 10; // 0(1)\n a = 50 + 3; // 0(1)\n \n for (let i = 0; i < input.length; i++) { // 0(n)\n anotherFunction(); // 0(n)\n let stranger = true; // 0(n)\n a++; // 0(n)\n }\n return a; // 0(1)\n } // BIG O is (3 + 4n) or O(n)", "title": "" }, { "docid": "e6dae90e0edea14ac074ec59b49a7aa4", "score": "0.60300213", "text": "function quadrado(n){\n return n * n // n**2\n}", "title": "" }, { "docid": "e29edb5e86235ba057a9e254da6e2ca6", "score": "0.6026401", "text": "function tribonacci(signature,n){\n if(n<3){return signature.slice(n-1,n)}\n let count = 0\n for(var j =1;j<n-2;j++){\n count=0\n for(var i=signature.length-1;i>signature.length-4;i--){\n count+=signature[i]\n }\n signature.push(count)\n }\n return signature\n}", "title": "" }, { "docid": "db737d0920817fb91f544f02c77ef7c4", "score": "0.6022109", "text": "function quadruple(n) {\n return n * 4;\n}", "title": "" }, { "docid": "ac1b8a81f38047fdb5db9566c20a77be", "score": "0.6009065", "text": "function threeStepsD(n) {\n const res = [];\n res[0] = 1;\n res[1] = 1;\n res[2] = 2;\n for (let i = 3; i < n + 1; i++) {\n res[i] = res[i - 1] + res[i - 2] + res[i - 3];\n }\n return res[n];\n}", "title": "" }, { "docid": "f029eb9f5ea722318533436487f2a059", "score": "0.60049075", "text": "function n$4t(n,t,i=j$1Z){return t||(t=new i),t===n||(t.removeAll(),e$3x(n)?t.addMany(n):n&&t.add(n)),t}", "title": "" }, { "docid": "1c6484f8cb734521bc9db78fe86f15c1", "score": "0.59875405", "text": "function n$52(r,n){if(r.forEach)r.forEach(n);else for(let t=0;t<r.length;t++)n(r[t],t,r);}", "title": "" }, { "docid": "815d73be031caad887ead76ac8cb89cd", "score": "0.5977405", "text": "function n$3O(n){return null!=m$39[n]}", "title": "" }, { "docid": "061ff9971e3d2f92220892a202a7b573", "score": "0.59772366", "text": "function solution(n, a, b) {\n // group\n let i = ((a - 1) / 2) << 0;\n let j = ((b - 1) / 2) << 0;\n\n let r = 1;\n while (i !== j) {\n i = (i / 2) << 0;\n j = (j / 2) << 0;\n\n r += 1;\n }\n\n return r;\n}", "title": "" }, { "docid": "e420e0505edeb88f2966375564f6f879", "score": "0.59736574", "text": "function solution(N) {\n // write your code in JavaScript (Node.js 8.9.4)\n const binary = N.toString(2);\n let count = 0;\n let pivot = 0;\n let arr = [];\n const arr2 = binary.split('')\n for(let i = 0; i < arr2.length ; i++) {\n const el = parseInt(arr2[i]);\n const elNext = parseInt(arr2[i+1]) || 0;\n if(el === 0 && pivot === 1) {\n count ++;\n } else if(el === 1 && pivot === 0 && elNext === 0) {\n pivot++;\n } else if(el === 1 && pivot === 1 && elNext === 0) {\n arr.push(count);\n count=0;\n } else if(el === 1 && pivot === 1) {\n pivot--;\n arr.push(count);\n count=0;\n }\n }\n arr = arr.sort();\n return arr[arr.length-1] || 0;\n}", "title": "" }, { "docid": "ab789271a8a585db2a1fe89548583a60", "score": "0.5971472", "text": "function fibonacci(n) { //O(2^n)\n \n if (n < 2) {\n return n\n }\n return fibonacci(n-1) + fibonacci(n-2);\n}", "title": "" }, { "docid": "7b4045abe89bf1875f17c9a75f53a874", "score": "0.5958038", "text": "function n(e,t){return e<<t|e>>>32-t}", "title": "" }, { "docid": "8b0486529198129a9274df19c14e5afd", "score": "0.5954723", "text": "static triple(n) {\n n = n || 1;\n return n * 3;\n }", "title": "" }, { "docid": "9f70d801fdfe800bb08c6cea3ce20290", "score": "0.5951633", "text": "function bits_needed(n) {\n let b = 0\n while (n)\n n = Math.floor(n / 2), ++b\n return b\n}", "title": "" }, { "docid": "d458c7ed567121e1bb07e08de731142d", "score": "0.59350497", "text": "function n(t){var e,n=t.length,r=this,i=0,o=r.i=r.j=0,s=r.S=[];\n// Set up S using the standard key scheduling algorithm.\nfor(\n// The empty key [] is treated as [0].\nn||(t=[n++]);i<a;)s[i]=i++;for(i=0;i<a;i++)s[i]=s[o=f&o+t[i%n]+(e=s[i])],s[o]=e;\n// The \"g\" method returns the next (count) outputs as one number.\n(r.g=function(t){for(\n// Using instance members instead of closure state nearly doubles speed.\nvar e,n=0,i=r.i,o=r.j,s=r.S;t--;)e=s[i=f&i+1],n=n*a+s[f&(s[i]=s[o=f&o+e])+(s[o]=e)];return r.i=i,r.j=o,n})(a)}", "title": "" }, { "docid": "e3fb1eb65c16d79bfd159d57e0aed201", "score": "0.5934685", "text": "function g(n){\n return of(n * 2);\n}", "title": "" }, { "docid": "ef82993d1391c22d875842351aa719af", "score": "0.5932852", "text": "function Fib(n) {\n let results = [0,1];\n for (let i=2;i<n+1;i++) {\n results.push(results[i - 1] + results[i - 2]);\n }\n return results[n];\n}", "title": "" }, { "docid": "58f52d5be8738fe47464960d8957cc78", "score": "0.59300834", "text": "function trianglar(n) {\n let result = 0;\n for(let i=n; i>=0; i--) {\n result += 1\n }\n return result;\n}", "title": "" }, { "docid": "4526cee261cf1f9db2115d1c3c024434", "score": "0.59205866", "text": "function factorial(num) {\nlet result = 1;\n\n for (let i = num; i > 1; i--) {\n result = result * i\n }\n return result;\n\n} // O(n)", "title": "" }, { "docid": "c1e2a9990a562d52ec894f29f4d40ef3", "score": "0.59183407", "text": "function problemTwo() {\n let array = [1, 2];\n let sum = 0;\n while (array[array.length - 1] < 4000000) {\n array.push(array[array.length - 1] + array[array.length - 2]);\n }\n for (var i = 0; i < array.length; i++) {\n if (array[i]%2 === 0) {\n sum = sum + array[i];\n }\n }\n return sum;\n}", "title": "" }, { "docid": "ef3bd510117a1343601ac76033a3bee6", "score": "0.5909955", "text": "function e$7(t,n,e){const o={x:0,y:0};n&&(o.z=0),e&&(o.m=0);let a=0,f=t[0];for(let l=0;l<t.length;l++){const c=t[l];if(!1===h$4(c,f)){const t=s$6(f,c,n),h=r$7(f,c,n,e);h.x*=t,h.y*=t,o.x+=h.x,o.y+=h.y,n&&(h.z*=t,o.z+=h.z),e&&(h.m*=t,o.m+=h.m),a+=t,f=c;}}return a>0?(o.x/=a,o.y/=a,n&&(o.z/=a),e&&(o.m/=a)):(o.x=t[0][0],o.y=t[0][1],n&&(o.z=t[0][2]),e&&n?o.m=t[0][3]:e&&(o.m=t[0][2])),o}", "title": "" }, { "docid": "caf1a5f78ff67b252eeac0ffb81102f7", "score": "0.59061396", "text": "function alturaArvoreUtopica(N){\n var height = 0;\n for (var i = 0; i <= N; i++){\n i % 2 == 0 ? height++: height *= 2;\n }\n return height;\n}", "title": "" }, { "docid": "c5264915565905f80f5b345edaebadb0", "score": "0.5902922", "text": "function getNthFibo(n) {\n if (n <= 1) return n;\n\n let last = 1;\n let lastLast = 0;\n let sum = 0;\n\n for (let i = 1; i < n; i++) {\n sum = last + lastLast;\n lastLast = last;\n last = sum;\n }\n return sum;\n}", "title": "" }, { "docid": "ef404c95d047d379248478f909601348", "score": "0.58784103", "text": "function finalResult (result,i){ // using recursion and closure is the best solution in my piont of view \n \t\tif(i > n){\n \t\t\treturn result;\n \t\t}\n \t\treturn finalResult(result * i, i + 1)\n \t}", "title": "" }, { "docid": "3dc508d7020dfc28c64af4fac092a529", "score": "0.58774024", "text": "function count(n) {\n let value = 0\n while (n >= 2) {\n value += Math.log10(n)\n n--\n }\n return ~~value + 1\n}", "title": "" }, { "docid": "be70c92220ef16a46591e5d0a1442878", "score": "0.5874573", "text": "function factorio(n){\n for(let i = n - 1; i > 0; i--){\n n *= i;\n }\n return n;\n}", "title": "" }, { "docid": "884f3329506c4d641e30a0ac7e12bc6e", "score": "0.58717537", "text": "function sumHalves(n){\n if (n < 2) return 0;\n return n/2 + sumHalves(n/2);\n}", "title": "" }, { "docid": "48728e3a76030b1d74765a168c3ce711", "score": "0.5870615", "text": "function solution(N, A) {\n // write your code in JavaScript (Node.js 8.9.4)\n var state = [];\n for (var i = 0; i < N; i++) {\n state.push(0);\n }\n for (var j = 0; j < A.length; j++) {\n var x = A[j];\n var counterIndex = x - 1;\n if (x >= 1 && x <= N) {\n state[counterIndex]++;\n }\n if (x == (N + 1)) {\n var sortedAsc = state.sort();\n var max = sortedAsc[sortedAsc.length - 1];\n for (var z = 0; z < state.length; z++) {\n state[z] = max;\n }\n }\n }\n return state;\n}", "title": "" }, { "docid": "4e37bfd9fe1214133fea96f7f1bc6ccc", "score": "0.58659124", "text": "function a(n){return n}", "title": "" }, { "docid": "4f222ff80dceeed0d905ac7d66f9dd65", "score": "0.58633953", "text": "function solve(n) {\r\n let a = '9'.repeat(String(n).length - 1)\r\n let b = n - a\r\n return [...a + b].reduce((c, d) => c + Number(d), 0)\r\n}", "title": "" }, { "docid": "15e5e72163afa7a31529a148c772f469", "score": "0.58630747", "text": "function solution(N) {\r\n // write your code in JavaScript (Node.js 8.9.4)\r\n return decToBin(N);\r\n}", "title": "" }, { "docid": "961c09d2cfe26d47f8016dcf5103b573", "score": "0.58618355", "text": "function arrayManipulation(n, queries) {\n // bc is 1-based\n // 0 pos is ignored, so n + 1\n // the algo will use (pos + 1) on last pos incl, so n + 2 pos are needed total\n let arr = Array(n + 2).fill(0);\n\n queries.map(q => {\n let [a, b, k] = q;\n\n // apply prefix sum algo\n // where you calculate curr el = prev el + curr el\n arr[a] += k;\n arr[b + 1] -= k;\n });\n\n let max = 0;\n for (var i = 1; i <= n; i++) {\n arr[i] = arr[i] + arr[i - 1];\n if (arr[i] > max) {\n max = arr[i];\n }\n }\n\n // Math.max returns runtime error...\n return max;\n}", "title": "" }, { "docid": "cec52bbbc3e1450d0a65a7178c44fd5e", "score": "0.5860083", "text": "function getNthFib3(n, memo = {1: 0, 2: 1}) {\n\tif (n in memo) return memo[n];\n\telse return memo[n] = getNthFib3(n - 1, memo) + getNthFib3(n - 2, memo);\n}", "title": "" }, { "docid": "1e0f52289f2e7b68b5e0a6327cb5725b", "score": "0.5859842", "text": "function popcnt32(n) {\n\tn -= ((n >> 1) & 0x55555555);\n\tn = (n & 0x33333333) + ((n >> 2) & 0x33333333);\n\treturn (((n + (n >> 4))& 0xF0F0F0F)* 0x1010101) >> 24;\n}", "title": "" }, { "docid": "ff98ce1bf6055aaf222323f6539645e3", "score": "0.58595204", "text": "function i(t,n){0}", "title": "" }, { "docid": "ff98ce1bf6055aaf222323f6539645e3", "score": "0.58595204", "text": "function i(t,n){0}", "title": "" }, { "docid": "dd39e54809ff71f3953b4397bc8ec0e2", "score": "0.58541375", "text": "function fib(number){\r\n if(number <= 2) return 1;\r\n return fib(number - 1) + fib(number - 2);\r\n} // the problem with this is that the time complexity is O(2^N), which is really bad, there is way to optimize so its O(N). If you tried fib(50), chrome freezes", "title": "" }, { "docid": "eca49b5196d863983253854e24b72df1", "score": "0.58513284", "text": "function n(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}", "title": "" }, { "docid": "eca49b5196d863983253854e24b72df1", "score": "0.58513284", "text": "function n(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}", "title": "" }, { "docid": "eca49b5196d863983253854e24b72df1", "score": "0.58513284", "text": "function n(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}", "title": "" }, { "docid": "eca49b5196d863983253854e24b72df1", "score": "0.58513284", "text": "function n(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}", "title": "" } ]
1c5d6ab1d0fd1d6d3a206ff3df6b8d68
In an async function, you can await for any Promise or catch its rejection cause. Implementation with promises:
[ { "docid": "ef7a58f4106fac5baf84d431a2f164d0", "score": "0.0", "text": "function handler (req, res) {\n return request('https://user-handler-service')\n .catch((err) => {\n logger.error('Http error', err)\n error.logged = true\n throw err\n })\n .then((response) => Mongo.findOne({ user: response.body.user }))\n .catch((err) => {\n !error.logged && logger.error('Mongo error', err)\n error.logged = true\n throw err\n })\n .then((document) => executeLogic(req, res, document))\n .catch((err) => {\n !error.logged && console.error(err)\n res.status(500).send()\n })\n }", "title": "" } ]
[ { "docid": "598dee011784641dd06b27f5924abb13", "score": "0.73036313", "text": "async function something(){\n try{\n\n }\n catch(err){\n\n }\n}", "title": "" }, { "docid": "c239a8b7df2ece8a79d373537621dce2", "score": "0.7258817", "text": "async function test() {\n try {\n await Promise.reject(new Error(\"rejection\"));\n }\n catch(err) {\n console.log(\"caught\");\n }\n}", "title": "" }, { "docid": "92d7b1d837309dec67ea2d30e2d8a774", "score": "0.7167275", "text": "async function myFirstAsyncFunction() {\n try {\n const fulfilledValue = await fetchData();\n console.log(fulfilledValue)\n }\n catch (rejectedValue) {\n console.log(rejectedValue)\n }\n}", "title": "" }, { "docid": "1e636ea455780ac6df7243041bf4b540", "score": "0.6926108", "text": "async function foo () {\n try {\n return await asyncFn()\n } catch (error) {\n // here we catch errors from asyncFn.\n }\n}", "title": "" }, { "docid": "6ece0c6ad52d699961d06194d2a48e8a", "score": "0.6924668", "text": "async function contrived3() {\n try {\n var z = await Promise.reject(30);\n } catch(e) {\n console.log('contrived3', e); // 30\n }\n}", "title": "" }, { "docid": "0284cbcb0bdf1704cd53cb5585544baf", "score": "0.69082123", "text": "function doAsync() {\n return Promise.reject(\"Some error\");\n}", "title": "" }, { "docid": "c2fde75f1083bb4c87b6fe6f650ffef8", "score": "0.68368936", "text": "async function waitForMe(param){\n try{\n var data = await doSomething(param);\n var data2 = await thenDoSomethingElse(data);\n return data2\n }\n catch(error){\n /* do error handling */\n }\n}", "title": "" }, { "docid": "f34ed972a28d27e8a73502141cb56ee8", "score": "0.68360656", "text": "async function asyncReturnReject() {\n await Promise.reject(new Error('asyncReturnReject'));\n}", "title": "" }, { "docid": "4924062443b007a18c72642bf0583267", "score": "0.6835549", "text": "async function f() {\n window.t1 = +new Date;\n await 123;\n// try {\n// await Promise.reject('出错了 && Promise.reject');\n// }catch(err){\n// console.log('xxx',err);\n// }\n await Promise.reject('出错了 && Promise.reject').catch(function(){\n console.log('catch 函数 arguments:',arguments);\n });\n await Promise.resolve('hello world'); // 上面加了catch捕获,会接着执行,如果不加try/catch或catch,zhe\n console.log('++++++++++');\n await new Promise(function(resolve, reject) {\n console.log('Promise');\n// throw new Error('出错了');// 会被 '1处' 的捕获到\n \n setTimeout(function(){\n console.log('resolve 时机-------------->');\n resolve(\"resolve data\"); \n },2000)\n });\n\n await new Promise(function(resolve, reject) {\n console.log('Promise');\n setTimeout(function(){\n console.log('reject 时机-------------->');\n reject(\"reject data 测试\"); \n },6000)\n });\n\n await setTimeout(function(){console.info('async',arguments)},2000);\n return ['a'];\n}", "title": "" }, { "docid": "28df6362433d11656c08ed959f83f9d4", "score": "0.6795537", "text": "async function main(){\n try {\n const data = await promise\n console.log(data)\n } catch(e){\n console.log(e)\n }\n}", "title": "" }, { "docid": "d2d15109a4671c0753e4bcb7d3327e44", "score": "0.67671573", "text": "function doAsync() {\n return new Promise(function (resolve, reject) {\n console.log(\"in promise code\");\n setTimeout(function () {\n console.log(\"rejecting...\");\n reject(\"database error\");\n }, 500);\n });\n}", "title": "" }, { "docid": "baa8a5827963e729b01941eb7d4f532c", "score": "0.6755807", "text": "async function asyncCall() {\n try {\n console.log(\"async calling\");\n let result = await do1(1);\n let result2 = await do2(result);\n let finResult = await do3(result2);\n console.log(`Got final result: ${finResult}`);\n } catch(error) {\n console.log(`got a rejection! ${error}`);\n }\n }", "title": "" }, { "docid": "b04ea6212a61be6fb56f90ce7b443c93", "score": "0.65760463", "text": "function handleAsyncExceptions() {\n if (handleAsyncExceptions.hooked === false) {\n process.on('unhandledRejection', (err) => {\n throw err;\n });\n\n handleAsyncExceptions.hooked = true;\n }\n}", "title": "" }, { "docid": "20022e1b162fe002aafa485e0058601b", "score": "0.650982", "text": "async function asyncCall() {\n const result = await myPromiseFunction(2);\n console.log(result);\n}", "title": "" }, { "docid": "5a0de373e30dd15f243572f7b46d6603", "score": "0.6470915", "text": "async function foo () {\n try {\n return asyncFn()\n } catch (error) {\n // errors from asyncFn do not land here.\n }\n}", "title": "" }, { "docid": "85bda53a718aea07868437f648653aae", "score": "0.64538884", "text": "function asyncCode(resolve, reject){\n setTimeout(() => reject({milk: 2, water: 1}), 1000 );\n}", "title": "" }, { "docid": "666533a0ba9e9e65fc0efd67cae5439b", "score": "0.64449525", "text": "async function asyncFuncExample(){\n let resolvedValue = await myPromise();\n console.log(resolvedValue);\n}", "title": "" }, { "docid": "31c7ce47b93ccb26b1b85e5d20ef9270", "score": "0.63687", "text": "async function expectError(f) {\n let fail = true;\n try {\n await f();\n } catch (err) {\n fail = false;\n }\n if (fail) {\n expect.fail('Expecting async function to throw');\n }\n}", "title": "" }, { "docid": "d02c92ad32fbd9a20e4df51d95bcb84b", "score": "0.6364597", "text": "async function getResult() {\r\n try {\r\n const result = await addWithPromise(2, 3);\r\n console.log('using pomise with async await:', result);\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n}", "title": "" }, { "docid": "65147bf50da79abbb875db5722ac8da6", "score": "0.6330303", "text": "async function async_two(){\n throw new Error('Issue with async!');\n}", "title": "" }, { "docid": "4d74656ce3b2853e5f163f85be609473", "score": "0.6314035", "text": "async function example4() {\n try {\n\n } catch (err) {\n console.error(err)\n }\n}", "title": "" }, { "docid": "339abe1300215add0abd0db869fdbfc7", "score": "0.63112617", "text": "function doAsync() {\n return new Promise(function (resolve, reject) {\n console.log(\"in promise code\");\n setTimeout(function () {\n console.log(\"rejecting...\");\n reject(\"It's a no go!\");\n }, 2000);\n });\n}", "title": "" }, { "docid": "a6573501cda2761d4f583cd4f22b7bb4", "score": "0.6310171", "text": "async catch(...args) {\n if (this.promise) {\n return this.promise.catch(...args)\n } else {\n return Promise.resolve()\n }\n }", "title": "" }, { "docid": "6ed5391dbfd69c9aa4bc9296a0fc1596", "score": "0.6303027", "text": "async function main() {\n try {\n function delay() {\n return new Promise((resolve, reject) => {\n try {\n const data = await servercall();\n resolve(data);\n\n } catch (err) {\n reject(err);\n }\n \n })\n }\n \n console.log('1st');\n \n throw {code: 403};\n \n console.log('3rd');\n\n } catch(err) {\n switch(err.code) {\n case 404:\n console.log('404 error');\n break;\n }\n }\n\n}", "title": "" }, { "docid": "ccd8ef0c3313ed999ee473a3f3a11dec", "score": "0.62918246", "text": "async function getResultErrorCaptured(){\n\ttry {\n\t\tlet result = await resultError(700);\n\t\treturn result;\n\t} catch (exception) {\n\t\treturn 'error caught';\n\t}\n}", "title": "" }, { "docid": "3fe815f197ebd906456665700baf6294", "score": "0.62683445", "text": "async function WaitForSomething() {\n await sleep(100);\n functionThatDoesNotExist();\n}", "title": "" }, { "docid": "c3daf61ac6b300f979faa2e374707327", "score": "0.6267976", "text": "async function ansyncExample() {\n\ttry {\n\t\tconst outcome = await randomProm;\n\t\tconsole.log(outcome);\n\t} catch (error) {\n\t\tconsole.log('catch error: ',error);\n\t}\n\n\t// This return value is wrapped in a promise\n\treturn 'AsyncReturnVal';\n}", "title": "" }, { "docid": "c3b4171964236eafd6c01b8f59175688", "score": "0.6266708", "text": "async function example1() {\n\n try {\n\n } catch (err) {\n console.error(err)\n }\n}", "title": "" }, { "docid": "70c65396b002807568fa153377d99b58", "score": "0.6258526", "text": "async function run() {\n try {\n const result = await someAsyncFunction(\"7fd12fd1-a977-4ace\");\n console.log(\"SUCCESS: \");\n console.log(result);\n } catch (err) {\n console.error(err.message);\n console.log(\"Please try again.\");\n }\n}", "title": "" }, { "docid": "a7a6c64340985fc601dbf7b97562bebc", "score": "0.624354", "text": "async function asyncReq(reqNum) {\n\ttry {\n\t\tawait clientRequest(reqNum);\n\t}\n\tcatch (error) {\n\t\t// Promise rejected\n\t\tconsole.log(error);\n\t}\n}", "title": "" }, { "docid": "064c378dbeda79d1bb4c4427d4f1292d", "score": "0.62273604", "text": "async function example3() {\n try {\n\n } catch (err) {\n console.error(err)\n }\n}", "title": "" }, { "docid": "30681c6de869ec26a4f148f1e7df8949", "score": "0.62255", "text": "async function f() {\n try {\n let response = await fetch('http://no-such-url');\n } catch(err) {\n console.log(err); // TypeError: failed to fetch\n }\n}", "title": "" }, { "docid": "2b20d665ec28db4b17a318263914fea9", "score": "0.6196546", "text": "async function uhOh() {\n throw new Error(\"oh no!\");\n}", "title": "" }, { "docid": "a77858bb2ffd7f5972603cd96ad70939", "score": "0.6174211", "text": "async function fetchAsync(func) {\n const response = await func();\n if (response.ok) {\n return await response.json();\n }\n throw new Error(\"Unexpected error!!!\");\n}", "title": "" }, { "docid": "b3e5cc46173d556d09e288fb9dced5c1", "score": "0.61722875", "text": "async function fetchWithErrorRejection(...args) {\n const res = await fetch(...args);\n if (res.ok) {\n return res;\n }\n\n throw res;\n}", "title": "" }, { "docid": "323b028967456ba785c17b5ffcc02f98", "score": "0.6128713", "text": "async function asyncF() {}", "title": "" }, { "docid": "1756e4607ec40913a6d282278844f11d", "score": "0.61145496", "text": "function doAsync(isRisky) {\n return new Promise(function (resolve, reject) {\n console.log(\"Start async task and wait for it to finish.\");\n if (isRisky) {\n setTimeout(function () {\n console.log(\"REJECTED!\");\n reject();\n }, 500);\n } else {\n setTimeout(function () {\n console.log(\"resolved\");\n resolve();\n }, 2000);\n }\n \n });\n}", "title": "" }, { "docid": "add947588cc2bf3b5be88eed0447072c", "score": "0.6114294", "text": "function __awaiter(e,t,n,r){return new(n||(n=Promise))((function(a,o){function i(e){try{u(r.next(e))}catch(e){o(e)}}function l(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){e.done?a(e.value):new n((function(t){t(e.value)})).then(i,l)}u((r=r.apply(e,t||[])).next())}))}", "title": "" }, { "docid": "5368a2527867a9e809dee9cf813ac1fc", "score": "0.6104793", "text": "async function foo()\n{\n await new Promise((resolve) => { console.log(1); resolve(); });\n await new Promise((resolve) => { console.log(2); resolve(); }); \n await new Promise((resolve) => { console.log(3); resolve(); });\n}", "title": "" }, { "docid": "d32b9376df1953b7ed235a625789085b", "score": "0.6085054", "text": "async function run_usingAwait() {\n try {\n await runner.run_usingAwait().then(\n (finalResult) => {\n console.log('finalResult run_usingAwait: ', finalResult)\n }\n )\n } catch (err) {\n console.error(`run_usingAwait ERROR: ${err.message}`)\n }\n}", "title": "" }, { "docid": "22ede14e47c4b14a906003567202e757", "score": "0.6078412", "text": "function doAnotherAsync() {\n return new Promise(function (resolve, reject) {\n console.log(\"in another promise code\");\n setTimeout(function () {\n reject(\"It's a no go! 2\");\n }, 1000);\n });\n}", "title": "" }, { "docid": "8438880956b7f253419c9284ae7bd44d", "score": "0.6077689", "text": "function asyncFunc(data){\n return new Promise(function (resolve,reject) {\n if (data === \"\") {\n\n reject(function(){\n try{\n Error(\"ERROR\");\n }\n catch (e) {\n\n }\n });\n }\n else {\n setTimeout(function (){\n resolve(data);}\n ,2000);\n }\n });\n}", "title": "" }, { "docid": "c1f330ba6113c7cb3ed03b5d2a22d533", "score": "0.60726047", "text": "function doAnotherAsync() {\n return new Promise(function (resolve, reject) {\n console.log(\"in another promise code\");\n setTimeout(function () {\n reject(\"It's a no go!\");\n }, 1000);\n });\n}", "title": "" }, { "docid": "b4b90628340ff86015bc4000451c6af7", "score": "0.6045926", "text": "async function pushCodeToRepository(reqData,patToken) {\n return new Promise(async (resolve,reject)=>{\n try{\n await getRepositoriesAPI(reqData,patToken).then(async projectId=>{\n\n await pushCodeToAzureRepo(reqData,projectId,patToken).then(async resultant=>{ //Push Code\n query = `UPDATE [dbo].[devOpsStarter] SET status = 'Import Code To Repository Succeeded.' WHERE processId ='${reqData.processId}'`\n databaseResponse = await database(query)\n resolve(resultant)\n }).catch(error=>{ //Error while push the code on Azure Repos.\n reject(error) \n })\n \n }).catch(error=>{ //Error while getting repositories list.\n reject(error) \n })\n }catch(error) { //Error occurred in try-catch block\n console.log(error)\n reject({\"Error\": \"Error occurred in try catch!!!\"})\n }\t \n })\n\n}", "title": "" }, { "docid": "566cf85eb2e0d30ef1655d1a60f7a7bd", "score": "0.601895", "text": "async function main() {\n Promise.reject(\"uno\");\n Promise.reject(\"dos\");\n Promise.reject(\"tres\");\n Promise.reject(new Error(\"the froggle is the wrong bodoozer\"));\n (function gogogo () {\n Promise.reject(new Error(\"woops\"));\n\n (function further() {\n Promise.reject(new Error(\"how many promises do I rip on the daily?\"));\n }());\n }())\n\n await timeout(10000000);\n return true;\n}", "title": "" }, { "docid": "b2a3947ece7de6cd1484d9a5200e319a", "score": "0.6014693", "text": "async function await6 (){\n try {\n const promesa1 = await exercise1();\n console.log(promesa1); \n getEmpleado(1).then(getSalario(employees[1])) \n } catch (err) {\n console.log(err)\n }\n}", "title": "" }, { "docid": "89c66f3e386fcc90777cb63efccae3f2", "score": "0.60104704", "text": "async function example2() {\n try {\n\n } catch (err) {\n console.error(err)\n }\n}", "title": "" }, { "docid": "d3a1d269f518ce0ff5c174fe0a0ee6d6", "score": "0.59918666", "text": "function doAsync(isRisky) {\n return new Promise(function (resolve, reject) {\n console.log(\"Start async task and wait for it to finish.\");\n if (isRisky) {\n setTimeout(function () {\n console.log(\"REJECTED!\");\n reject();\n }, 500);\n } else {\n setTimeout(function () {\n console.log(\"resolved\");\n resolve();\n }, 2000);\n }\n });\n}", "title": "" }, { "docid": "d3a1d269f518ce0ff5c174fe0a0ee6d6", "score": "0.59918666", "text": "function doAsync(isRisky) {\n return new Promise(function (resolve, reject) {\n console.log(\"Start async task and wait for it to finish.\");\n if (isRisky) {\n setTimeout(function () {\n console.log(\"REJECTED!\");\n reject();\n }, 500);\n } else {\n setTimeout(function () {\n console.log(\"resolved\");\n resolve();\n }, 2000);\n }\n });\n}", "title": "" }, { "docid": "d3a1d269f518ce0ff5c174fe0a0ee6d6", "score": "0.59918666", "text": "function doAsync(isRisky) {\n return new Promise(function (resolve, reject) {\n console.log(\"Start async task and wait for it to finish.\");\n if (isRisky) {\n setTimeout(function () {\n console.log(\"REJECTED!\");\n reject();\n }, 500);\n } else {\n setTimeout(function () {\n console.log(\"resolved\");\n resolve();\n }, 2000);\n }\n });\n}", "title": "" }, { "docid": "586569bfd09a18949722d7106f3992e2", "score": "0.5991061", "text": "async function cobaAsync() {\n try{\n const coba = await cobaPromise();\n console.log(coba);\n } catch(err) {\n console.error(err);\n }\n}", "title": "" }, { "docid": "10aa9ce962a76c594e22148f7e2c8a83", "score": "0.5979808", "text": "async function resultError(n){\n\tawait new Promise(resolve => { setTimeout(() => {resolve(0)}, n); });\n\treturn new Promise(() => { throw new Error('result error'); });\n}", "title": "" }, { "docid": "f13cb7b2cc03270464b7c042ca711585", "score": "0.59771156", "text": "async function getException(){\n\tthrow new Error('things go wrong');\n\treturn 0;\n}", "title": "" }, { "docid": "70d6713e636c34e913cba2cc1d2bd2c0", "score": "0.5969914", "text": "async function f(){\n let promise = new Promise((resolve,reject) => {\n setTimeout(() => resolve(\"done\"),1000)\n })\n\n let result = await promise; // wait until the promise resolves (#)\n\n alert(result); // \"done\"\n}", "title": "" }, { "docid": "e5a879ebb844a2f268142a08e2f08c6e", "score": "0.5964275", "text": "function syncify (fn) {\n return (req, res, next) => {\n try {\n return Promise\n .resolve(fn(req, res, next)) // this will resolve if none of\n // the encapsulated await statements reject.\n .catch(error => next(error))// otherwise this will be called and we call the express error handler\n } catch (error) {\n // another catch block to catch any error thrown via\n // throw error\n // these are not catch'ed by the promise statement\n next(error)\n }\n }\n}", "title": "" }, { "docid": "9cde6bda7cfed7ffb3beb1c32640f8f9", "score": "0.5947455", "text": "function myAsyncFunction2(msg) {\n \n const myTimerPromise = new Promise(\n function(resolve, reject) {\n // my async code will be in this function\n setTimeout(function() {\n // resolve(msg);\n reject(new Error('something happend'))\n }, 1000)\n }\n );\n return myTimerPromise;\n}", "title": "" }, { "docid": "8a727a6a9f916ebb99e15b4e57845c03", "score": "0.5937689", "text": "function awaitify (asyncFn, arity = asyncFn.length) {\n if (!arity) throw new Error('arity is undefined')\n function awaitable (...args) {\n if (typeof args[arity - 1] === 'function') {\n return asyncFn.apply(this, args)\n }\n\n return new Promise((resolve, reject) => {\n args[arity - 1] = (err, ...cbArgs) => {\n if (err) return reject(err)\n resolve(cbArgs.length > 1 ? cbArgs : cbArgs[0]);\n };\n asyncFn.apply(this, args);\n })\n }\n\n return awaitable\n}", "title": "" }, { "docid": "dabc335e89aabbaa92083a395992a97d", "score": "0.58983314", "text": "async function f() {\n\n let promise = new Promise((resolve, reject) => {\n setTimeout(() => resolve(\"done!\"), 1000)\n });\n\n let result = await promise; // wait until the promise resolves (*)\n\n return (result); // \"done!\"\n}", "title": "" }, { "docid": "055d720c69e638cff082fd787336d21b", "score": "0.5889553", "text": "async function doWork() {\n try {\n const response = await makeRequest(\"Facebook\"); // create an error by using anything but \"Google\"\n console.log(\"Response Recieved\");\n const processedResponse = await processRequest(response);\n console.log(processedResponse);\n } catch (err) {\n console.log(err);\n }\n}", "title": "" }, { "docid": "ac9fcf359e07a48ac8cf17371397fd2d", "score": "0.5869299", "text": "async function tuyvo() {\n var pro = await promiseResolve('mum.edu');\n console.log(pro);\n}", "title": "" }, { "docid": "b77c811bf2406873d0fe834dcbfbe268", "score": "0.5861815", "text": "promise() {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n return yield this.call();\n }\n catch (error) {\n return Promise.reject(error);\n }\n });\n }", "title": "" }, { "docid": "8a60e9a61d9686895b54e844ade70961", "score": "0.5852372", "text": "async function firstAsync() {\n let promise = new Promise((res, rej) => {\n TVDBapi.getSeries('ABCiee Working Diary');\n });\n\n // wait until the promise returns us a value\n let result = await promise; \n \n // \"Now it's done!\"\n console.log(result); \n}", "title": "" }, { "docid": "fa433ab3c62ec63389659c293eec41dd", "score": "0.5847354", "text": "async function f1(){\n let promise = new Promise((resolve, reject) =>{\n setTimeout( () => resolve(`done!`), 1000);\n });\n let ret = await promise; // resolve가 끝나길 기다림\n console.log(ret);\n }", "title": "" }, { "docid": "bd0800f6ad4e9ff459e9a5e46ab68a88", "score": "0.58434904", "text": "async function someValue() {\n let obj = new Promise((resolve, reject) => {\n setTimeout(() => {\n resolve(\"resolve is done\");\n }, 2000);\n });\n let result = await obj;\n console.log(result);\n}", "title": "" }, { "docid": "b76c7166eef9de17f34bf6b209dfa90f", "score": "0.5839505", "text": "async function findSomethingToDrink() {\n try {\n await drink('coffee');\n } catch (error) {\n console.error(error); // output: Error: I want to drink a Coke (with a tracing stack for debugging purpose)\n }\n}", "title": "" }, { "docid": "34ab68149bef98a27a6ad98054285a2c", "score": "0.5832566", "text": "async function writeStuffInOrder() {\n console.log(\"in the async function\");\n try {\n const promiseResult = await makeADecisionLater3(); // await keywork MUST be used in a function decorated with the async keyword\n console.log(\"1 >>>>\", promiseResult);\n } catch (err) {\n console.error(\"2 >>>>\", err);\n }\n}", "title": "" }, { "docid": "a03850d9372d3a5c73c817d58c0b447d", "score": "0.58291215", "text": "async function myFn(){\n await console.log('testing');\n}", "title": "" }, { "docid": "abc5aa4a110399049a01c317bb15b7e2", "score": "0.5825445", "text": "async afunc() {}", "title": "" }, { "docid": "3f92a59df844e21509a8f17d0558230d", "score": "0.58181816", "text": "function awaitify(asyncFn, arity = asyncFn.length) {\n if (!arity) throw new Error(\"arity is undefined\");\n function awaitable(...args) {\n if (typeof args[arity - 1] === \"function\") {\n return asyncFn.apply(this, args);\n }\n\n return new Promise((resolve, reject) => {\n args[arity - 1] = (err, ...cbArgs) => {\n if (err) return reject(err);\n resolve(cbArgs.length > 1 ? cbArgs : cbArgs[0]);\n };\n asyncFn.apply(this, args);\n });\n }\n\n return awaitable;\n }", "title": "" }, { "docid": "a44e4383a36d36ecd2c7028310f29bb2", "score": "0.58177227", "text": "async function doFetch() {\n\n let waiting_copy;\n\n try {\n\n try {\n\n value = await fetchOperation();\n if (value === undefined) {\n throw Error(\"fetch returned undefined value\");\n }\n\n }\n finally {\n // Copy array and clear existing,\n waiting_copy = [...waiting];\n waiting.length = 0;\n }\n\n // Send out responses to any promises waiting,\n for (const p of waiting_copy) {\n p.resolve(value);\n }\n\n }\n catch (err) {\n\n // Send out rejections to any promises that are waiting,\n for (const p of waiting_copy) {\n p.reject(err);\n }\n\n }\n\n }", "title": "" }, { "docid": "4c8b758b1efa2e3e1b405e8f70f9c32e", "score": "0.5811034", "text": "async function f3() {\n\n\ttry {\n\t\tlet response = await fetch('http://no-such-url');\n\t} catch (err) {\n\t\tconsole.error(err); // TypeError: failed to fetch\n\t}\n}", "title": "" }, { "docid": "f36808ff382d4acd2e93352365a818b6", "score": "0.58078843", "text": "function awaitify (asyncFn, arity = asyncFn.length) {\n if (!arity) throw new Error('arity is undefined')\n function awaitable (...args) {\n if (typeof args[arity - 1] === 'function') {\n return asyncFn.apply(this, args)\n }\n\n return new Promise((resolve, reject) => {\n args[arity - 1] = (err, ...cbArgs) => {\n if (err) return reject(err)\n resolve(cbArgs.length > 1 ? cbArgs : cbArgs[0]);\n };\n asyncFn.apply(this, args);\n })\n }\n\n return awaitable\n }", "title": "" }, { "docid": "d23d378f7d752507a62d75f1efd1136b", "score": "0.5804037", "text": "function testMsgAsync2() {\n return Promise.resolve('Hello World!');\n}", "title": "" }, { "docid": "96ef93dd2041fda45cacf5a91b19e936", "score": "0.5798318", "text": "attempt(fn){\n return new Promise(resolve=> {\n // Fixme, add the retry logic back in\n resolve(fn)\n })\n }", "title": "" }, { "docid": "62235f444d2b7b9630bec69c17da25c1", "score": "0.5778366", "text": "function async(makeGenerator) {\n var generator = makeGenerator.apply(this, arguments);\n\n function handle(result){\n\n if (result.done) return Promise.resolve(result.value);\n\n return Promise.resolve(result.value).then(function (res){\n return handle(generator.next(res));\n }, function (err){\n return handle(generator.throw(err));\n });\n }\n\n try {\n return handle(generator.next());\n } catch (ex) {\n return Promise.reject(ex);\n }\n}", "title": "" }, { "docid": "b76d65ad86f426d92ce1dc5e386d455b", "score": "0.5776621", "text": "async function getPromiseVal() {\n const returnVal = await promiseValue('wait for it...', 1000);\n console.log(`[post-await]: awaited promise value is ${returnVal}`);\n return returnVal;\n}", "title": "" }, { "docid": "9ae1e6d31822108f7bda5d32ae8f285d", "score": "0.5745266", "text": "async function cobaAsync() {\n try {\n const coba = await cobaPromise();\n console.log(coba);\n } catch (err) {\n console.error(err);\n }\n}", "title": "" }, { "docid": "79c29d67bc2ef8e4a9f51c2b3fccda0d", "score": "0.57404953", "text": "async method(){}", "title": "" }, { "docid": "746e10478dd5ac49d73a7482b7dd0456", "score": "0.5724731", "text": "async function asyncFunction() {\n let value = await doAsyncTask(); // instead of .then you await the function that returns a promise\n let value2 = await doAsyncTask();\n console.log(\"val2\", value2);\n console.log(\"val\", value); // waits before printed.\n}", "title": "" }, { "docid": "1a5f2b3b48e459c399273b94aeab5e28", "score": "0.5715487", "text": "async function fetchData(url){\n return await fetch(url)\n .then(resp => resp.json())\n .then(data => data.results)\n .catch(error => console.log('Some problem. Cant resole the request', error))\n}", "title": "" }, { "docid": "bf972a16f210d7b82c1922b021d17b15", "score": "0.57154757", "text": "async function net() {\n // When I say go, be ready to throw!\n\n // GO!\n throw net();\n}", "title": "" }, { "docid": "4856bdd430196af30eb731adcbb2bf20", "score": "0.57036775", "text": "async function myasync(){\r\n let resp = await getRandomNumber() ;\r\n console.log(resp) ;\r\n\r\n}", "title": "" }, { "docid": "01442264cd3140fa03cdc9201db75fe1", "score": "0.5688299", "text": "async function fetchUser(){ //* 함수 앞에 async => Promise로 자동변환 \n return 'Jisoo'; \n}", "title": "" }, { "docid": "cd009d42c2854094e3e6b3295243f971", "score": "0.5680216", "text": "async function asyncFuncFullfilled() {\n return 123; // (A)\n}", "title": "" }, { "docid": "a7a74ea59e20f166823700fecef05a9c", "score": "0.56799686", "text": "function asyncFunc() {\n return new Promise((resolve, reject) => {\n setTimeout(() => resolve('DONE'), 100);\n });\n}", "title": "" }, { "docid": "db8f4d21ddc51e80d561c90ddfdf9b74", "score": "0.566983", "text": "function asyncCode(resolve, reject){\n setTimeout(() => resolve({shots: 2}), 1000 );\n}", "title": "" }, { "docid": "640d6627001ca82379182563f2492b78", "score": "0.56635535", "text": "function evaluatePromiseAsync(promise) {\n return __awaiter(this, void 0, void 0, function () {\n var _a, e_1;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n _b.trys.push([0, 2, , 3]);\n _a = Value.bind;\n return [4 /*yield*/, promise];\n case 1: return [2 /*return*/, new (_a.apply(Value, [void 0, _b.sent()]))()];\n case 2:\n e_1 = _b.sent();\n return [2 /*return*/, new ErrorMessage(e_1.message)];\n case 3: return [2 /*return*/];\n }\n });\n });\n}", "title": "" }, { "docid": "233a1ea9a4fe7cd9a8a6e2851d8a5b91", "score": "0.5658118", "text": "function awaitify(asyncFn, arity = asyncFn.length) {\n if (!arity) throw new Error('arity is undefined');\n function awaitable(...args) {\n if (typeof args[arity - 1] === 'function') {\n return asyncFn.apply(this, args);\n }\n\n return new Promise((resolve, reject) => {\n args[arity - 1] = (err, ...cbArgs) => {\n if (err) return reject(err);\n resolve(cbArgs.length > 1 ? cbArgs : cbArgs[0]);\n };\n asyncFn.apply(this, args);\n });\n }\n\n return awaitable;\n}", "title": "" }, { "docid": "ffba31db80d45e26a66c01bf9a9e5761", "score": "0.56504196", "text": "function doAsync() {\n return new Promise(function (resolve, reject) {\n console.log(\"in promise code\");\n setTimeout(function () {\n console.log(\"resolving...\");\n resolve(\"OK\");\n }, 2000);\n });\n}", "title": "" }, { "docid": "864b676e95aecf547c6234ac37310dd7", "score": "0.56466407", "text": "async function contrived1() {\n var y = await 20;\n log('contrived1', y); // 20\n}", "title": "" }, { "docid": "0d3e4c0d4df76fa27c26e4f363a91e92", "score": "0.56459105", "text": "async function myFunctionTwo() {\n return Promise.resolve(1);\n}", "title": "" }, { "docid": "57dc605fb39d0f02a3d201aac1a038b4", "score": "0.56362575", "text": "handlePromiseRejections() {\n const unhandledRejections = [];\n process.on('unhandledRejection', (reason, promise) => {\n const unhandledPromiseId = unhandledRejections.push(promise);\n this.log.debug(`UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: ${unhandledPromiseId}): ${reason}`);\n });\n process.on('rejectionHandled', (promise) => {\n const unhandledPromiseId = unhandledRejections.indexOf(promise) + 1;\n this.log.debug(`PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: ${unhandledPromiseId})`);\n });\n }", "title": "" }, { "docid": "dc7daa8eb6f76ccd8f64c6e3672a9c7b", "score": "0.56265396", "text": "function doSomethingAsync(person) {\n return Promise.resolve(person);\n}", "title": "" }, { "docid": "370c034e80b01ccf0275acb68a7e579a", "score": "0.5625614", "text": "async function executar() {\n await esperarPor(2000);\n console.log('Async/Await 1...');\n\n await esperarPor(2000);\n console.log('Async/Await 2...');\n\n await esperarPor(2000);\n console.log('Async/Await 3...');\n}", "title": "" }, { "docid": "26b7380e4d5fd41a32297a6df1d2e170", "score": "0.56232214", "text": "function asyncHelper(callback){\n return async(req, res, next) => {\n try {\n await callback(req, res, next)\n } catch(error){\n res.status(500).json({ message: error.message });\n }\n }\n}", "title": "" }, { "docid": "69a719766641e53f376144b508dae566", "score": "0.5620524", "text": "async function foo() {}", "title": "" }, { "docid": "717fea135f3a53c9cbb5d4f385d0fd1b", "score": "0.5611266", "text": "catch(t) {\n return this._taskCompletionResolver.promise.catch(t);\n }", "title": "" }, { "docid": "fad248e5c1feebb092a4b66436622708", "score": "0.560642", "text": "async function executar() {\n await esperar(2000)\n console.log('Async/await 1...')\n await esperar(2000)\n console.log('Async/await 2...')\n await esperar(2000)\n console.log('Async/await 3...')\n}", "title": "" }, { "docid": "af1a5ebd43186d53227c9d68ddc9c118", "score": "0.5605684", "text": "async function callMyPromise (){\n\n const message = await myPromise();\n\n console.log(message);\n\n // myPromise().then(message => console.log(message));\n}", "title": "" }, { "docid": "1a4220fe778c23f4b8624a9d37aa2ab3", "score": "0.5605647", "text": "async function fetchUser(){\n // return new Promise((resolve, reject)=>{\n // //do network request in 10secs...\n // resolve('thisis');\n // })\n return 'thsis';\n}", "title": "" }, { "docid": "e6a8b7a5fc43cdd2f01ee892de29a2e7", "score": "0.5605166", "text": "static async method(){}", "title": "" } ]
b8916db9046bc8115fe458f5ed7e0f88
simple class the "Employee" function used here to define the class is called the constructor function
[ { "docid": "2ac8571d907f68b733ee96b13dd5a3d6", "score": "0.77861685", "text": "function Employee() {\n this.fname = \"\";\n this.lname = \"\";\n this.getName = function(){\n \treturn this.fname+' ' +this.lname;\n }\n}", "title": "" } ]
[ { "docid": "85a9a6f98c812b2c8b3c3513162b4cca", "score": "0.8268099", "text": "function Employee(name){this.name=name;}", "title": "" }, { "docid": "6cfb7d6fe6554542a04129521553edc6", "score": "0.81458527", "text": "function Employee(name,age,salary){\n // this.name = name; // Burada name ve age aslinda person objesinden alinabilir.\n // this.age = age; // bu islemi bir onceki konuda bahsi gecen call/apply ile ele alabiliriz :\n Person.call(this,name,age);\n this.salary = salary;\n}", "title": "" }, { "docid": "0e0eb9ba491b1fe23a4c29f8bb4f4491", "score": "0.8064551", "text": "function Employee(fName, lName, eId) {\n Person.call(this, fName, lName)\n this.empId = eId\n}", "title": "" }, { "docid": "6cf05c3809aa341934f34b4e74e27588", "score": "0.80470973", "text": "function Employee(name,age,salary){\n this.name = name;\n this.age = age;\n this.salary = salary;\n}", "title": "" }, { "docid": "fa43137b552ed3431f4d2a881a8b2d42", "score": "0.79408216", "text": "function Employee(name, address, designation, department) {\n\n this.name = name;\n this.address = address;\n this.designation = designation;\n this.department = department;\n\n}", "title": "" }, { "docid": "7119af2ba4b157d95b0d9cab76287fe8", "score": "0.79122126", "text": "function Employee(name) {\n this.name = name;\n }", "title": "" }, { "docid": "c1c32a67e11a0da6d6de3b70c5e494c2", "score": "0.7911818", "text": "function Employee(name) {\r\n this.employeeName = name;\r\n }", "title": "" }, { "docid": "00ce0dfd69ed634430b7c4267d8c0e23", "score": "0.79024374", "text": "function Employee(name) {\n this.employeeName = name;\n }", "title": "" }, { "docid": "9fe7ef57e26693a6750c45d9c2ba041b", "score": "0.7865025", "text": "function Employee(name) {\n this.name = name;\n this.age = 21;\n this.location = \"New York\";\n this.empID = 12345;\n}", "title": "" }, { "docid": "6358e465c250801af578f5be67e00383", "score": "0.7851733", "text": "function Employee (name, age, sex) {\n this.name = name;\n this.age = age;\n this.sex = sex; \n}", "title": "" }, { "docid": "4c15ef0483e5c493d87a4a5342b57185", "score": "0.7849664", "text": "function Employee () {\r\nthis.name = \"\";\r\nthis.dept = \"general\";\r\n}", "title": "" }, { "docid": "9a81bc0e83c7378e82ff23348fbbd7e6", "score": "0.7837366", "text": "function employee(name, jobtitle, born) {\n this.name = name;\n this.jobtitle = jobtitle;\n this.born = born;\n}", "title": "" }, { "docid": "df0798ce2b116fd1584a6b692e8d12a3", "score": "0.7808784", "text": "function Employee(eID,fName,lName,eTitle){\n this.id = eID;\n this.firstName = fName;\n this.lastName = lName;\n this.title = eTitle;\n}", "title": "" }, { "docid": "e9534d670aa552073d682ca7998052c6", "score": "0.7778353", "text": "function Employee () {\n this.name = 'Paul';\n this.salary = 0;\n}", "title": "" }, { "docid": "b8c49046b8cc62ea6933ea403de95c6a", "score": "0.77760494", "text": "function employee(id, name) { \n this.id = id; \n this.name = name; \n}", "title": "" }, { "docid": "a67ae382e1354fa88492f3f4ca8d0663", "score": "0.7772794", "text": "function Employee(id,salary,name){\n this.id = id;\n this.name = name;\n this.salary = salary;\n}", "title": "" }, { "docid": "6e850603990bdd60bf4371659cc390fd", "score": "0.77725637", "text": "function Employee (name1, name2) {\n\tthis.firstName = name1;\n\tthis.lastName = name2;\n\tthis.department = \"\";\n this.job = \"\";\n}", "title": "" }, { "docid": "9b6148e29a7d05c2c096ce90d95d45e1", "score": "0.77693415", "text": "function Employee(name) {\n this.name = name\n}", "title": "" }, { "docid": "fe75924e7e6c00a9d159f78542b42008", "score": "0.76047117", "text": "function employee(id, firstName, lastName, title) {\n this.id = id,\n this.firstName = firstName;\n this.lastName = lastName;\n this.title = title;\n\n \n }", "title": "" }, { "docid": "cadf931e1e7ab94a42e6677d20ec4db7", "score": "0.7592493", "text": "function Employee(name, jobTitle, salary) {\n this.name = name;\n this.jobTitle = jobTitle;\n this.salary = salary;\n this.status = \"full-time\";\n//a method to log the current employee object to the console\n this.printEmployeeForm = function() {\n console.log (this)\n }\n//a method to ad a new array element containing the new employee object\n this.add = function() {\n employees.push(this);\n }\n}", "title": "" }, { "docid": "2826c225c617ddfd48464f6be464a180", "score": "0.7537859", "text": "function Employee(salary){ \n this.salary = salary;\n}", "title": "" }, { "docid": "f711b5d0a4b4c418df101162d61cadf3", "score": "0.75260633", "text": "function employee (first, last, title) {\n this.first = first,\n this.last = last,\n this.title = title\n}", "title": "" }, { "docid": "bf1b009c834c5e2ccae179356957e038", "score": "0.75144887", "text": "function employee(id, name, address){\r\n\tthis.eId = id;\r\n\tthis.eName = name;\r\n\tthis.eAddress = address;\r\n}", "title": "" }, { "docid": "ef49a63ca1ff2981397d1ebab7e38265", "score": "0.74644226", "text": "function Employee(id, firstName, lastName, title) {\n\n this.id = id;\n\n this.firstName = firstName;\n\n this.lastName = lastName;\n\n this.title = title;\n\n}", "title": "" }, { "docid": "db5d3c11df5330626b294861949d8450", "score": "0.7431057", "text": "function Employee() {\n this.name = faker.name.firstName();\n this.designation = faker.name.jobTitle();\n this.company = \"Contenstack\";\n}", "title": "" }, { "docid": "c2c55305144aa5be0ab429366f6933e1", "score": "0.74138343", "text": "function Employee(id, firstName, lastName, title) {\n this.id = id;\n this.firstName = firstName;\n this.lastName = lastName;\n this.title = title;\n}", "title": "" }, { "docid": "c2c55305144aa5be0ab429366f6933e1", "score": "0.74138343", "text": "function Employee(id, firstName, lastName, title) {\n this.id = id;\n this.firstName = firstName;\n this.lastName = lastName;\n this.title = title;\n}", "title": "" }, { "docid": "0dd4305aee33258d727641ffec022e14", "score": "0.7407528", "text": "function emp(){this.name=\"Amir\", this.id=101}", "title": "" }, { "docid": "d43192d8d4804e9b239c75a09db1d911", "score": "0.73954993", "text": "constructor(name, id, email, school) {\n super(name, id, email); // utiliza las propiedades de Employee llamando el constructor de Employee primero\n this.school = school\n }", "title": "" }, { "docid": "f0733851e544f27e58a630425f4d7b67", "score": "0.73770535", "text": "function Employee(firstName, lastName, email) {\n this.firstName = firstName;\n this.lastName = lastName;\n this.email = email;\n }", "title": "" }, { "docid": "4311e213213fe608a87cb1bc1cd8deb3", "score": "0.73716724", "text": "constructor(empName,age,designation){\n this.empName = empName;\n this.age = age;\n this.designation = designation;\n }", "title": "" }, { "docid": "6366fc45f293f050a888ffc12362b6a4", "score": "0.735794", "text": "function employee (id, firstName, lastName, title) {\n this.id = id;\n this.firstName = firstName;\n this.lastName = lastName;\n this.title = title;\n}", "title": "" }, { "docid": "07ba76a9f5b9601a5150e35e80aca5c5", "score": "0.7340036", "text": "function Employee(id, firstName, lastName, title) {\r\n this.id = id;\r\n this.firstName = firstName;\r\n this.lastName = lastName;\r\n this.title = title;\r\n}", "title": "" }, { "docid": "f843f1f65d75440cba07da15a6524760", "score": "0.7334018", "text": "constructor(name, id, email, school){\n // Calls the employee constructor plus add Intern Role\n super(name, id, email, 'Intern');\n // Adds call for School \n this.school = school;\n }", "title": "" }, { "docid": "448774c23ccc8054cc3b2231c42fea14", "score": "0.7331818", "text": "function EmployeeObject(firstName,lastName,age){\n\tthis.firstName = firstName;\n\tthis.lastName = lastName;\n\tthis.age = age;\n}", "title": "" }, { "docid": "6334b8b1df0aa958c7bc69ef7754a6b4", "score": "0.7328123", "text": "function Employee(id,name,salary){\n\tvar _id = id,\n\t\t_name = name,\n\t\t_salary = salary;\n\n\tthis.id = function(){\n\t\treturn _id;\n\t};\n\tthis.name = function(val){\n\t\tif (typeof val === \"undefined\") return _name;\n\t\tif (val !== \"\") _name = val;\n\t\treturn _name;\n\t};\n\n\tthis.salary = function(val){\n\t\tif (typeof val === \"undefined\") return _salary;\n\t\tif (val > _salary) _salary = val;\n\t\treturn _salary;\n\t}\n}", "title": "" }, { "docid": "9047e464afa4f159321a59537ef0aba3", "score": "0.7328055", "text": "constructor(name, id, email, school) {\n\n // super is calling the Employee.js so you don't have to this.name/id/school\n super(name, id, email);\n\n // getSchool()= school;\n this.school = school;\n }", "title": "" }, { "docid": "ed6f3d8b6d490a1a1f80dedf269317d4", "score": "0.7324068", "text": "function employee(medID, name){\n this.medID = medID;\n this.name = name;\n}", "title": "" }, { "docid": "7190956ed49b98d4a70ad02f5f5dacab", "score": "0.7308733", "text": "constructor (name, id, email, github) {\n\n //add super as a requirement for the extended class, which contains the Employee parameters\n super(name, id, email);\n\n //set property specific to Engineer class\n this.github = github;\n }", "title": "" }, { "docid": "68c7389b27b418589e87907fb2326367", "score": "0.7300806", "text": "function newEmployee(firstName, lastName, idNum, title, salary) {\n let employee = new Employee(firstName, lastName, idNum, title, salary);\n employees.push(employee);\n // return employee;\n} // end newEmployee", "title": "" }, { "docid": "8f40d2a737d0a7d1fbee84b7137d278b", "score": "0.7283219", "text": "function Employee(firstName, lastName, id) {\n this.firstName = firstName;\n this.lastName = lastName;\n this.id = id;\n this.getFullName = function() {\n return `${this.firstName} ${this.lastName}`; \n }\n this.getId = function() {\n return id;\n }\n}", "title": "" }, { "docid": "8a9ac3b08dbb6a4c23e5022e707ce3fc", "score": "0.7272218", "text": "function Employee(firstName, lastName, empNum, jobTitle, reviewScore, salary) {\n this.firstName = firstName;\n this.lastName = lastName;\n this.empNum = parseInt(empNum);\n this.jobTitle = jobTitle;\n this.reviewScore = parseInt(reviewScore);\n this.salary = parseInt(salary);\n}", "title": "" }, { "docid": "65800eb3cb08977f75f84a618590ec08", "score": "0.72616154", "text": "constructor(name, id, email, role, officeNumber) {\n //add constructor from parent 'Employee' object with office number\n super(name, id, email, role);\n\n this.officeNumber = officeNumber;\n }", "title": "" }, { "docid": "140075fbb97846321af4cf1451ae553b", "score": "0.7184023", "text": "function Employee(name, age) {\n this.name = name;\n this.age = age;\n this.getDetails = function () {\n return `Hi, My name is ${this.name}. I am ${this.age} years old`;\n }\n}", "title": "" }, { "docid": "7e9f65c6242588ec0bd5eebcff1b16b0", "score": "0.7163747", "text": "constructor(name, id, email, github){\n // Call the properties and methods from Employee\n super(name, id, email);\n // Github Property\n this.github = github;\n }", "title": "" }, { "docid": "49d3236477e328ce17c0650f08300d15", "score": "0.71604174", "text": "function Employee(firstName, lastName, department) {\n\t\tthis.firstName = firstName;\n\t\tthis.lastName = lastName;\n\t\tthis.department = department;\n\t\tthis.hireDate = new Date();\n\t\t\n\t\tthis.getName = function() {\n\t\treturn this.firstName + ' ' + this.lastName;\n\t\t};\n\t\t\n\t\tthis.toString = function() {\n\t\treturn 'Name: ' + this.firstName + ' ' + this.lastName + '\\nDepartment: ' + this.department;\n\t\t};\t\n}", "title": "" }, { "docid": "065deec86ecccf84048594447e27a64a", "score": "0.71211016", "text": "function Emp4(cNo,cName,cSal,cDeptNo){\n this.cNo=cNo;\n this.cName=cName;\n this.cSal=cSal;\n this.cDeptNo=cDeptNo;\n }", "title": "" }, { "docid": "7d243366e2379f186d367702506bad9a", "score": "0.7095635", "text": "function printEmployee() {\n if (roleEmployee === \"Manager\") {\n //Manager constructor\n let printEmployee = new Manager(nameEmployee, idEmployee, emailEmployee, bonusRoleEmployee)\n //Manager constructor pushed to the employees array\n employees.push(printEmployee)\n } else if (roleEmployee === \"Intern\") {\n //Intern constructor\n let printEmployee = new Intern(nameEmployee, idEmployee, emailEmployee, bonusRoleEmployee)\n //Intern constructor pushed to the employees array\n employees.push(printEmployee)\n } else {\n //Engineer constructor\n let printEmployee = new Engineer(nameEmployee, idEmployee, emailEmployee, bonusRoleEmployee)\n //Engineer constructor pushed to the employees array\n employees.push(printEmployee)\n }\n }", "title": "" }, { "docid": "79d851afd75bee813d8229156d4c1d51", "score": "0.7085793", "text": "constructor(name) {\n this.name = name\n this.employees = []\n }", "title": "" }, { "docid": "5cd436167edc2dd2ac26f33c7469e524", "score": "0.69589067", "text": "function Employee ( name, dept ) {\r\nthis.name = name || \"\";\r\nthis.dept = dept || \"general\";\r\n}", "title": "" }, { "docid": "fd5eace57be4c0392ee16fc7f45a75a3", "score": "0.6954482", "text": "constructor(name, age, designation){\n //all props defined as they were in the constructor function\n this.name = name;\n this.age = age;\n this.designation = designation;\n //inside methods\n this.displayName = function (){\n console.log(\"Name of emplyee is \", this.name)\n }\n }", "title": "" }, { "docid": "391a7e969dd8ee8ec96a1bbce1cde01a", "score": "0.6951198", "text": "function Intern(name, id, email, school) {\n //calls the super class and instantiates constructor variables - INHERITANCE\n Employee.call(this, name, id, email);\n //instantiates school variable\n this.school = school;\n}", "title": "" }, { "docid": "8c04ea2cc9178fa13bf81046ea0f2ab3", "score": "0.69295037", "text": "function createEmployee(name=\"Patrick\", id=8, email=\"patrick@email.com\") {\n return new Employee (name, id, email);\n}", "title": "" }, { "docid": "ee776a527cb07eeda83a5aa95ef3288c", "score": "0.6927276", "text": "function Employee(){\n console.log(this.id);\n}", "title": "" }, { "docid": "5cb18afb3092a62e261c96d0d2a4f6ed", "score": "0.6924323", "text": "constructor(firstName, lastName){ //The constructor method is a special method for creating and initializing an object created within a class.\n\t this.firstName = firstName;\n\t this.lastName = lastName;\n\t }", "title": "" }, { "docid": "3822235a6f6bfe8e74cdd252c4095658", "score": "0.6919625", "text": "function EmpDetails(name, salary, dept) {\r\n this.name = name;\r\n this.salary = salary;\r\n this.dept = dept;\r\n }", "title": "" }, { "docid": "7fda138918b4a827f434861679f0b18a", "score": "0.6906301", "text": "constructor(name, id, email, gitHub){\n // Calls the employee constructor plus add engineer role\n super(name, id, email, 'Engineer');\n // Adds call for GitHub account\n this.gitHub = gitHub;\n }", "title": "" }, { "docid": "290e10df135ffa5e2e132ff462ce0dd7", "score": "0.68832153", "text": "function Programer(nanem, salary, experiance, role) {\n Employee.call(this,name,salary,experiance);\n this.role = role;\n}", "title": "" }, { "docid": "299967d155d6cfe0493f30c1fdb7484d", "score": "0.68823427", "text": "constructor(name, id, email) {\n this.name = name;\n this.id = id;\n this.email = email;\n // default role/title is Employee to start, can change\n this.title = \"Employee\";\n }", "title": "" }, { "docid": "a29b0242d5fa991274b0a4c827c4a2e9", "score": "0.6861628", "text": "function Programmer(name,salary,experience,language){\n Employee.call(this, name,salary,experience);\n this.language = language;\n}", "title": "" }, { "docid": "73a0cccaccffb6992ef453e51dea3d85", "score": "0.67024773", "text": "constructor(id, name) {\n this.id = id;\n this.name = name;\n // private readonly id: string; // Leaving uncommented just to show\n // name: string; // What shorthand does automatically\n this.employees = []; // You can initialize a field this way\n // this.id = id; // Leaving in commented out to show what shorthand\n // this.name = name // does for us automatically\n }", "title": "" }, { "docid": "69b6dd164096c65850cde8c4a8234407", "score": "0.67008466", "text": "function createEmployeeObj(name, age) {\n const emp = {};\n emp.name = name;\n emp.age = age;\n emp.getDetails = function () {\n return `Hi, My name is ${emp.name}. I am ${emp.age} years old`;\n }\n return emp;\n}", "title": "" }, { "docid": "390ab99312cb05f394746e597ca3b335", "score": "0.6683349", "text": "create(name) {\n return new Employee(name);\n }", "title": "" }, { "docid": "997c3236951850c2388bf1298db9d219", "score": "0.66173726", "text": "constructor(name, lname, email, sub1, sub2, employ, gpa){\n name = this.name;\n lname = this.lname;\n email = this.email;\n sub1 = this.sub1;\n sub2 = this.sub2;\n employment = employ;\n gpa = this.gpa;\n }", "title": "" }, { "docid": "672321d03965ed35ce6e30231e72901f", "score": "0.6606842", "text": "constructor(name, id, email) {\n this.name = name;\n this.id = id;\n this.email = email;\n\n if (this.title === undefined) {\n this.title = \"Employee\";\n };\n }", "title": "" }, { "docid": "c32dc09c59e8bc954a754f6ab937a5d7", "score": "0.65852445", "text": "function create_employee() {\n\t\n\tvar new_obj = {} ;\n\tnew_obj.firstname = \"mohit\" ;\n\tnew_obj.lastname = \"anand\" ;\n\tnew_obj.gender = \"male\" ;\n\treturn new_obj; \t\n }", "title": "" }, { "docid": "649abece46020f0a44b783ea7f16e2f0", "score": "0.6578328", "text": "function Employee(id, name){\n\n this.id = id;\n this.name = name;\n\n this.display = function(){\n document.write(\"<br/> Id is \" + this.id);\n document.write(\"<br/> Name is \" + this.name);\n }\n //normal function to access emp id\n //can't access within normal function \n // if you want to access use keyword\n var that = this;\n function dis(){\n document.write(\"<br/> ID is \" + that.id);\n }\n dis();\n //can use this keyword\n var dis1=()=>document.write(\"<br/> Id in arrow function \" + this.id );\n dis1();\n}", "title": "" }, { "docid": "3871b40d21fbbf083547d1be5d568215", "score": "0.65461", "text": "constructor(firstName, lastName, year){ //special method used to instantiate new instances\n this.firstName = firstName;\n this.lastName = lastName;\n this.grade = year;\n //this refers to the individual instance of the class\n }", "title": "" }, { "docid": "a8b7382f572f438a2e80e174efcd6f15", "score": "0.65334636", "text": "function People(empName, empNumber, empSalary, empRating){\n\n this.name = empName;\n this.id = empNumber;\n this.salary = empSalary;\n this.rating = empRating;\n this.validate = function(){\n\n if (this.name == undefined){\n this.name = \"name not entered\"\n }\n if (this.id == undefined){\n this.id = \"id not entered\"\n }\n if (this.salary == undefined){\n this.salary = \"salary not entered\"\n }\n if (this.rating == undefined){\n this.rating = \"rating not entered\"\n }\n\n }\n \n\n\n\n}", "title": "" }, { "docid": "0ec4731f0a5b63fc23332c95cea1337d", "score": "0.6510971", "text": "constructor(name, employees) {\n this.name = name\n this.employees = employees\n\n if (typeof Office.instance === \"object\") {\n return Office.instance\n\n }\n\n Office.instance = this\n return this\n\n }", "title": "" }, { "docid": "3890ae91273ed6be88fd89a796c69be6", "score": "0.64521897", "text": "function generateEmployee() {\n var firstName = Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 5); // Generate random firstName\n var lastName = Math.random().toString(36).replace(/[^a-z]+/g, ''); // Generate random lastName\n var empNum = Math.floor((Math.random() * 1000) + 1); // Generate random empNum\n var jobTitle = 'Randomly Generated'; // Generate static jobTitle\n var reviewScore = Math.floor((Math.random() * 5) + 1); // Generate random reviewScore(1-5)\n var salary = Math.floor((Math.random() * 100000) + 1); // Generate random salary\n\n // Create random Employee object from generated values, and push it to the employeeArrray\n employeeArray.push(new Employee(firstName, lastName, empNum, jobTitle, reviewScore, salary));\n updateEmployeeCost(); // Recalculate the total labor expence\n redrawArray(); // Redraw the employeeArray\n}", "title": "" }, { "docid": "2339bbb05fedc9398be59675335e81f9", "score": "0.64111716", "text": "constructor(name, age, gender, school, salary) {\n super(name, age, gender);\n this.school = school;\n this.salary = salary;\n }", "title": "" }, { "docid": "e00c45e61ddbdbe920b8c06196480fdc", "score": "0.63945955", "text": "function Factory() {\n let employee;\n this.createEmployee = function (type) {\n if (type === 'fullTime') {\n employee = new fullTime()\n } else if (type === 'partTime') {\n employee = new partTime()\n }\n employee.type = type\n return employee\n }\n}", "title": "" }, { "docid": "258eed370d6bf6d161252ccaa9022e84", "score": "0.6374594", "text": "constructor(id, name, salary) {\n this.id = id;\n this.name = name;\n this.salary = salary;\n }", "title": "" }, { "docid": "36531cca069eb48e3a35a762a74f5197", "score": "0.6356381", "text": "constructor(name,age,salary) {\n /*this.name = name;\n this.age = age;*/\n// Super anahtar kelimesi SUPERCLASS taki(Person sinifi) bir methodu kullanmak istedigimizi soyler\n //super.showInfos(); // Burada SUPER anahtar kelimesi PERSON sinif adina denk gelir.\n //sadece SUPER anahtar kelimesini tek kullanirsak PERSON sinifinin CONSTRUCTOR methodunu kullanmis oluruz\n super(name,age);\n this.salary = salary;\n }", "title": "" }, { "docid": "0718c9888f76800966cb42d3d49c1887", "score": "0.63560194", "text": "constructor(id, name, salary)\n {\n this.id = id;\n this.name = name;\n this.salary = salary;\n }", "title": "" }, { "docid": "410e934e38394ff371b6db7b32a08260", "score": "0.6326139", "text": "constructor(name, favoriteFood, hoursOfSleep, salary) {\n // \"super\" is a reference to your parant class like \"this\"\n super(name, favoriteFood, hoursOfSleep); // This is IMPORTANT!! We are call the constactor of our paren class\n // the rule is in case when you need to create your constractor and call constructor of your parent class call super at the first place\n // you should call parent constructor before trying to access 'this'\n // Otherwise error: `this is not defined` will happen\n this.salary = salary;\n }", "title": "" }, { "docid": "d5bb62e31ad4ca4907a4e60348da084a", "score": "0.6295245", "text": "constructor(firstName, lastName,occupation,color,description){\n this.firstName = firstName,\n this.lastName = lastName,\n this.occupation = occupation,\n this.color = color,\n this.description = description\n }", "title": "" }, { "docid": "a4ab0374347511184a88813ecc315409", "score": "0.62726456", "text": "function ConstructorFunction(name,email) {\r\n\tthis.name = name;\r\n\tthis.email = email;\r\n\r\n\tconsole.log(this.name , this.email);\r\n\r\n}", "title": "" }, { "docid": "d38366b1c0c176be9910fe2ef080da95", "score": "0.62687844", "text": "constructor(name,age) {\n this.name = name;\n this.age = age;\n }", "title": "" }, { "docid": "3a426bf84753024eb797221c5708b418", "score": "0.62602425", "text": "constructor () {\n\t\tif (this.constructor.name === 'EmployeeFactory') {\n\t\t\tthrow new Error('This is abstract class');\n\t\t}\n\t}", "title": "" }, { "docid": "31ade3509b3f9bcafef4c869a8decad4", "score": "0.6253359", "text": "function init() {\n addEmployee();\n}", "title": "" }, { "docid": "3348d7d936c4fbaaa4bf45b9cb4ab24f", "score": "0.6241852", "text": "function constructor()\n {\n //write your code here\n\n //please note that it is a private function, so you can call the public fields or methods only\n //do the private visiting in the following {}\n }", "title": "" }, { "docid": "3348d7d936c4fbaaa4bf45b9cb4ab24f", "score": "0.6241852", "text": "function constructor()\n {\n //write your code here\n\n //please note that it is a private function, so you can call the public fields or methods only\n //do the private visiting in the following {}\n }", "title": "" }, { "docid": "980e907cebd176d030e3ca3960659e1b", "score": "0.62339574", "text": "constructor (name) { // name and age are arguments given to object at the time of creation of object\n this.name = name; // This initializes the local variable as name passed in argument\n this.college = \"SIES\"; // We want the College to be same for all students that's why it is declared outside of constructor\n }", "title": "" }, { "docid": "129859c916e53627c79aae7bae1b2b99", "score": "0.62337494", "text": "function newConstructor (name , age){\n this.name = name;\n this.age = age;\n this.introduce =function() {\n console.log(`Hello , my name is ${this.name}. I am ${this.age} years old`)\n }\n}", "title": "" }, { "docid": "4cb76d4f3b1adea1b4727751f6ad8a1c", "score": "0.62135464", "text": "function createInstance() {\n //private methods and variables\n\n /*This private variable starts empty but is populated with the result of the LoadAndParseJSON() call.\n * If CollectAllEmployees() is called before LoadAndParseJSON(), the CollectAllEmployees() method will\n * first call the LoadAndParseJSON() method and store the result in this variable.\n * */\n var privateJSONObject='';\n\n //private method that serves a final check on the CollectAllEmployeesArray to make sure\n function privateRemoveDuplicatesAndUndefineds(employees){\n var comparisonArray=[];\n var toReturn=[];\n employees.forEach(function (element){\n if(element !=='undefined' && !comparisonArray.indexOf(element.EmployeeID) > -1){\n comparisonArray.push(element.EmployeeID)\n toReturn.push(element)\n }\n });\n return toReturn;\n\n }\n\n //private method that collects all the employees (and managers) recursively and returns as array\n function privateCollectAllEmployeesAux(department){\n if(department.SubDepartments==null){\n var result=[];\n result= result.concat(department.Employees);\n if(department.Manager!=null){\n result = result.concat([department.Manager]);\n }\n return result;\n }else{\n var result=[];\n if(department.Manager!=null){\n result= result.concat([department.Manager]);\n }\n if(department.Employees!=null){\n result=result.concat(Employees)\n }\n department.SubDepartments.forEach(function (subDeparment){\n var toAdd=privateCollectAllEmployeesAux(subDeparment)\n result=result.concat(toAdd);\n });\n return privateRemoveDuplicatesAndUndefineds(result);\n }\n };\n return {\n // Public methods and variables\n\n //Gets JSON file from directory\n LoadAndParseJSON: function () {\n privateJSONObject=require('./iqp_exam (2).json');\n },\n CollectAllEmployees: function () {\n if(typeof (privateJSONObject) =='string'){\n this.LoadAndParseJSON();\n }\n return privateCollectAllEmployeesAux(privateJSONObject);\n }\n };\n }", "title": "" }, { "docid": "be2c131ceeee8f9faa3c6e227ac2f06f", "score": "0.6204627", "text": "function Person1(firstName, lastName, salary) {\n this.firstName = firstName;\n this.lastName = lastName;\n this.salary = salary;\n}", "title": "" }, { "docid": "739f4450100857a2484cbe29d7d51ff6", "score": "0.6195223", "text": "constructor(nm, id, salary) {\n\t\tsuper(nm, id);\n\t\tthis.salary = salary;\n\t}", "title": "" }, { "docid": "870a9f8eadb782ddcecacc6e87efabc7", "score": "0.6192668", "text": "constructor(name, familyName) {\n // properties and functions here are added to\n // each new object created\n this.name = name;\n this.familyName = familyName;\n }", "title": "" }, { "docid": "e7b78f73b5adde6bd725affd217d4f6b", "score": "0.61811954", "text": "constructor(firstName, lastName, age)\n{\n\n this.firstName = firstName\n this.lastName = lastName\n this.age = age\n\n}", "title": "" }, { "docid": "7942310dfcaf34ded07271ac445632fc", "score": "0.6173493", "text": "function employeeInitializer(employee) {\n employee.fullName = ko.computed(function () {\n return employee.firstName() + ' ' + employee.lastName();\n });\n employee.device = ko.observable();\n employee.displayDate = ko.computed(function () {\n return moment(employee.createdDate(), \"YYYY-MM-DD, h:mm a\").format(\"D MMM YYYY\");\n });\n }", "title": "" }, { "docid": "ae28b5816b969dfd6764e5d1deb065ba", "score": "0.61652535", "text": "function PersonConstructor(name, address, age) {\n // Empty object\n // let personObj = {};\n\n // property creation and assignments\n this.name = name;\n this.address = address;\n this.age = age;\n\n // using the above created function object --> getDetails\n this.details = getDetails;\n\n // returns the above created object;\n // return personObj;\n}", "title": "" }, { "docid": "31c3eb1c668e88e02c590e86186eabe9", "score": "0.6158916", "text": "constructor(firstname, lastname) {\n super(firstname, lastname); // call constructor of the prototype\n }", "title": "" }, { "docid": "d247a040b2e79f50ca6bc00d16d73ed5", "score": "0.615439", "text": "function Person( name, age, salary ){\n \n this.name = name;\n\n this.age = age;\n\n this.salary = salary;\n}", "title": "" }, { "docid": "f80d84ce9ce23d7105cbbe3d0295799a", "score": "0.6144027", "text": "constructor(name, age, gender, classes) {//Person object properties are name,age,gender,classes\n this.name; \n this.age = age;\n this.gender = gender;\n this.classes = classes;\n }", "title": "" }, { "docid": "e3dbf11414b24b840ff086809cc20697", "score": "0.61413634", "text": "function Person(name, age) {\n //Assigning values through constructor\n this.name = name;\n this.age = age;\n //functions\n this.sayHi = function() {\n return this.name + \" Says Hi\";\n }\n}", "title": "" }, { "docid": "eb8f0c429c2e12a276fa864fcf1941bf", "score": "0.6135779", "text": "function MakeEmployee(newobject) {\n var new_human = new Employee();\n new_human.firstname = newobject.firstname;\n new_human.lastname = newobject.lastname;\n return new_human;\n}", "title": "" }, { "docid": "52aa27f92efcd6c3255dc818934ae16a", "score": "0.61313707", "text": "constructor(name, age) {\n\n this.name = name;\n this.age = age;\n\n }", "title": "" }, { "docid": "86a3fe3dfe5cb458e19143947be5f1f9", "score": "0.61208856", "text": "constructor(name,age,id)\n {\n this.Name=name;\n this.Age=age;\n this.Id=id;\n }", "title": "" } ]
e8eefb9a52a74ebab564a7729f53b94b
save editor current content to state
[ { "docid": "65076d7410916be2395fcf5f4aaa5e6a", "score": "0.64058226", "text": "onEditorContentChange(content) {\n this.setState({ content });\n }", "title": "" } ]
[ { "docid": "57c4d125b236d05ae823bb9371f1084f", "score": "0.770521", "text": "function save() {\n // Set chrome storage with data\n chrome.storage.local.set({\n editorState:JSON.stringify(element.editor)\n });\n }", "title": "" }, { "docid": "88fddf94d641e74eb34f45ad266e45e6", "score": "0.7523319", "text": "function saveEditorState() {\n\t\t\t// Grab all of the input values for state persistence.\n\t\t\tSCRIBEFIRE.prefs.setCharPref(\"state.entryId\", $(\"#list-entries\").val());\n\t\t\tSCRIBEFIRE.prefs.setCharPref(\"state.title\", $(\"#text-title\").val());\n\t\t\tSCRIBEFIRE.prefs.setCharPref(\"state.content\", editor.val());\n\t\t\tSCRIBEFIRE.prefs.setCharPref(\"state.tags\", $(\"#text-tags\").val());\n\t\t\tSCRIBEFIRE.prefs.setCharPref(\"state.timestamp\",getTimestamp());\n\t\t\tSCRIBEFIRE.prefs.setBoolPref(\"state.draft\", $(\"#status-draft\").val() == \"1\");\n\t\t\tSCRIBEFIRE.prefs.setJSONPref(\"state.categories\", $(\"#list-categories\").val());\n\t\t\tSCRIBEFIRE.prefs.setCharPref(\"state.slug\", $(\"#text-slug\").val());\n\t\t\tSCRIBEFIRE.prefs.setJSONPref(\"state.customFields\", SCRIBEFIRE.getCustomFields(true));\n\t\t\tSCRIBEFIRE.prefs.setCharPref(\"state.excerpt\", $(\"#text-excerpt\").val());\n\t\t\tSCRIBEFIRE.prefs.setBoolPref(\"state.private\", $(\"#checkbox-private\").get(0).checked);\n\t\t\tSCRIBEFIRE.prefs.setCharPref(\"state.editor\", switchEditors.mode);\n\t\t}", "title": "" }, { "docid": "84ef0062541c866f402dcc41ffac7048", "score": "0.7511905", "text": "function save() {\n write(get_editor_filename(), get_editor_content());\n unsaved_changed = false;\n E('editorinfo').innerHTML = 'saved';\n update_profile_list();\n}", "title": "" }, { "docid": "95d98db83ce4ddfb62f8ed1993b07dd9", "score": "0.7324807", "text": "function updateSavedContent(editor, savedContent) {\n editor.ckc.savedContent = savedContent;\n }", "title": "" }, { "docid": "2ea08db90e5cfdae342481e68a07e4ec", "score": "0.6942256", "text": "save() {\n this.tracksCode = this.tracksEditor.getValue();\n localStorage['tracksCode'] = this.tracksCode;\n\n this.app.code = this.sceneEditor.getValue();\n localStorage['appCode'] = this.app.code;\n }", "title": "" }, { "docid": "c1b8f0a56104ffeaf93ef017bbf2b36f", "score": "0.68784", "text": "function save() {\n if (UI.editable !== null) {\n UI.stop_edit();\n }\n\n localStorage.setItem(STATE, serialize(UI.tree));\n}", "title": "" }, { "docid": "d184b062220e21a120a6065b0fb0b359", "score": "0.6873975", "text": "async saveEditor()\n {\n return this.saveQuest();\n }", "title": "" }, { "docid": "d184b062220e21a120a6065b0fb0b359", "score": "0.6873975", "text": "async saveEditor()\n {\n return this.saveQuest();\n }", "title": "" }, { "docid": "ea7bf5759823d53b0fd650e4512d0f4a", "score": "0.6855111", "text": "save(state) {\n const index = this.editor.blocks.getCurrentBlockIndex();\n const activeElement = document?.activeElement;\n this.undoStack.push({\n index,\n state,\n activeElementHTML:\n activeElement.tagName === BODY_TAG_NAME\n ? null\n : activeElement.outerHTML,\n });\n if (this.redoStack.length === 0 && this.undoStack.length === 2) {\n this.undoStack[0].activeElementHTML = activeElement.outerHTML;\n this.undoStack[0].index = index;\n }\n\n if (this.undoStack.length >= this.maxLength) {\n this.truncate(this.undoStack, this.maxLength);\n }\n if (this.redoStack.length >= this.maxLength) {\n this.truncate(this.redoStack, this.maxLength);\n }\n this.onUpdate();\n }", "title": "" }, { "docid": "f8c8f97adc392d8e6bc01ac576fc29d0", "score": "0.67939305", "text": "function getSavedContent(editor) {\n return editor.ckc.savedContent;\n }", "title": "" }, { "docid": "ee7e63b8bc1ebf1e3e66c5b4f6b9c180", "score": "0.6719631", "text": "function saveEditorSettings() {\n\t\tsettingsHelper.setSetting(\"editorFontFamily\", $(\"#settings-editor-font-family\").val());\n\t\tsettingsHelper.setSetting(\"editorFontSize\", parseInt($(\"#settings-editor-font-size\").val(), 10));\n\t\tsettingsHelper.setSetting(\"editorIndentSize\", parseInt($(\"#settings-editor-indent-size\").val(), 10));\n\t\tsettingsHelper.setSetting(\"editorUseTabs\", $(\"#settings-editor-use-tabs\").prop(\"checked\"));\n\t\tsettingsHelper.setSetting(\"editorTheme\", $(\"#settings-editor-theme\").val());\n\t\tsettingsHelper.setSetting(\"editorShowLineNumbers\", $(\"#settings-editor-show-line-numbers\").prop(\"checked\"));\n\t\tsettingsHelper.setSetting(\"editorBigHeader\", $(\"#settings-editor-big-headers\").prop(\"checked\"));\n\t}", "title": "" }, { "docid": "1a8f0c6b19d0a7b0c07ed42acd7a2762", "score": "0.6714064", "text": "function editorSave() {\n if (err = checkErrors()) {\n showError(err);\n } else {\n $('#editorText').val(editor.getText())\n $('#editorForm').submit();\n }\n}", "title": "" }, { "docid": "4673ef9fedb9791f19b88b311a4adf67", "score": "0.660942", "text": "function savePost () {\n\tif (html_mode) {\n\t\t// Set body\n\t\tCKEDITOR.instances.post_body.setData(content_editor.getValue());\n\t}\n}", "title": "" }, { "docid": "163540dd670fbae9977078410637d495", "score": "0.65791935", "text": "function prepareContent(){\n var css = \"<style>\\n\" + cssEditor.getValue() + \"\\n</style>\";\n var html = htmlEditor.getValue();\n var js = \"<script>\\n\" + jsEditor.getValue() + \"\\n<\\/script>\";\n localStorage.setItem(\"css\", css);\n localStorage.setItem(\"html\", html);\n localStorage.setItem(\"js\", js);\n}", "title": "" }, { "docid": "ac8be50724249f5aa43a9aa9d96fe484", "score": "0.65541726", "text": "function saveContent() {\n browser.tabs.query({ windowId: myWindowId, active: true }).then((tabs) => {\n let contentToStore = {};\n contentToStore[tabs[0].url] = contentBox.innerHTML;\n browser.storage.local.set(contentToStore);\n });\n}", "title": "" }, { "docid": "78b6485c6f3ad785959dd5b1415a573f", "score": "0.6540361", "text": "function saveCurrent(e, d) {\n if (loadedDocument) {\n\n gitly.dlayer.save(\n { \n document: loadedDocument,\n contents: gitly.editor.get() \n },\n function (err, res) {\n if (err) {\n av.SnackBar('ERROR SAVING ' + err);\n } else {\n gitly.index.fetch(!d);\n gitly.editor.clearUnsaved();\n av.SnackBar('DOCUMENT SAVED');\n }\n gitly.dom.mainEditor.focus();\n }\n );\n }\n }", "title": "" }, { "docid": "835f15ec9d2746b9e8f0e895a65401a0", "score": "0.6524533", "text": "function saveLocal() {\n localStorage.setItem('gde', editor.getValue());\n}", "title": "" }, { "docid": "28f69561ccb8347a9d0bd938c5c74e9a", "score": "0.65068394", "text": "_save() {\n\t\tconst version = this._editor.model.document.version;\n\n\t\t// Operation may not result in a model change, so the document's version can be the same.\n\t\tif ( version === this._lastDocumentVersion ) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tthis._data = this._getData();\n\t\t\tthis._lastDocumentVersion = version;\n\t\t} catch ( err ) {\n\t\t\tconsole.error(\n\t\t\t\terr,\n\t\t\t\t'An error happened during restoring editor data. ' +\n\t\t\t\t'Editor will be restored from the previously saved data.'\n\t\t\t);\n\t\t}\n\t}", "title": "" }, { "docid": "28f69561ccb8347a9d0bd938c5c74e9a", "score": "0.65068394", "text": "_save() {\n\t\tconst version = this._editor.model.document.version;\n\n\t\t// Operation may not result in a model change, so the document's version can be the same.\n\t\tif ( version === this._lastDocumentVersion ) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tthis._data = this._getData();\n\t\t\tthis._lastDocumentVersion = version;\n\t\t} catch ( err ) {\n\t\t\tconsole.error(\n\t\t\t\terr,\n\t\t\t\t'An error happened during restoring editor data. ' +\n\t\t\t\t'Editor will be restored from the previously saved data.'\n\t\t\t);\n\t\t}\n\t}", "title": "" }, { "docid": "58868559195b3c14be597221dff2b2f2", "score": "0.65019274", "text": "save() {\n if (!this.isDirty) {\n return Promise.resolve(undefined);\n }\n const settings = this._settings;\n const source = this._user.editor.model.value.text;\n return settings\n .save(source)\n .then(() => {\n this._updateToolbar(false, false);\n })\n .catch(reason => {\n this._updateToolbar(true, false);\n this._onSaveError(reason);\n });\n }", "title": "" }, { "docid": "b485f0d7d0b628b4879a1d9d0c4791ec", "score": "0.6496311", "text": "function saveToLocalStorage() {\n localStorage.setItem(\"textArea\", JSON.stringify(savedTextAreaContent));\n}", "title": "" }, { "docid": "bb7e9f6a5cea7634409d4cb26cd246e0", "score": "0.6486889", "text": "_onStateChanged() {\n this._state.sizes = this._panel.relativeSizes();\n this._state.container = this._editor.state;\n this._state.container.editor = this._list.editor;\n this._state.container.plugin = this._list.selection;\n this._saveState()\n .then(() => {\n this._setState();\n })\n .catch(reason => {\n console.error('Saving setting editor state failed', reason);\n this._setState();\n });\n }", "title": "" }, { "docid": "9f1a149268b2e80e803b1b05060ecb8d", "score": "0.6476006", "text": "save() {\n return this._editor.raw.save();\n }", "title": "" }, { "docid": "adff0fda61fc68027fc30b982bc64bcc", "score": "0.64353484", "text": "function saveBlocks() {\n if (typeof Blockly != 'undefined' && myself.workspace) {\n var xml = Blockly.Xml.workspaceToDom(myself.workspace);\n var text = Blockly.Xml.domToText(xml);\n $window.localStorage.savedBlocks = text;\n }\n }", "title": "" }, { "docid": "823904a6f3be758e5793c2984162c9f9", "score": "0.643484", "text": "function saveHtml() {\n for (var i = 0; i < textAreas.length; i++) {\n $(textAreas[i]).text($(textAreas[i]).val());\n localStorage.setItem(`${i}`, $(textAreas[i]).text());\n }\n }", "title": "" }, { "docid": "b46003b4df4016c29b00d2f7b4735272", "score": "0.6433106", "text": "function saveFile(path) {\n fs.writeFile(path, editor.getValue(), function (err) {\n if (err) throw err;\n console.log('saved as ' + documentPath);\n // note document path\n note('Saved as: ' + documentPath);\n // set edited to false\n edited = false;\n // reset title (remove '*')\n $('title').html(documentPath + ' (' + getTitle() + ') - ' + appName);\n });\n }", "title": "" }, { "docid": "268fbc2325a1b967ce0e6e60c47ac783", "score": "0.64196897", "text": "function contentPersist(){\n $('textarea').each(function(){ \n var id = $(this).attr('id');\n var value = localStorage.getItem(id);\n\n $(this).val(value);\n\n }); \n\n\n\n\n\n}", "title": "" }, { "docid": "33ffbe92af10313d030fa9ba21d08f0d", "score": "0.6408988", "text": "function saveStates()\r\n\t{\r\n\t //we get all the values from fields in the variables\r\n\t var txt = document.editor.text.value;\r\n\t\tvar txtFontStyle = document.getElementById(\"textFont\").value;\r\n\t\tvar txtSize = document.getElementById(\"textSize\").value+\"px\";\r\n\t\tvar txtColor = document.getElementById(\"textColor\").value;\r\n\t\tvar bgcolor = document.getElementById(\"backgroundColor\").value;\r\n\t\tvar animationClass = \"animate__animated animate__\"+ document.getElementById(\"animation\").value+\" animate__delay-\"+ document.getElementById(\"animationDelay\").value+\"s\";\t\r\n\t\tvar dlay = document.getElementById(\"animationDelay\").value;\r\n\t\t\r\n\t\t// store the state of animated text in object\r\n\t\tconst animatedElement = { text: txt,textFont:txtFontStyle, textSize: txtSize ,textColor: txtColor, bgColor: bgcolor ,animation: animationClass,delay:dlay};\r\n // store the bject in array of objects\r\n\t\tanimatedElements.push(animatedElement);\r\n\t\t//use javascript local storage for storing states in the browser\r\n\t\tlocalStorage.setItem('elements', JSON.stringify(animatedElements));\r\n\t\t\r\n\t\talert(\"Animated Element Saved\");\r\n\r\n\t}", "title": "" }, { "docid": "853b6a7f77945e25f7bed8716e5ea598", "score": "0.63996613", "text": "function EditorState()\n {\n }", "title": "" }, { "docid": "fd8153fe9d08e00c75b2fb5601e5ff33", "score": "0.63889855", "text": "function saveState() {\n\n /* Les lettres du mot à deviner */\n let saveLetters = [];\n for (let i = 0; i < lettersOfWord.length; i++) {\n saveLetters.push(lettersOfWord[i].innerHTML);\n }\n\n localStorage.setItem(\"letters\", JSON.stringify(saveLetters));\n\n /* Le mot */\n localStorage.setItem(\"word\", JSON.stringify(pendu.word));\n\n /* Les vies */\n localStorage.setItem(\"lives\", pendu.lives);\n\n /* L'état des lettres du clavier */\n let keyboardState = [];\n for (let letter of lettersBlocks) {\n keyboardState.push(letter.className);\n }\n\n localStorage.setItem(\"keyboardState\", JSON.stringify(keyboardState));\n }", "title": "" }, { "docid": "658e4c23042620f55ef2655f8e48cd21", "score": "0.63844794", "text": "onSaveStyles() {\r\n this.setState({ value: this.refs.editor.value });\r\n }", "title": "" }, { "docid": "ca615187c81ee830b35ddf47dc153853", "score": "0.63831985", "text": "function updateContent() {\n\t\tsource_code = editor.getValue();\n\t\tinputtext = inputarea.val();\n\t}", "title": "" }, { "docid": "f9417fe34743d0f2b793000088139a8c", "score": "0.63397473", "text": "function saveEditorState (editor) {\n const store = {scrollTop: editor.element.getScrollTop()}\n\n const foldRowRanges = editor.displayLayer.foldsMarkerLayer.findMarkers({}).map(marker => {\n const {start, end} = marker.getRange()\n return [start.row, end.row]\n })\n\n return function restoreEditorState ({anchorPosition, skipRow = null} = {}) {\n if (anchorPosition) {\n store.anchorScreenRow = this.editor.screenPositionForBufferPosition(anchorPosition).row\n store.anchorFirstVisibileScreenRow = editor.getFirstVisibleScreenRow()\n }\n\n for (const [startRow, endRow] of foldRowRanges.reverse()) {\n if (skipRow >= startRow && skipRow <= endRow) continue\n if (!editor.isFoldedAtBufferRow(startRow)) {\n editor.foldBufferRow(startRow)\n }\n }\n\n if (anchorPosition) {\n const {anchorScreenRow, anchorFirstVisibileScreenRow} = store\n const shrinkedRows = anchorScreenRow - this.editor.screenPositionForBufferPosition(anchorPosition).row\n this.editor.setFirstVisibleScreenRow(anchorFirstVisibileScreenRow - shrinkedRows)\n } else {\n editor.element.setScrollTop(store.scrollTop)\n }\n }\n}", "title": "" }, { "docid": "268dbbb82566d0f1e7e6457ce0061d84", "score": "0.6319762", "text": "function qjSave() {\n var qj_content = $('#qj-master').html();\n localStorage.setItem(qj_local_key, qj_content);\n }", "title": "" }, { "docid": "ffb1d2897b59d1d28f205828bc5d7a05", "score": "0.6295693", "text": "function saveCommand() {\n saveFile(editor.getValue());\n}", "title": "" }, { "docid": "1ea377741555ecbba361d35ecb1190e3", "score": "0.62851703", "text": "onSaveFile() {\r\n const script = Object.assign({}, this.state.script);\r\n\r\n script[this.state.viewing] = this.refs.editor.value;\r\n\r\n this.setState({ script });\r\n }", "title": "" }, { "docid": "58089cc8b7b48cfdb9c1f206d8de6087", "score": "0.62510055", "text": "function editor_save() {\n var text = editor.exportFile(ui.doc_ref);\n $.post('/d'+ui.doc_ref, {text: text, path: ui.doc_ref})\n .done(function(d) {\n if(d.error) {\n $.pnotify({type:'error', text: ''+d.error, title: \"Unable to save\"});\n } else {\n $.pnotify({type:'success', text: 'File saved'});\n }\n })\n .fail(function(e) {\n $.pnotify({type:'error', text: ''+e, title: \"Unable to save\"});\n });\n}", "title": "" }, { "docid": "88f2364b524f3377404a4ec453633fe0", "score": "0.62137544", "text": "function onLoad() {\n var myContent = localStorage.getItem(\"myContent\");\n document.getElementById(\"save-button\").disabled = true;\n document.getElementById(\"save-button\").innerHTML = \"✔ Saved\";\n if (localStorage.getItem(\"myContent\") !== null) {\n document.getElementById(\"myTextarea\").innerHTML = myContent;\n }\n}", "title": "" }, { "docid": "037c47db3a5ddef74fb80bab9edab89c", "score": "0.62102956", "text": "function save() {\n if(activeNote === null) { // if a note is currently active\n let {title, body} = getContent();\n let index = Notes.add(title, body);\n makeActiveNote.call(addNote(index)); // build a note element & set as active\n }\n else { // if a note is active\n let {title, body} = getContent();\n Notes.replace(activeNote.noteIndex, title, body);\n updateNote();\n }\n}", "title": "" }, { "docid": "bb8114a93a9d5b324f1bcb3156b03e0b", "score": "0.62088567", "text": "function handleSave(event){\n var value = $(this).siblings(\".textarea\").val();\n var key = $(this).siblings(\".textarea\").attr(\"id\");\n localStorage.setItem(key, value);\n}", "title": "" }, { "docid": "6e4891db890897937023caaa4e0f1eab", "score": "0.61845607", "text": "function sendEditorState() {\n if (isPlaying)\n return;\n for (let [id, player] of Object.entries(players)) {\n if (!player.isLocal) continue;\n if (player == players[\"me\"] && id !== \"me\") continue;\n let doc = player.editor.getDoc();\n // Might want to strip out irrelevant info, like selection stickiness and xRel.\n let editorState = {\n cursor: doc.getCursor(),\n selections: doc.listSelections(),\n content: doc.getValue()\n };\n // It is amazing that there is no reasonable way to compare objects (or maps) built-in to this language.\n if (JSON.stringify(editorState) !== JSON.stringify(player.lastEditorState)) {\n emit(id, 'editor', editorState);\n player.lastEditorState = editorState;\n }\n }\n setTimeout(sendEditorState, 200);\n }", "title": "" }, { "docid": "d7605bdcda7d7cee80216ca76f78d459", "score": "0.61804956", "text": "function save(event) {\n event.preventDefault();\n var index = $(this).attr('index');\n // jQuery selector always returns an array. to get around that, I had to use\n // .eq(0) (because it was always the only thing in the array).\n var textToSave = $('textarea[index=' + index + ']').eq(0).val();\n var objectToSave = {\n index: index,\n text: textToSave\n }\n localStorage.setItem(index, JSON.stringify(objectToSave));\n }", "title": "" }, { "docid": "8c31c162c5b2320a200d1f3d134fed0c", "score": "0.6170804", "text": "function postToEditor() {\n editor.html(extractToText(thisElement.val()));\n }", "title": "" }, { "docid": "3fcb93696f6c9b9e9e763fd22e5166f5", "score": "0.61520576", "text": "_onContentChanged() {\n const editorModel = this.editor.model;\n const oldValue = editorModel.value.text;\n const newValue = this._context.model.toString();\n if (oldValue !== newValue) {\n editorModel.value.text = newValue;\n }\n }", "title": "" }, { "docid": "077f03af851b0700589b823bc49a6887", "score": "0.61353046", "text": "saveLocalStorage() {\n const textsToSave = JSON.stringify(this.texts.map(text => { return { ...text, highlighted: undefined, selected: undefined } }))\n window.localStorage.setItem('texts', textsToSave)\n }", "title": "" }, { "docid": "89b87be002c05dcbd759801a461ef799", "score": "0.6116485", "text": "function updateCurrentContent(editor, content) {\n if (editor.config.fullPage) {\n return editor.document.getBody().setHtml(content);\n } else {\n return editor.loadSnapshot(content);\n }\n }", "title": "" }, { "docid": "af02de97cb12ba5b39279cb0cb72577a", "score": "0.60709745", "text": "function updateContent()\n\t\t{\n\t\t\tif(contentIsUpdating)\n\t\t\t{\n\t\t\t\tcontentNeedsUpdating = true;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcontentIsUpdating = true;\n\n\t\t\teditor.setData(editor.getData(), {\n\t\t\t\tcallback: function()\n\t\t\t\t{\n\t\t\t\t\tcontentIsUpdating = false;\n\t\t\t\t\tif(contentNeedsUpdating)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontentNeedsUpdating = false;\n\t\t\t\t\t\tupdateContent(editor);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "6dadade837d9b2a739d92d62da406ca6", "score": "0.6065716", "text": "save() {\n\n // normalize copyright date\n let design = this.design\n\n design.copyright = dayjs(design.copyright).format('YYYY-MM-DD')\n\n // invert grid text overlay layers\n this.settings.gridTextColor = getContrastYIQ(this.settings.gridBackgroundColor)\n\n let data = {\n layers: this.layers,\n settings: this.settings,\n tiles: this.tiles,\n lines: this.lines,\n design,\n }\n\n localStorage.setItem(LS_DESIGN_DATA, JSON.stringify(data))\n\n if (this.design.designer) {\n localStorage.setItem(LS_COPYRIGHT_DATA, this.design.designer)\n }\n\n this.setPageTitle(this.design.title)\n // this.compressData(data)\n }", "title": "" }, { "docid": "4d1beaca5ca56c873fa6a2b9a58b4960", "score": "0.6063063", "text": "function save() {\n var pluginItem = new yak.ui.PluginItem();\n pluginItem.id = parent.find('[name=id]').val();\n pluginItem.description = parent.find('[name=description]').val();\n pluginItem.code = codeEditor.getValue();\n\n viewModel.updateValue(pluginItem);\n }", "title": "" }, { "docid": "d0af46e5a99fdc859acc9c63599e2f03", "score": "0.6058314", "text": "function saveState() {\n LS.setData('commute-storage', [\n vm.state.originA,\n vm.state.originB,\n vm.state.destination,\n vm.state.mileageRate,\n vm.state.hourlyRate,\n vm.state.milesPerGallon,\n vm.state.gasPrice,\n vm.state.maintenance,\n vm.state.tires,\n vm.state.insurance,\n vm.state.licenseRegTaxes,\n vm.state.depreciation,\n vm.state.finance,\n vm.state.advancedToggle\n ]);\n // reset state, which will use local storage data\n setState();\n }", "title": "" }, { "docid": "3e16c6a63da8577671915d0e87a7fd82", "score": "0.60300744", "text": "function savedEditedNotesTextArea() {\n\tfor (let i = 0; i < noteBookArray.length; i++) {\n\t\ttextAreaArrayNotes.push(noteBookArray[i]);\n\t\tnoteBookArray.splice(i, 1);\n\t\ti--;\n\t}\n\tlocalStorage.setItem(\"saveEditedNotes\", JSON.stringify(textAreaArrayNotes));\n\tlocalStorage.removeItem(\"savedNoteBooks\");\n}", "title": "" }, { "docid": "3b4bd678e1b164f8ccbef5467180f1ed", "score": "0.60256815", "text": "function storeStuff() {\n var text = $(this).parent(\"div\").parent(\"div\").find(\"textarea\").val().trim();\n var textId = $(this).parent(\"div\").parent(\"div\").find(\"textarea\").get(0).id;\n localStorage.setItem(textId, text);\n}", "title": "" }, { "docid": "6a96b24b8ed7593bb30054ef19976d77", "score": "0.6021234", "text": "save() {\n\t\t\t\tthis.savedStates.push(this.position);\n\t\t\t}", "title": "" }, { "docid": "3105a95a1afa292f99309e60452f9ae4", "score": "0.60161924", "text": "function saveBoard () {\n const cells = document.querySelectorAll('.board > div')\n const serialized = Array.from(cells).map((el) => {\n return {\n t: el.innerText,\n m: el.classList.contains('marked')\n }\n })\n localStorage.setItem('saved', JSON.stringify(serialized))\n localStorage.setItem('savedAt', Date.now())\n}", "title": "" }, { "docid": "3a2b40b5b4710c59062a47c4cef4f42e", "score": "0.60129213", "text": "function handleStateChange(editorState){\n setEditor(editorState);\n const value = editorState.getCurrentContent().getPlainText();\n\n setValues(values => ({\n ...values,\n deskripsi_produk: value,\n }))\n }", "title": "" }, { "docid": "14f2ced9a531e7bb91b20715022ed481", "score": "0.60050344", "text": "updateEditor() {\n\n }", "title": "" }, { "docid": "9fe3d4c81aeca8241093a3e8ce19f4f4", "score": "0.59968185", "text": "function EditorState(immutable){_classCallCheck(this,EditorState),this._immutable=immutable;}", "title": "" }, { "docid": "79798817c85e1976cc8a0fc66ffd7516", "score": "0.5993847", "text": "function transferHTML(callback) {\n\tvar ed = tinymce.activeEditor; // get editor instance\n\ted.save(); //save editor content to textarea\n\tupdateIframe(function(){\n\t\t\n\t\tupdateArticles(function(){\n\t\t\tupdatePre();\n\t\t});\n\t});\n\tif(callback != undefined && typeof callback == 'function') callback();\n}", "title": "" }, { "docid": "2a906794306d292f2d9ecf85832d1d4f", "score": "0.59809697", "text": "getAndProcessEditorContent() {\n const proc = async () => {\n const data = await this.getEditorContent();\n this.processEditorContent(data);\n };\n\n if (this.editor) {\n proc();\n } else {\n this.once('beforeAppend', proc);\n }\n }", "title": "" }, { "docid": "9488d0b6047a3618c9a8b15fde756aef", "score": "0.5980946", "text": "function save()\n{\n // initializes a packet to be saved\n let packet = {};\n\n // retrieves the search engine type select\n const searchEngineSelect = document.getElementById('search-engine-selector');\n\n // retrieves the constant phrases from editor.html\n const constantPhrases = document.getElementsByClassName('input-text');\n\n // adds the selected option to the packet to be saved\n packet['search-engine'] = searchEngineSelect.options[searchEngineSelect.selectedIndex].value;\n\n // adds the prepended and appended phrases to the packet\n packet['prepend-constant'] = constantPhrases[0].value;\n packet['append-constant'] = constantPhrases[1].value;\n\n\n // save the packet to local storage\n chrome.storage.local.set(packet, function ()\n {\n // navigates the user to import.html\n chrome.tabs.update({'url': chrome.extension.getURL('editor.html')});\n });\n}", "title": "" }, { "docid": "761156abee28a4e63b5f73b71d58e34c", "score": "0.59763885", "text": "function toEditorState(text) {\n return __WEBPACK_IMPORTED_MODULE_0_draft_js__[\"ContentState\"].createFromText(text);\n}", "title": "" }, { "docid": "327a9773033a3f15bf8c99a91657b4b0", "score": "0.596962", "text": "function save() {\n var $e = $(this);\n $e.data(me + \"-visibility\", $e.css(\"visibility\"));\n $e.data(me + \"-display\", $e.css(\"display\"));\n }", "title": "" }, { "docid": "a7b6b14d13bdaa53bdf63ae1a6cb71ba", "score": "0.59670734", "text": "function _saveToStorage(id, value) {\n //save textarea data in localStorage\n localStorage.setItem(id, value);\n }", "title": "" }, { "docid": "f0bf7c2b73ca4b4d5da4291e4349a8dc", "score": "0.59517694", "text": "saveState() {\n this.instance().save_state();\n }", "title": "" }, { "docid": "f7d5fd056b4b2b1cf427cbc15731adb0", "score": "0.5948649", "text": "setContentsCallback() {\n this.rich_editor.setContents(this.article.content);\n }", "title": "" }, { "docid": "822ba312a805379ed20feb0850d89e62", "score": "0.58982587", "text": "function restore() {\n const gde = localStorage.getItem('gde');\n if (gde) {\n editor.setValue(gde);\n }\n}", "title": "" }, { "docid": "0eec8e294e402a302b04e4e18067e5ff", "score": "0.5895407", "text": "function setTextContent() {\n for (const [key, value] of Object.entries(savedTextAreaContent)) {\n $(\"#\" + key).val(value);\n }\n}", "title": "" }, { "docid": "c07c5e1c37a972c078f1f284b6fef7a8", "score": "0.5885503", "text": "function saveContentEdit(_data){\n var docu = new DOMParser().parseFromString('<content></content>', \"application/xml\")\n var newCDATA=docu.createCDATASection(_data);\n $(data).find(\"page\").eq(currentPage).children(\"branch\").eq(currentBranch).find(\"content\").first().empty();\n $(data).find(\"page\").eq(currentPage).children(\"branch\").eq(currentBranch).find(\"content\").first().append(newCDATA);\n sendUpdate();\n }", "title": "" }, { "docid": "3182f2ebdc245a1d4e1c3da1b4407f5d", "score": "0.5880413", "text": "function contentStore(obj) {\n obj.old=obj.innerHTML;\n }", "title": "" }, { "docid": "fbd1289d19fa969176243fa4a8c1fbf5", "score": "0.5878874", "text": "updateEditorValue() {\n var content = \"\";\n var children = this.children;\n if (this.childNodes[0] && this.childNodes[0].tagName !== \"TEMPLATE\") {\n children = this.childNodes;\n if (children.length > 0) {\n // loop through everything found in the slotted area and put it back in\n for (var j = 0, len2 = children.length; j < len2; j++) {\n if (children[j].tagName) {\n content += children[j].outerHTML;\n } else {\n content += children[j].textContent;\n }\n }\n }\n } else if (children[0]) {\n content = children[0].innerHTML;\n }\n if (content) {\n if (this.language === \"html\") {\n content = formatHTML(content);\n }\n this.shadowRoot.querySelector(\"#codeeditor\").value = content.trim();\n }\n }", "title": "" }, { "docid": "49245511bb5599cafef4c92017819eac", "score": "0.58697", "text": "function editorStateToJSON(editorState) {\n if (editorState) {\n var content = editorState.getCurrentContent();\n return JSON.stringify((0, _draftJs.convertToRaw)(content), null, 2);\n }\n}", "title": "" }, { "docid": "770be19665bf32e02cf1fdb03921b789", "score": "0.58505684", "text": "function fileState() {\n if (editor.session.getUndoManager().isClean()) {\n $('#save').addClass(\"disabled\").removeClass(\"active\");\n } else {\n $('#save').removeClass(\"disabled\").addClass(\"active\");\n }\n}", "title": "" }, { "docid": "38257e55fbca4b93a8c00d7d95898f34", "score": "0.5849062", "text": "function save() {\n let title = document.getElementById(\"title\");\n title.style.border = \"none\";\n title.setAttribute(\"readOnly\", true);\n\n let postContent = document.getElementById(\"postContent\");\n postContent.style.border = \"none\";\n postContent.setAttribute(\"contentEditable\", false);\n\n document.getElementById(\"save\").style.display = \"none\";\n document.getElementById(\"edit\").style.display = \"\";\n}", "title": "" }, { "docid": "7ad444d40b5147c24ef34e69d4c997df", "score": "0.58451587", "text": "function editorUpdate() {\n $(\"div#md-output\").html(marked($(\"textarea#md-editor\").val()));\n}", "title": "" }, { "docid": "c04f869d4965bf229f97272810ff148a", "score": "0.58447796", "text": "function nodeEditor(data) {\n\n\n\t\tvar editor = qs('#editor');\n\t\tselected = data;\n\t\tif (data === null) {\n\t\t\tblankEditor();\n\t\t\treturn;\n\t\t}\n\n\t\tvar source = $('#statedescr-template').html();\n\t\tvar template = Handlebars.compile(source);\n\t\tvar html = template(data);\n\t\teditor.innerHTML = html;\n\t\tMathJax.Hub.Queue(['Typeset', MathJax.Hub, '#editor']);\n\t\t//scroll_DOWN();\n\t}", "title": "" }, { "docid": "1a9ac70ef9917cd49f7fc506547e8650", "score": "0.5844491", "text": "function setCurrentState(obj){\n\t// getting current obj from textToEditor,\n\tlet arr = getAllNotes();\n\t// gathering all objets\n\tarr.forEach((n)=>{\n\t\t//ForEach obj checking if id is same as targeted in textToditor, if true set current to true else false.\n\t\t(n.id === obj.id) ? n.current = true : n.current = false;\n\t\t// save down all objects\n\t\taddToLocalStorage(n);\n\t})\n}", "title": "" }, { "docid": "5f3e640c30a30f0433762e1870b41b30", "score": "0.58444726", "text": "function savePostContent() {\n /* Get Object From Session Storage Using 'postInfo' Key*/\n var sessionObj = sessionStorage.getItem('postInfo');\n /* Parse Session Object Using JSON.parse Method */\n var parseObj = JSON.parse(sessionObj);\n /* Get Post Author Name */\n var postAuthorName = parseObj[\"authorName\"];\n /* Set Edit Button When Post Content Saved */\n document.getElementById('postAuthor').innerHTML =\n `<h4>${postAuthorName}</h4>` + `<button type=\"button\" id=\"edit-btn\" class=\"edit-btn\" onclick=\"editPostContent();\">Edit <i class=\"fa fa-pencil-square-o\"></i></button>`;\n /* Post Title In NoN-Editable Mode */\n document.getElementById('postTitle').contentEditable = \"false\";\n /* Post Description In NoN-Editable Mode */\n document.getElementById('postDescription').contentEditable = \"false\";\n /* Toggle Border Around Post Description When Post Content Saved */\n document.getElementById('postDescription').style.border = \"none\";\n /* Toggle Border Around Post Title When Post Content Saved */\n document.getElementById('postTitle').style.border = \"none\";\n}", "title": "" }, { "docid": "5bcb73c861a4212e91ee7d19e50d61e5", "score": "0.584373", "text": "function save() {\n\t\tvar selected_content = $(\"#selected-content\").clone();\n\t\tvar selected_content_html = selected_content.html();\n\t\t$(\"input#form_name\").val($(\"input#form-title\").val());\n\t\t$(\"input#form_id_ctr\").val(_ctrl_index);\n\t\t$(\"input#content_form\").val(selected_content_html);\n\n\t\tvar no_name = 0;\n\t\t$(\"#selected-content :input\").each(\tfunction() {\n\t\t\tif($(this).attr('name')=='' || !$(this).attr('name')) {\n\t\t\t\tno_name++;\n\t\t\t}\n\t\t});\n\n\t\tif(no_name>0) {\n\t\t\talert('The form cannot be saved, Please make sure you provide name in each field.');\n\t\t} else {\n\t\t\t$(\"#formsave\").submit();\n\t\t}\n\t}", "title": "" }, { "docid": "371f7807fe16e223b2cbefcf84e453f1", "score": "0.5842684", "text": "serialize() {\n unreachable(\"An editor must be serializable\");\n }", "title": "" }, { "docid": "99bdcc18f58d0d4441c78344119667d9", "score": "0.5842231", "text": "save() {\n localStorage.setItem('notebooks', JSON.stringify(this.notebooks))\n localStorage.setItem('notebookId', this.currentNotebookId)\n }", "title": "" }, { "docid": "ce7f6e1b6c1eb733928b319adda970b6", "score": "0.5841029", "text": "handleEditorDataChange( evt, editor ) {\n this.setState( {\n editorData: editor.getData(),\n isPublished: false\n } );\n }", "title": "" }, { "docid": "89a804aaafd8fae81ddad6289aa22641", "score": "0.5835048", "text": "function update()\n{\n var idoc = document.getElementById('iframe').contentWindow.document; //getting everything user writes inside editor\n idoc.open();\n idoc.write(editor.getValue());\n idoc.close();\n}", "title": "" }, { "docid": "7580adb20607a91649729667658e845b", "score": "0.5825303", "text": "function autosave(){\n\tif(typeof(Storage) === \"undefined\"){ return; }\n\tlocalStorage.setItem(\"state\", JSON.stringify(state));\n}", "title": "" }, { "docid": "f107db2f0fc63084b4d10414f31063e1", "score": "0.5824101", "text": "handleEditorDataChange( evt, editor ) {\n this.setState( {\n editorData: editor.getData()\n } );\n }", "title": "" }, { "docid": "e9f9e0cad6d2bec8f76de22ab9b6bedd", "score": "0.58182067", "text": "function saveContent(){\r\n var getObjFromSession = sessionStorage.getItem('theObj');\r\n var Obj = JSON.parse(getObjFromSession);\r\n \r\n var author = Obj[\"authNmae\"];\r\n document.getElementById('post-auth').innerHTML = \r\n `<h5 id=\"auth\">${author}</h5>`+`<button type=\"button\" id=\"editBtn\" onclick=\"makeContentEditable();\">Edit <i class=\"fa fa-edit\"></i></button>`;\r\n document.getElementById('post-title').contentEditable = \"false\";\r\n document.getElementById('post-desc').contentEditable = \"false\";\r\n document.getElementById('post-desc').style.border = \"none\";\r\n document.getElementById('post-title').style.border = \"none\";\r\n}", "title": "" }, { "docid": "8bb3b0f1f9117e485fad68be5fa2aa0e", "score": "0.580964", "text": "saveSelection() {\n this.selected = this.model.document.selection.getSelectedElement()\n }", "title": "" }, { "docid": "4481de56cb90402d8772b240ad80eb48", "score": "0.5796662", "text": "function toEditorState(text) {\n return _draftJs.ContentState.createFromText(text);\n}", "title": "" }, { "docid": "d95a0a5b2272b3fb8cbe91aee7b8dccc", "score": "0.57938457", "text": "function updateSavedState() {\n 'use strict';\n if (split) {\n return;\n }\n\n var mapping = {\n live: 'output',\n javascript: 'js',\n css: 'css',\n html: 'html',\n console: 'console'\n };\n\n var withRevision = true;\n\n var query = $panelCheckboxes.filter(':checked').map(function () {\n return mapping[this.getAttribute('data-panel')];\n }).get().join(',');\n $shareLinks.each(function () {\n var path = this.getAttribute('data-path');\n var url = jsbin.getURL({ withRevision: withRevision }) + path + (query && this.id !== 'livepreview' ? '?' + query : ''),\n nodeName = this.nodeName;\n var hash = panels.getHighlightLines();\n\n if (hash) {\n hash = '#' + hash;\n }\n\n if (nodeName === 'A') {\n this.href = url;\n } else if (nodeName === 'INPUT') {\n this.value = url;\n if (path === '/edit') {\n this.value += hash;\n }\n } else if (nodeName === 'TEXTAREA') {\n this.value = ('<a class=\"jsbin-embed\" href=\"' + url + hash + '\">' + documentTitle + '</a><' + 'script src=\"' + jsbin.static + '/js/embed.js\"><' + '/script>').replace(/<>\"&/g, function (m) {\n return {\n '<': '&lt;',\n '>': '&gt;',\n '\"': '&quot;',\n '&': '&amp;'\n }[m];\n });\n }\n });\n}", "title": "" }, { "docid": "0c939c624aeb9a224f45925a77682ac5", "score": "0.5793584", "text": "function EditSave(e)\n {\n const id = e.currentTarget.id;\n const _content = [...content];\n _content[id].edit = !_content[id].edit;\n setContent(_content);\n }", "title": "" }, { "docid": "032eeb388e9c8e55bae8d5a92fbb4505", "score": "0.57767636", "text": "function saveInsightsTextFunction(){\n var parentProject = $(this).parents('.project');\n var parentId = parentProject.find('input[type=hidden]').attr('value');\n\n var text = parentProject.find('.ql-editor').html();\n\n $.post(edgarw + \"/project/updateInsightsText/\" + parentId, {info: text})\n .done(function (data) {\n savedWithAjax('.wrapperScrollable','Saved!');\n });\n }", "title": "" }, { "docid": "2d601627c6ab29eb59c26f312597abb9", "score": "0.57748663", "text": "function loadTextEditor() {\n\t\tlet currentValue = getCurrentStorageValue();\n\t\tlet textArea = document.getElementById('json-config');\n\t\t//If current value is present\n\t\tstorageValueExists(currentValue, function (exists) {\n\t\t\tif (exists) {\n\t\t\t\tchrome.storage.local.get(currentValue, function (result) {\n\t\t\t\t\ttextArea.value = result[currentValue];\n\t\t\t\t\tbuildVisualFromText();\n\t\t\t\t});\n\t\t\t}\n\t\t\telse {\n\t\t\t\ttextArea.value = defaultTextEditorValue;\n\t\t\t\tbuildVisualFromText();\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "dc23ee15b73a93b8c43c19901429e026", "score": "0.5769226", "text": "function unsavedContentSave(currentID, nextID) {\n\tupdateNote(currentID, getText());// Save note\n\ttextToEditor(getNoteFromStorage(nextID)); // Display next note in editor\n\t\n\t// setting next note as current.\n\tlet note = getNoteFromStorage(nextID);\n\tnote.current = true;\n\tfilterNoteList();\n\tsetCurrentNoteID(nextID);\n}", "title": "" }, { "docid": "3a41649690e5b85360d1e4f6c5b32567", "score": "0.57650745", "text": "saveNotes() {\r\n this.currentEditing.notes = this.tempNotes;\r\n this._storage.notes[this.currentEditing.id] = this.tempNotes;\r\n this.tempNotes = null;\r\n this.currentEditing = null;\r\n }", "title": "" }, { "docid": "373983a3aab353826a00c71ade0234f5", "score": "0.57640433", "text": "save() {\n let status = {\n board: this.board.innerHTML,\n size: this.rows,\n current: this.currentEmpty\n };\n localStorage.setItem(dataName, JSON.stringify(status));\n }", "title": "" }, { "docid": "45666b04c6b12485f6bb63dec964df34", "score": "0.5758136", "text": "function saveItem(event){\n //get targeted button\n var targetButton = $(event.target);\n //get targeted button's previous sibling: textarea\n var textArea = targetButton.prev();\n //textArea stored locally using textArea's id as key (e.g. \"hour-9\")\n localStorage.setItem(textArea.attr(\"id\"), textArea.val());\n}", "title": "" }, { "docid": "f07345ed46dbd967ed4efac4c47f6739", "score": "0.575659", "text": "function saveState () {\n console.log('saving state to ' + cfg.filePath)\n cfg.write(state.saved, function (err) {\n if (err) console.error(err)\n update()\n })\n}", "title": "" }, { "docid": "5867559e7efd3e049fb652dc196ee021", "score": "0.5747138", "text": "function saveContentEdit(_data){\n var docu = new DOMParser().parseFromString('<content></content>', \"application/xml\")\n var newCDATA=docu.createCDATASection(_data);\n $(data).find(\"page\").eq(currentPage).find(\"content\").first().empty();\n $(data).find(\"page\").eq(currentPage).find(\"content\").first().append(newCDATA);\n sendUpdate();\n }", "title": "" }, { "docid": "1d76d47abc959e982f5713b0b0023ab0", "score": "0.5744491", "text": "function handleSaveButton() {\n if (fileEntry && hasWriteAccess) {\n writeEditorToFile(fileEntry);\n } else {\n chrome.fileSystem.chooseEntry({ type: 'saveFile' }, onSaveFile);\n }\n}", "title": "" }, { "docid": "d88b3874f3099abe12c6e3711b0ae353", "score": "0.5737496", "text": "function onEditorChange(){\n const newContent = $(\".jqte_editor\").html();\n const description = strip(newContent).substring(0, 77) + \"...\";\n\n $(\"#description\").text(breakeFormater(description));\n $(\"#content\").html(breakeFormater(newContent));\n}", "title": "" } ]
75644ca16517414874ea148841a7c5a5
Write a program that prints a staircase of size . Input Format A single integer, , denoting the size of the staircase. Output Format Print a staircase of size using symbols and spaces. Note: The last line must have spaces in it.
[ { "docid": "cd71e95e4cb509103506fb157b2b6850", "score": "0.5447455", "text": "function staircase(n) {\nvar i = 1;\nwhile (i<=n){\n console.log(\" \".repeat(n-i) + \"#\".repeat(i));\n i++;\n}\n}", "title": "" } ]
[ { "docid": "f588c7c4d0079322a1e978d9a1331c67", "score": "0.641146", "text": "function staircase(n) {\n const zeroBasedLength = n - 1;\n for (let i = 0, len = n; i < len; i++) {\n // let spaces = Array(12 + 1).join(\" \")\n // make 1 based fit with 0 based\n const spaces = \" \".repeat(n - (i + 1))\n const pounds = \"#\".repeat(i + 1)\n console.log(`${spaces}${pounds}`)\n }\n}", "title": "" }, { "docid": "f1834e5d182c40e0603b31bc25feb9d5", "score": "0.6227437", "text": "function staircase(n) {\n for (let line = 1; line <= n; line++) {\n let output = \"\";\n for (let spaces = line; spaces < n; spaces++) {\n output += \" \";\n }\n for (let stars = n - line; stars < n; stars++) {\n output += \"*\";\n }\n console.log(output);\n }\n}", "title": "" }, { "docid": "0cb43811ceff821e67bf0b005a5fccfb", "score": "0.6179718", "text": "function staircase(n) {\n var symbolCount = 1\n var spaceCount = n-1\n\n while (symbolCount <= n){\n var line = \"\"\n for(var i = 0; i < spaceCount; i++){\n line = line.concat(\" \")\n }\n for(var i = 0; i < symbolCount; i++){\n line = line.concat(\"#\")\n }\n symbolCount++\n spaceCount--\n console.log(line)\n }\n}", "title": "" }, { "docid": "acd85fa1b4fb564e0ef79a2354de24fb", "score": "0.5927726", "text": "function generateBraSize() {\n var output = [\"Bra Size\"];\n for (var i = 32; i < 39; i+=2) {\n output.push(i+\"AA\");\n output.push(i+\"A\");\n output.push(i+\"B\");\n output.push(i+\"C\");\n output.push(i+\"D\");\n }\n return output;\n}", "title": "" }, { "docid": "3454a2359b23188010f6208e67caff87", "score": "0.57895523", "text": "function makeSquare (size) {\n\n var asterisks = \"*\";\n var asterisksMult = asterisks.repeat(size) + '\\n';\n var asterisksSquared = asterisksMult.repeat(size);\n\n return asterisksSquared.substring(0, asterisksSquared.length - 1);\n\n}", "title": "" }, { "docid": "6d55a4dfd2b4f26ec9618dad9f52257b", "score": "0.577543", "text": "function staircase(n) {\n let staircasePrint = \"\";\n for (let i = 1; i <= n; i++) {\n staircasePrint = (\" \").repeat(n - i) + (\"#\").repeat(i);\n console.log(staircasePrint);\n }\n}", "title": "" }, { "docid": "a3fd8ef2577cf42260df0bd629f71d3b", "score": "0.5727147", "text": "function staircase(stairs) {\n for (let i = 1; i <= stairs; i++) {\n console.log(\" \".repeat(stairs - i) + \"#\".repeat(i));\n }\n}", "title": "" }, { "docid": "b2759202228fc7fbc5f2928b87ac7165", "score": "0.5687623", "text": "function creatediamondShape(size){\n for(var i=1;i<=size;i++){\n for(var s=size-1;s>=i;s--){\n process.stdout.write(\" \");\n }\n for(var j=1;j<=i;j++){\n process.stdout.write(\"* \")\n }\n console.log();\n }\n if(i==size+1){\n for(var i=1;i<=size-1;i++){\n for(var s=1;s<=i;s++){\n process.stdout.write(\" \");\n }\n for(j=i;j<=size-1;j++){\n process.stdout.write(\"* \");\n }\n console.log();\n }\n }\n }", "title": "" }, { "docid": "eadb66326e9433fda1511e0462ca5b52", "score": "0.5567028", "text": "function printSquare(size) {\n var row = '';\n // solution without using repeat method\n // for (var i = 0; i < size; i++) { \n // row += '*';\n // }\n // for (var i = 0; i < size; i++)\n // console.log(row);\n\n for (var i = 0; i < size; i++) {\n console.log('*'.repeat(size));\n }\n}", "title": "" }, { "docid": "82928916bf8c0bad6d9c61932431d041", "score": "0.5561874", "text": "function staircase(n) {\n\tvar s = '';\n\tfor(var i =1; i <= n; i++){\n\t\ts+= ' '.repeat(n - i) + '#'.repeat(i) + '\\n';\n\t}\n\tconsole.log(s);\n}", "title": "" }, { "docid": "57a16bd8e7a0df63be517aaa9e519ef9", "score": "0.55561006", "text": "function printShape(shape, height, character){\n switch(shape){\n case \"Square\":\n j=\"\";\n k=\"\";\n for(i=0;i<height;i++){\n j=j+character;\n }\n for(i=0;i<height;i++){\n k= k+j + \"\\n\";\n }\n console.log(k);\n break;\n case \"square\":\n j=\"\";\n k=\"\";\n for(i=0;i<height;i++){\n j=j+character;\n }\n for(i=0;i<height;i++){\n k= k+j + \"\\n\";\n }\n console.log(k);\n break; \n case \"Triangle\":\n j=character;\n for(i=0;i<height;i++){\n console.log(j);\n j=j+character;\n }\n break;\n case \"triangle\":\n j=character;\n for(i=0;i<height;i++){\n console.log(j);\n j=j+character;\n }\n break; \n case \"Diamond\":\n k=0;\n space= \"\";\n l=\"\";\n m=\"\";\n for(i=1;i<=height+height;i=i+2){\n k=Math.abs((height-i)/2);\n if(i<=height){\n l=l+character; \n }else{\n l=l.slice(0,(height*2)-i);\n }\n for(j=0;j<k;j++){\n space= space+ \" \";\n }\n console.log(space + l+m);\n space = \"\";\n if(i<height){\n m=l;\n }else{\n m=\"\";\n }\n // m.slice(1,Math.abs(i-l.length-height));\n }\n break; \n case \"diamond\":\n k=0;\n space= \"\";\n l=\"\";\n m=\"\";\n for(i=1;i<=height+height;i=i+2){\n k=Math.abs((height-i)/2);\n if(i<=height){\n l=l+character; \n }else{\n l=l.slice(0,(height*2)-i);\n }\n for(j=0;j<k;j++){\n space= space+ \" \";\n }\n console.log(space + l+m);\n space = \"\";\n if(i<height){\n m=l;\n }else{\n m=\"\";\n }\n // m.slice(1,Math.abs(i-l.length-height));\n }\n break; \n\n\n}\n}", "title": "" }, { "docid": "a5b12d3f8e23730916c69d202f33f5a1", "score": "0.55376196", "text": "function staircase(n) {\n for (let i = 0; i < n; i++) {\n // Print spaces\n let space = \"\", crosses=\"\";\n for (let j = 0; j < n-i-1; j++) {\n space += \" \";\n }\n for (let j = n-i-1; j < n; j++) {\n crosses += \"#\";\n }\n console.log(space+crosses);\n }\n}", "title": "" }, { "docid": "0050517cfd546c35676c335c7da2c7e6", "score": "0.55039895", "text": "function printSquare(size) {\n var row = \"\";\n for (var i = 0; i <= size; i++) {\n row += \"*\";\n }\n for (var j = 0; j <= size; j++) {\n console.log(row);\n }\n}", "title": "" }, { "docid": "312b01cdd94234018d5984671b1c3ad2", "score": "0.54636514", "text": "function staircase(n) {\r\n for (let i = 1; i <= n; i++){\r\n for (let j=0;j < (n-i); j++){\r\n process.stdout.write(\" \");\r\n }\r\n for(let j=(n-i);j<n; j++){\r\n process.stdout.write(\"#\");\r\n }\r\n process.stdout.write(\"\\n\");\r\n }\r\n}", "title": "" }, { "docid": "816d364cd382c0772288eb5100eff177", "score": "0.545927", "text": "function createWhiteSpace(item, sectionSize){\n if(typeof item === \"number\"){\n var numString = item.toString();\n var spaceLength = sectionSize - numString.length;\n } else {\n var spaceLength = sectionSize - item.length;\n }\n \n var display = \" \" + item + new Array(spaceLength).join(\" \") + \" \";\n return display;\n}", "title": "" }, { "docid": "b9c140f7986896f605966917ea22185f", "score": "0.5440325", "text": "function stringy(size) {\n console.log(size);\n let str = '1';\n for (let i = 1; i < size; i++) {\n if (i % 2 !== 0) str += '0'\n else str += '1';\n }\n console.log(str);\n return str;\n}", "title": "" }, { "docid": "1c542326d37de7ed1152220b279bb751", "score": "0.5401728", "text": "function printSize(talla, stocks,isBackSoon,listaSkuBackSoon,showProductNoStock, single, isComingSoon, listaSkuComingSoon) {\n inventory = checkSell(stocks, talla.id);\n\n if(talla.desc){\n return printSizeWithStock(talla, inventory,isBackSoon,listaSkuBackSoon,showProductNoStock, single, isComingSoon, listaSkuComingSoon);\n }else{\n return '';\n }\n\n}", "title": "" }, { "docid": "9511e44125edce8adaf1572713995c48", "score": "0.5383037", "text": "function spaces(num, char){\n var blankSpace = \"\";\n for ( var i = 0; i < num ; i++ ){\n blankSpace = blankSpace + \" \" + num + \" |\";\n }\n return blankSpace;\n }", "title": "" }, { "docid": "dc405caae883dfa99cfb319b92b0a6b1", "score": "0.53813225", "text": "function printSquare(size) {\n for (let i = 0; i<size; i++) {\n let emptyString = \"\";\n for (let j = 0; j<size; j++) {\n emptyString += \"*\";\n }\n console.log(emptyString);\n }\n}", "title": "" }, { "docid": "4fd08287fc29611df7b55c446f6a2833", "score": "0.535764", "text": "function staircase(n) {\n let param = n;\n let resultLine = '';\n //concat each result in resultLine\n for (let i = 1; i <= n; i++) {\n for (let j = 1; j <= n; j++) {\n if (j < param) {\n resultLine += ' ';\n } else {\n resultLine += '#';\n }\n }\n console.log(resultLine);\n resultLine = '';\n param--;\n }\n}", "title": "" }, { "docid": "3c78c23f3a91420dd3ec45225753cee8", "score": "0.53428674", "text": "function main() {\r\n var n = parseInt(readLine());\r\n staircase(n);\r\n}", "title": "" }, { "docid": "090eae6c94c21ce5c780588f2002f689", "score": "0.5340429", "text": "function stars(length) {\n var stufftoprint = ''\n for(i = 0; i < length; i++) {\n printStars(length + \"\\n\")\n } \n stufftoprint = '' \n}", "title": "" }, { "docid": "e3a77065a2a5f9ab44339b4767fbeab7", "score": "0.5311452", "text": "function FormatSize( size )\n{\n var gb = 1073741824;\n var mb = 1048576;\n var kb = 1024;\n var rs;\n \n if( size > gb )\n rs = Math.round( size / gb ) + \" GB\";\n else if( size > mb )\n rs = Math.round( size / mb ) + \" MB\";\n else if( size > kb )\n rs = Math.round( size / kb ) + \" KB\"; \n else\n rs = size + \" B\";\n \n return( rs );\n}", "title": "" }, { "docid": "d6f8d350bdb9c2f10147b00d0cb67b42", "score": "0.5305357", "text": "function drawLeftStars(num){\n var star = \"*\";\n var space= \" \";\n console.log(star.repeat(num) + space.repeat(75-num));\n}", "title": "" }, { "docid": "04039b9167b4fdff68e44ecb52c89c56", "score": "0.5302449", "text": "function makeSquare(squareSize) {\n let square = ''\n let star = '*'\n\n for (let i = 0; i < squareSize; i++) {\n if (i < squareSize - 1) {\n square += star.repeat(squareSize) + '\\n'\n }else square += star.repeat(squareSize)\n }\n return square\n}", "title": "" }, { "docid": "5f36a74c01f30f334724e0fd4385ea94", "score": "0.5300784", "text": "function drawsquare(size, brush=\"*\"){\r\n let result=\"\";\r\n for (let i = 1; i <= size; i++) { \r\n let row=\" \";\r\n for (let j = 1; j <= size; j++) \r\n { \r\n if (j === i || j === (size + 1 - i)) row += brush;\r\n else row+=\" \";\r\n }\r\n row += \"\\n\";\r\n result+=row;\r\n }\r\n return result;\r\n}", "title": "" }, { "docid": "826b627d51c30367b4be2b2b800186ed", "score": "0.52902997", "text": "function square(lines) {\n\n //Error checking for arguments validity\n if ((arguments.length != 1) || (typeof(lines)!=\"number\") || lines<=1){\n throw new UserException('Please pass only one parameter that is an integer greater than one to the function');\n }\n\n //Using a loop to go through the number of lines and print the square\n for(i=1;i<=lines;i++){\n str=\"\";\n if((i===1) || (i===lines)){\n for(count1=1;count1<=lines;count1++){\n str=str+hordash;\n }\n }\n\n else{\n for(count2=1;count2<=lines;count2++){\n str=str+space;\n }\n }\n\n console.log(verdash+str+verdash);\n \n } \n}", "title": "" }, { "docid": "e33845c89f64b5486f9bc35ce8024ca6", "score": "0.5252871", "text": "function indent_output(n, name, description) {\n if (!n) {\n n = 0\n }\n\n console.log(\n _.repeat(' ', n) +\n name +\n _.repeat(' ', 32 - n * 4 - name.length) +\n description\n )\n}", "title": "" }, { "docid": "9a4d125dd56f523a0a432960ed4cfb8f", "score": "0.52464455", "text": "function indent_output(n, name, description) {\n if (!n) {\n n = 0;\n }\n\n console.log(\n _.repeat(' ', n)\n + name\n + _.repeat(' ', 32 - n * 4 - name.length)\n + description\n );\n}", "title": "" }, { "docid": "70ca8f7e89c08d02abe950d6331dd54a", "score": "0.5217971", "text": "function staircase(n) {\n // Write your code here\n let numArray = [...Array(n+1).keys()];\n let sliced = numArray.slice(1) \n console.log(sliced.map(i => ' '.repeat(sliced.length - i) + '#'.repeat(i) + '\\n').join(''))\n}", "title": "" }, { "docid": "9ae297c9f590e71dac6adf57d54d6675", "score": "0.5210858", "text": "function getSizeFormat(size,prefix){\n\tvar sizes=['B','KB','MB'];\n\tvar asize=prefix || '';\n\tif (size<512)asize+=size+sizes[0];\n\telse if (size<1048576)asize+=Math.round(size/1024)+sizes[1];\n\telse asize+=(size/1048576).toFixed(1)+sizes[2];\n\treturn asize;\n}", "title": "" }, { "docid": "a459ace6a18065cf6a6fc3343edd817e", "score": "0.5190345", "text": "function whitespace(count) {\n tmp = \"\";\n for (let i = 0; i < 18 - count; i++) {\n tmp += \" \";\n }\n return tmp + \"|\";\n}", "title": "" }, { "docid": "5b619176cd125f6a997357bac15f550c", "score": "0.5189875", "text": "function staircase(n) {\n for (let i = 0; i < n; i++) {\n let stair = \"\";\n for (let j = 1; j <= n; j++) {\n if (j >= n - i) {\n stair += \"#\";\n } else {\n stair += \" \";\n }\n }\n console.log(stair);\n }\n}", "title": "" }, { "docid": "05e4db465679f95919e0ccd18e769638", "score": "0.5186724", "text": "function wpFlex(size)\t\n{\t\n\treturn 'sz='+size+';'\n}", "title": "" }, { "docid": "c904b196580255b2a62074a685c9e38c", "score": "0.5160519", "text": "function getSizeDisplay(sizeValue) {\n if (sizeValue == \"S\") {\n return \"Small\";\n } else if (sizeValue == \"M\") {\n return \"Medium\";\n } else if (sizeValue == \"L\") {\n return \"Large\";\n } else if (sizeValue == \"XL\") {\n return \"Extra-Large\";\n } else {\n // if the size value doesn't match a\n // valid value, return the original size\n return sizeValue\n }\n }", "title": "" }, { "docid": "6f5c400ab9e37a3807038db2d35090ac", "score": "0.5159863", "text": "space(spacing) { return this.options.stave.space * spacing; }", "title": "" }, { "docid": "19dab64de09b8885d0ff56ef15cd6af6", "score": "0.514691", "text": "function testSize(num) {\n if (num < 5) {\n return \"Tiny\";\n}\n else if (num < 10) {\n return \"Small\";\n}\n else if (num <15) {\n return \"Medium\";\n}\n else if (num < 20) {\n return \"Large\";\n}\n else\n return \"Huge\";\n\n}", "title": "" }, { "docid": "8e2512ae1fea49a898b8688624bb47df", "score": "0.5133902", "text": "function padding(size,ch){\n var str = '';\n if(!ch && ch !== 0){\n ch = ' ';\n }\n while(size !== 0){\n if(size & 1 === 1){\n str += ch;\n }\n ch += ch;\n size >>>= 1;\n }\n return str;\n}", "title": "" }, { "docid": "0ed3debe1cba4452bd2435d2602b11a1", "score": "0.51336336", "text": "function padding(size,ch){\n var str = '';\n if(!ch && ch !== 0){\n ch = ' ';\n }\n while(size !== 0){\n if(size & 1 === 1){\n str += ch;\n }\n ch += ch;\n size >>>= 1;\n }\n return str;\n }", "title": "" }, { "docid": "015bcea0f7004e84cac4b461b007bf45", "score": "0.51298624", "text": "function staircase(n) {\n for(var i = 1; i<=n; i++){\n var stri = ''\n for(var j = 0; j<n-i; j++) stri += ' ';\n for(var j = 0; j<i; j++) stri += '#';\n console.log(stri)\n }\n\n}", "title": "" }, { "docid": "7b1f21a417c71bc4654b693a2def0827", "score": "0.5126651", "text": "function star(size) {\n let top = [];\n\n for (let leftSpaces = 0, middleSpaces = (size - 3) / 2;\n leftSpaces < (size - 1) / 2;\n leftSpaces++, middleSpaces -= 1)\n {\n top.push(' '.repeat(leftSpaces) +'*' + \n ' '.repeat(middleSpaces) + '*' +\n ' '.repeat(middleSpaces) + '*');\n }\n\n let middle = '*'.repeat(size);\n let bottom = [...top].reverse();\n\n top.concat(middle, bottom).flat().forEach(row => console.log(row));\n}", "title": "" }, { "docid": "95b2f2ddd00bddb066e566acae1aba28", "score": "0.5126372", "text": "function printStairs(n){\r\n let str= '';\r\n for (let i= 0;i<n;i++){\r\n console.log(str+='#');\r\n}\r\n}", "title": "" }, { "docid": "30f1b8cc4896623225a6018521890c27", "score": "0.51179266", "text": "function SquareA_Help(){\n\t\t\t\t\tconsole.log(\"Just type SquareA() and inside () put the side Side Length of the square, like SquareA(5) will give you 25. It's the area of your square!\")\n\n\t\t\t\t}", "title": "" }, { "docid": "26e7eaa1dd13ca9d23211045a89bf6fa", "score": "0.5117218", "text": "function size_format (filesize) {\n\tif (filesize >= 1073741824) {\n\t\tfilesize = number_format(filesize / 1073741824, 2, '.', '') + ' Gb';\n\t} else {\n\t\tif (filesize >= 1048576) {\n\t\t\tfilesize = number_format(filesize / 1048576, 2, '.', '') + ' Mb';\n\t\t} else {\n\t\t\tif (filesize >= 1024) {\n\t\t\t\tfilesize = number_format(filesize / 1024, 0) + ' Kb';\n\t \t\t} else {\n\t\t\t\tfilesize = number_format(filesize, 0) + ' bytes';\n\t\t\t};\n \t\t};\n\t};\n return filesize;\n}", "title": "" }, { "docid": "6607443518762292a4aeddd840270bc4", "score": "0.5116384", "text": "function hrline() {\n\t\tvar newWidth = '';\n\t\tfor(var i=0; i<width; i++) {\n\t\t\tnewWidth += '-'\n\t\t}\n\t\tconsole.log(newWidth)\n\t}", "title": "" }, { "docid": "5d4066074af6fcc8eaef4a0a855a4d4b", "score": "0.5114008", "text": "function penSize(size) {\n penWidth = size;\n document.getElementById(\"pensize\").innerHTML = penWidth;\n}", "title": "" }, { "docid": "f1b707aa2d491cca66276644c7fff936", "score": "0.50845426", "text": "function stairs(n){\n let stair = \"#\";\n let space = \" \";\n\tfor(let i=1; i<=n; i++){\n\t\tconsole.log(stair + space.repeat(n-i));\n\t\tstair = stair + \"#\";\n\t}\n}", "title": "" }, { "docid": "b53bfa1b05863d56fdfe272192bd514c", "score": "0.5074963", "text": "Printsize()\n {\n this.size;\n }", "title": "" }, { "docid": "121be1b0275dc7a903f799f980ed1115", "score": "0.50712115", "text": "function main() {\n var s = readLine();\n var result = '';\n var length = s.length;\n var col = Math.ceil(Math.sqrt(length));\n for(var i = 0; i < col; i++) {\n for(var j = 0; j < col; j++) {\n result += s[i + (j * col)] || '';\n }\n result += ' ';\n }\n console.log(result);\n}", "title": "" }, { "docid": "d3cbca3bf4fb82c5d3f248e769daeff7", "score": "0.5062377", "text": "function drawStairs(n) {\n let str = \"\"\n for(let i = 1; i < n; i++)\n str = str + \"I\\n\" + \" \".repeat(i);\n return str + \"I\";\n}", "title": "" }, { "docid": "d7d10f3990e9956c8146a9344d1c18f0", "score": "0.50581473", "text": "function stringy(size) {\n var str='';\n for( var i=1; i<=size; i++ )\n str+=i%2;\n return str;\n }", "title": "" }, { "docid": "a723539bcf2d64ef9cfd0c9551ab8fee", "score": "0.50546366", "text": "function printInBox(string) {\n console.log('+' + '-'.repeat(string.length + 2) + '+');\n console.log('|' + ' '.repeat(string.length + 2) + '|');\n console.log('| ' + string + ' |');\n console.log('|' + ' '.repeat(string.length + 2) + '|');\n console.log('+' + '-'.repeat(string.length + 2) + '+');\n}", "title": "" }, { "docid": "4266972ade16c3c5947e6eef5ac1b93e", "score": "0.50514513", "text": "function printBox(width, height) {\n console.log(\" - \".repeat(width));\n for (let i = 1; i < height - 1; i++) {\n console.log(\"| \" + \" \".repeat(width - 2) + \" |\");\n }\n console.log(\" - \".repeat(width));\n}", "title": "" }, { "docid": "cc2b305ae5282d74b154b753c5aa31f0", "score": "0.5047566", "text": "function formatSize(size) {\r\n if (size < 1000) {\r\n return size + ' B';\r\n }\r\n\r\n if (size < 1000 * 1000) {\r\n return Math.round(size / 1000) + ' kB';\r\n }\r\n\r\n if (size < 1000 * 1000 * 1000) {\r\n return Math.round(size / 1000 / 1000) + ' MB';\r\n }\r\n\r\n if (size < 1000 * 1000 * 1000 * 1000) {\r\n return Math.round(size / 1000 / 1000 / 1000) + ' GB';\r\n }\r\n\r\n return Math.round(10 * size / 1000 / 1000 / 1000 / 1000) / 10 + ' TB'; // with one decimal\r\n}", "title": "" }, { "docid": "5a691d29758398926a7e0d23d3b30abe", "score": "0.5038739", "text": "function squareStarPrinter( length ){ \n\tvar string = \"*\" \n\tvar repeater = string.repeat( length ) //repeat stars first time\n\tvar repeater2 = repeater + \"\\n\" //add a new line \n\treturn repeater2.repeat( length ) //repeat stars second time\n}", "title": "" }, { "docid": "7153e7acff93ccc3ab7519db4d1735de", "score": "0.503801", "text": "function makeSpace(numSpaces){\nvar newSpace = ' ';\nfor(var i = 1; i< numSpaces; i++){\n newSpace = newSpace + ' ';\n }\nreturn newSpace;\n}", "title": "" }, { "docid": "654349ea18d78e166dee759874e107fe", "score": "0.5035071", "text": "function printThings(Num) {\n\n display.type = 'text';\n display.value = Num;\n fontSize();\n \n}", "title": "" }, { "docid": "ed315f3f75416fdbc6b38e4fb50443df", "score": "0.50293714", "text": "function drawCenteredStars(num) {\n let remainder = 75 - num;\n let spaces = '';\n let stars = '';\n for (let i = 0; i < num && i < 75; i++) {\n stars += '*';\n }\n for (let i = 0; i < remainder / 2; i++) {\n spaces += ' ';\n }\n console.log(spaces + stars);\n}", "title": "" }, { "docid": "62fbdfde1bf5993afed003ef3caffad9", "score": "0.5027938", "text": "function printTriangle(length) {\n var space = '';\n\n for (i = 0; i < length; i++) {\n space += \"*\";\n console.log(space);\n }\n\n}", "title": "" }, { "docid": "3322ee510aa1d98a5a30953636b964b4", "score": "0.5014363", "text": "function tab(n){\n var tab = \"\";\n for(var i = 0; i <= n; i++){\n tab += \"&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp\"; // 8-space \"tab\"\n }\n return tab;\n}", "title": "" }, { "docid": "e5dccb4a3c3ed7aa9bc8119c435a83a0", "score": "0.50103515", "text": "function stairs(n) {\n for(let i = 1; i <= n; i++) {\n console.log((\" \").repeat(n-i).concat((\"#\").repeat(i)).concat(\"\"));\n }\n}", "title": "" }, { "docid": "df0e67ed78e860b6a5f9955b393091b9", "score": "0.5006002", "text": "function drawStairs(n) {\n let str = '';\n let x = ' ';\n for (let i = 1; i <= n; i++) {\n if (i === n) return str += 'I';\n str += \"I\\n\";\n for (let y = 1; y <= i; y++) {\n str += x;\n }\n }\n return str;\n}", "title": "" }, { "docid": "a8a44077d4ddd22ae2e03b784044fc33", "score": "0.4998111", "text": "function staircase(n) {\n for( let r = 1; r <= n; r++ ) {\n let blanks = [...Array(n-r)].map( r => ' ');\n let hashes = [...Array(n-(n-r))].map( r => '#');\n console.log([...hashes, ...blanks].join(''));\n }\n}", "title": "" }, { "docid": "4297f7b052bc8a920723d4b4b42790cd", "score": "0.49962395", "text": "function drawRightStars(num) {\n let remainder = 75 - num;\n let spaces = '';\n let stars = '';\n for (let i = 0; i < num && i < 75; i++) {\n stars += '*';\n }\n for (let i = 0; i < remainder; i++) {\n spaces += ' ';\n }\n console.log(spaces + stars);\n}", "title": "" }, { "docid": "853a2d6c4a0fe5ac1072cc8686f9d619", "score": "0.49877438", "text": "function drawStars(arr) {\n for (let i = 0; i < arr.length; i++) {\n if (typeof arr[i] == \"string\") {\n console.log(arr[i].charAt(0).toLowerCase().repeat(arr[i].length));\n } else {\n console.log(\"*\".repeat(arr[i]));\n }\n }\n}", "title": "" }, { "docid": "39921ea5f76f9475d5afa9034937b7ba", "score": "0.49840218", "text": "function floyd () {\n var count = 1;\n for (var i = 1; i <= 4; i++) {\n var extraSpace = \"\";\n for (var j = 1; j <= i; j++) {\n extraSpace += count + \" \";\n count++;\n }\n console.log(extraSpace);\n }\n}", "title": "" }, { "docid": "d0b0e03dc42e441a495d32693ee80271", "score": "0.49831674", "text": "function CalculateSpace(numLine : int){\n\tvar moveToNextInt : int = moveToNext[numLine];\n\tif (!moveToNextInt)\n\t\treturn lBorder + widthText;\n\telse\n\t\treturn lBorder + widthText - letterSpots[moveToNextInt - 1].x;\n}", "title": "" }, { "docid": "2e584607274a6306fc18408f1689fb9e", "score": "0.49813718", "text": "zeroPad(number, size)\n {\n let stringNum = String(number);\n while(stringNum.length < (size || 2)) stringNum = \"0\" + stringNum;\n return stringNum;\n }", "title": "" }, { "docid": "fc2e3cd10514d427901f62d6ad007a06", "score": "0.4973172", "text": "function drawStars() {\n var counter = 10;\n\n //this internal function that generate string that include '*'\n function drawling(end) {\n var str = '';\n\n for(j = 0; j < end; j++) {\n str += '*';\n }\n return str;\n }\n\n for(i = 9; i <= 29; i += counter) {\n console.log(drawling(i));\n counter -= 2;\n\n if (!counter) {\n break;\n }\n }\n\n counter = 0;\n\n for(i = 29; i >= 9; i -= counter) {\n console.log(drawling(i));\n counter += 2;\n\n if (!counter) {\n break;\n }\n }\n}", "title": "" }, { "docid": "35868cd49c4549e9acddc368998d12d6", "score": "0.4971508", "text": "function drawLeftStars(num) {\n\tvar textField = \"\";\n\tfor(var i = 1; i <= 75; i++) {\n\t\tif(num > 0) {\n\t\t\ttextField += \"*\";\n\t\t\tnum--;\n\t\t} else {\n\t\t\ttextField += \" \";\n\t\t}\n\t}\n\tconsole.log(textField);\n}", "title": "" }, { "docid": "3ab9315845f7becdae2158641ccb3a07", "score": "0.49713114", "text": "function printStairs(n) {\n let i;\n let str=\"#\";\n for(i=0; i<=n; i++){\n console.log(str.repeat(i));\n } \n }", "title": "" }, { "docid": "fba70e6d7abef616619d717176d4e7b9", "score": "0.497079", "text": "function basePrint(sizeArrow){\n starNumberRepeat = sizeArrow*2 -1 \n base = \"*\".repeat(starNumberRepeat)\n console.log(base)\n}", "title": "" }, { "docid": "a9d7b1540608fe0bc496a4fb25f416eb", "score": "0.49706176", "text": "function fmt(value, defaultWidth) {\n if (flag == '-') // No padding.\n return value;\n\n if (flag == '^') // Convert to uppercase.\n value = String(value).toUpperCase();\n\n if (typeof width == 'undefined')\n width = defaultWidth;\n\n // If there is no width specifier, there's nothing to pad.\n if (!width)\n return value;\n\n if (flag == '_') // Pad with spaces.\n return lpad(value, ' ');\n\n // Autodetect padding character.\n if (typeof value == 'number')\n return lpad(value, '0');\n\n return lpad(value, ' ');\n }", "title": "" }, { "docid": "b04963b757325001c6c68ae7efb7687c", "score": "0.49599326", "text": "function inserts_dashes (strInput) {\n\tconsole.log(strInput);\t\n//var strInput = \"7286924\"//prompt(\"Please enter your mumber as a string\");\nvar strOutput = \"\";\n\tfor (var i = 0; i < strInput.length-1; i++) {\n\t\t\t\n\t\t\tif (parseInt(strInput.charAt(i)) % 2 == 0 && parseInt(strInput.charAt(i+1)) % 2 == 0) {\n\t\t\t\tstrOutput += parseInt(strInput.charAt(i)).toString() + '-' ;\n\t\t\t\t}\n\t\t\telse{\n\t\t\t\tstrOutput += parseInt(strInput.charAt(i)).toString();\n\t\t\t\t}\n\t\t\tif(i == strInput.length-2)\t{\n\t\t\t\tstrOutput += strInput.charAt(strInput.length-1);\n\t\t\t\t}\n\t\t\t}\n\t\t\tconsole.log(strOutput);\n}", "title": "" }, { "docid": "7ae0673f49d9e620148ef1fce31bc555", "score": "0.49520957", "text": "function snowboardSize() {\n var value = document.getElementById(\"myList\").value; \n var snowboarddiv = document.getElementById(\"snowboard\");\n switch(value) {\n case \"109cm\":\n // document.write(\"Your snowboard size is between 90cm and 105cm\");\n snowboarddiv.innerHTML = 'Your snowboard size is between 90cm and 105cm';\n break;\n case \"124cm\":\n snowboarddiv.innerHTML = 'Your snowboard size is between 110cm and 120cm';\n break;\n case \"137cm\":\n snowboarddiv.innerHTML = 'Your snowboard size is between 115cm and 130cm';\n break;\n case \"147cm\":\n snowboarddiv.innerHTML = 'Your snowboard size is between 125cm and 135cmm';\n break;\n case \"155cm\":\n snowboarddiv.innerHTML = 'Your snowboard size is between 130cm and 140cm';\n break;\n case \"160cm\":\n snowboarddiv.innerHTML = 'Your snowboard size is between 135cm and 145cm';\n break;\n case \"163cm\":\n snowboarddiv.innerHTML = 'Your snowboard size is between 140cm and 150cm';\n break;\n case \"165cm\":\n snowboarddiv.innerHTML = 'Your snowboard size is between 145cm and 152cm';\n break;\n case \"168cm\":\n snowboarddiv.innerHTML = 'Your snowboard size is between 148cm and 153cm';\n break;\n case \"170cm\":\n snowboarddiv.innerHTML = 'Your snowboard size is between 150cm and 155cm';\n break;\n case \"173cm\":\n snowboarddiv.innerHTML = 'Your snowboard size is between 152cm and 155cm';\n break;\n case \"175cm\":\n snowboarddiv.innerHTML = 'Your snowboard size is between 153cm and 157cm';\n break;\n case \"178cm\":\n snowboarddiv.innerHTML = 'Your snowboard size is between 154cm and 159cm';\n break;\n case \"180cm\":\n snowboarddiv.innerHTML = 'Your snowboard size is between 155cm and 160cm';\n break;\n case \"183cm\":\n snowboarddiv.innerHTML = 'Your snowboard size is between 156cm and 162cm';\n break;\n case \"185cm\":\n snowboarddiv.innerHTML = 'Your snowboard size is between 157cm and 163cm';\n break;\n case \"188cm\":\n snowboarddiv.innerHTML = 'Your snowboard size is between 158cm and 166cm';\n break;\n case \"191cm\":\n snowboarddiv.innerHTML = 'Your snowboard size is between 159cm and 167cm';\n break;\n case \"193cm\":\n snowboarddiv.innerHTML = 'Your snowboard size is between 160cm and 170cm';\n break;\n default:\n text = \"Snowboarding is the best lol...\";\n }\n /* calling the switch statement in the function */\n window.onclick = document.getElementById('myList').onclick = snowboardSize();\n\n}", "title": "" }, { "docid": "08d86523e704d386634448c860eda7d0", "score": "0.49498904", "text": "function printStars(count) {\n //body of the function\n console.log('*'.repeat(count))\n}", "title": "" }, { "docid": "25ec8d0696ec52b61f67446c9246aec6", "score": "0.49457636", "text": "function draw1(width, hight) {\n for (var i = 0; i < hight; i++) {\n document.write(\"*\");\n for (var i_5 = 0; i_5 < width - 2; i_5++) {\n document.write(\"\\xa0\");\n }\n document.write(\"*\" + \"<br>\");\n }\n}", "title": "" }, { "docid": "8d5c8b1b6d0e5b96fa8df89ba4d33fce", "score": "0.49411428", "text": "function nbsp(x) {\n var times = x || 1;\n var returns = \"\";\n for (var x = 0; x < times; x++)\n returns += String.fromCharCode(0xA0);\n return returns;\n}", "title": "" }, { "docid": "59eaa03aee6529d59085f13e5bc53b81", "score": "0.49380276", "text": "function starPrinter( length ){\n\tvar string = \"*\"\n\treturn string.repeat( length )\n\t}", "title": "" }, { "docid": "40a23bfc67b78926560b45a16e31ad6e", "score": "0.49366704", "text": "function formatOutput(s, nibbleLen) {\n if (s == 0) return \"0\";\n\n s = s.toString();\n\n var result = \"\";\n\n for (var i = s.length; i > 0; i -= nibbleLen) {\n\n var nibble = s.substring(i - nibbleLen, i);\n\n // Complete the nibble with zeros\n // while (nibble.length < nibbleLen) {\n // nibble = \"0\" + nibble;\n // }\n\n result = nibble + \" \" + result;\n }\n\n return result.toUpperCase();\n}", "title": "" }, { "docid": "eb97a2f15f0528fc33d17ceeb3e87146", "score": "0.49331143", "text": "function fixedWidthStr(inp, size, fill) {\n fill = typeof fill == 'undefined' ? ' ' : fill;\n var out = \"\" + inp;\n var diff = size - out.length;\n var extra = '';\n for(var i = 0; i < diff; i++)\n extra += fill;\n out = extra + out;\n return out.slice(0, size);\n}", "title": "" }, { "docid": "5fcc0eed4dd73b3991b57007f8d78fb9", "score": "0.4930072", "text": "function printStairs(n) {\n let str = \"\";\n for (let i = 0; i < n; i++) {\n console.log(str)\n str += \"#\";\n }\n }", "title": "" }, { "docid": "8e3630202a8bbf39d1d813342aceeab2", "score": "0.49244866", "text": "function _line(size) {\r\n\tlet len = size || 80,\r\n\t\tstr = '';\r\n\r\n\twhile (len--) {\r\n\t\tstr += '-';\r\n\t}\r\n\r\n\treturn str;\r\n}", "title": "" }, { "docid": "c90274a3f3302cc7fc855eb348d2d30c", "score": "0.4922523", "text": "function ScratchPad() {}", "title": "" }, { "docid": "4147375a4b2a2c7dddefaf53667d35a6", "score": "0.4919178", "text": "function printBox(width, height) {\n console.log(\"*\".repeat(width));\n for (var i = 0; i < (height - 2); i++) {\n console.log(\"*\" + \" \".repeat(width - 2) + \"*\");\n }\n console.log(\"*\".repeat(width));\n}", "title": "" }, { "docid": "7aaf5ea3bf04ae294736ad761b0d3c67", "score": "0.4905738", "text": "function testSize(num) {\n // Only change code below this line\nif(num < 5){\n return \"Tiny\"\n} else if(num < 10){\n return \"Small\"\n} else if(num < 15){\n return \"Medium\"\n} else if (num < 20){\n return \"Large\"\n} else if(num >= 20){\n return \"Huge\"\n} else {\n return \"Change Me\";\n}\n\n // Only change code above this line\n}", "title": "" }, { "docid": "fe651cb117db77efc09ec0abed4a0fe7", "score": "0.4895096", "text": "function printStars(number) {\n let result = \"*\"\n console.log(result);\n for (let i = 1; i < number; i++) {\n result = result.concat(\" *\");\n console.log(result);\n }\n}", "title": "" }, { "docid": "fd45590ac2703d7f7e16982de139089f", "score": "0.48892528", "text": "function spaces(n){\n var space = \"\";\n for(var i = 0; i <= n; i++){\n space += \"&nbsp\"; // space\n }\n return \"<span id='spacedOut'>\" + space + \"</span>\";\n}", "title": "" }, { "docid": "4b2b3a04252290c740b783424a72ba34", "score": "0.4884203", "text": "function addS(num) {\r\n if(num === 1) {\r\n return '';\r\n } else {\r\n return 's';\r\n }\r\n}", "title": "" }, { "docid": "5c560e97ea5b61c4116c69ac74977dec", "score": "0.487477", "text": "function zeroPad(num, size) {\n var s = num + \"\";\n while (s.length < size)\n s = \"0\" + s;\n return s;\n }", "title": "" }, { "docid": "49466843625ed69d400a67fb1c7bc14a", "score": "0.4871501", "text": "function pyramid2(height){\n let str = '';\n for(let i=1; i<=height; i++){\n for(let k=1; k<=height-i; k++){\n str += \"\\t\";\n }\n for(let j=1; j<=i; j++){\n str += \"*\\t\\t\";\n }\n console.log(str);\n str = \"\";\n }\n}", "title": "" }, { "docid": "9e1abd7bbcf4e49751cf6c70699e37c6", "score": "0.48682526", "text": "function Hunger()\n{\n\tif(aNumber <= 9)\n\t{\t//\tTest if number is divisible by 3. If so output Hunger - Proper Spacing under 10 - Line 1\n\t\tdocument.write(aLine4 + aNumber + aLine1 + aString1 + aBreaker);\n\t}\n\telse if((aNumber >= 10) && (aNumber <= 99))\n\t{\t//\tTest if number is divisible by 3. If so output Hunger - Proper Spacing from 10 up to 99 - Line 2\n\t\tdocument.write(aLine4 + aNumber + aLine2 + aString1 + aBreaker);\n\t}\n\telse\n\t{\t//\tTest if number is divisible by 3. If so output Hunger - Proper Spacing from 100 up to 1,000 - Line 3\n\t\tdocument.write(aLine4 + aNumber + aLine3 + aString1 + aBreaker);\n\t}\n\t\n}", "title": "" }, { "docid": "a20c025f4d698aad258d1949665710ed", "score": "0.48671505", "text": "function Size(length,width,thickness){\n\nthis.length= length;\nthis.width = width;\nthis.thickness = thickness;\nthis.script=\"\";\n\n}", "title": "" }, { "docid": "705825afcb786a061c18ae4a4a598063", "score": "0.4864605", "text": "function makeBox (width, height) {\n\n var asterisks = \"*\";\n var finalBox = \"\";\n var lineTop = asterisks.repeat(width) + '\\n';\n var lineMiddle = \"\";\n var lineBottom = asterisks.repeat(width);\n\n function noAsterisks () {\n if (height >= 3 && width >= 3) {\n lineMiddle = lineMiddle + \"*\" + ( \" \".repeat(width - 2) ) + \"*\" + '\\n';\n }\n }\n\n function ifHeiWid () {\n if (height === 1) {\n finalBox = finalBox + lineBottom;\n } else if (height === 2) {\n finalBox = finalBox + lineTop + lineBottom;\n } else if (width === 1 || width === 2) {\n finalBox = finalBox + ( lineTop.repeat(height - 1) ) + lineBottom;\n } else {\n finalBox = finalBox + lineTop + ( lineMiddle.repeat(height - 2) ) + lineBottom;\n }\n }\n\n noAsterisks();\n ifHeiWid();\n return finalBox;\n\n}", "title": "" }, { "docid": "dedcae43beb13efdc5ab7ba4b2ad0ade", "score": "0.48625448", "text": "function drawStarSide(size) {\n penWidth(2);\n arcLeft(size,size);\n}", "title": "" }, { "docid": "21e3f5177574a3bda15408123841a7fe", "score": "0.48580816", "text": "function pad(s,n){\n s = s.toString() + \" \"; \n return ( s.substring(0,n));\n}", "title": "" }, { "docid": "f9a2bb68ffb2e7948843dc971889eafd", "score": "0.48528144", "text": "function display(arr, size) {\n\n for (var i = 0; i < size; i++)\n document.write(\"\\n\" + arr[i]);\n}", "title": "" }, { "docid": "e9edbaca6699acccaf18f143005a2a89", "score": "0.4847083", "text": "function star(size) {\n var result = [];\n var first = '*' + ' '.repeat((size - 3) / 2);\n for (var i = 0; i < (size - 1) / 2; i++) {\n var line = first + '*' + first.split('').reverse().join('');\n console.log(line);\n result.push(line);\n first = ' ' + first.slice(0, -1);\n }\n console.log('*'.repeat(size))\n for (var i = result.length - 1; i >= 0; i--) {\n console.log(result[i]);\n }\n}", "title": "" }, { "docid": "d7d813116c5c953721f30eb61d37c472", "score": "0.48462003", "text": "function printPyramid(length) {\n var times = 0;\n var level = '';\n var spaces = 0;\n for (var idx = 1; idx <= length; idx++) {\n level = '';\n times = idx;\n spaces = length - idx;\n while (times > 0) {\n while (spaces > 0) {\n level += ' ';\n spaces--;\n }\n level += '* ';\n times--;\n }\n console.log(level.length);\n console.log(level);\n }\n}", "title": "" }, { "docid": "1e5729b68d320aae467e0b6261b3dcc5", "score": "0.4829295", "text": "function byteSizeFormat(size) {\n var tier = size > 0 ? Math.floor(Math.log(size) / Math.log(1024)) : 0;\n var n = size / Math.pow(1024, tier);\n\n if (tier > 0) {\n n = Math.floor(n * 10) / 10; // Preserve only 1 digit after decimal.\n }\n\n return String(n) + [\"B\", \"K\", \"M\", \"G\", \"T\"][tier];\n}", "title": "" } ]
357785e1c598310a70c2f1bfa261bbd3
Filters row numbers by time (if applicable) for a given region mapped ImageryLayer
[ { "docid": "8b3d83fb0a055f0cfadbf411df1d2487", "score": "0.64128035", "text": "getImageryLayerFilteredRows(input, currentTimeRows, rowNumbers) {\n if (!isDefined(rowNumbers))\n return;\n if (!isDefined(currentTimeRows)) {\n return Array.isArray(rowNumbers) ? rowNumbers[0] : rowNumbers;\n }\n if (typeof rowNumbers === \"number\" &&\n currentTimeRows.includes(rowNumbers)) {\n return rowNumbers;\n }\n else if (Array.isArray(rowNumbers)) {\n const matchingTimeRows = rowNumbers.filter(row => currentTimeRows.includes(row));\n if (matchingTimeRows.length <= 1) {\n return matchingTimeRows[0];\n }\n //In a time-varying dataset, intervals may\n // overlap at their endpoints (i.e. the end of one interval is the start of the next).\n // In that case, we want the later interval to apply.\n return matchingTimeRows.reduce((latestRow, currentRow) => {\n var _a, _b, _c, _d;\n const currentInterval = (_b = (_a = input.style.timeIntervals) === null || _a === void 0 ? void 0 : _a[currentRow]) === null || _b === void 0 ? void 0 : _b.stop;\n const latestInterval = (_d = (_c = input.style.timeIntervals) === null || _c === void 0 ? void 0 : _c[latestRow]) === null || _d === void 0 ? void 0 : _d.stop;\n if (currentInterval &&\n latestInterval &&\n JulianDate.lessThan(latestInterval, currentInterval)) {\n return currentRow;\n }\n return latestRow;\n }, matchingTimeRows[0]);\n }\n }", "title": "" } ]
[ { "docid": "2f3f2c72c31e3b21ddd2a68ef6e12cea", "score": "0.5623865", "text": "getImageryLayerFeatureInfo(input, feature, currentTimeRows) {\n var _a;\n if (isDefined(input.style.regionColumn) &&\n isDefined(input.style.regionColumn.regionType) &&\n isDefined(input.style.regionColumn.regionType.regionProp)) {\n const regionType = input.style.regionColumn.regionType;\n if (!isDefined(regionType))\n return undefined;\n const regionIds = (_a = input.style.regionColumn.valuesAsRegions.regionIdToRowNumbersMap.get(feature.properties[regionType.regionProp].toLowerCase())) !== null && _a !== void 0 ? _a : [];\n const filteredRegionId = this.getImageryLayerFilteredRows(input, currentTimeRows, regionIds);\n let d = isDefined(filteredRegionId)\n ? this.getRowValues(filteredRegionId)\n : null;\n if (d === null)\n return;\n // Preserve values from d and insert feature properties after entries from d\n const featureData = Object.assign({}, d, feature.properties, d);\n const featureInfo = new ImageryLayerFeatureInfo();\n if (isDefined(regionType.nameProp)) {\n featureInfo.name = featureData[regionType.nameProp];\n }\n featureData.id = feature.properties[regionType.uniqueIdProp];\n featureInfo.properties = featureData;\n featureInfo.configureDescriptionFromProperties(featureData);\n featureInfo.configureNameFromProperties(featureData);\n // If time-series region-mapping - show timeseries chart\n if (!isDefined(featureData._terria_getChartDetails) &&\n this.discreteTimes &&\n this.discreteTimes.length > 1 &&\n Array.isArray(regionIds)) {\n featureInfo.properties._terria_getChartDetails = getChartDetailsFn(this.activeTableStyle, regionIds);\n }\n return featureInfo;\n }\n return undefined;\n }", "title": "" }, { "docid": "a8d3213c21b7fb7bf5148c1e454e89ad", "score": "0.5586575", "text": "function filter_region(x) {\n return x.region === val;\n }", "title": "" }, { "docid": "8e7b5e3bc931644388a9ff73316fe70d", "score": "0.5559512", "text": "function filterByViewPort() {\n\n clearLayerSource(filterLayerVector);\n\n mapObj.cql = \"INTERSECTS(\" + geomField + \",\" + convertToWktPolygon(getMapBbox()) + \")\";\n\n // Update the image cards in the list via spatial bounds\n wfsService.updateSpatialFilter(mapObj.cql);\n //this.updateFootPrintLayer(mapObj.cql);\n //updateFootPrints(mapObj.cql);\n\n }", "title": "" }, { "docid": "a421d2ecac5230219496d27b52192b88", "score": "0.5542202", "text": "function renderRegions() {\n clearRegions()\n\n colorQuantiler = new Quantiler(\n Object.values(sbaData).map(region => region[colorField]),\n numQuantiles)\n \n\n\n\n Object.values(sbaData).forEach(function(row) {\n const colorVariable = row[colorField]\n const filterVariable = row[filterField]\n\n if(filterRange[0] <= filterVariable && filterVariable <= filterRange[1]) {\n // update the existing row with the new data\n const feature = map.data.getFeatureById(row.region)\n if(feature)\n feature.setProperty('colorVariable', colorVariable); \n }\n\n });\n\n $('#legend-min').text(round(fields[colorField].extent[0], 1))\n $('#legend-max').text(round(fields[colorField].extent[1], 1))\n}", "title": "" }, { "docid": "31a42fa2d811df827a7ea4dba902fa1f", "score": "0.5475364", "text": "function filterByViewPort() {\n clearLayerSource(filterLayerVector);\n\n mapObj.cql =\n \"INTERSECTS(\" +\n geomField +\n \",\" +\n convertToWktPolygon(getMapBbox()) +\n \")\";\n\n // Update the image cards in the list via spatial bounds\n wfsService.updateSpatialFilter(mapObj.cql);\n }", "title": "" }, { "docid": "48b260b5c38cae7de497e258510c60e4", "score": "0.5442556", "text": "function onFilterByTimeAndDate(date, time){\n\ttimeFilterResult = new Array();\n\ttimeFilterResult = getAllLocationsWithEventAtDateAndTime(date, time, allLocationsInRadius);\n\tsetIconsFromFilterResult(dateFilterResult.matched, false);\n\tsetIconsFromFilterResult(timeFilterResult.matched, true);\n\tcreateTable(currentShown);\n}", "title": "" }, { "docid": "9dea8e3d56e6bc835348950bf19591d3", "score": "0.54063344", "text": "function queryForTimeSlices(){\n\t\n\tvar gpService = \"http://arcgis-esrifederalsciences-1681685868.us-east-1.elb.amazonaws.com/arcgis/rest/services/201307_GLDAS_Multidimensional/SoilMoistureToTable/GPServer/Make%20NetCDF%20Table%20from%20Point\";\n\tvar gp = new esri.tasks.Geoprocessor(gpService);\n \n var point = new esri.geometry.Point(-99.7230062499967,38.466490312843504);\n \n //We reproject the points into WGS84 for the service.\n var features= [];\n\n var repoGraphic = new esri.Graphic(point,null);\n features.push(repoGraphic);\n \n var featureSet = new esri.tasks.FeatureSet();\n featureSet.features = features;\n \n var params = []; //{ inputParamaterName:featureSet };\n params[\"InputPnt\"] = featureSet; \n \n gp.execute(params, getTimeSlices);\n}", "title": "" }, { "docid": "6cd4014d61987b29e6138419501fe542", "score": "0.53910375", "text": "function filter(region){\n var allButton = document.getElementById(\"All\");\n if(region == \"All\"){\n var activeRegions = document.querySelectorAll(\".regionImagePressed\");\n for(var i=0; i<activeRegions.length; ++i){\n setHeader(activeRegions[i],false);\n }\n setHeader(allButton,true);\n }\n else{\n if(isDown(allButton)){\n setHeader(allButton,false);\n displayRegionCards(\"All\",false);\n }\n var activeRegion = document.getElementById(region);\n setHeader(activeRegion,true);\n }\n displayRegionCards(region);\n}", "title": "" }, { "docid": "c499a6c127d84fa14843a02c33254f03", "score": "0.52330065", "text": "function filterSightings(filter) {\n return filter.datetime == input;\n}", "title": "" }, { "docid": "035c3bf50c27754516d3555b9c5739c5", "score": "0.5130456", "text": "function createMediansByYears(AOI, beginYear, endYear, STARTDAY, ENDDAY, INTERVAL){\n // var imgList = [];\n var begin = beginYear;\n \n while (begin <= endYear){\n var med = createMedians(AOI, begin, STARTDAY, ENDDAY, INTERVAL);\n print(med);\n Map.addLayer(med, {bands: ['B5', 'B4', 'B3'], min: 0.0, max: 10000.0, gamma: 1.4,}, 'med_'+begin+'_'+(STARTDAY)+'_'+(STARTDAY+INTERVAL), false);\n Export.image.toDrive({\n image: med,\n description: 'My_AOI_'+begin+'_'+(STARTDAY)+'_'+(ENDDAY),\n folder: 'GEE data',\n scale: 30,\n region: geometry,\n fileFormat: 'GeoTIFF',\n formatOptions: {\n cloudOptimized: true\n }\n });\n/*\nExport.image.toAsset({\n image: med,\n description: 'My_AOI_'+begin+'_'+(STARTDAY)+'_'+(ENDDAY),\n scale: 30,\n region: geometry\n });\n */\n begin += 1\n }\n\n \n}", "title": "" }, { "docid": "3102c38799cfac42d72b08facf9bfbc8", "score": "0.51215947", "text": "function simpleWindowFilter(e,t,r,a,i){var n=e.select(t).toArray(),s=ee.List(a),m=ee.Number(ee.List(e.aggregate_array(\"system:index\")).map(function(e){return ee.Number.parse(e)}).sort().get(-1)).add(1),u=ee.Image(ee.Array(ee.List.sequence(0,m.subtract(1)).map(function(e){return ee.List.repeat(0,e).cat(s).cat(ee.List.repeat(0,ee.Number(m).subtract(ee.Number(e)[\"int\"]().add(1))))})).slice(1,Math.floor(a.length/2),-1*Math.floor(a.length/2))),d=r.toArray().matrixToDiag();u=u.matrixMultiply(d);var l=u.matrixMultiply(n).divide(u.matrixMultiply(ee.Array(ee.List.repeat([1],m))));if(i)return l;var o=ee.Number.parse(ee.List(e.aggregate_array(\"system:index\")).get(-1));return e=ee.ImageCollection(ee.List.sequence(0,o).map(function(e){var t=l.arraySlice(0,ee.Number(e)[\"int\"](),ee.Number(e).add(1)[\"int\"]()).arrayProject([1]).arrayFlatten([[\"mean\"]]);return t}))}", "title": "" }, { "docid": "638bf0d52710bfa1513c54a96cb1dfce", "score": "0.5113875", "text": "function filterDetail(tt,id) { \n\n var lyr = map.getLayer(id); \n esri.request({\n\turl:lyr.url+'/0',\n\tcontent:{f:\"json\"},\n\tcallbackParamName:\"callback\",\n\tload: function(data) {\n\t var query = new esri.tasks.Query(), \n\t displayField = data.displayField; \n\n\t query.where = displayField + \" like '%\"+ tt + \"%'\"; \n\t query.outFields = [displayField];\n\t query.returnGeometry = true; \n\t var featureLayer = new esri.layers.FeatureLayer(lyr.url+'/0',\n\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\tmode: esri.layers.FeatureLayer.MODE_SELECTION,\n\t\t\t\t\t\t\t\tvisible: false,\n\t\t\t\t\t\t\t\tmaxAllowableOffset: maxOffset(map,20)\n\t\t\t\t\t\t\t }); \n\n\t featureLayer.queryFeatures(query, function(featureSet) { \n\t\tfeatureSet.features.sort(function(a,b){\n\t\t var aString = a.attributes[displayField];\n\t\t var bString = b.attributes[displayField];\n\t\t if (aString < bString) { return -1 } else if (aString > bString) { return 1 } else { return 0 };\n\t\t});\n\n\t\tbrowseFeatures = featureSet.features; \n\t\tvar items = [];\n\n\t\tdojo.forEach(featureSet.features, function(feature) { \n\t\t items.push({\"UNIQUE\":feature.attributes[displayField]}); \n\t\t}); \n\n\t\t$(\"#browse-data-list\").empty();\n\t\t$(\"#browse-data-template\")\n\t\t .tmpl(items)\n\t\t .appendTo(\"#browse-data-list\"); \n\n\t\t$(\"#detail-list\").hide();\n\t\t$(\"#browse-data-list\").show();\n\n\t\t$(\"#browse-data-list > li\")\n\t\t .live({\n\t\t\tclick: function () { \n\t\t\t $(\"#detail-filter-search, #detail-filter-search-button\").hide(); \n\n\t\t\t // use the currentBrowseGraphic geometry to zoom into the area. \n\t\t\t var ind = $(this).index(), ext;\n\t\t\t if (browseFeatures[ind].geometry.type === \"polygon\") { \n\t\t\t\text = browseFeatures[ind].geometry.getExtent();\n\t\t\t\tmap.setExtent(ext,true); \n\t\t\t } else if (browseFeatures[ind].geometry.type === \"polyline\") { \n\t\t\t\text = browseFeatures[ind].geometry.getExtent();\n\t\t\t\tmap.setExtent(ext,true); \n\t\t\t } else if (browseFeatures[ind].geometry.type === \"point\") { \n\t\t\t\tmap.centerAndZoom(browseFeatures[ind].geometry,6); \n\t\t\t }\t\t\t\n\n\t\t\t var fieldArray = [], fieldList = \"\", displayFieldType = \"\"; \n\t\t\t $(featureLayer.fields).each(function (index, field) { \n\t\t\t\tif (field.type === \"esriFieldTypeString\" || \n\t\t\t\t field.type === \"esriFieldTypeInteger\" || \n\t\t\t\t field.type === \"esriFieldTypeDouble\" || \n\t\t\t\t field.type === \"esriFieldTypeDate\" || \n\t\t\t\t field.type === \"esriFieldTypeSmallInteger\") \n\t\t\t\t{\n\t\t\t\t if (field.name === featureLayer.displayField) { \n\t\t\t\t\tdisplayFieldType = field.type; \n\t\t\t\t }\n\t\t\t\t fieldArray.push('\"'+field.name+'\"'); \n\n\t\t\t\t}\n\t\t\t }); \n\n\t\t\t fieldList = fieldArray.join(\",\"); \n\t\t\t var q = new esri.tasks.Query(); \n\n\t\t\t if (displayFieldType === \"esriFieldTypeString\") {\n\t\t\t\tq.where = featureLayer.displayField +\" = '\"+ browseFeatures[ind].attributes[featureLayer.displayField] +\"'\"; \t\t\n\t\t\t } else { \n\t\t\t\t// TODO: deal with date type in display field\n\t\t\t\tq.where = featureLayer.displayField +\" = \"+ browseFeatures[ind].attributes[featureLayer.displayField]; \t\t\n\t\t\t }\n\n\t\t\t q.outFields = [fieldList];\n\t\t\t q.returnGeometry = false; \n\t\t\t var queryTask = new esri.tasks.QueryTask(lyr.url+'/0');\n\t\t\t dojo.connect(queryTask,\"onComplete\", function(set) { \n\t\t\t\ttry { \n\t\t\t\t var det = [], fieldCount = 0;\n\n\t\t\t\t for (var key in set.features[0].attributes) { \n\t\t\t\t\tif (set.fields[fieldCount].type === \"esriFieldTypeOID\") { \n\t\t\t\t\t // Should we print or not? \n\n\t\t\t\t\t} else if (set.fields[fieldCount].type === \"esriFieldTypeDate\") { \n\t\t\t\t\t var dt = formatDate(set.features[0].attributes[key]),\n\t\t\t\t\t\tky = set.fieldAliases[key] || key; \n\t\t\t\t\t \n\t\t\t\t\t det.push({\"key\":ky,\"value\":dt});\n\t\t\t\t\t} else { \n\t\t\t\t\t var ky = set.fieldAliases[key] || key; \n\t\t\t\t\t det.push({\"key\":ky,\"value\":set.features[0].attributes[key]});\n\t\t\t\t\t}\n\t\t\t\t\tfieldCount++; \n\t\t\t\t }\n\t\t\t\t} catch (err) { logger(\"filter detail error: \" + err.message); }\n\t\t\t\t\n $(\"#browse-data-detail-list\").empty(); \n\t\t\t\t$(\"#browse-data-detail-template\").tmpl(det).appendTo(\"#browse-data-detail-list\"); \n\t\t\t\t$(\"#browse-data-list\").hide(); \n\t\t\t\t$(\"#browse-data-detail-list\").fadeIn('fast');\n\n\t\t\t }); \n\t\t\t queryTask.execute(q); \n\n\t\t\t},\n\t\t\tmouseenter: function(){ \n\t\t\t var ind = $(this).index();\n\t\t\t \n\t\t\t var markerSymbol = new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_CIRCLE,20,\n\t\t\t\t\t\t\t\t\t\t new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t new dojo.Color([255,140,0]), 2.5), \n\t\t\t\t\t\t\t\t\t\t new dojo.Color([0,50,200,0.05]));\n\t\t\t \n\t\t\t var lineSymbol = new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([0,50,200,0.25]), 2.5);\n\t\t\t var polygonSymbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_NONE, \n\t\t\t\t\t\t\t\t\t\t new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t new dojo.Color([255,140,0]), 2.5),\n\t\t\t\t\t\t\t\t\t\t new dojo.Color([0,50,200,0.25]));\n\n\t\t\t if (browseFeatures[ind].geometry.type === \"polygon\") { \n\t\t\t\tcurrentBrowseGraphic = new esri.Graphic(browseFeatures[ind].geometry,polygonSymbol,browseFeatures[ind].attributes,\"\"); \n\t\t\t } else if (browseFeatures[ind].geometry.type === \"polyline\") { \n\t\t\t\tcurrentBrowseGraphic = new esri.Graphic(browseFeatures[ind].geometry,lineSymbol,browseFeatures[ind].attributes,\"\"); \n\t\t\t } else if (browseFeatures[ind].geometry.type === \"point\") { \n\t\t\t\tcurrentBrowseGraphic = new esri.Graphic(browseFeatures[ind].geometry,markerSymbol,browseFeatures[ind].attributes,\"\"); \n\t\t\t }\n\t\t\t map.graphics.add(currentBrowseGraphic); \n\t\t\t},\n\t\t\tmouseleave: function(){ \n\t\t\t map.graphics.remove(currentBrowseGraphic); \n\t\t\t} \n\t\t }); \n\n\t\t$(\"#detail-back-button\").show();\n\t\t\t\t\n\t }); \n\t},\n\terror:esriConfig.defaults.io.errorHandler\n });\n}", "title": "" }, { "docid": "2dd5f9f4ae405f6df9998e7c75dc1ee7", "score": "0.503001", "text": "function section_filter(obj, aE) {\n return obj[ARR_M_LAT] >= aE[1].min && obj[ARR_M_LAT] <= aE[1].max && (obj[ARR_M_LON] >= aE[0].min && obj[ARR_M_LON] <= aE[0].max);\n}", "title": "" }, { "docid": "7f64ee7fae417a915bb1841a5d32613d", "score": "0.5022237", "text": "function getAllTimeSerisFromRegion() {\n\tvar region = arguments[0];\n\tvar date = getDateFromCSV(csv_a);\n\tvar I = getRegionTimeSeriesFromCSV(csv_a, region);\n\tvar R = getRegionTimeSeriesFromCSV(csv_r, region);\n\tvar D = getRegionTimeSeriesFromCSV(csv_d, region)\n\tvar C = getRegionTimeSeriesFromCSV(csv_c, region);\t\n\treturn [date, I, R, D, C];\n}", "title": "" }, { "docid": "2fd280514923032410f1cd06b6f26173", "score": "0.49817738", "text": "function onClickFilter() {\n var year = document.getElementById('input_year').value;\n var month = document.getElementById('input_month').value;\n var day = document.getElementById('input_day').value;\n if(year == \"\" || month == \"\" || day == \"\") {\n initMap();\n return;\n }\n var time = document.getElementById('time_show').innerHTML;\n var date = year + \"-\" + month + \"-\" + day;\n filterPlanesbyTime(date, time);\n}", "title": "" }, { "docid": "4166f71b32af03c6655d46282bbd39d0", "score": "0.4966045", "text": "function addlayertime() {\n\n changethefilter();\n // console.log(filter_content);\n try{\n map.removeLayer('Complain_p');\n map.removeSource('Complain_p');\n }\n catch(e){};\n\n map.addLayer({\n id: 'Complain_p',\n type: 'circle',\n source: {\n type: 'geojson',\n data: './time_display_incident.geojson' // local geojson\n },\n paint: {\n 'circle-radius': [\n 'interpolate',\n ['linear'],\n ['number', ['get', 'harz_l']],\n 1, 5,\n 2, 7,\n 3, 10,\n 4, 12,\n 5, 15,\n 6, 20\n ],\n // 'circle-radius':5,\n 'circle-color': [\n 'interpolate',\n ['linear'],\n ['number', ['get', 'harz_l']],\n\n 1, '#1a9850',\n 2, '#91cf60',\n 3, '#d9ef8b',\n 4, '#fee08b',\n 5, '#fc8d59',\n 6, '#d73027'\n ],\n 'circle-opacity': 0.8\n },\n //replace following line if checked\n filter: filter_content\n // filter : null\n });\n\n\n document.getElementById('slider').addEventListener('input', function(e) {\n var hour = parseInt(e.target.value);\n // update the map\n map.setFilter('Complain_p', ['==', ['number', ['get', 'Created_hr']], hour]);\n\n // converting 0-23 hour to AMPM format\n var ampm = hour >= 12 ? 'PM' : 'AM';\n var hour12 = hour % 12 ? hour % 12 : 12;\n\n // update text in the UI\n document.getElementById('active-hour').innerText = hour12 + ampm;\n });\n\n\n\n\n }", "title": "" }, { "docid": "c64cc5b9efc05c572f85d85f1435b88a", "score": "0.4916627", "text": "function unfilter(region){\n var regionButton = document.getElementById(region);\n if(isDown(regionButton)){\n displayRegionCards(region,false);\n setHeader(regionButton,false);\n }\n if(document.querySelectorAll(\".regionImagePressed\").length == 0){\n var all = document.getElementById(\"All\");\n setHeader(all,true);\n displayRegionCards(\"All\");\n }\n}", "title": "" }, { "docid": "f4bbcf9f8dc7b6d7fae11706e8236362", "score": "0.48707718", "text": "function filterData(spec) {\n var allData = data[0]\n\n // Selects data for worldmap\n if (spec == \"worldmap\") {\n regionDict = {};\n var groupCat = _.groupBy(allData, obj => obj.categoryTag);\n groupYear = _.groupBy(groupCat[categoryOption], obj => obj.Year);\n groupRegion = _.groupBy(groupYear[yearOption], obj => obj.ISO);\n for (var region of Object.values(groupRegion)) {\n regionDict[region[0].ISO] = region[0].Quantity;\n }\n return regionDict;\n }\n\n // Selects data for piechart\n else if (spec == \"pie\") {\n var groupISO = _.groupBy(allData, obj => obj.ISO);\n groupISO = _.groupBy(groupISO[countryOption], obj => obj.Year);\n return groupISO[yearOption];\n }\n\n // Selects data for linechart 1\n else if (spec == \"line1\") {\n var groupCountry = _.groupBy(allData, obj => obj.ISO)[countryOption];\n var groupCat = _.groupBy(groupCountry, obj => obj.categoryTag);\n array = [];\n for (var i in Object.values(groupCat)) {\n sorted = Object.values(groupCat)[i].sort((a, b) => (a.Year > b.Year)\n ? 1 : -1);\n array.push({\"categoryTag\": Object.keys(groupCat)[i], \"values\": sorted});\n }\n return array;\n }\n\n // Selects data for linechart2\n else if (spec == \"line2\") {\n var groupCat = _.groupBy(allData, obj => obj.categoryTag);\n totalArray = [];\n var groupRegion = _.groupBy(groupCat[categoryOption], obj => obj.Region);\n for (var index in Object.values(groupRegion)) {\n regionArray = [];\n key = Object.keys(groupRegion)[index];\n value = Object.values(groupRegion)[index];\n var groupYear = _.groupBy(value, obj => obj.Year);\n for (var yearIndex in groupYear) {\n sum = 0;\n for (var elem of groupYear[yearIndex]) {\n sum += elem.Quantity;\n }\n regionArray.push({\"Year\": parseInt(yearIndex), \"Quantity\": sum,\n \"Region\": elem.Region});\n }\n if (Object.keys(groupRegion)[index] != \"null\") {\n totalArray.push({\"Region\": Object.keys(groupRegion)[index],\n \"values\": regionArray});\n }\n }\n return totalArray;\n }\n}", "title": "" }, { "docid": "b8f528cca7827a2efc8ffa7c104ead94", "score": "0.48598287", "text": "function createTimeBand(img) {\n var date = ee.Date(img.get('system:time_start'))\n var year = date.get('year').subtract(1991);\n \n return ee.Image(year).byte().addBands(img);\n}", "title": "" }, { "docid": "17358cfa1dd36782d68091e907c1bb34", "score": "0.48378593", "text": "function regionClick(event) {\n\n if (displaymode == \"S\") {\n zoomClose();\n }\n\n var region = $(event.target);\n \n if (region.hasClass('region')) {\n\n $('.common-container').data().regionClicked = true;\n\n setTimeout(function () {\n $('.common-container').data().regionClicked = false;\n }, 100);\n\n var regionType = region.attr('type');\n\n return processRegion(region, regionType);\n\n }\n \n \n\n}", "title": "" }, { "docid": "6fcba64885fe99ccd7bff3d058bb1187", "score": "0.48374668", "text": "function app() {\n var scale = Map.getScale()\n \n // define area of interest\n var aoi = geometry.buffer(scale*40).bounds()\n\n // get images for that area\n var s2 = ee.ImageCollection('COPERNICUS/S2')\n .filterBounds(aoi)\n //.filterDate('2017-08-01', '2018-01-01')\n .select(\n ['B1', 'B2', 'B3', 'B4', 'B5', 'B6', 'B7', 'B8', 'B8A', 'B9', 'B10', 'B11', 'B12'],\n ['coastal', 'blue', 'green', 'red', 'red2', 'red3', 'red4', 'nir', 'nir2', 'water_vapour', 'cirrus', 'swir', 'swir2']\n )\n\n s2 = s2.map(function(i) {\n var time = i.get('system:time_start')\n \n i = i.resample('bicubic').divide(10000)\n\n return i\n .set('system:time_start', time)\n })\n \n // merge by time\n s2 = mosaicByTime(s2)\n print('Image size (merged by time):', s2.size())\n\n var l8 = ee.ImageCollection('LANDSAT/LC08/C01/T1_TOA')\n \n l8 = l8.map(function(i) {\n var time = i.get('system:time_start')\n\n return i\n .set('system:time_start', time)\n })\n \n l8 = l8\n .filterBounds(aoi)\n .select(['B6', 'B7', 'B5', 'B4', 'B3', 'B2', 'B9', 'B1'], \n ['swir', 'swir2', 'nir', 'red', 'green', 'blue', 'cirrus', 'coastal'])\n\n //var images = s2\n //var images = l8\n \n var images = ee.ImageCollection(l8.merge(s2))\n \n \n var cloudFrequency = 70\n \n // naive groupping of overlapping images - S2 scenes are split\n //images = ee.ImageCollection(images.distinct('system:time_start'))\n \n\n print('Image size:', images.size())\n\n var rows = 6\n var columns = 12\n images = images.limit(rows*columns)\n \n // skip empty\n function addAny(i) { \n return i.set('any', i.select(0).mask().reduceRegion(ee.Reducer.allNonZero(), aoi, scale).values().get(0)) \n }\n images = images.map(addAny).filter(ee.Filter.eq('any', 1))\n\n // add some quality score (cloudness, greeness, etc.)\n images = addSpatialQualityScore(images, aoi, scale)\n\n // sort\n images = images.sort('quality')\n //images = images.sort('system:time_start')\n \n print(images.aggregate_array('quality'))\n \n print(ui.Chart.feature.histogram(images, 'quality', 30))\n \n // TODO: determine from cloud frequency\n var qualityThreshold = 3500\n \n // filter cloudy images\n // images = images.filter(ee.Filter.lt('quality', qualityThreshold))\n \n images = images.limit(rows*columns)\n \n/* images = images.map(function(i) { \n return i.addBands(computeCloudScore(i))\n })\n*/\n var minReflectance = 0.05\n var maxReflectance = 0.5\n \n // show as a gallery\n var options = {proj: 'EPSG:3857', flipX: false, flipY: true }\n var gallery = imageGallery(images, aoi, rows, columns, scale, options)\n \n gallery = gallery\n .addBands(computeCloudScore(gallery))\n \n Map.addLayer(gallery, {bands: ['swir', 'nir', 'blue'], min: minReflectance, max: maxReflectance}, 'gallery (false)', true);\n Map.addLayer(gallery, {bands: ['red', 'green', 'blue'], min: minReflectance, max: maxReflectance}, 'gallery (true)', false);\n\n // var cloudScore = computeCloudScore(gallery)\n var cloudScore = gallery.select('cloud_score')\n\n Map.addLayer(cloudScore.mask(cloudScore), {min: 0.0, max: 0.5, palette:['000000', 'ffff00']}, 'gallery (cloud)', false);\n Map.addLayer(cloudScore, {min: 0.0, max: 0.5, palette:['000000', 'ffffff']}, 'gallery (cloud, no mask)', false);\n Map.addLayer(cloudScore.mask(cloudScore.gt(0.15)), {min: 0.0, max: 1, palette:['000000', 'ffff00']}, 'gallery (cloud > 0.15)', false);\n Map.addLayer(cloudScore.mask(cloudScore.gt(0.1)), {min: 0.0, max: 1, palette:['000000', 'ffff00']}, 'gallery (cloud > 0.1)', false);\n Map.addLayer(cloudScore.mask(cloudScore.gt(0.4)), {min: 0.0, max: 1, palette:['000000', 'ffff00']}, 'gallery (cloud > 0.4)', false);\n\n var mean = images.map(function(i) { \n return i.updateMask(i.select('cloud_score').lt(0.5))\n }).mean()\n\n var ndwi = images.map(function(i) { \n var ndwi = i.updateMask(i.select('cloud_score').lt(0.4)).normalizedDifference(['green', 'nir'])\n \n ndwi = ndwi\n .where(ndwi.gt(0.35), 0.35)\n .where(ndwi.lt(-0.05), -0.05)\n \n return ndwi\n }).mean()\n \n Map.addLayer(mean, {bands: ['swir', 'nir', 'blue'], min: minReflectance, max: maxReflectance}, 'masked', false);\n\n var Palettes = {\n water: ['f7fbff', 'deebf7', 'c6dbef', '9ecae1', '6baed6', '4292c6', '2171b5', '08519c', '08306b']\n };\n Map.addLayer(ndwi, {min: 0, max: 0.4, palette: Palettes.water}, 'masked, ndwi', false);\n\n\n\n \n var radius = 30\n var stddev = cloudScore.reduceNeighborhood(ee.Reducer.stdDev(), ee.Kernel.circle(radius, 'meters'))\n Map.addLayer(stddev, {min: 0, max: 0.05}, 'cloudScore stddev neighborhood', false) \n\n \n function renderLabel(i) {\n //var str = i.id()\n var str = i.date().format('YYYY-MM-dd')\n //var str = ee.Number(i.get('score')).format('%.2f')\n \n return Text.draw(str, location, scale, {\n fontSize:14, textColor: 'ffffff', outlineColor: '000000', outlineWidth: 2, outlineOpacity: 0.6})\n }\n \n var locations = getMarginLocations(aoi, 'left', 10, 10, scale)\n var location = locations.get(8)\n var labelImages = images.map(renderLabel)\n var galleryLabel = imageGallery(labelImages, aoi, rows, columns, scale, options)\n Map.addLayer(galleryLabel, {}, 'gallery, label', true)\n\n\n var cloudScoreText = ee.Image()\n var cloudScoreTextLayer = ui.Map.Layer(cloudScoreText, {}, 'cloud score text')\n Map.layers().add(cloudScoreTextLayer)\n\n var cloudScorePoiLayer = ui.Map.Layer(null, {palette: ['ff0000']}, 'cloud score text location', 0.3)\n Map.layers().add(cloudScorePoiLayer)\n \n Map.onClick(function(pt) {\n cloudScoreTextLayer.setEeObject(ee.Image())\n \n pt = ee.Dictionary(pt)\n var lat = pt.get('lat')\n var lon = pt.get('lon')\n \n var poi = ee.Geometry.Point([lon, lat])//.buffer(150)\n \n var region = poi.buffer(Map.getScale()*5)\n \n cloudScorePoiLayer.setEeObject(ee.Image().paint(poi, 1, 1))\n \n var cloudScoreValue = cloudScore\n .reduceRegion({reducer: ee.Reducer.first(), geometry: poi, scale: Map.getScale(), crs: 'EPSG:3857'}).values().get(0)\n\n print(cloudScoreValue)\n\n var text = Text.draw(ee.Number(cloudScoreValue).format('%.3f'), poi, Map.getScale(), {\n fontSize:14, textColor: 'ffff00', outlineColor: '000000', outlineWidth: 2, outlineOpacity: 0.6})\n\n cloudScoreTextLayer.setEeObject(text)\n })\n}", "title": "" }, { "docid": "7e47f9a68cb4ca0a901661c41bedfc5e", "score": "0.48150018", "text": "function mapFilter(item){\n var layer = $(item).data('map-layer');\n var filter = $(item).data('map-layer-filter');\n map.setFilter(layer, filter);\n}", "title": "" }, { "docid": "ff8d55692c536c3a9767b929ea6d9918", "score": "0.48110366", "text": "function setupRegionedGrid( region ) {\n \n var grid = region.grid;\n \n // Attach region backdrop\n var backdrop = document.createElement(\"div\");\n backdrop.className = \"backdrop\";\n grid.root.appendChild(backdrop);\n \n // Element to show the currently hovered tile\n var curr = document.createElement(\"div\");\n curr.style.textAlign = \"center\";\n curr.style.lineHeight = grid.tileHeight + \"px\";\n curr.style.position = \"absolute\";\n curr.style.border = \"4px outset green\";\n curr.style.background = \"lightgreen\";\n curr.style.width = (grid.tileWidth - 7) + \"px\";\n curr.style.height = (grid.tileHeight - 7) + \"px\";\n curr.style.display = \"none\";\n grid.root.appendChild(curr);\n \n // Setting mouse movement related tile events\n grid.addEvent(\"tileover\", function(e, x, y) {\n var inv = grid.screenpos(x, y);\n curr.style.left = inv.x + \"px\";\n curr.style.top = inv.y + \"px\";\n curr.innerHTML = [x, y] + '';\n });\n \n // Disable panning if the tiledown event happened in the region\n grid.addEvent(\"tiledown\", function(e, x, y) {\n if (region.inside(x, y)) {\n e.preventDefault(); // the \"default\" tiledown action is to begin panning\n }\n });\n \n // Center the root element.\n var size = hex.size(grid.elem);\n grid.reorient(size.x * 0.5, size.y * 0.5);\n \n // Announce an event to the log\n function announce(e, x, y) {\n hex.log([x, y], e.type);\n }\n region.addEvent(\"regionover\", announce);\n region.addEvent(\"regionout\", announce);\n region.addEvent(\"regiondown\", announce);\n region.addEvent(\"regionup\", announce);\n region.addEvent(\"regionclick\", announce);\n \n // Setting region UI events\n region.addEvent(\"regionover\", function(e, x, y) {\n curr.style.display = \"\";\n });\n region.addEvent(\"regionout\", function(e, x, y) {\n curr.style.display = \"none\";\n });\n region.addEvent(\"regiondown\", function (e, x, y) {\n curr.style.borderStyle = \"inset\";\n curr.style.background = \"green\";\n });\n \n // Special case for when the hold is released\n function release(e, x, y) {\n curr.style.borderStyle = \"outset\";\n curr.style.background = \"lightgreen\";\n }\n grid.addEvent(\"gridout\", release);\n grid.addEvent(\"tileup\", function(e, x, y) {\n release(e, x, y);\n grid.trigger(\"tileover\", x, y);\n });\n}", "title": "" }, { "docid": "76875100e688433a8a62f919b1594ba5", "score": "0.48066851", "text": "unprojectIIIFRegionToBounds(region) {\n var minPoint = L.point(parseInt(region[0]), parseInt(region[1]));\n var maxPoint = L.point(parseInt(region[0]) + parseInt(region[2]), parseInt(region[1]) + parseInt(region[3]));\n\n var min = this.cropperMap.unproject(minPoint, this.maxZoom());\n var max = this.cropperMap.unproject(maxPoint, this.maxZoom());\n return L.latLngBounds(min, max);\n }", "title": "" }, { "docid": "1e133649226ef50d07f92d7b5c516636", "score": "0.48015034", "text": "get mapItems() {\n var _a, _b, _c, _d;\n const numRegions = (_d = (_c = (_b = (_a = this.activeTableStyle.regionColumn) === null || _a === void 0 ? void 0 : _a.valuesAsRegions) === null || _b === void 0 ? void 0 : _b.uniqueRegionIds) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0;\n // Estimate number of points based off number of rowGroups\n const numPoints = this.activeTableStyle.rowGroups.length;\n // If we have more points than regions OR we have points are are using a ConstantColorMap - show points instead of regions\n // (Using ConstantColorMap with regions will result in all regions being the same color - which isn't useful)\n if ((numPoints > 0 &&\n this.activeTableStyle.colorMap instanceof ConstantColorMap) ||\n numPoints > numRegions) {\n const pointsDataSource = this.createLongitudeLatitudeDataSource(this.activeTableStyle);\n // Make sure there are actually more points than regions\n if (pointsDataSource &&\n pointsDataSource.entities.values.length > numRegions)\n return [pointsDataSource];\n }\n if (this.regionMappedImageryParts)\n return [this.regionMappedImageryParts];\n return [];\n }", "title": "" }, { "docid": "1332624e3fcfd1bfe4bdb024d322f123", "score": "0.47863385", "text": "_filter() {\n // if no filters are selected then immediately show everything\n if (!this.isCategoryFiltered && !this.isYearFiltered && !this.isLocationFiltered) {\n this.tileTargets.forEach(tile => this._show(tile));\n }\n\n // loop through each tile and figure out if should be shown or not\n this.tileTargets.forEach(tile => {\n const tileYears = tile.dataset.years.split(\",\");\n const tileLocations = tile.dataset.locations.split(\",\");\n let showTile = true;\n\n showTile = showTile && this._isVisibleInCategory(tile);\n showTile = showTile && this._isVisibleInYear(tile);\n showTile = showTile && this._isVisibleInLocation(tile);\n\n showTile ? this._show(tile) : this._hide(tile);\n });\n }", "title": "" }, { "docid": "a878ee750b564f4de46862af3feeefb2", "score": "0.4782055", "text": "function filterRow(row, device) {\n if (match(device)) {\n row.classList.remove('filter-out')\n }\n else {\n row.classList.add('filter-out')\n }\n }", "title": "" }, { "docid": "f9c7390d80bf6762b405222d1295bbba", "score": "0.47790307", "text": "function caveClearRegions(width, height, limit, region, map) {\n\n let groupMap = cloneArray2D(map);\n\n let groupNum = 2;\n\n let groups = [];\n\n for(let y = 0; y < height; y++) {\n for(let x = 0; x < width; x++) {\n\n if(groupMap[y][x] < 2 && map[y][x] == region) {\n \n let groupSize = floodRegion(x, y);\n \n if(groupSize < limit) groups.push([groupNum, Math.abs(region-1)]);\n\n groupNum++;\n }\n }\n }\n\n for(let g = 0; g < groups.length; g++) \n replaceGroup(groups[g][0], groups[g][1]);\n \n // Determines the size of a region\n function floodRegion(x, y) {\n\n groupMap[y][x] = groupNum;\n\n let groupSize = 0;\n\n if(x > 0 && map[y][x] == map[y][x-1] && groupMap[y][x] != groupMap[y][x-1]) \n groupSize += floodRegion(x-1, y) + 1;\n\n if(x < width-1 && map[y][x] == map[y][x+1] && groupMap[y][x] != groupMap[y][x+1]) \n groupSize += floodRegion(x+1, y) + 1;\n\n if(y > 0 && map[y][x] == map[y-1][x] && groupMap[y][x] != groupMap[y-1][x]) \n groupSize += floodRegion(x, y-1) + 1;\n\n if(y < height-1 && map[y][x] == map[y+1][x] && groupMap[y][x] != groupMap[y+1][x]) \n groupSize += floodRegion(x, y+1) + 1;\n\n return groupSize;\n }\n\n // Fills in a region\n function replaceGroup(target, replacement) {\n\n for(let y = 0; y < height; y++) {\n for(let x = 0; x < width; x++) {\n\n if(groupMap[y][x] == target) map[y][x] = replacement;\n }\n }\n }\n}", "title": "" }, { "docid": "47371009ca690b2a952c7d641b391cdc", "score": "0.47729743", "text": "function filterDataPoint(row, col) {\n\tvar mywindow = DataSetObject.getDataWindow();\n\tvar actual_x = mywindow[row][col].row_id;\n\tvar actual_y = mywindow[row][col].col_id;\n\t// TO DO - fix this, as it's causing inconsistencies\n\tfilterCoordinates.push([parseInt(row), parseInt(col)]);\n\n\tPRESS_COMPARE_COUNTER++;\n\t/* Start timer to detect whether we need to compare two rows or filter out a single point. Timer is set to\n\t * detect presses within a specific timeframe. */\n\tif(COMPARE_TIMER_STARTED == false) {\n\t\tCOMPARE_TIME_1 = timestamp();\n\t\tbeginCompareTimer();\n\t}\n}", "title": "" }, { "docid": "49598e87536cb9f295e0182775c6cbe6", "score": "0.47712886", "text": "function filter(dataArray, datetime) {\n \n var filtredData = dataArray.filter(data => data.datetime === datetime )\n \n insertData(filtredData)\n}", "title": "" }, { "docid": "7ecf1e079ab17784c187a2afecd7ff31", "score": "0.47601107", "text": "function markeragefilter() {\n var start = $('#startagefilter').val();\n var end = $('#endagefilter').val();\n\n if (start == '' && end == ''){\n view_all_samples();\n return\n }\n // if BP or ka included, remove and correct value if needed\n if (start.toLowerCase().indexOf('bp') != -1){\n start = start.substring(0, start.length-2);\n }else if (start.toLowerCase().indexOf('ka') != -1) {\n start = start.substring(0, start.length - 2);\n start = start * 1000;\n }\n\n if (end.toLowerCase().indexOf('bp') != -1){\n end = end.substring(0, end.length-2);\n }else if (end.toLowerCase().indexOf('ka') != -1) {\n end = end.substring(0, end.length - 2);\n end = end * 1000;\n }\n\n // if numerical, check right way round\n if (!isNaN(start) && !isNaN(end)){\n if (start < end) {\n var start_copy = start;\n start = end;\n end = start_copy;\n }\n // show/hide markers based on whether they lie within the range\n for (var i = 0; i < markers.length; i++) {\n var marker = markers[i];\n if ((marker.age > start || marker.age < end) || marker.age == null) {\n marker.setMap(null);\n }else{\n marker.setMap(map);\n }\n }\n }\n}", "title": "" }, { "docid": "e77daf25c0ff42d5e9a19512db6bf68c", "score": "0.47546044", "text": "function addZoom(region){\r\n\t\t\t\t$('<img />').addClass(settings.zoomClass)\r\n\t\t\t\t\t.attr({\r\n\t\t\t\t\t\tsrc: settings.blankImage,\r\n\t\t\t\t\t\tid: region.id\r\n\t\t\t\t\t}).css({\r\n\t\t\t\t\t\tposition: 'absolute',\r\n\t\t\t\t\t\twidth: addpx(region.area_width),\r\n\t\t\t\t\t\theight: addpx(region.area_height),\r\n\t\t\t\t\t\ttop: addpx(region.top),\r\n\t\t\t\t\t\tleft: addpx(region.left),\r\n\t\t\t\t\t\tcursor: 'pointer'\r\n\t\t\t\t\t}).appendTo(map).click(function(){\r\n\t\t\t\t\t\t//hide neighboring bullets and zoomables\r\n\t\t\t\t\t\t$(this).siblings().fadeOut();\r\n\t\t\t\t\t\t$(this).hide()\r\n\t\t\t\t\t\t\t .attr('src', region.image).load(function(){\r\n\t\t\t\t\t\t\t\t\t$(this).fadeIn('slow')\r\n\t\t\t\t\t\t\t\t\t\t .animate({\r\n\t\t\t\t\t\t\t\t\t\t\t\twidth: addpx(region.width),\r\n\t\t\t\t\t\t\t\t\t\t\t\theight: addpx(region.height),\r\n\t\t\t\t\t\t\t\t\t\t\t\ttop: addpx(((settings.height-region.height)/2)),\r\n\t\t\t\t\t\t\t\t\t\t\t\tleft: addpx(((settings.width-region.width)/2))\r\n\t\t\t\t\t\t\t\t\t\t\t}, settings.zoomDuration, '', function(){\r\n\t\t\t\t\t\t\t\t\t\t\t\tdisplayMap(region);\r\n\t\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t});\r\n\t\t\t}", "title": "" }, { "docid": "bf91bef9dd65640c377b48773f839127", "score": "0.47517323", "text": "function get_nbi(regions,year) {\nvar yL8 = ee.ImageCollection('LC8_L1T_TOA')\n .filterDate(new Date(year,1,1),new Date(year,12,31))\n .filterBounds(regions);\n\n// Now we are creating a new Collection of images that create\n// our normalized burn index for every scene in the collection.\n// We also use Google's built in Cloud cover algorythm.\nvar nbi=yL8.map(function(img){\n var nbi=img.normalizedDifference(['B5','B7']).select([0],['nbi']);\n var nw=ee.Algorithms.SimpleLandsatCloudScore(img).select(['cloud']);\n return nw.addBands(nbi);\n });\nreturn nbi;\n}", "title": "" }, { "docid": "61472dd2e713455fed5e7399bfe0f055", "score": "0.47209343", "text": "function imageGallery(images, region, rows, columns, scale, options) {\n var proj = ee.Projection('EPSG:3857', [scale, 0, 0, 0, -scale, 0]);\n var scale = proj.nominalScale();\n\n var e = ee.ErrorMargin(scale);\n\n var bounds = region.transform(proj, e).bounds(e, proj);\n\n var count = ee.Number(columns * rows);\n\n images = images.limit(count);\n\n // number of images is less than grid cells\n count = count.min(images.size());\n\n var ids = ee.List(images.aggregate_array('system:index'));\n\n var indices = ee.List.sequence(0, count.subtract(1));\n\n var offsetsX = indices.map(function (i) {\n return ee.Number(i).mod(columns);\n });\n var offsetsY = indices.map(function (i) {\n return ee.Number(i).divide(columns).floor();\n });\n\n var offsets = offsetsX.zip(offsetsY);\n\n var offsetByImage = ee.Dictionary.fromLists(ids, offsets);\n\n var coords = ee.List(bounds.coordinates().get(0));\n\n var w = ee.Number(ee.List(coords.get(1)).get(0)).subtract(ee.List(coords.get(0)).get(0));\n var h = ee.Number(ee.List(coords.get(2)).get(1)).subtract(ee.List(coords.get(0)).get(1));\n\n var boundsImage = ee.Image().toInt().paint(bounds, 1).reproject(proj);\n\n // new region\n var ll = ee.List(coords.get(0));\n var ur = [ee.Number(ll.get(0)).add(w.multiply(columns)), ee.Number(ll.get(1)).add(h.multiply(rows))];\n\n var regionNew = ee.Geometry.Rectangle([ll, ur], proj, false);\n\n var mosaic = images.map(function (i) {\n var offset = ee.List(offsetByImage.get(i.get('system:index')));\n var xoff = w.multiply(offset.get(0)).multiply(scale);\n var yoff = h.multiply(offset.get(1)).multiply(scale);\n\n i = i.mask(boundsImage.multiply(i.mask())).paint(bounds, 1, 1);\n\n return i.translate(xoff, yoff, 'meters', proj);\n }).mosaic();\n\n return mosaic;\n}", "title": "" }, { "docid": "37f210d0b8bbae8688e3e579d523cab2", "score": "0.47143888", "text": "function createTimeBand(img) {\n var year = ee.Date(img.get('system:time_start')).get('year').subtract(1980);\n return ee.Image(year).rename('year').byte().addBands(img).copyProperties(img, ['system:time_start']);\n}", "title": "" }, { "docid": "5dddbe89a91b192fad45a55689b0be52", "score": "0.4703135", "text": "function filterTimes(filters, timeKey, eventList) {\n const startIdx = filters.selectedTime[0];\n const endIdx = filters.selectedTime[1];\n const startTime = timeKey[startIdx];\n const endTime = timeKey[endIdx];\n\n const filteredEvents = [];\n let i = 0;\n for (i = 0; i < eventList.length; i += 1) {\n let time = null;\n let timeHour = null;\n let timeMinute = null;\n\n timeHour = eventList[i].start_time.hour();\n timeMinute = (eventList[i].start_time.minute()) / 100;\n\n // if the time is before 6am\n if (timeHour < 6) {\n // set the time to be 24 hours larger for comparison purposes\n timeHour += 24;\n }\n // formats time as hour.minute\n time = timeHour + timeMinute;\n\n if (time >= startTime) {\n if (time <= endTime) {\n filteredEvents.push(eventList[i]);\n }\n }\n }\n return filteredEvents;\n}", "title": "" }, { "docid": "77ee2afc94edf08d0d79e8cdbba8c6a3", "score": "0.46602458", "text": "function setMapFilter(filter) {\n console.log(\"Map filter = \" + filter);\n removePopup();\n clearAllHighlighted();\n namesModal.style.display = \"none\";\n if (filter == \"all\") {\n clearFilters();\n } else if (filter == \"1955\") {\n slideOn = true;\n overOn = true;\n newarkOn = true;\n console.log(\"Filtering for 1955 - 1964...\");\n slideModal.style.display = \"none\";\n overModal.style.display = \"none\";\n newarkModal.style.display = \"none\";\n stories.value = \"all\";\n map.flyTo({\n center: [-74.189, 40.73],\n zoom: 12,\n pitch: 0,\n bearing: 0,\n essential: true,\n });\n map.setLayoutProperty(\"allOrigins\", \"visibility\", \"visible\");\n map.setLayoutProperty(\"allOriginsInner\", \"visibility\", \"visible\");\n map.setLayoutProperty(\"allDestinations\", \"visibility\", \"visible\");\n map.setLayoutProperty(\"allDestinationsInner\", \"visibility\", \"visible\");\n map.setLayoutProperty(\"historicalBuildings\", \"visibility\", \"none\");\n map.setLayoutProperty(\"historicalBuildingsOutline\", \"visibility\", \"none\");\n map.setLayoutProperty(\"newarkPolygon\", \"visibility\", \"none\");\n // map.setLayoutProperty(\"historicalBuildingsLabel\", \"visibility\", \"none\");\n map.setLayoutProperty(\"concaveHull72\", \"visibility\", \"none\");\n map.setLayoutProperty(\"concaveHull72_outline\", \"visibility\", \"none\");\n map.setLayoutProperty(\"slideThroughTimeLocations\", \"visibility\", \"none\");\n map.setLayoutProperty(\"eppersonCentroid\", \"visibility\", \"none\");\n map.setLayoutProperty(\"eppersonCentroidInner\", \"visibility\", \"none\");\n map.setLayoutProperty(\"eppersonHouse\", \"visibility\", \"none\");\n map.setLayoutProperty(\"eppersonHouseOutline\", \"visibility\", \"none\");\n map.setLayoutProperty(\n \"slideThroughTimeLocationsInner\",\n \"visibility\",\n \"none\"\n );\n map.setLayoutProperty(\"concaveHull64\", \"visibility\", \"visible\");\n map.setLayoutProperty(\"concaveHull64_outline\", \"visibility\", \"visible\");\n map.setFilter(\"allDestinationsInner\", [\n \"==\",\n [\"get\", \"year\"],\n [\"to-number\", filter],\n ]);\n map.setFilter(\"allDestinations\", [\n \"==\",\n [\"get\", \"year\"],\n [\"to-number\", filter],\n ]);\n map.setFilter(\"allOriginsInner\", [\n \"==\",\n [\"get\", \"year\"],\n [\"to-number\", filter],\n ]);\n map.setFilter(\"allOrigins\", [\"==\", [\"get\", \"year\"], [\"to-number\", filter]]);\n map.setFilter(\"allLines\", [\"==\", [\"get\", \"year\"], [\"to-number\", filter]]);\n } else if (filter == \"1964\") {\n console.log(\"Filtering for 1964 - 1972...\");\n slideOn = true;\n overOn = true;\n slideModal.style.display = \"none\";\n overModal.style.display = \"none\";\n newarkModal.style.display = \"none\";\n stories.value = \"all\";\n map.flyTo({\n center: [-74.189, 40.735],\n zoom: 11.5,\n pitch: 0,\n bearing: 0,\n essential: true,\n });\n map.setLayoutProperty(\"allOrigins\", \"visibility\", \"visible\");\n map.setLayoutProperty(\"allOriginsInner\", \"visibility\", \"visible\");\n map.setLayoutProperty(\"allDestinations\", \"visibility\", \"visible\");\n map.setLayoutProperty(\"allDestinationsInner\", \"visibility\", \"visible\");\n map.setLayoutProperty(\"historicalBuildings\", \"visibility\", \"none\");\n map.setLayoutProperty(\"historicalBuildingsOutline\", \"visibility\", \"none\");\n map.setLayoutProperty(\"newarkPolygon\", \"visibility\", \"none\");\n // map.setLayoutProperty(\"historicalBuildingsLabel\", \"visibility\", \"none\");\n map.setLayoutProperty(\"concaveHull64\", \"visibility\", \"none\");\n map.setLayoutProperty(\"concaveHull64_outline\", \"visibility\", \"none\");\n map.setLayoutProperty(\"slideThroughTimeLocations\", \"visibility\", \"none\");\n map.setLayoutProperty(\n \"slideThroughTimeLocationsInner\",\n \"visibility\",\n \"none\"\n );\n map.setLayoutProperty(\"concaveHull72\", \"visibility\", \"visible\");\n map.setLayoutProperty(\"concaveHull72_outline\", \"visibility\", \"visible\");\n map.setLayoutProperty(\"eppersonCentroid\", \"visibility\", \"none\");\n map.setLayoutProperty(\"eppersonCentroidInner\", \"visibility\", \"none\");\n map.setLayoutProperty(\"eppersonHouse\", \"visibility\", \"none\");\n map.setLayoutProperty(\"eppersonHouseOutline\", \"visibility\", \"none\");\n map.setFilter(\"allDestinationsInner\", [\n \"==\",\n [\"get\", \"year\"],\n [\"to-number\", filter],\n ]);\n map.setFilter(\"allDestinations\", [\n \"==\",\n [\"get\", \"year\"],\n [\"to-number\", filter],\n ]);\n map.setFilter(\"allOriginsInner\", [\n \"==\",\n [\"get\", \"year\"],\n [\"to-number\", filter],\n ]);\n map.setFilter(\"allOrigins\", [\"==\", [\"get\", \"year\"], [\"to-number\", filter]]);\n map.setFilter(\"allLines\", [\"==\", [\"get\", \"year\"], [\"to-number\", filter]]);\n } else if (filter == \"slide\") {\n slideOn = true;\n overOn = false;\n console.log(\"Filtering for slide through time points...\");\n slideModal.style.display = \"block\";\n overModal.style.display = \"none\";\n newarkModal.style.display = \"none\";\n year.value = \"all\";\n turnLinesOff();\n map.setLayoutProperty(\"slideThroughTimeLocations\", \"visibility\", \"visible\");\n map.setLayoutProperty(\n \"slideThroughTimeLocationsInner\",\n \"visibility\",\n \"visible\"\n );\n map.setLayoutProperty(\"newarkPolygon\", \"visibility\", \"none\");\n map.setLayoutProperty(\"concaveHull64\", \"visibility\", \"none\");\n map.setLayoutProperty(\"concaveHull64_outline\", \"visibility\", \"none\");\n map.setLayoutProperty(\"concaveHull72\", \"visibility\", \"none\");\n map.setLayoutProperty(\"concaveHull72_outline\", \"visibility\", \"none\");\n map.setLayoutProperty(\"allOrigins\", \"visibility\", \"none\");\n map.setLayoutProperty(\"allOriginsInner\", \"visibility\", \"none\");\n map.setLayoutProperty(\"allDestinations\", \"visibility\", \"none\");\n map.setLayoutProperty(\"allDestinationsInner\", \"visibility\", \"none\");\n map.setLayoutProperty(\"allLines\", \"visibility\", \"none\");\n map.setLayoutProperty(\"historicalBuildings\", \"visibility\", \"visible\");\n map.setLayoutProperty(\n \"historicalBuildingsOutline\",\n \"visibility\",\n \"visible\"\n );\n map.setLayoutProperty(\"eppersonCentroid\", \"visibility\", \"none\");\n map.setLayoutProperty(\"eppersonCentroidInner\", \"visibility\", \"none\");\n map.setLayoutProperty(\"eppersonHouse\", \"visibility\", \"none\");\n map.setLayoutProperty(\"eppersonHouseOutline\", \"visibility\", \"none\");\n // map.setLayoutProperty(\"historicalBuildingsLabel\", \"visibility\", \"visible\");\n map.flyTo({\n center: [-74.189, 40.74],\n zoom: 15.5,\n bearing: 0,\n pitch: 0,\n essential: true,\n });\n } else if (filter == \"deadBody\") {\n console.log(\"Filtering for over my dead body points...\");\n slideOn = false;\n overOn = true;\n overModal.style.display = \"block\";\n slideModal.style.display = \"none\";\n newarkModal.style.display = \"none\";\n year.value = \"all\";\n turnLinesOff();\n map.setLayoutProperty(\"eppersonCentroid\", \"visibility\", \"visible\");\n map.setLayoutProperty(\"eppersonCentroidInner\", \"visibility\", \"visible\");\n map.setLayoutProperty(\"eppersonHouse\", \"visibility\", \"visible\");\n map.setLayoutProperty(\"eppersonHouseOutline\", \"visibility\", \"visible\");\n map.setLayoutProperty(\"newarkPolygon\", \"visibility\", \"none\");\n map.setLayoutProperty(\"slideThroughTimeLocations\", \"visibility\", \"none\");\n map.setLayoutProperty(\n \"slideThroughTimeLocationsInner\",\n \"visibility\",\n \"none\"\n );\n map.setLayoutProperty(\"concaveHull64\", \"visibility\", \"none\");\n map.setLayoutProperty(\"concaveHull64_outline\", \"visibility\", \"none\");\n map.setLayoutProperty(\"concaveHull72\", \"visibility\", \"none\");\n map.setLayoutProperty(\"concaveHull72_outline\", \"visibility\", \"none\");\n map.setLayoutProperty(\"allOrigins\", \"visibility\", \"none\");\n map.setLayoutProperty(\"allOriginsInner\", \"visibility\", \"none\");\n map.setLayoutProperty(\"allDestinations\", \"visibility\", \"none\");\n map.setLayoutProperty(\"allDestinationsInner\", \"visibility\", \"none\");\n map.setLayoutProperty(\"allLines\", \"visibility\", \"none\");\n map.setLayoutProperty(\"historicalBuildings\", \"visibility\", \"visible\");\n map.setLayoutProperty(\n \"historicalBuildingsOutline\",\n \"visibility\",\n \"visible\"\n );\n map.flyTo({\n center: [-74.1885, 40.74],\n zoom: 16,\n pitch: 0,\n bearing: 0,\n essential: true\n });\n }\n else if (filter == \"newark\") {\n console.log(\"Filtering for Newark 1967...\");\n slideOn = false;\n overOn = false;\n newarkOn = true;\n overModal.style.display = \"none\";\n slideModal.style.display = \"none\";\n newarkModal.style.display = \"block\";\n year.value = \"all\";\n turnLinesOff();\n map.setLayoutProperty(\"newarkPolygon\", \"visibility\", \"visible\");\n map.setLayoutProperty(\"eppersonCentroid\", \"visibility\", \"none\");\n map.setLayoutProperty(\"eppersonCentroidInner\", \"visibility\", \"none\");\n map.setLayoutProperty(\"eppersonHouse\", \"visibility\", \"none\");\n map.setLayoutProperty(\"eppersonHouseOutline\", \"visibility\", \"none\");\n map.setLayoutProperty(\"slideThroughTimeLocations\", \"visibility\", \"none\");\n map.setLayoutProperty(\n \"slideThroughTimeLocationsInner\",\n \"visibility\",\n \"none\"\n );\n map.setLayoutProperty(\"concaveHull64\", \"visibility\", \"none\");\n map.setLayoutProperty(\"concaveHull64_outline\", \"visibility\", \"none\");\n map.setLayoutProperty(\"concaveHull72\", \"visibility\", \"none\");\n map.setLayoutProperty(\"concaveHull72_outline\", \"visibility\", \"none\");\n map.setLayoutProperty(\"allOrigins\", \"visibility\", \"none\");\n map.setLayoutProperty(\"allOriginsInner\", \"visibility\", \"none\");\n map.setLayoutProperty(\"allDestinations\", \"visibility\", \"none\");\n map.setLayoutProperty(\"allDestinationsInner\", \"visibility\", \"none\");\n map.setLayoutProperty(\"allLines\", \"visibility\", \"none\");\n map.setLayoutProperty(\"historicalBuildings\", \"visibility\", \"none\");\n map.setLayoutProperty(\n \"historicalBuildingsOutline\",\n \"visibility\",\n \"none\"\n );\n map.flyTo({\n center: [-74.189, 40.740],\n zoom: 16,\n pitch: 60,\n bearing: 45,\n essential: true,\n });\n }\n}", "title": "" }, { "docid": "a2e5dcbd6706593b7a09cf99f0d352d4", "score": "0.46368092", "text": "function interpolateData(time) {\n var timeGroup = getTimeData(time);\n\n dex.console.log(\"InterpolateData(\" + time + \")\", timeGroup);\n return timeGroup.data.map(function (od) {\n return od.csv.data.map(function (d) {\n dex.console.log(\"DATA\", d);\n //var idata = dex.object.clone(d);\n //d[config.index.x] = interpolateValues(time, times, tmatrix[config.index.x]);\n //d[config.index.y] = interpolateValues(time, times, tmatrix[config.index.y]);\n //d[config.index.size] = interpolateValues(time, times, tmatrix[config.index.size]);\n //dex.console.log(\"D\", d);\n return d;\n });\n });\n }", "title": "" }, { "docid": "221b96796e8b62e40781935b74fc63e2", "score": "0.4633084", "text": "get_locations_for_images(proj_name, callback, filter_params = {}) {\n var _this = this;\n var db = this.db;\n db.serialize(function() {\n _this.has_project(proj_name, function(bool) {\n if (bool) {\n _this.has_metadata_attr(['GPSLatitude', 'GPSLongitude'], function(attr_exists) {\n if (attr_exists) {\n var coords = [];\n var stmt_str = \"SELECT img_name, GPSLatitude, GPSLongitude FROM Images WHERE proj_name = ?\"\n stmt_str += _this.filter_stmt(filter_params)\n stmt_str += \" AND GPSLatitude IS NOT NULL AND GPSLongitude IS NOT NULL\"\n var stmt = db.prepare(stmt_str);\n stmt.each([proj_name], function(err, row) {\n if (err) {\n console.error(\"FAILING: \" + err);\n callback([]);\n return;\n }\n\n coords.push({'lat': JSON.parse(row['GPSLatitude']), 'lng': JSON.parse(row['GPSLongitude']), 'title': row['img_name']});\n }, function() {\n callback(coords);\n });\n stmt.finalize();\n } else {\n console.error(\"column DNE: GPSLatitude, GPSLongitude\");\n callback([]);\n }\n });\n } else {\n console.error('get_locations_for_images:', proj_name, \"does not exist\");\n callback([]);\n }\n });\n });\n }", "title": "" }, { "docid": "6a8bb50e18e0123a5f172d72facd6e21", "score": "0.46205544", "text": "function filterPoints(minutes) {\n pBar.show();\n travelTimes = [minutes * 60];\n options.travelEdgeWeights = travelTimes;\n filterTargets(houses);\n}", "title": "" }, { "docid": "be0d1f1da85a9ffdd492b8877dcc9d65", "score": "0.4619308", "text": "function prepareMultiSeriesQueryObject(data, object, filters) {\n\n //console.log(object)\n\n var currentTime = filters[0].currentTime;\n var duration = filters[0].duration;\n var period = data.period;\n var loopValue = object.tileContext.multiSeries;\n var durationInNumbers = duration.split(/([0-9]+)/)[1];// seperate string and number\n \n var mapDetails = {};\n for( var i = 0; i < loopValue; i++) {\n var tmpObj = JSON.parse(JSON.stringify(data));\n tmpObj.opcode = getOpcode(object);\n if(period == \"days\") {\n tmpObj.filters[0].currentTime = moment().subtract(durationInNumbers * i, \"days\").valueOf();\n } else if(period == \"hours\") {\n tmpObj.filters[0].currentTime = moment().subtract(durationInNumbers * i, \"hours\").valueOf();\n } else if(period == \"minutes\") {\n tmpObj.filters[0].currentTime = moment().subtract( durationInNumbers * i, \"minutes\").valueOf();\n }\n mapDetails[i+1] = tmpObj;\n }\n\n return mapDetails;\n}", "title": "" }, { "docid": "2b734482b4d4e3a51353fa90df741af8", "score": "0.4608173", "text": "function zoomlightrowHide() {\n zoomlightRow.deactivate();\n }", "title": "" }, { "docid": "a23f3a4411fed8711654004ca0c274be", "score": "0.45944414", "text": "function map() {\n /* global emit, query */\n const acceptRecord = function acceptRecord(specificity) {\n /* eslint-disable object-shorthand */\n emit(this.productId, { price: this.price, specificity: specificity });\n }.bind(this);\n\n if (this.region === query.region) {\n acceptRecord(2);\n } else if (this.region === '*') {\n acceptRecord(1);\n }\n }", "title": "" }, { "docid": "16cfe1b917a7e397093be0a74a825490", "score": "0.4594151", "text": "function filterAnalysesByTime (lowerTimeThreshold, upperTimeThreshold, vis) {\n vis.graph.lNodes = partsService.lNodesBAK;\n vis.graph.aNodes = partsService.aNodesBAK;\n vis.graph.saNodes = partsService.saNodesBAK;\n vis.graph.nodes = partsService.nodesBAK;\n vis.graph.aLinks = partsService.aLinksBAK;\n vis.graph.lLinks = partsService.lLinksBAK;\n\n var selAnalyses = vis.graph.aNodes.filter(function (an) {\n upperTimeThreshold.setSeconds(upperTimeThreshold.getSeconds() + 1);\n return provvisHelpers.parseISOTimeFormat(an.start) >= lowerTimeThreshold &&\n provvisHelpers.parseISOTimeFormat(an.start) <= upperTimeThreshold;\n });\n\n /* Set (un)filtered analyses. */\n vis.graph.aNodes.forEach(function (an) {\n if (selAnalyses.indexOf(an) === -1) {\n an.filtered = false;\n an.children.values().forEach(function (san) {\n san.filtered = false;\n san.children.values().forEach(function (n) {\n n.filtered = false;\n });\n });\n } else {\n an.filtered = true;\n an.children.values().forEach(function (san) {\n san.filtered = true;\n san.children.values().forEach(function (n) {\n n.filtered = true;\n });\n });\n }\n });\n\n /* Update analysis filter attributes. */\n vis.graph.aNodes.forEach(function (an) {\n if (an.children.values().some(function (san) {\n return san.filtered;\n })) {\n an.filtered = true;\n } else {\n an.filtered = false;\n }\n an.doi.filteredChanged();\n });\n\n /* Update layer filter attributes. */\n vis.graph.lNodes.values().forEach(function (ln) {\n if (ln.children.values().some(function (an) {\n return an.filtered;\n })) {\n ln.filtered = true;\n } else {\n ln.filtered = false;\n }\n ln.doi.filteredChanged();\n });\n\n /* Update analysis link filter attributes. */\n vis.graph.aLinks.forEach(function (al) {\n al.filtered = false;\n });\n vis.graph.aLinks.filter(function (al) {\n return al.source.parent.parent.filtered &&\n al.target.parent.parent.filtered;\n }).forEach(function (al) {\n al.filtered = true;\n });\n vis.graph.lLinks.values().forEach(function (ll) {\n ll.filtered = false;\n });\n vis.graph.lLinks.values().filter(function (ll) {\n return ll.source.filtered && ll.target.filtered;\n }).forEach(function (ll) {\n ll.filtered = true;\n });\n\n /* On filter action 'hide', splice and recompute graph. */\n if (partsService.filterAction === 'hide') {\n /* Update filtered nodesets. */\n var cpyLNodes = d3.map();\n vis.graph.lNodes.entries().forEach(function (ln) {\n if (ln.value.filtered) {\n cpyLNodes.set(ln.key, ln.value);\n }\n });\n vis.graph.lNodes = cpyLNodes;\n vis.graph.aNodes = vis.graph.aNodes.filter(function (an) {\n return an.filtered;\n });\n vis.graph.saNodes = vis.graph.saNodes.filter(function (san) {\n return san.filtered;\n });\n vis.graph.nodes = vis.graph.nodes.filter(function (n) {\n return n.filtered;\n });\n\n /* Update filtered linksets. */\n vis.graph.aLinks = vis.graph.aLinks.filter(function (al) {\n return al.filtered;\n });\n\n /* Update layer links. */\n var cpyLLinks = d3.map();\n vis.graph.lLinks.entries().forEach(function (ll) {\n if (ll.value.filtered) {\n cpyLLinks.set(ll.key, ll.value);\n }\n });\n vis.graph.lLinks = cpyLLinks;\n }\n\n dagreService.dagreDynamicLayerLayout(vis.graph);\n\n if (partsService.fitToWindow) {\n provvisHelpers.fitGraphToWindow(partsService.nodeLinkTransitionTime);\n }\n\n updateNodeLink.updateNodeFilter();\n updateNodeLink.updateLinkFilter();\n updateAnalysis.updateAnalysisLinks(vis, partsService.linkStyle);\n updateLayers.updateLayerLinks(vis.graph.lLinks);\n\n vis.graph.aNodes.forEach(function (an) {\n updateNodeLink.updateLink(an);\n });\n vis.graph.lNodes.values().forEach(function (ln) {\n updateNodeLink.updateLink(ln);\n });\n\n /* TODO: Temporarily enabled. */\n if (partsService.doiAutoUpdate) {\n doiService.recomputeDOI();\n }\n }", "title": "" }, { "docid": "bcacb1037377ecb6397b8a9d6e7e8ede", "score": "0.4577307", "text": "function mosaicByTime(images) {\n var TIME_FIELD = 'system:time_start'\n\n var distinct = images.distinct([TIME_FIELD])\n\n var filter = ee.Filter.equals({ leftField: TIME_FIELD, rightField: TIME_FIELD });\n var join = ee.Join.saveAll('matches')\n var results = join.apply(distinct, images, filter)\n\n // mosaic\n results = results.map(function(i) {\n var mosaic = ee.ImageCollection.fromImages(i.get('matches')).sort('system:index').mosaic()\n \n return mosaic.copyProperties(i).set(TIME_FIELD, i.get(TIME_FIELD))\n })\n \n return ee.ImageCollection(results)\n}", "title": "" }, { "docid": "dde8059a8fa81496e8ea14af39794464", "score": "0.45769656", "text": "function queryTimeBoundsFilter(query, timefield)\n{\n\tvar filter;\n\n\tif (query.qc_before !== null) {\n\t\tmod_assertplus.ok(query.qc_after !== null);\n\t\tmod_assertplus.string(timefield);\n\n\t\t/*\n\t\t * Since the start time is inclusive and measured in\n\t\t * milliseconds, but we only index in seconds, we round\n\t\t * up to the nearest second and use a \"greater-than-or-\n\t\t * equal-to\" condition. Similarly, we round up the end\n\t\t * time and use a \"less-than\" condition.\n\t\t */\n\t\tfilter = {\n\t\t 'and': [ {\n\t\t 'ge': [ 'PLACEHOLDER', Math.ceil(\n\t\t\t query.qc_after.getTime() / 1000) ]\n\t\t }, {\n\t\t 'lt': [ 'PLACEHOLDER', Math.ceil(\n\t\t\t query.qc_before.getTime() / 1000) ]\n\t\t } ]\n\t\t};\n\t\tfilter.and[0].ge[0] = timefield;\n\t\tfilter.and[1].lt[0] = timefield;\n\t\treturn (filter);\n\t} else {\n\t\tmod_assertplus.ok(query.qc_after === null);\n\t\treturn (null);\n\t}\n}", "title": "" }, { "docid": "02fc61b352a14351417b9e6cae02eed8", "score": "0.45692328", "text": "function addRegionMask(){\n // get the regions from the regions api\n $.getJSON(Config.REGION_MASK_URL, function(data){\n var geojson = new OpenLayers.Format.GeoJSON({\n 'internalProjection': new OpenLayers.Projection(\"EPSG:3857\"),\n 'externalProjection': new OpenLayers.Projection(\"EPSG:4326\")\n });\n var features = geojson.read(data);\n mask.addFeatures(features);\n });\n }", "title": "" }, { "docid": "0a41df4bd96fc844878132f9f1bc84b6", "score": "0.45552582", "text": "function kernelResample(read, write, filterSize, kernel) {\n const { width, height, data } = read;\n const readIndex = (x, y) => 4 * (y * width + x);\n const twoFilterSize = 2 * filterSize;\n const xMax = width - 1;\n const yMax = height - 1;\n const xKernel = new Array(4);\n const yKernel = new Array(4);\n return (xFrom, yFrom, to) => {\n const xl = Math.floor(xFrom);\n const yl = Math.floor(yFrom);\n const xStart = xl - filterSize + 1;\n const yStart = yl - filterSize + 1;\n for (let i = 0; i < twoFilterSize; i++) {\n xKernel[i] = kernel(xFrom - (xStart + i));\n yKernel[i] = kernel(yFrom - (yStart + i));\n }\n for (let channel = 0; channel < 3; channel++) {\n let q = 0;\n for (let i = 0; i < twoFilterSize; i++) {\n const y = yStart + i;\n const yClamped = clamp(y, 0, yMax);\n let p = 0;\n for (let j = 0; j < twoFilterSize; j++) {\n const x = xStart + j;\n const index = readIndex(clamp(x, 0, xMax), yClamped);\n p += data[index + channel] * xKernel[j];\n }\n q += p * yKernel[i];\n }\n write.data[to + channel] = Math.round(q);\n }\n };\n }", "title": "" }, { "docid": "c4ea7c5355e5458b7563285c80a34aff", "score": "0.45502904", "text": "filterLoadedDatasets(timeFrame) {\n\n var filtered = [];\n var currentUnixTimeStamp = Math.floor(new Date().getTime() / 1000);\n\n for(let i=0; i<this.loadedDatasets.length; i++) {\n\n let strDate = this.loadedDatasets[i].timestamp;\n let datasetUnixTimestamp = this.GetUnixTimestampFromStr(strDate);\n\n if (datasetUnixTimestamp>(currentUnixTimeStamp-timeFrame*60*60))\n filtered.push(this.loadedDatasets[i]);\n }\n\n return filtered;\n }", "title": "" }, { "docid": "175ef7dbb10dcd972f4b63d6cbadd847", "score": "0.45485276", "text": "function searchByAreaWithinTimeRange(area,time_range) {\n time_range = \"10m\"\n return elasticClient.search({\n index: config.indexName,\n body:\n {\n \"query\": {\n \"bool\": {\n \"must\": [\n {\n \"match\": {\n \"place.name\": area,\n }\n },\n {\n \"range\": {\n \"@timestamp\": {\n \"gte\": `now-${time_range}`,\n \"lt\": \"now\"\n }\n }\n }\n ]\n }\n }\n }\n });\n}", "title": "" }, { "docid": "c6a24fd5d6bc64887887e027f857e8d5", "score": "0.45480195", "text": "function filterAll() {\n for (var i = 0, l = rows.length; i < l; ++i) {\n filterRow(rows[i], mapping[rows[i].id])\n }\n }", "title": "" }, { "docid": "a4d6292b728c631acb939d30eb41c2e2", "score": "0.454696", "text": "function filters(rows) {\n const columns = rows[0] && Object.keys(rows[0]);\n return rows.filter((row) => columns.some(\n (column) => row[column].toString().toLowerCase().indexOf(queryCity.toLowerCase()) > -1)\n &&\n columns.some(\n (column) => row[column].toString().toLowerCase().indexOf(queryState.toLowerCase()) > -1)\n &&\n parseInt(row[2]) >= queryMin\n &&\n parseInt(row[2]) <= queryMax);\n }", "title": "" }, { "docid": "d4142531e6b2647df76f458b99fa88ef", "score": "0.45298156", "text": "function filter(data) {\n // this gives you an array of tuples where the first element is the hour, second element is the minute and the last element is the # of users\n var result = data.rows.map(\n function(elem) {\n return [elem[0], elem[1], elem[2]]\n })\n\n var minute = date.getMinutes();\n var x = [];\n\n // sort result by hour and minute in ascending order\n result.sort(function(a, b) {\n var n = a[0] - b[0];\n if(n !== 0) {\n return n;\n }\n return parseInt(a[1]) - parseInt(b[1]);\n });\n\n // push number of pageviews in the past 60 minutes to an array\n // Since the proxy is delayed, we are taking the data from a 60 minute time frame\n // which ends at 10 minutes prior to current time\n // ie: if it is 6:20pm, we take data in an array from [5:10pm to 6:10pm]\n var counter = 0;\n var counter2 = 0;\n var subtractHour1 = 0;\n var subtractHour2 = 0;\n\n if(minute < 10) {\n subtractHour1 = subtractHour1 + 2;\n subtractHour2++;\n } else {\n counter = minute - 10;\n subtractHour1++;\n }\n\n\n for(var i = 0; i < result.length; i++) {\n // reset counter after 60 min mark\n if(counter == 59) {\n counter = 0;\n }\n // Fixed the filter function. This was causing the data points to disappear.\n if((result[i][0] == (hour-subtractHour1)) && (result[i][1] >= counter) || result[i][0] == hour-subtractHour2) {\n if(counter2 >= 60) {\n break;\n }\n x.push(Number(result[i][2]));\n counter++;\n counter2++;\n }\n }\n // filtered array in past hour\n return x;\n}", "title": "" }, { "docid": "3e1069dcad6941e965ef7c23e88f65ea", "score": "0.45293435", "text": "function dropSample() {\n if (isNaN(parseInt(id_flag))) {\n var loc = month_loc;\n } else {\n var loc = user_loc;\n }\n clearMarkers();\n if (loc.length > 50) {\n len = 50;\n } else {\n len = loc.length;\n }\n for (var i = 0; i < len; i++) {\n index = Math.round(loc.length * Math.random());\n addMarkerWithTimeout(loc[index], i * 50);\n }\n}", "title": "" }, { "docid": "2e44a9a054083bd27c3e630c98d86652", "score": "0.45172125", "text": "function partitionViewport(projection) {\n let z = geoScaleToZoom(projection.scale());\n let z2 = (Math.ceil(z * 2) / 2) + 2.5; // round to next 0.5 and add 2.5\n let tiler = utilTiler().zoomExtent([z2, z2]);\n\n return tiler.getTiles(projection)\n .map(tile => tile.extent);\n}", "title": "" }, { "docid": "4e2371a52dcd62392ef970267bcdd86e", "score": "0.45074", "text": "get regionMappedImageryParts() {\n if (!this.regionMappedImageryProvider)\n return;\n return {\n imageryProvider: this.regionMappedImageryProvider,\n alpha: this.opacity,\n show: this.show,\n clippingRectangle: this.clipToRectangle\n ? this.cesiumRectangle\n : undefined\n };\n }", "title": "" }, { "docid": "0798069f17084e673eaf6c1d2469dddf", "score": "0.44986784", "text": "function updateFilter(data, map, attributes, filterAmount){\n const index = $('#month-slider').val();\n map.removeLayer(mapLayer);\n mapLayer = createPropSymbols(data, map, attributes, index, filterAmount);\n}", "title": "" }, { "docid": "39d2b735ef4991a9833d15a4baee8918", "score": "0.44864875", "text": "function _svt_annotation_show_frame_regions(select, oid) {\n var rid = parseInt( select.options[select.selectedIndex].value );\n var time = svt_project.obj.trk[oid].regions[rid][0];\n\n via_ng.v.now.content.pause();\n via_ng.v.now.content.currentTime = time;\n _svt_annotation_draw_frame_manual_regions(oid, rid);\n}", "title": "" }, { "docid": "66de85a5b36a745f3d3529177df687d7", "score": "0.44864872", "text": "function map_toggle_zoom(m_region) {\n\t\t$('body').toggleClass('zoomed');\n\n\t\tvar obj = '.zoom_box';\n\t\tif ($('body').hasClass('zoomed')) {\n\t\t\t$(obj).addClass('zoom_' + m_region);\n\t\t} else {\n\t\t\tfor (r in map_regions) {\n\t\t\t\t$(obj).removeClass('zoom_' + map_regions[r]);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "e040959b0e6e685d98e636d3e72a6f68", "score": "0.44779816", "text": "crop(tr) {\n const timerangeBegin = tr.begin();\n let beginPos = this.bisect(timerangeBegin);\n const bisectedEventOutsideRange = this.at(beginPos).timestamp() < timerangeBegin;\n beginPos = bisectedEventOutsideRange ? beginPos + 1 : beginPos;\n const endPos = this.bisect(tr.end(), beginPos);\n return this.slice(beginPos, endPos + 1);\n }", "title": "" }, { "docid": "98651883c53790cf1a234d5be459c528", "score": "0.44743574", "text": "get_images_by_date(proj_name, callback, filter_params = {}) {\n var _this = this;\n var db = this.db;\n db.serialize(function() {\n _this.has_project(proj_name, function(bool) {\n if (bool) {\n _this.has_metadata_attr(['CreateDate'], function(attr_exists) {\n if (attr_exists) {\n var dates = [];\n var counts = [];\n var stmt_str = \"SELECT CreateDate, COUNT(*) as Count FROM Images WHERE proj_name = ?\"\n stmt_str += _this.filter_stmt(filter_params)\n stmt_str += \" AND CreateDate IS NOT NULL GROUP BY CreateDate ORDER BY CreateDate\"\n var stmt = db.prepare(stmt_str);\n stmt.each([proj_name], function(err, row) {\n if (err) {\n console.error(\"FAILING CreateDate: \" + err);\n callback([], []);\n return;\n }\n\n var date = row['CreateDate']\n\n if (dates.indexOf(date) >= 0) {\n counts[dates.indexOf(date)] += 1;\n } else {\n dates.push(date);\n counts.push(row['Count']);\n }\n }, function() {\n callback(dates, counts);\n });\n } else {\n console.error(\"column DNE: CreateDate\");\n callback([], []);\n }\n });\n } else {\n console.error(\"no image dates found\");\n callback([], []);\n }\n });\n });\n }", "title": "" }, { "docid": "f0fb3ec6763d1c27148053880c69eeb8", "score": "0.4473052", "text": "function filterData(x) {\n return x.datetime === inputValue;\n }", "title": "" }, { "docid": "70aea0758db226330143d4041e71d58f", "score": "0.44693604", "text": "function updateLayersState(){\n\t\t\tvar shown_count = 0;\n\t\t\tfor (var region = 0; region < 2; ++region){\n\t\t\t\tfor (var rank = 0; rank < ranks_count; ++rank){\n\t\t\t\t\tif (rank_states[rank] && region_states[region]){\n\t\t\t\t\t\tmap.addLayer(elements[region][rank]);\n\t\t\t\t\t\tshown_count += elements[region][rank].getLayers().length;\n\t\t\t\t\t}else{\n\t\t\t\t\t\tmap.removeLayer(elements[region][rank]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t//stats_container.textContent = shown_count;\n\t\t}", "title": "" }, { "docid": "a75f36067fe60066a7384c1174da3623", "score": "0.4456311", "text": "function view_all_samples() {\n $('#startagefilter').val('');\n $('#endagefilter').val('');\n var marker;\n for (var i=0 ; i < markers.length; i++){\n marker = markers[i];\n marker.setMap(map);\n }\n}", "title": "" }, { "docid": "a699cd3327a62038d669540c41211531", "score": "0.44445527", "text": "function selectRegionOnMap(regionName){\n \n $scope.$apply(function(){\n $scope.searchFilters.regionFilter = regionName;\n $('#sb-map-feature-options').show();\n });\n\n }", "title": "" }, { "docid": "ea3497056e1ba3e9a02dd351f6f2be1f", "score": "0.44435734", "text": "function highLightRegion(x, y) {\n\n // find cell where user is \n // outilne that cell\n // + 3 in up direction \n // + 3 in down direction\n // + 3 in left direction\n // + 3 in right direction \n if (region_checkbox.checked()) {\n blendMode(MULTIPLY);\n fill(255, 0, 0);\n noStroke();\n let x = col * col_width;\n let y = row * row_height;\n rect(x, y, col_width * 5, row_height * 5);\n blendMode(NORMAL);\n }\n}", "title": "" }, { "docid": "f6c527e3743d71a14588729d48eb4830", "score": "0.44433394", "text": "function filterData(dataset,countries, region_list, income_group_list, years, start, stop)\n{\n var filtered_data = [];\n filtered_data = _.filter(dataset,function(d){\n if (($.inArray(d.country, countries) != -1) && ($.inArray(d.region, region_list) != -1) \n && ($.inArray(d.income_group, income_group_list) != -1) && ($.inArray(d.year, years) != -1) \n && (d.population >= start) && (d.population <= stop)) {\n return true;\n };\n });\n return filtered_data;\n}", "title": "" }, { "docid": "3f0357c9da8ca933ef3ab4ce8b922631", "score": "0.4442312", "text": "function multifilter(){\n\n // Select the id = datetime for getting the data for filtering the table.\n var date_time = d3.select('#datetime');\n var date_value = date_time.property('value');\n console.log(date_value);\n \n // Select the id = city for getting the data for filtering the table.\n var city_name = d3.select('#city');\n var city_value = city_name.property('value');\n console.log(city_value);\n\n // Select the id = state for getting the data for filtering the table.\n var state_name = d3.select('#state');\n var state_value = state_name.property('value');\n console.log(state_value);\n\n // Select the id = country for getting the data for filtering the table.\n var country_name = d3.select('#country');\n var country_value = country_name.property('value');\n console.log(country_value);\n\n // Select the id = shape for getting the data for filtering the table.\n var shape_name = d3.select('#shape');\n var shape_value = shape_name.property('value');\n console.log(shape_value);\n\n // filter the data with 5 different filter values form the list dictionary. \n var filter_data = tableData.filter(({datetime, city, state, country, shape}) => datetime === date_value && city === city_value && state === state_value && country === country_value && shape === shape_value);\n console.log(filter_data);\n\n // var filter_date = tableData.filter(date => date.datetime === date_value);\n // console.log(filter_date);\n return filter_data;\n}", "title": "" }, { "docid": "9a4dcc4f167953181057c0aa95313322", "score": "0.44382364", "text": "function simpleTDOM2(c, zShadowThresh, irSumThresh, dilatePixels) {\n var shadowSumBands = ['nir', 'swir1'];\n\n //Get some pixel-wise stats for the time series\n var irStdDev = c.select(shadowSumBands).reduce(ee.Reducer.stdDev());\n var irMean = c.select(shadowSumBands).mean();\n\n //Mask out dark dark outliers\n c = c.map(function (img) {\n var z = img.select(shadowSumBands).subtract(irMean).divide(irStdDev);\n var irSum = img.select(shadowSumBands).reduce(ee.Reducer.sum());\n var m = z.lt(zShadowThresh).reduce(ee.Reducer.sum()).eq(2).and(irSum.lt(irSumThresh)).not();\n m = m.focal_min(dilatePixels);\n\n return img.addBands(m.rename('TDOMMask'));\n });\n\n return c;\n}", "title": "" }, { "docid": "04ef3af70676fddad9fc878bc88c804d", "score": "0.44349796", "text": "function filterData(criteria) {\r\n // resetIndex\r\n activeIndex = 0;\r\n\r\n // remove a popup if open\r\n var popUps = document.getElementsByClassName('mapboxgl-popup');\r\n if (popUps[0]) {\r\n popUps[0].remove();\r\n }\r\n\r\n\r\n filteredData.features = [...pointData.features];\r\n // Filter type\r\n if(criteria.TYPE == 'All Types' ){\r\n \r\n }else {\r\n filteredData.features = filteredData.features.filter(feature =>{\r\n if(feature.properties.TYPE == criteria.TYPE){\r\n return feature;\r\n }\r\n });\r\n }\r\n\r\n console.log(filteredData);\r\n // filter company\r\n if(criteria.COMPANY == 'All Companies' ){\r\n // return feature;\r\n }else {\r\n filteredData.features = filteredData.features.filter(feature =>{\r\n\r\n if(feature.properties.COMPANY == criteria.COMPANY){\r\n return feature;\r\n }\r\n });\r\n }\r\n\r\n console.log(filteredData);\r\n // filter score\r\n if(criteria.SCORE == null){\r\n\r\n }else {\r\n filteredData.features = filteredData.features.filter(feature =>{\r\n if(feature.properties.SCORE == criteria.SCORE){\r\n return feature;\r\n }\r\n });\r\n }\r\n\r\n console.log(filteredData);\r\n // filter date\r\n let dates = criteria.DATE;\r\n filteredData.features = filteredData.features.filter(feature =>{\r\n if(new Date(feature.properties['DATE']) >= new Date(dates[0]) && \r\n new Date(feature.properties['DATE']) <= new Date(dates[1]) \r\n ){\r\n return feature;\r\n }\r\n });\r\n\r\n console.log(filteredData);\r\n map.getSource(\"csvData\").setData(filteredData);\r\n\r\n // get layer bounds and fit to the bounds\r\n if(filteredData.features.length == 0) {\r\n // notify the user\r\n let text = \"No data matching the criteria found\";\r\n $('.snackbar').text(text).toggleClass('open');\r\n\r\n } else{\r\n var filterCount = filteredData.features.length - 1;\r\n var coordinates = filteredData.features.map(feature => feature.geometry.coordinates);\r\n let latBounds = new mapboxgl.LngLatBounds(coordinates[0], coordinates[filterCount]);\r\n \r\n map.fitBounds(latBounds, {\r\n padding:20\r\n });\r\n }\r\n \r\n }", "title": "" }, { "docid": "6e305e5794f60887c5ef8e2f52da3035", "score": "0.4434226", "text": "function get_bands(collection, index, map_year, band_selection) {\n return collection\n .filterMetadata('map_year', 'equals', map_year)\n .first()\n .select(band_selection)\n .rename([index + '_mag', index + '_mmu']);\n}", "title": "" }, { "docid": "d1ad2af040cb830011964f0bb1e5b632", "score": "0.44275936", "text": "function findRow(id) {\n var rowIndex = Math.floor(id / mapSize);\n return rowIndex;\n}", "title": "" }, { "docid": "fb2b3f5fa77cac847b239fb12e4952ac", "score": "0.4421194", "text": "getTripTimeFilter({ tripTime: [min, max] = [] }) {\n if (parseInt(min) != NaN && parseInt(max) != NaN) {\n if (min > 0) {\n this.addClause(`trip_time >= ${this.getTag(min)}`);\n }\n if (max < tripInformationSliderConfig.maxTime) {\n this.addClause(`trip_time <= ${this.getTag(max)}`);\n }\n }\n }", "title": "" }, { "docid": "572d72647e6e4e368a3232487916656f", "score": "0.4419387", "text": "function addRegions() {\n /*function(d){\n var regio = d.name;\n var responders = vis.data.reduce(function(a, b){\n if (b[\"EmbeddedData-Region_Cont\"] == regio){\n return a + 1;\n }\n else{\n return a;\n }\n }, 0);\n if (responders > 30){\n return \"#337ab7\";\n }\n else {\n return \"grey\";\n }\n });*/\n //.on(\"click\", regionClicked);\n\n}", "title": "" }, { "docid": "35a112662c313215cf655baa698b9c1a", "score": "0.4415652", "text": "function displayMap(region){\r\n\t\t\t\t//Set Current Region Id\r\n\t\t\t\t$(this).data('currentId', region.id);\r\n if (region.parent == undefined) {\r\n\t\t\t\t\twidth=addpx(settings.width);\r\n\t\t\t\t\theight=addpx(settings.height);\r\n left=addpx(\"0\");\r\n top=addpx(\"0\");\r\n }\r\n else {\r\n\t\t\t\t\twidth=addpx(region.width);\r\n\t\t\t\t\theight=addpx(region.height);\r\n left=addpx((settings.width-region.width)/2);\r\n top=addpx((settings.height-region.height)/2);\r\n }\r\n\r\n\t\t\t\t//Clear the Map and Set the Background Image\r\n\t\t\t\tmap.empty().css({\r\n\t\t\t\t\tbackgroundImage: 'url(' + region.image + ')',\r\n\t\t\t\t\twidth: width,\r\n\t\t\t\t\theight: height,\r\n left: left,\r\n top: top\r\n\t\t\t\t});\r\n\t\t\t\tvar check = map.css('background-image');\r\n\r\n\t\t\t\t//Load RegionData\r\n\t\t\t\tloadRegionData(region);\r\n\t\t\t}", "title": "" }, { "docid": "d4e67f73d5bec0a1e874e73d34ffca2f", "score": "0.44140607", "text": "function filterTable(){\n // Prevent the page from refreshing\n d3.event.preventDefault();\n results = tableData;\n\n //Date filter\n results = applyFilter(results, \"#dateFilter\", \"datetime\");\n //City filter\n results = applyFilter(results, \"#cityFilter\", \"city\");\n //State filter\n results = applyFilter(results, \"#stateFilter\", \"state\");\n //Country filter\n results = applyFilter(results, \"#countryFilter\", \"country\");\n //Shape filter\n results = applyFilter(results, \"#shapeFilter\", \"shape\");\n\n tBody.selectAll(\"tr\").remove();\n updateTable(results); \n}", "title": "" }, { "docid": "ab5b525a4394ce400c5cd790dd955f12", "score": "0.44105017", "text": "function filterAnalysesByTime (lowerTimeThreshold, upperTimeThreshold, _vis_) {\n _vis_.graph.lNodes = lNodesBAK;\n _vis_.graph.aNodes = aNodesBAK;\n _vis_.graph.saNodes = saNodesBAK;\n _vis_.graph.nodes = nodesBAK;\n _vis_.graph.aLinks = aLinksBAK;\n _vis_.graph.lLinks = lLinksBAK;\n\n const selAnalyses = _vis_.graph.aNodes.filter(an => {\n upperTimeThreshold.setSeconds(upperTimeThreshold.getSeconds() + 1);\n return parseISOTimeFormat(an.start) >= lowerTimeThreshold &&\n parseISOTimeFormat(an.start) <= upperTimeThreshold;\n });\n\n /* Set (un)filtered analyses. */\n _vis_.graph.aNodes.forEach(an => {\n if (selAnalyses.indexOf(an) === -1) {\n an.filtered = false;\n an.children.values().forEach(san => {\n san.filtered = false;\n san.children.values().forEach(n => { n.filtered = false; });\n });\n } else {\n an.filtered = true;\n an.children.values().forEach(san => {\n san.filtered = true;\n san.children.values().forEach(n => { n.filtered = true; });\n });\n }\n });\n\n /* Update analysis filter attributes. */\n _vis_.graph.aNodes.forEach(an => {\n if (an.children.values().some(san => san.filtered)) {\n an.filtered = true;\n } else {\n an.filtered = false;\n }\n an.doi.filteredChanged();\n });\n\n /* Update layer filter attributes. */\n _vis_.graph.lNodes.values().forEach(ln => {\n if (ln.children.values().some(an => an.filtered)) {\n ln.filtered = true;\n } else {\n ln.filtered = false;\n }\n ln.doi.filteredChanged();\n });\n\n /* Update analysis link filter attributes. */\n _vis_.graph.aLinks.forEach(al => {\n al.filtered = false;\n });\n _vis_.graph.aLinks.filter(al =>\n al.source.parent.parent.filtered &&\n al.target.parent.parent.filtered\n ).forEach(al => {\n al.filtered = true;\n });\n _vis_.graph.lLinks.values().forEach(ll => {\n ll.filtered = false;\n });\n _vis_.graph.lLinks.values().filter(\n ll => ll.source.filtered && ll.target.filtered\n ).forEach(ll => { ll.filtered = true; });\n\n /* On filter action 'hide', splice and recompute graph. */\n if (filterAction === 'hide') {\n /* Update filtered nodesets. */\n const cpyLNodes = d3.map();\n _vis_.graph.lNodes.entries().forEach(ln => {\n if (ln.value.filtered) {\n cpyLNodes.set(ln.key, ln.value);\n }\n });\n _vis_.graph.lNodes = cpyLNodes;\n _vis_.graph.aNodes = _vis_.graph.aNodes.filter(an => an.filtered);\n _vis_.graph.saNodes = _vis_.graph.saNodes.filter(san => san.filtered);\n _vis_.graph.nodes = _vis_.graph.nodes.filter(n => n.filtered);\n\n /* Update filtered linksets. */\n _vis_.graph.aLinks = _vis_.graph.aLinks.filter(al => al.filtered);\n\n /* Update layer links. */\n const cpyLLinks = d3.map();\n _vis_.graph.lLinks.entries().forEach(ll => {\n if (ll.value.filtered) {\n cpyLLinks.set(ll.key, ll.value);\n }\n });\n _vis_.graph.lLinks = cpyLLinks;\n }\n\n dagreDynamicLayerLayout(_vis_.graph);\n\n if (fitToWindow) {\n fitGraphToWindow(nodeLinkTransitionTime);\n }\n\n updateNodeFilter();\n updateLinkFilter();\n updateAnalysisLinks(_vis_.graph);\n updateLayerLinks(_vis_.graph.lLinks);\n\n _vis_.graph.aNodes.forEach(an => {\n updateLink(an);\n });\n _vis_.graph.lNodes.values().forEach(ln => {\n updateLink(ln);\n });\n\n /* TODO: Temporarily enabled. */\n if (doiAutoUpdate) {\n recomputeDOI();\n }\n}", "title": "" }, { "docid": "63f05116437101012b887e36858af3fb", "score": "0.44103009", "text": "function filterDataTable(parms, counter) {\n var filteredData = [];\n\n var filteredDatetime = tableData.filter(tableData => tableData.datetime === parms.dateTime);\n var filteredShape = tableData.filter(tableData => tableData.shape.toUpperCase() === parms.shape);\n var filteredCity = tableData.filter(tableData => tableData.city.toUpperCase() === parms.city);\n var filteredState = tableData.filter(tableData => tableData.state.toUpperCase() === parms.state);\n var filteredCountry = tableData.filter(tableData => tableData.country.toUpperCase() === parms.country);\n\n filteredData.push(filteredDatetime);\n filteredData.push(filteredCity);\n filteredData.push(filteredState);\n filteredData.push(filteredCountry);\n filteredData.push(filteredShape);\n\n // previous,current count\n d3.select(\"table\").attr(\"data-count-previous\", d3.select(\"table\").attr(\"data-count\"));\n d3.select(\"table\").attr(\"data-count\", counter);\n\n d3.select(\"tbody\").selectAll(\"tr\").classed(\"ufo--hide\", true);\n\n filteredData.forEach((filtered) => {\n filtered.forEach((obj) => {\n d3.select(\"tr[data-uid='\" + obj.uid + \"']\").classed(\"ufo--hide\", false);\n });\n });\n}", "title": "" }, { "docid": "1ca8cc4cd27448da40282c48e0275a29", "score": "0.43961236", "text": "function extract_sentinel_IC(a_feature,start_date, end_date){\n var geom = a_feature.geometry(); //a_feature is a feature collection\n var newDict = {'original_polygon_1': geom};\n var imageC = ee.ImageCollection('COPERNICUS/S2')\n .filterDate(start_date, end_date)\n .filterBounds(geom)\n // Pre-filter to get less cloudy granules.\n //.filterMetadata('CLOUDY_PIXEL_PERCENTAGE', \"less_than\", cloud_perc)\n .map(function(image){return image.clip(geom)})\n .filter(ee.Filter.lte('CLOUDY_PIXEL_PERCENTAGE', cloud_perc))\n //.filter('CLOUDY_PIXEL_PERCENTAGE < 70')\n .sort('system:time_start', true);\n \n \n imageC = imageC.map(maskS2clouds); // toss out cloudy pixels\n imageC = addYear_to_collection(imageC); // add year as a band\n imageC = addDoY_to_collection(imageC); // add DoY as a band\n imageC = add_EVI_collection(imageC); // add EVI as a band\n imageC = add_system_start_time_collection(imageC);\n \n // add original geometry to each image\n // we do not need to do this really:\n imageC = imageC.map(function(im){return(im.set(newDict))});\n \n // add original geometry and WSDA data as a feature to the collection\n imageC = imageC.set({ 'original_polygon': geom});\n return imageC;\n}", "title": "" }, { "docid": "add83edd88db76ded0b5d4a9e5de4ca8", "score": "0.43957242", "text": "function filtered(lidx) {\n // filter to current L* bounds\n var a = data.filter(function(d) {\n var c = d.chip, ll = c3.color[c].L;\n\treturn c3.count[c] > MINCOUNT && \n (ll >= L[lidx] && ll < L[lidx+1] && d.s > thresh);\n });\n // sort so larger squares are drawn first\n a.sort(function(a,b) { return b.s - a.s; });\n return a;\n }", "title": "" }, { "docid": "ffe91a42780e290392ba11f82a3e9706", "score": "0.43935257", "text": "function additionalFilters() {\n var key = d3.select(this).property('id');\n var value = d3.select(this).property('value');\n\n tableData = tableData.filter(obj => obj[key] == value);\n display(tableData);\n}", "title": "" }, { "docid": "f3e82f4418139af5704ab2949a34bd33", "score": "0.4385115", "text": "scaleRowsInPlace(ax, ay, az, aw) {\n for (let i = 0; i < 4; i++)\n this._coffs[i] *= ax;\n for (let i = 4; i < 8; i++)\n this._coffs[i] *= ay;\n for (let i = 8; i < 12; i++)\n this._coffs[i] *= az;\n for (let i = 12; i < 16; i++)\n this._coffs[i] *= aw;\n }", "title": "" }, { "docid": "0f1e1f8083e509bc11aa4687745c4358", "score": "0.4376695", "text": "function updateLayer(layer, filtering_condition){\n layer.setOptions({\n query: {\n select: locationColumn,\n from: tableId,\n where: filtering_condition\n }\n });\n}", "title": "" }, { "docid": "a8e4379b0558d338546223f2d550cd14", "score": "0.43737924", "text": "function srTimeFilter(traces, start, end) {\n var tsStart = Date.parse(start) * 1000;\n var tsEnd = Date.parse(end) * 1000;\n return traces.map(function (trace) {\n var retval = {\n trace_id: trace.trace_id,\n spans: trace.spans.filter(function (span) {\n return tsStart <= span.sr && span.sr <= tsEnd;\n })\n };\n return retval;\n });\n }", "title": "" }, { "docid": "8e16ff61f98f0a111af895c47821d0bc", "score": "0.43693957", "text": "function Filter(layer, projection) {\n 'use strict';\n /**\n * featureLayer is a reference of the Feature Layer Object\n * @type {Feature|*}\n */\n var featureLayer = layer.getFeatureLayers();\n /**\n * ListLayers contains all queryable Layers of the map\n * @type {Array}\n */\n this.ListLayers = featureLayer.getListFeatures();\n /**\n * ListDataLayers contains all data about queryable Layers of the map\n * @type {Array}\n */\n this.ListDataLayers = featureLayer.getListFilterFeatures();\n /**\n * geoJSONFormat define the format GeoJSON\n * @type {ol.format.GeoJSON}\n */\n var geoJSONFormat = new ol.format.GeoJSON();\n /**\n * esrijsonFormat define the format EsriJSON\n * @type {ol.format.EsriJSON}\n */\n var esriJSONFormat = new ol.format.EsriJSON();\n\n \n /**\n * Filter Method\n * filterLayerGEOJSON apply a filter on the Lutece Web Service\n * @param name the layer name\n * @param urlGeoJson the new url ot filter data\n * @param refreshmode \n */\n this.filterLayerGEOJSON = function(name, urlGeoJson, refreshmode){ \n \tvar dataProj = this.ListLayers[name].getSource().getProjection();\n \tthis.filterLayerGEOJSON (name, dataproj, urlGeoJson, refreshmode);\n };\n \n /**\n * Filter Method\n * filterLayerGEOJSON apply a filter on the Lutece Web Service\n * @param name the layer name\n * @param dataProj the projection of the datasource. Ex: 'EPSG:2154'\n * @param urlGeoJson the new url to filter data\n * @param refreshmode \n */\n this.filterLayerGEOJSON = function(name, dataProj, urlGeoJson, refreshmode){\n var vectorSource;\n if(refreshmode === 'dynamic'){\n vectorSource = new ol.source.Vector({\n attributions: this.ListLayers[name].getSource().getAttributions(),\n strategy: ol.loadingstrategy.bbox,\n loader: function (extent) {\n if(extent[0] === -Infinity){\n extent = projection.getExtent();\n }\n $.ajax({\n url : urlGeoJson,\n type : 'GET',\n dataType: 'jsonp',\n jsonpCallback: 'callback',\n data: {\n bbox: extent.join(',')\n }, \n success: function (response) {\n if (response.error) {\n console.log(response.error.message + '\\n' + response.error.details.join('\\n'));\n } else {\n var features = geoJSONFormat.readFeatures(response,{\n dataProjection: dataProj,\n featureProjection: projection.getProjection().getCode()\n });\n if (features.length > 0) {\n if(vectorSource instanceof ol.source.Cluster) {\n vectorSource.getSource().addFeatures(features);\n } else{\n vectorSource.addFeatures(features);\n }\n }\n }\n }\n });\n }\n });\n }\n if(refreshmode === 'static'){\n vectorSource = new ol.source.Vector({\n attributions: this.ListLayers[name].getSource().getAttributions(),\n loader: function () {\n $.ajax({\n url : urlGeoJson,\n type : 'GET',\n dataType: 'jsonp',\n jsonpCallback: 'callback',\n success: function (response) {\n if (response.error) {\n console.log(response.error.message + '\\n' + response.error.details.join('\\n'));\n } else {\n var features = geoJSONFormat.readFeatures(response,{\n dataProjection: dataProj,\n featureProjection: projection.getProjection().getCode()\n });\n if (features.length > 0) {\n if(vectorSource instanceof ol.source.Cluster) {\n vectorSource.getSource().addFeatures(features);\n } else{\n vectorSource.addFeatures(features);\n }\n }\n }\n }\n });\n }\n });\n }\n var clusterLayer = featureLayer.getClusterLayers();\n for(var i = 0; i < clusterLayer.length; i++) {\n if (clusterLayer[i].get('title') === name) {\n var sourceCluster = vectorSource;\n vectorSource = new ol.source.Cluster({\n source: sourceCluster,\n distance: this.ListLayers[name].getSource().distance_\n });\n }\n }\n this.ListLayers[name].setSource(vectorSource);\n };\t \n\t \n /**\n * Filter Method\n * filterLayerWFS apply a filter on the all Web Service\n * @param name the layer name\n * @param query the query to apply to filter data\n */\n this.filterLayerWFS = function(name, query){\n var server = this.ListDataLayers[name][0];\n var url = this.ListDataLayers[name][1];\n var dataProj = this.ListDataLayers[name][2];\n var queryOrigin = this.ListDataLayers[name][3];\n var dataAttribution = this.ListDataLayers[name][4];\n var queryFinal = '';\n var vectorSource = null;\n if(queryOrigin !== '' && query !== ''){\n queryFinal = queryOrigin + ' AND ' + query;\n }else if (query === ''){\n queryFinal = queryOrigin;\n }else{\n queryFinal = query;\n }\n if (server === 'AGS') {\n if(queryFinal === '') {\n vectorSource = new ol.source.Vector({\n attributions: [\n new ol.Attribution({\n html: dataAttribution\n })\n ],\n loader: function (extent) {\n if (extent[0] === -Infinity) {\n extent = projection.getExtent();\n }\n var webService = url + '/query/?f=json&returnGeometry=true&spatialRel=esriSpatialRelIntersects&geometry=' +\n encodeURIComponent('{\"xmin\":' + extent[0] + ',\"ymin\":' + extent[1] + ',\"xmax\":' + extent[2] + ',\"ymax\":' + extent[3] +\n ',\"spatialReference\":{\"wkid\":' + projection.getProjection().getCode().substring(5, projection.getProjection().getCode().length) +\n '}}') + '&geometryType=esriGeometryEnvelope&inSR=&outFields=*&' + 'outSR=' +\n projection.getProjection().getCode().substring(5, projection.getProjection().getCode().length);\n $.ajax({\n url: webService,\n dataType: 'jsonp',\n success: function (response) {\n if (response.error) {\n console.log(response.error.message + '\\n' + response.error.details.join('\\n'));\n } else {\n var features = esriJSONFormat.readFeatures(response, {\n featureProjection: projection.getProjection().getCode()\n });\n if (features.length > 0) {\n if(vectorSource instanceof ol.source.Cluster) {\n vectorSource.getSource().addFeatures(features);\n }else{\n vectorSource.addFeatures(features);\n }\n }\n }\n }\n });\n },\n strategy: ol.loadingstrategy.tile(ol.tilegrid.createXYZ({\n tileSize: 512\n }))\n });\n }else{\n vectorSource = new ol.source.Vector({\n attributions: [\n new ol.Attribution({\n html: dataAttribution\n })\n ],\n loader: function (extent) {\n if(extent[0] === -Infinity){\n extent = projection.getExtent();\n }\n var webService = url + '/query?where=' + queryFinal + '&f=json&returnGeometry=true&spatialRel=esriSpatialRelIntersects&geometry=' +\n encodeURIComponent('{\"xmin\":' + extent[0] + ',\"ymin\":' + extent[1] + ',\"xmax\":' + extent[2] + ',\"ymax\":' + extent[3] +\n ',\"spatialReference\":{\"wkid\":' + projection.getProjection().getCode().substring(5, projection.getProjection().getCode().length) +\n '}}') + '&geometryType=esriGeometryEnvelope&inSR=&outFields=*&' + 'outSR=' +\n projection.getProjection().getCode().substring(5, projection.getProjection().getCode().length);\n $.ajax({\n url: webService,\n dataType: 'jsonp',\n success: function (response) {\n if (response.error) {\n console.log(response.error.message + '\\n' + response.error.details.join('\\n'));\n }else {\n var features = esriJSONFormat.readFeatures(response, {\n featureProjection: projection.getProjection().getCode()\n });\n if (features.length > 0) {\n if(vectorSource instanceof ol.source.Cluster) {\n vectorSource.getSource().addFeatures(features);\n }else{\n vectorSource.addFeatures(features);\n }\n }\n }\n }\n });\n },\n strategy: ol.loadingstrategy.tile(ol.tilegrid.createXYZ({\n tileSize: 512\n }))\n });\n }\n }else if (server === 'GeoServer'){\n var projectionData = projection.getEpsgData(dataProj, false)[0];\n if(queryFinal !== ''){\n queryFinal = \"&CQL_FILTER=\" + queryFinal;\n }\n vectorSource = new ol.source.Vector({\n attributions: [\n new ol.Attribution({\n html: dataAttribution\n })\n ],\n loader: function(extent) {\n var webService = '';\n if(queryFinal !== '') {\n webService = url + queryFinal + '&outputFormat=text/javascript&srsname=' + projectionData.getCode() + '&format_options=callback:loadFeatures';\n }else{\n if(extent[0] === -Infinity){\n extent = projection.getExtent();\n }\n var extentCapture = ol.extent.applyTransform(extent, ol.proj.getTransform(projection.getProjection().getCode(), projectionData.getCode()));\n webService = url + '&outputFormat=text/javascript&format_options=callback:loadFeatures&' +\n 'srsname=' + projectionData.getCode() + '&bbox=' + extentCapture.join(',') + ',' + projectionData.getCode();\n }\n $.ajax({\n url: webService,\n dataType: 'jsonp'\n });\n window.loadFeatures = function(response) {\n var features = geoJSONFormat.readFeatures(response, {\n dataProjection: projectionData.getCode(),\n featureProjection: projection.getProjection().getCode()\n });\n if(vectorSource instanceof ol.source.Cluster) {\n vectorSource.getSource().addFeatures(features);\n }else{\n vectorSource.addFeatures(features);\n }\n };\n },\n strategy: ol.loadingstrategy.tile(ol.tilegrid.createXYZ({\n tileSize: 512\n }))\n });\n }\n var clusterLayer = featureLayer.getClusterLayers();\n for(var i = 0; i < clusterLayer.length; i++) {\n if (clusterLayer[i].get('title') === name) {\n var sourceCluster = vectorSource;\n vectorSource = new ol.source.Cluster({\n attributions: [\n new ol.Attribution({\n html: dataAttribution\n })\n ],\n source: sourceCluster,\n distance: this.ListLayers[name].getSource().distance_\n });\n }\n }\n this.ListLayers[name].setSource(vectorSource);\n };\n}", "title": "" }, { "docid": "c83a86b866602c64baf3cd012dd2bb07", "score": "0.43686602", "text": "function filterRows(row) {\n return !/_bucket$/.test(row.type) && !/^series/.test(row.type) && !/^percentile/.test(row.type) && !/^top_hit/.test(row.type);\n}", "title": "" }, { "docid": "d938deeff83dfd66ea4cd417cf7e44fb", "score": "0.43660587", "text": "function findThinLandPixelsXAxis(srcImageData)\n{\n let LAND_CHANNEL = 1;\n let SUM_THRESHOLD = 120; // sum that the 2 middle values need to add to be recognised\n let FILL_THRESHOLD = 10; // threshold to fill in a pixel\n let OUTER_EDGE_THRESHOLD = 0; // edge pixel\n\n let d = srcImageData.data;\n let c0,c1,c2,c3;\n for(let y = 0; y < _h ; ++ y){\n\n for(let x = 0; x < _w-3 ; ++ x){\n\n c0 = d[4*( y*_w + x + 0 ) + LAND_CHANNEL];\n c1 = d[4*( y*_w + x + 1 ) + LAND_CHANNEL];\n c2 = d[4*( y*_w + x + 2 ) + LAND_CHANNEL];\n c3 = d[4*( y*_w + x + 3 ) + LAND_CHANNEL];\n if((c0 <= OUTER_EDGE_THRESHOLD) && (c3 <= OUTER_EDGE_THRESHOLD))\n {\n if( (c1 +c2) > SUM_THRESHOLD )\n {\n // console.log(\"here------\");\n\n if(c1 >= FILL_THRESHOLD){\n _idmap[y*_w + x + 1] = 0;\n }\n if(c2 >= FILL_THRESHOLD){\n _idmap[y*_w + x + 2] = 0;\n }\n }\n }\n }\n }\n\n}", "title": "" }, { "docid": "faf8932150ca0c7a42b777c70b9a4fd2", "score": "0.43526977", "text": "function vanishAllBelow(death_count) {\r\n\r\n if (map.getLayer(\"highlighted_city\")) map.removeLayer(\"highlighted_city\");\r\n if (map.getLayer(\"city-mask\")) map.removeLayer(\"city-mask\");\r\n\r\n if (!map.getLayer(\"vanishable\")) {\r\n map.addLayer({\r\n 'id': 'vanishable',\r\n 'type': 'fill',\r\n 'source': 'mun',\r\n 'source-layer': 'municipalities',\r\n 'paint': {\r\n 'fill-opacity' : 1,\r\n 'fill-outline-color' : 'transparent',\r\n 'fill-color' : 'black'\r\n },\r\n 'filter': ['<=', 'pop_2019', ''] \r\n },\r\n 'admin-1-boundary-bg');\r\n }\r\n\r\n map.setFilter(\r\n 'vanishable', [\r\n '<=', \r\n [\r\n 'number', \r\n ['get', 'pop_2019']\r\n ], \r\n death_count\r\n ]);\r\n}", "title": "" }, { "docid": "9a38cadcee6966bab8bcc4fe2512bf15", "score": "0.43446952", "text": "function map2(violationType,violationTime){\n var myLatlng = new google.maps.LatLng(latitude,longitude);\n var mapOptions = {\n zoom: 13,\n scrollwheel: false,\n center: myLatlng\n };\n let map = new google.maps.Map(document.getElementById('google-map'), mapOptions);\n viol_list.forEach((elem)=>{\n //apply the filter\n if(compareType(elem, violationType) && compareDate(elem,violationTime) ){\n var marker = new google.maps.Marker({\n position: new google.maps.LatLng(elem.getLatitude(),elem.getLongitude()),\n label: elem.getType(),\n map: map\n });\n marker.setMap(map);\n }\n });\n\n}", "title": "" }, { "docid": "777e9a1cc0d7f5bf540ecfc882b4c6df", "score": "0.43410516", "text": "function mapLoadedHandler(maploadEvent){\n\n //create a layer definition for the gps points\n var layerDefinition = {\n \"objectIdField\": \"OBJECTID\",\n \"trackIdField\": \"TrackID\",\n \"geometryType\": \"esriGeometryPoint\",\n \"timeInfo\": {\n \"startTimeField\": \"DATETIME\",\n \"endTimeField\": null,\n \"timeExtent\": [1277412330365],\n \"timeInterval\": 1,\n \"timeIntervalUnits\": \"esriTimeUnitsMinutes\"\n },\n \"fields\": [\n {\n \"name\": \"OBJECTID\",\n \"type\": \"esriFieldTypeOID\",\n \"alias\": \"OBJECTID\",\n \"sqlType\": \"sqlTypeOther\"\n },\n {\n \"name\": \"TrackID\",\n \"type\": \"esriFieldTypeInteger\",\n \"alias\": \"TrackID\"\n },\n {\n \"name\": \"DATETIME\",\n \"type\": \"esriFieldTypeDate\",\n \"alias\": \"DATETIME\"\n }\n ]\n };\n\n var featureCollection = {\n layerDefinition: layerDefinition,\n featureSet: null\n };\n featureLayer = new FeatureLayer(featureCollection);\n\n //setup a temporal renderer\n var sms = new SimpleMarkerSymbol().setColor(new Color([255, 0, 0])).setSize(8);\n var observationRenderer = new SimpleRenderer(sms);\n var latestObservationRenderer = new SimpleRenderer(new SimpleMarkerSymbol());\n var infos = [\n {\n minAge: 0,\n maxAge: 1,\n color: new Color([255, 0, 0])\n }, {\n minAge: 1,\n maxAge: 5,\n color: new Color([255, 153, 0])\n }, {\n minAge: 5,\n maxAge: 10,\n color: new Color([255, 204, 0])\n }, {\n minAge: 10,\n maxAge: Infinity,\n color: new Color([0, 0, 0, 0])\n }\n ];\n\n var ager = new TimeClassBreaksAger(infos, TimeClassBreaksAger.UNIT_MINUTES);\n var sls = new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID,\n new Color([255, 0, 0]), 3);\n var trackRenderer = new SimpleRenderer(sls);\n var renderer = new TemporalRenderer(observationRenderer, latestObservationRenderer,\n trackRenderer, ager);\n featureLayer.setRenderer(renderer);\n map.addLayer(featureLayer);\n\n gl = new GraphicsLayer();\n map.addLayer(gl);\n \n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(zoomToLocation, locationError);\n navigator.geolocation.watchPosition(showLocation, locationError);\n console.log(\"geolocation!\");\n } else {\n console.log(\"No geolocation.\");\n }\n }", "title": "" }, { "docid": "817343da956c9a507ae53f3f411d3759", "score": "0.43373913", "text": "function requestToMapFilter(inids, anids) {\n if (chartVisualizationDecided == 'map') {\n loadingVisualization(true);\n setTimeout(function () {\n // send a request to server side to reset map image and theme setting\n mapObj.setMapFilterRequest(inids, anids, 'yes'); // yes to render map image\n // redraw theme details\n redrawThemeDetails(['theme', 'series', 'detail', 'title', 'thname', 'sthseries']); // thname for update theme name also\n\n loadingVisualization(false);\n }, 500);\n }\n else {\n // just sending request to update inids and anid no response.\n mapObj.setMapFilterRequest(inids, anids, 'no'); // no to render map image\n }\n}", "title": "" }, { "docid": "77cdc0dc4116d97a5b840f50a84d151b", "score": "0.4335721", "text": "function mapIt(){\n\t$(document).ready(function(){ \n\t\t$(\"#regions_div\").show();\n \t\t$(\"#commTable\").hide();\n\t\tvar ctycnt=topCtyTable[\"12\"].length;\n\t\t\n\t\tvar mapTots =[[],[]]; \n\t\tfor(i=1;i<60;i++){\n\t\t\tmapTots[i-1][0]=topCtyTable[\"12\"][i][2];\n\t\t\tmapTots[i-1][1]=Number(topCtyTable[\"12\"][i][3]);\n\t\t}\n\t\tconsole.log(mapTots);\n\t\t\n\t\tgoogle.charts.load('current', {'packages':['geochart']});\n \t\tgoogle.charts.setOnLoadCallback(drawRegionsMap);\n \t\tfunction drawRegionsMap() {\n \t\tvar data = google.visualization.arrayToDataTable(mapTots);\n \tvar options = {};\n\t\tvar chart = new google.visualization.GeoChart(document.getElementById('regions_div'));\n \tchart.draw(data, options);\n \t\t}\t\n\t});\n}", "title": "" }, { "docid": "eaf8fcce96e90accd4a517a9ae720deb", "score": "0.43333468", "text": "function interateOverRegionArray(rArray,func){\n for(var x=0;x<rArray.length;x++){\n for(var y=0;y<rArray[y].length;y++){\n func(rArray[x][y]);\n }\n }\n}", "title": "" }, { "docid": "c76de9405eb332a02d1c21a1b8c4b703", "score": "0.43263823", "text": "function getStatesInRegion() {\n var region = getRegion();\n return state_mapping.filter(d => d.state_region == region);\n }", "title": "" }, { "docid": "de848b4428a69cda1f2470b298786390", "score": "0.43253073", "text": "function selectTemperaturesBySensorNum(sensorNum, cntRows, startDate, endDate, callback) {\n // - Num records is an SQL filter from latest record back trough time series, \n // - start_date is the first date in the time-series required, \n // - callback is the output function\n if (cntRows <= 0)\n cntRows = 1000000000000000000;\n selectSensors(sensorNum, (err, sensors) => {\n if (sensors.length === 0)\n return callback(null, []);\n if (sensors.length > 1)\n return callback('Bad sensor number.');\n db.query(\"SELECT t.UnixTime as unixTime, t.TemperatureValue as temperatureValue FROM Temperatures t WHERE t.TemperatureTime >= ? AND t.TemperatureTime < ? AND t.SensorId = ? ORDER BY t.UnixTime ASC LIMIT ?\", [startDate, endDate, sensors[0].SensorId, cntRows],\n function(err, rows) {\n if (err) {\n console.log('Error serving querying database. ' + err);\n callback(err);\n } else {\n //callback(null, rows.map((item) => {return {ut:Math.round(item.unixTime / 60 / 1000) * 60 * 1000, t:item.temperatureValue}}));\n callback(null, rows.map((item) => {return [Math.round(item.unixTime / 60 / 1000) * 60 * 1000, item.temperatureValue]}));\n }\n });\n });\n}", "title": "" }, { "docid": "60bd6d10f78a99eed45e18cab2f99ba0", "score": "0.43251714", "text": "function NumberRangeColumnFilter({\n column: { filterValue = [], preFilteredRows, setFilter, id },\n}) {\n const [rangeValue, setRangeValue] = React.useState();\n\n return (\n <div\n style={{\n display: 'flex',\n }}\n >\n\t <DateRangePicker \n\t\tvalue={rangeValue}\n\t\tonChange={e => {\n\t\t\tsetRangeValue(e)\n\t\t\tconst mind = e ? new Date(e[0]) : undefined\n\t\t\tconst maxd = e ? new Date(e[1]) : undefined\n\t\t\tsetFilter((old = []) => [mind ? mind.getTime() : undefined])\n\t\t\tsetFilter((old = []) => [old[0], maxd ? maxd.getTime() : undefined])\n }}\n\t />\n </div>\n )\n}", "title": "" }, { "docid": "04bd671f3d24a2d4a56b2ebf91ba824a", "score": "0.43216637", "text": "function stitchTms(west, south, east, north, zoom, stitched, callback) {\n var x, y, url;\n\n for(x=west; x<=east; x++) {\n for(y=north; y>=south; y--) {\n url = getUrl({x: x, y: y, z: zoom});\n\n drawImage(url, x-west, north-y, stitched, callback);\n }\n }\n }", "title": "" }, { "docid": "9081fed66bd76ee110d0323ef60a6c70", "score": "0.43177685", "text": "function filterFunction(f) {\n refilter = crossfilter_filterAll;\n\n filterIndexFunction(refilterFunction = f);\n\n lo0 = 0;\n hi0 = n;\n\n return dimension;\n }", "title": "" }, { "docid": "9081fed66bd76ee110d0323ef60a6c70", "score": "0.43177685", "text": "function filterFunction(f) {\n refilter = crossfilter_filterAll;\n\n filterIndexFunction(refilterFunction = f);\n\n lo0 = 0;\n hi0 = n;\n\n return dimension;\n }", "title": "" }, { "docid": "9081fed66bd76ee110d0323ef60a6c70", "score": "0.43177685", "text": "function filterFunction(f) {\n refilter = crossfilter_filterAll;\n\n filterIndexFunction(refilterFunction = f);\n\n lo0 = 0;\n hi0 = n;\n\n return dimension;\n }", "title": "" } ]
844b3e0c5f584e79c4438d6d6fd10904
save email to cookies
[ { "docid": "ab49bdc43d521d15ae2df3b41b705b89", "score": "0.7702611", "text": "function saveToCookies(data) {\n var d = new Date();\n d.setMonth(d.getMonth() + 1);\n document.cookie = \"Email=\" + data + \";expires=\" + d.toUTCString();\n }", "title": "" } ]
[ { "docid": "4e8d07f2d714d16b1203ccc1ffdc71fc", "score": "0.7365653", "text": "function criarCookie(email){\n var emailCookie = 'email='+email+';path=/;expires=never';\n document.cookie = emailCookie;\n}", "title": "" }, { "docid": "9c59bafe12df7e2d88cf200d7a03554f", "score": "0.72728604", "text": "setEmail(email) {\n this.ctx.cookies.set('username', email, {\n maxAge: 1000 * 60 * 60 * 3,\n expires: 1000 * 60 * 60 * 3,\n path: '/',\n signed: true,\n encrypt: false\n });\n }", "title": "" }, { "docid": "2b1b9c423369bc2067e0b14e091f8838", "score": "0.7092506", "text": "function saveMail(email, url, cookie, callback) {\n var data = {\n contents: email,\n cookie: cookie,\n save_message: 1\n };\n\n var xhr = new XMLHttpRequest();\n xhr.open(\"POST\", url, true);\n // xhr.setRequestHeader('Content-Type', 'application/json; charset=UTF-8');\n // send the collected data as JSON\n xhr.send(JSON.stringify(data));\n xhr.onloadend = function() {\n // TODO: expect response from wice\n callback(xhr);\n };\n}", "title": "" }, { "docid": "ce0a8f3260d3ad7426b3c30f9d585b53", "score": "0.6904685", "text": "function verificaCookie(){\n var incCookie = document.cookie.split(';');\n if(incCookie!=''){\n for(var i = 0; i<incCookie.length; i++){\n var cookieAtual = incCookie[i].split('=');\n if(cookieAtual[0]=='email'){\n emaildoCookie = cookieAtual[1];\n }\n }\n }\n}", "title": "" }, { "docid": "e188d8bc7a117e38090dd444e29de8dc", "score": "0.68759763", "text": "function setCookie(cemail, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays*24*60*60*1000));\n var expires = \"expires=\"+ d.toUTCString();\n document.cookie = cemail + \"=\" + cvalue + \";\" + expires + \";path=/\";\n}", "title": "" }, { "docid": "73b91b5a48920c1da91fd9526f1eaf98", "score": "0.6789553", "text": "function setUserStatus(email, status, identity) {\n document.cookie = \"email=\" + email;\n document.cookie = \"status=\" + status;\n document.cookie = \"identity=\" + identity;\n}", "title": "" }, { "docid": "55e24564a4f221ef3ae25c36a7ab45b8", "score": "0.66142327", "text": "function cookiesContacto() {\n\n\tvar c_nombre = document.getElementById(\"nombre\").value;\n\tsetCookie(\"nombre_contacto\", c_nombre);\n\n\tvar c_apellido1 = document.getElementById(\"apellido1\").value;\n\tsetCookie(\"apellido1_contacto\", c_apellido1);\n\n\tvar c_apellido2 = document.getElementById(\"apellido2\").value;\n\tsetCookie(\"apellido2_contacto\", c_apellido2);\n\n\tvar c_email = document.getElementById(\"email\").value;\n\tsetCookie(\"email_contacto\", c_email);\n\n}", "title": "" }, { "docid": "83238d8df304f66ea0973436cc08335f", "score": "0.66060716", "text": "function officerCookieCreate(email, remember) {\n\t// generate random id\n\tid = generateID();\n\t\n\t// if set to remeber add a expirery date\n\tif (remember != true) {\n\t\tvar expires = \"\";\n\t} else {\n\t\t// else calculate expirery time of 1 year\n\t\tvar d = new Date();\n\t\td.setTime(d.getTime() + (365 * 24 * 60 * 60 * 1000));\n\t\tvar expires = \"expires=\"+d.toUTCString()+\";\";\n\t}\n\t\n\t// write email and random id number to local cookie #Josh\n\tdocument.cookie = \"login_uname=\" + email + \";domain=ct4009-17bn.studentsites.glos.ac.uk;path=/;\" + expires;\n\tdocument.cookie = \"login_uremember=\" + remember + \";domain=ct4009-17bn.studentsites.glos.ac.uk;path=/;\" + expires;\n\tdocument.cookie = \"login_uuid=\" + id + \";domain=ct4009-17bn.studentsites.glos.ac.uk;path=/;\" + expires;\n\t\n\t// write email and random id number to local cookie #Aaron\n\tdocument.cookie = \"login_uname=\" + email + \";domain=ct4009-17cc.studentsites.glos.ac.uk;path=/;\" + expires;\n\tdocument.cookie = \"login_uremember=\" + remember + \";domain=ct4009-17cc.studentsites.glos.ac.uk;path=/;\" + expires;\n\tdocument.cookie = \"login_uuid=\" + id + \";domain=ct4009-17cc.studentsites.glos.ac.uk;path=/;\" + expires;\n\t\n\t// write email and random id number to local cookie #Oliver\n\tdocument.cookie = \"login_uname=\" + email + \";domain=ct4009-17cr.studentsites.glos.ac.uk;path=/;\" + expires;\n\tdocument.cookie = \"login_uremember=\" + remember + \";domain=ct4009-17cr.studentsites.glos.ac.uk;path=/;\" + expires;\n\tdocument.cookie = \"login_uuid=\" + id + \";domain=ct4009-17cr.studentsites.glos.ac.uk;path=/;\" + expires;\n\t\n\treturn id;\n}", "title": "" }, { "docid": "e1f6912692fee077edef7d26313dd5b0", "score": "0.6457278", "text": "function getUserEmail() {\n var cookieArr = document.cookie.split(\";\");\n var email;\n for (var i = 0; i < cookieArr.length; i++) {\n var dataArr = cookieArr[i].split(\"=\"); // get attribute and their value\n if (dataArr[0].search(\"email\") !== -1) { // in email part\n email = dataArr[1];\n }\n }\n return email;\n}", "title": "" }, { "docid": "47f1b8417017a26abb26448dcf49025b", "score": "0.64057565", "text": "function saveData() {\n setCookie('vaccineCheckerData', JSON.stringify(data));\n sendMessage(data);\n}", "title": "" }, { "docid": "47604ca747bdf4f133de2f574b7e1e75", "score": "0.63978434", "text": "function saveConnectionCookies(setcookies, domain) {\r\n\r\n for(let i=0; i<setcookies.length;i++) {\r\n let key = setcookies[i].split(';')[0].split('=')[0];\r\n let val = setcookies[i].split(';')[0].split('=')[1];\r\n\r\n google_cookies[domain][key] = val;\r\n }\r\n}", "title": "" }, { "docid": "71b4b79ff3f5caeb6148a4cdd9189f04", "score": "0.6333456", "text": "function saveCookie(){\n let expire = new Date();\n expire.setTime(expire.getTime()+(1000*60*60*24*30)); // 30 dias\n let c = `record=${JSON.stringify({time, intents})};`;\n c+=`expires=${expire.toGMTString()};`;\n document.cookie = c;\n}", "title": "" }, { "docid": "e0cbfe22e985d4a85d2ce0e09679f0c8", "score": "0.6321693", "text": "async saveCookie(cookie) {\n try {\n await AsyncStorage.saveToAsyncStorage('cookie', cookie);\n } catch (error) {\n console.log(\"Error saving cookie to AsyncStorage\", error);\n }\n }", "title": "" }, { "docid": "66899b5de3b8fb4848cfdcffe52c4c15", "score": "0.6316251", "text": "function saveCookie() {\r\n if (cookielock) {\r\n return;\r\n }\r\n\r\n cookielock = true;\r\n\r\n cookieobj = {};\r\n\r\n cookieobj.map = document.getElementsByName('showmap')[0].checked ? 1 : 0;\r\n cookieobj.iZoom = document.getElementsByName('itemdivsize')[0].value;\r\n cookieobj.mZoom = document.getElementsByName('mapdivsize')[0].value;\r\n\r\n cookieobj.mPos = document.getElementsByName('mapposition')[1].checked ? 1 : 0;\r\n\r\n cookieobj.prize = document.getElementsByName('showprizes')[0].checked ? 1 : 0;\r\n\r\n cookieobj.rewards = JSON.parse(JSON.stringify(rewards));\r\n cookieobj.items = JSON.parse(JSON.stringify(itemLayout));\r\n cookieobj.obtainedItems = JSON.parse(JSON.stringify(items));\r\n cookieobj.overworldChests = JSON.parse(JSON.stringify(serializeChests()));\r\n cookieobj.dungeonChests = JSON.parse(JSON.stringify(serializeDungeonChests()));\r\n\r\n setCookie(cookieobj);\r\n\r\n cookielock = false;\r\n}", "title": "" }, { "docid": "025ed0b4a842b21b57143f311a7513ec", "score": "0.6308135", "text": "setCookies(email, password) {\n this.setEmail(email);\n this.setPassword(password);\n }", "title": "" }, { "docid": "9f921f10d1ab4fd7534288ebba735e31", "score": "0.62519175", "text": "function setCookie(response, data) {\n response.cookie('sms', JSON.stringify(data), { maxAge: 9000000 });\n}", "title": "" }, { "docid": "a99a00d558cd1cc655ca859470ebbe5c", "score": "0.62467617", "text": "saveSettings() {\n let cookieService = get(this, 'cookies'),\n expires = this.get('moment').moment().add(3, 'M').toDate(),\n settings = {};\n\n if(get(this, 'rememberUser')) {\n settings = Base64.encode(JSON.stringify({\n sortAlpha: get(this, 'sortAlpha'),\n lastCheck: new Date().getTime()\n }));\n\n cookieService.write(COOKIE_NAME, settings, { expires });\n }\n }", "title": "" }, { "docid": "96ab7c7699d4e0d2c136b2b4d7d6c99f", "score": "0.6234852", "text": "function setCookie (uid, email, provider, name) {\n Cookies.set('uid', uid)\n Cookies.set('email', email)\n Cookies.set('provider', provider)\n Cookies.set('name', name)\n}", "title": "" }, { "docid": "a20ec2b90f044a101b285b1dcf77dee2", "score": "0.6228327", "text": "static save(name, value, days, domain = '.jcpenney.com') {\n /**\n * Condition for the server side rendering\n */\n if (__SERVER__) {\n return;\n }\n let expires;\n const date = new Date();\n if (days) {\n date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));\n expires = (`; expires=${date.toGMTString()}`);\n } else {\n expires = '';\n }\n document.cookie = (`${name}=${value}${expires};domain=${domain};path=/`);\n }", "title": "" }, { "docid": "4f4b4a32a45c6dc4a847f001c2f24c07", "score": "0.619315", "text": "function setCookie(obj){\n if(obj.hasOwnProperty('email') && obj.hasOwnProperty('firstname') && obj.hasOwnProperty('lastname') && obj.hasOwnProperty(\"address\")){\n $.cookie('email', obj.email, { expires: 1, path: '/' });\n $.cookie('firstname', obj.firstname, { expires: 1, path: '/' });\n $.cookie('lastname', obj.lastname, { expires: 1, path: '/' });\n $.cookie('address', JSON.stringify(obj.address), { expires: 1, path: '/' });\n \n $.event.trigger({\n type:\"userLoggedIn\",\n message:\"a user just logged in\",\n time : new Date()\n });\n \n return true;\n }else\n return false;\n}", "title": "" }, { "docid": "ad2fc99d7bbc8649a603bdf8b7d401a7", "score": "0.61923337", "text": "function getEmail(req){\n let jsonCookies = cookieParser.JSONCookies(req.cookies);\n let email = jsonCookies.email;\n return email;\n}", "title": "" }, { "docid": "f7ecf28a1ff66c8e9365b54d2c84714f", "score": "0.6183474", "text": "function setConfirmed() {\n let exdate = new Date();\n exdate.setDate(exdate.getDate() + expiration);\n exdate = exdate.toUTCString();\n document.cookie = `${confirmedCookieName}=yes;expires=${exdate};path=/`;\n }", "title": "" }, { "docid": "a927bc59f9676af51f30a71f7d2c6f9e", "score": "0.6183025", "text": "function setCookies() {\r\n // set cookie for each field value\r\n document.cookie = \"username=\" + document.getElementById(\"userName\").value;\r\n document.cookie = \"password=\" + document.getElementById(\"password\").value;\r\n document.cookie = \"verifiedPassword=\" + document.getElementById(\"passwordVerify\").value;\r\n document.cookie = \"firstname=\" + document.getElementById(\"firstName\").value;\r\n document.cookie = \"lastname=\" + document.getElementById(\"lastName\").value;\r\n document.cookie = \"email=\" + document.getElementById(\"email\").value;\r\n document.cookie = \"phonenumber=\" + document.getElementById(\"phoneNumber\").value;\r\n document.cookie = \"newsletter=\" + document.getElementById(\"signUpNewsletter\").value;\r\n}", "title": "" }, { "docid": "e073e5572b4334494235bebecb25776f", "score": "0.6165478", "text": "saveCookie() {\n this.update_();\n this.element_.modal('hide');\n if (this.timer_) {\n this.timer_.start();\n }\n this.peer_.send('consent', '');\n }", "title": "" }, { "docid": "152566df04d0a8f0429d862c838a7b05", "score": "0.6143375", "text": "setCookies(token, fname, lname, email, createdat, lastSignin, id, persist) {\n var secureState = false;\n var sign = true;\n var type = \"user\"\n if (persist) {\n Cookies.set(\"cNf\", btoa(lname), { expires: 30, secure: secureState });\n Cookies.set(\"cNl\", btoa(fname), { expires: 30, secure: secureState });\n Cookies.set(\"cM\", btoa(email), { expires: 30, secure: secureState });\n Cookies.set(\"cTok\", token, { expires: 30, secure: secureState });\n Cookies.set(\"cCre\", btoa(createdat), { expires: 30, secure: secureState });\n Cookies.set(\"cLsi\", btoa(lastSignin), { expires: 30, secure: secureState });\n Cookies.set(\"cId\", btoa(id), { expires: 30, secure: secureState });\n Cookies.set(\"type\", type, { expires: 30, secure: secureState });\n Cookies.set(\"sin\", btoa(sign), { expires: 30, secure: secureState });\n } else {\n Cookies.set(\"cNf\", btoa(lname), { secure: secureState });\n Cookies.set(\"cNl\", btoa(fname), { secure: secureState });\n Cookies.set(\"cM\", btoa(email), { secure: secureState });\n Cookies.set(\"cTok\", token, { secure: secureState });\n Cookies.set(\"cCre\", btoa(createdat), { secure: secureState });\n Cookies.set(\"cLsi\", btoa(lastSignin), { secure: secureState });\n Cookies.set(\"sin\", btoa(sign), { secure: secureState });\n Cookies.set(\"cId\", btoa(id), { secure: secureState });\n Cookies.set(\"type\", type, { secure: secureState });\n }\n }", "title": "" }, { "docid": "1c23de492c500e0ba33480243787a810", "score": "0.61000806", "text": "function setAuthenticatedUserIntoSession(email){\n sessionStorage.setItem(USER_AUTHENTICATED_CREDENTIAL, JSON.stringify(email));\n}", "title": "" }, { "docid": "4b7b3268882e0ef970508bacce10476a", "score": "0.6100036", "text": "function guardarCookie(nombre,valor,fecha) {\n document.cookie=nombre+\"=\"+valor+\";expires=\"+fecha;\n}", "title": "" }, { "docid": "2a2a20f48d2aeb86aca6b11a0a4ad0c0", "score": "0.60897064", "text": "function write_cookie( cookie_name ) {\n\t\n var form_data = $(\"#PersonaliseForm\").serialize();\n\n jQuery.ajax(\n {\n type: \"POST\",\n url: \"/podcasts/cookie\",\n data: form_data,\n error:\n function()\n {\n alert('unable to set cookie');\n }\n });\n}", "title": "" }, { "docid": "52bce2ea4b094e4084dbcf935be20ce7", "score": "0.6085873", "text": "function save(){\n localStorage.setItem('email', email.checked);\n localStorage.setItem('profile', profile.checked);\n localStorage.setItem('timezone', timezone.value);\n\n}", "title": "" }, { "docid": "d5e1cc5572fac8efbeef38fb5cd0324f", "score": "0.6078822", "text": "function saveSettings() {\n\tvar ttc_email = $('#txtEmail').val();\n\t\n\t//take the input value and store it\n localStorage.setItem(\"ttcemail\", ttc_email);\n\t\n\t//retrieve the storage, just to be sure!\n\tvar check_storage = localStorage.getItem(\"ttcemail\");\n\t//alert (\"The NEW storage is \"+check_storage);\n\t\n\t//Now run a check on it and display as appropriate\n\tcheck_credentials();\n return false;\n}", "title": "" }, { "docid": "81ea260cf416a96f913915db0f4ce7aa", "score": "0.6078463", "text": "function store() {\n localStorage.setItem('email', emailRegOpen);\n localStorage.setItem('senha', senhaRegOpen);\n // localStorage.setItem('name', nameRegOpen);\n }", "title": "" }, { "docid": "eb373af234a46e4205a3071a09194c91", "score": "0.6074621", "text": "function setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays*24*60*60*1000));\n var expires = \"expires=\"+ d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\"+\";domain=strategeion-career.herokuapp.com\";\n\n}", "title": "" }, { "docid": "e5a4849bedff021051c089bd1a38780f", "score": "0.6071583", "text": "saveCookieConsent(selection) {\n\t\tsetCookie('cookie_consent', JSON.stringify(selection), this.expiration);\n\t\tthis.pushSettings(selection);\n\t\tthis.cookieValue = JSON.stringify(selection);\n\t\tthis.cookiebar.classList.add('hidden');\n\t}", "title": "" }, { "docid": "df61b0df9f09dd8ff4d66b0d24d41d96", "score": "0.60666025", "text": "function saveBruker(){\n\n var bruker = {\n firstName: document.getElementById(\"fnavn\").value,\n lastName: document.getElementById(\"enavn\").value,\n mail: document.getElementById(\"email\").value,\n shooterId: document.getElementById(\"skytterNr\").value,\n phone: document.getElementById(\"tlfnr\").value,\n club: document.getElementById(\"klubb\").value,\n\n };\n\n if(localStorage.getItem(\"email\") !== null) {\n deletePerson(jsPerson._id)\n localStorage.clear()\n }\n postPerson(bruker);\n console.log(bruker);\n var email = document.getElementById(\"email\").value;\n localStorage.setItem(\"email\", email)\n\n}", "title": "" }, { "docid": "c83dd285fe0c4ac79b47934a6b99eb3b", "score": "0.60619205", "text": "function cookieSave(name, value, expires, domain) {\n var now = new Date();\n var expirestr = '';\n\n // let the cookie expire in 10 years by default\n if(expires == undefined) { expires = 10*365*86400; }\n\n if(expires > 0) {\n expires = new Date(now.getTime() + (expires*1000));\n expirestr = \" expires=\" + expires.toGMTString() + \";\";\n }\n\n var cookieStr = name+\"=\"+value+\"; path=\"+cookie_path+\";\"+expirestr;\n\n if(domain) {\n cookieStr += \";domain=\"+domain;\n }\n\n document.cookie = cookieStr;\n}", "title": "" }, { "docid": "d944d48fd71b218aaaa16a6764165bd3", "score": "0.60617685", "text": "function saveSettings() {\n $cookies.putObject(DICESTREAM_COOKIE, settingsService.settings, {expires:new Date(2020, 1, 1, 1, 1, 1)});\n }", "title": "" }, { "docid": "facc10257f9fc090b0de69946f0414d0", "score": "0.6057131", "text": "function submitEmail() {\n console.log(\"submit email\");\n var email = document.getElementById('register-email').value;\n var username = document.getElementById('register-username').value;\n var password = document.getElementById('register-password').value;\n\n console.log(\"saved: \" + email + \", \" + username + \", \" + password);\n localStorageSet('email', email);\n localStorageSet('username', username);\n localStorageSet('password', password);\n\n views['registerEmail'].classList.add('hidden');\n views['registerHome'].classList.remove('hidden');\n }", "title": "" }, { "docid": "3c6cf7e8f61165f103df8c071ef9183b", "score": "0.6020804", "text": "function saveProgressCookie(){\n\tvar d = $(\"#jsGrid\").data().JSGrid.data;\n\tCookies.set(\"GridSaveData\",d);\n\tCookies.set(\"BibTexSaveData\",$(\"#bibtexsource\").val());\n\tCookies.set(\"editingExistingData\",editingExistingData);\n}", "title": "" }, { "docid": "83789bc00d297a56038990c8624f4478", "score": "0.60108095", "text": "getEmail() {\n return this.ctx.cookies.get('username', {\n signed: true,\n encrypt: false\n });\n }", "title": "" }, { "docid": "a58137a2c59569e85307f469c07de14c", "score": "0.601037", "text": "function saveReminder() {\n \n // Validity check - making sure the title is filled with a value\n var title = document.getElementById(\"reminderTitle\");\n if (title.value === \"\") {\n alert('Title must not be empty');\n title.focus();\n return(0); // Ends check\n }\n var remLocation = document.getElementById(\"select_location\");\n \n var lng = getCookie(\"tmpLng\");\n var lat = getCookie(\"tmpLat\");\n \n // Making sure the lng a lat are set with a value\n if ( !lng || !lat) {\n alert('Must select location');\n remLocation.focus();\n return(0);\n }\n\n var reminderId = getCookie(\"updateReminderId\");\n if (reminderId == 0) {\n addNewReminder(lng, lat);\n }\n else {\n updateReminder(reminderId, lng, lat);\n }\n \n}", "title": "" }, { "docid": "d9df507ee06d0c185086387e61315fb3", "score": "0.59588265", "text": "function saveOrDeleteCookie(){\n\tvar isChecked = get(\"_spring_security_remember_me\");\n\tvar uname = get(\"j_username\").value;\n\tif(isChecked.checked == true){\n\t\tsaveCookie(uname);\n\t}else{\n\t\tdeleteCookie();\n\t}\n}", "title": "" }, { "docid": "ed9ddc3519f7309a11d30da4f44529af", "score": "0.5955875", "text": "function setCookie () {\n let y = ar3.join(\"|\");\n document.cookie = \"Tim\" + encodeURIComponent(ar3.join(\"|\"))\n}", "title": "" }, { "docid": "985cd4ec4aa8af1ecbdcdcef6302910e", "score": "0.59402394", "text": "function saveUserName() {\n var nameBox = document.getElementById('name');\n\n // Not very strong verification here - the game will do it.\n var value = nameBox.value;\n if (!value || !value.length) {\n value = 'User';\n }\n var maxAge = 60 * 60 * 24 * 30 * 12;\n var futureDate = new Date(+(new Date()) + maxAge * 1000);\n document.cookie =\n 's_un=' + encodeURIComponent(value) +\n '; path=/; expires=' + futureDate.toUTCString() + ';';\n}", "title": "" }, { "docid": "1c83b64c39f5a04f6b218f3e796da7a6", "score": "0.5933108", "text": "function stateSave() {\n var date = new Date();\n date.setTime(date.getTime() + (CONST.cookies.days*24*60*60*1000));\n \n $.cookies.set(\n CONST.appName,\n {\n // key: value\n },\n { expiresAt: date }\n );\n}", "title": "" }, { "docid": "a1b94de2925f1c7d7b50468148518576", "score": "0.59225494", "text": "function getUserID (){\r\n email =document.getElementById('email').value\r\n localStorage.setItem(\"Email\",email);\r\n}", "title": "" }, { "docid": "48414ce97331ef245d2a0fbfd0969567", "score": "0.59119153", "text": "setCookies() {\n this._reset();\n const _cookies = {\n user : this.ptt.user,\n current_timer : this.ptt.current_timer,\n site : {\n url: this.ptt.site.url,\n name: this.ptt.site.name,\n home: this.ptt.site.home,\n description: this.ptt.site.description,\n },\n creds : this.ptt.creds,\n };\n Cookies.set( '_ptt', _cookies );\n }", "title": "" }, { "docid": "0b1d1560eb77de89d6ba5067c1c419d4", "score": "0.5898406", "text": "function writeRememberMeCookie(vm) {\n //debugger\n var now = new Date();\n var expiry = new Date();\n expiry.setMonth(expiry.getMonth() + 1); \n \n //alert(vm.username + ' , ' + vm.encryptedPassword + ' , ' + now + ' , ' + expiry);\n \n document.cookie = \"cookie creation date time=\" + now + \";\";\n document.cookie = \"username=\" + vm.username + \";\";\n document.cookie = \"password=\" + vm.encryptedPassword + \";\";\n document.cookie = \"expires=\" + expiry.toUTCString() + \";\"; \n }", "title": "" }, { "docid": "122339f5b21f68514828f7e8f11684f4", "score": "0.58983445", "text": "function savecookie()\n{\n delete_cookie('konkollist');\n var date = new Date();\n //keeps for a year\n date.setTime(date.getTime() + Number(365) * 3600 * 1000);\n document.cookie = 'hecox' + \"=\" + escape(shoppinglist.join(',')) + \"; path=/;expires = \" + date.toGMTString();\n}", "title": "" }, { "docid": "fc8a7cc3bd5bc4f0453763e5372a2c5e", "score": "0.58983", "text": "function SaveUserPassword(username, password, expiredays)\r\n{\r\n\tvar exdate=new Date();\r\n\texdate.setDate(exdate.getDate() + expiredays);\r\n\tvar expiryStr = ((expiredays==null) ? \"\" : \"; expires=\"+exdate.toUTCString());\r\n\t\r\n\tdocument.cookie = \"UserName=\" + username + expiryStr;\r\n\tdocument.cookie = \"Password=\" + password + expiryStr;\r\n\tdocument.cookie = \"LoginExpires=\" + exdate.getTime() + expiryStr;\r\n\t\r\n} //SaveUserPassword()", "title": "" }, { "docid": "47ad098f48c6e8004a5f018bf445aa00", "score": "0.58975", "text": "function saveData(name, form) {\r\n\tvar data = form2ArrayString(form);\r\n\tvar expDate = getExpDate(180, 0, 0);\r\n\tsetCookie(name, data, expDate);\r\n\t}", "title": "" }, { "docid": "ae43144ac7f1fc630ec82b853cb0e2a1", "score": "0.5889887", "text": "function setCookie(c_name, value, exdays) {\n var exdate = new Date();\n exdate.setDate(exdate.getDate() + exdays);\n var c_value = escape(value) + ((exdays == null) ? \"\" : \"; expires=\" + exdate.toUTCString());\n var cookie = c_name + \"=\" + c_value;\n localStorage.setItem(c_name, cookie);\n }", "title": "" }, { "docid": "c978b11acba003642c5b6f0f24ffd7b8", "score": "0.5881509", "text": "function saveCookie(name, value) {\n // var path = '/'; // Default to same domain and folder.\n \n var expires = new Date();\n // Days, Hours, Minutes, Seconds, Milliseconds. Default is 30 days.\n expires.setTime(expires.getTime() + (30 * 24 * 60 * 60 * 1000));\n \n document.cookie = name + '=' + value + ';' + \n //'path' + '=' + path + ';' + \n 'expires' + '=' + expires.toUTCString() + ';';\n}", "title": "" }, { "docid": "ff1c099d8b3c8e06b79d3bae0b5edd29", "score": "0.5879373", "text": "function writeCustomerCookie(form){\r\n\tSetCookie(\"customerName\", document.forms[0].firstName.value + \"&nbsp;\" + document.forms[0].lastName.value + \"<br/>\");\r\n\tSetCookie(\"customerAddress\", document.forms[0].customerAddress.value + \"<br/>\");\r\n\tSetCookie(\"customerCity\", document.forms[0].customerCity.value + \"&comma;&nbsp;\" + document.forms[0].customerState.value + \"&nbsp;\" + document.forms[0].customerZip.value + \"<br/>\");\r\n\tSetCookie(\"customerPhone\", document.forms[0].customerPhone.value + \"<br/>\");\r\n\tSetCookie(\"customerEmail\", document.forms[0].customerEmail.value);\r\n\r\n\r\n\r\n\treturn true;\r\n}", "title": "" }, { "docid": "73b90ffca7ddfbf0ba44b3c17ca24046", "score": "0.58589387", "text": "function saveCookie(auth)\n{\n\tvar minutes = 20;\n\tvar date = new Date();\n\tdate.setTime(date.getTime()+(minutes*60*1000));\t\n\tdocument.cookie = \"auth=\" + auth + \";expires=\" + date.toGMTString();\n}", "title": "" }, { "docid": "8da9b1f40d6af44f3fb309a4aeca9775", "score": "0.58556664", "text": "function setCookie(cname, cvalue, exdays) {\r\n //create new date variable with specific format for cookies\r\n let d = new Date();\r\n d.setTime(d.getTime() + (exdays*24*60*60*1000));\r\n //\r\n let expires = \"expires=\"+ d.toUTCString();\r\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";SameSite=None;Secure;path=/\";\r\n}", "title": "" }, { "docid": "7f85a59469a24e1468cb04de235f61fe", "score": "0.5854032", "text": "function store(name, value) {\r\n\tdocument.cookie = name + '=' + value + '; max-age=' + (60 * 60 * 24 * 365);\r\n}", "title": "" }, { "docid": "6cdcb52be5fdb05f0dfe49b91df67f6c", "score": "0.58537704", "text": "function savecookie()\n{\n delete_cookie('konkollist'); //replace konkol with YOUR last name\n var date = new Date();\n //keeps for a year\n date.setTime(date.getTime() + Number(365) * 3600 * 1000);\n //replace konkol with YOUR last name\n document.cookie = 'Hecoxlist' + \"=\" + escape(shoppinglist.join(',')) + \"; path=/;expires = \" + date.toGMTString();\n}", "title": "" }, { "docid": "36a624403946d0e028bd05000760bf5d", "score": "0.58530736", "text": "function setCookie(exdays, key, value) {\n var userid = key + \"=\" + value;\n var d = new Date();\n d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));\n var expires = \"; expires=\" + d.toUTCString();\n var path = \"; path=/\";\n document.cookie = userid + expires + path\n}", "title": "" }, { "docid": "b5015b722c9084179d456554b07dea34", "score": "0.58518636", "text": "function saveCookie(name,value,days) {\n \t if (days) {\n\t\t var date = new Date();\n\t\t date.setTime(date.getTime()+(days*24*60*60*1000))\n\t\t var expires = \"; expires=\"+date.toGMTString()\n\t }\n\t else expires = \"\"\n\t document.cookie = name+\"=\"+value+expires+\"; path=/\"\n }", "title": "" }, { "docid": "cabcd83efe3cac773eef898eeeb77ccf", "score": "0.58357793", "text": "function setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays*24*60*60*1000));\n var expires = \"expires=\" + d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \"; \" + expires;\n}//end setCookie()", "title": "" }, { "docid": "27694876db712d279da9a980f9360dd0", "score": "0.5821079", "text": "function cookieSet(temp_cookie){\n cookie = temp_cookie;\n }", "title": "" }, { "docid": "60707347df3ba6e6e55d8e4614a0846f", "score": "0.5816205", "text": "saveEmailSettings (){\n let emailSave = document.getElementById(\"localSaveEmail\");\n if(emailSave.checked){\n localStorage.setItem(\"emailSave\", \"true\");\n return true;\n } else if (!emailSave.checked) {\n localStorage.setItem(\"emailSave\", \"false\");\n return false;\n }\n }", "title": "" }, { "docid": "b4f0460d45864e45973f7832c3017659", "score": "0.5805785", "text": "function store(thing) {\n var jsoncookie = JSON.stringify(thing);\n document.cookie = \"thewholeplay=\" + jsoncookie +\"; expires=Thu, 18 Dec 2016 12:00:00 UTC\";\n // console.log(\"FUCK\" + jsoncookie);\n}", "title": "" }, { "docid": "81814dd1bafda2c505bd9794f0bc73b0", "score": "0.57998484", "text": "function saveNtuChoice() {\n var inputs = $('input.ntuposition');\n var nbElems = inputs.length;\n var arr = []\n $('input.ntuposition').each(function (idx) {\n console.log($(this).val());\n arr.push($(this).val());\n });\n\n //delete existing cookie\n var choice = getCookie(\"ntuchoice\");\n if (choice != \"\") {\n delete_cookie(\"ntuchoice\");\n }\n //set new cookie\n var obj = { \"1\": arr[0], \"2\": arr[1], \"3\": arr[2], \"4\": arr[3], \"5\": arr[4] }\n choice = JSON.stringify(obj)\n\n setCookie(\"ntuchoice\", choice, 1);\n arr = [];\n\n }", "title": "" }, { "docid": "918ce0e6c675fe7b7e62cce32a32677f", "score": "0.5794462", "text": "function saveSession() {\n let tabmail = document.getElementById('tabmail');\n let tabsState = tabmail.persistTabs();\n if (tabsState)\n hometabSessionManager.unloadingWindow(tabsState);\n}", "title": "" }, { "docid": "380af79f0db5a834192d6ef5bc0d7e85", "score": "0.5794373", "text": "function crearCookie(){\n var tipusEsp = document.getElementById('tipusEsp').getElementsByTagName(\"input\");\n document.cookie = \"nom=\"+nom.value+\"; expires=Thu, 31 Dec 9999 23:59:59 GMT\";\n document.cookie = \"cognom=\"+cognom.value+\"; expires=Thu, 31 Dec 9999 23:59:59 GMT\";\n document.cookie = \"email=\"+email.value+\"; expires=Thu, 31 Dec 9999 23:59:59 GMT\";\n document.cookie = \"telefon=\"+telefon.value+\"; expires=Thu, 31 Dec 9999 23:59:59 GMT\";\n document.cookie = \"password=\"+password.value+\"; expires=Thu, 31 Dec 9999 23:59:59 GMT\";\n document.cookie = \"dataNaixement=\"+dataNaix.value+\"; expires=Thu, 31 Dec 9999 23:59:59 GMT\";\n document.cookie = \"adreca=\"+adreca.value+\"; expires=Thu, 31 Dec 9999 23:59:59 GMT\";\n document.cookie = \"poblacio=\"+poblacio.value+\"; expires=Thu, 31 Dec 9999 23:59:59 GMT\";\n document.cookie = \"pais=\"+pais.value+\"; expires=Thu, 31 Dec 9999 23:59:59 GMT\";\n document.cookie = \"codiPostal=\"+codiPostal.value+\"; expires=Thu, 31 Dec 9999 23:59:59 GMT\";\n for(var i = 0; i < tipusEsp.length; i++){\n if(tipusEsp[i].checked){\n document.cookie=\"Opcio\"+(i+1)+\"=\"+tipusEsp[i].value+\"; expires=Thu, 31 Dec 9999 23:59:59 GMT\";\n }\n }\n document.cookie = \"IBAN=\"+iban.value+\"; expires=Thu, 31 Dec 9999 23:59:59 GMT\";\n //mostrar botons de veurecookie i borrarcookie\n btnCookie.hidden = false;\n btnDeleteCookie.hidden = false;\n}", "title": "" }, { "docid": "a16747041ab008d77a71585545306bc7", "score": "0.5781666", "text": "function saveCookie()\n{\n\tvar minutes = 20;\n\tvar date = new Date();\n\tdate.setTime(date.getTime()+(minutes*60*1000));\n\tdocument.cookie = \"userId=\" + userId + \";expires=\" + date.toGMTString();\n}", "title": "" }, { "docid": "e19ba2395e007459e0442d9c6f474b32", "score": "0.5780289", "text": "function guardarProgreso() {\n document.cookie = score.innerHTML;\n }", "title": "" }, { "docid": "8e9bdc43e5a3e0de545f804324e5d0ba", "score": "0.5773923", "text": "function setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));\n var expires = \"expires=\" + d.toGMTString();\n document.cookie = cname + \"=\" + cvalue + \"; \" + expires;\n}", "title": "" }, { "docid": "da717ded0be0d3eacff916fd6efd2a14", "score": "0.5772525", "text": "function setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));\n var expires = \"expires=\" + d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \";\" + expires;\n}", "title": "" }, { "docid": "59e2e83b31d7b64cfea95d8f8f16b3eb", "score": "0.5769112", "text": "function setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));\n var expires = \"expires=\" + d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \"; \" + expires;\n}", "title": "" }, { "docid": "a37b696a4a456632a2d8666068453994", "score": "0.5768534", "text": "function setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));\n var expires = \"expires=\" + d.toGMTString();\n document.cookie = cname + \"=\" + cvalue + \"; \" + expires;\n }", "title": "" }, { "docid": "369caf475c2b390ee5708b8fddd13506", "score": "0.5768172", "text": "function setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));\n var expires = \"expires=\"+d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n }", "title": "" }, { "docid": "4d910cd9d4efc66e2afa6841f462fa21", "score": "0.5767916", "text": "function setCookie(obj) {\r\n var d = new Date();\r\n d.setTime(d.getTime() + (365 * 24 * 60 * 60 * 1000));\r\n var expires = \"expires=\" + d.toUTCString();\r\n var val = JSON.stringify(obj);\r\n document.cookie = \"key=\" + val + \";\" + expires + \";path=/\";\r\n}", "title": "" }, { "docid": "2751c5f97396e769232d5e00f9c85522", "score": "0.5754409", "text": "function setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays*24*60*60*1000));\n var expires = \"expires=\"+ d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \"; \" + expires;\n}", "title": "" }, { "docid": "b976ac5b469941187e11f3c1d3be8729", "score": "0.57525426", "text": "function setCookie(cname,cvalue,exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays*24*60*60*1000));\n var expires = \"expires=\" + d.toGMTString();\n document.cookie = cname+\"=\"+cvalue+\"; \"+expires;\n }", "title": "" }, { "docid": "0b2c4d5786179c2a6e19fe9cc87159c5", "score": "0.5748805", "text": "function setCookie(cname, cvalue, exdays) {\r\n var d = new Date();\r\n d.setTime(d.getTime() + (exdays*24*60*60*1000));\r\n var expires = \"expires=\"+d.toUTCString();\r\n document.cookie = cname + \"=\" + cvalue + \"; \" + expires;\r\n}", "title": "" }, { "docid": "1abd8049419198328ff4a9529c8c6464", "score": "0.5747839", "text": "function setCookie(cname, cvalue, exdays) {\n if (exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));\n var expires = \"expires=\" + d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n } else document.cookie = cname + \"=\" + cvalue + \";path=/\";\n}", "title": "" }, { "docid": "676397b71e14709363b98f941b331e98", "score": "0.5747383", "text": "function setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));\n var expires = \"expires=\"+d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n }", "title": "" }, { "docid": "676397b71e14709363b98f941b331e98", "score": "0.5747383", "text": "function setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));\n var expires = \"expires=\"+d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n }", "title": "" }, { "docid": "d7470533ae0a9a89a95988fc7a14116f", "score": "0.57470995", "text": "function setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays*24*60*60*1000));\n var expires = \"expires=\"+d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \"; \" + expires;\n}", "title": "" }, { "docid": "d7470533ae0a9a89a95988fc7a14116f", "score": "0.57470995", "text": "function setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays*24*60*60*1000));\n var expires = \"expires=\"+d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \"; \" + expires;\n}", "title": "" }, { "docid": "e5c9ba0ede4fc3387f479ea1be45eb07", "score": "0.57412255", "text": "function setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));\n var expires = \"expires=\" + d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n }", "title": "" }, { "docid": "1a01c3638c997234602e012e6aac018f", "score": "0.573818", "text": "function saveSettings() {\n\tlocalStorage.setItem('email', emailSetting);\n\tlocalStorage.setItem('publicpro', publicSetting);\n\tlocalStorage.setItem('tzone', timeZoneSetting);\n}", "title": "" }, { "docid": "29b931d4ff9e349834cb845026a0a9dc", "score": "0.57376266", "text": "function setCookie(cname,cvalue,exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays*24*60*60*1000));\n var expires = \"expires=\" + d.toGMTString();\n document.cookie = cname+\"=\"+cvalue+\"; \"+expires;\n}", "title": "" }, { "docid": "d48f6020a1a4583d96b4b2a60a467883", "score": "0.57357633", "text": "function setCookie(cname, cvalue, exdays) {\r\n var d = new Date();\r\n d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));\r\n var expires = \"expires=\" + d.toUTCString();\r\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\r\n}", "title": "" }, { "docid": "afb7d49745be0e95960f5980c816143c", "score": "0.57345974", "text": "function SetCookies(cname, cvalue) {\n var date = new Date(); //get the date library to store the cookies for longer time.\n date.setTime(date.getTime() + 365 * 24 * 60 * 60 * 100); //this will set the cookie time how long it will be saved in the browser.\n let exp = \"Expires\" + date.toUTCString(); //converting the time into utc and adding the expire time with it.\n document.cookie = cname + \"=\" + cvalue + \";\" + exp; // here it will store the cookie into browsers.\n}", "title": "" }, { "docid": "c4352cfb33b1f6446aa9385ae0782707", "score": "0.57339275", "text": "function setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays*24*60*60*1000));\n var expires = \"expires=\"+d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n }", "title": "" }, { "docid": "4d57196a7005dde2637d0afd45586c2c", "score": "0.5732296", "text": "function cookieDelete() {\n\t// set cookie expirery to value before now #Josh\n\tdocument.cookie = \"login_uemail=\" + \"0\" + \";domain=ct4009-17bn.studentsites.glos.ac.uk;path=/;expires=Thu, 01 Jan 1970 00:00:00 UTC;\";\n\tdocument.cookie = \"login_uremember=\" + false + \";domain=ct4009-17bn.studentsites.glos.ac.uk;path=/;expires=Thu, 01 Jan 1970 00:00:00 UTC;\";\n\tdocument.cookie = \"login_uuid=\" + \"0\" + \";domain=ct4009-17bn.studentsites.glos.ac.uk;path=/;expires=Thu, 01 Jan 1970 00:00:00 UTC;\";\n\t\n\t// set cookie expirery to value before now #Aaron\n\tdocument.cookie = \"login_uemail=\" + \"0\" + \";domain=ct4009-17cc.studentsites.glos.ac.uk;path=/;expires=Thu, 01 Jan 1970 00:00:00 UTC;\";\n\tdocument.cookie = \"login_uremember=\" + false + \";domain=ct4009-17cc.studentsites.glos.ac.uk;path=/;expires=Thu, 01 Jan 1970 00:00:00 UTC;\";\n\tdocument.cookie = \"login_uuid=\" + \"0\" + \";domain=ct4009-17cc.studentsites.glos.ac.uk;path=/;expires=Thu, 01 Jan 1970 00:00:00 UTC;\";\n\t\n\t// set cookie expirery to value before now #Oliver\n\tdocument.cookie = \"login_uemail=\" + \"0\" + \";domain=ct4009-17cr.studentsites.glos.ac.uk;path=/;expires=Thu, 01 Jan 1970 00:00:00 UTC;\";\n\tdocument.cookie = \"login_uremember=\" + false + \";domain=ct4009-17cr.studentsites.glos.ac.uk;path=/;expires=Thu, 01 Jan 1970 00:00:00 UTC;\";\n\tdocument.cookie = \"login_uuid=\" + \"0\" + \";domain=ct4009-17cr.studentsites.glos.ac.uk;path=/;expires=Thu, 01 Jan 1970 00:00:00 UTC;\";\n}", "title": "" }, { "docid": "0381ac76955952a56616dec551fad02c", "score": "0.57294816", "text": "function setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));\n var expires = \"expires=\"+d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n}", "title": "" }, { "docid": "49dd8a701f4e35db49e39108964a3df5", "score": "0.5729437", "text": "function setCookie(cname, cvalue, exdays) {\r\n var d = new Date();\r\n d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));\r\n var expires = \"expires=\" + d.toGMTString();\r\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\r\n }", "title": "" }, { "docid": "1e0d4b0248ac130605c47c21c80e09a2", "score": "0.57286686", "text": "function setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));\n var expires = \"expires=\" + d.toGMTString();\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n }", "title": "" }, { "docid": "0713307c03520f9e9c7382717c3b1c49", "score": "0.57270193", "text": "function setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));\n var expires = \"expires=\" + d.toGMTString();\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n}", "title": "" }, { "docid": "4b2e5ced50db5817dc2d8426d3ba69a9", "score": "0.5726437", "text": "function setCookie(cname, cvalue, exdays) {\n\t var d = new Date();\n\t d.setTime(d.getTime() + (exdays*24*60*60*1000));\n\t var expires = \"expires=\"+d.toUTCString();\n\t document.cookie = cname + \"=\" + cvalue + \"; \" + expires;\n\t}", "title": "" }, { "docid": "9af94bc6393627b297e91147ea333101", "score": "0.5726241", "text": "function setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));\n var expires = \"expires=\" + d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n}", "title": "" }, { "docid": "9af94bc6393627b297e91147ea333101", "score": "0.5726241", "text": "function setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));\n var expires = \"expires=\" + d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n}", "title": "" }, { "docid": "9af94bc6393627b297e91147ea333101", "score": "0.5726241", "text": "function setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));\n var expires = \"expires=\" + d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n}", "title": "" }, { "docid": "9af94bc6393627b297e91147ea333101", "score": "0.5726241", "text": "function setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));\n var expires = \"expires=\" + d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n}", "title": "" }, { "docid": "9af94bc6393627b297e91147ea333101", "score": "0.5726241", "text": "function setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));\n var expires = \"expires=\" + d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n}", "title": "" }, { "docid": "aec75a43a182dfe39eff056c2fbe48e4", "score": "0.57253337", "text": "function storeCookie(key, value){\r\n $cookies.put(key, value);\r\n }", "title": "" } ]
0e6d3f585a36a17181072b4b10650906
end of the StartGame Function
[ { "docid": "026805d1d5898829fe1948ddd35dad49", "score": "0.0", "text": "function NextQuestions () {\n\t\tCurrentQuestion = Math.floor(Math.random()*RemainingQuestionsArray.length);\n\t\tconsole.log(QuestionsArray[CurrentQuestion].Question);\n\t\tshuffle(QuestionsArray[CurrentQuestion].Answers.PossibleAnswer);\n\t\tconsole.log(QuestionsArray[CurrentQuestion].Answers.PossibleAnswer);\n\t\t\n\t\tQuestionDiv();\n\n\n\n\t\tRemainingQuestionsArray = RemainingQuestionsArray.splice(CurrentQuestion,1); // remove one entry from the array to avoid duplicates\n\t\tconsole.log(RemainingQuestionsArray);\n\n\n}", "title": "" } ]
[ { "docid": "5584661b3748eb9a31e0d8d3764a8755", "score": "0.80638015", "text": "function startGame() {}", "title": "" }, { "docid": "5584661b3748eb9a31e0d8d3764a8755", "score": "0.80638015", "text": "function startGame() {}", "title": "" }, { "docid": "8503bcffcb51949aa79e7f2f3abe62c2", "score": "0.7951263", "text": "function StartGame () {}", "title": "" }, { "docid": "8c0da8dedd050100590fe06788588f74", "score": "0.7744921", "text": "function startGame() {\n \n}", "title": "" }, { "docid": "8cf0bd66df0db39431ba149286502700", "score": "0.7698145", "text": "startGame(){\n\n\n\n}", "title": "" }, { "docid": "dc35134d5bd5b0979dc1d5d852ef7692", "score": "0.7667227", "text": "startGame(game) {\n startGame(game);\n }", "title": "" }, { "docid": "3bc4dfdb244eb7cc000020515ba0b9a9", "score": "0.7636337", "text": "function startGame() {\n kill();\n game.init();\n sequence();\n }", "title": "" }, { "docid": "d0e9ce87de3beca896ae81fab42cb4ed", "score": "0.76315475", "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": "75203907374c154b13892f43fba20627", "score": "0.76293993", "text": "function prepareEndGame () {\n gameShouldEnd = true\n }", "title": "" }, { "docid": "574f0e1568815b8921a8b07e05c59558", "score": "0.75973785", "text": "function startGame()\n{\n mainGame();\n}", "title": "" }, { "docid": "f1dd06a31799b98615dc332e3d1ef931", "score": "0.75953543", "text": "function startGame(){\n \n}", "title": "" }, { "docid": "e7e15958fe51360957217263ba86c511", "score": "0.75847095", "text": "function newGameStart() {\n resetGame();\n generateImgPath();\n wordSelectorArray();\n updateData();\n}", "title": "" }, { "docid": "6c59c4a532a3608d3a84820b8954c61b", "score": "0.7513321", "text": "handleGameStarted() {}", "title": "" }, { "docid": "8856f0450fbb4e511d8eefd8691165a8", "score": "0.7502291", "text": "startGame(){\n this.clearGame();\n }", "title": "" }, { "docid": "5e1d554f2ceddf6e641f0cef2e51ea06", "score": "0.7496919", "text": "function runGame() {\n\tcheckClear();\n\tspawn();\n\texisting();\n}", "title": "" }, { "docid": "13a3bc2c12ffe969dcb445f7dfc9dc96", "score": "0.74684316", "text": "function playGame() {\n // When the game starts there are 3 gems and 1 heart and the player\n // finds himself in world 1\n remainingGems = 3;\n remainingHearts = 1;\n world = 1;\n // Set the active flag variable to true to start the game\n active = true;\n // Set the flag variable that for collision with enemies\n // to false\n crashed = false;\n // Set the lastTime variable that is required for the game loop\n lastTime = Date.now();\n // Call the game loop function\n main();\n }", "title": "" }, { "docid": "18f4f3e134b115c48c4451564dcc300d", "score": "0.7448512", "text": "runGame() {\n\n }", "title": "" }, { "docid": "35da9065ee584f08895a5488df7d1814", "score": "0.7380367", "text": "function startGame() {\n score = 0; level = 0; lives = 0;\n nextLevel();\n }", "title": "" }, { "docid": "5195cff374c5b467769b5c75459d525c", "score": "0.73550254", "text": "function gameStart(){\n\t//randomizes background music\n\trdmBgM = rdmArrEl(bgM);\n\t//randomizes background image\n\tlet backImg = rdmArrEl(background);\n\t//hides title page\n\thidePage(titlePage);\n\t//shows game page\n\tshowPage(gamePage);\n\tgamePage.style['transition-delay'] = '2s';\n\t//sets background image\n\tgamePage.style.background = `url(${backImg}) no-repeat center center fixed`;\n\t//performs function for placing, showing, and hiding characters with 5sec delay\n\tsetTimeout(placeCharacters, 5000);\n\t//pauses title page music\n\trdmIntroM.pause();\n\t//checks if title page music is new music after reset. If so, it pauses it.\n\tif(rdmBacktitleM){\n\t\trdmBacktitleM.pause();\n\t\trdmBacktitleM.currentTime = 0;\n\t}\n\telse if(mwin){\n\t\tmwin.pause();\n\t\tmwin.currentTime = 0;\n\t}\n\trdmIntroM.currentTime = 0;\n\trdmBgM.play();\n\trdmBgM.loop = true;\n\tif(humans.length === 17){\n\t\tsetTimeout(timer, 10000);\n\t}\n\ttimergap = 4000;\n\tstop = false;\n}", "title": "" }, { "docid": "bcd2d18bf603de5e5d4068bf170d866e", "score": "0.7335168", "text": "function playGame() {}", "title": "" }, { "docid": "e8457c82fda6bf47869f0e53d021a163", "score": "0.7330999", "text": "function startGame() {\n setLevelRound();\n showFlashcards();\n}", "title": "" }, { "docid": "467c328259a7c2a23263db47912c4477", "score": "0.731716", "text": "function startGame() {\n var screen = new GameScreen(\"Kill The Clowns\",\"Hit enter to begin challenge\",\n function() {\n Game.loadBoard(new GameBoard(1));\n });\n Game.loadBoard(screen);\n Game.loop();\n }", "title": "" }, { "docid": "ca8bf5e2fc41b7130a10dbf975a88e65", "score": "0.73103523", "text": "function startGame() {\n numMatch = 0;\n moves = 0;\n showEasy();\n welcomeMessage();\n resetTimer();\n changeDifficulty();\n showRules();\n showSound();\n}", "title": "" }, { "docid": "99418a3e122ed71663ce1ef2b648fc57", "score": "0.7294738", "text": "function start() {\n startGame(event);\n}", "title": "" }, { "docid": "b4c8a40b6fbe87f6cc20df6f231ae49d", "score": "0.7293937", "text": "function startNewGame(){\n\tbackToGame();\n\tstartGame();\n}", "title": "" }, { "docid": "5831f336bbbdb20d307c1b89af30aced", "score": "0.7288474", "text": "function gameStart() {\n\n if (gameStartCheck === 0) {\n disableAllButtons();\n removeGameHolderAudio();\n removeGameHolder();\n game1.zeroState();\n installGamePackage()\n }\n}", "title": "" }, { "docid": "b3d117e57032d6d4164b42b1f42f2b3d", "score": "0.7272216", "text": "function endGame(){\n\n }", "title": "" }, { "docid": "7f2b820e031ab065bc800011b9196563", "score": "0.7267102", "text": "function startGame(){\n myGameArea.clear();\n myPlayer.clear();\n myGameArea.start();\n myObstacles = [];\n animation();\n}", "title": "" }, { "docid": "4b2f806bdfa3c033a9756d627abd7fc2", "score": "0.7265821", "text": "function gameStart() {\n\tvar initialText = \"Welcome to Classes & Teachers! Make sure to type in your inputs accurately!\" + \"\\n\" + \n\t\t\t\t\t\t\"The goal of the game is to find the exit (without dying!)\" + \"\\n\" +\n\t\t\t\t\t\t\"To begin, type in your name!\";\n\tconsole.log(initialText);\n\twindow.playerName = prompt(\"Enter name here!\");\n\twindow.currentPlayerRow = 0;\n\twindow.currentPlayerCol = 0;\n\tmap[currentPlayerRow][currentPlayerCol] = \"X\";\n\twindow.gameStarted = true;\n\twindow.playerStatus = {\n\t\tboredom: 0,\n\t\tlaziness: 0,\n\t\thealth: 5,\n\t\tfright: 0\n\t};\n\tplayerStatus[\"boredom\"] = 0;\n\tplayerStatus[\"laziness\"] = 0;\n\tplayerStatus[\"health\"] = 5;\n\tplayerStatus[\"fright\"] = 0;\n\twindow.endRow = Math.floor((Math.random() * (map.length - 1)) + 1);\n\twindow.endCol = Math.floor((Math.random() * (map.length - 1)) + 1);\n\tbuildMap();\n}", "title": "" }, { "docid": "4ade3d321e01a6f27230f76d0c111ff0", "score": "0.7262365", "text": "function startGame() {\n if (!inProgress) {\n endGame();\n }\n}", "title": "" }, { "docid": "4ae9dd26b0fe153667b83216bdf71204", "score": "0.7257262", "text": "function startGame () {\n showScreen('game')\n sound.game()\n nextTurn()\n}", "title": "" }, { "docid": "01142c47019cba8d7b467db4f73a5b48", "score": "0.7256974", "text": "function game_startGame() {\n game_startHand(true);\n}", "title": "" }, { "docid": "0320e7b0eeb70c81d3a4099c84f6d22b", "score": "0.7256606", "text": "function endGame() {\n isGameOver = true;\n //initWorld();\n}", "title": "" }, { "docid": "c4a468be047eb7f7963edbd661b101bb", "score": "0.7249566", "text": "function startGame() {\n theme.play();\n shuffleQuestions();\n displayQuestion();\n }", "title": "" }, { "docid": "9c65c3c0ddc4426f349b8f6e6a4643df", "score": "0.7211856", "text": "function start()\r\n {\r\n\t\t//Initialize player data\r\n\t\tplayer.x = width / 2;\r\n\t\tplayer.y = height / 2;\r\n\t\t\r\n\t\t//Initialize game data\r\n\t\tiCloudsTransition = 0;\r\n\t\tiScore = 0;\r\n\t\tiCoins = 0;\r\n\t\tiLifes = 2;\r\n\t\tiGameSpeed = 0;\r\n\t\tiLifeLostBlinkAnimIterations = 3;\r\n\t\tiLastHitObstacle = -1;\r\n\t\tbEndGame = false;\r\n\t\tbLifeLostAnimation = false;\r\n\t\t\r\n\t\t//Check if cookies exist otherwise create them\r\n\t\tCreateCookies();\r\n\t\t\r\n\t\t//Set the height and width for the all canvas\r\n\t\tcanvasEnd.width = width;\r\n\t\tcanvasEnd.height = height;\r\n\t\r\n\t\tcanvasGameplay.width = width;\r\n\t\tcanvasGameplay.height = height;\r\n \r\n canvasPause.width = width;\r\n\t\tcanvasPause.height = height;\r\n \r\n canvasMenu.width = width;\r\n\t\tcanvasMenu.height = height;\r\n\t\t\r\n //assign the image to the objects\r\n imgObsatcle.src = 'Obstacle.png';\r\n\t\timgCoins.src = 'coins.png';\r\n\t\timgHeartIcon.src = 'heart.png';\r\n\t\timgCoinIcon.src = 'coin.png';\r\n\t\timgBirdIcon.src = 'birdIcon.png';\r\n imgPlayer.src = 'bird.png';\r\n\t\timgGameTitle.src = 'game_title.png';\r\n \r\n //assign the image to the menu screen buttons\r\n imgButtonMenuPlay.src = 'ScreenMenuButtons//button_play.png';\r\n imgButtonMenuInstructions.src = 'ScreenMenuButtons//button_instructions.png';\r\n imgButtonMenuScore.src = 'ScreenMenuButtons//button_high-score.png';\r\n\t\timgButtonMenuBack.src = 'ScreenMenuButtons//button_back.png';\r\n\t\tscreenMenu();\r\n\t\t\r\n\t\t//Assign the image to the level screen buttons\r\n\t\timgButtonLevelPause.src = 'ScreenLevelButtons//button_pause.png';\r\n\t\t\r\n\t\t//assign the image to the pause screen buttons\r\n imgButtonPausePlay.src = 'ScreenPauseButtons//button_start-again.png';\r\n imgButtonPauseMenu.src = 'ScreenPauseButtons//button_go-to-menu.png';\r\n imgButtonPauseResume.src = 'ScreenPauseButtons//button_resume.png';\r\n\t\tscreenPause();\r\n\t\t\r\n\t\t//assign the image to the end screen buttons\r\n imgButtonEndPlay.src = 'ScreenEndButtons//button_play-again.png';\r\n imgButtonEndMenu.src = 'ScreenEndButtons//button_go-to-menu.png';\r\n\t\tscreenEnd();\r\n\t\t\r\n\t\t//background moving animation images\r\n\t\timgBkClouds.src = 'Background.png';\r\n\t\timgBkClouds2.src = 'Background2.png';\r\n\t\timgBkClouds3.src = 'Background.png';\r\n\t\t\r\n\t\t//Instructions scene image\r\n\t\timgInstructions.src = 'Instructions.png';\r\n\t\t\r\n\t\t//Initialize sounds objects\r\n\t\tpSoundFlapBird = new sound(\"Sounds//BirdFlapSound.mp3\");\r\n\t\tpSoundMenu = new sound(\"Sounds//menu_music.mp3\");\r\n\t\tpSoundLevel = new sound(\"Sounds//level_music.mp3\");\r\n\t\tpSoundEnd = new sound(\"Sounds//end_music.mp3\");\r\n\t\tpSoundClick = new sound(\"Sounds//click_sound.mp3\");\r\n\t\tpSoundCoin = new sound(\"Sounds//coin_sound.mp3\");\r\n\t\tpSoundCollision = new sound(\"Sounds//collision_sound.mp3\");\r\n\t\t\r\n\t\t\r\n\t\t//Set obstacles position dynamically\r\n for(var iCount = 0; iCount < 7; iCount++)\r\n {\r\n pObstacles[iCount].x= width + 100 + (iCount*400);\r\n pObstacles[iCount].y= Math.floor((Math.random() * (height - 300)) + 1);\r\n\t\t\t\r\n\t\t\tfObstaclesY[iCount] = pObstacles[iCount].y;\r\n\t\t\tiObstaclesDirection[iCount] = Math.floor((Math.random() * 100) + 1);\r\n\t\t\t\r\n\t\t\tif(Math.floor((Math.random() * 100) + 1)%2 == 0)\r\n\t\t\t{\r\n\t\t\t\tbObstaclesMoving[iCount] = true;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tbObstaclesMoving[iCount] = false;\r\n\t\t\t}\r\n }\r\n\t\t\r\n\t\t//Set coins position dynamically\r\n\t\tfor(var iCount = 0; iCount < pCoins.length; iCount++)\r\n {\r\n pCoins[iCount].x= width + 100 + (iCount*40);\r\n pCoins[iCount].y= Math.floor((Math.random() * (height - 16)) + 1);\r\n }\r\n\t}", "title": "" }, { "docid": "da00218867c18e00746c2e008265d9a2", "score": "0.7206371", "text": "function startGame(){\n bonus = 0;\n demerits = 0;\n resetGame();\n }", "title": "" }, { "docid": "455df2a67f8deb6a1ffbf82957027c30", "score": "0.7204339", "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": "c1f3827df99818036bf760dfece05ff8", "score": "0.72014266", "text": "function startGame() {\n\n if (spritesloaded >= spriteAmt) {\n //there is game field now\n ECS.game = new ECS.Game();\n ECS.game.start();\n console.log('GAME');\n console.log('\\t'+ECS.game);\n console.log('\\t',ECS.player.components.collidable);\n }\n }", "title": "" }, { "docid": "61a81ba03cdb3c504d94373a7beb4c0b", "score": "0.72010934", "text": "function startGame(){\n //Remove everthing from main screen\n remove(blueRect);\n remove(purpRect);\n stopTimer(changeColor);\n remove(title);\n remove(play);\n \n //Wall\n\tdrawWall();\n\n\t//Ball\n\tdrawBall();\n\tsetTimer(moveBall, 5);\n\n\t//Paddle\n\tdrawPaddle();\n\tmouseMoveMethod(movePad);\n}", "title": "" }, { "docid": "cfa05e593d63e83e3a9387c06efcd844", "score": "0.72008646", "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": "2287f8cb4214929eb98666e7e970ba11", "score": "0.7200112", "text": "function gameStart(){\n\tfor(var name in config.player2lightid){\n\t\tplayerLeft( name);\n\t}\n}", "title": "" }, { "docid": "afae4056befa0a92c432a80455c483b0", "score": "0.7195777", "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": "f2b06a9050b6c8a02df25787b0f984bf", "score": "0.7191677", "text": "function startGame(user_id, map_status, map_data) {\n // map_status: 0 if the map needs to be regenerated\n // 1 if the map is loaded from server's database\n // map_data: if map_status is 1, map_data contains data for stored map\n // user_id: id for logged-in user in the database\n\n if (myGameArea.pause == true) {\n var val= mylife.val;\n }else {\n var val = 3;\n }\n myGameArea.start();\n input = new p5.AudioIn();\n input.start();\n\n\n\n mylife = new life(\"red\", canvas_width - 150, 30, val);\n myscore = new score(\"black\", canvas_width - 150, 60);\n\n candy_flag = false;\n candy_p = 0.5;\n\n offset = createMap(map_status, map_data, user_id);\n\n}", "title": "" }, { "docid": "d65171fc444276e900a35c885a959ef6", "score": "0.71902794", "text": "function startGame()\n{ \n update();\n createObjects();\n \n}", "title": "" }, { "docid": "7519878387cdc009b658bf4077c74dc3", "score": "0.71826816", "text": "function initializeGame() {\r\n\t\r\n\t// This code should be at the bottom of the initializeGame.\r\n\tpushPosition(currentPosition);\r\n}", "title": "" }, { "docid": "16b739f74fef429dc183cba2ac3c52c8", "score": "0.7181333", "text": "function gameStart(){\n startTimer();\n toggleEnemyGeneration(true);\n playMusic();\n paintAgent();\n isWaitingAnswer = false;\n $('body').css('cursor', 'none');\n}", "title": "" }, { "docid": "387b00675f18ee7cb001a87f32c91b13", "score": "0.716779", "text": "function startGame() {\n\n console.log(\"startGame\");\n //reset the gameOn and gameOver flags\n gameOn = true;\n gameOver = false;\n\n //reset the counters\n score = 0;\n frameCounter = 0;\n\n genMeteroid();\n\n bgMusic.loop = true;\n bgMusic.play();\n } // startGame()", "title": "" }, { "docid": "5e93530df691ca6db27e432f6240626b", "score": "0.71545017", "text": "function startGame() {\r\n isFirstClick = false;\r\n gGame.isOn = true;\r\n addMines();\r\n getTime();\r\n}", "title": "" }, { "docid": "e99896007066d7f036ba592f4546f8bb", "score": "0.7145105", "text": "function gameStart() {\n resizeCanvas();\n init();\n}", "title": "" }, { "docid": "78b4704ff705e942aeedac943d31f885", "score": "0.71391743", "text": "function startGame() {\n //Whats this?! A humble tron reference in the log\n console.log(\"We're on the grid\");\n console.log(\"Let the games begin\");\n\n //Reseting the score and question counter to 0\n questionCounter = 0;\n score = 0;\n\n //Loading the questions\n loadQuestion();\n}", "title": "" }, { "docid": "41128a5ce81e540da8e5a93ec24c7bf7", "score": "0.7136827", "text": "function startGame (){\n game = new Game(scene, map);\n game.init();\n}", "title": "" }, { "docid": "da1a4d042a347cedecefeefc3fb9b0c6", "score": "0.7134802", "text": "function gameStart() {\n fallingPiecesGo();\n startStopTimer();\n livesAtStart();\n pointsAtStart();\n loadPieces();\n gameImagesGood();\n gameImagesBad();\n }", "title": "" }, { "docid": "287e5e96dda296e4b687e2da02824cd5", "score": "0.7132991", "text": "function runGame() {\n console.log(\"runGame\");\n setup();\n gameLoop();\n}", "title": "" }, { "docid": "83f488deb399deaaca80fae860cd2919", "score": "0.71250504", "text": "function startGame() {\n if (!isGameOver)\n return;\n isGameOver = false;\n myRect = [];\n FillRectangleArray(); // Fill array with rectangles which act as a one step in game\n gameLoop(); // Looooooop which draws our rectangles all over again\n }", "title": "" }, { "docid": "0f3850f53846d8e27126a23af797925e", "score": "0.71175504", "text": "function startOver() {\n started = false;\n level = 0;\n gamePattern = [];\n\n}", "title": "" }, { "docid": "13c075e8aa1e71268184b11cdde6fe30", "score": "0.7113848", "text": "function handleStartGame() {\n createGrid()\n\n //*Start playing BGM with player first key press\n // bgm.play()\n\n //*Passing each ghost object into the ghostAggroMove() \n ghosts.forEach(ghost => ghostAggroMove(ghost))\n \n\n //* Passing each ghost object into the capturePlayer()\n ghosts.forEach(ghost => capturePlayer(ghost))\n\n \n\n }", "title": "" }, { "docid": "3f95982de40589d7c65390e710330839", "score": "0.7109591", "text": "function startGame (){\nsequence = [];\n newTurn();\n}", "title": "" }, { "docid": "6e70a0752161b201341ba9f5286b6af0", "score": "0.71076125", "text": "startGame() {\n this.setRanking()\n this.setTime()\n }", "title": "" }, { "docid": "4e1adf0e4231052f1210d2f382b4ad5e", "score": "0.7103433", "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": "53f8327837990f3fd891ca9785ff1e40", "score": "0.70935893", "text": "function startOver() {\n level = 0;\n gamePattern = [];\n gameStarted = false;\n}", "title": "" }, { "docid": "ac1e519ce49f321270e90043ae864103", "score": "0.70926785", "text": "function startGame() {\n gamePattern = [];\n expectedUserInputPosition = 0;\n userInputPattern = [];\n continueGame();\n}", "title": "" }, { "docid": "823f5a92919c1f68052da27cc07afc55", "score": "0.7092374", "text": "function gameStart () {\n\n\t\tturnOffDisplay();\n\t\tturnOffLights();\n\n\t\tclearTimeout(timeOutPlayerMove);\n\t\tclearTimeout(timeOutSequence);\n\t\tclearTimeout(timeOutGameStart);\n\n\t\tisGameStart\t\t\t= true;\n\t\tisPlayerTurn\t\t= false;\n\t\tgameOver\t\t\t= false;\n\t\tpositions\t\t\t= [];\n\t\tplayerPositions\t\t= [];\n\t\tmoveTime\t\t\t= 800;\n\t\tafterMoveTime\t\t= 150;\n\n\t\ttimeOutGameStart = setTimeout(function () { showSequence(Math.floor(Math.random() * 4)); }, 500);\n\t}", "title": "" }, { "docid": "eab0f9ea6c7fead81da5d28c02660e3a", "score": "0.709222", "text": "function startGame() {\n console.log('start yo!');\n myGameArea.start();\n swSong.play();\n }", "title": "" }, { "docid": "1155fda5d4efef88466f8cb7e4896e5b", "score": "0.7090252", "text": "function gameEnded() {\n destroyGameScreen();\n buildGameOverScreen();\n }", "title": "" }, { "docid": "7b50361613d3fdaa0b0e19bcef07f3df", "score": "0.7081403", "text": "function startGame() {\n $(\"body\").removeClass(\"game-over\");\n nextSequence(0);\n}", "title": "" }, { "docid": "8610c37f74ffd1d9132b8ed8a455be8c", "score": "0.70751846", "text": "start() {\n\n Game.mode_selection();\n Game.next_round();\n\n let end_game = false;\n do {\n\n //----------------------------------------------------------------------------------------------------------\n // Ditampilkan informasi-informasi berikut:\n // - Ronde keberapa\n // - Giliran siapa\n // - Formasi unit masing-masing pemain\n //----------------------------------------------------------------------------------------------------------\n\n console.log(`<====== Ronde ${Game.round} ======>`);\n console.log(`Giliran: ${Game.players[Game.turn].p_name}\\n`);\n\n //----------------------------------------------------------------------------------------------------------\n // Jika saat ini giliran player, tampilkan apa saja yang dapat ia lakukan\n //----------------------------------------------------------------------------------------------------------\n\n const player = Game.players[Game.turn];\n if(!player.hasOwnProperty('isAI')) {\n\n Game.show_battlefield();\n\n console.log(`<=== Action Menu ===>`);\n console.log(`Credit(s): ${player.credit}\\n`);\n console.log(`1. Beli unit`);\n console.log(`2. Beri unit perintah`);\n console.log(`3. Akhiri Giliran`);\n console.log(`4. Menyerah\\n`);\n\n const action = input_number(\"> \");\n\n switch(action) {\n\n //--------------------------------------------------------------------------------------------------\n // Case 1: Pemain membeli unit baru\n //--------------------------------------------------------------------------------------------------\n\n case 1:\n\n //----------------------------------------------------------------------------------------------\n // Pemain ditampilakn daftar unit yang tersedia di game ini\n //----------------------------------------------------------------------------------------------\n\n console.log(`<=== Buy Menu ===>\\n`);\n Game.show_unit_profiles();\n\n //----------------------------------------------------------------------------------------------\n // Pemain diminta memilih satu unit untuk dibeli\n //----------------------------------------------------------------------------------------------\n\n const select = input_number(`Pilih unit (Credit: ${player.credit}): `) -1;\n\n //----------------------------------------------------------------------------------------------\n // Jika pemain menginput yang aneh-aneh, tampilkan pesan error\n //----------------------------------------------------------------------------------------------\n\n if(select < 0 || select >= Game.units.length) {\n console.log(`Error: Input tidak dapat diterima!`);\n press_enter_to_continue();\n }\n\n //----------------------------------------------------------------------------------------------\n // Jika pemain tidak memiliki cukup credit, tampilkan pemberitahuan\n //----------------------------------------------------------------------------------------------\n\n else if(player.credit < Game.units[select].cost) {\n console.log(`Anda tidak memiliki cukup credit untuk membeli unit ini!`);\n press_enter_to_continue();\n }\n\n //----------------------------------------------------------------------------------------------\n // Jika syarat-syarat pembelian unit terpenuhi (credit cukup dan input tidak aneh-aneh),\n // lanjutkan proses pembelian unit\n //----------------------------------------------------------------------------------------------\n\n else {\n let new_unit;\n\n //------------------------------------------------------------------------------------------\n // Jika unit yang dibeli adalah Saboteur, kirim unit tersebut ke barisan lawan\n //------------------------------------------------------------------------------------------\n\n if(Game.units[select].hasOwnProperty('sabotage'))\n new_unit = new Game.units[select].constructor(player.enemy);\n\n\n //------------------------------------------------------------------------------------------\n // Jika unit lain, kirim unit tersebut ke barisan unit pemain\n //------------------------------------------------------------------------------------------\n\n else\n new_unit = new Game.units[select].constructor(player);\n\n //------------------------------------------------------------------------------------------\n // Proses pembelian unit...\n //------------------------------------------------------------------------------------------\n\n player.buy_unit(new_unit);\n\n if(new_unit.constructor === Saboteur) // Jika unit yang dibeli adalah Saboteur\n new_unit.sabotage(); // lakukan sabotase kastil lawan\n\n if(new_unit.constructor === Builder) // Jika unit yang dibeli adalah Dwarven Builder\n new_unit.repair(); // perbaiki kastil milik pemain\n\n press_enter_to_continue();\n }\n\n console.log();\n break;\n\n\n //--------------------------------------------------------------------------------------------------\n // Case 2: Pemain memerintahkan unitnya untuk menyerang lawan\n //--------------------------------------------------------------------------------------------------\n\n case 2:\n\n //----------------------------------------------------------------------------------------------\n // Untuk dapat memberi perintah, pemain harus memiliki unit yang sudah standby di medan\n // tempur dan belum pernah bergerak sama sekali di ronde tersebut\n //----------------------------------------------------------------------------------------------\n\n if(player.has_movable_unit()) {\n\n //------------------------------------------------------------------------------------------\n // Pemain ditanya ingin memerintahkan unit yang mana\n //------------------------------------------------------------------------------------------\n\n const moveable_units = player.get_movable_units();\n\n console.log(`<=== Command Menu ===>\\n`);\n let i=0;\n for(let unit of moveable_units) {\n console.log(`${i+1}. ${unit.status()}`);\n i++;\n }\n console.log();\n const select_unit = input_number(\"Pilih unit untuk dikomando: \") -1;\n\n //------------------------------------------------------------------------------------------\n // Jika pemain menginput yang aneh-aneh, proses akan keluar dan pemain akan dikembalikan\n // ke menu sebelumnya\n //------------------------------------------------------------------------------------------\n\n if(select_unit < 0 || select_unit >= moveable_units.length) {\n console.log(`Error: Input invalid!`);\n press_enter_to_continue();\n break;\n }\n\n //------------------------------------------------------------------------------------------\n // Pemain ditanya ingin menyerang apa\n //------------------------------------------------------------------------------------------\n\n const attackable_targets = player.enemy.get_attackable_units();\n\n console.log(`\\n<=== Formasi Unit Lawan ===>\\n`);\n i=0;\n for(let target of attackable_targets) {\n console.log(`${i+1}. ${target.status()}`);\n i++;\n }\n console.log();\n const select_target = input_number(\"Pilih target untuk diserang: \") -1;\n\n //------------------------------------------------------------------------------------------\n // Jika pemain menginput yang aneh-aneh, proses akan keluar dan pemain akan dikembalikan\n // ke menu sebelumnya\n //------------------------------------------------------------------------------------------\n\n if(select_target < 0 || select_target >= attackable_targets.length) {\n console.log(`Error: Input invalid!`);\n press_enter_to_continue();\n break;\n }\n\n //------------------------------------------------------------------------------------------\n // Input diterima, perintah diproses...\n //------------------------------------------------------------------------------------------\n\n const unit = moveable_units[select_unit];\n const target = attackable_targets[select_target];\n\n unit.attack(target);\n press_enter_to_continue();\n }\n\n //----------------------------------------------------------------------------------------------\n // Jika pemain tidak memiliki unit yang dapat ia beri perintah, tampilkan pesan\n //----------------------------------------------------------------------------------------------\n\n else {\n console.log(`Anda tidak memiliki unit yang dapat diberi perintah saat ini!`);\n press_enter_to_continue();\n }\n console.log();\n break;\n\n\n //--------------------------------------------------------------------------------------------------\n // Case 3: Pemain mengakhiri gilirannya\n //--------------------------------------------------------------------------------------------------\n\n case 3:\n console.log(`Mengakhiri giliran...\\n`);\n Game.end_turn();\n break;\n\n\n //--------------------------------------------------------------------------------------------------\n // Case 4: Pemain menyerah... GG!\n //--------------------------------------------------------------------------------------------------\n\n case 4:\n console.log(`${player.p_name} menyerah!`);\n player.formation[0].hp = 0;\n press_enter_to_continue();\n console.log();\n break;\n\n\n //--------------------------------------------------------------------------------------------------\n // Default: Untuk berjaga-jaga jika pemain menginput yang aneh-aneh\n //--------------------------------------------------------------------------------------------------\n\n default:\n console.log(`Error: Masukan yang benar!`);\n press_enter_to_continue();\n break;\n }\n }\n\n //----------------------------------------------------------------------------------------------------------\n // Jika saat ini adalah giliran AI...\n //----------------------------------------------------------------------------------------------------------\n\n else {\n Game.ai.start_turn();\n console.log();\n }\n\n\n //----------------------------------------------------------------------------------------------------------\n // Jika victory condition tercapai (salah satu kastil hancur), looping akan selesai. Jika tidak, looping\n // akan terus lanjut hingga ada satu kastil yang hancur\n //----------------------------------------------------------------------------------------------------------\n\n end_game = Game.victory_condition()\n\n }while(end_game);\n Game.victory_screen();\n }", "title": "" }, { "docid": "540aceedbb278b57f8f1461dbf5c406d", "score": "0.70671743", "text": "function startGame() {\n\n // game scene\n createGame();\n\n // game state\n changeState(2);\n}", "title": "" }, { "docid": "90bc32ba3769883a405b44a3e608b658", "score": "0.70670843", "text": "function startGame() {\ngameEnd = false;\nrunCount = 0;\nshuffleQuestions();\nresetScore();\nrenderQuiz();\nstartTimer();\n\n\n\n}", "title": "" }, { "docid": "22141272d2301cd88f7de0d86f6d8825", "score": "0.70640624", "text": "startGame() {\n this.hasMadeDoubleMove = false;\n this.moveCountInGame = 0;\n }", "title": "" }, { "docid": "e8f6afcb3c63868c9322072e4ca6d963", "score": "0.7062764", "text": "function start_game() {\r initialize_variables();\r sprites.onload = function() {\r draw_static_gameboard();\r delay = 100; //milliseconds\r game_loop();\r //setInterval(game_loop, delay);\r //game_loop();\r //render_numLives();\r //render_init_text();\r // draw_frog();\r // draw_car();\r // draw_log();\r };\r}", "title": "" }, { "docid": "f64168644d2813179be60411c2861aae", "score": "0.7060582", "text": "function continueGame() {\n //game active\n isGameReady = true;\n //increment new level\n currentLevel += 1;\n //reset objects\n resetObjects();\n //check missiles\n GameLogic.equipMissiles(currentLevel, missileList, browserWidth, browserHeight);\n //check ship health\n GameLogic.checkRebelShipHealth(rebelShip, currentLevel);\n //create enemies\n loadEnemies();\n //reset time var\n timePrevious = Date.now();\n}", "title": "" }, { "docid": "e9420efb95a05dc328c149d678c3d129", "score": "0.7055805", "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": "9f09833555fd31a761ad8c81d0e82794", "score": "0.70540106", "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": "a96784b6d62817246ae9cd6621cca5e3", "score": "0.7053046", "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": "fb736dd6c720ccb95b41e1c0cfc252fe", "score": "0.7046325", "text": "function startGame () {\n updateDisplay();\n startTimer();\n loadQuestion ();\n}", "title": "" }, { "docid": "4012c2f0ac82a3877ba835f5f84e55ab", "score": "0.70428586", "text": "function draw() {\n initGame()\n startGame()\n}", "title": "" }, { "docid": "213b71b96f27a320fc6dee214257dfc1", "score": "0.70416784", "text": "function init() {\n resetGame();\n lastTime = Date.now();\n main();\n }", "title": "" }, { "docid": "07e67fbcdeaec944cb5b53c3b16be25c", "score": "0.7039622", "text": "startNewGame(){\n this.bindMenuEvents();\n this.resetBoard();\n this.fadeInMenu();\n this.bindGamePlayEvents();\n }", "title": "" }, { "docid": "2b2cfb8c9c717fb5d27df8c83f0d9671", "score": "0.70319974", "text": "function joinGame(){\n\t\n}", "title": "" }, { "docid": "03c185743294d6d844b698fdafc0b4ed", "score": "0.7024348", "text": "function startGame() {\n gameState = 2;\n\n}", "title": "" }, { "docid": "1207ceb03ab8cf83af23e4219451918c", "score": "0.7022558", "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": "7245c4d9e78390f0befc8d5f21a2c5f2", "score": "0.70187926", "text": "function startGame() {\n resetCounter();\n generateMatchNumber();\n giveCatsRandomValues();\n}", "title": "" }, { "docid": "7ba887755863b915c7e1336e66a2f5ed", "score": "0.70085955", "text": "function onDone() {\n // Start your game here\n}", "title": "" }, { "docid": "96445fc9310593d72d9268b12b2dbb22", "score": "0.7008182", "text": "function gameLoop(){\n\n \n}", "title": "" }, { "docid": "e87a412d596b3c47224f8e0be0c3445a", "score": "0.700764", "text": "function StartGame(){\n\tstartPos\t\t\t= transform.position;\n}", "title": "" }, { "docid": "100f467aa0c4901ca256e61f15c8e461", "score": "0.70054543", "text": "function startGame() {\n\tconsole.log(gameState);\n\tvar startState = findState(\"1\");\n\tcurrentState = startState;\n\trenderState(startState);\n}", "title": "" }, { "docid": "ba2dd301eda99498db16b8cb4e3cca9f", "score": "0.7002488", "text": "_startGame () {\n\tthis.game.state.start('game');\n }", "title": "" }, { "docid": "eaadc598350d972e7922f7270e1820bf", "score": "0.7000692", "text": "function startGame(){\n drawingLoop();\n shotClockTimer();\n}", "title": "" }, { "docid": "f4c1dea5c350337314aa08e628d748b3", "score": "0.6996256", "text": "function gameStart() {\n if (!initialized) {\n gameCanvas = document.getElementById('gameCanvas');\n gameContext = gameCanvas.getContext(\"2d\");\n //gameContext.clearRect(0,0,textCanvas.width, textCanvas.height);\n\n // Create a few objects\n var pluto = new Planet(0.5, 200.0);\n var myRocket = new Rocket(0.0, alt, 100.0, 1.0, pluto);\n myRocket.drawRocket(gameContext);\n drawSurface(pluto, gameContext);\n game = new Game(myRocket, -4.0, -10.0);\n initialized = true;\n }\n\n // Start the game\n if(!end) {\n game.play(gameContext);\n }\n return false;\n}", "title": "" }, { "docid": "13f6f589a3ad14d6e65e64ca394016da", "score": "0.69908273", "text": "step() {\n this.draw();\n this.detectCollision(this.players[0]);\n }", "title": "" }, { "docid": "c97e1c69283ffc00b4e20e98e4d7a75a", "score": "0.6982676", "text": "function startGame() {\n\n\tdeal();\n\n\t\t\tcleanedUp = false;\n\t\t\tstatusUpdate(players[0]);\n\n\t\t\t//assign phase buttons to current player\n\t\t\tdocument.getElementById(\"buy\").onclick = function() {buyPhase(players[0])};\n\t\t\tdocument.getElementById(\"clean\").onclick = function() {cleanupPhase(players[0])};\n\n\t\t\tturn(players[0]);\n}", "title": "" }, { "docid": "b5928bbaded42ce03969fd047c348a67", "score": "0.6982186", "text": "function startOver(){\r\nlevel = 0;\r\ngamePattern = [];\r\nstarted = false;\r\n}", "title": "" }, { "docid": "8a54eee7bfc471bc044c0ac4e8912b69", "score": "0.6980758", "text": "function startOver() {\n level = 0;\n gamePattern = [];\n gameStarted = 0; \n}", "title": "" }, { "docid": "21f0fc137e965cb2bb532a3462010e36", "score": "0.69805056", "text": "function startGame() {\n var count = 0;\n window.setInterval(function() {\n moveGhosts(myPacX, myPacY, myPacXPrev, myPacYPrev);\n }, 1000);\n }", "title": "" }, { "docid": "45323dca282bb98a6364d95964d55407", "score": "0.6976305", "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": "9337a53d5906b5f988d341a968db3f5a", "score": "0.6972038", "text": "function startOver(){\n gamePattern = [];\n level = 0;\n started = false;\n }", "title": "" }, { "docid": "a665e3a3ee016db4d4b37803b6f176a0", "score": "0.6965491", "text": "function runGameState() {\n currentGameStateFunction();\n }", "title": "" }, { "docid": "2846552336333f8cd46493b0a765caec", "score": "0.69621783", "text": "function playAgain(){\n gameStart();\n}", "title": "" }, { "docid": "9cf58c23e09b22572256ff8bef2810f2", "score": "0.6957709", "text": "function startOver() {\r\n level = 0;\r\n gamePattern = [];\r\n started = 0;\r\n}", "title": "" }, { "docid": "b0118fc178d23d01cad00dacd63ac7e8", "score": "0.6957576", "text": "function playGame() {\n initiateGame();\n grabVariables();\n gamePlayInterface();\n}", "title": "" }, { "docid": "575de24f9d3cbabce63a5f76254fb6d8", "score": "0.6957459", "text": "function startOver(){\r\n level = 0;\r\n gamePattern = [];\r\n started = false;\r\n}", "title": "" } ]
d266ed8909d0a4f48b2575a34c554006
Changes the document type to indicate that it doesn't exist at the given version.
[ { "docid": "aba6e46df9eb5ad7c8b78b8ade9724b6", "score": "0.4999741", "text": "convertToNoDocument(t) {\n return this.version = t, this.documentType = 2 /* NO_DOCUMENT */ , this.data = bt.empty(), \n this.documentState = 0 /* SYNCED */ , this;\n }", "title": "" } ]
[ { "docid": "3ee0805029f87fea9c3a728e1be830c6", "score": "0.5567615", "text": "function t(\n /**\n * Set to an instance of DbUnknownDocument if the data for a document is\n * not known, but it is known that a document exists at the specified\n * version (e.g. it had a successful update applied to it)\n */\n t, \n /**\n * Set to an instance of a DbNoDocument if it is known that no document\n * exists.\n */\n n, \n /**\n * Set to an instance of a Document if there's a cached version of the\n * document.\n */\n i, \n /**\n * Documents that were written to the remote document store based on\n * a write acknowledgment are marked with `hasCommittedMutations`. These\n * documents are potentially inconsistent with the backend's copy and use\n * the write's commit version as their document version.\n */\n e, \n /**\n * When the document was read from the backend. Undefined for data written\n * prior to schema version 9.\n */\n r, \n /**\n * The path of the collection this document is part of. Undefined for data\n * written prior to schema version 9.\n */\n u) {\n this.unknownDocument = t, this.noDocument = n, this.document = i, this.hasCommittedMutations = e, \n this.readTime = r, this.parentPath = u;\n }", "title": "" }, { "docid": "55dd87bd20e5b7239a762644cf42dce6", "score": "0.5496858", "text": "function version(doc) {\n var v = doc.tangerine_version;\n delete doc.tangerine_version;\n doc.tangerineVersion = v;\n return doc;\n}", "title": "" }, { "docid": "85e2faaf272b2298212e78d2bd142b08", "score": "0.5493536", "text": "function togleDocType(type) {\n self.documentsList.pageNum = 1;\n self.mydocs = type;\n self.filterddocs = true;\n self.showAllOptions = true;\n alldocuments = false;\n getDocuments();\n }", "title": "" }, { "docid": "b58609566bda5f15aeb85ee7707b2ac5", "score": "0.52998394", "text": "Re(t, e) {\n if (e) {\n const t = ri(this.N, e);\n // Whether the document is a sentinel removal and should only be used in the\n // `getNewDocumentChanges()`\n if (!(t.isNoDocument() && t.version.isEqual(it.min()))) return t;\n }\n return qt.newInvalidDocument(t);\n }", "title": "" }, { "docid": "08d536372639d16f86e53bd1f403460c", "score": "0.5297304", "text": "docType(name, publicId, systemId) { }", "title": "" }, { "docid": "2f4963934d251eef1a1bc75523b5967b", "score": "0.5196699", "text": "function documentTypesWithoutPreview_(){this.documentTypesWithoutPreview$uRne=( [\"EditorPreferences\", \"Preferences\", \"Query\", \"Dictionary\"]);}", "title": "" }, { "docid": "bce35d09ab72066cc9eab009970b1347", "score": "0.5048067", "text": "convertToUnknownDocument(t) {\n return this.version = t, this.documentType = 3 /* UNKNOWN_DOCUMENT */ , this.data = Bt.empty(), \n this.documentState = 2 /* HAS_COMMITTED_MUTATIONS */ , this;\n }", "title": "" }, { "docid": "a955b766843d0beaa2f98b23b8697275", "score": "0.5045867", "text": "static newUnknownDocument(t, e) {\n return new Vt(t, 3 /* UNKNOWN_DOCUMENT */ , e, bt.empty(), 2 /* HAS_COMMITTED_MUTATIONS */);\n }", "title": "" }, { "docid": "5074bff4ad66445b5c3674af5ab4f647", "score": "0.50345105", "text": "convertToUnknownDocument(t) {\n return this.version = t, this.documentType = 3 /* UNKNOWN_DOCUMENT */ , this.data = bt.empty(), \n this.documentState = 2 /* HAS_COMMITTED_MUTATIONS */ , this;\n }", "title": "" }, { "docid": "3d6c951b71da5f4b205e4372e52cb042", "score": "0.50283736", "text": "convertToNoDocument(t) {\n return this.version = t, this.documentType = 2 /* NO_DOCUMENT */ , this.data = Bt.empty(), \n this.documentState = 0 /* SYNCED */ , this;\n }", "title": "" }, { "docid": "1ad8a4237a9bcf75f2c244db4a92497a", "score": "0.50028145", "text": "tryUpdate(sourceURL: string, apiVersion: string): Promise<void> {\n function unavailableError(err) {\n throw new Error(\n 'Could not update event types from ' + sourceURL +\n '\\nError: ' + err.message);\n }\n function invalidError(err) {\n throw new Error(\n 'Invalid event types schema returned from ' + sourceURL +\n '\\nErrors: ' + err.errors);\n }\n\n const USER_AGENT_PREFIX: string = 'Pryv.io/';\n\n return superagent\n .get(sourceURL)\n .set('User-Agent', USER_AGENT_PREFIX + apiVersion)\n .catch(unavailableError)\n .then((res) => {\n const validator = new ZSchemaValidator();\n const schema = res.body;\n\n return bluebird.try(() => {\n if (!validator.validateSchema(schema))\n return invalidError(validator.lastReport);\n\n // Overwrite defaultTypes with the merged list of type schemata. \n defaultTypes = lodash.merge(defaultTypes, schema);\n });\n });\n }", "title": "" }, { "docid": "1b86fc7c37fc39e5b605d588e15a3729", "score": "0.49968323", "text": "function create_documentType(document, name, publicId, systemId) {\n return DocumentTypeImpl_1.DocumentTypeImpl._create(document, name, publicId, systemId);\n}", "title": "" }, { "docid": "1b86fc7c37fc39e5b605d588e15a3729", "score": "0.49968323", "text": "function create_documentType(document, name, publicId, systemId) {\n return DocumentTypeImpl_1.DocumentTypeImpl._create(document, name, publicId, systemId);\n}", "title": "" }, { "docid": "360bdc95fcdf14dabd9b54ef47cc4c34", "score": "0.4965398", "text": "function setupType(node, callback) {\n \n // Extract local typename\n var typename = node._id.split('/')[2];\n views = {\n \"all\": {\n \"properties\": [\"_id\"],\n \"map\": \"function(doc) { if (doc.type.indexOf('\"+node._id+\"')>=0) { emit([doc._id], doc); } }\"\n }\n };\n \n // Setup validation function\n validatorFn = \"function(newDoc, oldDoc, userCtx) {\\n\";\n validatorFn += \"if (newDoc.type.indexOf('\"+node._id+\"')>=0) {\\n\";\n _.each(node.properties, function(property, key) {\n if (property.required) validatorFn += \"if (!newDoc['\"+key+\"']) throw({forbidden : '\"+key+\" is missing'});\\n\";\n if (property.validator) validatorFn += \"if (!new RegExp('\"+property.validator+\"').test(newDoc.\"+key+\")) throw({forbidden: '\"+key+\" is invalid'});\"\n });\n validatorFn += \"}}\";\n \n if (node.indexes) {\n _.each(node.indexes, function(properties, indexName) {\n var keyExpr = \"[\"+ _.map(properties, function(p) { return \"doc.\"+p;}).join(',')+ \"]\";\n views[indexName] = {\n \"properties\": properties,\n \"map\": \"function(doc) { if (doc.type.indexOf('\"+node._id+\"')>=0) { emit(\"+keyExpr+\", doc); } }\"\n };\n });\n }\n \n db.save({\n _id: '_design/'+typename,\n views: views,\n validate_doc_update: validatorFn\n }, {force: true}, function (err, doc) {\n err ? callback(err) : callback();\n });\n }", "title": "" }, { "docid": "c7bf08ef6cb079d9ad36c4651dc53f8f", "score": "0.48816505", "text": "function getVersionType(version) {\n const releasePattern = /^(\\d+)\\.(\\d+)\\.(\\d+)$/;\n\n let type = 'patch';\n\n if (!releasePattern.test(version)) {\n type = 'prerelease';\n } else if (version.endsWith('.0.0')) {\n type = 'major';\n } else if (version.endsWith('.0')) {\n type = 'minor';\n }\n\n return type;\n}", "title": "" }, { "docid": "86940f238ad70dd3fdf9cf41e147eda6", "score": "0.48282725", "text": "_updateDocument() {\n this._initializingDoc = true;\n if (!this._isValidType(this.selectedDocType) || !this.parent) {\n this.document = null;\n // prevent error message from being displayed the first time\n this.$.docTypeDropdown.invalid = false;\n this._initializingDoc = false;\n return;\n }\n\n return this.newDocument(this.selectedDocType.type, this._getDocumentProperties()).then((document) => {\n document.parentRef = this.parent.uid;\n // disable controls while the layout loads\n if (\n !this.document ||\n (this.document.type !== document.type &&\n !customElements.get(`nuxeo-${document.type.toLowerCase()}-import-layout`))\n ) {\n const promise = new Promise((resolve) => {\n this._layout_changed = (e) => {\n if (e.detail.element) {\n this.removeEventListener('document-layout-changed', this._layout_changed);\n resolve(e);\n }\n };\n this.addEventListener('document-layout-changed', this._layout_changed);\n });\n this.document = document;\n return promise.then((e) => {\n if (e.detail.element) {\n this._initializingDoc = false;\n }\n });\n }\n this.document = document;\n this._initializingDoc = false;\n });\n }", "title": "" }, { "docid": "455bd548a6f6fc295793967897fb01c1", "score": "0.4797248", "text": "function DocumentTypeImpl(name, publicId, systemId) {\n var _this = _super.call(this) || this;\n _this._name = '';\n _this._publicId = '';\n _this._systemId = '';\n _this._name = name;\n _this._publicId = publicId;\n _this._systemId = systemId;\n return _this;\n }", "title": "" }, { "docid": "6f79db84a6119f5e6095d25222583dd0", "score": "0.47815502", "text": "function doSomething(doc, docType, basename)\n{\n var uri = '/extensions/' + basename;\n if (docType == 'application/json') {\n // create a mutable version of the doc so we can modify it\n var mutableDoc = doc.toObject();\n uri += '.json';\n\n // add a JSON property to the input content\n mutableDoc.written = fn.currentTime();\n xdmp.documentInsert(uri, mutableDoc);\n return uri;\n } else if (docType == 'application/xml') {\n // pass thru an XML doc unchanged\n uri += '.xml';\n xdmp.documentInsert(uri, doc);\n return uri;\n } else {\n return '(skipped)';\n }\n}", "title": "" }, { "docid": "6f79db84a6119f5e6095d25222583dd0", "score": "0.47815502", "text": "function doSomething(doc, docType, basename)\n{\n var uri = '/extensions/' + basename;\n if (docType == 'application/json') {\n // create a mutable version of the doc so we can modify it\n var mutableDoc = doc.toObject();\n uri += '.json';\n\n // add a JSON property to the input content\n mutableDoc.written = fn.currentTime();\n xdmp.documentInsert(uri, mutableDoc);\n return uri;\n } else if (docType == 'application/xml') {\n // pass thru an XML doc unchanged\n uri += '.xml';\n xdmp.documentInsert(uri, doc);\n return uri;\n } else {\n return '(skipped)';\n }\n}", "title": "" }, { "docid": "439d577fba87d321c792bfb66f9a88da", "score": "0.4756139", "text": "function changeType(req, res) {\n req.checkBody(\"type\", \"Type cannot be empty\").notEmpty();\n\n Program.findOneAndUpdate(\n { title: req.body.title },\n {\n $set: {\n type: req.body.type\n }\n },\n { new: true }\n )\n .then(content => res.json(content))\n .catch(err => res.json(err));\n}", "title": "" }, { "docid": "60cf284d262f07c931f4e75bde351798", "score": "0.47349468", "text": "function excludedDocumentTypes_(){this.excludedDocumentTypes$uRne=( []);}", "title": "" }, { "docid": "b5dd8012b77688574dc77a3d18a4cb7d", "score": "0.4674056", "text": "function documentTypesHiddenInReferrers_(){this.documentTypesHiddenInReferrers$uRne=( [\"EditorPreferences\", \"Preferences\"]);}", "title": "" }, { "docid": "e48989d85b5526357603f8c68a111cd4", "score": "0.46737257", "text": "function convertUnknownType(context, type) {\n var name = context.checker.typeToString(type);\n return new td.models.UnknownType(name);\n }", "title": "" }, { "docid": "95b512335eeb7cff1902bff33bd2f387", "score": "0.46667373", "text": "function xe(t, e) {\n return void 0 !== t.updateTime ? e.isFoundDocument() && e.version.isEqual(t.updateTime) : void 0 === t.exists || t.exists === e.isFoundDocument();\n}", "title": "" }, { "docid": "47002c0a9016cf81548ac82d227705d6", "score": "0.4639368", "text": "function setversion() {\n}", "title": "" }, { "docid": "cdda1e86f06e22a4b085ecf15b80fd9d", "score": "0.463575", "text": "function replaceDoc() {\n self.docModel.doc_name = '';\n self.uploaddoc = true;\n self.officeDocs = false;\n toggleButtons(false);\n toggleButtons(true, 'Cancel');\n initializeSingleFileDropnzone();\n }", "title": "" }, { "docid": "8a05676be5b16f93003d291d71b60864", "score": "0.46203405", "text": "function invalidDoc(doc) {\n if (doc.query) {\n if (typeof doc.query.type != \"string\") return \".query.type must be a string\";\n if (doc.query.start && !isPosition(doc.query.start)) return \".query.start must be a position\";\n if (doc.query.end && !isPosition(doc.query.end)) return \".query.end must be a position\";\n }\n if (doc.files) {\n if (!Array.isArray(doc.files)) return \"Files property must be an array\";\n for (var i = 0; i < doc.files.length; ++i) {\n var file = doc.files[i];\n if (typeof file != \"object\") return \".files[n] must be objects\";\n else if (typeof file.name != \"string\") return \".files[n].name must be a string\";\n else if (file.type == \"delete\") continue;\n else if (typeof file.text != \"string\") return \".files[n].text must be a string\";\n else if (file.type == \"part\") {\n if (!isPosition(file.offset) && typeof file.offsetLines != \"number\")\n return \".files[n].offset must be a position\";\n } else if (file.type != \"full\") return \".files[n].type must be \\\"full\\\" or \\\"part\\\"\";\n }\n }\n }", "title": "" }, { "docid": "ca4425de9fb72b0d8d0d7bc112f28265", "score": "0.46050632", "text": "notType(type) {\n return this.notAttribute('type', type);\n }", "title": "" }, { "docid": "72e4addee7b9db54d129af514af5580b", "score": "0.46030632", "text": "function nodenotationnodetype() {\n var success;\n if(checkInitialization(builder, \"nodenotationnodetype\") != null) return;\n var doc;\n var docType;\n var notations;\n var notationNode;\n var nodeType;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"staff\");\n docType = doc.doctype;\n\n assertNotNull(\"docTypeNotNull\",docType);\nnotations = docType.notations;\n\n assertNotNull(\"notationsNotNull\",notations);\nnotationNode = notations.getNamedItem(\"notation1\");\n assertNotNull(\"notationNotNull\",notationNode);\nnodeType = notationNode.nodeType;\n\n assertEquals(\"nodeNotationNodeTypeAssert1\",12,nodeType);\n \n}", "title": "" }, { "docid": "1d508792567bcd6b64eab3248dd7da34", "score": "0.45939872", "text": "async resetVersion () {\n const pkg = await this.getPackageJson()\n\n pkg.version = '0.0.0'\n\n await this.savePackageJson(pkg)\n }", "title": "" }, { "docid": "75acbd1c6ad8a8d227f6f13a3f7c6985", "score": "0.45877537", "text": "function addDocument(type, data) {\n pushToDataLayer(type, data);\n }", "title": "" }, { "docid": "b7da6493613177d6f425d52f425a1df4", "score": "0.45694736", "text": "setFiletype(filetype) {\n let { uri, version } = this;\n this._filetype = this.convertFiletype(filetype);\n version = version ? version + 1 : 1;\n let textDocument = vscode_languageserver_protocol_1.TextDocument.create(uri, this.filetype, version, this.content);\n this.textDocument = textDocument;\n }", "title": "" }, { "docid": "ccebec02bfa2521305d9e6d1654e0f50", "score": "0.4566406", "text": "function invalidDoc(doc) {\n if (doc.query) {\n if (typeof doc.query.type != \"string\") return \".query.type must be a string\";\n if (doc.query.start && !isPosition(doc.query.start)) return \".query.start must be a position\";\n if (doc.query.end && !isPosition(doc.query.end)) return \".query.end must be a position\";\n }\n if (doc.files) {\n if (!Array.isArray(doc.files)) return \"Files property must be an array\";\n for (var i = 0; i < doc.files.length; ++i) {\n var file = doc.files[i];\n if (typeof file != \"object\") return \".files[n] must be objects\";\n else if (typeof file.name != \"string\") return \".files[n].name must be a string\";\n else if (file.type == \"delete\") continue;\n else if (typeof file.text != \"string\") return \".files[n].text must be a string\";\n else if (file.type == \"part\") {\n if (!isPosition(file.offset) && typeof file.offsetLines != \"number\")\n return \".files[n].offset must be a position\";\n } else if (file.type != \"full\") return \".files[n].type must be \\\"full\\\" or \\\"part\\\"\";\n }\n }\n }", "title": "" }, { "docid": "37d5c7356a63d87e99cc61a2916de51b", "score": "0.4563894", "text": "function setVersion() {\n if( versionType == \"prev\" || versionType == \"dev\" ) \n $(\"versionType\").html(versionType);\n $(\"version\").html(version + \" (\"+versionType+\")\");\n}", "title": "" }, { "docid": "77781e279dfbd24e0fba4081767becf0", "score": "0.45597872", "text": "function newVersionDevNo() {\r\n\tnewVersionDevCreation = false;\r\n\tnewVersionShowSection('newVersionMinor');\r\n}", "title": "" }, { "docid": "0211a9e2a2ad5827f12822abede0a69f", "score": "0.4557676", "text": "function setVersion(versionType, versionFull) {\n\t\tversionType.version = versionFull;\n\t\tvar versionArray = versionFull.split(\".\");\n\t\tif (versionArray.length > 0) {\n\t\t\tversionArray = versionArray.reverse();\n\t\t\tversionType.major = versionArray.pop();\n\t\t\tif (versionArray.length > 0) {\n\t\t\t\tversionType.minor = versionArray.pop();\n\t\t\t\tif (versionArray.length > 0) {\n\t\t\t\t\tversionArray = versionArray.reverse();\n\t\t\t\t\tversionType.patch = versionArray.join(\".\");\n\t\t\t\t} else {\n\t\t\t\t\tversionType.patch = \"0\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tversionType.minor = \"0\";\n\t\t\t}\n\t\t} else {\n\t\t\tversionType.major = \"0\";\n\t\t}\n\t}", "title": "" }, { "docid": "8a20a33b99b1d10de42365e8c3fcc22b", "score": "0.455112", "text": "createIfNotExists(doc) {\n const op = \"createIfNotExists\";\n validateObject(op, doc);\n requireDocumentId(op, doc);\n return this._add({\n [op]: doc\n });\n }", "title": "" }, { "docid": "564058e8e6b5edf2002d34b0a5373a09", "score": "0.45410976", "text": "function fixOldSave(oldVersion){\n}", "title": "" }, { "docid": "564058e8e6b5edf2002d34b0a5373a09", "score": "0.45410976", "text": "function fixOldSave(oldVersion){\n}", "title": "" }, { "docid": "b4ea8daab732c17fbeb921de6783f3d5", "score": "0.4535678", "text": "function checkImageType() {\n _.each(vmParent.spot.properties.images, function (image, i) {\n if (!image.image_type ||\n _.isEmpty(image.image_type)) vmParent.spot.properties.images[i]['image_type'] = 'photo';\n });\n }", "title": "" }, { "docid": "0dde9dd2fca3a4d8982f5f738349eb2b", "score": "0.4527566", "text": "skipVersion (version) {\n let skipped = this.state.saved.skippedVersions\n if (!skipped) skipped = this.state.saved.skippedVersions = []\n skipped.push(version)\n dispatch('stateSave')\n }", "title": "" }, { "docid": "75a97d7ede4e140de9153281b269ab2d", "score": "0.44997054", "text": "function Oe(t) {\n return t.isFoundDocument() ? t.version : K.min();\n}", "title": "" }, { "docid": "ca6e2ca58246a6d16092fa2e2da5dfc1", "score": "0.44906914", "text": "_createDirtyView() {\n return this._slouch.doc.createOrUpdate(this._spiegel._dbName, {\n _id: '_design/dirty_' + this._type,\n views: {\n ['dirty_' + this._type]: {\n map: [\n 'function(doc) {',\n // Note: we use doc.dirty !== false as we also want to consider the item dirty when\n // there is no dirty attribute\n 'if (doc.type === \"' + this._type + '\" && doc.dirty !== false) {',\n 'emit(doc._id, null);',\n '}',\n '}'\n ].join(' ')\n }\n }\n })\n }", "title": "" }, { "docid": "7beac5ae0992eff0ff94fd916b6f6418", "score": "0.44871324", "text": "function DocumentWithoutSegmentsStatus() {\n _classCallCheck(this, DocumentWithoutSegmentsStatus);\n\n DocumentWithoutSegmentsStatus.initialize(this);\n }", "title": "" }, { "docid": "81fea6ba2aa25e58feb6a4a9fa24e37f", "score": "0.44712195", "text": "function clear(){\n document_types.length = 0;\n document_types_dict = {};\n document_types_option_list.length = 0;\n }", "title": "" }, { "docid": "187924e30ac998b39032a1ad0916b8bc", "score": "0.44641677", "text": "function initializerByDocumentType_(){this.initializerByDocumentType$uRne=( {});}", "title": "" }, { "docid": "0cb50e35671afe99c5578a952cdaf146", "score": "0.44629827", "text": "function update(document, changes, version) {\n if (document instanceof FullTextDocument) {\n document.update(changes, version);\n return document;\n }\n else {\n throw new Error('TextDocument.update: document must be created by TextDocument.create');\n }\n }", "title": "" }, { "docid": "30d3da5f695de2a68a83e4975c83755f", "score": "0.44563448", "text": "function changeVersion(event, index) {\n if (sheets) {\n if (index !== sheets[sheetIndex].changes.length - 1) {\n document.getElementById(\"revertion\").style.visibility = \"visible\";\n } else {\n document.getElementById(\"revertion\").style.visibility = \"hidden\";\n }\n }\n setData(sheets[selectedIndex - 1].changes[index].text);\n setIndex(index);\n }", "title": "" }, { "docid": "123bbbf95cd4ed35d91f5d83881558bd", "score": "0.4443946", "text": "function notFound(type) {\n var source = $(\"#not-found-template\").html();\n $(\"#\"+type+\"-section\").removeClass(\"d-none\");\n $(\"#\"+type+\"-section\").children(\"i\").addClass(\"d-none\");\n $(\"#\"+type+\"-section\").append(source);\n}", "title": "" }, { "docid": "b0c9d57a31d6383e48bc81cfc34607b9", "score": "0.44304308", "text": "set type(newValue) {\n // jshint unused:false\n console.warn('DEPRECATION WARNING: \"type\" property is going to be deprecated, please from now on don\\'t use it.');\n }", "title": "" }, { "docid": "d05a675b2f02dbdf70ccb317d1d26e76", "score": "0.44211367", "text": "static newInvalidDocument(t) {\n return new Vt(t, 0 /* INVALID */ , W.min(), bt.empty(), 0 /* SYNCED */);\n }", "title": "" }, { "docid": "fe857dd7fd31d995a91dbc9e92888873", "score": "0.44087678", "text": "function DbRemoteDocument(\r\n /**\r\n * Set to an instance of DbUnknownDocument if the data for a document is\r\n * not known, but it is known that a document exists at the specified\r\n * version (e.g. it had a successful update applied to it)\r\n */\r\n unknownDocument, \r\n /**\r\n * Set to an instance of a DbNoDocument if it is known that no document\r\n * exists.\r\n */\r\n noDocument, \r\n /**\r\n * Set to an instance of a Document if there's a cached version of the\r\n * document.\r\n */\r\n document, \r\n /**\r\n * Documents that were written to the remote document store based on\r\n * a write acknowledgment are marked with `hasCommittedMutations`. These\r\n * documents are potentially inconsistent with the backend's copy and use\r\n * the write's commit version as their document version.\r\n */\r\n hasCommittedMutations, \r\n /**\r\n * When the document was read from the backend. Undefined for data written\r\n * prior to schema version 9.\r\n */\r\n readTime, \r\n /**\r\n * The path of the collection this document is part of. Undefined for data\r\n * written prior to schema version 9.\r\n */\r\n parentPath) {\r\n this.unknownDocument = unknownDocument;\r\n this.noDocument = noDocument;\r\n this.document = document;\r\n this.hasCommittedMutations = hasCommittedMutations;\r\n this.readTime = readTime;\r\n this.parentPath = parentPath;\r\n }", "title": "" }, { "docid": "ebd038bd5000c0069ace3bbdf704fae2", "score": "0.44084206", "text": "static newUnknownDocument(t, e) {\n return new qt(t, 3 /* UNKNOWN_DOCUMENT */ , e, Bt.empty(), 2 /* HAS_COMMITTED_MUTATIONS */);\n }", "title": "" }, { "docid": "80c72b2cabfd7e0bdd3e65fe08c44205", "score": "0.44077307", "text": "constructor(\n /**\n * Set to an instance of DbUnknownDocument if the data for a document is\n * not known, but it is known that a document exists at the specified\n * version (e.g. it had a successful update applied to it)\n */\n t, \n /**\n * Set to an instance of a DbNoDocument if it is known that no document\n * exists.\n */\n e, \n /**\n * Set to an instance of a Document if there's a cached version of the\n * document.\n */\n n, \n /**\n * Documents that were written to the remote document store based on\n * a write acknowledgment are marked with `hasCommittedMutations`. These\n * documents are potentially inconsistent with the backend's copy and use\n * the write's commit version as their document version.\n */\n s, \n /**\n * When the document was read from the backend. Undefined for data written\n * prior to schema version 9.\n */\n i, \n /**\n * The path of the collection this document is part of. Undefined for data\n * written prior to schema version 9.\n */\n r) {\n this.unknownDocument = t, this.noDocument = e, this.document = n, this.hasCommittedMutations = s, \n this.readTime = i, this.parentPath = r;\n }", "title": "" }, { "docid": "80c72b2cabfd7e0bdd3e65fe08c44205", "score": "0.44077307", "text": "constructor(\n /**\n * Set to an instance of DbUnknownDocument if the data for a document is\n * not known, but it is known that a document exists at the specified\n * version (e.g. it had a successful update applied to it)\n */\n t, \n /**\n * Set to an instance of a DbNoDocument if it is known that no document\n * exists.\n */\n e, \n /**\n * Set to an instance of a Document if there's a cached version of the\n * document.\n */\n n, \n /**\n * Documents that were written to the remote document store based on\n * a write acknowledgment are marked with `hasCommittedMutations`. These\n * documents are potentially inconsistent with the backend's copy and use\n * the write's commit version as their document version.\n */\n s, \n /**\n * When the document was read from the backend. Undefined for data written\n * prior to schema version 9.\n */\n i, \n /**\n * The path of the collection this document is part of. Undefined for data\n * written prior to schema version 9.\n */\n r) {\n this.unknownDocument = t, this.noDocument = e, this.document = n, this.hasCommittedMutations = s, \n this.readTime = i, this.parentPath = r;\n }", "title": "" }, { "docid": "188863239239de893b83a9a632b2877d", "score": "0.44065335", "text": "_serializeDocumentType(node, requireWellFormed, noDoubleEncoding) {\n /**\n * 1. If the require well-formed flag is true and the node's publicId\n * attribute contains characters that are not matched by the XML PubidChar\n * production, then throw an exception; the serialization of this node\n * would not be a well-formed document type declaration.\n */\n if (requireWellFormed && !algorithm_1.xml_isPubidChar(node.publicId)) {\n throw new Error(\"DocType public identifier does not match PubidChar construct (well-formed required).\");\n }\n /**\n * 2. If the require well-formed flag is true and the node's systemId\n * attribute contains characters that are not matched by the XML Char\n * production or that contains both a \"\"\" (U+0022 QUOTATION MARK) and a\n * \"'\" (U+0027 APOSTROPHE), then throw an exception; the serialization\n * of this node would not be a well-formed document type declaration.\n */\n if (requireWellFormed &&\n (!algorithm_1.xml_isLegalChar(node.systemId) ||\n (node.systemId.indexOf('\"') !== -1 && node.systemId.indexOf(\"'\") !== -1))) {\n throw new Error(\"DocType system identifier contains invalid characters (well-formed required).\");\n }\n /**\n * 3. Let markup be an empty string.\n * 4. Append the string \"<!DOCTYPE\" to markup.\n * 5. Append \" \" (U+0020 SPACE) to markup.\n * 6. Append the value of the node's name attribute to markup. For a node\n * belonging to an HTML document, the value will be all lowercase.\n * 7. If the node's publicId is not the empty string then append the\n * following, in the order listed, to markup:\n * 7.1. \" \" (U+0020 SPACE);\n * 7.2. The string \"PUBLIC\";\n * 7.3. \" \" (U+0020 SPACE);\n * 7.4. \"\"\" (U+0022 QUOTATION MARK);\n * 7.5. The value of the node's publicId attribute;\n * 7.6. \"\"\" (U+0022 QUOTATION MARK).\n * 8. If the node's systemId is not the empty string and the node's publicId\n * is set to the empty string, then append the following, in the order\n * listed, to markup:\n * 8.1. \" \" (U+0020 SPACE);\n * 8.2. The string \"SYSTEM\".\n * 9. If the node's systemId is not the empty string then append the\n * following, in the order listed, to markup:\n * 9.2. \" \" (U+0020 SPACE);\n * 9.3. \"\"\" (U+0022 QUOTATION MARK);\n * 9.3. The value of the node's systemId attribute;\n * 9.4. \"\"\" (U+0022 QUOTATION MARK).\n * 10. Append \">\" (U+003E GREATER-THAN SIGN) to markup.\n * 11. Return the value of markup.\n */\n this.docType(node.name, node.publicId, node.systemId);\n }", "title": "" }, { "docid": "2c5e1fff272ddeaa4ae45895551d1849", "score": "0.44027665", "text": "static newNoDocument(t, e) {\n return new Vt(t, 2 /* NO_DOCUMENT */ , e, bt.empty(), 0 /* SYNCED */);\n }", "title": "" }, { "docid": "43daac0c9eecf608cda07b0dd064d87d", "score": "0.43999448", "text": "function migrateCheck(version, storedVersion) {\n\tif (version !== storedVersion) {\n\t\t// this function clears default values which have changed\n\t\tswitch (storedVersion) {\n\n\t\t\tcase '1.9.9':\t// replace with 2.0.0-beta.1\n\t\t\t\t// after all previous versions have fallen through\n\t\t\t\tconsole.log('Upgrading Georgia Theme settings');\n globals.version = currentVersion;\n\t\t\t\twindow.Reload();\n\n default:\n globals.version = currentVersion;\n\t\t\t\tbreak;\n\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b741afb4a0d62b89e832b135a439c39b", "score": "0.43994036", "text": "function notFound (type) {\n\tvar source = $('#not-found-template').html();\n\tvar template = Handlebars.compile(source);\n\tvar html = template();\n\tif (type === 'movie') {\n\t\t$('.list-movies').append(html);\n\t} else {\n\t\t$('.list-series').append(html);\n\t}\n\tshowTypeSerch();\n}", "title": "" }, { "docid": "bad8503867894b332f80f90cc07be304", "score": "0.43887472", "text": "_serializeDocumentType(node, requireWellFormed) {\n /**\n * 1. If the require well-formed flag is true and the node's publicId\n * attribute contains characters that are not matched by the XML PubidChar\n * production, then throw an exception; the serialization of this node\n * would not be a well-formed document type declaration.\n */\n if (requireWellFormed && !algorithm_1.xml_isPubidChar(node.publicId)) {\n throw new Error(\"DocType public identifier does not match PubidChar construct (well-formed required).\");\n }\n /**\n * 2. If the require well-formed flag is true and the node's systemId\n * attribute contains characters that are not matched by the XML Char\n * production or that contains both a \"\"\" (U+0022 QUOTATION MARK) and a\n * \"'\" (U+0027 APOSTROPHE), then throw an exception; the serialization\n * of this node would not be a well-formed document type declaration.\n */\n if (requireWellFormed &&\n (!algorithm_1.xml_isLegalChar(node.systemId) ||\n (node.systemId.indexOf('\"') !== -1 && node.systemId.indexOf(\"'\") !== -1))) {\n throw new Error(\"DocType system identifier contains invalid characters (well-formed required).\");\n }\n /**\n * 3. Let markup be an empty string.\n * 4. Append the string \"<!DOCTYPE\" to markup.\n * 5. Append \" \" (U+0020 SPACE) to markup.\n * 6. Append the value of the node's name attribute to markup. For a node\n * belonging to an HTML document, the value will be all lowercase.\n * 7. If the node's publicId is not the empty string then append the\n * following, in the order listed, to markup:\n * 7.1. \" \" (U+0020 SPACE);\n * 7.2. The string \"PUBLIC\";\n * 7.3. \" \" (U+0020 SPACE);\n * 7.4. \"\"\" (U+0022 QUOTATION MARK);\n * 7.5. The value of the node's publicId attribute;\n * 7.6. \"\"\" (U+0022 QUOTATION MARK).\n * 8. If the node's systemId is not the empty string and the node's publicId\n * is set to the empty string, then append the following, in the order\n * listed, to markup:\n * 8.1. \" \" (U+0020 SPACE);\n * 8.2. The string \"SYSTEM\".\n * 9. If the node's systemId is not the empty string then append the\n * following, in the order listed, to markup:\n * 9.2. \" \" (U+0020 SPACE);\n * 9.3. \"\"\" (U+0022 QUOTATION MARK);\n * 9.3. The value of the node's systemId attribute;\n * 9.4. \"\"\" (U+0022 QUOTATION MARK).\n * 10. Append \">\" (U+003E GREATER-THAN SIGN) to markup.\n * 11. Return the value of markup.\n */\n return node.publicId && node.systemId ?\n \"<!DOCTYPE \" + node.name + \" PUBLIC \\\"\" + node.publicId + \"\\\" \\\"\" + node.systemId + \"\\\">\"\n : node.publicId ?\n \"<!DOCTYPE \" + node.name + \" PUBLIC \\\"\" + node.publicId + \"\\\">\"\n : node.systemId ?\n \"<!DOCTYPE \" + node.name + \" SYSTEM \\\"\" + node.systemId + \"\\\">\"\n :\n \"<!DOCTYPE \" + node.name + \">\";\n }", "title": "" }, { "docid": "abbf5e67b76c0f3cebc75291ade46dc8", "score": "0.43810266", "text": "function hc_nodereplacechildinvalidnodetype() {\n var success;\n if(checkInitialization(builder, \"hc_nodereplacechildinvalidnodetype\") != null) return;\n var doc;\n var rootNode;\n var newChild;\n var elementList;\n var oldChild;\n var replacedChild;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"hc_staff\");\n newChild = doc.createAttribute(\"lang\");\n elementList = doc.getElementsByTagName(\"p\");\n oldChild = elementList.item(1);\n rootNode = oldChild.parentNode;\n\n \n\t{\n\t\tsuccess = false;\n\t\ttry {\n replacedChild = rootNode.replaceChild(newChild,oldChild);\n }\n\t\tcatch(ex) {\n success = (typeof(ex.code) != 'undefined' && ex.code == 3);\n\t\t}\n\t\tassertTrue(\"throw_HIERARCHY_REQUEST_ERR\",success);\n\t}\n\n}", "title": "" }, { "docid": "3b576082dceb542376daf11364ff8a7c", "score": "0.43587714", "text": "enterVersionType(ctx) {\n\t}", "title": "" }, { "docid": "a4668a89b4743548c35c1346000a3551", "score": "0.43586805", "text": "function importType(type, ver) {\n if (ver != undefined)\n try {\n return gir.import(type, ver);\n }\n catch (e) {\n console.warn('In importType(),', e);\n return gir.import(type);\n }\n else\n return gir.import(type);\n}", "title": "" }, { "docid": "94a560104535b03b723b83e86e55beb1", "score": "0.43295062", "text": "function DbRemoteDocument(\r\n /**\r\n * Set to an instance of DbUnknownDocument if the data for a document is\r\n * not known, but it is known that a document exists at the specified\r\n * version (e.g. it had a successful update applied to it)\r\n */\r\n unknownDocument, \r\n /**\r\n * Set to an instance of a DbNoDocument if it is known that no document\r\n * exists.\r\n */\r\n noDocument, \r\n /**\r\n * Set to an instance of a Document if there's a cached version of the\r\n * document.\r\n */\r\n document, \r\n /**\r\n * Documents that were written to the remote document store based on\r\n * a write acknowledgment are marked with `hasCommittedMutations`. These\r\n * documents are potentially inconsistent with the backend's copy and use\r\n * the write's commit version as their document version.\r\n */\r\n hasCommittedMutations, \r\n /**\r\n * When the document was read from the backend. Undefined for data written\r\n * prior to schema version 9.\r\n */\r\n readTime, \r\n /**\r\n * The path of the collection this document is part of. Undefined for data\r\n * written prior to schema version 9.\r\n */\r\n parentPath) {\r\n this.unknownDocument = unknownDocument;\r\n this.noDocument = noDocument;\r\n this.document = document;\r\n this.hasCommittedMutations = hasCommittedMutations;\r\n this.readTime = readTime;\r\n this.parentPath = parentPath;\r\n }", "title": "" }, { "docid": "d9c43e5ed9fdea40f103663df784094b", "score": "0.43272817", "text": "function excludedDocTypeNames_(){this.excludedDocTypeNames$FPu8=( mx.resources.ResourceManager.getInstance().getString('com.coremedia.cms.editor.sdk.navigationtree.NavigationTreeSettings', 'navigation_document_type_exclusions').split(\",\"));}", "title": "" }, { "docid": "ab9c3523c008fb3e3cf03928999fd770", "score": "0.43264246", "text": "_newVersion() {\n let versionName = $('#version_name', this.$el).val() + '_' + new Date().toLocaleString();\n new Content().save({version_name: versionName}, {\n apiContext: 'new-version',\n urlParameter: {\n contentId: this._content.get('content_id'),\n language: this._content.get('language'),\n originalVersion : this._content.get('version')\n },\n success: () => {\n let url = Backbone.history.generateUrl('editContent', {\n contentTypeId: this._contentType.get('content_type_id'),\n language: this._content.get('language'),\n contentId: this._content.get('content_id')\n });\n if (url === Backbone.history.fragment) {\n Backbone.history.loadUrl(url);\n } else {\n Backbone.history.navigate(url, true);\n }\n }\n })\n }", "title": "" }, { "docid": "d9cddc3d59cbebff4100a05fa801ed36", "score": "0.4325504", "text": "function testDocumentType(basePrivilege, documentIdType) {\n it('successfully creates a valid document', function() {\n // kashooId is omitted from this document to test that the validator will accept that case\n var doc = {\n _id: 'merchant.3.' + documentIdType + '.2',\n id: documentIdType + '-ID',\n entity: { somekey: 'somevalue' },\n lastModified: '2016-02-29T17:13:43.666Z',\n kashooId: 12345,\n processingFailure: 'this is a processing failure'\n };\n\n verifyDocumentCreated(basePrivilege, 3, doc);\n });\n\n it('cannot create a document when the fields are of the wrong types', function() {\n var doc = {\n _id: 'merchant.3.' + documentIdType + '.2',\n id: 79,\n kashooId: 'some-string',\n entity: [ 'not', 'the', 'right', 'type' ],\n lastModified: 'lkjasdflkj',\n processingFailure: 98213098\n };\n\n verifyDocumentNotCreated(\n basePrivilege,\n 3,\n doc,\n documentIdType,\n [\n errorFormatter.typeConstraintViolation('id', 'string'),\n errorFormatter.typeConstraintViolation('kashooId', 'integer'),\n errorFormatter.typeConstraintViolation('entity', 'object'),\n errorFormatter.typeConstraintViolation('lastModified', 'datetime'),\n errorFormatter.typeConstraintViolation('processingFailure', 'string')\n ]);\n });\n\n it('cannot create a document that has a non-positive kashooId field', function() {\n var doc = {\n _id: 'merchant.3.' + documentIdType + '.2',\n id: documentIdType + '-ID',\n entity: { somekey: 'somevalue' },\n lastModified: '2016-02-29T17:13:43.666Z',\n kashooId: 0\n };\n\n verifyDocumentNotCreated(basePrivilege, 3, doc, documentIdType, errorFormatter.minimumValueViolation('kashooId', 1));\n });\n\n it('successfully replaces a valid document', function() {\n var doc = {\n _id: 'merchant.3.' + documentIdType + '.2',\n id: documentIdType + '-ID',\n entity: { somekey: 'somevalue' },\n lastModified: '2016-02-29T17:13:43.666Z',\n kashooId: 98230980935\n };\n var oldDoc = { _id: 'merchant.3.' + documentIdType + '.2', lastModified: '2016-02-29T17:14:43.666Z', };\n\n verifyDocumentReplaced(basePrivilege, 3, doc, oldDoc);\n });\n\n it('cannot replace a document when the square entity and ID fields are missing', function() {\n var doc = {\n _id: 'merchant.3.' + documentIdType + '.2',\n kashooId: 78234672\n };\n var oldDoc = { _id: 'merchant.3.' + documentIdType + '.2', };\n\n verifyDocumentNotReplaced(\n basePrivilege,\n 3,\n doc,\n oldDoc,\n documentIdType,\n [ errorFormatter.requiredValueViolation('id'), errorFormatter.requiredValueViolation('entity') ]\n )\n });\n\n it('successfully deletes a document', function() {\n var oldDoc = {\n _id: 'merchant.8.' + documentIdType + '.2',\n entity: { somekey: 'somevalue' },\n _deleted: true\n };\n\n verifyDocumentDeleted(basePrivilege, 8, oldDoc);\n });\n }", "title": "" }, { "docid": "40ac0be663765d8f7344eef1174eb092", "score": "0.43057114", "text": "function nodedocumentnodetype() {\n var success;\n if(checkInitialization(builder, \"nodedocumentnodetype\") != null) return;\n var doc;\n var nodeType;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"staff\");\n nodeType = doc.nodeType;\n\n assertEquals(\"nodeDocumentNodeTypeAssert1\",9,nodeType);\n \n}", "title": "" }, { "docid": "67f95facf57cb43aa4cfb364cc9d3610", "score": "0.42915076", "text": "ge(t, e) {\n if (e) {\n const t = Ws(this.R, e);\n // Whether the document is a sentinel removal and should only be used in the\n // `getNewDocumentChanges()`\n if (!(t.isNoDocument() && t.version.isEqual(W.min()))) return t;\n }\n return Vt.newInvalidDocument(t);\n }", "title": "" }, { "docid": "23c1fcf24045a2108b156c205e3e8f7f", "score": "0.4288845", "text": "createOrReplace(doc) {\n const op = \"createOrReplace\";\n validateObject(op, doc);\n requireDocumentId(op, doc);\n return this._add({\n [op]: doc\n });\n }", "title": "" }, { "docid": "38a7957646b05b5c579e7e23529572bb", "score": "0.42864767", "text": "function nodedocumenttypenodetype() {\n var success;\n if(checkInitialization(builder, \"nodedocumenttypenodetype\") != null) return;\n var doc;\n var documentTypeNode;\n var nodeType;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"staff\");\n documentTypeNode = doc.doctype;\n\n assertNotNull(\"doctypeNotNull\",documentTypeNode);\nnodeType = documentTypeNode.nodeType;\n\n assertEquals(\"nodeType\",10,nodeType);\n \n}", "title": "" }, { "docid": "5e55e24118471afc3856d28a78d6bc2b", "score": "0.42861515", "text": "function UnreleasedVersionLabel({\n siteTitle,\n versionMetadata\n}) {\n return <_Translate.default id=\"theme.docs.versions.unreleasedVersionLabel\" description=\"The label used to tell the user that he's browsing an unreleased doc version\" values={{\n siteTitle,\n versionLabel: <b>{versionMetadata.label}</b>\n }}>\n {'This is unreleased documentation for {siteTitle} {versionLabel} version.'}\n </_Translate.default>;\n}", "title": "" }, { "docid": "0af4dbbcefadf884b457e38372a6fee5", "score": "0.4277953", "text": "precondition(t) {\n const e = this.readVersions.get(t.toString());\n return !this.writtenDocs.has(t.toString()) && e ? Ne.updateTime(e) : Ne.none();\n }", "title": "" }, { "docid": "5348ecefa3b7c34aba7440085083ad80", "score": "0.42762595", "text": "function replaceFamilyDocument(document) {\n let documentUrl = `${collectionUrl}/docs/${document.id}`;\n console.log(`Replacing document:\\n${document.id}\\n`);\n document.children[0].grade = 6;\n\n return new Promise((resolve, reject) => {\n client.replaceDocument(documentUrl, document, (err, result) => {\n if (err) reject(err);\n else {\n resolve(result);\n }\n });\n });\n}", "title": "" }, { "docid": "df7549b19ec1cf3970d734bc8cf544d4", "score": "0.42674398", "text": "function isDocumentNew(doc) {\r\n\t// Assumes doc is the activeDocument\r\n\tcTID = function (s) {\r\n\t\treturn app.charIDToTypeID(s);\r\n\t}\r\n\tvar ref = new ActionReference();\r\n\tref.putEnumerated(cTID(\"Dcmn\"),\r\n\t\tcTID(\"Ordn\"),\r\n\t\tcTID(\"Trgt\")); // ActiveDoc\r\n\tvar desc = executeActionGet(ref);\r\n\tvar rc = true;\r\n\tif (desc.hasKey(cTID(\"FilR\"))) { // FileReference\r\n\t\tvar path = desc.getPath(cTID(\"FilR\"));\r\n\r\n\t\tif (path) {\r\n\t\t\trc = (path.absoluteURI.length == 0);\r\n\t\t}\r\n\t}\r\n\treturn rc;\r\n}", "title": "" }, { "docid": "1c7fc8322d441edfed311a290c232392", "score": "0.42650774", "text": "function checkVersionNumber()\n{\n var temp = PropertiesService.getUserProperties();\n var latestVersion = temp.getProperty(\"esd-latestVersion\");\n \n if(latestVersion === \"\" || parseInt(latestVersion) !== esdVersion)\n {\n PropertiesService.getUserProperties().setProperty(\"esd-latestVersion\", esdVersion.toString());\n openNewVersionModal();\n }\n}", "title": "" }, { "docid": "b2d1200e42c7c45b984e1955c37310b5", "score": "0.42601532", "text": "function _versionCheck() {\n // get user's version\n var _version = store.get(\"version\");\n // set version again\n store.set(\"version\", planner.version);\n // publish the app wide message related to user\n $.publish(\"app:status:\" + ((!_version) ? \"new\" :\n (_version < planner.version) ? \"updated\" : \"uptodate\"));\n }", "title": "" }, { "docid": "48d32489f02fb98dcd9c0aad414c61b8", "score": "0.42489657", "text": "function Ae(t, e) {\n return void 0 !== t.updateTime ? e.isFoundDocument() && e.version.isEqual(t.updateTime) : void 0 === t.exists || t.exists === e.isFoundDocument();\n}", "title": "" }, { "docid": "1cfc03a83640fda89e9bd8ba0d1f5fc5", "score": "0.42445526", "text": "static _create(document, name, publicId = '', systemId = '') {\n const node = new DocumentTypeImpl(name, publicId, systemId);\n node._nodeDocument = document;\n return node;\n }", "title": "" }, { "docid": "ed48e2e6b89abc3294fda231c3eb2376", "score": "0.42398518", "text": "function Le(t) {\n return t.isFoundDocument() ? t.version : W.min();\n}", "title": "" }, { "docid": "51729fee9efee57ec47e66e9a24f6fe5", "score": "0.4238662", "text": "precondition(t) {\n const e = this.readVersions.get(t.toString());\n return !this.writtenDocs.has(t.toString()) && e ? We.updateTime(e) : We.none();\n }", "title": "" }, { "docid": "6f5648a6ab14c7d74c03c00b198cb3dc", "score": "0.4234053", "text": "function hc_nodedocumentnodetype() {\n var success;\n if(checkInitialization(builder, \"hc_nodedocumentnodetype\") != null) return;\n var doc;\n var nodeType;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"hc_staff\");\n nodeType = doc.nodeType;\n\n assertEquals(\"nodeDocumentNodeTypeAssert1\",9,nodeType);\n \n}", "title": "" }, { "docid": "4843130ba83d9c67891f343f96578d08", "score": "0.4232001", "text": "function tagsToUpdate(typeScriptVersion) {\n // A 2.0-compatible package is assumed compatible with TypeScript 2.1\n // We want the \"2.1\" tag to always exist.\n const idx = allTags.indexOf(`ts${typeScriptVersion}`);\n if (idx === -1) {\n throw new Error();\n }\n return allTags.slice(idx);\n }", "title": "" }, { "docid": "5f84d53d15a17d7298d682c2c0144a63", "score": "0.42228693", "text": "function Ze(t) {\n return t.isFoundDocument() ? t.version : it.min();\n}", "title": "" }, { "docid": "e7ee85f21ef30eb29ad0b3659a8e5ffe", "score": "0.42165452", "text": "function UnknownType(name) {\n _super.call(this);\n this.name = name;\n }", "title": "" }, { "docid": "0160708c3139fe0c0f2a03a973ce254f", "score": "0.42160413", "text": "enterDocumentType(ctx) {\n\t}", "title": "" }, { "docid": "afc95d2f87e35cf87d8c36916f8025e6", "score": "0.42151523", "text": "function loadVersion(requestedVersion) {\r\n version = requestedVersion;\r\n getTriples(version, \"right\");\r\n if (compareMode)\r\n enablePredecessor();\r\n}", "title": "" }, { "docid": "51c1cd691684071fa2dcc3f3e11ef6fe", "score": "0.42106858", "text": "ifNotExists() {\n return new CreateIndexBuilder({\n ...this.#props,\n node: create_index_node_js_1.CreateIndexNode.cloneWith(this.#props.node, {\n ifNotExists: true,\n }),\n });\n }", "title": "" }, { "docid": "406d883ff9192aa23732938553cc795a", "score": "0.42060557", "text": "function getVersion(bookRoot, version) {\n return ensureVersion(bookRoot, version, {\n install: false\n });\n}", "title": "" }, { "docid": "0f092ca4d61f5e75e21d65801c104f6e", "score": "0.41950938", "text": "exitDocumentType(ctx) {\n\t}", "title": "" }, { "docid": "dcee40e7e5c4a6202183034f3bf7638d", "score": "0.41771173", "text": "function ne(e,t,n,r,o,s){const a=new e.Query({},{},e,e.collection);return s&&(s=e.$wrapCallback(s)),n=n instanceof i?n.toObject():F.clone(n),te(r,o=\"function\"==typeof o?o:F.clone(o),I(e,\"schema.options.versionKey\",null)),a[t](n,r,o,s)}", "title": "" }, { "docid": "fac07c85a504be6da2740af0ea4c9643", "score": "0.41764948", "text": "version(p_sVersion) {\n if (!p_sVersion) return p_sVersion;\n\n version = p_sVersion;\n }", "title": "" }, { "docid": "9921dbc4bbc3ca0f1460dcd2c3b3daef", "score": "0.41714907", "text": "function verify(type) {\n\tvar watcher = this,\n\t\toriginal = watcher.file;\n\n\toriginal.changed(function(err, change) {\n\t\tif (err)\n\t\t\twatcher.emit('error', err);\n\t\telse if (change === null) {\n\t\t\twatcher.close();\n\t\t\twatcher.emit('deleted', original);\n\t\t}\n\t\telse if (change) {\n\t\t\twatcher.file = change;\n\t\t\twatcher.emit('changed', type, change, original);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "7dbd8cdec35caf968380dda48bbfdfdf", "score": "0.41694742", "text": "function ensureType(json) {\n if (!json.type) {\n var info = cardinfo.cardFromNumber(json.number);\n if (info) {\n json.type = info.type;\n }\n }\n }", "title": "" }, { "docid": "e86f04e940576b06177eef64017efc03", "score": "0.41619802", "text": "function vset(node, ver, ok) {\n if (ok) {\n if (! node.version_added) {\n // Feature was added in this version\n node.version_added = ver;\n }\n else if (node.version_added && node.version_removed) {\n // Feature was added, removed, now added again. Keep only latest data.\n node.version_added = ver;\n delete node.version_removed;\n }\n }\n else {\n if (node.version_added && ! node.version_removed) {\n // Feature was removed in this version\n node.version_removed = ver;\n }\n }\n}", "title": "" }, { "docid": "6ed714be34e6ddadd03bc6cc0c75ffac", "score": "0.41536626", "text": "async addDefaultVersion() {\n const packagePath = helper.hostPath('package.json');\n const currentPackage = await readJson(packagePath);\n\n if (currentPackage.version) {\n return;\n }\n\n const newPackage = {\n ...currentPackage,\n version: '0.0.1',\n };\n\n await writeJson(newPackage, packagePath);\n }", "title": "" }, { "docid": "3bacb5ba2c877c9ad07dc8f7d12b7170", "score": "0.41525006", "text": "isLockfileEntryOutdated(version, range, hasVersion) {\n return !!(semver.validRange(range) && semver.valid(version) && !(0, (_index || _load_index()).getExoticResolver)(range) && hasVersion && !semver.satisfies(version, range));\n }", "title": "" }, { "docid": "7e11bcaf9ca3506716f6bb593565bbdd", "score": "0.41438013", "text": "function check_version() {\n $.getJSON( \"/api/version\", function(data) {\n if(__version__ != data) { report_update(); }\n });\n }", "title": "" }, { "docid": "e5a227a3e147c8e4ab1ebf477d8c9e7c", "score": "0.41385046", "text": "get type() {\n throw new Error('InternalModelMap.type is no longer available');\n }", "title": "" }, { "docid": "e5a227a3e147c8e4ab1ebf477d8c9e7c", "score": "0.41385046", "text": "get type() {\n throw new Error('InternalModelMap.type is no longer available');\n }", "title": "" } ]
4747a4fbb44c22cdd78d0a53fd88adf5
This returns the first server it can find in the servers section, mainly to support the streetlights tutorial.
[ { "docid": "1cae1aaead74f410bfb26decea60214d", "score": "0.49020654", "text": "function server(asyncapi) {\n return templateUtil.getServer(asyncapi)\n}", "title": "" } ]
[ { "docid": "64b6111f4cfd9d2e48d490c9c97e981f", "score": "0.6570335", "text": "getApiServer() {\n // we may use different servers for different farms (geographical regions)\n // if a server is specified explicitly, use it. otherwise, use farm specific server.\n let server = config.getConfig('appier.server');\n if (!server) {\n const farm = config.getConfig('appier.farm');\n server = API_SERVERS_MAP[farm] || API_SERVERS_MAP['default'];\n }\n return server;\n }", "title": "" }, { "docid": "aed4a513e027bc05ae45250c8b9d5eb7", "score": "0.631521", "text": "function getCurrentServer(sessionInfo) {\r\n console.log('finding current instance of Streisand. . .')\r\n return client.dropletGetAll().then(droplets => {\r\n return droplets.filter(el => {\r\n if (el.name.search('streisand-') !== -1) {\r\n return el.name\r\n }\r\n })\r\n }).then(droplet => {\r\n sessionInfo.old_server = droplet[0];\r\n console.log('The current server is: ' + sessionInfo.old_server.name +\r\n \" \" + sessionInfo.old_server.networks.v4[0].ip_address)\r\n return sessionInfo\r\n }).catch(error => console.error(error))\r\n}", "title": "" }, { "docid": "5e97ae2a04b5ad31074b5f77fd52bf99", "score": "0.6292756", "text": "function findSourceServer(client, shortcode, serverId) {\n const guild = client.guilds.get(serverId);\n if (!guild) {\n return null;\n }\n\n return { shortcode, guild, isSourceServer: true };\n}", "title": "" }, { "docid": "7fb8262f9b8ea0293781a45f05b5569f", "score": "0.62509984", "text": "function getServer() { return server }", "title": "" }, { "docid": "414a1ff87b36f2e17fc34a3abc037c99", "score": "0.6087862", "text": "function getServerURL() {\n var r = httpGet(\"/nmc/rss/server\" + \"?start=0&fmt=json\");\n if (!r) return \"\";\n try {\n var list = parseJson(r); \t\t\t\t// transform json item to object\n } catch (e) {\n return \"\";\n }\n if (itemHasProperty(list, \"error\")) return \"\";\n var itemCount = getReturnedItems(list);\t// item count\n var port1 = getPort(window.location.host);\n for (var i = 0; i < itemCount; i++) { // find the server\n if (isServer(list, i, port1)) return getNMCPropertyText(list, \"item.url\", i);\n }\n return \"\";\n}", "title": "" }, { "docid": "cd52bdb8176dc6abece9c0220c882b0f", "score": "0.60604507", "text": "function selectServer() {\n if (!servers.length) {\n vscode.window.showInformationMessage(\"You don't have any servers\");\n return;\n }\n\n // Show Command Palette with server list of servers\n // Return promise to allow for .then(...)\n return vscode.window.showQuickPick(servers.map(s => s.name), 'Select the server to connect...');\n}", "title": "" }, { "docid": "56d838cb6ca2149a06c1444c6927e88b", "score": "0.6045205", "text": "lastIsMaster() {\n const serverDescriptions = Array.from(this.description.servers.values());\n if (serverDescriptions.length === 0)\n return {};\n const sd = serverDescriptions.filter((sd) => sd.type !== common_1.ServerType.Unknown)[0];\n const result = sd || { maxWireVersion: this.description.commonWireVersion };\n return result;\n }", "title": "" }, { "docid": "93417123280af7c2f84228afead42723", "score": "0.6030929", "text": "GetServer(serviceName) {\n let url = `/dedicated/server/${serviceName}`;\n return this.client.request('GET', url);\n }", "title": "" }, { "docid": "d4498841c9fd34e56b51c1d335abd0f2", "score": "0.60134906", "text": "SecondaryNameServerAvailableForYourServer(serviceName) {\n let url = `/dedicated/server/${serviceName}/secondaryDnsNameServerAvailable`;\n return this.client.request('GET', url);\n }", "title": "" }, { "docid": "1ee2341d396a98dca7031cce2dbe2e12", "score": "0.59916663", "text": "function getServers(serverOrDatacenter) {\n let servers;\n if (Object.keys(constants_js_1.DATACENTERS).includes(serverOrDatacenter)) {\n servers = constants_js_1.DATACENTERS[serverOrDatacenter];\n }\n else if (constants_js_1.SERVERS.includes(serverOrDatacenter)) {\n servers = [serverOrDatacenter];\n }\n else {\n return undefined;\n }\n return servers;\n}", "title": "" }, { "docid": "bee99c44f6731f8c0d77fd547fb52bdf", "score": "0.5967396", "text": "function findServer(data) {\r\n return axios.all(data.map(requestServer)).then(reponses => {\r\n const server = reponses.filter(request => request.online)\r\n .sort((x, y) => x.priority - y.priority);\r\n if (server && server.length) {\r\n //GETTING LEAST PRIORITY SERVER\r\n return server[0];\r\n }\r\n \r\n }).catch(err => {\r\n console.log(\"No Server is online\");\r\n });\r\n}", "title": "" }, { "docid": "4ab17cb87c05430261633648186f9984", "score": "0.59372", "text": "function pickServerSimple(username, servers) {\n\n // hash username\n const hash = utils.hashString(username);\n\n // pick server according to modulo rule\n return servers[hash % servers.length];\n}", "title": "" }, { "docid": "5ff25b044b69e0e6bef55650fab8b727", "score": "0.58741415", "text": "function getServer() {\n let server = \"\";\n if (serverAddr != \"\") {\n server = serverAddr;\n } else {\n let protocol = location.protocol;\n let slashes = protocol.concat(\"//\");\n server = slashes.concat(window.location.host);\n }\n return server;\n}", "title": "" }, { "docid": "e7a840deacde1f122cd01e4d54cfb214", "score": "0.58646107", "text": "get_server(fileid) {\n return this.servers[fileid % this.servers.length];\n }", "title": "" }, { "docid": "32a59f848b067604afb4355b455c71ec", "score": "0.585959", "text": "function getGuild(guildID){\r\n\tfor(let n=0;n<serverSettings.servers.length;n++){\r\n\t\tif(guildID===serverSettings.servers[n].id){\r\n\t\t\treturn n;\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "ef844c31bb76fe5ca2ddcb4a2351c910", "score": "0.5853348", "text": "getServerById(serverId) {\n return this._allServersById.get(serverId);\n }", "title": "" }, { "docid": "b009b12a698de661d7dfe8686dc101cb", "score": "0.5841782", "text": "function _getOCRServer() {\n\t\tvar $dfd = $.Deferred();\n\t\tif (isFirefox) {\n\t\t\tbrowser.runtime.sendMessage({\n\t\t\t\tevt: 'get-best-server'\n\t\t\t}).then(function (response) {\n\t\t\t\t$dfd.resolve(response.server.id);\n\t\t\t});\n\t\t} else {\n\t\t\tbrowser.runtime.sendMessage({\n\t\t\t\tevt: 'get-best-server'\n\t\t\t}, function (response) {\n\t\t\t\t$dfd.resolve(response.server.id);\n\t\t\t});\n\t\t}\n\t\treturn $dfd;\n\t}", "title": "" }, { "docid": "b839ac86f6638e2df6c2686dffa6bb98", "score": "0.58146864", "text": "getSyncServer() {\n return this.isConnected() ? this.peers()[0] : null;\n }", "title": "" }, { "docid": "2ede1a0667b415807dc444a4318d3d09", "score": "0.5798458", "text": "function discoverServer(){\n\t\tif (util.serverurl) {\n\t\t\tvar service = {\n\t\t\t\t\"resolve\" : function(){},\n\t\t\t\t\"name\"\t : util.serverurl,\n\t\t\t\t\"socket\" : ambientModule.module.createTCPSocket({\n\t\t\t\t\t\t\t\thostName:util.serverurl,\n\t\t\t\t\t\t\t\tport:util.serverport,\n\t\t\t\t\t\t\t\tmode:util.rw_mode \n\t\t\t\t\t\t\t})\n\t\t\t};\n\t\t\t\n\t\t\tconnectionManager.addConnection(service);\n\t\t}\t\t\n\t}", "title": "" }, { "docid": "b6f93b0ab911d06db4c92c7e7545ce31", "score": "0.5783342", "text": "async function getServers() {\n const guid = (Math.random() * 100000 + 10000).toFixed(0);\n const query = querystring_1.stringify({ guid });\n const httpResult = await http_client_1.get(endpoints_1.Endpoints.CharList + `?${query}`);\n const result = httpResult.toString();\n const servers = {};\n let match = SERVER_REGEX.exec(result);\n while (match !== null) {\n const name = match[1];\n const address = match[2];\n servers[name] = {\n name, address,\n };\n match = SERVER_REGEX.exec(result);\n }\n return servers;\n}", "title": "" }, { "docid": "04ab4e64cae7f93d905b2271f56cd420", "score": "0.57662153", "text": "function getPossibleServerName(str) {\n for (let i = str.length - 1; 1 <= i; --i) {\n const c = str.charAt(i)\n if (c === c.toUpperCase()) {\n return str.substring(i, str.length)\n }\n }\n return null\n }", "title": "" }, { "docid": "09ae0c693ba88355f18e424d5d2b0b9f", "score": "0.56900233", "text": "get server() {\n return this.configuration.server;\n }", "title": "" }, { "docid": "83311b266bb50da1b48f66032e8fd9ed", "score": "0.5686352", "text": "function firstWindowClient() {\n return clients.matchAll({ type: 'window' }).then(function(windowClients) {\n return windowClients.length ? windowClients[0] : Promise.reject(\"No clients\");\n });\n}", "title": "" }, { "docid": "67ee00195a1d59196e5f06caad6f74cb", "score": "0.55811536", "text": "function findMirrorServer(client, serverId) {\n const guild = client.guilds.get(serverId);\n if (!guild) {\n return null;\n }\n\n return { guild, isMirrorServer: true };\n}", "title": "" }, { "docid": "1010cb494595940fdf79fc5b3d3293b3", "score": "0.5556913", "text": "getServerId() {\n\t \treturn this.serverId;\n\t }", "title": "" }, { "docid": "cb0c3c9140c48d08de41d887a6ae6b61", "score": "0.5546598", "text": "function getServerName() {\n var filepath = window.location.toString();\n var pattern = /\\/\\/([^\\/]+)\\/?/;\n var result = filepath.match(pattern);\n if (result != null) {\n return result[1];\n }\n}", "title": "" }, { "docid": "347ade2659a4998e8568fd90c3c7e8b2", "score": "0.55363697", "text": "function getServerName() {\n var glob = require(\"glob\")\n files = glob.sync(getTempPath()+\"/Server/*\");\n if (files[0]) {\n var dirName = files[0].split(\"/\")[files[0].split(\"/\").length - 1];\n return dirName;\n }\n }", "title": "" }, { "docid": "957031a6755bb1a2f2be13b3cf138840", "score": "0.55345684", "text": "function getGame(req, res){\n console.log(req.params.id);\n var server = serverList.getServer(req.params);\n if (server === undefined){\n res.sendStatus(404);\n } else {\n res.json(server.toJson());\n }\n}", "title": "" }, { "docid": "0594b9bf5a12d5e9fed61946a1c51c35", "score": "0.55313057", "text": "function findClient(sckt){\n\tvar room;\n\tvar argR = new Array(3);\n\tfor(j = 0; j < localFiles.length; j++){\n\t\troom = localFiles[j];\n\t\tfor(i=0; i < 20; i++){\n\t\t\tvar target = rooms[room][i];\n\t\t\tif(target && target != \"*\"){ //target !null\n\t\t\t\tif(target.sckt == sckt){\n\t\t\t\t\targR[0] = room;\n\t\t\t\t\targR[1] = i;\n\t\t\t\t\targR[2] = rooms[room][i].type;\n\t\t\t\t\treturn argR;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn -1;\n}", "title": "" }, { "docid": "e7bd0da63bf955e89859eff63a2d7e49", "score": "0.55030984", "text": "static get defaultIceServers() {\n return defaultServers;\n }", "title": "" }, { "docid": "340f68bf9d3a2c25d9cf948aef18a78d", "score": "0.5490389", "text": "get server (): Server {\n return this._server\n }", "title": "" }, { "docid": "9cee3ba0d95c5d49f9ed9bfdd412ae58", "score": "0.5481461", "text": "function getCrtServer() {crtPage.search(/http:\\/\\/(.*)\\//); TB3O.fullServerName = RegExp.$1; TB3O.gServer = TB3O.fullServerName.replace(/\\.travian\\./,''); return;}", "title": "" }, { "docid": "6aadfbd2323434b95f977cdb42603ecf", "score": "0.54576904", "text": "function discoverMeshServer() { console.log('Looking for server...'); discoveryInterval = setInterval(discoverMeshServerOnce, 5000); discoverMeshServerOnce(); }", "title": "" }, { "docid": "acb7dbb3868d20322167491515a38eb5", "score": "0.5450336", "text": "function findServer() {\n return new Promise((resolve, reject) => {\n for (let i in nginxArray) {\n console.log('Finding if the server is free ', nginxArray[i][Object.keys(nginxArray[i])[0]]);\n if (nginxArray[i][Object.keys(nginxArray[i])[0]] == \"free\") {\n freeServer = [Object.keys(nginxArray[i])[0]]\n resolve(freeServer);\n break;\n } else {\n console.log('Server ' + Object.keys(nginxArray[i])[0] + ' is busy');\n }\n }\n })\n}", "title": "" }, { "docid": "5bd4761f8a197358a641a5584fba37e0", "score": "0.544837", "text": "getCleanedServer(srv) {\n const strId = srv['id'].toString();\n return {\n 'id': strId,\n 'name': srv.name || strId,\n 'ip-addr': srv['ip-addr'],\n 'mac-addr': srv['mac-addr'] || '',\n 'role': srv['role'] || '',\n 'server-group': srv['server-group'] || '',\n 'ilo-ip': srv['ilo-ip'] || '',\n 'ilo-user': srv['ilo-user'] || '',\n 'ilo-password': srv['ilo-password'] || '',\n 'nic-mapping': srv['nic-mapping'] || ''\n };\n }", "title": "" }, { "docid": "dce460e08ccec2a0df4a30837c11f308", "score": "0.5411714", "text": "function getFirstAddress(name){\n let client = clients.find(client => client.name === name );\n return client.addresses[0];\n}", "title": "" }, { "docid": "5dacbae77cf24dd8791e988ef4b9df5e", "score": "0.5405634", "text": "searchForPartner(socket) {\n let usersId = Object.keys(this.waitingList);\n if (usersId.length === 0) {\n return null;\n }\n else {\n //currently just get any random player available\n //TODO - change the search mechanism\n let firstUserId = usersId[0];\n let partner = this.waitingList[firstUserId];\n return partner;\n }\n }", "title": "" }, { "docid": "b937ce815e35ce221d9f0f1f6527a931", "score": "0.53938735", "text": "getPrimaryServerNodeId() {\n\t \treturn this.primaryServerNodeId;\n\t }", "title": "" }, { "docid": "5ef6ceeed1dc9f811a86fe94f5a72b4b", "score": "0.53932804", "text": "function getServerName() {\n return new Promise((resolve, reject) => {\n if (program.server) {\n if ((program.serverSave) || (program.save))\n {\n config.users[config.index].server = program.server;\n console.log(chalk.cyan(program.server) + \" is now the default server URL/IP.\");\n fs.writeFileSync(path, JSON.stringify(config.users, null, 2));\n }\n resolve([\"-s\", program.server]);\n }\n else {\n if (config.users[config.index].server) {\n resolve([\"-s\", config.users[config.index].server]);\n return;\n }\n console.log(chalk.green(\"No Websocket URL/IP Address Has Been Set.\"))\n rl.question('Websocket Server URL/IP: ', answer => {\n if (answer.length) {\n rl.question('Save As Default Websocket URL/IP (Y/N)? ', saveAnswer => {\n if (saveAnswer.toUpperCase() === 'Y') {\n config.users[config.index].server = answer;\n console.log(chalk.cyan(answer) + \" is now the default server URL/IP.\");\n fs.writeFileSync(path, JSON.stringify(config.users, null, 2));\n }\n resolve(['-s', answer]);\n });\n }\n else\n reject('Need to enter valid URL/IP Address!');\n });\n }\n });\n}", "title": "" }, { "docid": "b2cc08e3c27ccd7d56a3d3a4ed404e34", "score": "0.53791004", "text": "static get AbstractServer() {\n\t\treturn AbstractServer;\n\t}", "title": "" }, { "docid": "c42fd40132aa46eb90db954628160d00", "score": "0.5361515", "text": "function GetServerName(){\r\n\tvar ServerName = \"\";\r\n\tvar sentenceIni = window.location.href;\r\n\tvar sentence1 = \"http://\";\r\n\tvar sentence2 = \"/game/\";\r\n\tvar pos1 = sentenceIni.indexOf(sentence1,0);\r\n\tif (pos1 >= 0 ){\r\n\t\tvar pos2 = sentenceIni.indexOf(sentence2,pos1+sentence1.length);\r\n\t\tServerName = sentenceIni.substring(pos1+sentence1.length,pos2);\r\n\t}\r\n\t//alert(ServerName);\r\n\treturn ServerName;\r\n}", "title": "" }, { "docid": "81e0c57f4a55d58db15ef4a01926f970", "score": "0.5357036", "text": "function findMinWeightServer(serverWeight, index){\n\n //find the first element that is not excludeserver\n function firstMin(serverWeight){\n return serverWeight !== index;\n }\n var min = serverWeight.find(firstMin);\n\n //find the min index that is not exclude server\n for (i = 0; i < serverWeight.length; i++){\n //setting the first element in an array\n if (serverWeight[i] !== index){\n if(serverWeight[i] < min){\n min = serverWeight[i];\n }\n }\n }\n return serverWeight.indexOf(min);\n}", "title": "" }, { "docid": "d6d2dfa1b9ebfb4fb64c73714c24c688", "score": "0.53519636", "text": "function GetServerName(){\n var ServerName = \"\";\n var sentenceIni = window.location.href;\n var sentence1 = \"http://\";\n var sentence2 = \"/game/\";\n var pos1 = sentenceIni.indexOf(sentence1,0);\n if (pos1 >= 0 ){\n var pos2 = sentenceIni.indexOf(sentence2,pos1+sentence1.length);\n ServerName = sentenceIni.substring(pos1+sentence1.length,pos2);\n }\n //alert(ServerName);\n return ServerName;\n}", "title": "" }, { "docid": "41495035c2ad7782b329d6c373b839ae", "score": "0.53305596", "text": "function discoverMeshServerOnce() {\n var interfaces = os.networkInterfaces();\n for (var adapter in interfaces) {\n if (interfaces.hasOwnProperty(adapter)) {\n for (var i = 0; i < interfaces[adapter].length; ++i) {\n var addr = interfaces[adapter][i];\n multicastSockets[i] = dgram.createSocket({ type: (addr.family == \"IPv4\" ? \"udp4\" : \"udp6\") });\n multicastSockets[i].bind({ address: addr.address, exclusive: false });\n if (addr.family == \"IPv4\") {\n try {\n multicastSockets[i].addMembership(membershipIPv4);\n //multicastSockets[i].setMulticastLoopback(true);\n multicastSockets[i].once('message', OnMulticastMessage);\n multicastSockets[i].send(settings.serverid, 16989, membershipIPv4);\n } catch (e) { }\n }\n }\n }\n }\n}", "title": "" }, { "docid": "2bb11ba389086b452e7e038796a80032", "score": "0.5315672", "text": "function showServerByTag(req, res){\n sq.Server.find({}, {type:1}, function(err, servers) {\n if (err) return next(err);\n var tags = _.select(_.uniq(_.flatten(_.pluck(servers,'type')).sort(), true), function(word){\n return (word.indexOf(req.params.tag) != -1)?true:false\n })\n res.send(tags)\n });\n }", "title": "" }, { "docid": "dda864b0b184c7a0ebfd13a0a645c727", "score": "0.53045875", "text": "function retrieveServerID() {\n \tvar retrieveServerID = bot.channels[channelID].guild_id;\n\t\t//TO-DO: create function that returns serverID\n\t\treturn retrieveServerID;\n\t}", "title": "" }, { "docid": "b408cea5a8ec990159b43c7481d02557", "score": "0.52680457", "text": "function getClientPlayer() {\n for (let index in players) {\n let player = players[index];\n if (player.isClientPlayer) return player;\n }\n}", "title": "" }, { "docid": "61db63cabc57871021c97fcef8454ffc", "score": "0.52584386", "text": "function getHost(node){\n return config.statsdServers[parseInt(crc32.calculate(node) % config.statsdServers.length,10)];\n\n}", "title": "" }, { "docid": "37e810eb63188e558d62d621e441c7a2", "score": "0.52372885", "text": "function findOptimalServer(serverWeight, index){\n console.log('index: ', index);\n var idu = checkUndefinedServer(serverWeight);//returns true if there is atleast one undefined else, returns false\n\n var idex = checkExcludedServer(serverWeight, index);//returns true if there is one excluded server\n console.log('idex val: ', idex);\n //All servers are up, this code block gets executed\n if(idu === true){//this scenario arises when server starts up\n x = preferredServer;\n console.log('Atleast one server undefined- var x:', x);\n }\n else if(idex === false){//when all servers up\n var ide = checkEqualityOfServer(serverWeight, index);\n if (ide === true){\n x = Math.floor(Math.random() * serverWeight.length);\n console.log('All servers up. Random server- var x', x);\n }\n else{\n x = serverWeight.indexOf(Math.min.apply(Math, serverWeight));\n if (x === -1){\n x = preferredServer;\n console.log('All servers up. Min weight server- var x=-1', x);\n }\n else\n console.log('All servers up. Min weight server- var x', x);\n }\n }\n //one or more server goes down, this code block gets executed\n else if(idex === true){\n\n ide = checkEqualityOfServer(serverWeight, index);\n if (ide === true){\n x = findRandomServer(serverWeight, index);\n console.log('one or more servers down. Random server- var x', x);\n }\n else{\n x = findMinWeightServer(serverWeight, index);\n if (x === -1){\n x = preferredServer;\n console.log('one or more servers down. Min weight server- var x=-1', x);\n }\n else{\n console.log('one or more servers down. Min weight server- var x', x);\n }\n }\n }\n else\n console.log('No Additional conditions found as of now.');\n\n return x;\n}", "title": "" }, { "docid": "289f3eef61082e671b6e18edddd931ed", "score": "0.52363104", "text": "function select_guild() {\n let guild_list = client.guilds.array();\n let guild_names = client.guilds.array().map(g => g.name);\n\n return guild_list[select_item(guild_names)];\n}", "title": "" }, { "docid": "521c104573fd7cfa7bbb3369a1f6dc70", "score": "0.5225679", "text": "function YWireless_FirstWireless()\n {\n var next_hwid = YAPI.getFirstHardwareId('Wireless');\n if(next_hwid == null) return null;\n return YWireless.FindWireless(next_hwid);\n }", "title": "" }, { "docid": "0e791414dd06b51b8f71d7b62736bbbb", "score": "0.5203915", "text": "function getServers() {\r\n if (!store.storage.servers)\r\n store.storage.servers = [];\r\n return store.storage.servers;\r\n}", "title": "" }, { "docid": "cc0f1d947e4acf17233a4fb1e688cf73", "score": "0.5194578", "text": "hasServer() {\n return Boolean(this.tcpServer);\n }", "title": "" }, { "docid": "b7fa0d0a5ac79b4ed3c8cf1cb7944ce6", "score": "0.5191676", "text": "function InitServers(){\n if(gs){\n var srv = gs.os.getEnvironmentVariable('GS5_CHECKPOINT_SERVER'); \n //console.log('GS5_CHECKPOINT_SERVER => ' + srv);\n if(srv){\n checkPointServers = []; //override existent settings\n checkPointServers[0] = {\n Name: 'server_0',\n URL: srv + '/checkpoint2/CheckPointService.svc/GenerateResponseCode?callback=?',\n Tries: 0,\n MaxTries: 5,\n TimeOut: 15000\n }\n\n return;\n } \n } \n \n if(typeof checkPointServers === 'undefined'){\n //UI_HTML/js/GS_Mapping.js is missing, fall backs to built-in servers\n checkPointServers = [];\n ['https://shield.yummy.net', 'https://secure.yummy.net'].forEach(function(srv, i){\n checkPointServers.push({\n Name: 'server_' + i,\n URL: srv + '/checkpoint2/CheckPointService.svc/GenerateResponseCode?callback=?',\n Tries: 0,\n MaxTries: 5,\n TimeOut: 15000\n });\n });\n }\n }", "title": "" }, { "docid": "f1326494b1617ae3ad3bc95c5e6f6c8d", "score": "0.51849425", "text": "function getClient() {\r\n return clients[numberbetween(clients.length)];\r\n}", "title": "" }, { "docid": "5ab0f5cd5041da20b825aed357c93a20", "score": "0.5178139", "text": "function getServerUrl() {\r\n return (\r\n \"http\" +\r\n (location.hostname == \"localhost\" ? \"\" : \"s\") +\r\n \"://\" +\r\n location.hostname +\r\n (location.hostname == \"localhost\" ? \":\" + serverPort : \"\")\r\n );\r\n}", "title": "" }, { "docid": "a78fb409252a75ba73c19bd6edfb50b0", "score": "0.5175282", "text": "function getServers() {\r\n let fdb = new jsondb(DB, true, true);\r\n try { var json = fdb.getData('/server') }\r\n catch(err) {\r\n return LOGGER.log('API request for data, but no data is available.',i);\r\n }\r\n Object.keys(json).forEach(function(k) {\r\n json[k] = json[k]['name']; //key is id, value is name\r\n });\r\n return json;\r\n}", "title": "" }, { "docid": "971f88d6aa1e6b1c88defd237f17f47f", "score": "0.5143275", "text": "getServerConfiguration() {\n\t\treturn config.get(\"domino.server\");\n\t}", "title": "" }, { "docid": "006bf4ad3788d8a4a47406bb39e14a50", "score": "0.512306", "text": "function findRandomServer(serverWeight, indexServer){\n\n //find the random index first.lets say, x;\n x = Math.floor(Math.random() * serverWeight.length);\n //\n while (serverWeight[x] === indexServer){//index can be includeServer or excludeServer, if equals, then calculate index again else, exit.\n x = Math.floor(Math.random() * serverWeight.length);\n }\n return x;\n}", "title": "" }, { "docid": "ec911de1e8652c3a1817471930bde7d9", "score": "0.5115925", "text": "function tryAndSeparatePlayerFromServer(playerName, datacenter) { //TODO rewrite description\n const result = { datacenter: datacenter, playerName: null, serverName: null, found: false }\n\n if (playerName === null)\n return result\n\n const names = playerName.split(' ')\n\n if (names.length !== 2) //player have always first and last name, unfortunately, the server is joined to the last name\n return result\n\n //returns the last part of a given string, which starts with an uppercase letter and is shorter than the given string\n function getPossibleServerName(str) {\n for (let i = str.length - 1; 1 <= i; --i) {\n const c = str.charAt(i)\n if (c === c.toUpperCase()) {\n return str.substring(i, str.length)\n }\n }\n return null\n }\n\n const lastName = names[names.length - 1]\n const serverName = getPossibleServerName(lastName)\n\n if (serverName === null) //doesn't have anything that may be a server\n return result\n\n if (!result.datacenter) {\n result.datacenter = Gobchat.DatacenterHelper.tryAndGetDatacenterByServerName(serverName)\n }\n\n if (result.datacenter === null) // wasn't a server or we just failed to find it\n return result\n\n if (_.includes(result.datacenter.servers, serverName)) {\n result.playerName = playerName.substring(0, playerName.length - serverName.length)\n result.serverName = serverName\n result.found = true\n }\n\n return result\n }", "title": "" }, { "docid": "92cebef2b21708f702ef63457386a05f", "score": "0.5104873", "text": "function shouldBecomeNextServer() {\n\t\tlet successors = env.state.successors;\n\t\tlet should = false;\n\t\tif (!successors.length) { // If there are no successors, just check the server role flag\n\t\t\tshould = hasServerRole();\n\t\t} else { // If there are successors, check if I'm the first one\n\t\t\tshould = successors[0] === env.clientId;\n\t\t}\n\t\tShippy.Util.log('Should become server? ' + should);\n\t\treturn should;\n\t}", "title": "" }, { "docid": "94fdbcf1fce679081741a61f3de90ccf", "score": "0.5064819", "text": "serverInfo() {\n return {\n header: CLIENTBOUND_HEADERS.serverInfo,\n kind: CLIENTBOUND_KINDS.serverInfo,\n data: {\n gamemode: this.stringNT(),\n serverUUID: this.stringNT(),\n hostRegion: this.stringNT()\n },\n raw: this.buffer\n };\n }", "title": "" }, { "docid": "9de0213738559a6d28e3cfe3e8bbb1df", "score": "0.50596946", "text": "function firstMin(serverWeight){\n return serverWeight !== index;\n }", "title": "" }, { "docid": "93bfeb14870768d24c93ab53abc236e7", "score": "0.5043322", "text": "function getPWServerName()\n{\n\tif (ISNULL(Phoneweb)){\n\t\tif (session.com.voicegenie.telephone.primarychan.length == 22){\n\t\t\tPhoneweb = _VGGetInfo('host_ip');\n\t\t}\n\t\telse{\n\t\t\tPhoneweb = session.com.voicegenie.instance.myself;\n\t\t\tif((i = Phoneweb.indexOf(\"$\")) != -1 ) {\n\t\t\t\tPhoneweb = Phoneweb.substring( 0, i);\n\t\t\t}\n\t\t}\n\t}\n\n return Phoneweb;\n}", "title": "" }, { "docid": "d09a70acd110f8c0268543a360c3e754", "score": "0.50224566", "text": "function getServerIP() {\n\tif(server_ips == null) {\n\t\treturn new Array();\n\t} else {\n\t\treturn server_ips;\n\t}\n}", "title": "" }, { "docid": "71f1a90eb7a84dc4dc3e2f793e49aeae", "score": "0.5013481", "text": "async firstOrDefault(){\n var client = new Client({\n user: this.database.username,\n host: this.database.hostname,\n database: this.database.databaseName,\n password: this.database.password,\n port: 5432,\n });\n let query = this.generateSelectQuery();\n \n await client.connect()\n var res = await client.query(query.string, query.params);\n await client.end();\n // after we preforema query we need to reset the query state \n this.resetQueryState();\n // before returning them we need to save the \"current state\" of them in the db for update changes\n this.initalState(res.rows);\n \n return res.rows[0];\n }", "title": "" }, { "docid": "848d056c7c283b4ed4d3fc3ac54adae8", "score": "0.49948674", "text": "async function checkJoinedServer(serverID){\r\n\tnoobJoined=\"unknownServer\", memberIsSpoofer=\"no\";\r\n\t\r\n\t// CHECK IF SERVER JOINED IS MY SERVER\r\n\tif(serverID===myServer.id){\r\n\t\tnoobJoined=myServer.name;\r\n\t}\r\n\r\n\t// IF NOT MY SERVER CHECK JSON FILE\r\n\telse{\r\n\t\tawait spoofServers.forEach(async server=>{\r\n\t\t\tif(serverID===server.id){\r\n\t\t\t\tnoobJoined=await server.name;\r\n\t\t\t\tmemberIsSpoofer=await \"yes\";\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t\r\n\t// SEND DATA BACK TO VARIABLE\r\n\treturn await noobJoined;\r\n}", "title": "" }, { "docid": "d7d4c594c15e83d11691963fc1e28723", "score": "0.49927345", "text": "function getIPFromCtl(controlServerName){\n var IPofCtlServer = {publicIP:\"\",\n privateIP:\"\"}\n if (controlServerName!=\"\"){\n var part = controlServerName.split(\"_\")\n selectedId = part[part.length-1]\n }else{\n selectedId = -1\n }\n\n for (var item in recordControlServer){\n if(recordControlServer[item].Id == selectedId){\n IPofCtlServer.publicIP=recordControlServer[item].PubIp\n IPofCtlServer.privateIP=recordControlServer[item].PriIp\n }\n }\n return IPofCtlServer\n}", "title": "" }, { "docid": "11851b38d6eb96a06830fb2b49ae5208", "score": "0.49799076", "text": "function whoGoesFirst() {\n\t// setting this to player for now.\n\tvar choices = ['player', 'computer'];\n\tvar chosen = choices[Math.floor(Math.random() * choices.length)];\n\n\treturn chosen;\n}", "title": "" }, { "docid": "a1551be0403ae2924773803320e748ba", "score": "0.49752557", "text": "function selectRefillStation(truck) {\n return config.services[truck.getProp(\"service\")][\"base\"][0] // take first one for now\n}", "title": "" }, { "docid": "b43947c9a9ea4abe0a5fade6fb7be968", "score": "0.49635383", "text": "getPingableMember () {\n const pingableMembers = this.getNextMembers([this.sdswim.me], 1)\n if (!pingableMembers.length) {\n return // no candidates\n }\n return pingableMembers[0]\n }", "title": "" }, { "docid": "e16d6b666dca4a49f04b9067e0fc9875", "score": "0.49581787", "text": "function getClient() {\n // Our load balancing strategy is just a counter which wraps around the length of the clients\n const client = constants.clients[constants.clientIndex];\n constants.clientIndex = ++constants.clientIndex % constants.clients.length;\n\n if (!client) {\n console.log(\"Could not find an available client.\");\n process.exit(1);\n }\n\n return client;\n}", "title": "" }, { "docid": "2bfe2e1244bb8275a250e1dba09f573f", "score": "0.49578083", "text": "function loadServers() {\n document.getElementById(\"select_server\").innerHTML = \"\";\n requestJSON(\"GET\", \"/api/server\", null, populateServerSelect, requestError);\n\n function populateServerSelect(req) {\n var select = document.getElementById('select_server')\n var data = req.data.servers;\n\n for(i in data) {\n var server_option = document.createElement(\"option\");\n server_option.value = data[i][1]\n server_option.textContent = data[i][0]\n\n select.appendChild(server_option);\n }\n\n }\n\n function requestError(req) {\n alert(\"Couldn't load servers...\")\n }\n}", "title": "" }, { "docid": "7bf0f96cfbe55be851ea0a3bfc751281", "score": "0.49484324", "text": "addServer(server) {\n if (typeof server !== 'string') return;\n server = server.trim();\n if (server && this.servers.indexOf(server) === -1) {\n this.servers.push(server);\n }\n }", "title": "" }, { "docid": "1ded7ea8453e4f848dd2f2e5d7a9e48e", "score": "0.49226665", "text": "function getServerHost() {\n return process.env[`${getServerStub()}_HOST`] || defaultHost;\n}", "title": "" }, { "docid": "b2792f4423db61fa8b5279d9c2694b7f", "score": "0.49126577", "text": "function pickServerRendezvous(username, servers) {\n let maxServer = null;\n let maxScore = null;\n\n // loop through all servers\n for (const server of servers) {\n\n // calculate score for server\n const score = utils.computeScore(username, server);\n\n // keep updating the maxScore and the server associated with that maxScore\n if (maxScore === null || score > maxScore) {\n maxScore = score;\n maxServer = server;\n }\n }\n\n return maxServer;\n}", "title": "" }, { "docid": "16b32e2c1fdac81a96d96f0e7a46581e", "score": "0.4894137", "text": "function getServer(rootPath, mode) {\n var d = new $.Deferred();\n\n _nodeConnectionDeferred.done(function (nodeConnection) {\n if (nodeConnection.connected()) {\n nodeConnection.domains.theseusServer.getServer(rootPath, mode, \"thirdparty|node_modules\").done(function (address) {\n d.resolve({\n address: address.address,\n port: address.port,\n proxyRootURL: \"http://\" + address.address + \":\" + address.port + \"/\"\n });\n }).fail(function () {\n d.reject();\n });\n } else {\n // nodeConnection has been connected once (because the deferred\n // resolved, but is not currently connected).\n //\n // If we are in this case, then the node process has crashed\n // and is in the process of restarting. Once that happens, the\n // node connection will automatically reconnect and reload the\n // domain. Unfortunately, we don't have any promise to wait on\n // to know when that happens.\n d.reject();\n }\n }).fail(function () {\n d.reject();\n });\n\n return d.promise();\n }", "title": "" }, { "docid": "4d8024d39436ec11869e2031a683111f", "score": "0.48595405", "text": "function getMaster(cluster) {\n if (!cluster) {\n cluster = mainCluster;\n }\n if (cluster.master &&\n _.contains(cluster.nodes, cluster.master)) {\n return cluster.master;\n }\n return;\n}", "title": "" }, { "docid": "3f57fd0ed1634c01f2b29bf61f4f14e7", "score": "0.4851025", "text": "function initServing() {\n populateInfoPane();\n if (isServing == '3D') {\n init3DServing();\n } else if (isServing == '2D') {\n // Issue asynchronous HTTP request to get serverDefs setting init2DServing\n // as callback-function which will be triggered when request finished.\n getServerDefinitionAsync(GEE_SERVER_URL, true, init2DServing);\n } else if (isServing == undefined) {\n document.getElementById('NoMap').style.display = 'block';\n }\n}", "title": "" }, { "docid": "40e02b22a7aa2d8a774b4035113465e9", "score": "0.48473546", "text": "hasServer() {\n return Boolean(this.httpServer);\n }", "title": "" }, { "docid": "84a40f0a780a477a6e237875e9cdf0f7", "score": "0.48456493", "text": "function findPlayerObject(squeezeserver, players, name) {\n\n name = normalizePlayer(name);\n console.log(\"In findPlayerObject with \" + name);\n\n // Look for the player in the players list that matches the given name. Then return the corresponding player object\n // from the squeezeserver stored by the player's id\n\n // NOTE: For some reason squeezeserver.players[] is empty but you can still reference values in it. I think it\n // is a weird javascript timing thing\n\n for (var pl in players) {\n if (\n players[pl].name.toLowerCase() === name || // name matches the requested player\n (name === \"\" && players.length === 1) // name is undefined and there's only one player,\n // so assume that's the one we want.\n ) {\n return squeezeserver.players[players[pl].playerid];\n }\n }\n\n console.log(\"Player %s not found\", name);\n}", "title": "" }, { "docid": "63bd16314652ccdae4d540de6673ac32", "score": "0.48442134", "text": "async function getServerData() {\n return {\n games: ['Warcraft 2 BNE']\n }\n}", "title": "" }, { "docid": "24a4790bdf8405b1a63189dd6797bdb9", "score": "0.48327947", "text": "function getCurrServ(worker) {\r\n worker.port.emit('init', {\r\n servers: getServers(),\r\n YTresolution: prefs.ytresolution,\r\n textbtnDEL: _(\"Delete\"),\r\n textbtnEDIT: _(\"Edit\")\r\n });\r\n}", "title": "" }, { "docid": "c73e1e7b38d89e80baf1b9a4b9a32e26", "score": "0.4832014", "text": "get(name) {\n if (typeof name === 'string')\n return this.servers.get(name) || null;\n if (name instanceof ClientSocket_1.ClientSocket)\n return name;\n throw new TypeError('Expected a string or a ClientSocket instance.');\n }", "title": "" }, { "docid": "ee52507a99bbd01b46a5f2281f20bcba", "score": "0.48320037", "text": "function get_machine(serverID) {\n return synnefo.storage.vms.get(serverID).attributes;\n}", "title": "" }, { "docid": "e0b92abdeb3c0d43328929898e7cc49a", "score": "0.48312655", "text": "function getSingleClient(paramName, paramValue){\r\n for(var i = 0;i < users.length;i++){\r\n if(users[i][paramName] == paramValue){\r\n return [users[i], i];\r\n }\r\n }\r\n \r\n return null;\r\n}", "title": "" }, { "docid": "8053aba368740ac1832407662d6c1246", "score": "0.48134315", "text": "async function findPort(server) {\n let newArray = services[appName]\n for (let i in newArray) {\n console.log('Finding if the port ' + newArray[i] + 'is free');\n //Shell script connectPort.sh takes a port as argument and returns code based on it is free or not\n let codeFromShellScript = await shell.exec('sudo sh ./connectPort.sh' + \" \" + newArray[i]).code\n if (codeFromShellScript == 0) {\n return newArray[i];\n break;\n } else {\n continue;\n }\n }\n}", "title": "" }, { "docid": "52db5758c93c5696b50d92e631b89a9c", "score": "0.48111817", "text": "GetServer() {\n // Make the HTTP request:\n this.http.get('http://localhost:8081/ping')\n .map((res) => res.json())\n .catch((error) => Observable_1.Observable.throw(error.json().error || 'Server error'));\n }", "title": "" }, { "docid": "e23a2df8093853f06885951c83428c2a", "score": "0.48001024", "text": "function first()\n {\n ip = false;\n if (forms.length > 0) {\n var x = 0;\n for (x in forms) {\n\n if (forms[x]) {\n ip = x;\n return true;\n }\n }\n return false;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "93efef39fc8605384bd38a1eda08fb2f", "score": "0.47948933", "text": "async function prememberCheck(memberID,serverID,serverName){\r\n\tcorrectServer='';\r\n\ttry{\r\n\t\tnoobFound = await bot.guilds.cache.get(serverID).members.fetch(memberID);\r\n if(noobFound.user.id===memberID){\r\n\t\t\tcorrectServer=serverName;\r\n }\r\n }\r\n\r\n catch(error){\r\n\t\tcorrectServer = '';\r\n }\r\n\r\n\treturn correctServer;\r\n}", "title": "" }, { "docid": "6ea4e2c830526f31d8de4acfd9b212f4", "score": "0.47925934", "text": "function getSocket() {\n\n var candidates = [];\n\n this.sockets.forEach(function(socket) {\n if (socket.status === C.SOCKET_STATUS_ERROR) {\n return; // continue the array iteration\n } else if (candidates.length === 0) {\n candidates.push(socket);\n } else if (socket.weight > candidates[0].weight) {\n candidates = [socket];\n } else if (socket.weight === candidates[0].weight) {\n candidates.push(socket);\n }\n });\n\n if (candidates.length === 0) {\n // all sockets have failed. reset sockets status\n this.sockets.forEach(function(socket) {\n socket.status = C.SOCKET_STATUS_READY;\n });\n\n // get next available socket\n getSocket.call(this);\n return;\n }\n\n var idx = Math.floor((Math.random()* candidates.length));\n this.socket = candidates[idx].socket;\n}", "title": "" }, { "docid": "6ea4e2c830526f31d8de4acfd9b212f4", "score": "0.47925934", "text": "function getSocket() {\n\n var candidates = [];\n\n this.sockets.forEach(function(socket) {\n if (socket.status === C.SOCKET_STATUS_ERROR) {\n return; // continue the array iteration\n } else if (candidates.length === 0) {\n candidates.push(socket);\n } else if (socket.weight > candidates[0].weight) {\n candidates = [socket];\n } else if (socket.weight === candidates[0].weight) {\n candidates.push(socket);\n }\n });\n\n if (candidates.length === 0) {\n // all sockets have failed. reset sockets status\n this.sockets.forEach(function(socket) {\n socket.status = C.SOCKET_STATUS_READY;\n });\n\n // get next available socket\n getSocket.call(this);\n return;\n }\n\n var idx = Math.floor((Math.random()* candidates.length));\n this.socket = candidates[idx].socket;\n}", "title": "" }, { "docid": "6ea4e2c830526f31d8de4acfd9b212f4", "score": "0.47925934", "text": "function getSocket() {\n\n var candidates = [];\n\n this.sockets.forEach(function(socket) {\n if (socket.status === C.SOCKET_STATUS_ERROR) {\n return; // continue the array iteration\n } else if (candidates.length === 0) {\n candidates.push(socket);\n } else if (socket.weight > candidates[0].weight) {\n candidates = [socket];\n } else if (socket.weight === candidates[0].weight) {\n candidates.push(socket);\n }\n });\n\n if (candidates.length === 0) {\n // all sockets have failed. reset sockets status\n this.sockets.forEach(function(socket) {\n socket.status = C.SOCKET_STATUS_READY;\n });\n\n // get next available socket\n getSocket.call(this);\n return;\n }\n\n var idx = Math.floor((Math.random()* candidates.length));\n this.socket = candidates[idx].socket;\n}", "title": "" }, { "docid": "94e3fa061df8322c973d73899cbce501", "score": "0.4788986", "text": "function checkServer(req, res) {\n checkServerServices(req.server, function(){\n showServerStatus(req, res)\n })\n }", "title": "" }, { "docid": "66abd9e46fcacaddcde7b0ee03915ad3", "score": "0.47840586", "text": "function isGameServerUp(server, attempt, callback) {\n server.cuRest.getServers().then(function(data) {\n for (var i = 0; i < data.length; i++) {\n if (data[i].name.toLowerCase() === server.name.toLowerCase()) {\n callback(true);\n return;\n }\n }\n callback(false);\n }, function(error) {\n // Retry twice before giving up.\n if (attempt < 2) {\n isGameServerUp(server, attempt+1, callback);\n } else {\n util.log(\"[ERROR] Unable to query servers API.\");\n callback(false);\n }\n });\n}", "title": "" }, { "docid": "4cac7e5252c1e8d532c58232ed57d724", "score": "0.47636837", "text": "function searchForPeers () {\n //We don't serarch if we aren't verified and don't have keys\n if (serverLogs.publicKey == null || serverVars.verified == null) return;\n\n //We use a variable 'servers' to store a list of possible servers to connect to\n var servers = [];\n //We poll from our list of known servers\n for (i in serverLogs.servers) servers.push(serverLogs.servers[i]);\n //And sort them by their reliability\n servers.sort(function (a,b) {return a.failedConnectAttempts-b.failedConnectAttempts;});\n\n //This is where we filter out candidates that may be best suited\n var targetServer;\n for (i in servers) {\n var server = servers[i];\n if (server.blocked != null) if (server.blocked > Date.now()) continue; //No blocked servers allowed\n if (server.state == 1) continue; //don't connect to peers we determined to be dead, 1 == dead, 0 == known good\n if (peers[server.id] != null) continue; //Don't connect to nodes we already have a connection with\n targetServer = server; //Save our top pick server\n break;\n }\n\n //If no other options still\n if (targetServer == null) {\n for (i in servers) {\n var server = servers[i];\n if (server.blocked != null) if (server.blocked > Date.now()) continue; //Still don't like blocked hosts\n if (server.state == 0) continue; //We then decide to try hosts that are knon down\n if (peers[server.id] != null) continue;\n targetServer = server; //Save the target\n break;\n }\n }\n if (targetServer == null) return;\n connectTo(server); //Try connecting to that peer\n}", "title": "" }, { "docid": "cc22708d61d6f4adb9548880420d24d5", "score": "0.4756853", "text": "function getFirstTile(){\n\t\t\t\t\n\t\treturn g_objInner.children(\".ug-thumb-wrapper\").first();\n\t}", "title": "" }, { "docid": "099970d9dac0e3706e6ddf3264fab924", "score": "0.47518006", "text": "function getServerList() {\n $.ajax({\n url: NMON_API_URL_PREFIX + '/server/list',\n data: {},\n success: function(data) {\n var result = eval(data);\n var html = '<option value=\"aix-db1\">Select host</option>';\n // do not show all hosts flag\n //html += '<option value=\"All\">All</option>';\n for (var i = 0; i < result.length; i++) {\n html += '<option value=\"' + result[i] + '\">' + result[i] + '</option>';\n }\n $(\"#hosts\").html(html);\n }\n });\n}", "title": "" }, { "docid": "66b81da6ea008bab4d0ef6e65ba8be4c", "score": "0.4729074", "text": "function getNameBySocket(socket)\n{\n for(var key in playerSocket)\n {\n var val = playerSocket[key];\n if(val === socket)\n {\n return key;\n }\n }\n}", "title": "" }, { "docid": "00d02644b90059f131496374697a259c", "score": "0.47287363", "text": "getFirstVcf() {\n let self = this;\n let urlNames = Object.keys(self.vcfEndptHash);\n if (urlNames != null && urlNames.length > 0 && urlNames[0] != null && urlNames[0] !== '') {\n return self.vcfEndptHash[urlNames[0]];\n }\n }", "title": "" } ]
c54ff8842d2e19670fa01e190f4fab5e
! moment.js locale configuration
[ { "docid": "9d5282520792f7326f4ae0ce42cacbf2", "score": "0.0", "text": "function t(e,t,n){var r,a;return\"m\"===n?t?\"хвилина\":\"хвилину\":\"h\"===n?t?\"година\":\"годину\":e+\" \"+(r=+e,a={ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[n].split(\"_\"),r%10==1&&r%100!=11?a[0]:r%10>=2&&r%10<=4&&(r%100<10||r%100>=20)?a[1]:a[2])}", "title": "" } ]
[ { "docid": "83aee654a8d97aa81bf251da5968faeb", "score": "0.7198731", "text": "function localizeMoment(mom) {\n\t\tmom._locale = localeData;\n\t}", "title": "" }, { "docid": "b0d4c1b699e678f87040e762f40a7ead", "score": "0.7170552", "text": "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}}return globalLocale._abbr;}", "title": "" }, { "docid": "4c56901385ed751cd9d3933efb7d2592", "score": "0.7123434", "text": "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else {data=defineLocale(key,values);}if(data){ // moment.duration._locale = moment._locale = data;\nglobalLocale=data;}}return globalLocale._abbr;}", "title": "" }, { "docid": "fad337a45033123f16c1c14ae067edb0", "score": "0.69311756", "text": "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data = getLocale(key);}else {data = defineLocale(key,values);}if(data){ // moment.duration._locale = moment._locale = data;\n globalLocale = data;}}return globalLocale._abbr;}", "title": "" }, { "docid": "2cd6e0afa303482be26d92878566ea03", "score": "0.67919683", "text": "moment(time, config) {\n const moment = require('moment');\n moment.locale('zh-cn');\n if (_.isEmpty(config)) {\n return moment(time).fromNow();\n } else {\n return moment(time).format(config);\n }\n }", "title": "" }, { "docid": "7e6800864cd37d59f9bad4999cfa19dc", "score": "0.6507607", "text": "function handleLocaleChange(locale) {\n i18n.locale = locale;\n moment.locale(locale);\n}", "title": "" }, { "docid": "f229b3d4e3ba9f5e400e92e075168029", "score": "0.63341385", "text": "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n __f__(\"warn\",\n 'Locale ' + key + ' not found. Did you forget to load it?', \" at node_modules/moment/moment.js:2121\");\n\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "f229b3d4e3ba9f5e400e92e075168029", "score": "0.63341385", "text": "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n __f__(\"warn\",\n 'Locale ' + key + ' not found. Did you forget to load it?', \" at node_modules/moment/moment.js:2121\");\n\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "19be4983393cdcd650db1481b06eb5ce", "score": "0.6289015", "text": "setLocale(momentInstance) {\n if (this.props.locale) {\n momentInstance.locale(this.props.locale.name);\n }\n return momentInstance;\n }", "title": "" }, { "docid": "fe8cccfeb08a82911f2984d5a476dcd7", "score": "0.627704", "text": "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "title": "" }, { "docid": "72d207aed2b9d222d6b15385794511e8", "score": "0.6207738", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n \n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n \n return globalLocale._abbr;\n }", "title": "" }, { "docid": "72d207aed2b9d222d6b15385794511e8", "score": "0.6207738", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n \n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n \n return globalLocale._abbr;\n }", "title": "" }, { "docid": "cf395bb0083ba1ea07b9d05bf01925ac", "score": "0.61816984", "text": "function ApexLocale() { }", "title": "" }, { "docid": "244e69573239f27ee5fde4e5b434822a", "score": "0.6137076", "text": "locale() {\n const { sane } = this;\n return (\n sane.chosenLocale ||\n sane.ssrLocale ||\n sane.cookieLocale ||\n this.defaultLocale\n );\n }", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.6091772", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.6091772", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.6091772", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.6091772", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.6091772", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.6091772", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.6091772", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.6091772", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.6091772", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "3c6ba42b2c0815f318c908cd9a8af99d", "score": "0.6089248", "text": "function getDate() {\n moment.locale();\n dateElem.innerHTML = moment().format(\"llll\");\n}", "title": "" }, { "docid": "8f2dec80f30de9b816173933f5b8e1ea", "score": "0.6080036", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.6076949", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.6076949", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.6076949", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.6076949", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.6076949", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.6076949", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.6076949", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.6076949", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.6076949", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.6076949", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.6076949", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "fe68cc57a23fbe20efe840a5049ebc61", "score": "0.6072631", "text": "registerLanguage() {\n\t\tthis.options.locale = {\n\t\t\tname: CONFIG.langKey,\n\t\t\tweekStart: this.weekStart,\n\t\t\tweekdays: [\n\t\t\t\tLANG.JS_SUNDAY,\n\t\t\t\tLANG.JS_MONDAY,\n\t\t\t\tLANG.JS_TUESDAY,\n\t\t\t\tLANG.JS_WEDNESDAY,\n\t\t\t\tLANG.JS_THURSDAY,\n\t\t\t\tLANG.JS_FRIDAY,\n\t\t\t\tLANG.JS_SATURDAY\n\t\t\t],\n\t\t\tweekdaysShort: [\n\t\t\t\tLANG.JS_SUN,\n\t\t\t\tLANG.JS_MON,\n\t\t\t\tLANG.JS_TUE,\n\t\t\t\tLANG.JS_WED,\n\t\t\t\tLANG.JS_THU,\n\t\t\t\tLANG.JS_FRI,\n\t\t\t\tLANG.JS_SAT\n\t\t\t],\n\t\t\tweekdaysMin: [\n\t\t\t\tLANG.JS_SUN,\n\t\t\t\tLANG.JS_MON,\n\t\t\t\tLANG.JS_TUE,\n\t\t\t\tLANG.JS_WED,\n\t\t\t\tLANG.JS_THU,\n\t\t\t\tLANG.JS_FRI,\n\t\t\t\tLANG.JS_SAT\n\t\t\t],\n\t\t\tmonths: [\n\t\t\t\tLANG.JS_JANUARY,\n\t\t\t\tLANG.JS_FEBRUARY,\n\t\t\t\tLANG.JS_MARCH,\n\t\t\t\tLANG.JS_APRIL,\n\t\t\t\tLANG.JS_MAY,\n\t\t\t\tLANG.JS_JUNE,\n\t\t\t\tLANG.JS_JULY,\n\t\t\t\tLANG.JS_AUGUST,\n\t\t\t\tLANG.JS_SEPTEMBER,\n\t\t\t\tLANG.JS_NOVEMBER,\n\t\t\t\tLANG.JS_OCTOBER,\n\t\t\t\tLANG.JS_DECEMBER\n\t\t\t],\n\t\t\tmonthsShort: [\n\t\t\t\tLANG.JS_JAN,\n\t\t\t\tLANG.JS_FEB,\n\t\t\t\tLANG.JS_MAR,\n\t\t\t\tLANG.JS_APR,\n\t\t\t\tLANG.JS_MAY,\n\t\t\t\tLANG.JS_JUN,\n\t\t\t\tLANG.JS_JUL,\n\t\t\t\tLANG.JS_AUG,\n\t\t\t\tLANG.JS_SEP,\n\t\t\t\tLANG.JS_NOV,\n\t\t\t\tLANG.JS_OCT,\n\t\t\t\tLANG.JS_DEC\n\t\t\t],\n\t\t\tordinal: (n) => `${n}`,\n\t\t\tNow: LANG.JS_GANTT_NOW,\n\t\t\t'X-Scale': LANG.JS_GANTT_ZOOM_X,\n\t\t\t'Y-Scale': LANG.JS_GANTT_ZOOM_Y,\n\t\t\t'Task list width': LANG.JS_GANTT_TASKLIST,\n\t\t\t'Before/After': LANG.JS_GANTT_EXPAND,\n\t\t\t'Display task list': LANG.JS_GANTT_TASKLIST_VISIBLE\n\t\t};\n\t}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.60719347", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" } ]
3a1310edb931c95b83ff4a660c5d17ed
56 / Use parseInt() in the convertToInteger function so it converts a binary number to an integer and returns it.
[ { "docid": "09c22e0a23c915437058fc198fbf1465", "score": "0.7070979", "text": "function convertToInteger(str) {\n return parseInt(str,2)\n }", "title": "" } ]
[ { "docid": "e8e6f2b93cb64f28abdc20d574cad487", "score": "0.7221441", "text": "function binaryToDec(binary){\n let number = parseInt(binary, 2);\n\n console.log(number);\n}", "title": "" }, { "docid": "f69c2ee27ba1f2d7faeb73cf573a9d3c", "score": "0.7083178", "text": "function convertToInteger(str) {\n return parseInt(str, 2);\n}", "title": "" }, { "docid": "ff27de1206d20ada3756c3c278f825ab", "score": "0.7064901", "text": "convertToInteger(value){\n return parseInt(value)\n }", "title": "" }, { "docid": "1d7f00938549e0c0db7b0878e0f87785", "score": "0.7060159", "text": "function convertToInteger(str)\n{\n return parseInt(str,2);//default is base 10\n}", "title": "" }, { "docid": "a060399e15e7cf185b8ca69dc888ce5f", "score": "0.7037842", "text": "function convertToInteger(str) {\n var a = parseInt(str, 2);\n return a;\n}", "title": "" }, { "docid": "aaee63d7e9f9a7f6385ac0b024e950a8", "score": "0.7031197", "text": "function BinaryConverter(str) { \n return parseInt(str,2); \n}", "title": "" }, { "docid": "eaf2244ac2149f9a06b6aa77b6fbaa58", "score": "0.6998878", "text": "function convertToInteger(str) {\n var a = parseInt(str, 2);\n return a\n}", "title": "" }, { "docid": "376938be28167614720d1f1fa7ca2f92", "score": "0.6986733", "text": "function convertToInteger(str){\n return parseInt(str);\n}", "title": "" }, { "docid": "69223f29ca75bfb3c3eaf4e6c93f8702", "score": "0.69803804", "text": "function convertToInteger(str) {\r\n return parseInt(str, 2)\r\n}", "title": "" }, { "docid": "2071fa98b77e776fe20c86df5653e622", "score": "0.6963035", "text": "function convertToInteger(str) {\n var a = parseInt(str, 2);\n return a\n }", "title": "" }, { "docid": "6afee08e1d580718ab582422fd24926b", "score": "0.69590086", "text": "function convertToInteger(str) {\n return parseInt(str, 2)\n}", "title": "" }, { "docid": "ee0fec0624b1853d817848c3b15ca847", "score": "0.69083035", "text": "function convertToInteger(str) {\n return parseInt(str, 2);\n}", "title": "" }, { "docid": "639efa547d36b5aeae674434f22642dc", "score": "0.68862844", "text": "function convertToInteger(str) {\n return parseInt(str, 2);\n}", "title": "" }, { "docid": "639efa547d36b5aeae674434f22642dc", "score": "0.68862844", "text": "function convertToInteger(str) {\n return parseInt(str, 2);\n}", "title": "" }, { "docid": "639efa547d36b5aeae674434f22642dc", "score": "0.68862844", "text": "function convertToInteger(str) {\n return parseInt(str, 2);\n}", "title": "" }, { "docid": "df4a40119c9b480f18732a26541c1e5c", "score": "0.68653804", "text": "function convertToInteger2(str) {\n return parseInt(str,2);\n}", "title": "" }, { "docid": "1d63c36fe0e8e8cb33c3e320dcd90f39", "score": "0.685786", "text": "function convertToInteger(str) {\n\treturn parseInt(str, 2);\n}", "title": "" }, { "docid": "5498ea97b354bfac066d768a6bd5d526", "score": "0.68427944", "text": "function convertToInt(inputString) {\n return parseInt(inputString, 10);\n }", "title": "" }, { "docid": "719a828bb8a52427f0c611c77c1cdd2e", "score": "0.6839442", "text": "function convertToInteger(str) {\n return parseInt(str, 36);\n}", "title": "" }, { "docid": "7164744e613a849c9fb16e2cbf3f5639", "score": "0.683791", "text": "function convertToInteger(str) {\n var a = parseInt(str);\n return a\n}", "title": "" }, { "docid": "eac4b1613443cfd338febc63fb13d781", "score": "0.68338805", "text": "function convertToInteger(str) {\n\n\treturn parseInt(str, 2);\n\n}", "title": "" }, { "docid": "a68b916eae6648a9036e1d8341531a7f", "score": "0.68287617", "text": "function convertToInteger(str) {\r\n return parseInt(str);\r\n}", "title": "" }, { "docid": "ff0ccb3ede3c80778f42ee07b62ff5b3", "score": "0.67912334", "text": "function convertToInteger(str) {\n var toint = parseInt(str);\n return toint\n}", "title": "" }, { "docid": "3abda86f9889a0020fec82e436585715", "score": "0.6788408", "text": "function convertToInteger2(str) {\n return parseInt(str, 2);\n}", "title": "" }, { "docid": "cda18c87a5749ab738b25d671fe12582", "score": "0.67694324", "text": "function toInteger(a){\r\n\treturn parseInt(a);\r\n}", "title": "" }, { "docid": "686561a55b772c00f275a97e44e76100", "score": "0.6761413", "text": "function convertToInteger(value) {\n var strVal = typeof value === 'string' ? value : value.toString(),\n radix = strVal.indexOf('0x') === 0 ? 16 : strVal.indexOf('0') === 0 ? 8 : 10;\n\n return parseInt(strVal, radix);\n }", "title": "" }, { "docid": "abea0dc8737420cb9654f7b30f21911a", "score": "0.6757467", "text": "function convertToInteger(str) {\n return parseInt(str);\n}", "title": "" }, { "docid": "2dcae06877665639840879280e479284", "score": "0.67099917", "text": "function convertToInteger(str) {\n return parseInt(str);\n}", "title": "" }, { "docid": "2dcae06877665639840879280e479284", "score": "0.67099917", "text": "function convertToInteger(str) {\n return parseInt(str);\n}", "title": "" }, { "docid": "4539fe1583ac53512197c3d1f9dbe2fe", "score": "0.6691398", "text": "function convertToInteger(str) {\n\n\treturn parseInt(str);\n\n}", "title": "" }, { "docid": "86686514785d97f560a4e72cf6aea9f5", "score": "0.66840464", "text": "function convertToInt(str) {\r\n return parseInt(str);\r\n}", "title": "" }, { "docid": "0ee30774d22a9a98f5160d7bfe06dc6c", "score": "0.6681684", "text": "function convertToInt(stringInt) {\n return parseInt(stringInt);\n}", "title": "" }, { "docid": "9b7044d65a125214c944c25cc0a06ebf", "score": "0.6670009", "text": "toInteger(value) {\n return parseInt(`${value}`, 10);\n }", "title": "" }, { "docid": "ff072f2eafc8728cccbec3cbe99dc233", "score": "0.66514796", "text": "function convertInt(value) {\n if (typeof value === 'string')\n return parseInt(value);\n return value;\n }", "title": "" }, { "docid": "4ef57a6384988515d6aa15ec22bcf08e", "score": "0.66490054", "text": "function convertToIntegerX(str) {\n return parseInt(str, 2);\n}", "title": "" }, { "docid": "ec6ebd295e51d87b91d7d748d9f4c01e", "score": "0.663068", "text": "function convertToInt(str) {\n return parseInt(str);\n}", "title": "" }, { "docid": "9577ee529bf144d9a454403ea4acdd24", "score": "0.66283935", "text": "function toInt(number) \n{\n\treturn parseInt(number);\n}", "title": "" }, { "docid": "3ecbfb35330983b8c3fa8b61675174d3", "score": "0.65749204", "text": "function hex2int(p_hex, p_bytes) {\n\tvar l_hex = '00';\n\tvar l_int = 0;\n\tif (p_bytes === 2) {\n\t\tl_hex = p_hex.slice(0, 2) + p_hex.slice(3);\n\t\tl_int = parseInt(l_hex, 16).toString();\n\t}\n\tif (p_bytes === 3) {\n\t\tl_hex = p_hex.slice(0, 2) + p_hex.slice(3, 5) + p_hex.slice(6);\n\t\tl_int = parseInt(l_hex, 16).toString();\n\t}\n\treturn l_int;\n}", "title": "" }, { "docid": "ca16a7dbb00c1cf73413107389249138", "score": "0.65633434", "text": "tobinary2(num) {\n var str = num.toString();\n var bin = (+str).toString(2);\n var s = \" \";\n console.log(bin);\n let fb = bin.slice(0, 4);\n let lb = bin.slice(4);\n let newbin = lb + fb;\n console.log(newbin);\n var digit = parseInt(newbin, 2);\n console.log(digit);\n }", "title": "" }, { "docid": "6aef3f17fbccd3a918949386d55b3300", "score": "0.65516424", "text": "function toInt(str){\n return parseInt(str, 10);\n }", "title": "" }, { "docid": "f0d11aaded5a1aca32df500d8d16bbb0", "score": "0.65483767", "text": "function string2int(s) {\nreturn s.split().reduce(function(x,y){\nreturn x*10+y;});\n}", "title": "" }, { "docid": "3b357bfe7dbf197316fb3a2e23d1d60c", "score": "0.6547426", "text": "function toInteger(mystr) {\n return parseInt(mystr);\n}", "title": "" }, { "docid": "8907ebc3746f5cbaa413e3bbd5b61cff", "score": "0.65415823", "text": "function conversion(){\n\tvar binContent = [];\n\t\tbinContent = bin.value.split('');\n\n\t\tfor(var i=0; i<binContent.length; i++){\n\t\t\tif(binContent[i] != '0' && binContent[i] != '1'){\n\t\t\t\terror.innerHTML = 'Error: unexpected (int) ' + binContent[i];\n\t\t\t}\n\t\t}\n\n\t\tfor(var i=0; i<binContent.length; i++){\n\t\t\tdec += binContent[i]*(2**(binContent.length-1-i));\n\t\t}\n\n\t\tresult.innerHTML = '';\n\t\tresult.innerHTML = dec;\n}", "title": "" }, { "docid": "d6f76f1def6951b7cd808a05424d520d", "score": "0.6507929", "text": "function convertToInt(string) {\n return parseInt(string, 10);\n}", "title": "" }, { "docid": "deef43547357890d7a7e5fd0589fac6a", "score": "0.6486277", "text": "function binToDec([binNum]) {\n binNum = parseInt(binNum, 2);\n console.log(binNum);\n}", "title": "" }, { "docid": "01335c13aae81523bec9a66e17ca8278", "score": "0.64851594", "text": "function stringToInt(str) {\n \n}", "title": "" }, { "docid": "92d267bfda207072151b80f5fd674d3b", "score": "0.64840215", "text": "function sc_string2integer(s, radix) {\n return parseInt(s, radix);\n}", "title": "" }, { "docid": "92d267bfda207072151b80f5fd674d3b", "score": "0.64840215", "text": "function sc_string2integer(s, radix) {\n return parseInt(s, radix);\n}", "title": "" }, { "docid": "bae908d6e601b587afbe4b1df9250dcd", "score": "0.64383227", "text": "function makeInt(n){\n return parseInt(n,10);\n}", "title": "" }, { "docid": "83ee6863ea7ef5dcc1563d9c76452f44", "score": "0.64326537", "text": "function toInt(val){\n // we do not use lang/toNumber because of perf and also because it\n // doesn't break the functionality\n return ~~val;\n }", "title": "" }, { "docid": "19caabc1f39ea7b1e863b26d123f2f23", "score": "0.6431773", "text": "function makeInt(n) {\n\t return parseInt(n,10);\n }", "title": "" }, { "docid": "15967d459c70495bd485b5704e87b1f9", "score": "0.6385664", "text": "function toInt(str) {\n return parseInt(str, 10);\n }", "title": "" }, { "docid": "df037758d6e4246fc943c4f504dea59a", "score": "0.6332078", "text": "function toInteger(mystr) {\n console.log(Number(mystr));\n return Number(mystr);\n}", "title": "" }, { "docid": "39292edc0f57b483db0170f8b9199474", "score": "0.63259023", "text": "function int(str){\r\n return parseInt(str);\r\n }", "title": "" }, { "docid": "9242d52dbe183f9a734e25e94ccedd58", "score": "0.6321054", "text": "function stringToInteger(string) {\n let tempArray = string.split('');\n let result = [];\n\n for (let i = 0; i < tempArray.length; i++) {\n switch (tempArray[i]) {\n case '1':\n result.push(1);\n break;\n\n case '2':\n result.push(2);\n break;\n\n case '3':\n result.push(3);\n break;\n\n case '4':\n result.push(4);\n break;\n\n case '5':\n result.push(5);\n break;\n\n case '6':\n result.push(6);\n break;\n\n case '7':\n result.push(7);\n break;\n\n case '8':\n result.push(8);\n break;\n\n case '9':\n result.push(9);\n break;\n\n case '0':\n result.push(0);\n break;\n }\n }\n\n result.join('');\n let value = 0;\n console.log(result);\n\n result.forEach(digit => {\n console.log(`The Value is ${value}`);\n console.log(`The Digit is ${digit}`);\n (value = (10 * value) + digit)\n });\n console.log(value);\n return value;\n}", "title": "" }, { "docid": "841f3d8350f736d25a090a6baadf6090", "score": "0.6286271", "text": "function stringtoInt(message) {\n let c = 2 ** 8;\n let n = message.length;\n let message_num = 0;\n for (let i = 0; i < n; i++) {\n message_num += message.charCodeAt(i) * c ** i\n }\n return message_num\n}", "title": "" }, { "docid": "1e70d2f64bf33c85122a3f4016b15205", "score": "0.6284333", "text": "function binToDec(binString){\n // Write your code here.\n}", "title": "" }, { "docid": "5ca83f3693d4674c6fbb3687be786b77", "score": "0.62767124", "text": "function HexToInt(hex)\r\n{\r\n\treturn parseInt(hex, 16);\r\n}", "title": "" }, { "docid": "21785fd7bc622db0f104b594e8fc96ce", "score": "0.6261982", "text": "function makeInt(n) {\n return parseInt(n, 10);\n}", "title": "" }, { "docid": "21785fd7bc622db0f104b594e8fc96ce", "score": "0.6261982", "text": "function makeInt(n) {\n return parseInt(n, 10);\n}", "title": "" }, { "docid": "703bb4be2f3dc42bcd83c6d8058022b2", "score": "0.62611794", "text": "static parseInt(input){let value=\"\";for(let i=0;i<input.length;i++)input.charCodeAt(i)>=32&&input.charCodeAt(i)<=126&&(value+=input[i]);return parseInt(value,10)}", "title": "" }, { "docid": "4726339ba4d80c439cca1daf313f351a", "score": "0.62443304", "text": "function toInt(str) {\n return parseInt(str, 10) || 0;\n }", "title": "" }, { "docid": "4b8ee483ddcb9e8d9692e491b2fbffcc", "score": "0.6238565", "text": "function BinaryConverter(str) {\n\tsplitString = str.split(\"\")\n\tsum = 0;\n\tpowerCounter = splitString.length - 1;\n\tfor (i=0;i<splitString.length;i++) {\n\t\t//no idea why i had to make this base case but for some reason \n\t\t// anytime it was a '0' for the last digit it would give the answer as 1 causing all the answers ending in '0' to be off by 1\n\t\tif (i == splitString.length - 1 && splitString[i] == \"0\") {\n\t\t\tbreak;\n\t\t}\n\t\tsum += Math.pow((parseInt(splitString[i])*2),powerCounter)\n\t\tpowerCounter--;\n\t}\n\treturn sum\n}", "title": "" }, { "docid": "8ca42999b154a22e8af3a0060dde401d", "score": "0.6223384", "text": "function convertToNum(convin) { \n\tvar convnum = 0;\n\tvar arr = convin.split(\"\");\n\n\tif (arr[0].toUpperCase() == \"B\") convnum += 8;\n\telse if (arr[0].toUpperCase() == \"C\") convnum += 16;\n\telse if (arr[0].toUpperCase() == \"D\") convnum += 24;\n\telse if (arr[0].toUpperCase() == \"E\") convnum += 32;\n\telse if (arr[0].toUpperCase() == \"F\") convnum += 40;\n\telse if (arr[0].toUpperCase() == \"G\") convnum += 48;\n\telse if (arr[0].toUpperCase() == \"H\") convnum += 56;\n\tconvnum+= Number(arr[1]);\n\treturn convnum;\n}", "title": "" }, { "docid": "d535b0d9220ed5ced3de8598b3290e46", "score": "0.6202603", "text": "function binToInt(x)//sp\n{\n var total = 0;\n var power = parseInt(x.length) - 1;\n\n\n\n\n for (var i = 0; i < x.length; i++)\n {\n if (x.charAt(i) == '1')\n {\n total = total + Math.pow(2, power);\n }\n power--;\n }\n return total;\n}", "title": "" }, { "docid": "49846e02d8bb235404ab18435767c2b4", "score": "0.6194135", "text": "function asInt(val) {\n return parseInt(val, 10);\n }", "title": "" }, { "docid": "d2d3b5ec53cfadc3eeb97a149f844942", "score": "0.61900467", "text": "function convertBinary(binaryNumber) {\n let decimalValue = 0;\n // split the input string into individual digits and immediately map them to Integers.\n // I am using arrow function as the argument of .map() function.\n let digitArray = binaryNumber.split('').map((value) => parseInt(value));\n\n for (let i = digitArray.length - 1; i >= 0; i--) {\n if (!(digitArray[i] === 0 || digitArray[i] === 1)) { // checking if all digits are either 0 OR 1\n console.log(\"Wrong number!\");\n return;\n }\n let exponent = digitArray.length - i - 1;\n decimalValue += digitArray[i] * Math.pow(2, exponent); // decimalValue+= value; is shorhand for => decimalValue = decimalValue + value;\n }\n return decimalValue;\n}", "title": "" }, { "docid": "f429f4248dffde02148b41628cfe7277", "score": "0.6184953", "text": "function convert(n, base1, base2) {\nreturn parseInt(n, base1).toString(base2);\n}", "title": "" }, { "docid": "bc060c2c0dabeead12c7b19e38737c87", "score": "0.6179004", "text": "function convert() {\n let converted = 0;\n switch (numberSystem.value) {\n case \"hex\":\n converted = parseInt(userNumber).toString(16);\n break;\n\n case \"binary\":\n converted = parseInt(userNumber).toString(2);\n break;\n default:\n converted = 0;\n }\n console.log(converted);\n /* const num = 84;\n console.log(num.toString(16)); */\n result.innerHTML = converted;\n}", "title": "" }, { "docid": "469528adcfdca79d78ac40a7beff9c2f", "score": "0.6158552", "text": "function convertint(intermediate){\n var unencoded = intermediate;\n var intermediate = intermediate+8192;\n var intermediate_21 = intermediate;\n var intermediate_2 = (intermediate_21 &= 0x7F);\n var intermediate_3 = intermediate_2 + ((intermediate &= 0xFF80)<<1);\n var encodedword = intermediate_3.toString(16);\n console.log(\"Unencoded value: \"+unencoded+ \" Encoded hex \" +encodedword);\n}", "title": "" }, { "docid": "d504e8b4e7de1793f4ae6a2c399d945b", "score": "0.61450744", "text": "function convertInteger (integer) {\n\t\t\t\tif (integer >= base) {\n\t\t\t\t\treturn `{${integer}}`;\n\t\t\t\t}\n\t\t\t\tif (integer >= 10) {\n\t\t\t\t\treturn String.fromCharCode(\"a\".charCodeAt(0) - 10 + integer);\n\t\t\t\t}\n\t\t\t\treturn `${integer}`;\n\t\t\t}", "title": "" }, { "docid": "2dd3c1460f324cb540ce19618ec286ca", "score": "0.61336297", "text": "rawStrToInt(rawStr) {\n const s1 = rawStr.charAt(0);\n const s2 = rawStr.charAt(1);\n const s3 = rawStr.charAt(2);\n const s4 = rawStr.charAt(3);\n const c1 = s1.charCodeAt(0);\n const c2 = s2.charCodeAt(0);\n const c3 = s3.charCodeAt(0);\n const c4 = s4.charCodeAt(0);\n const i1 = c1 << 24 >>> 0;\n const i2 = c2 << 16 >>> 0;\n const i3 = c3 << 8 >>> 0;\n const i4 = c4 << 0 >>> 0;\n return i1 + i2 + i3 + i4;\n }", "title": "" }, { "docid": "e77ac9ff5a3a131eea6256cfcb0352e5", "score": "0.61303174", "text": "function bin_to_dec(bstr) { \n return parseInt((bstr + '')\n .replace(/[^01]/gi, ''), 2);\n}", "title": "" }, { "docid": "1cd2203e62190778a1742b484c65f819", "score": "0.612592", "text": "function toInt(str, radix) {\n if (radix === void 0) { radix = 10; }\n return parseInt(str, radix);\n }", "title": "" }, { "docid": "13a163a4d3e0b8d3d36485924c01a1b6", "score": "0.6112114", "text": "midiInt() {\n let result = 0;\n while (true) {\n const value = this.uint8();\n if (value & 0b10000000) {\n result += value & 0b1111111;\n result <<= 7;\n }\n else {\n return result + value;\n }\n }\n }", "title": "" }, { "docid": "9fbddc1d31ae2d4e96775ee735cc0951", "score": "0.6104658", "text": "_scanBinaryNumber () {\n var numberPart = '';\n\n while (this._isBinaryDigit(this._peekNextChar())) {\n numberPart += this._getNextChar();\n }\n\n return numberPart;\n }", "title": "" }, { "docid": "88ca4fff9ff52b0db55da2276819c930", "score": "0.61012214", "text": "function toInteger(toConvert){\n\t\t\n\t\tvar _typeof = typeof(toConvert);\n\n\t\tif(_typeof == 'string'){\n\t\t\tswitch (toConvert.toLowerCase()) {\n\t\t\t\tcase \"true\":\n\t\t\t\t\treturn 1;\n\t\t\t\tbreak;\n\t\t\t\tcase \"false\":\n\t\t\t\t\treturn 0;\n\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tlog(\"Cannot convert string to integer. [toInteger()]\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}else if( (_typeof == 'boolean') || (_typeof == 'number') ){\n\t\t\tif(toConvert){\n\t\t\t\treturn 1;\n\t\t\t}else {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}else {\n\t\t\tlog(\"Cannot convert to integer. [toInteger()]\");\n\t\t}\n\t\t\n\t}", "title": "" }, { "docid": "f53b8fca2025bb659d82570f78047d87", "score": "0.61002225", "text": "static parseInteger(s) {\n return parseInt(s,10);\n }", "title": "" }, { "docid": "83bf221c58a11ce80e78b4f72d80fb5b", "score": "0.60709965", "text": "function baseTenToBinary(baseTenNumber) {\n //your code here\n}", "title": "" }, { "docid": "7eb61477bcbd73356a715ecae7efd2d9", "score": "0.6061484", "text": "intToBinary(number) {\n // Your code here\n\n let result = \"\";\n\n function recurse(number) {\n number = ~~number;\n\n if (!number) {\n return \"0\";\n }\n\n result = ((number & 0x01) ? \"1\" : \"0\") + result;\n recurse(number >> 1);\n }\n\n recurse(number);\n return result;\n }", "title": "" }, { "docid": "58948093a615d32eb733f57c9775f1b7", "score": "0.6043181", "text": "toInteger() {\n if (!this.tag.isInteger()) {\n throw new error_1.ASN1TypeError('not an integer');\n }\n return (0, parse_1.parseInteger)(this.value);\n }", "title": "" }, { "docid": "af10512b43b5e57dcaf5f9b3d775ef34", "score": "0.60395217", "text": "function toInt(value) {\n if (typeof value === 'number') {\n return value | 0;\n }\n return parseInt(value);\n }", "title": "" }, { "docid": "ebdcaee625cdaba49f0f4b4137792a88", "score": "0.60335404", "text": "function parseArbitraryInt(str, bits) {\n // We parse the string into a vector of digits, base 10. This is convenient to work on.\n\n assert(bits > 0); // NB: we don't check that the value in str can fit in this amount of bits\n\n function str2vec(s) { // index 0 is the highest value\n var ret = [];\n for (var i = 0; i < s.length; i++) {\n ret.push(s.charCodeAt(i) - '0'.charCodeAt(0));\n }\n return ret;\n }\n\n function divide2(v) { // v /= 2\n for (var i = v.length-1; i >= 0; i--) {\n var d = v[i];\n var r = d % 2;\n d = Math.floor(d/2);\n v[i] = d;\n if (r) {\n assert(i+1 < v.length);\n var d2 = v[i+1];\n d2 += 5;\n if (d2 >= 10) {\n v[i] = d+1;\n d2 -= 10;\n }\n v[i+1] = d2;\n }\n }\n }\n\n function mul2(v) { // v *= 2\n for (var i = v.length-1; i >= 0; i--) {\n var d = v[i]*2;\n r = d >= 10;\n v[i] = d%10;\n var j = i-1;\n if (r) {\n if (j < 0) {\n v.unshift(1);\n break;\n }\n v[j] += 0.5; // will be multiplied\n }\n }\n }\n\n function subtract(v, w) { // v -= w. we assume v >= w\n while (v.length > w.length) w.splice(0, 0, 0);\n for (var i = 0; i < v.length; i++) {\n v[i] -= w[i];\n if (v[i] < 0) {\n v[i] += 10;\n // find something to take from\n var j = i-1;\n while (v[j] == 0) {\n v[j] = 9;\n j--;\n assert(j >= 0);\n }\n v[j]--;\n }\n }\n }\n\n function isZero(v) {\n for (var i = 0; i < v.length; i++) {\n if (v[i] > 0) return false;\n }\n return true;\n }\n\n var v;\n\n if (str[0] == '-') {\n // twos-complement is needed\n str = str.substr(1);\n v = str2vec('1');\n for (var i = 0; i < bits; i++) {\n mul2(v);\n }\n subtract(v, str2vec(str));\n } else {\n v = str2vec(str);\n }\n\n var bitsv = [];\n while (!isZero(v)) {\n bitsv.push((v[v.length-1] % 2 != 0)+0);\n v[v.length-1] = v[v.length-1] & 0xfe;\n divide2(v);\n }\n\n var ret = zeros(Math.ceil(bits/32));\n for (var i = 0; i < bitsv.length; i++) {\n ret[Math.floor(i/32)] += bitsv[i]*Math.pow(2, i % 32);\n }\n return ret;\n}", "title": "" }, { "docid": "c6b8749d616e2a313fab584282f09812", "score": "0.60330844", "text": "function bytesToInt() {\n for (var e = 0, t = 0, n = arguments.length - 1; 0 <= n; n--) {\n e = (e | (255 & arguments[n]) << t >>> 0) >>> 0,\n t += 8\n }\n return e\n}", "title": "" }, { "docid": "d54e4687cec14def9122feb130b92c00", "score": "0.6032213", "text": "function parse_PtgInt(blob) { blob.l++; return blob.read_shift(2); }", "title": "" }, { "docid": "d54e4687cec14def9122feb130b92c00", "score": "0.6032213", "text": "function parse_PtgInt(blob) { blob.l++; return blob.read_shift(2); }", "title": "" }, { "docid": "d54e4687cec14def9122feb130b92c00", "score": "0.6032213", "text": "function parse_PtgInt(blob) { blob.l++; return blob.read_shift(2); }", "title": "" }, { "docid": "d54e4687cec14def9122feb130b92c00", "score": "0.6032213", "text": "function parse_PtgInt(blob) { blob.l++; return blob.read_shift(2); }", "title": "" }, { "docid": "d54e4687cec14def9122feb130b92c00", "score": "0.6032213", "text": "function parse_PtgInt(blob) { blob.l++; return blob.read_shift(2); }", "title": "" }, { "docid": "d54e4687cec14def9122feb130b92c00", "score": "0.6032213", "text": "function parse_PtgInt(blob) { blob.l++; return blob.read_shift(2); }", "title": "" }, { "docid": "d54e4687cec14def9122feb130b92c00", "score": "0.6032213", "text": "function parse_PtgInt(blob) { blob.l++; return blob.read_shift(2); }", "title": "" }, { "docid": "d54e4687cec14def9122feb130b92c00", "score": "0.6032213", "text": "function parse_PtgInt(blob) { blob.l++; return blob.read_shift(2); }", "title": "" }, { "docid": "bbc33e4a31d23c320005250e57bee2a0", "score": "0.60316", "text": "function convert(num) {\n \n}", "title": "" }, { "docid": "e5e2f0e0a1a9124b5da5231fbd3907cc", "score": "0.6015991", "text": "function parseIntFromHex(val) {\n return parseInt(val, 16);\n }", "title": "" }, { "docid": "a58367d10174c442272aef44ba9b62cd", "score": "0.601368", "text": "function parseBigInt(b,a){return new BigInteger(b,a)}", "title": "" }, { "docid": "a58367d10174c442272aef44ba9b62cd", "score": "0.601368", "text": "function parseBigInt(b,a){return new BigInteger(b,a)}", "title": "" }, { "docid": "a58367d10174c442272aef44ba9b62cd", "score": "0.601368", "text": "function parseBigInt(b,a){return new BigInteger(b,a)}", "title": "" }, { "docid": "a58367d10174c442272aef44ba9b62cd", "score": "0.601368", "text": "function parseBigInt(b,a){return new BigInteger(b,a)}", "title": "" }, { "docid": "a58367d10174c442272aef44ba9b62cd", "score": "0.601368", "text": "function parseBigInt(b,a){return new BigInteger(b,a)}", "title": "" }, { "docid": "a58367d10174c442272aef44ba9b62cd", "score": "0.601368", "text": "function parseBigInt(b,a){return new BigInteger(b,a)}", "title": "" } ]
c7a0ead1494d960232348a18cffbfe54
Puts a new message in the queue. Will also trigger a processing in the queue so this message might be processed instantly.
[ { "docid": "d1375e089125f316ad36a7bcba191f36", "score": "0.6610056", "text": "enqueue(message) {\n this.redisClient.llen(config.redis.keys.events(this.id), (error, reply) => {\n const length = reply;\n if (length < config.hooks.queueSize && this.queue.length < config.hooks.queueSize) {\n Logger.info(`[Hook] ${this.callbackURL} enqueueing message:`, JSON.stringify(message));\n // Add message to redis queue\n this.redisClient.rpush(config.redis.keys.events(this.id), JSON.stringify(message), (error,reply) => {\n if (error != null) { Logger.error(\"[Hook] error pushing event to redis queue:\", JSON.stringify(message), error); }\n });\n this.queue.push(JSON.stringify(message));\n this._processQueue();\n } else {\n Logger.warn(`[Hook] ${this.callbackURL} queue size exceed, event:`, JSON.stringify(message));\n }\n });\n }", "title": "" } ]
[ { "docid": "4c8f68a0fc3dd75ee7ceabe3ff29c8ae", "score": "0.7482252", "text": "_enqueue(message) {\n this.msgQueue.push(message);\n this._dequeue(); // Attempt to dequeue the message\n }", "title": "" }, { "docid": "d030d3b43fcd9375303239664006113f", "score": "0.70494044", "text": "function enqueue(msg)\n {\n queue.push(msg);\n if (!tickUpcoming) {\n setImmediate(tick);\n }\n }", "title": "" }, { "docid": "218d915823e7e67e9320457d53d89edf", "score": "0.66839343", "text": "async sendToQueue (queueName, message) {\n\t\t// looks like RMQ has no concept of response for publishing\n\t\tconst bufferMessage = Buffer.from(JSON.stringify({ message, id: uuidv1() }));\n\t\tthis.channel.sendToQueue(queueName, bufferMessage);\n\t}", "title": "" }, { "docid": "599e561a0cec91af5dd1bb81da19dfa1", "score": "0.6630806", "text": "_addMessageToQueue(message, detail) {\n if(!this.isConnected) {\n this._queue.push({\n message: message,\n detail: detail\n });\n }\n }", "title": "" }, { "docid": "8f098a1ec52b7203f1e3e5e36cbbb5e8", "score": "0.66152066", "text": "function enqueueMessage(handler, msg) {\r\n\t queue.pushBack({ handler: handler, msg: msg });\r\n\t scheduleMessageLoop();\r\n\t }", "title": "" }, { "docid": "8f098a1ec52b7203f1e3e5e36cbbb5e8", "score": "0.66152066", "text": "function enqueueMessage(handler, msg) {\r\n\t queue.pushBack({ handler: handler, msg: msg });\r\n\t scheduleMessageLoop();\r\n\t }", "title": "" }, { "docid": "449428f040e2f0c0f4c87e3ad9c51071", "score": "0.6559612", "text": "function api_websocket_send_(message)\n{\n console.log(`api_websocket_send_: put message to the pending queue ${message}`);\n api_pending_messages_.push(message);\n //console.log(`api_websocket_send_: after put message to the pending queue api_pending_messages_.length=${ api_pending_messages_.length}, api_pending_messages_=${JSON.stringify(api_pending_messages_)}`);\n\n // Try to send pending including the new one. It can work :-)\n api_websocket_send_pending_();\n}", "title": "" }, { "docid": "9fdc5c7efaa270b5406ba0595bffd662", "score": "0.64609504", "text": "function produce(queueName, message){\n\tbus.on('online', function() {\n\t var q = bus.queue(queueName);\n\t q.on('attached', function() {\n\t console.log('Attached producer to queue ' + queueName + '.');\n\t });\n\t q.attach();\n\t q.push(message);\n\t});\n\tbus.connect();\n}", "title": "" }, { "docid": "2179fcef206b17fde2f837546d795fb2", "score": "0.6219309", "text": "function enqueueMessage(handler, msg) {\r\n\t // Add the posted message to the queue.\r\n\t messageQueue.addLast({ handler: handler, msg: msg });\r\n\t // Bail if a loop task is already pending.\r\n\t if (loopTaskID !== 0) {\r\n\t return;\r\n\t }\r\n\t // Schedule a run of the message loop.\r\n\t loopTaskID = schedule(runMessageLoop);\r\n\t }", "title": "" }, { "docid": "939cda1b491c95d9e3fe287fbff21560", "score": "0.61350256", "text": "sendOneMessage() {\n if (this.queue.length > 0) {\n this.send(this.queue.shift());\n } else {\n this.emit('idle');\n }\n }", "title": "" }, { "docid": "dec1a7170c87a15b5b188e1f6f74089b", "score": "0.59945726", "text": "function send(message) {\n dispatcher.trigger('new_message', message);\n}", "title": "" }, { "docid": "bbc09003cc019ab0d0dcd86b69659080", "score": "0.5940696", "text": "enqueue(item) {\n this._queue.push(item);\n }", "title": "" }, { "docid": "dd88a5edd29c81b6676a0df95231e9fd", "score": "0.5926632", "text": "receiveMessage(envelope, queue, callback) {\n this._messages.push(envelope);\n }", "title": "" }, { "docid": "8d4c2f419a3f750a348513a2cda71cbd", "score": "0.59011495", "text": "enqueue(item) {\n this.queue.push(item);\n this.size += 1;\n }", "title": "" }, { "docid": "9e435640fea568470d4531890e10268d", "score": "0.5897084", "text": "function EnqueueMessageToClient(message, client) {\r\n queue = GetQueue(client);\r\n queue.push(message);\r\n // notify aqui?\r\n}", "title": "" }, { "docid": "85388a495a8c3397d4d7739e816d512b", "score": "0.5889498", "text": "enqueue() {\n if (!this[_enqueued]) {\n this[_enqueued] = true;\n queue.add(this);\n }\n }", "title": "" }, { "docid": "e93a8df6043cd1e658a6b61b50a56ab3", "score": "0.587506", "text": "saveToMessageQueue(messageEntity) {\n return __awaiter(this, void 0, void 0, function* () {\n this.state.messageQueue.push(messageEntity);\n return yield this._saveToPersistent();\n });\n }", "title": "" }, { "docid": "cc6bedc9a21fd180ab01c6920c7a97b6", "score": "0.586977", "text": "enqueue(item) {\n this.queue.push(item)\n }", "title": "" }, { "docid": "3e1b422fbef34dcbe83cde8a32df885f", "score": "0.5816221", "text": "enqueue(newItem) {\n this.q.push(newItem)\n }", "title": "" }, { "docid": "3e1b422fbef34dcbe83cde8a32df885f", "score": "0.5816221", "text": "enqueue(newItem) {\n this.q.push(newItem)\n }", "title": "" }, { "docid": "56deb070bbf95003c677b6d4a2d9ea12", "score": "0.5805674", "text": "static publish(message, callback) {\n let {queue, event, payload} = message;\n console.log(message);\n Queue.io.of(queue).to(event).emit('trigger', payload);\n if (callback) callback();\n }", "title": "" }, { "docid": "2cbd3fb561686c56f9b3bdfdf563cfd4", "score": "0.5765494", "text": "function queueMessage(payload) {\n // Defines the data and the attributes of the PubSub message\n var data = payload.data;\n var attributes = payload;\n if (attributes.data !== undefined) {\n delete attributes['data'];\n }\n\n //Defines the topic name and create it if it does not exist\n var topicName = payload.deviceType;\n getTopic(topicName, (err, topic) => {\n if (err) {\n console.log('Error occurred while getting pubsub topic', err);\n return;\n }\n\n const publisher = topic.publisher();\n publisher.publish(Buffer.from(data), attributes, err => {\n if (err) {\n console.log('Error occurred while queuing background task', err);\n } else {\n console.log(`Book queued for background processing`);\n }\n });\n });\n}", "title": "" }, { "docid": "e13c2ca1570bd6f4648a9549f3b95efe", "score": "0.5735213", "text": "function new_queue() {\n run(get_queue())\n }", "title": "" }, { "docid": "933b3f773d36bd32909dc20f467fd337", "score": "0.5729472", "text": "function postMessage(message) {\n if(typeof(message)==\"object\")\n message = JSON.stringify(message);\n console.log('Sending too ', url,'\\nmessage : ', message);\n client.getQueue(url, function(err, queue){\n\n if(err) console.log(\"queue does not exist\");\n\n //messages must be strings for now...\n \n queue.sendMessage(message, function(err){\n if(err) console.log(\"send failed!\");\n });\n\n });\n}", "title": "" }, { "docid": "6222e3f9f7492110e07276c8ca7491bd", "score": "0.57200533", "text": "function queueMessage(){\n console.log('Message queued');\n\n var payload = {\n title: document.getElementById('name').value,\n description: document.getElementById('messagetext').value,\n };\n console.log('messagesList',messagesList)\n // Save to indexdb\n idbKeyval.set('sendPost', messagesList);\n}", "title": "" }, { "docid": "25a3924edf17f122476e5c29724d1e4c", "score": "0.5703949", "text": "function addMessage() {\n\t\t\t\tevent.preventDefault();\n\n\t\t\t\tvar message = {\n\t\t\t\t\tuser: session.name,\n\t\t\t\t\ttext: self.newMessage,\n\t\t\t\t\tcreated_at: Date.now()\n\t\t\t\t};\n\n\t\t\t\tself.messages.$add(message).then(function (ref) {\n\t\t\t\t\tconsole.log('success: ' + ref.key);\n\n\t\t\t\t\tself.newMessage = '';\n\n\t\t\t\t}, function (error) {\n\t\t\t\t\tconsole.log(error);\n\t\t\t\t});\n\t\t\t}", "title": "" }, { "docid": "f02c76a90ced36c0b221193dea96c1b6", "score": "0.569765", "text": "function queue(data) {\n _messageBuffer.appendMessage(data);\n\n if (_messageBuffer.contents.length >= maxBufferSizeRecords) {\n _report();\n }\n }", "title": "" }, { "docid": "52defed20d978cfc480a62bd14a735b0", "score": "0.56654996", "text": "add(messege) {\r\n\t\tthis.messages.push({message, timestamp: Date.now()});\r\n\t}", "title": "" }, { "docid": "89d581e70c041a5bfb4bdda08f97c20a", "score": "0.56456023", "text": "async HandlePressSend(newMessage = []) {\n if (!this.props.curRoom.RoomID) {\n const members = this.props.curRoom.Data.Members;\n const newRoom = this.CreateNewRoom(members);\n this.PushAndUseNewRoom(newRoom).then((value) => {\n this.state.messages = [];\n this.SendMessage(newMessage);\n });\n } else {\n this.SendMessage(newMessage);\n }\n this.setState({ currentMessage: \"\", currentVideo: \"\" });\n }", "title": "" }, { "docid": "3cb042a303be49258240aaa781d8d513", "score": "0.56093556", "text": "processQueue(self){\n if(self.queue.length === 0) return;\n\n console.log(\"Processing queue\");\n let outbound = self.queue\n self.queue = []\n let msg\n while(msg = outbound.shift(0)){\n self.connector.send(msg);\n }\n }", "title": "" }, { "docid": "c238b606c86f96e83097cae658143033", "score": "0.5598139", "text": "function handleSend(newMessage = []) {\n setMessages(GiftedChat.append(messages, newMessage))\n }", "title": "" }, { "docid": "92ce7d7b40374ed3c2463edb26d26011", "score": "0.5565551", "text": "function sendToRouterService(message) {\n if (!transport || (transport instanceof Promise)) {\n Logger.system.warn(\"RouterClient: Queuing message since router initialization not complete\", message);\n queue.push(message);\n }\n else {\n transport.send(message);\n }\n }", "title": "" }, { "docid": "89ce54df868fe45ee421ba4accf710af", "score": "0.5565355", "text": "function _enqueue_chunk(self, message) { \n \n console.log(\"_enqueue_chunk: self.sourceBuffer.updating = \" + self.sourceBuffer.updating ); \n\n if (self.sourceBuffer.updating === true) {\n \n // still processing buffer, push message\n if (self.vq.length < self.MAX_VQ_LENGTH) { \n \n self.vq.push( message.payloadBytes );\n } else {\n self.handler({\n error: \"Queue depth exceeded dropping video\",\n errno: self.VIDEO_QUEUE_DEPTH_EXCEEDED\n }); \n }\n } else {\n // append to video buffer\n console.log(\"appending \" + message.payloadBytes.length + \" bytes\");\n self.sourceBuffer.appendBuffer( message.payloadBytes );\n }\n\n\n // stop dequeue timer if not needed \n if ( (self.vq.length == 0) && (self.dequeue_timer !== null) )\n {\n console.log(\"disable dequeue timer\");\n clearInterval(self.dequeue_timer);\n self.dequeue_timer = null; \n }\n else if ( (self.vq.length > 0) && (self.dequeue_timer === null) )\n {\n // we don't know the frame rate but we have to move fast\n console.log(\"enable dequeue timer\");\n self.dequeue_timer = setInterval(_dequeue_chunk, 50, self);\n }\n \n return true;\n}", "title": "" }, { "docid": "f1ef8bcb768445a18484bb1cbf4e2b09", "score": "0.5519259", "text": "enqueue(element) {\n // adding element to the queue\n this.items.push(element);\n }", "title": "" }, { "docid": "eba37736c2c552a6d42873a10b133d6a", "score": "0.5513629", "text": "enqueue(item) {\n return this.queue.push(item)\n }", "title": "" }, { "docid": "1afebfa3864278ac0e6c601f105d9628", "score": "0.5510753", "text": "sendMessage({commit}, message) {\n \n commit(\"SET_MESSAGE\", \"\")\n commit(\"SET_MESSAGE_LOADING\", true)\n\n // send message asynchron\n commit('ADD_MESSAGE', message)\n\n // finaly:\n commit(\"SET_MESSAGE_LOADING\", false)\n }", "title": "" }, { "docid": "fe5e441aea044a2d4935bb11f2806b13", "score": "0.5505553", "text": "async push(name, payload, queue) {\n\t\treturn this._storeNewJob({\n\t\t\tqueue,\n\t\t\tname,\n\t\t\tpayload,\n\t\t\tavailable: moment().toDate()\n\t\t})\n\t}", "title": "" }, { "docid": "02d75163da79a5bc07e2576d2f84eba3", "score": "0.54790175", "text": "function sendMessage () {\n var message = $inputMessage.val();\n var submitTime = new Date($.now());\n submitTime = submitTime.toString();\n if (message) {\n $inputMessage.val('');\n addChatMessage({\n username: username,\n message: message,\n submitTime: submitTime\n });\n socket.emit('new message', {message: message, submitTime: submitTime});\n }\n }", "title": "" }, { "docid": "14f8cb162ec01fe4a00cbd7abbbea74d", "score": "0.54751486", "text": "message(value) {\n this.newMessage = value\n }", "title": "" }, { "docid": "f768ccec5c6a903c2ea67fe6b29f0db3", "score": "0.5473942", "text": "ls_pushMessage (msg) {\n ls.set('new-message', msg)\n }", "title": "" }, { "docid": "708ff220bb999b1f4649d372e24554e7", "score": "0.54567724", "text": "sendMessage(message){\n this.#messages.push(message)\n }", "title": "" }, { "docid": "90ba88d535f8fa5c2c748c5303c2f979", "score": "0.54539573", "text": "enqueue(element) {\r\n\t\t// adding element to the queue \r\n\t\tthis.items.push(element);\r\n\t}", "title": "" }, { "docid": "1b9b0cfed5806ceb1911d8ec652f087c", "score": "0.5446747", "text": "sendMessage(message) {\n this.message.next(message);\n this.clearMessageIn(DURATION);\n return;\n }", "title": "" }, { "docid": "8317bed8cfe30eac7c70a3948bc035de", "score": "0.5433052", "text": "function handleNewQuestion(msg) {\n console.info('client :: New Question!!' + JSON.stringify(msg));\n if (!msg.msg || msg.msg.length == 0) {\n console.info('client :: Ignoring empty question');\n return;\n }\n var question = questionDistributor.submitQuestion(socket.id, msg.sender, msg.msg, msg.language);\n socketChannel.to(socket.id).emit('questionAck', question);\n console.info('client :: Message pending...' + JSON.stringify(msg));\n }", "title": "" }, { "docid": "eacc5a739ebfc264b857a70964bacf0a", "score": "0.54175806", "text": "function queueMessage(data, attributes) {\n // Defines the data and the attributes of the PubSub message\n var data = JSON.stringify(data);\n var attributes = attributes;\n console.log(data);\n getTopic((err, topic) => {\n if (err) {\n console.log('Error occurred while getting pubsub topic', err);\n return;\n }\n\n const publisher = topic.publisher();\n publisher.publish(Buffer.from(data), attributes, err => {\n if (err) {\n console.log('Error occurred while queuing background task', err);\n } else {\n console.log(`Message queued for background processing`);\n }\n });\n });\n}", "title": "" }, { "docid": "54a051859eea9af731a0c14ad1fd2729", "score": "0.54087114", "text": "function worker(message) {\n console.log(`Processing \"${message.message.data}\"...`);\n\n setTimeout(() => {\n console.log(`Finished procesing \"${message.message.data}\".`);\n isProcessed = true;\n }, 30000);\n }", "title": "" }, { "docid": "d56bb0404f51b147e09f8dd7ab7db335", "score": "0.539886", "text": "_enqueue(data) {\n\t\tthis._queue.push(data);\n\t\tif (this._queue.length > this.max_queue_size) {\n\t\t\tthis._queue.splice(0, 1);\n\t\t}\n\t}", "title": "" }, { "docid": "9c002b3cd6b8d9fb0feea68d61fe5c8c", "score": "0.5397876", "text": "async issueMessage(message) {\n let resolver = null;\n\n const observerPromise = new Promise(resolve => resolver = resolve);\n\n dispatchEvent('playertext', {\n playerid: this.id,\n text: message,\n\n // Injected for tests, should be called when processing the message is complete.\n resolver,\n });\n\n await observerPromise;\n }", "title": "" }, { "docid": "d4ba55353f3c45bd8d39e76957ffda2f", "score": "0.539139", "text": "send (userId, ...args) {\n this._sendingQueue.add(() => this._send('message', ...args), userId)\n }", "title": "" }, { "docid": "5144855acdf6bed44852fa066f412d24", "score": "0.5385643", "text": "_onSendMessage() {\n console.log('Send Message requested');\n this._processAndSendMessage(this.state.text);\n\n this.state.text = '';\n this.state.shouldShowSendMessageButton = false;\n this.setState(this.state);\n }", "title": "" }, { "docid": "f78514922cc786d6c918c235286cbe5b", "score": "0.53591007", "text": "function enqueue() {\n\tqueue.add(this.id);\n\tqueue.draw();\n\tif (queue.length() == 1) {\n\t\tchangeSong(this.id);\n\t}\n}", "title": "" }, { "docid": "8539f9a2f1f363a37e8b8b5d6a69870c", "score": "0.5351663", "text": "function pushMessageForMessagethread(message) {\n newMessage = message;\n return messagethreadModel.pushMessage(messagethreadId, newMessage._id);\n }", "title": "" }, { "docid": "5fc808ceee4206c6eef124df7cde9260", "score": "0.53428173", "text": "async onAddMessage(event) {\n event.preventDefault();\n var upvotesRef = database.ref(\n \"/ppls/\" + this.state.keyUserFb + \"/countNew\"\n );\n await upvotesRef.transaction(function(current_value) {\n return (current_value || 0) + 1;\n });\n\n await database\n .ref(\"/ppls/\" + this.state.keyUserFb + \"/notification/\")\n .push({ message: this.input.value, sender: this.state.username });\n }", "title": "" }, { "docid": "7f98a281ec000e0ae989a607b5cfea69", "score": "0.53289586", "text": "addMessage(message) {\n if (this.messages === undefined) {\n this.messages = [];\n }\n this.messages.push(message);\n }", "title": "" }, { "docid": "7f98a281ec000e0ae989a607b5cfea69", "score": "0.53289586", "text": "addMessage(message) {\n if (this.messages === undefined) {\n this.messages = [];\n }\n this.messages.push(message);\n }", "title": "" }, { "docid": "c41fbe48dddc0370461be00bcf756640", "score": "0.53226644", "text": "_onQueueUpdate() {\n this.forceUpdate();\n }", "title": "" }, { "docid": "ad641941704273bc42a3c82b0ee2c064", "score": "0.53193825", "text": "grabPutQueue() {\n this.__inPut++;\n }", "title": "" }, { "docid": "5f20330d7a6895ad5edfde2fc4cc966c", "score": "0.5317193", "text": "handleSubmit(event) {\n event.preventDefault();\n\n // loading state\n this.setState(prevState => ({\n loading: !prevState.loading\n }));\n\n // call method to insert a new message\n Meteor.call('messages.new', { content: this.state.content }, (err, res) => {\n // handle error\n \n // no more loading state, clean the input\n this.setState(prevState => ({\n loading: !prevState.loading,\n content: '',\n }));\n });\n }", "title": "" }, { "docid": "ce855fd6c84057a69abb2d2fddfbc0e8", "score": "0.5313989", "text": "async publishToTopic(ctx, topicNumber, newMessage) {\n console.info('============= START : Publish to a Topic ===========');\n\n const topicAsBytes = await ctx.stub.getState(topicNumber); // get the topic from chaincode state\n if (!topicAsBytes || topicAsBytes.length === 0) {\n throw new Error(`${topicNumber} does not exist`);\n }\n const topic = JSON.parse(topicAsBytes.toString());\n topic.message = newMessage;\n\n await ctx.stub.putState(topicNumber, Buffer.from(JSON.stringify(topic)));\n \n const name_broker = publisher_id + '_' + topicNumber\n\n const updateUrl = `http://${brokerServer}:${brokerPort}${brokerInvokePath}`\n console.log(await updateTopic(updateUrl, name_broker, newMessage))\n \n console.info('============= END : Publish to a Topic ===========');\n }", "title": "" }, { "docid": "a3fafd137eea7edde0ea0b3b67eca6b5", "score": "0.5310928", "text": "run(msg) {\n this.v.once(`${msg.id}_error`, (err) => {\n msg.channel.createMessage(this.t(err));\n this.v.removeListener('queue');\n });\n this.v.once(`${msg.id}_queue`, (queue) => {\n msg.channel.createMessage(this.buildReply(queue, msg));\n this.v.removeListener('error');\n });\n this.v.getQueue(msg);\n }", "title": "" }, { "docid": "05b6c13e7fc008c899afa7ee2d277a6f", "score": "0.531061", "text": "enqueue (item) {\n // limit capacity\n if (this.hasReachedCapacity()) {\n if (this.errorOnCapacityLimit) {\n throw new Error('Queue reached capacity:' + this.capacity);\n } else {\n this.dequeue();\n } // drop one item\n }\n\n this.queue.push(item);\n }", "title": "" }, { "docid": "925f7dacedbb1deb47f0f31e7f413971", "score": "0.53104556", "text": "add(item) {\n this.queueStack.push(item)\n }", "title": "" }, { "docid": "85869d8786cecf27efb82c248c6d4d51", "score": "0.53061247", "text": "addMessage(text) {\n const ref = firebase.database().ref(`${REF}/messages`).push();\n ref.set({\n _id: this.id,\n _key: ref.key,\n _timestamp: Date.now(),\n text,\n });\n }", "title": "" }, { "docid": "91c7b4ea24f8e9590f5fc61cfaced5c1", "score": "0.5274656", "text": "dequeueMessage() {\n\t\tthis.messageCompleted = false;\n\t\tthis.messageQueue.shift();\n\t\tthis.dialogueText.text = \"\";\n\n\t\tif (this.messageQueue.length === 0) {\n\t\t\tthis.closeDialogueBox();\n\t\t}\n\t\telse {\n\t\t\tthis.showMessage();\n\t\t}\n\t}", "title": "" }, { "docid": "0217d4ff28497ee678be341f4b290c15", "score": "0.52715516", "text": "_enqueue(value) {\n if(!this.items.length === null)\n throw new Error(\"Nothing to enqueue\")\n this.items.push(value);\n }", "title": "" }, { "docid": "0180300c9f5ba67187403c9dbd05cc78", "score": "0.52714", "text": "function saveMessage(name, message){\n var newMessageRef = messagesRef.push();\n newMessageRef.set({\n name: name,\n message: message\n });\n }", "title": "" }, { "docid": "fa34a6c34496764b1773172c4101cf69", "score": "0.5264208", "text": "function sendMessageToQueue(queue, message) {\n return new Promise(async (resolve, reject) => {\n const connection =\n RabbitMQ.RabbitMQ.publisherConnection ||\n (await RabbitMQ.connect(\"publisher\"));\n if (!RabbitMQ.RabbitMQ.publisherChannel) {\n await RabbitMQ.createChannel(connection, \"publisher\");\n }\n RabbitMQ.RabbitMQ.publisherChannel.assertQueue(\n queue,\n { durable: true },\n (error, ok) => {\n if (error) {\n Sentry.captureException(error);\n console.error(\"Error asserting queue: \", error);\n return reject(error);\n }\n }\n );\n RabbitMQ.RabbitMQ.publisherChannel.sendToQueue(queue, Buffer.from(message));\n resolve(true);\n console.log(\"Mensaje enviado\");\n });\n}", "title": "" }, { "docid": "111fc8698992c084884545d6c1ac521d", "score": "0.52603555", "text": "function add(item) {\n exports.Queue.push(item);\n}", "title": "" }, { "docid": "86cd8ac5feb375594cde6de3068f8418", "score": "0.5252385", "text": "function drainQueue() {\n let item = messageQueue.shift();\n if (item) {\n setTimeout(() => {\n if (connected) {\n fire.apply(this, item);\n drainQueue();\n } else {\n messageQueue.unshift(item);\n }\n }, drainInterval);\n }\n }", "title": "" }, { "docid": "366ac8c975539d7f18791474b2bc940e", "score": "0.52451175", "text": "function doQueue() {\n\tvar qty = queue.length;\n\tif (qty > 0) {// are there any elements in queue?\n\t\tpreprocess(queue.shift());\n\t}\n\tif (qty > 1) {\t// more than 1 berfore queue.pop()?\n\t\tsetTimeout(doQueue, 10);\n\t} else {\t// queue empty\n\t\tif (onQueueEmptyCallback && typeof onQueueEmptyCallback == 'function'){\n\t\t\tonQueueEmptyCallback();\n\t\t\tonQueueEmptyCallback = undefined;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "7a775850d98d3fdcc4196c3247a2b2c8", "score": "0.52438456", "text": "handleSendMessage(msg, promise, uploader) {\n const topic = this.tinode.getTopic(this.state.topicSelected);\n\n msg = topic.createMessage(msg, false);\n // The uploader is used to show progress.\n msg._uploader = uploader;\n\n if (!topic.isSubscribed()) {\n if (!promise) {\n promise = Promise.resolve();\n }\n promise = promise.then(() => { return topic.subscribe(); });\n }\n\n if (promise) {\n promise = promise.catch((err) => {\n this.handleError(err.message, 'err');\n });\n }\n\n topic.publishDraft(msg, promise)\n .then((ctrl) => {\n if (topic.isArchived()) {\n return topic.archive(false);\n }\n })\n .catch((err) => {\n this.handleError(err.message, 'err');\n });\n }", "title": "" }, { "docid": "f324e6090299ed5e1299e10449c96b62", "score": "0.5242585", "text": "function handleSubmit(e) {\n e.preventDefault();\n socket.emit(\"new message\", {\n message: newMessage,\n user: props.user,\n });\n setNewMessage(\"\");\n }", "title": "" }, { "docid": "0910d172cfffac9d35b172fad99d0d39", "score": "0.5239593", "text": "function sendMessage(message) {\n serviceBusClient.sendQueueMessage(config.eventHubName, message,\n function(error) {\n if (error) {\n logger.log('info', error);\n }\n else\n {\n logger.log('info', 'Message sent to queue');\n }\n });\n}", "title": "" }, { "docid": "5ac2a8b5760f6a5db0d6efc660d490db", "score": "0.52254045", "text": "function _Process_queue ()\n\t{\n\t\tif ( _is_queue_working )\n\t\t\treturn;\n\t\t\n\t\tif ( _queue.length > 0 )\n\t\t{\n\t\t\t_is_queue_working = true;\n\t\t\t\n\t\t\tvar request_callback = _queue_callbacks.shift();\n\t\t\t_queue.shift();\n\t\t\t\n\t\t\tif ( _queue_delay > 0 )\n\t\t\t\twindow.setTimeout( function ()\n\t\t\t\t{\n\t\t\t\t\t_Triggers.On_queue_advance();\n\t\t\t\t\trequest_callback( true );\n\t\t\t\t}, _queue_delay );\n\t\t\telse\n\t\t\t{\n\t\t\t\t_Triggers.On_queue_advance();\n\t\t\t\trequest_callback( true );\n\t\t\t}\n\t\t}\n\t\telse\n\t\t\t_Triggers.On_queue_end();\n\t}", "title": "" }, { "docid": "ce062f25c4a1f93a565b693f002d7473", "score": "0.52223486", "text": "schedule(fn) {\n this._queue.schedule(fn)\n }", "title": "" }, { "docid": "641c951bcb99b36d0bc6eceb9dadb95b", "score": "0.5218377", "text": "sendMessage(message){\n let self = this;\n self.internalMessageBuffer.push(message);\n }", "title": "" }, { "docid": "da07635ac4173e0be059c2b6b0e39d0b", "score": "0.52088445", "text": "_executeQueue() {\n this._queue.forEach((options) => {\n this._postMessage(options.message, options.detail);\n });\n this._clearQueue();\n }", "title": "" }, { "docid": "da2ea68ec2dc57525eb4baf6b6c407e8", "score": "0.5203036", "text": "function receivedMessage(message) {\n setMessages(oldMsgs => [...oldMsgs, message]);\n }", "title": "" }, { "docid": "105fcbbe6a685be12a8112668fb02183", "score": "0.5196348", "text": "sendNextMessageInQueue() {\n if (!this.commandsQueue.length) return\n let command = this.commandsQueue[0]\n\n // This next line ensures that we don't send a second command until a\n // response from the first has been reveived:\n if (command.sent) return\n\n if (Array.isArray(command.cmd)) {\n logger.debug(`Sending ${command.cmd.length} commands:\\n` + command.cmd.map(c => { return ` [${c}]\\n`}).join(''))\n command.cmd = command.cmd.map(c => c + '\\n').join('')\n }\n else {\n logger.debug(`Sending command: [${command.cmd}]`)\n command.cmd = `${command.cmd}\\n`\n }\n\n command.sent = true\n this.client.write(command.cmd)\n\n if (command.args.expectResponse === false) {\n this.commandsQueue.shift()\n command.responseHandler()\n this.sendNextMessageInQueue() // time to do next message\n }\n }", "title": "" }, { "docid": "fbb502043a89f5206c0953fa7dab3b04", "score": "0.5192327", "text": "function onNewMessage(message) {\n\tvar options = message.options || {};\n\n\tif (!isInited) {\n\t\tinit(message.processId, message.continueLastJob, options);\n\t}\n\n\tbusy();\n\n\tif (message.action === 'sort' &&\n\t\tjobStatus.get('nextLine') <= jobStatus.get('endLine')) {\n\t\tdoSort(jobStatus.get('fn'));\n\t} else {\n\t\tidle();\n\t}\n}", "title": "" }, { "docid": "757bc5784003357a6c7487262137e278", "score": "0.51734364", "text": "async postMessage() {\n\t\tthis.setState({ loading: true });\n\n\t\tvar body = {\n\t\t\ttype: AppX.objects.message,\n\t\t\tcreatedOn: new Date(),\n\t\t\ttext: this.state.message,\n\t\t\tissue: {\n\t\t\t\treference: 'Issue',\n\t\t\t\trootType: '$IssueT3',\n\t\t\t\trootId: this.props.id,\n\t\t\t\texternalType: '$IssueT3',\n\t\t\t},\n\t\t\tlicensee: {\n\t\t\t\t'memberId': '5717989018004281',\n\t\t\t}\n\t\t};\n\n\t\tvar appx = await AppX.create(body);\n\n\t\tif (appx.data) {\n\t\t\tthis.props.navigator.pop();\n\t\t\tthis.props.reload();\n\t\t} else {\n\t\t\talert('We were\\'nt able to create your message. Please try again later.');\n\t\t}\n\n\t\tthis.setState({ loading: false });\n\t}", "title": "" }, { "docid": "7c5479ddddda978d93e788453f6cff78", "score": "0.51706856", "text": "function consumer() {\r\n // asserts the queue exists\r\n publisherChannel.assertQueue(queue, {durable: true});\r\n //consumes the queue\r\n publisherChannel.consume(queue, function (msg) {\r\n if (msg !== null) {\r\n // writes the received message to the console\r\n logger.log(\"info\", \" [x] Received \" + msg.content.toString());\r\n // acknowledge that the message was received\r\n publisherChannel.ack(msg);\r\n }\r\n });\r\n}", "title": "" }, { "docid": "38b697babd6c57c383ff9e8eb1ccf58a", "score": "0.516767", "text": "function addWorkToQueue(work, queue) {\n queue.push(work);\n}", "title": "" }, { "docid": "fe71e135e82cb56615446c9724dfeffb", "score": "0.5155618", "text": "async function enqueue(data) {\n await this.ready;\n this.send(data);\n}", "title": "" }, { "docid": "35c2b98bf133659d011b9d3679b52838", "score": "0.51476204", "text": "queueEntry (key, entryData) {\n\t\tvar self = this;\n\n\t\t// careful, queue.add does not return a function\n\t\tthis.queue.add( function () {\n\t\t\treturn self.__callCreateEntry(key, entryData);\n\t\t});\n\t}", "title": "" }, { "docid": "9dee7ffdb103088cbd0155b8d9748199", "score": "0.51475984", "text": "applyQueue() {\n const readFromQueue = () => {\n if(this.#queue.length) {\n const queueItem = this.#queue.shift();\n this[queueItem.action] (queueItem.params)\n }\n else {\n this.#queueIsActive = false;\n clearInterval(this.#queueInterval);\n }\n }\n this.#queueInterval = setInterval(readFromQueue, 1);\n }", "title": "" }, { "docid": "789099fababf3102484d4f26f0e91913", "score": "0.51471686", "text": "recordMessage(message) //adds a single message to the .json\n {\n this.json[\"messages\"].push(message);\n this.updateWordCount(message);\n }", "title": "" }, { "docid": "7cdf5b2ac349aa3e9d60467dbbdf0578", "score": "0.5146681", "text": "handleSubmit(message) {\n this.send(message, () => {\n this.refresh();\n });\n }", "title": "" }, { "docid": "616cb2a5a8fedb7e3d608684d63b3d1e", "score": "0.5140567", "text": "addEntry(message) {\n\t this.entries.push(message);\n\t this.save();\n }", "title": "" }, { "docid": "7f08c6cc59f152e0d44cde56f1083dfa", "score": "0.513301", "text": "enqueue(value){\n this.storage[this.size()+ 1] = value;\n // Add to top of the queue\n // increment counter by one\n\n }", "title": "" }, { "docid": "ebf65fce3544243f28ad59e0b3762c3c", "score": "0.51237583", "text": "addMessage() { \n\n if(this.newMessage.length > 0) {\n\n let contattoAttivo = this.contacts[this.contatto_corrente];\n contattoAttivo.messages.push({\n date: dayjs().format('DD/MM/YYYY HH:mm:ss'),\n text: this.newMessage,\n status:'sent'\n })\n this.newMessage = ''\n\n setTimeout(() => \n contattoAttivo.messages.push({\n date: dayjs().format('DD/MM/YYYY HH:mm:ss'),\n text: 'OK! 😄',\n status:'received'\n }) ,1000) \n } \n }", "title": "" }, { "docid": "5264f28a601647c667bd2aaa5e86f483", "score": "0.5121818", "text": "function enqueueUser(message){\n person = message.author;\n game = person.presence.game;\n //make sure they are not already in the queue\n var inqueue = queue[game].findIndex(function(el) {\n return el = [person.username, person.discriminator]\n });\n if(!(inqueue === -1)) {\n message.channel.send('You\\'re already in the ' + game + ' queue');\n return;\n }\n message.channel.send('Putting ' + person.username + ' into the ' + game + ' queue');\n queue[game].push([person.username, person.discriminator]);\n //describe the queue\n displayQueueStatus(message)\n}", "title": "" }, { "docid": "dcd82928eab1a00a650e80df79be0172", "score": "0.5120078", "text": "function pushMessage(message) {\n\tvar payloads = [\n\t\t{topic: kafkaProperties.RAW_DRONE_MESSAGES_TOPIC, messages: message}\n\t];\n\n\tproducer.send(payloads, function (err, data) {\n\t\tif (err) console.log(\"pushMessage:\", err);\n\t\telse if (data) console.log(\"pushMessage:\", data);\n\t});\n}", "title": "" }, { "docid": "01d870b98ecc84a2344d7d9268ea3c3b", "score": "0.5117556", "text": "function pushStep(message) {\n if (message == null)\n throw TypeError('A message must be provided');\n\n var step = getNextStep();\n commitStep(step, message);\n}", "title": "" }, { "docid": "f2ac448727f77d072df01ad542db402d", "score": "0.51053387", "text": "_push (value, heft) {\n const queue = this.async\n queue.size += heft\n queue._head = queue._head.next = {\n next: null,\n heft: heft,\n value: value,\n end: value == null,\n count: 0,\n shifters: 0,\n unshifters: 0\n }\n }", "title": "" }, { "docid": "9fc6900047f4053b8f7263e7145e4241", "score": "0.51007366", "text": "enqueue(string) {\n this.storage[this.recentIndex] = string;\n this.recentIndex++;\n }", "title": "" }, { "docid": "2958e86e873f56319f7b58465cef7f6d", "score": "0.5098915", "text": "enqueue(process) {}", "title": "" }, { "docid": "3896e124dc4f4da3e7e561c3d3e9c8a2", "score": "0.5094647", "text": "function postMessage(handler, msg) {\r\n\t // Handle the common case of a non-conflatable message.\r\n\t if (!msg.isConflatable) {\r\n\t enqueueMessage(handler, msg);\r\n\t return;\r\n\t }\r\n\t // Conflate the message with an existing message if possible.\r\n\t var conflated = algorithm_1.some(messageQueue, function (posted) {\r\n\t if (posted.handler !== handler) {\r\n\t return false;\r\n\t }\r\n\t if (!posted.msg) {\r\n\t return false;\r\n\t }\r\n\t if (posted.msg.type !== msg.type) {\r\n\t return false;\r\n\t }\r\n\t if (!posted.msg.isConflatable) {\r\n\t return false;\r\n\t }\r\n\t return posted.msg.conflate(msg);\r\n\t });\r\n\t // Enqueue the message if it was not conflated.\r\n\t if (!conflated) {\r\n\t enqueueMessage(handler, msg);\r\n\t }\r\n\t }", "title": "" }, { "docid": "4c5be289d608ea64709534d7fb38998b", "score": "0.50727", "text": "createMessage(text, time) {\n var that = this;\n\t\tvar obj = new String(text);\n\t\tthis.messages.push(obj);\n\t\tsetTimeout(function() { that.messages.splice(that.messages.indexOf(obj), 1); }, time);\n\t}", "title": "" }, { "docid": "3bd1748565cff0fbb4dce371e5c91754", "score": "0.5070374", "text": "publish(message) {\n this.props.pubSubHub.publish(this.props.id, message);\n }", "title": "" } ]
25a83c9164cc2def47a332e2da58c58f
Read the actual heights of the rendered lines, and update their stored heights to match.
[ { "docid": "a2ebdb3f40d801d1aee4f9d737dd6184", "score": "0.0", "text": "function updateHeightsInViewport(cm) {\n\t var display = cm.display;\n\t var prevBottom = display.lineDiv.offsetTop;\n\t for (var i = 0; i < display.view.length; i++) {\n\t var cur = display.view[i], height = (void 0);\n\t if (cur.hidden) { continue }\n\t if (ie && ie_version < 8) {\n\t var bot = cur.node.offsetTop + cur.node.offsetHeight;\n\t height = bot - prevBottom;\n\t prevBottom = bot;\n\t } else {\n\t var box = cur.node.getBoundingClientRect();\n\t height = box.bottom - box.top;\n\t }\n\t var diff = cur.line.height - height;\n\t if (height < 2) { height = textHeight(display); }\n\t if (diff > .005 || diff < -.005) {\n\t updateLineHeight(cur.line, height);\n\t updateWidgetHeight(cur.line);\n\t if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n\t { updateWidgetHeight(cur.rest[j]); } }\n\t }\n\t }\n\t}", "title": "" } ]
[ { "docid": "ecb99a0c8432aab7abf0fd5933278567", "score": "0.6686384", "text": "function updateLineHeight(line,height){var diff=height-line.height;if(diff)for(var n=line;n;n=n.parent){n.height+=diff;}} // Given a line object, find its line number by walking up through", "title": "" }, { "docid": "f8a3d6c2e16c4e375029ac5bc42ecb68", "score": "0.6595145", "text": "function updateLineHeight(line, height) {\n let diff = height - line.height;\n if (diff) for (let n = line; n; n = n.parent) n.height += diff;\n} // Given a line object, find its line number by walking up through", "title": "" }, { "docid": "f7f0d92ba62dccf333972c68cbfcb148", "score": "0.65765935", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n\n if (diff) {\n for (var n = line; n; n = n.parent) {\n n.height += diff;\n }\n }\n } // Given a line object, find its line number by walking up through", "title": "" }, { "docid": "f7f0d92ba62dccf333972c68cbfcb148", "score": "0.65765935", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n\n if (diff) {\n for (var n = line; n; n = n.parent) {\n n.height += diff;\n }\n }\n } // Given a line object, find its line number by walking up through", "title": "" }, { "docid": "f7f0d92ba62dccf333972c68cbfcb148", "score": "0.65765935", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n\n if (diff) {\n for (var n = line; n; n = n.parent) {\n n.height += diff;\n }\n }\n } // Given a line object, find its line number by walking up through", "title": "" }, { "docid": "f7f0d92ba62dccf333972c68cbfcb148", "score": "0.65765935", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n\n if (diff) {\n for (var n = line; n; n = n.parent) {\n n.height += diff;\n }\n }\n } // Given a line object, find its line number by walking up through", "title": "" }, { "docid": "97dbba96f74ac6caabc98f95b5d1f422", "score": "0.65490913", "text": "function updateWidgetHeight(line) {\n if (line.widgets) {\n for (var i = 0; i < line.widgets.length; ++i) {\n line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight;\n }\n }\n }", "title": "" }, { "docid": "2ffd485fd51ddbe38672e074440fbdfe", "score": "0.6536929", "text": "checkHeight() {\n const el = ReactDOM.findDOMNode(this);\n let lineHeight = el.style.lineHeight || window.getComputedStyle(el).lineHeight;\n let fontSize = el.style.fontSize || window.getComputedStyle(el).fontSize;\n\n fontSize = Number(fontSize.replace('px',''))\n\n if (lineHeight == 'normal') {\n lineHeight = 1.2 * fontSize;\n } else {\n lineHeight = Number(lineHeight.replace('px', ''));\n }\n\n // In all honesty, the below calculation is a result of trial\n // and error -- I'm not quite sure why it works as well as it does.\n const height = (lineHeight + (fontSize/4));\n\n if (height != this.state.height) {\n this.setState({\n height\n });\n }\n }", "title": "" }, { "docid": "93c1b604fd6d78944e1f25f83e6c59d7", "score": "0.65324223", "text": "function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.offsetHeight;\n }", "title": "" }, { "docid": "93c1b604fd6d78944e1f25f83e6c59d7", "score": "0.65324223", "text": "function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.offsetHeight;\n }", "title": "" }, { "docid": "93c1b604fd6d78944e1f25f83e6c59d7", "score": "0.65324223", "text": "function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.offsetHeight;\n }", "title": "" }, { "docid": "93c1b604fd6d78944e1f25f83e6c59d7", "score": "0.65324223", "text": "function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.offsetHeight;\n }", "title": "" }, { "docid": "93c1b604fd6d78944e1f25f83e6c59d7", "score": "0.65324223", "text": "function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.offsetHeight;\n }", "title": "" }, { "docid": "93c1b604fd6d78944e1f25f83e6c59d7", "score": "0.65324223", "text": "function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.offsetHeight;\n }", "title": "" }, { "docid": "93c1b604fd6d78944e1f25f83e6c59d7", "score": "0.65324223", "text": "function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.offsetHeight;\n }", "title": "" }, { "docid": "93c1b604fd6d78944e1f25f83e6c59d7", "score": "0.65324223", "text": "function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.offsetHeight;\n }", "title": "" }, { "docid": "93c1b604fd6d78944e1f25f83e6c59d7", "score": "0.65324223", "text": "function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.offsetHeight;\n }", "title": "" }, { "docid": "894485acb853b4425ce89477e5a65933", "score": "0.6531384", "text": "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i)\n { line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight; } }\n }", "title": "" }, { "docid": "f0f6e3e9ef71f920660c0ae7c9568c22", "score": "0.6522878", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) {\n for (var n = line; n; n = n.parent) {\n n.height += diff;\n }\n }\n }", "title": "" }, { "docid": "5455678b48b0b018d28d0a8dd79d6490", "score": "0.65206814", "text": "function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight;\n }", "title": "" }, { "docid": "5455678b48b0b018d28d0a8dd79d6490", "score": "0.65206814", "text": "function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight;\n }", "title": "" }, { "docid": "5455678b48b0b018d28d0a8dd79d6490", "score": "0.65206814", "text": "function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight;\n }", "title": "" }, { "docid": "c49a9685b59bfe6021b4e4c37469b31e", "score": "0.6517417", "text": "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i)\n { line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight } }\n}", "title": "" }, { "docid": "c49a9685b59bfe6021b4e4c37469b31e", "score": "0.6517417", "text": "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i)\n { line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight } }\n}", "title": "" }, { "docid": "140c6506ce9e5da191cf17fac6ca62d3", "score": "0.65114695", "text": "function updateWidgetHeight(line) {\n\t if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n\t line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight;\n\t }", "title": "" }, { "docid": "c5827a0de14cbdeb6dd7730b9652ebbe", "score": "0.6505487", "text": "function maintainAbsLineHeight() {\n\n//$(\".absLine\").height(eleHeightCount-2* 53);\n //\n $('.absLine').css({minHeight: $('#statemachine-demo').height()});\n}", "title": "" }, { "docid": "c72d0e3af4be6a5e05346b63b7d9f94a", "score": "0.6504852", "text": "function updateHeightsInViewport(cm){var display=cm.display;var prevBottom=display.lineDiv.offsetTop;for(var i=0;i<display.view.length;i++){var cur=display.view[i],height;if(cur.hidden)continue;if(ie&&ie_version<8){var bot=cur.node.offsetTop+cur.node.offsetHeight;height=bot-prevBottom;prevBottom=bot;}else {var box=cur.node.getBoundingClientRect();height=box.bottom-box.top;}var diff=cur.line.height-height;if(height<2)height=textHeight(display);if(diff>.001||diff<-.001){updateLineHeight(cur.line,height);updateWidgetHeight(cur.line);if(cur.rest)for(var j=0;j<cur.rest.length;j++){updateWidgetHeight(cur.rest[j]);}}}} // Read and store the height of line widgets associated with the", "title": "" }, { "docid": "bbf259522ef8198db20a1acfd0caf329", "score": "0.6492107", "text": "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i)\n { line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight; } }\n}", "title": "" }, { "docid": "bbf259522ef8198db20a1acfd0caf329", "score": "0.6492107", "text": "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i)\n { line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight; } }\n}", "title": "" }, { "docid": "bbf259522ef8198db20a1acfd0caf329", "score": "0.6492107", "text": "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i)\n { line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight; } }\n}", "title": "" }, { "docid": "bbf259522ef8198db20a1acfd0caf329", "score": "0.6492107", "text": "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i)\n { line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight; } }\n}", "title": "" }, { "docid": "bbf259522ef8198db20a1acfd0caf329", "score": "0.6492107", "text": "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i)\n { line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight; } }\n}", "title": "" }, { "docid": "bbf259522ef8198db20a1acfd0caf329", "score": "0.6492107", "text": "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i)\n { line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight; } }\n}", "title": "" }, { "docid": "87f881ea97d7b5ae0b9b4838c8aecfc7", "score": "0.6476632", "text": "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }", "title": "" }, { "docid": "87f881ea97d7b5ae0b9b4838c8aecfc7", "score": "0.6476632", "text": "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }", "title": "" }, { "docid": "87f881ea97d7b5ae0b9b4838c8aecfc7", "score": "0.6476632", "text": "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }", "title": "" }, { "docid": "87f881ea97d7b5ae0b9b4838c8aecfc7", "score": "0.6476632", "text": "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }", "title": "" }, { "docid": "87f881ea97d7b5ae0b9b4838c8aecfc7", "score": "0.6476632", "text": "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }", "title": "" }, { "docid": "87f881ea97d7b5ae0b9b4838c8aecfc7", "score": "0.6476632", "text": "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }", "title": "" }, { "docid": "87f881ea97d7b5ae0b9b4838c8aecfc7", "score": "0.6476632", "text": "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }", "title": "" }, { "docid": "87f881ea97d7b5ae0b9b4838c8aecfc7", "score": "0.6476632", "text": "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }", "title": "" }, { "docid": "87f881ea97d7b5ae0b9b4838c8aecfc7", "score": "0.6476632", "text": "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }", "title": "" }, { "docid": "87f881ea97d7b5ae0b9b4838c8aecfc7", "score": "0.6476632", "text": "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }", "title": "" }, { "docid": "87f881ea97d7b5ae0b9b4838c8aecfc7", "score": "0.6476632", "text": "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }", "title": "" }, { "docid": "87f881ea97d7b5ae0b9b4838c8aecfc7", "score": "0.6476632", "text": "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }", "title": "" }, { "docid": "87f881ea97d7b5ae0b9b4838c8aecfc7", "score": "0.6476632", "text": "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }", "title": "" }, { "docid": "6a484ee4c072afe82b3f89bb6b6f1be3", "score": "0.6472347", "text": "getHeight() {\n return Math.max.apply(Math, this.lines.map(el => {\n if (el.y0 > el.y1) {\n return el.y0;\n }\n else {\n return el.y1;\n }\n })) + 20;\n }", "title": "" }, { "docid": "db4c5f3d35f8ec75b68da6c0e81b8db1", "score": "0.64595664", "text": "function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i],\n wrapping = cm.options.lineWrapping;\n var height = void 0,\n width = 0;\n\n if (cur.hidden) {\n continue;\n }\n\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top; // Check that lines don't extend past the right of the current\n // editor width\n\n if (!wrapping && cur.text.firstChild) {\n width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1;\n }\n }\n\n var diff = cur.line.height - height;\n\n if (diff > .005 || diff < -.005) {\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n\n if (cur.rest) {\n for (var j = 0; j < cur.rest.length; j++) {\n updateWidgetHeight(cur.rest[j]);\n }\n }\n }\n\n if (width > cm.display.sizerWidth) {\n var chWidth = Math.ceil(width / charWidth(cm.display));\n\n if (chWidth > cm.display.maxLineLength) {\n cm.display.maxLineLength = chWidth;\n cm.display.maxLine = cur.line;\n cm.display.maxLineChanged = true;\n }\n }\n }\n } // Read and store the height of line widgets associated with the", "title": "" }, { "docid": "db4c5f3d35f8ec75b68da6c0e81b8db1", "score": "0.64595664", "text": "function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i],\n wrapping = cm.options.lineWrapping;\n var height = void 0,\n width = 0;\n\n if (cur.hidden) {\n continue;\n }\n\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top; // Check that lines don't extend past the right of the current\n // editor width\n\n if (!wrapping && cur.text.firstChild) {\n width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1;\n }\n }\n\n var diff = cur.line.height - height;\n\n if (diff > .005 || diff < -.005) {\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n\n if (cur.rest) {\n for (var j = 0; j < cur.rest.length; j++) {\n updateWidgetHeight(cur.rest[j]);\n }\n }\n }\n\n if (width > cm.display.sizerWidth) {\n var chWidth = Math.ceil(width / charWidth(cm.display));\n\n if (chWidth > cm.display.maxLineLength) {\n cm.display.maxLineLength = chWidth;\n cm.display.maxLine = cur.line;\n cm.display.maxLineChanged = true;\n }\n }\n }\n } // Read and store the height of line widgets associated with the", "title": "" }, { "docid": "db4c5f3d35f8ec75b68da6c0e81b8db1", "score": "0.64595664", "text": "function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i],\n wrapping = cm.options.lineWrapping;\n var height = void 0,\n width = 0;\n\n if (cur.hidden) {\n continue;\n }\n\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top; // Check that lines don't extend past the right of the current\n // editor width\n\n if (!wrapping && cur.text.firstChild) {\n width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1;\n }\n }\n\n var diff = cur.line.height - height;\n\n if (diff > .005 || diff < -.005) {\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n\n if (cur.rest) {\n for (var j = 0; j < cur.rest.length; j++) {\n updateWidgetHeight(cur.rest[j]);\n }\n }\n }\n\n if (width > cm.display.sizerWidth) {\n var chWidth = Math.ceil(width / charWidth(cm.display));\n\n if (chWidth > cm.display.maxLineLength) {\n cm.display.maxLineLength = chWidth;\n cm.display.maxLine = cur.line;\n cm.display.maxLineChanged = true;\n }\n }\n }\n } // Read and store the height of line widgets associated with the", "title": "" }, { "docid": "db4c5f3d35f8ec75b68da6c0e81b8db1", "score": "0.64595664", "text": "function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i],\n wrapping = cm.options.lineWrapping;\n var height = void 0,\n width = 0;\n\n if (cur.hidden) {\n continue;\n }\n\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top; // Check that lines don't extend past the right of the current\n // editor width\n\n if (!wrapping && cur.text.firstChild) {\n width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1;\n }\n }\n\n var diff = cur.line.height - height;\n\n if (diff > .005 || diff < -.005) {\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n\n if (cur.rest) {\n for (var j = 0; j < cur.rest.length; j++) {\n updateWidgetHeight(cur.rest[j]);\n }\n }\n }\n\n if (width > cm.display.sizerWidth) {\n var chWidth = Math.ceil(width / charWidth(cm.display));\n\n if (chWidth > cm.display.maxLineLength) {\n cm.display.maxLineLength = chWidth;\n cm.display.maxLine = cur.line;\n cm.display.maxLineChanged = true;\n }\n }\n }\n } // Read and store the height of line widgets associated with the", "title": "" }, { "docid": "d4bb8765e264d813289e15b38dd31954", "score": "0.64494985", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "title": "" }, { "docid": "d4bb8765e264d813289e15b38dd31954", "score": "0.64494985", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "title": "" }, { "docid": "d4bb8765e264d813289e15b38dd31954", "score": "0.64494985", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "title": "" }, { "docid": "d4bb8765e264d813289e15b38dd31954", "score": "0.64494985", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "title": "" }, { "docid": "d4bb8765e264d813289e15b38dd31954", "score": "0.64494985", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "title": "" }, { "docid": "d4bb8765e264d813289e15b38dd31954", "score": "0.64494985", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "title": "" }, { "docid": "d4bb8765e264d813289e15b38dd31954", "score": "0.64494985", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "title": "" }, { "docid": "d4bb8765e264d813289e15b38dd31954", "score": "0.64494985", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "title": "" }, { "docid": "d4bb8765e264d813289e15b38dd31954", "score": "0.64494985", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "title": "" }, { "docid": "d4bb8765e264d813289e15b38dd31954", "score": "0.64494985", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "title": "" }, { "docid": "d4bb8765e264d813289e15b38dd31954", "score": "0.64494985", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "title": "" }, { "docid": "d4bb8765e264d813289e15b38dd31954", "score": "0.64494985", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "title": "" }, { "docid": "d4bb8765e264d813289e15b38dd31954", "score": "0.64494985", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "title": "" }, { "docid": "d4bb8765e264d813289e15b38dd31954", "score": "0.64494985", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "title": "" }, { "docid": "d0231db6cbe97c4ef1fcaf3c17c69155", "score": "0.64380497", "text": "function updateWidgetHeight(line) {\n\t if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i)\n\t { line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight } }\n\t}", "title": "" }, { "docid": "f880f6630d8e29bd6ffe11a0d1d767fd", "score": "0.6434718", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "title": "" }, { "docid": "f880f6630d8e29bd6ffe11a0d1d767fd", "score": "0.6434718", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "title": "" }, { "docid": "f880f6630d8e29bd6ffe11a0d1d767fd", "score": "0.6434718", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "title": "" }, { "docid": "f880f6630d8e29bd6ffe11a0d1d767fd", "score": "0.6434718", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "title": "" }, { "docid": "f880f6630d8e29bd6ffe11a0d1d767fd", "score": "0.6434718", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "title": "" }, { "docid": "f880f6630d8e29bd6ffe11a0d1d767fd", "score": "0.6434718", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "title": "" }, { "docid": "f880f6630d8e29bd6ffe11a0d1d767fd", "score": "0.6434718", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "title": "" }, { "docid": "f880f6630d8e29bd6ffe11a0d1d767fd", "score": "0.6434718", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "title": "" }, { "docid": "f880f6630d8e29bd6ffe11a0d1d767fd", "score": "0.6434718", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "title": "" }, { "docid": "f880f6630d8e29bd6ffe11a0d1d767fd", "score": "0.6434718", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "title": "" }, { "docid": "f880f6630d8e29bd6ffe11a0d1d767fd", "score": "0.6434718", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "title": "" }, { "docid": "f4ca239f395f64a8a5a5c0313805d883", "score": "0.6421203", "text": "function updateWidgetHeight(line) {\n\t if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i)\n\t { line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight; } }\n\t}", "title": "" }, { "docid": "f4ca239f395f64a8a5a5c0313805d883", "score": "0.6421203", "text": "function updateWidgetHeight(line) {\n\t if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i)\n\t { line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight; } }\n\t}", "title": "" }, { "docid": "02bd47d7351a668477037444c988214f", "score": "0.64098555", "text": "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n}", "title": "" }, { "docid": "02bd47d7351a668477037444c988214f", "score": "0.64098555", "text": "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n}", "title": "" }, { "docid": "02bd47d7351a668477037444c988214f", "score": "0.64098555", "text": "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n}", "title": "" }, { "docid": "02bd47d7351a668477037444c988214f", "score": "0.64098555", "text": "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n}", "title": "" }, { "docid": "02bd47d7351a668477037444c988214f", "score": "0.64098555", "text": "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n}", "title": "" }, { "docid": "02bd47d7351a668477037444c988214f", "score": "0.64098555", "text": "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n}", "title": "" }, { "docid": "02bd47d7351a668477037444c988214f", "score": "0.64098555", "text": "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n}", "title": "" }, { "docid": "02bd47d7351a668477037444c988214f", "score": "0.64098555", "text": "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n}", "title": "" }, { "docid": "1a6092988d81a570819f2d6cd0c2db2f", "score": "0.63785475", "text": "function updateLineHeight(line, height) {\n\t var diff = height - line.height;\n\t if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n\t }", "title": "" }, { "docid": "6185f136299744f45b3d66dd7f3a7d42", "score": "0.6375941", "text": "lineHeight(lineHeight) {\n this.lh = lineHeight;\n }", "title": "" }, { "docid": "6ae2f2ac542aaa0ef511f06d97f31260", "score": "0.63526696", "text": "function updateHeightsInViewport(cm) {\n let display = cm.display;\n let prevBottom = display.lineDiv.offsetTop;\n\n for (let i = 0; i < display.view.length; i++) {\n let cur = display.view[i],\n wrapping = cm.options.lineWrapping;\n let height,\n width = 0;\n if (cur.hidden) continue;\n\n if (_util_browser_js__WEBPACK_IMPORTED_MODULE_3__[\"ie\"] && _util_browser_js__WEBPACK_IMPORTED_MODULE_3__[\"ie_version\"] < 8) {\n let bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n let box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top; // Check that lines don't extend past the right of the current\n // editor width\n\n if (!wrapping && cur.text.firstChild) width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1;\n }\n\n let diff = cur.line.height - height;\n\n if (diff > .005 || diff < -.005) {\n Object(_line_utils_line_js__WEBPACK_IMPORTED_MODULE_1__[\"updateLineHeight\"])(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) for (let j = 0; j < cur.rest.length; j++) updateWidgetHeight(cur.rest[j]);\n }\n\n if (width > cm.display.sizerWidth) {\n let chWidth = Math.ceil(width / Object(_measurement_position_measurement_js__WEBPACK_IMPORTED_MODULE_2__[\"charWidth\"])(cm.display));\n\n if (chWidth > cm.display.maxLineLength) {\n cm.display.maxLineLength = chWidth;\n cm.display.maxLine = cur.line;\n cm.display.maxLineChanged = true;\n }\n }\n }\n} // Read and store the height of line widgets associated with the", "title": "" }, { "docid": "73d529201916f39d8ace94704a15769a", "score": "0.6307098", "text": "function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], height = (void 0);\n if (cur.hidden) { continue }\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n }\n var diff = cur.line.height - height;\n if (height < 2) { height = textHeight(display); }\n if (diff > .001 || diff < -.001) {\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n { updateWidgetHeight(cur.rest[j]); } }\n }\n }\n }", "title": "" }, { "docid": "aa6edd12e211db7b98859f0d73bbbcda", "score": "0.62978274", "text": "_layout(visibleLines) {\n // First figure out what our virtual first line is\n var firstLine = Math.floor(this._verticalOffset / this.lineHeight);\n // Now layout out each line.\n for (let i = 0; i < visibleLines; i++) {\n let l = this._lines[i];\n l.style.top = (i * this.lineHeight) + 'px';\n }\n // Populate lines, loading immediately rather than delaying for scrolling.\n // Resizes won't \"skip past\" lines so it's OK to start loading as soon as\n // new content is visible rather than waiting to see if the user skips past\n // it.\n this._populateLines(firstLine, visibleLines, true);\n // Also update our scrollbar.\n this._scrollBar.visibleArea = this.container.offsetHeight;\n this._scrollBar.total = this.lineHeight * this.totalLines;\n }", "title": "" }, { "docid": "49da6f67be89794c3b38bcbb280bc84b", "score": "0.6294086", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff } }\n}", "title": "" }, { "docid": "49da6f67be89794c3b38bcbb280bc84b", "score": "0.6294086", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff } }\n}", "title": "" }, { "docid": "62323da3332005368b5d7e56dd969bee", "score": "0.6285592", "text": "function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i],\n height = void 0;\n if (cur.hidden) {\n continue;\n }\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n }\n var diff = cur.line.height - height;\n if (height < 2) {\n height = textHeight(display);\n }\n if (diff > .001 || diff < -.001) {\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) {\n for (var j = 0; j < cur.rest.length; j++) {\n updateWidgetHeight(cur.rest[j]);\n }\n }\n }\n }\n }", "title": "" }, { "docid": "775e8508983c47ba94f0177fbacd1c55", "score": "0.6266571", "text": "function updateLineHeight(line, height) {\n\t var diff = height - line.height;\n\t if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n\t}", "title": "" }, { "docid": "775e8508983c47ba94f0177fbacd1c55", "score": "0.6266571", "text": "function updateLineHeight(line, height) {\n\t var diff = height - line.height;\n\t if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n\t}", "title": "" }, { "docid": "ff540d0599bae5da5f01eed8805da255", "score": "0.62644905", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n}", "title": "" }, { "docid": "ff540d0599bae5da5f01eed8805da255", "score": "0.62644905", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n}", "title": "" }, { "docid": "ff540d0599bae5da5f01eed8805da255", "score": "0.62644905", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n}", "title": "" }, { "docid": "ff540d0599bae5da5f01eed8805da255", "score": "0.62644905", "text": "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n}", "title": "" } ]
966767f7abc61f752a956de849fde8cc
change of end angle
[ { "docid": "12c756e530527a24ad106dce20ac3d54", "score": "0.7458542", "text": "function outputEndAngle(size){\n\tvar intSize = parseInt(size);\n\n\tif(startAngle < intSize)\n\t{\n\t\tEndAngle = intSize;\n\t}\n\tif(startAngle == 0 && EndAngle == 0)\n\t\tEndAngle = 1;\n\telse if(startAngle == 360 && EndAngle == 360)\n\t\tEndAngle = 359;\t\n\t\t\n\tdrawCircle(circle, innerCircle);\n}", "title": "" } ]
[ { "docid": "b08def3c5873bfe66d36c81828b40440", "score": "0.74540544", "text": "function outputEndAngle(size){\n\tvar intSize = parseInt(size);\n\n\tif(startAngle < intSize)\n\t{\n\t\tEndAngle = intSize;\n\t}\n\tif(startAngle == 0 && EndAngle == 0)\n\t\tEndAngle = 1;\n\telse if(startAngle == 360 && EndAngle == 360)\n\t\tEndAngle = 359;\t\n\t\n\tdrawCircle(circle, innerCircle);\n}", "title": "" }, { "docid": "32531ab51922972e4ff68badd1d75e58", "score": "0.74511844", "text": "updateAngle() {\n if(this.radians > this.maxAngle) {\n this.clockwise = true\n } else if (this.radians < this.minAngle){\n this.clockwise = false\n }\n\n if(this.clockwise) {\n this.step--\n } else {\n this.step++\n }\n\n this.radians = this.step*this.angularConst + this.minAngle\n }", "title": "" }, { "docid": "ea06cad818dd87b73a2b2fe76cf62267", "score": "0.72784054", "text": "function angle(d) {\n var a = (d.startAngle + d.endAngle) * 90 / Math.PI - 180;\n //console.log(a < 180 ? a + 180 : a, a);\n return a < 180 ? a + 180 : a;\n }", "title": "" }, { "docid": "2d69a830f7bbae0041ef3cbea2d4489d", "score": "0.7135415", "text": "static LerpAngle(start, end, amount) {\n var num = Scalar.Repeat(end - start, 360.0);\n if (num > 180.0) {\n num -= 360.0;\n }\n return start + num * Scalar.Clamp(amount);\n }", "title": "" }, { "docid": "1cd0357fb2746fa88879a659ee4727fa", "score": "0.71129835", "text": "function angle(d) {\n\t\t\t\tvar a = (d.startAngle + d.endAngle) * 90 / Math.PI - 90;\n\t\t\t\treturn a > 90 ? a - 180 : a;\n\t\t\t}", "title": "" }, { "docid": "76c1e0d59aaab87bc9bc005a779f4b25", "score": "0.7080951", "text": "function angle(n){\n return (n - 2) * 180;\n}", "title": "" }, { "docid": "c3d9fca9cfb0e6ead8fdfed84da4757a", "score": "0.7079313", "text": "function angle(d) {\n\t\t\t\t var a = (d.startAngle + d.endAngle) * 90 / Math.PI - 90;\n\t\t\t\t return a > 90 ? a - 180 : a;\n\t\t\t\t}", "title": "" }, { "docid": "6b9836f996505e1a0091cff9af465c7e", "score": "0.70627105", "text": "function angle(d) {\n var a = (d.startAngle + d.endAngle) * 90 / Math.PI - 90;\n return a > 90 ? a - 180 : a;\n }", "title": "" }, { "docid": "e3c969aafa6689addecd48b9c3240705", "score": "0.7058939", "text": "function angle(d) {\n\t\t var a = (d.startAngle + d.endAngle) * 90 / Math.PI - 90;\n\t\t return a > 90 ? a - 180 : a;\n\t\t}", "title": "" }, { "docid": "37fe014dc71ed0c85a0445ecf2a999c4", "score": "0.70420384", "text": "angle()\n {\n const angle = this.angleRaw();\n return (angle >= -90 && angle <= 180) ? angle + 90 : angle + 450;\n }", "title": "" }, { "docid": "5501c33482e61ab767e3a26aad2aebdf", "score": "0.7041929", "text": "function angle(d) {\n var a = (d.startAngle + d.endAngle) * 90 / Math.PI - 90;\n return a > 90 ? a - 180 : a;\n }", "title": "" }, { "docid": "5501c33482e61ab767e3a26aad2aebdf", "score": "0.7041929", "text": "function angle(d) {\n var a = (d.startAngle + d.endAngle) * 90 / Math.PI - 90;\n return a > 90 ? a - 180 : a;\n }", "title": "" }, { "docid": "c4252d00ad740607639529c4878f0821", "score": "0.70338917", "text": "function angle(d) {\n\t\t\tvar a = (d.startAngle + d.endAngle) * 90 / Math.PI - 90;\n\t\t\treturn a > 90 ? a - 180 : a;\n\t\t}", "title": "" }, { "docid": "c4252d00ad740607639529c4878f0821", "score": "0.70338917", "text": "function angle(d) {\n\t\t\tvar a = (d.startAngle + d.endAngle) * 90 / Math.PI - 90;\n\t\t\treturn a > 90 ? a - 180 : a;\n\t\t}", "title": "" }, { "docid": "f6fd7643b2f1330498934b05a148dd90", "score": "0.7025611", "text": "function angle(n) {\n return (n - 2) * 180;\n}", "title": "" }, { "docid": "82496e84a20764c3a61dde6a0992e3a2", "score": "0.70245576", "text": "function caluculateAngle() {\n\t\t\tvar x = start.x - end.x;\n\t\t\tvar y = end.y - start.y;\n\t\t\tvar r = Math.atan2(y, x); //radians\n\t\t\tvar angle = Math.round(r * 180 / Math.PI); //degrees\n\n\t\t\t//ensure value is positive\n\t\t\tif (angle < 0) {\n\t\t\t\tangle = 360 - Math.abs(angle);\n\t\t\t}\n\n\t\t\treturn angle;\n\t\t}", "title": "" }, { "docid": "10b32c481ffea515f7cb104b0213d2b6", "score": "0.702163", "text": "function angle(d) {\n var a = (d.startAngle + d.endAngle) * 90 / Math.PI - 90;\n return a > 90 ? a - 180 : a;\n }", "title": "" }, { "docid": "10b32c481ffea515f7cb104b0213d2b6", "score": "0.702163", "text": "function angle(d) {\n var a = (d.startAngle + d.endAngle) * 90 / Math.PI - 90;\n return a > 90 ? a - 180 : a;\n }", "title": "" }, { "docid": "5264bee1032c814eb4ce3cff88bcab87", "score": "0.70145756", "text": "function angle(d) {\n\t var a = (d.startAngle + d.endAngle) * 90 / Math.PI - 90;\n\t return a > 90 ? a - 180 : a;\n\t }", "title": "" }, { "docid": "ed3e6b7c5aa84850c8de49a1170f3231", "score": "0.6986904", "text": "function rev(angle) \t{return angle-Math.floor(angle/360.0)*360.0;}\t\t// 0<=a<360", "title": "" }, { "docid": "c319e4af942ee533b8ff5a60c1099b22", "score": "0.69803", "text": "function angle(d) {\r\n var a = (d.startAngle + d.endAngle) * 90 / Math.PI - 90;\r\n return a > 90 ? a - 180 : a;\r\n }", "title": "" }, { "docid": "aa7546214cdb14b5b09d1536447c738d", "score": "0.6969785", "text": "set eulerAngles(value) {}", "title": "" }, { "docid": "97bd182560fa4c630a799dd4d9b1263d", "score": "0.6956515", "text": "function angle(d) {\n\t\tvar a = (d.startAngle + d.endAngle) * 90 / Math.PI - 90;\n\t\treturn a > 90 ? a - 180 : a;\n\t}", "title": "" }, { "docid": "517dbf05f2dabb6d213787cf1933cf69", "score": "0.69507694", "text": "function angle(d) {\n var a = (d.startAngle + d.endAngle) * 90 / Math.PI - 90;\n return a > 90 ? a - 180 : a;\n }", "title": "" }, { "docid": "d2fa98e0e87030d96b4a8a6e36000c75", "score": "0.69506925", "text": "function angle(d) {\n var a = (d.startAngle + d.endAngle) * 90 / Math.PI - 90;\n return a > 90 ? a - 180 : a;\n }", "title": "" }, { "docid": "69b97186978a7ee6481242be3f59f1d8", "score": "0.691619", "text": "static DeltaAngle(current, target) {\n var num = Scalar.Repeat(target - current, 360.0);\n if (num > 180.0) {\n num -= 360.0;\n }\n return num;\n }", "title": "" }, { "docid": "8d2c055e7819cfc44dfc35ba2f70b599", "score": "0.6899204", "text": "function otherAngle(a, b) {\n return 180 - (a + b)\n}", "title": "" }, { "docid": "64f6997334e376b317780aef9f951c3b", "score": "0.6878143", "text": "function angle(d) {\n const a = ((d.startAngle + d.endAngle) * 90) / Math.PI - 90\n return a > 90 ? a - 180 : a\n }", "title": "" }, { "docid": "bbefb920440c760243c81d64f5a60b6f", "score": "0.6864029", "text": "function angle(d) {\n let a = (d.startAngle + d.endAngle) * 90 / Math.PI - 90;\n return a > 90 ? a - 180 : a;\n }", "title": "" }, { "docid": "e53c14f0082369ecc454a8343b90dbbe", "score": "0.68619764", "text": "function otherAngle(a, b) {\n return 180 - a - b;\n}", "title": "" }, { "docid": "05ab1b3e57fede353e76a4e5e66681c5", "score": "0.68423223", "text": "function angle(d) {\n var a = (d.startAngle + d.endAngle) * 90 / Math.PI - 90;\n return a > 90 ? a - 180 : a;\n }", "title": "" }, { "docid": "05ab1b3e57fede353e76a4e5e66681c5", "score": "0.68423223", "text": "function angle(d) {\n var a = (d.startAngle + d.endAngle) * 90 / Math.PI - 90;\n return a > 90 ? a - 180 : a;\n }", "title": "" }, { "docid": "feeff0a199c057ac467b512b18de220c", "score": "0.68412143", "text": "get initialAngle()\r\n {\r\n return this.initAng;\r\n }", "title": "" }, { "docid": "f9459cb5e291fba6d2a78393f85bf865", "score": "0.6837787", "text": "function otherAngle(a, b) {\n return (180 - a) - b;\n}", "title": "" }, { "docid": "5ef02e074d7dc90bcf7442eb0e27a2cf", "score": "0.6825089", "text": "function angle(d) {\n let a = (d.startAngle + d.endAngle) *90/Math.PI-90;\n return a > 90 ? a - 180 : a;\n }", "title": "" }, { "docid": "2b450ae67661ac5e7a76e53a3cab0033", "score": "0.6816215", "text": "function otherAngle(a, b) {\n return 180 - (a + b);\n}", "title": "" }, { "docid": "de1d07e9b6d058982d6b037b5cd50144", "score": "0.6804191", "text": "function fixangle(a)\n{\n return a - 360.0 * (Math.floor(a / 360.0));\n}", "title": "" }, { "docid": "efe41a381e97642667d00d340c71daa7", "score": "0.6786505", "text": "function fixAngle( a ) {\n if (a<0) return a+360;\n if (a>360) return a-360;\n return a;\n}", "title": "" }, { "docid": "15a0d4b534c7b55054700db6d6b5d5e4", "score": "0.67558557", "text": "convertAngle() {\n let angle = this.angle;\n\n if (angle === \"east\" || angle === \"e\") angle = 0;else if (angle === \"eastnortheast\" || angle === \"ene\") angle = 30;else if (angle === \"northeast\" || angle === \"ne\") angle = 45;else if (angle === \"northnorthast\" || angle === \"nne\") angle = 60;else if (angle === \"north\" || angle === \"n\") angle = 90;else if (angle === \"northnorthwest\" || angle === \"nnw\") angle = 120;else if (angle === \"northwest\" || angle === \"nw\") angle = 135;else if (angle === \"westnorthwest\" || angle === \"wnw\") angle = 150;else if (angle === \"west\" || angle === \"w\") angle = 180;else if (angle === \"westsouthwest\" || angle === \"wsw\") angle = 210;else if (angle === \"southwest\" || angle === \"sw\") angle = 225;else if (angle === \"southsouthwest\" || angle === \"ssw\") angle = 240;else if (angle === \"south\" || angle === \"s\") angle = 270;else if (angle === \"southsoutheast\" || angle === \"sse\") angle = 300;else if (angle === \"southeast\" || angle === \"se\") angle = 315;else if (angle === \"eastsoutheast\" || angle === \"ese\") angle = 330;\n\n this.angle = angle * -(Math.PI / 180);\n return this;\n }", "title": "" }, { "docid": "d5f37f2c30f35713356ea7795ad8507f", "score": "0.6749362", "text": "setAngle(a)\n {\n this.dir = p5.Vector.fromAngle(a);\n }", "title": "" }, { "docid": "c752bf737b9da97c90d73bf160512069", "score": "0.67296344", "text": "function fixAngle (angle) {\n return (angle - 90) * DEG_TO_RAD;\n }", "title": "" }, { "docid": "cc3761a9bbb4982098d957701612f729", "score": "0.67137396", "text": "function fixAngle (angle) {\n\t\treturn (angle - 90) * DEG_TO_RAD;\n\t}", "title": "" }, { "docid": "08f7a31f5f1b02054516da8918345663", "score": "0.6711357", "text": "function fixAngle(a) {\n while (a < -180) {\n a += 360;\n }\n while (a > 180) {\n a -= 360;\n }\n return a;\n}", "title": "" }, { "docid": "08f7a31f5f1b02054516da8918345663", "score": "0.6711357", "text": "function fixAngle(a) {\n while (a < -180) {\n a += 360;\n }\n while (a > 180) {\n a -= 360;\n }\n return a;\n}", "title": "" }, { "docid": "e5e3eda59ce6775156a72a01ccf42383", "score": "0.6709941", "text": "updateAngle(){\n let width = this.calcWidth();\n let height = this.calcHeight();\n\n let angle = Math.atan(width/height);\n\n // put angle in correct quadrant\n if (width < 0 && height < 0){\n angle -= Math.PI;\n }\n else if (width > 0 && height < 0){\n angle += Math.PI;\n }\n \n this.angle = angle;\n }", "title": "" }, { "docid": "fd75cf5fd32abf667d54a22929819b95", "score": "0.6702475", "text": "get newAngle() {\n let calculation = this.calculateAngle(new Vector(1,0));\n return this.calculateAngle(new Vector(1, 0));\n }", "title": "" }, { "docid": "e0dca4eeb67462058ed46da817cb30a2", "score": "0.6701121", "text": "function otherAngle(a, b) {\n\treturn 180 - a - b\n}", "title": "" }, { "docid": "beb6770620b445d4ef7b32c91fcd0613", "score": "0.66760665", "text": "angle(other) {}", "title": "" }, { "docid": "e16f35cc7f79fa582f8a1bcc69756302", "score": "0.6656324", "text": "function rev(/** @type {number} */ angle) {\n return angle - Math.floor(angle / 360.0) * 360.0;\n}", "title": "" }, { "docid": "f2ed9d8d3ff0ccabb25becfac12981c3", "score": "0.6648396", "text": "swapGoalAngle(){\n\n // naturally this will break when at edge of 0 -> 360\n if(this.getOrbitDirection() === -1 &&\n this.getDirection() < this.getGoalAngle()){\n\n // inverting orbital direction\n this.setOrbitDirection(this.getOrbitDirection()*-1);\n\n // swaping goal angle and source angle to invert direction\n let oldGoal = this.getGoalAngle();\n this.setGoalAngle(this.getStartAngle());\n this.setStartAngle(oldGoal);\n\n } else if(this.getOrbitDirection() === 1 &&\n this.getDirection() > this.getGoalAngle()){\n\n // inverting orbital direction\n this.setOrbitDirection(this.getOrbitDirection()*-1);\n\n // swaping goal angle and source angle to invert direction\n let oldGoal = this.getGoalAngle();\n this.setGoalAngle(this.getStartAngle());\n this.setStartAngle(oldGoal);\n\n }\n\n\n }", "title": "" }, { "docid": "96a038befb60417f24ee45921d3cafb7", "score": "0.6647965", "text": "function AdjustAngle (angle)\r\n {\r\n if (angle > 2*Math.PI)\r\n angle -= 2*Math.PI;\r\n else if (angle < -2*Math.PI)\r\n angle += 2*Math.PI;\r\n\r\n return angle;\r\n }", "title": "" }, { "docid": "3c9465836125848eaa954c06d5d5af31", "score": "0.66443133", "text": "function mirror_angle_v(ang) {\n\treturn -ang;\n}", "title": "" }, { "docid": "ffcabd13199c438a360df7ed653178b9", "score": "0.6607925", "text": "angle(){\n return Math.atan2(this.y, this.x)\n }", "title": "" }, { "docid": "e7bf0e95f02de16fa6d823db77695265", "score": "0.66077644", "text": "function mirror_angle_h(ang) {\n\treturn -ang + 180;\n}", "title": "" }, { "docid": "5c4ec71535aaa58f2f3c01c50a2c6ada", "score": "0.6586986", "text": "angle() {\n return Math.atan2(this.y, this.x);\n }", "title": "" }, { "docid": "20711e6b1df829f625e2a68d47101937", "score": "0.65549237", "text": "function getOppAngle(angle) {\r\n\tangle *= 180 / Math.PI;\r\n\tangle += ( 180 ) % 360;\r\n\treturn angle;\r\n}", "title": "" }, { "docid": "a3e9bdf2528dec123d4359b83f643032", "score": "0.65365505", "text": "calculateAngles(x, y) {\n if (!this.selectedSlider) return;\n\n let max = this.selectedSlider.max,\n min = this.selectedSlider.min,\n step = this.selectedSlider.step,\n endAngle = Math.atan2(y - this.y0, x - this.x0),\n ang_degrees = Slider.radToDeg(Slider.normalizeTan(endAngle)),\n normalizedValue = Slider.normalizeTan(endAngle) * (max - min) / (2 * Math.PI) + min;\n\n normalizedValue = (normalizedValue / step >> 0) * step;\n\n this.selectedSlider.endAngle = endAngle;\n this.selectedSlider.ang_degrees = ang_degrees;\n this.selectedSlider.normalizedValue = normalizedValue;\n }", "title": "" }, { "docid": "78d6647365af85b30b262cbeb15c5746", "score": "0.65354705", "text": "getAngle() {\n if (this.direction === 0 /* FORWARD */) {\n return -this.angle;\n }\n return this.angle;\n }", "title": "" }, { "docid": "b0c0d57f0e341b270a67efe213893afe", "score": "0.6523593", "text": "turnRight() {\n this.angle += this.turnMax;\n }", "title": "" }, { "docid": "4c93085436fa4b1851a5bbc07e391dd7", "score": "0.652324", "text": "angle() {\n return Math.atan2(this.y, this.x);\n }", "title": "" }, { "docid": "37b233c06e2bbd96bdbc68a59b4900a7", "score": "0.6519997", "text": "function currentAngle(d, i) {\n return angularScale(d) % 360 + axisConfig.orientation;\n }", "title": "" }, { "docid": "1a7266467056c4484192e72c395cc410", "score": "0.6519734", "text": "function animate() { \n rotAngle= (rotAngle+1.0) % 360;\n}", "title": "" }, { "docid": "98c9966a6d576c7c6a9961dff236c17b", "score": "0.6481748", "text": "angle() {\n const [x, y] = this.nums;\n return Math.atan(y / x);\n }", "title": "" }, { "docid": "7836496d7f1da640079f5e36920d60d4", "score": "0.64737326", "text": "get startAngle() {\r\n return this.i.a8;\r\n }", "title": "" }, { "docid": "c0d89e05757b011ed764a9b6579185d9", "score": "0.6462932", "text": "updateCurrentAngle(diff)\r\n {\r\n this.currAngle += this.angularSpeed * diff;\r\n\r\n if((this.currAngle % (2 * Math.Pi)) > Math.abs(this.initAng + this.rotAng))\r\n this.currAngle = this.initAng + this.rotAng;\r\n }", "title": "" }, { "docid": "d41a3d96148e0fbfe309f3512dbe73c1", "score": "0.645907", "text": "static inverse_angle(angle) {\n return angle + pi > pi ? angle - pi : angle + pi\n }", "title": "" }, { "docid": "fe49a25ee8458c7bfdcd12aff8944da2", "score": "0.6454887", "text": "angle() {\n return this.target.position.sub(this.source.position).angle();\n }", "title": "" }, { "docid": "27354651b9a384c1b530a7573af4aa58", "score": "0.6440354", "text": "get currentAngle()\r\n {\r\n return this.currAngle;\r\n }", "title": "" }, { "docid": "6b62f2e9304ce590f333d8fd286876eb", "score": "0.6422895", "text": "function outputStartAngle(size){\n\tvar intSize = parseInt(size);\n\n\tif(EndAngle > intSize)\n\t{\n\t\tstartAngle = intSize;\n\t}\n\tif(startAngle == 0 && EndAngle == 0)\n\t\tstartAngle = 1;\n\telse if(startAngle == 360 && EndAngle == 360)\n\t\tstartAngle = 359;\n\t\n\tdrawCircle(circle, innerCircle);\n\n}", "title": "" }, { "docid": "09ceac30ae2778c69666885299fba616", "score": "0.64150155", "text": "function OnInitAngleSliderChange ()\r\n {\r\n var angle = document.getElementById ('initAngleSlider').value;\r\n document.getElementById ('initAngleOutput').value = angle + '°';\r\n\r\n _dTheta = angle / 180 * Math.PI;\r\n\r\n drawScreen ();\r\n }", "title": "" }, { "docid": "d4ad5077d98297aaa37229745d16feda", "score": "0.6396507", "text": "function getDirectionAngle(start, end, dirLen) {\n\n var q = 360 / dirLen;\n return Math.floor(g.normalizeAngle(start.theta(end) + q / 2) / q) * q;\n }", "title": "" }, { "docid": "35de25c9a82847c05172a5bda7f768c7", "score": "0.63871175", "text": "function calcAngle(p2) {\n\t// push();\n\t// translate(B_CENTER.x, B_CENTER.y);\n\tvar diff = p5.Vector.sub(B_CENTER, p2).rotate(HALF_PI);\n\tvar azi = degrees(diff.heading()).toFixed(2);\n\t// pop();\n\treturn -azi; \n}", "title": "" }, { "docid": "be4dae8f9a299dd95feaf4f6335050c3", "score": "0.6380766", "text": "setRotationAngle(value)\n {\n this.getJavaClass().setRotationAngleSync(value);\n }", "title": "" }, { "docid": "1aea612be55895e54fdcecf2f185c189", "score": "0.6380347", "text": "[$wrapAngle](radians) {\n const normalized = (radians + Math.PI) / (2 * Math.PI);\n const wrapped = normalized - Math.floor(normalized);\n return wrapped * 2 * Math.PI - Math.PI;\n }", "title": "" }, { "docid": "aa33e93de650392a0ed61e6d46fa1c63", "score": "0.6379731", "text": "effectiveAngle(id, angle) {\n var dir = id[1];\n var a = 0;\n if (dir === '1') a = 45;\n else if (dir === '2') a = 90;\n else if (dir === '3') a = 135;\n else if (dir === '4') a = 180;\n else if (dir === '5') a = 225;\n else if (dir === '6') a = 270;\n else if (dir === '7') a = 315;\n a += angle;\n if (a < 0) a += 360;\n else if (a >= 360) a -= 360;\n return a;\n }", "title": "" }, { "docid": "9beea3c8a8f472ba6d4740bb61e534e9", "score": "0.63717824", "text": "get eulerAngles() {}", "title": "" }, { "docid": "34cee3084863d05867b873dbf86184da", "score": "0.63681215", "text": "function animate(angle) {\n var now = Date.now(); // Calculate the elapsed time\n var elapsed = now - last;\n last = now;\n // Update the current rotation angle (adjusted by the elapsed time)\n var newAngle = angle + (ANGLE_STEP * elapsed) / 1000.0;\n return 1;\n //return newAngle % 360;\n}", "title": "" }, { "docid": "0b7c14f0b6a602f01cd4458d181b9721", "score": "0.63644654", "text": "function midAngle(d) { return d.startAngle + (d.endAngle - d.startAngle) / 2; }", "title": "" }, { "docid": "ff8bcff8edbbc30c5eafe3eb42c56717", "score": "0.6357133", "text": "function outputStartAngle(size){\n\tvar intSize = parseInt(size);\n\n\tif(EndAngle > intSize)\n\t{\n\t\tstartAngle = intSize;\n\t}\n\tif(startAngle == 0 && EndAngle == 0)\n\t\tstartAngle = 1;\n\telse if(startAngle == 360 && EndAngle == 360)\n\t\tstartAngle = 359;\n\t\n\tdrawCircle(circle, innerCircle);\n}", "title": "" }, { "docid": "49e0a0f4302eb9a13280b464ac3f514d", "score": "0.63565695", "text": "rotateUp(radians) {\n const minAngle = -.5 * Math.PI;\n const maxAngle = -minAngle;\n this.yzAngle = Math.max(Math.min(this.yzAngle + radians, maxAngle), minAngle);\n }", "title": "" }, { "docid": "533dd25856dcc760f6ae5db29d99d885", "score": "0.63480705", "text": "function midAngle(d) {\n return d.startAngle + (d.endAngle - d.startAngle) / 2;\n }", "title": "" }, { "docid": "234ce7b3aae916ec631a1f483bebcfda", "score": "0.63396055", "text": "get totalRotation ()\r\n {\r\n return this.initialAngle + this.rotationAngle;\r\n }", "title": "" }, { "docid": "92d3812f02fc1db8ee58f84bce70326d", "score": "0.6334307", "text": "get angle() {\n return this.rotation * RAD_TO_DEG;\n }", "title": "" }, { "docid": "c495ef61385a98e2f67fbcce01cd8623", "score": "0.63342947", "text": "function control(baseAngle, prefs) {\n var angleCenter;\n if (prefs.radius < 0) {\n angleCenter = baseAngle - 90;\n } else {\n angleCenter = baseAngle + 90;\n }\n\n debug('angleCenter' + '\\t' + angleCenter);\n return angleCenter;\n}", "title": "" }, { "docid": "6c4f2d8bbabe7332adfcb2be6f73b8df", "score": "0.63226426", "text": "get startAngle() {\r\n return this.i.c1;\r\n }", "title": "" }, { "docid": "6360d20f664e98c18951c6a8710ee3e6", "score": "0.62837225", "text": "function convertRotationTo360 (value) {\n //return parseInt(value % 360, 10);\n return Math.round( value / scope.options.snap ) * scope.options.snap; \n }", "title": "" }, { "docid": "c01445623cb327fb8392e2892c4c2254", "score": "0.6265426", "text": "setAngle(value, callback) {\n var commands = [];\n\n switch(this.device.widget) {\n default:\n if(this.blindMode && this.targetPosition.value == this.currentPosition.value) {\n var orientation = Math.round((value + 90)/1.8);\n commands.push(new Command('setOrientation', orientation));\n } else {\n return this.setClosureAndOrientation(callback);\n }\n break;\n }\n\t\tthis.device.executeCommand(commands, function(status, error, data) {\n \tswitch (status) {\n case ExecutionState.INITIALIZED:\n callback(error);\n break;\n case ExecutionState.COMPLETED:\n if(this.device.stateless) {\n\t\t\t\t\t\tthis.currentAngle.updateValue(value);\n\t\t\t\t\t}\n break;\n case ExecutionState.FAILED:\n this.targetAngle.updateValue(this.currentAngle.value); // Update target position in case of cancellation\n break;\n }\n }.bind(this), callback);\n }", "title": "" }, { "docid": "4b7b53468ab40fa3692a8426614714a1", "score": "0.6263615", "text": "get angle() {\n return Math.atan2(this.y, this.x);\n }", "title": "" }, { "docid": "ecccc5b51e34565e29cf36e2dc1b3535", "score": "0.6261908", "text": "ToAngleAxis() {}", "title": "" }, { "docid": "06f3421fa1e7300b5faa0fe67bc652d5", "score": "0.6252979", "text": "function midAngle(d)\n{\n\treturn d.startAngle + (d.endAngle - d.startAngle)/2;\n}", "title": "" }, { "docid": "29a8a18475c853f9d9ad8b10c1e135c5", "score": "0.6246159", "text": "function animate(angle) {\r\n var now = Date.now(); // Calculate the elapsed time\r\n var elapsed = now - last;\r\n last = now;\r\n // Update the current rotation angle (adjusted by the elapsed time)\r\n var newAngle = angle + (ANGLE_STEP * elapsed) / 1000.0;\r\n return newAngle % 360;\r\n}", "title": "" }, { "docid": "7260950a907de8c8c345a24e5ef65778", "score": "0.6242759", "text": "function animate(angle) {\n var now = Date.now(); // Calculate the elapsed time\n var elapsed = now - last;\n last = now;\n // Update the current rotation angle (adjusted by the elapsed time)\n var newAngle = angle + (ANGLE_STEP * elapsed) / 1000.0;\n return newAngle % 360;\n}", "title": "" }, { "docid": "e6c28a3c5437d7ed5e2ed8104c499339", "score": "0.6226263", "text": "function findAngle(startX, startY, endX, endY) {\n return Math.atan2(endY - startY, endX - startX);\n}", "title": "" }, { "docid": "b3c3a699115010d72b05eef56ebf7bef", "score": "0.62233377", "text": "update() {\n this.angle = 30 + Math.sin(this.game.time.time * 1/500) * 5\n }", "title": "" }, { "docid": "008031a20394c2992b3518cd722b26c7", "score": "0.621617", "text": "function startAngle(d) { return d.startAngle + offset; }", "title": "" }, { "docid": "008031a20394c2992b3518cd722b26c7", "score": "0.621617", "text": "function startAngle(d) { return d.startAngle + offset; }", "title": "" }, { "docid": "008031a20394c2992b3518cd722b26c7", "score": "0.621617", "text": "function startAngle(d) { return d.startAngle + offset; }", "title": "" }, { "docid": "4f3dcadeee64c5bb215bde6d8814a06b", "score": "0.62026095", "text": "function calcAngle(percentAngle) {\n\treturn 180 * percentAngle - 30;\n}", "title": "" }, { "docid": "82d5d5bfb453550fe628cf2f38b10f0b", "score": "0.62009025", "text": "function animate(angle) {\n var now = Date.now(); // Calculate the elapsed time\n var elapsed = now - last;\n last = now;\n // Update the current rotation angle (adjusted by the elapsed time)\n var newAngle = angle + (ANGLE_STEP * elapsed) / 1000.0;\n return newAngle % 360;\n}", "title": "" }, { "docid": "82d5d5bfb453550fe628cf2f38b10f0b", "score": "0.62009025", "text": "function animate(angle) {\n var now = Date.now(); // Calculate the elapsed time\n var elapsed = now - last;\n last = now;\n // Update the current rotation angle (adjusted by the elapsed time)\n var newAngle = angle + (ANGLE_STEP * elapsed) / 1000.0;\n return newAngle % 360;\n}", "title": "" } ]
2bf38d2ad707dcde2e80f159b4d3a72f
Deletes (empties) questionnaire response from Interests section.
[ { "docid": "cb224e3c085688848e61a2073eb9a02e", "score": "0.0", "text": "deleteInterest(questionnaireTopic) {\n console.log(\"remove\", questionnaireTopic, \"for\", this.state.username);\n axios.put(`http://localhost:3010/v0/removeqresponse/${this.state.username}/${questionnaireTopic}`, [this.state])\n .then(response => {\n console.log('Profile.js: success deleting qr');\n console.log(response);\n // call get request again to see new changes\n axios.get(`http://localhost:3010/v0/getqresponse/${this.state.username}`, [this.state])\n .then(res => {\n console.log('successful get q response');\n this.setState({ outdooractivity: res.data[0].outdooractivity });\n this.setState({ place: res.data[0].place });\n this.setState({ store: res.data[0].store });\n this.setState({ musicgenre: res.data[0].musicgenre });\n this.setState({ musician: res.data[0].musician });\n this.setState({ band: res.data[0].band });\n this.setState({ indooractivity: res.data[0].indooractivity });\n this.setState({ movietvshow: res.data[0].movietvshow });\n this.setState({ videogame: res.data[0].videogame });\n this.setState({ sport: res.data[0].sport });\n this.setState({ sportsteam: res.data[0].sportsteam });\n this.setState({ exercise: res.data[0].exercise });\n })\n .catch(err => {\n console.log('failed get q response');\n console.log(err);\n });\n })\n .catch(error => {\n console.log(\"Profile.js: failed deleting qr\");\n console.log(this.state);\n console.log(error);\n });\n }", "title": "" } ]
[ { "docid": "099af4e33678d74d2f1cba5e963c241a", "score": "0.6469646", "text": "removeResponseField(e){\n const formGroup = $(e.target).closest('.response-li');\n const responseTextArea = $(e.target).siblings('.response-text')[0];\n\n const index = this.responsesArray.indexOf(responseTextArea);\n if (index > -1) {\n this.responsesArray.splice(index, 1);\n }\n\n formGroup.remove();\n }", "title": "" }, { "docid": "cd526d9bdca916a8690bafd0b3e59e7e", "score": "0.6306217", "text": "function deleteAnInterview() {\n transition(DELETING, true);\n props\n .deletedInterview(props.id)\n .then(() => transition(EMPTY))\n .catch((err) => transition(ERROR_DELETE, true));\n}", "title": "" }, { "docid": "0ac42e510cd9e8399cca8dcacd9486c8", "score": "0.6095763", "text": "function deleteAnswer(passedkey) {\n var answerIds = [];\n var questions = [];\n if (vm.allQuestions[passedkey].answer) {\n answerIds.push(vm.allQuestions[passedkey].answer._id);\n questions.push(vm.allQuestions[passedkey]._id);\n UserResponses.deleteAnswer({ answer: answerIds, userResponse: vm.respondedId, questions: questions }, function success(response) {\n delete vm.allQuestions[passedkey].answer;\n answerIds.length = 0;\n }, function error(err) {\n ErrorHandler.error(err);\n });\n }\n }", "title": "" }, { "docid": "2fe4d5b6105fb85e5485560295b52607", "score": "0.59649014", "text": "function deleteInterview(id, interview) {\n return axios.delete(`/api/appointments/${id}`)\n .then(() => {\n const appointment = {\n ...state.appointments[id],\n interview: null\n };\n const appointments = {\n ...state.appointments,\n [id]: appointment\n };\n\n const days = updateSpots(state.day, state.days, appointments);\n\n setState({ ...state, appointments, days })\n });\n }", "title": "" }, { "docid": "662125a1c04cf38c3acc3a37ddd43d9d", "score": "0.5874423", "text": "function removeChoice(choiceIndex) {\n let choiceCard = document.getElementById(\"choice-\" + choiceIndex)\n choiceCard.parentElement.removeChild(choiceCard)\n currentNodeInFocus.responseChoices.delete(choiceIndex)\n\n if(validating) validateResponseChoices()\n}", "title": "" }, { "docid": "4b4de95e55c5c59fb7d4d530a8c78ab1", "score": "0.58061796", "text": "function deleteSingleAnswer(req, res) {\n queries_answer.deleteSingleAnswer(req.params.id, function (err, rows) {\n if (err) {\n app_service.errorHandler(err, res);\n }\n else {\n res.send(\"Successfully deleted answer with id \" + req.params.id);\n }\n });\n}", "title": "" }, { "docid": "01d818b54f7ae7890c3e7f19f29170cb", "score": "0.57661575", "text": "questionnaireResponse(trial) {\n if (Object.keys(this).indexOf('questionnaires') === -1)\n this.questionnaires = [];\n trial.afterTrial = this.currentTrialIndex-1;\n trial.advisorId = this.lastQuestionnaireAdvisorId;\n this.questionnaires.push(trial);\n }", "title": "" }, { "docid": "41175216f3de2263650add5cea1a9d8c", "score": "0.5761721", "text": "function removeSolutions(id) {\n\t$('.respImg').remove();\n}", "title": "" }, { "docid": "df0d88190212b484e5d2efc4af7ed006", "score": "0.5761045", "text": "function removeAnswer_() {\n\n var answer = this.closest('.answer'),\n number = parseInt(this.dataset.number);\n\n if (choiceAnswers[answer.dataset.answer].length <= 2) {\n\n pit.notification.notify({\n type: 'warning',\n message: 'Минимальное количество ответов - 2'\n });\n return false;\n\n }\n\n if (answer.dataset.image === 'true')\n this.removeEventListener('click', transportAnswerImage_);\n\n answer.getElementsByTagName('input')[number].removeEventListener('keyup', updateInputAnswers_);\n answer.getElementsByClassName('js-option-delete')[number].removeEventListener('click', removeAnswer_);\n\n for ( var i = number + 1; i < choiceAnswers[answer.dataset.answer].length; i++) {\n\n var elements = answer.querySelectorAll('[data-number=\"' + i + '\"]');\n\n for (var j = 0; j < elements.length; j++) {\n\n elements[j].dataset.number = i - 1;\n\n }\n\n }\n\n choiceAnswers[answer.dataset.answer].splice(number, 1);\n answer.querySelector('.answer__item:nth-child(' + ( number + 1) + ')').remove();\n\n answer.getElementsByClassName('js-answers-json')[0].value = JSON.stringify(choiceAnswers[answer.dataset.answer]);\n\n updateFieldData_(answer.getElementsByClassName('js-answers-json')[0]);\n\n }", "title": "" }, { "docid": "e7abbcd3418ee8e7a0eb1bc603cadda3", "score": "0.5756332", "text": "function deleteQuestion(question) { \n var previousQuestions = getStoredQuestions(); \n var inQuestion = previousQuestions.filter(function (questionQuery, index) {\n return question.indexOf(questionQuery.question) !== -1; \n });\n // delete retrieved question from local storage\n previousQuestions.forEach(function (question, index) {\n if(question.question == inQuestion[0].question) {\n previousQuestions.splice(index, 1); \n }\n });\n // rerender page with removed responses \n storeQuestions(previousQuestions); \n rightPane.innerHTML = templates.renderQuestionForm(); \n leftPanel.innerHTML = templates.renderQuestion({\n questions: previousQuestions\n })\n // add listener\n addQuestion(); \n }", "title": "" }, { "docid": "2c8a2539432c788727876d6e60360f85", "score": "0.5734309", "text": "deleteAssessment(request, response) {\n const assessmentId = request.params.id;\n logger.info(\"deleting assessment: \", assessmentId);\n assessmentStore.removeAssessment(assessmentId);\n response.redirect(\"/member-dashboard\");\n }", "title": "" }, { "docid": "d1e64316cc6ce438358fb50b565cc83f", "score": "0.57312995", "text": "function deleteQuestion(id){\n\tif (confirm(\"Press OK to delete this question?\") == false) return;\n\tdeleteURL = \"https://www.woravich-k.com:49154/deleteRow/question/\" + id;\n\tclient = new XMLHttpRequest();\n\tclient.open('GET', deleteURL);\n\tclient.onreadystatechange = deleteResponse; \n\tclient.send();\n}", "title": "" }, { "docid": "d839e132ab1984d941d663dcf7a620af", "score": "0.5726736", "text": "async function deleteAnswersOfQuestion(questionId) {\n await models.Answer.destroy({\n where: {\n questionId: questionId\n }\n });\n}", "title": "" }, { "docid": "11f2a06e2fdafa0867f8725a224758d9", "score": "0.5718983", "text": "deleteAssessment(request, response) {\n const loggedInUser = accounts.getCurrentUser(request);\n assessmentStore.removeAssessment(loggedInUser.id, request.params.assessmentid);\n loggedInUser.noOfAssessments -= 1;\n userstore.store.save();\n response.redirect('/dashboard/');\n }", "title": "" }, { "docid": "2928cea5888da60a8d931c147837ace2", "score": "0.57134056", "text": "function cancelInterview(id) {\n return axios.delete(`/api/appointments/${id}`)\n .then((response) => {\n if (response) {\n dispatch({ type: SET_INTERVIEW, id, interview: null })\n }\n })\n }", "title": "" }, { "docid": "c05e93075a5eac12dd0b3d57ebaa5dda", "score": "0.5683982", "text": "function removeQuiz() {\n mainContent.remove();\n}", "title": "" }, { "docid": "47043866f1ed94c048d545621836a21c", "score": "0.5675423", "text": "async deleteQuestion() {\n const questions = await Question.query().where('activity_id', this.id);\n\n if (questions) {\n questions.map(question => question.deleteAnswer());\n await Question.query()\n .delete()\n .where('activity_id', this.id);\n }\n return questions;\n }", "title": "" }, { "docid": "cf927eda696f1e6002e19497fba37aa0", "score": "0.5627155", "text": "removeQuestion() {\n var q_id = sessionStorage.getItem('q_id');\n fetch(`http://localhost:4001/Questions/DelQ/` + q_id, {\n method: 'DELETE',\n headers: {\n 'Content-Type': 'application/json'\n }\n })\n .then(response => {\n if (response.status === 200) {\n console.log('Question Deleted');\n window.location.reload();\n } else {\n alert('Failed to delete answer');\n };\n })\n }", "title": "" }, { "docid": "5b1558d2ded8ae0796205bcabbe294ee", "score": "0.5602303", "text": "function deleteQuestion(id) {\n $.ajax({\n method: \"DELETE\",\n url: \"/getquestions/\" + id\n }).then(function() {\n getQuestions();\n });\n }", "title": "" }, { "docid": "d8a0a2ceb839c2a4d12170863886eeb3", "score": "0.559593", "text": "function action() {\n question.techops.delete = true;\n question.techops.log('Files Deleted', {\n 'Title': question.display_name,\n 'ID': question.id\n });\n callback(null, course, question);\n }", "title": "" }, { "docid": "c3716054415b357a0f7adfe452ae42a9", "score": "0.5588886", "text": "function deleteQuestionModule() {\r\n let mcqElements = document.getElementsByClassName(\"question_form\");\r\n\r\n while (mcqElements.length > 0) {\r\n mcqElements[0].parentNode.removeChild(mcqElements[0]);\r\n }\r\n\r\n let buttons = document.getElementsByClassName(\"buttons\");\r\n while (buttons.length > 0) {\r\n buttons[0].parentNode.removeChild(buttons[0]);\r\n }\r\n}", "title": "" }, { "docid": "d43ca3af98253cf9ceee0492b73904e6", "score": "0.55632055", "text": "function clearQuestion() {\n\tif (currentQuestion > 0) {\n\t\tcurrentQuestion = 0;\n\t\tquestionTileChoice = -1;\n\t\t$(\"#continue\").hide();\n\t}\n}", "title": "" }, { "docid": "65bda046f9abe8f2bf3a2bf018821824", "score": "0.5562152", "text": "function clearQuestionAndAnswers()\n{\n $(\"#q-and-a-container\")\n .contents(\":not(#answer-button-container, #selected-answer-message)\").remove();\n // Hide the selected answer message since we are leaving feedback state.\n $(\"#selected-answer-message\").hide();\n // Makes the answer notification fixed to not center with rest of content.\n $(\"#selected-answer-message\").addClass(\"selected-answer-pre-feedback\");\n} // end-clearQuestionAndAnswers", "title": "" }, { "docid": "8eae801353bb2b3b0c89127c666bf7a4", "score": "0.55614996", "text": "function deleteQuestion(elementId) {\n var element = allQuestions.find(oneElement => oneElement.id === elementId);\n console.log(element.category);\n const deleteQuestion = {\n id: elementId,\n firstName: element.firstName,\n email: element.email,\n customerQuestion: element.customerQuestion,\n category: element.category\n }\n $.post(\"FAQ/DeleteAnsweredQuestion\", deleteQuestion, function (output) {\n console.log(output);\n clearLists();\n getUnansweredQuestions(element.category); \n }); \n \n}", "title": "" }, { "docid": "a707a408cdc2eb114423768515070237", "score": "0.5540622", "text": "function hideQA() {\n $(\"#questionHere\").hide();\n $(\"AnswerSlot1\").hide();\n $(\"AnswerSlot2\").hide();\n $(\"AnswerSlot3\").hide();\n $(\"AnswerSlot4\").hide();\n}", "title": "" }, { "docid": "c5de0f27d0ee0a3d87c5e2c2ce0c07f8", "score": "0.5528201", "text": "function clearAnswers() {\r\n while (answerDiv.firstChild) {\r\n answerDiv.removeChild(answerDiv.firstChild);\r\n }\r\n}", "title": "" }, { "docid": "e0caab0e7dcb748a66fe84e03180ae84", "score": "0.5519887", "text": "function cancelInterview(id) {\n\nconst appointment = {\n ...state.appointments[id],\n interview: null\n};\n\nreturn axios.delete(`/api/appointments/${id}`, appointment)\n.then(() => {\n dispatch({ type: SET_INTERVIEW, id, interview: null });\n})\n}", "title": "" }, { "docid": "d2bd46b899705871c52697f7ceafae85", "score": "0.5505522", "text": "function cancelInterview(id) {\n\n const appointment = {\n ...state.appointments[id],\n interview: null\n };\n const appointments = {\n ...state.appointments,\n [id]: appointment\n };\n const days = updateObjectInArray(state.days, {\n index: getWeekDay(state.day),\n item: state.days[getWeekDay(state.day)].spots + 1\n });\n\n return Axios.delete(`http://localhost:8001/api/appointments/${id}`).then(() => {\n return Axios\n .delete(`http://localhost:8001/api/appointments/${id}`)\n .then(() => {\n dispatch({\n type: SET_INTERVIEW,\n value: appointments\n });\n //making sure spots is changed when deleting a appointment\n dispatch({\n type: SET_SPOTS,\n value: days\n });\n })\n });\n\n }", "title": "" }, { "docid": "779e0d7f147cc72d980fc6a3b857a3d6", "score": "0.5500545", "text": "removeQuestion(index){\n this.kahoot.kahoot.questions.splice(index,1);\n return this;\n }", "title": "" }, { "docid": "6777b35b1dd905c15cf78dfa60fe0fce", "score": "0.5499524", "text": "function clearAllResponses() {\n\t\tvar txt;\n\t\tvar r = confirm(\"Are you sure you want to clear ALL responses?\");\n\t\tif (r == true) {\n\t\t\tvar numOutVars = $('#myTable2 tr').length-2;\n\t\t\tfor (i=1;i<=numOutVars;i++) {\n\t\t\t\trowNum = i;\n\t\t\t\t$(\"#varOutValue\" + rowNum).val(\"\");\n\t\t\t}\n\t\t\t\n\t\t\t$(\"#showXML\").text(\"<No response found>\");\n\t\t\t$(\"#showXMLButton\").hide();\n\t\t\t$(\"#clearResponse\").hide();\n\t\t\t\n\t\t\tvar numOutVars = $('#myTable2 tr').length-1;\n\t\t\tfor (i=1;i<=numOutVars;i++) {\n\t\t\t\t$(\"#varOutValue\" + i).val(\"\");\n\t\t\t}\n\t\t} \n\t}", "title": "" }, { "docid": "da6c5d87ba80953cdf8e2459fb9d7e07", "score": "0.54974705", "text": "deleteQuestion(){\n\n }", "title": "" }, { "docid": "1396b9d5d6788cabe28dcf94b10da2b4", "score": "0.549454", "text": "function removeQuestion(index) {\n currentQuestions.splice(index, 1);\n console.log(currentQuestions);\n}", "title": "" }, { "docid": "76c4b3776a1410c299a29c1dd6d2bde2", "score": "0.5478718", "text": "function postDelete(response) {\n\tif (response == \"OK\") {\n\t\talert(\"Successfull delete\");\n\t\t$(\"#\" + $(\"#expid\").val()).remove();\n\t\t$(\"#noexp\").html(parseInt($(\"#noexp\").html()) - 1); // Update experiment counter\n\t} else\n\t\talert(\"Action failed\");\n}", "title": "" }, { "docid": "9853e4323845858ece5d6ec7a4d1a4fe", "score": "0.5471222", "text": "deleteAssessment(request, response) {\n \n //variable created to store ID of assessment list\n const assessmentListId = request.params.id;\n \n //variable created to store ID of assessment\n const assessmentId = request.params.assessmentid;\n \n //message to show that the assessment is being deleted from the assessment list\n logger.debug(`Deleting Assessment ${assessmentId} from Assessment List ${assessmentListId}`);\n \n //calling the removeAssessment method from the assesmentListStore model\n assessmentListStore.removeAssessment(assessmentListId, assessmentId);\n \n //display the assessment view with the assessmentlist\n response.redirect('/assessment/' + assessmentListId);\n }", "title": "" }, { "docid": "29c3c9e6452e47436deaa04e3b0afd05", "score": "0.5458458", "text": "function _deleteExtraDescriptions(question) {\n delete question.level1_description;\n delete question.level2_description;\n delete question.level3_description;\n delete question.level4_description;\n delete question.level5_description;\n delete question.level1_description3;\n delete question.level2_description3;\n delete question.level3_description3;\n delete question.level4_description3;\n delete question.level5_description3;\n}", "title": "" }, { "docid": "8a1b543cda53b1dc371ad0fdafc56472", "score": "0.5441997", "text": "function cancelInterview(id) {\n\n const appointment = {\n ...state.appointments[id],\n interview: null\n };\n\n const appointments = {\n ...state.appointments,\n [id]: appointment\n };\n\n return axios.delete(`/api/appointments/${id}`)\n .then(() => {\n dispatch({ type: SET_INTERVIEW, value: appointments});\n })\n }", "title": "" }, { "docid": "4909422588f5b1ce88c9191b536383c8", "score": "0.5428682", "text": "function clearResponses(){\n responseHolder.innerHTML = \"\";\n }", "title": "" }, { "docid": "3019d134b03097c7443ddbe0e5fb51c5", "score": "0.5427679", "text": "function deleteAllAnswers(req, res) {\n queries_answer.deleteAllAnswers(function (err, rows) {\n if (err) {\n app_service.errorHandler(err, res);\n }\n else {\n res.send(\"Successfully deleted all answers\");\n }\n });\n}", "title": "" }, { "docid": "1d1f4fe0c482bb2593b5051677b57ae1", "score": "0.5406797", "text": "function deleteResponse(postIndex, responseIndex) {\n // Send the request to the php script\n $.ajax({\n type: \"POST\",\n url: \"php/forum/deleteResponse.php\",\n data:{postIndex: postIndex, responseIndex: responseIndex},\n // when returned (no error catching yet)\n success: function() {\n // update the list of responses\n refreshResponses(postIndex);\n // update forum index (since this tracks # of responses)\n refreshForumIndex();\n // hide the interaction div\n hide('deleteResponse');\n }\n });\n}", "title": "" }, { "docid": "96f083fb8b675b27fedeaa74688c350f", "score": "0.54013234", "text": "function clearQuestion() {\n $(\"#random-question\").empty();\n $(\".answers\").empty();\n $(\".answers\").show();\n $(\".questionblock\").show();\n $(\".wronganswer\").empty();\n $(\".answerimage\").empty();\n \n }", "title": "" }, { "docid": "127173b4b1fd1122f58d670622d20967", "score": "0.5401201", "text": "function deleteExam(req, res) {\n\tExam.remove({_id : req.params.id}, (err, result) => {\n\t\tres.json({ message: \"Exam successfully deleted!\", result });\n\t});\n}", "title": "" }, { "docid": "cd518d3cd6f169d9a91e5851a1e97c7c", "score": "0.5371008", "text": "function cancelInterview(id) {\n const appointment = {\n ...state.appointments[id],\n interview: null\n };\n const appointments = {\n ...state.appointments,\n [id]: appointment\n };\n return axios.delete(`/api/appointments/${id}`, appointment)\n .then(() => {\n setState(updateSpots({ ...state, appointments }))\n })\n }", "title": "" }, { "docid": "a2f0f927f28218ee2bcde9833fd36e10", "score": "0.53691864", "text": "function delet(subid) {\n $.ajax({\n datatype: \"json\",\n url: \"../ajaxfile/examAjax.php\",\n type: \"post\",\n data: { subid: subid, status: \"deleteAll\" },\n success: function (response) {\n var data = JSON.parse(response);\n if (data.success == \"true\") {\n alert(\"データが削除されました。\")\n } else if (data.error == \"false\") {\n alert(\"データ削除エラー\")\n }\n subject_question()\n }\n })\n }", "title": "" }, { "docid": "ec27e999bbfe3aa5af7b8e63c612dc0c", "score": "0.53530276", "text": "function removeQuestion() {\n return new Promise(() => questionContainerEl.innerText = \"\")\n}", "title": "" }, { "docid": "835fb01e6006821a35334be53267ef86", "score": "0.535288", "text": "function remove() {\n if ($window.confirm('Are you sure you want to delete?')) {\n vm.wf_instrument_inspection.$remove($state.go('admin.wf_instrument_inspections.list'));\n }\n }", "title": "" }, { "docid": "703047451a3705af6f46b6bb6fc05da1", "score": "0.53480446", "text": "function remove(id) {\n\tlet index = pickedquestions.indexOf(Allquestions[id])\n\tconsole.log(index);\n\tif (index > -1) {\n\t\tpickedquestions.splice(index, 1);\n\t}\n\tload();\n}", "title": "" }, { "docid": "c10af2586553cb21efa1a181f0863d34", "score": "0.53435475", "text": "function deleteResponsable(id){\n\t\tvar requestResponsable = new Object();\n\t\trequestResponsable[\"idCentroResponsable\"] = id;\n\t\t\n\t\t\t$.ajax({\n\t\t\t url: \"http://erpge.getsandbox.com/api/centroresponsable/del\",\n\t\t\t type: \"POST\",\n\t\t\t dataType: 'json',\n\t\t\t data: JSON.stringify(requestResponsable),\n\t\t\t contentType : \"application/json\",\n\t\t\t success: function(data) {\n\t\t\t\t\tconsole.log(\"Success = \" + JSON.stringify(data) );\n\t\t\t\t\t$('#tbl_responsable tbody').empty();\n\t\t\t\t\tlistarResponsable();\n\t\t\t },\n\t\t\t error: function() { \n\t\t\t \t\t//alert('Failed!'); \n\t\t\t \t}\n\t\t\t});\n\t\t\n\t }", "title": "" }, { "docid": "74b1d065dbca9ccbe0cbda633de6ec12", "score": "0.53424877", "text": "function response() {\n quiz.questionIndex++;\n seconds = 25;\n $(\"#radioButton\").empty();\n $(\"#qholder\").empty();\n runQuiz();\n }", "title": "" }, { "docid": "0cf37c36cc9fa86278baafbc9fcde1db", "score": "0.5341741", "text": "async function eliminarProfesional(idProfesional, response) {\n let profesionalActualizado = await Profesional.deleteOne({ \"_id\": idProfesional });\n response.send(true);\n\n}", "title": "" }, { "docid": "51148befbb8140d7edab2d31a2a0bf05", "score": "0.5333626", "text": "function removeQuestion (e) {\r\n e.preventDefault() // Prevents following the <a> link\r\n $(this).closest('.question-wrap').remove()\r\n }", "title": "" }, { "docid": "417ecd58ae890a593aebeab6fd35c93c", "score": "0.5325184", "text": "delete_question()\n {\n let self = this;\n let request = new XMLHttpRequest();\n\n request.open(\"POST\", \"http://127.0.0.1:5000/api/deleteQ\", true);\n request.onreadystatechange = function() {\n if (request.readyState == 4 && request.status == 200) {\n let data = request.responseText;\n if (data == \"Success!\") {\n document.getElementById(\"results\").innerHTML = self.userInput + \" was successfully deleted.\";\n } else {\n document.getElementById(\"results\").innerHTML = self.userInput + \" could not be deleted.\";\n }\n }\n }\n let msg = this.formatted_partialQ(this.userInput);\n if (msg != \"Ill-Formatted\") {\n request.send(msg);\n } else {\n document.getElementById(\"results\").innerHTML = \"Please use the format 'arg1 op arg2' to delete a question.\";\n }\n }", "title": "" }, { "docid": "8a980ec9cfd87c2176a33a2ea33a1f4d", "score": "0.53222716", "text": "function cancelInterview(id) {\n\n const url = `/api/appointments/${id}`\n\n return axios.delete(url)\n .then(() => {\n let num = state.days[0].spots\n num++\n state.days[0].spots = num\n reRender()\n setState({\n ...state\n })\n })\n }", "title": "" }, { "docid": "8e4fbdf03cb5490dd75e0eb9a17e18ae", "score": "0.53218555", "text": "function ClearExerciceRadio() {\n for (var i = 0; i < questExercices.length; i++) {\n questExercices[i].checked = false;\n }\n}", "title": "" }, { "docid": "5b305921510daa195db68e99a9165e7e", "score": "0.53216094", "text": "function clearQuestion() {\n \n while (answerButtons.firstChild) {\n \n answerButtons.removeChild(answerButtons.firstChild);\n \n }\n}", "title": "" }, { "docid": "cc6f11dc92ca8a19bb426ee1110221db", "score": "0.5310792", "text": "function deletePresentation(presentationID) {\n let conf = confirm(\"Weet je zeker dat je de presentatie wilt verwijderen?\");\n var a = document.getElementById(\"label\"+presentationID).textContent;\n if (conf == true) {\n let url = SERVER+PORT+\"/api/presentationdraft/delete/\"+presentationID;\n let xhreq = new XMLHttpRequest();\n xhreq.open(\"DELETE\",url,true);\n xhreq.onreadystatechange = function() {\n if(this.readyState == 4){\n document.getElementById(\"form_review\").innerHTML = '';\n alert(\"Voorstel is verwijderd.\");\n refreshFieldsDeletion(a);\n }\n }\n xhreq.send();\n }\n}", "title": "" }, { "docid": "46e32b65ab37aa2823bda078858aba82", "score": "0.53095156", "text": "static async delete(req, res) {\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\tconst { id } = req.params\n\n\t\t\t\n\t\t\t// deleting exam info\n\t\t\tawait examService.Deleting(id)\n\n\t\t\t// create response\n\t\t\tconst response = {\n\t\t\t\tsuccess: true,\n\t\t\t}\n\n\t\t\tres.send(response)\n\t\t} catch (e) {\n\t\t\tres.send(e)\n\t\t}\n\t}", "title": "" }, { "docid": "fc20a8ca914a4a84f90ca15f2c037e13", "score": "0.53075904", "text": "function deletePresentation(presentationID) {\r\n let conf = confirm(\"Weet je zeker dat je de presentatie wilt verwijderen?\");\r\n var a = document.getElementById(\"label\"+presentationID).textContent;\r\n if (conf == true) {\r\n let url = SERVER+PORT+\"/api/presentationdraft/delete/\"+presentationID;\r\n let xhreq = new XMLHttpRequest();\r\n xhreq.open(\"DELETE\",url,true);\r\n xhreq.onreadystatechange = function() {\r\n if(this.readyState == 4){\r\n document.getElementById(\"form_review\").innerHTML = '';\r\n alert(\"Voorstel is verwijderd.\");\r\n refreshFieldsDeletion(a);\r\n }\r\n }\r\n xhreq.send();\r\n }\r\n}", "title": "" }, { "docid": "f8c3687e21d0a112ebde7285d2b5f820", "score": "0.5304706", "text": "function delete_exam(exam_id){\n\t\t if(confirm(\"Are You Sure To Delete Selected Record?\")){\n\t\t\t this.document.exam_view.act.value=\"delete_exam\";\n\t\t\t\tthis.document.exam_view.exam_id.value=exam_id;\n\t\t\t\tthis.document.exam_view.submit();\n\t\t\t }\n\t\t}", "title": "" }, { "docid": "435e282034db6cd6947f70b7cd6631b6", "score": "0.53027624", "text": "function clearResults() {\n correctAnswers.empty;\n incorrectAnswers.empty;\n unansweredAnswers.empty;\n}", "title": "" }, { "docid": "5a6799541e449404a338a89160eb8de0", "score": "0.53018916", "text": "function removeAccomplishment(req, res) {\n\tlet assignmentId = req.params.assignmentId;\n\tlet taskId = req.params.taskId;\n\tconsole.log('assignmentId = ' + assignmentId);\n\tconsole.log('taskId = ' + taskId);\n\tdbAccess.removeAccomplishment(assignmentId, taskId, function(err, result) {\n\t\tif(err || result === null) {\n\t\t\t// the data is false\n\t\t\tres.status(500).json({success: false, data: err});\n\t\t} else {\n\t\t\tvar accomplishment = result;\n\t\t\tres.status(200).json(accomplishment);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "6d0311b35afda3d60e1fb8a748e16c7d", "score": "0.528332", "text": "function cancelInterview(id) {\n const appointment = {\n ...state.appointments[id],\n interview: null\n };\n const appointments = {\n ...state.appointments,\n [id]: appointment\n };\n const days = updateSpots(state, appointments);\n //delete request instead of put..\n return (axios.delete(`http://localhost:8001/api/appointments/${id}`)\n .then(() => {\n setState({\n ...state,\n appointments, days\n });\n }));\n }", "title": "" }, { "docid": "396bcd0a6e2f326dcab4b67f6f214c7b", "score": "0.52825207", "text": "function clearQuestion() {\n while (answerButtons.firstChild) {\n answerButtons.removeChild(answerButtons.firstChild);\n }\n}", "title": "" }, { "docid": "87ea25f28baea7106dabb7222ee74711", "score": "0.52815294", "text": "function clearExam () {\r\n //Clear the acumulated score from the variable\r\n score = 0;\r\n\r\n /**\r\n * Uses the same principle as the getAnswer function but in this case it sets\r\n * to false the input elements that are checked\r\n */\r\n for(var q = 0; q < exam_answers.length; q++) {\r\n document.getElementsByName(exam_answers[q][0]).forEach(sel => {\r\n if(sel.checked)\r\n sel.checked = false;\r\n })\r\n }\r\n}", "title": "" }, { "docid": "e6fab7d34742896def3cd6817747efce", "score": "0.5280032", "text": "function cancelInterview(id) {\n const appointment = { ...state.appointments[id], interview: null };\n const appointments = { ...state.appointments, [id]: appointment };\n return axios.delete(`/api/appointments/${id}`).then((res) => {\n let days = updateSpots(state.day, state.days, appointments);\n setState((prev) => ({ ...prev, appointments, days }));\n });\n }", "title": "" }, { "docid": "fafa65190ac82d0fa44c12dc3effbe96", "score": "0.52794296", "text": "function deleteExhibit(id) {\n $.ajax({\n method: \"DELETE\",\n url: \"/api/exhibits/\" + id\n })\n .then(function () {\n getExhibits();\n window.location.href = \"/searchData\"\n });\n }", "title": "" }, { "docid": "d51fda187a3778aec16f4d867c5e54ad", "score": "0.5276508", "text": "function cancelInterview(id) {\n const appointment = {...state.appointments[id], interview: null }\n const appointments = { ...state.appointments, [id]: appointment }\n const newState = {...state, appointments}\n \n return axios\n .delete(`/api/appointments/${id}`)\n .then((res) => {\n const days = updateSpots(newState);\n setState(prev => {\n return {...prev, appointments, days}\n })\n return res;\n })\n .catch((error) => {\n console.log(error.response)\n return null\n })\n }", "title": "" }, { "docid": "84d5121039d9a48ae5b25de66019a4ad", "score": "0.52744824", "text": "function removeOldQuestion() {\n while (answerEl.firstChild) {\n answerEl.removeChild(answerEl.firstChild)\n }\n}", "title": "" }, { "docid": "1be2303974174892eb480fc1a9441d33", "score": "0.5274161", "text": "function deleteQuestion(id){\n\n var savedQuestions = localStorage[\"savedQuestions\"];\n if(savedQuestions == null){\n return;\n }\n\n var index = getQuestionIndex(id);\n if(index == -1){\n return;\n }\n\n var questions = JSON.parse(localStorage[\"savedQuestions\"]);\n questions.splice(index, 1);\n localStorage[\"savedQuestions\"] = JSON.stringify(questions);\n window.location.reload(false); //refreshes the page without getting it from the server \n}", "title": "" }, { "docid": "ae1fb587b38635e8f617088800c45485", "score": "0.52360886", "text": "function checkAnswer(){\n\n //Get id of button that was clicked\n var buttonClicked = this.id;\n\n // Target section that contains question\n var sectionToClear = document.getElementById(\"newSectionForQuestions\");\n\n // If answer is correct, set checkAnswerText to correct, then remove entire section\n if (buttonClicked == questions[questionNum].correct){\n checkAnswerText = \"Correct!\";\n correct++;\n sectionToClear.remove();\n \n // Add 1 to questionNum to move to next question\n questionNum++;\n\n // If question is greater than amount of questions, stop recursion, else continue\n if (questionNum > 4){\n return;\n }\n else {\n displayQuestions(questionNum);\n }\n }\n // If answer is wrong, set checkAnswer to wrong and remove entire section\n else {\n checkAnswerText = \"Wrong\";\n sectionToClear.remove();\n\n // Add 1 to questionNum to move to next question\n questionNum++;\n\n // If question is greater than amount of questions, stop recursion, else continue\n if (questionNum > 4){\n return;\n }\n else {\n displayQuestions(questionNum);\n }\n }\n }", "title": "" }, { "docid": "fbdad352887e45d1f64ed6299dc952a3", "score": "0.5234118", "text": "function deleteMedEx(b){\n if(confirm('Are you sure you wish to cancel this reservation?')){\n\n var row = b.parentNode.parentNode;\n\n var medEx = {\n date: row.cells[0].innerText,\n time: formatTime(row.cells[1].innerText),\n doctor: row.cells[2].dataset.attr\n }\n\n $.ajax({\n url: 'http://localhost:8080/4Doctors-1.00/rest/medicalExamination/'+medEx.doctor+'/'+medEx.date+'/'+medEx.time,\n type: 'delete',\n success: function (data) {\n //when the rest call is successful, delete the row from the table\n var i = row.rowIndex;\n var table = document.getElementById(\"future-exams\");\n table.deleteRow(i);\n\n //we removed all examinations, only header is left\n if(table.rows.length == 1){\n table.getElementsByTagName('tbody')[0].innerHTML = '<tr id=\"notbooked\"><td>No examinations booked.</td><td></td><td></td></tr>';\n }\n }\n });\n }\n}", "title": "" }, { "docid": "144429b2059d78ff871e02944bbb26c5", "score": "0.52311635", "text": "function tearDown() {\n if(unansweredCount===questions.length){\n alert(\"You didn't answer any questions!! Please click Replay. :)\");\n } \n $(\"#myForm, #timeHolder\").hide();\n $(\"#replay, #results\").show();\n }", "title": "" }, { "docid": "1c4c14d91b7d2bd40a10ca9c4e2c345a", "score": "0.52152914", "text": "function clearQuestions(){\n\t\t$(\"#a1\").html(\"\");\n\t\t$(\"#a2\").html(\"\");\n\t\t$(\"#a3\").html(\"\");\n\t\t$(\"#a4\").html(\"\");\n\t\tclearInterval(intervalTime);\n\t}", "title": "" }, { "docid": "793fd13e741761a63d3f33a88cd2d999", "score": "0.52115506", "text": "deleteSelectionOption(index) {\n this.props.questionDataStructure.selectionOptions.splice(index, 1);\n\n const deleteQuestOpt = (prevSurvey) =>\n update(prevSurvey, {\n surveySections: {\n [this.props.sectionIndex]: {\n questions: {\n [this.props.questionId]: {\n questionOptions: { $splice: [[index, 1]] },\n },\n },\n },\n },\n });\n this.props.modifySurvey(deleteQuestOpt);\n }", "title": "" }, { "docid": "8250e720a91c379573299b85a6a565ec", "score": "0.51932126", "text": "function removeSelectedLabelFromQuestion(idQuestion, idLabel) {\n const requestOptions = {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: authHeader(),\n },\n };\n\n\n const removedLabelQuestion = {\n idQuestion,\n idLabel,\n };\n\n const question = { question: idQuestion };\n return axios.post(`${apiUrl}/labels/${idLabel}/remove_question/`, question, requestOptions)\n .then(response => response.data).then(() => removedLabelQuestion);\n}", "title": "" }, { "docid": "d1fbace19d0efc892d3446fa874fe714", "score": "0.5184334", "text": "function deleteMyQuestionLabel(idLabel) {\n const requestOptions = {\n method: 'DELETE',\n headers: {\n Authorization: authHeader(),\n },\n };\n\n return axios.delete(`${apiUrl}/labels/${idLabel}/`, requestOptions)\n .then(response => response.data).then(() => idLabel);\n}", "title": "" }, { "docid": "11bcd74b6a933804cc989f1565bd338f", "score": "0.51827323", "text": "function deleteInteraction(intId) {\n //Destroy Popover\n $(\"#interaction_\" + intId).popover(\"destroy\");\n\n //Delete from JSON\n var indexOfJSON = getIntJSONIndex(intId);\n flashTeamsJSON[\"interactions\"].splice(indexOfJSON, 1);\n updateStatus();\n\n //Delete Arrow or Rectangle\n $(\"#interaction_\" + intId).remove();\n}", "title": "" }, { "docid": "6a076daac29aa59d6a8520035bc73ff4", "score": "0.51789236", "text": "function clearQuestionDiv() {\n console.log(\"About to clear html\");\n document.getElementById(\"question-choices\").innerHTML = \"\";\n quizOver();\n}", "title": "" }, { "docid": "c107f1615c455100c877f6a708dfeaf4", "score": "0.51663655", "text": "function handleQuestionDelete() {\n var currentQuestion = $(this)\n .parent()\n .parent()\n .data(\"question\");\n deleteQuestion(currentQuestion.id);\n }", "title": "" }, { "docid": "61fb167a9c94b266e019809a1673682e", "score": "0.51656", "text": "function cleanColection(questionnaire, callback)\n{\n \t'use strict';\n questionnaire.remove({},function (err, db)\n {\n if(err)\n {\n console.log('Couldn\\'t remove collection');\n }\n else\n {\n console.log('Collection removed ');\n }\n\n questionnaire.count({},function(err, elements)\n {\n if(err)\n {\n throw err;\n }\n callback(questionnaire);\n });\n\n });\n}", "title": "" }, { "docid": "652c2901ae6ac7b1aa1c8a1412f4c6bb", "score": "0.5163441", "text": "function removeExam(delExam){\n\tlet level = delExam.exam_level;\n\tfor (var exam in exams[level]) {\n\t\tif(exams[level].hasOwnProperty(exam) && exams[level][exam].exam_id == delExam.exam_id){\n\t\t\texams[level].splice(exam, 1);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "6fb2299db036b86fa421cdaeee8ad785", "score": "0.51534635", "text": "function removeAnswer() {\n \n var remv = document.removalForm.remove.value;\n \n var index = fortunes.indexOf(remv);\n \n if(index >= 0) {\n fortunes.splice(index, 1) \n// index and how many elements we want it to take. we only want to remove one element in this example. now fortunes will be one element shorter than it used to be.\n }\n \n console.log(fortunes);\n \n event.preventDefault();\n}", "title": "" }, { "docid": "ae051a337753b130b583e0b30b9c120f", "score": "0.5147168", "text": "function covidHadYesClean() { //clean everything, not counting first part\n let part2 = document.getElementById('antibodies-status-question');\n part2.classList.add('d-none');\n let part3 = document.getElementById('date-test-yes');\n part3.classList.add('d-none');\n let part4 = document.getElementById('date-test-no');\n part4.classList.add('d-none');\n clearRadio('antibody-test-date');\n clearInput('date-test-yes-date');\n clearInput('date-test-yes-count');\n clearInput('date-test-no-date');\n page3validation = true;\n}", "title": "" }, { "docid": "7d236ddcc0b39f01b63b9aab6e9ea78d", "score": "0.5139115", "text": "clearQuestionDiv () {\n const element = document.querySelector('#container2')\n element.remove()\n }", "title": "" }, { "docid": "101f3d9e2505d19329daa7135b109582", "score": "0.513509", "text": "function _deleteExploration() {\n if (!DataExplorerController.isEmptyExploration) {\n DataExplorerController.deleteExploration();\n D3jsAccess.deleteSvgObject(viewObjectExplorer);\n div_dataExplorer_legendContainer.innerHTML = '';\n div_dataExplorer_gridHeader.innerHTML = '';\n }\n }", "title": "" }, { "docid": "6f5268ffb67e3b5040f01d659c96975b", "score": "0.51333314", "text": "function removePageContent() {\r\n\t$(surveyPageId).empty();\r\n}", "title": "" }, { "docid": "776afeeaaa4567760d48d913486cd033", "score": "0.51164037", "text": "function set_empty_qresp(qkey) {\n angular.forEach(vm.project.requests[0].request_question_responses, function (req_resp, key) {\n if (qkey === req_resp.question.key) {\n if (req_resp.question_response === null) {\n req_resp.question_response = '';\n }\n }\n });\n }", "title": "" }, { "docid": "e0ec9b309f57c1bba64f07804030b44f", "score": "0.5111899", "text": "function clearReq() \n{\n myKey = null;\n myReq = null;\n myStorage.clear();\n document.getElementById(\"request\").value = \"\";\n document.getElementById(\"description\").innerHTML = \"Write a post!\";\n document.getElementById(\"request\").disabled = false;\n const myNode = document.getElementById(\"replies\");\n while (myNode.firstChild) {\n myNode.removeChild(myNode.lastChild);\n }\n}", "title": "" }, { "docid": "ff4ef2107fb7c32b27e06ba4517c4b7f", "score": "0.51040494", "text": "function deleting() {\n transition(DELETE, true);\n props\n .cancelInterview(props.id)\n .then(() => {\n transition(EMPTY);\n })\n .catch(() => {\n transition(ERROR_DELETE, true);\n });\n }", "title": "" }, { "docid": "d9f1490f79e03a1044697d30a45ad4f1", "score": "0.5100231", "text": "async deleteResponsiblecollection(req, res) {\n const { id } = req.params;\n\n try {\n let rowCount = await responsiblecollectionModel.deleteResponsiblecollection(id);\n return res.json(rowCount == 1 ? { message: \"Eliminado exitosamente\", tipo: \"exito\" } : { message: \"Responsable de acopio no registrado\", tipo: \"error\" });\n \n } catch (err) {\n return res.json({ message: \"Error al tratar de eliminar un responsable de acopio\", tipo: \"error\" });\n }\n }", "title": "" }, { "docid": "549e3f32bccaf396039cd6f6d6567424", "score": "0.5094568", "text": "async delete(req, res, next) {\n const rs = { status: 0, msg: 'Delete study set successfully !' };\n\n try {\n const _id = req.params.id;\n if (_id) {\n await studySetModel.findByIdAndDelete({ _id });\n } else {\n rs.msg = 'please select an item to delete';\n }\n } catch (err) {\n rs.status = 1;\n rs.msg = err.message;\n }\n\n res.json(rs);\n }", "title": "" }, { "docid": "7e05712ff9c876420dcb7114936a7dfe", "score": "0.5092119", "text": "function deleteChoice(id){\n var choicesArray = story.chapters[currentChapter].scenes[currentScene].choices;\n choicesArray.splice(id, 1);\n console.log(\"DELETED CHOICE \" + id );\n sceneBuilder(currentChapter,currentScene);\n editorbuilder();\n}", "title": "" }, { "docid": "3d32c51e8f6b43ce72f0ec0002b49a88", "score": "0.5091224", "text": "async function deleteRequest() {\n await axios.post(\n `https://bandquest-bandend.herokuapp.com/requests/declinerequest`, {\n id: reqInfo._id\n }\n );\n setDeclineState(\"Request Deleted\")\n }", "title": "" }, { "docid": "55c3b1c9f744e94aaf04b80297c51b45", "score": "0.50902313", "text": "function deleteEvent(eventId){\n\n $('#confirmAction').modal('hide');\n\n var indexOfJSON = getEventJSONIndex(eventId);\n var events = flashTeamsJSON[\"events\"];\n \n events.splice(indexOfJSON, 1);\n //console.log(\"event deleted from json\");\n \n //stores the ids of all of the interactions to erase\n var intersToDel = [];\n \n for (var i = 0; i < flashTeamsJSON[\"interactions\"].length; i++) {\n var inter = flashTeamsJSON[\"interactions\"][i];\n if (inter.event1 == eventId || inter.event2 == eventId) {\n intersToDel.push(inter.id);\n //console.log(\"# of intersToDel: \" + intersToDel.length);\n }\n }\n \n for (var i = 0; i < intersToDel.length; i++) {\n // take it out of interactions array\n var intId = intersToDel[i];\n var indexOfJSON = getIntJSONIndex(intId);\n flashTeamsJSON[\"interactions\"].splice(indexOfJSON, 1);\n\n // remove from timeline\n deleteInteraction(intId);\n }\n\n removeTask(eventId);\n \n updateStatus(false);\n}", "title": "" }, { "docid": "dbdfc4124bc6ffc72ee2a365e7a545f7", "score": "0.50870645", "text": "function emptyAnswers() {\n $(\".optnContainer\").empty();\n}", "title": "" }, { "docid": "96f0226baff3686b5c5280780253ef5d", "score": "0.5078601", "text": "deleteAns(index) {\n\t\t\tthis.answersInputList.splice(index, 1);\n\t\t}", "title": "" }, { "docid": "db5e5492373314af4ec1e7a0d4b573ba", "score": "0.5070395", "text": "function deleteAnsSection(id)\n{\n var opt_c = $('#'+id).attr('data-option_count');\n var sec_c = $('#'+id).attr('data-ans_section_count');\n $('#ans_option_'+opt_c+'_li_'+sec_c).remove();\n $('#preview_option_'+opt_c+'_section_'+sec_c).remove();\n}", "title": "" }, { "docid": "14e605f381485a6bf45640fe3dd35cbe", "score": "0.50644046", "text": "async function deleteAppts() {\n try {\n await fetch(API_URL_APPTSLOTS, {\n method: 'DELETE'\n });\n } catch {\n console.log('Error: Could not delete all appointment slots');\n } \n}", "title": "" }, { "docid": "9e48b9b68e738373ac3036e66370e30c", "score": "0.506219", "text": "function clearQ(){\n\t\t$('.game-question, .form-group').empty();\n\t\tquestTimer.pauseQ();\n\t}", "title": "" }, { "docid": "4c1cbedbd20bd89195d562fd9d13eb7f", "score": "0.5059832", "text": "function confirmDelete(name, interviewer) {\n transition(DELETING);\n const interview = {\n student: name,\n interviewer,\n };\n\n props.deleteInterview(props.id, interview, transition);\n }", "title": "" }, { "docid": "f3c2f63909dbde547d34f4fe2d164dae", "score": "0.505929", "text": "function deleteQueSection(id)\n{\n var c = $('#'+id).attr('data-quecount');\n $('#que_li_'+c).remove();\n $('#preview_que_section_'+c).remove();\n}", "title": "" }, { "docid": "3fba2e27f93d3120f97453ce05b697ed", "score": "0.505346", "text": "resetHotSeatQuestion() {\n this.hotSeatQuestion = undefined;\n this.clearAllPlayerAnswers();\n }", "title": "" } ]
a315fdb6d1f4d441494f378cba25c5eb
pass down the min size
[ { "docid": "2030eec1c8f9dfb1d9090d25306128b4", "score": "0.0", "text": "split_leaf(m_leaf) {\n var max, split, splitHorizontally;\n // begin\n if (this.lchild !== void 0 && this.rchild !== void 0) {\n return false; // this leaf has already been split\n }\n \n // determine split\n if (State.rng.range(0, 1) === 0) {\n // Split vertically\n splitHorizontally = false;\n } else {\n splitHorizontally = true;\n }\n // if width of the leaf is 25% bigger than height, split vertically\n // and the converse for horizontal split\n if ((this.leaf.w / this.leaf.h) >= 1.25) {\n splitHorizontally = false;\n } else if ((this.leaf.h / this.leaf.w) >= 1.25) {\n splitHorizontally = true;\n }\n console.log(\"Splitting horizontally: \" + splitHorizontally);\n // respect min sizes\n if (splitHorizontally) {\n max = this.leaf.h - m_leaf;\n } else {\n max = this.leaf.w - m_leaf;\n }\n if (max <= m_leaf) {\n console.log(\"Leaf too small to split, \" + m_leaf);\n return false; // the leaf is too small to split further\n }\n split = State.rng.range(m_leaf, max); //determine where to split\n if (splitHorizontally) {\n this.lchild = new Leaf(new Rect(this.leaf.x1, this.leaf.y1, this.leaf.w, split));\n this.rchild = new Leaf(new Rect(this.leaf.x1, this.leaf.y1 + this.lchild.leaf.h, this.leaf.w, this.leaf.h - this.lchild.leaf.h));\n console.log(this.lchild);\n console.log(this.rchild);\n } else {\n this.lchild = new Leaf(new Rect(this.leaf.x1, this.leaf.y1, split, this.leaf.h));\n this.rchild = new Leaf(new Rect(this.leaf.x1 + this.lchild.leaf.w, this.leaf.y1, this.leaf.w - this.lchild.leaf.w, this.leaf.h));\n console.log(this.lchild);\n console.log(this.rchild);\n }\n return true;\n }", "title": "" } ]
[ { "docid": "8f4116e99ae3a0b9165ccee2a5d189bd", "score": "0.6895785", "text": "CalcMinMaxWidth() {}", "title": "" }, { "docid": "5a5982f92978aef00b912968b662da76", "score": "0.6769247", "text": "function computeMinLaneSize(lane) {\r\n if (!lane.isSubGraphExpanded) return new go.Size(MINLENGTH, 1);\r\n return new go.Size(MINLENGTH, MINBREADTH);\r\n }", "title": "" }, { "docid": "6e4f27a497ad097a5d8f8c47fb82168f", "score": "0.6605803", "text": "function minExtentA(element, size) {return -size[a.size] * element.pivot[a.axis]; } // eslint-disable-line", "title": "" }, { "docid": "7eb4abd1af93ae4bc89a1d1f2298a23f", "score": "0.66037065", "text": "function _setMinimumChunkSize(minSize) {\n var uploadChunkSize, settingSize;\n if (!minUploadSize) {\n minUploadSize = { UPLOAD_CHUNK_SIZE: girder.rest.getUploadChunkSize() };\n var resp = girder.rest.restRequest({\n url: 'system/setting',\n method: 'GET',\n data: { key: 'core.upload_minimum_chunk_size' },\n async: false\n });\n minUploadSize.setting = resp.responseText;\n }\n if (!minSize) {\n uploadChunkSize = minUploadSize.UPLOAD_CHUNK_SIZE;\n settingSize = minUploadSize.setting;\n } else {\n uploadChunkSize = minSize;\n settingSize = minSize;\n }\n girder.rest.setUploadChunkSize(uploadChunkSize);\n girder.rest.restRequest({\n url: 'system/setting',\n method: 'PUT',\n data: { key: 'core.upload_minimum_chunk_size', value: settingSize },\n async: false\n });\n}", "title": "" }, { "docid": "4abc08c7b4d05fcc31068534cd0dec62", "score": "0.6574574", "text": "function getMinesCount(size) {\n switch (size) {\n case 4: return 2;\n break;\n case 6: return 5;\n break;\n case 8: return 15;\n break;\n }\n}", "title": "" }, { "docid": "2fa64783ab35c377534dfea1ebf66cff", "score": "0.6564017", "text": "_checkSize(size) {\n if (size <= 600) {\n this._setSizeAttribute('size-s');\n } else if (size > 600 && size <= 1023) {\n this._setSizeAttribute('size-m');\n } else if (size > 1023 && size <= 1439) {\n this._setSizeAttribute('size-l');\n } else if (size > 1439) {\n this._setSizeAttribute('size-xl');\n } else {\n this._setSizeAttribute('size-m');\n }\n }", "title": "" }, { "docid": "ad25c5ba3897c1827968ad23e7e9fb1a", "score": "0.6480687", "text": "get defaultMinWidth() {\n if (!this.grid) {\n return '80';\n }\n switch (this.grid.displayDensity) {\n case DisplayDensity.cosy:\n return '64';\n case DisplayDensity.compact:\n return '56';\n default:\n return '80';\n }\n }", "title": "" }, { "docid": "d21673e9c5fe8157d1eb1d2594899a6b", "score": "0.64423704", "text": "function chooseSize(mag) {\n return (mag*30000)\n\n }", "title": "" }, { "docid": "70f8ad082a77d8ea4fb8a7f6a0c8d100", "score": "0.64211434", "text": "get restrictResizeMin() {\n const actualWidth = this.column.headerCell.nativeElement.getBoundingClientRect().width;\n const minWidth = this.column.minWidthPx < actualWidth ? this.column.minWidthPx : actualWidth;\n return actualWidth - minWidth;\n }", "title": "" }, { "docid": "e12851d5f9cb6929d6aff99eedea890d", "score": "0.63756293", "text": "set size(value) {\n\t\tthis.sizeAbs = this.pointAbs(value);\n\t}", "title": "" }, { "docid": "e1ec2a76a5967a95bc2a7a6fb3d0434a", "score": "0.6371668", "text": "get minimumWidth() {\n return this.i.k;\n }", "title": "" }, { "docid": "6a06fb3b68e978ef9bc9e426cd527d48", "score": "0.6366842", "text": "function minWidth(obj)\r\n {\r\n //TODO\r\n return 0;\r\n var oTmp = document.getElementById(obj.m_ID + '_t_title');\r\n if(oTmp){\r\n obj.M_MinWidth = oTmp.clientWidth + 15;\r\n if(!obj.noMinMax) obj.M_MinWidth += 20;\r\n if(!oMain.noTitle && !obj.noClose) obj.M_MinWidth += 20;\r\n if(!obj.noFixed) obj.M_MinWidth += 20;\r\n }\r\n else obj.M_MinWidth = 32;\r\n\r\n var minw2 = 0;\r\n for(var i = 0; i < obj.tabPages.length; i++){\r\n var oTmp = document.getElementById(obj.m_ID + '_p_title' + i);\r\n if(oTmp) minw2 += (oTmp.offsetWidth + 1);\r\n var oTmp = document.getElementById(obj.m_ID + '_p_r' + i);\r\n if(oTmp) minw2 += (oTmp.offsetWidth + 1);\r\n }\r\n if(obj.M_MinWidth < minw2) obj.M_MinWidth = minw2;\r\n\r\n oTmp = document.getElementById(obj.m_ID + '_s_title');\r\n if(oTmp){\r\n minw2 = oTmp.clientWidth + 15;\r\n if(!obj.noResize) minw2 += 20;\r\n if(obj.M_MinWidth < minw2) obj.M_MinWidth = minw2;\r\n }\r\n if(isValid() && oMain.style.display != 'none' && !isMin()){\r\n var oTmp2 = document.getElementById(m_ID + '_i_ifrm');\r\n if(oTmp2){\r\n var oTmp = document.getElementById(m_ID + '_m_table');\r\n oTmp2.style.width = (oTmp.clientWidth+3) + 'px';\r\n oTmp2.style.height = (oTmp.clientHeight+3) + 'px';\r\n }\r\n }\r\n return obj.M_MinWidth;\r\n }", "title": "" }, { "docid": "4760d028fec1ae36ad94640962f90793", "score": "0.6350222", "text": "set minDistance(value) {}", "title": "" }, { "docid": "4b60003edf37e6e9b0f59ff38f0c2e19", "score": "0.63379407", "text": "getInitialSize() {\n return {\n width: this._maxWidth,\n height: this._maxHeight,\n };\n }", "title": "" }, { "docid": "4b60003edf37e6e9b0f59ff38f0c2e19", "score": "0.63379407", "text": "getInitialSize() {\n return {\n width: this._maxWidth,\n height: this._maxHeight,\n };\n }", "title": "" }, { "docid": "a706f6c5a09d4b97b49a693f17cdbdc9", "score": "0.6337062", "text": "get shouldGrow() {\n return this.radius > config.minWidth;\n }", "title": "" }, { "docid": "3039847b790d69b4ae80aa8dadf31d9e", "score": "0.63367134", "text": "set minWidth(value) {\n const minVal = parseFloat(value);\n if (Number.isNaN(minVal)) {\n return;\n }\n this._defaultMinWidth = value;\n }", "title": "" }, { "docid": "e7bb2fee8ca5435a798c48d72bea28bd", "score": "0.63293546", "text": "applyVertexSize(){\n if(this.settings.scaleVertices){\n const minSize = this.settings.minSize\n const maxSize = this.settings.maxSize\n for(let i = 0; i < this.vertices.length; i++){\n const v = this.vertices[i];\n v.size = Math.floor(\n ((v.degree - this.minDegree)/(this.maxDegree -this.minDegree))\n * (maxSize - minSize)) + minSize\n }\n }else {\n for(let i = 0; i < this.vertices.length; i++){\n this.vertices[i].size = 3;\n }\n }\n this.settings.shouldResizeVertex = false\n }", "title": "" }, { "docid": "f9fefe2e4968dcdbe45cbd3b6bf27746", "score": "0.62867254", "text": "shrinkX(rate, min) {\n if (this.wid > min) {\n this.wid -= p.deltaTime / rate;\n }\n }", "title": "" }, { "docid": "c9d8dcd9bc6f1efec0dfc35a6f1a2e27", "score": "0.627307", "text": "selectBestImageVersion(sizes) {\n const best = sizes.sizes.size.find((size) => {\n if (size.label.indexOf('Square') >= 0) {\n return false;\n }\n return size.width >= this.props.config.xParticlesCount;\n }) || sizes.sizes.size[sizes.sizes.size.length - 1];\n return best;\n }", "title": "" }, { "docid": "965aec5b8216339e24368f3971a8dcd0", "score": "0.6268531", "text": "function minSubArrayLen() {\n\n}", "title": "" }, { "docid": "cb35f0d4057ddcff02d91747de192de2", "score": "0.6253782", "text": "CalcSize() {}", "title": "" }, { "docid": "18a989c6fd42ca360233fcbe8ce50d00", "score": "0.62398535", "text": "updateSize(xSize, ySize) {\n if (700 < xSize) {\n xSize = 700;\n } else if (10 > xSize) {\n xSize = 10;\n }\n if (700 < ySize) {\n ySize = 700;\n } else if (10 > ySize) {\n ySize = 10;\n }\n this.xSize = xSize;\n this.ySize = ySize;\n }", "title": "" }, { "docid": "0a90091a5d328c0a31dca70919855aff", "score": "0.62372154", "text": "function increaseSize() {\n if (baseSize < 18) {\n baseSize++;\n setNewSize();\n }\n}", "title": "" }, { "docid": "10aa06d654c80c81e6171df3cc0f6bbb", "score": "0.62225544", "text": "function getSmallestWidth(){\n\treturn $(\".\"+$(\".kafka\").attr(\"class\").split(\" \")[1]).eq(1).data(\"size\")\n}", "title": "" }, { "docid": "78ed430a40e607b9135104439f726569", "score": "0.6218598", "text": "shrink() {\n if (this.size > 0.2) {\n this.size -= 0.1;\n }\n }", "title": "" }, { "docid": "b6c09703ebe98a9ef173e22c488765ab", "score": "0.62167245", "text": "setSizeRange(minSize, maxSize) {\n this.minSize = minSize;\n this.maxSize = maxSize;\n }", "title": "" }, { "docid": "aa4823eb3dd65ab4d8f863698bdb9f50", "score": "0.6198894", "text": "minHeight() {\n return this.radius;\n }", "title": "" }, { "docid": "a28bdfe96b36c4b32974123ff3da9086", "score": "0.61968106", "text": "respectMinItemWidth() {\n const minItemWidth = this.layoutManager.layoutConfig.dimensions.minItemWidth;\n let totalOverMin = 0;\n let totalUnderMin = 0;\n const entriesOverMin = [];\n const allEntries = [];\n if (this._isColumn || !minItemWidth || this.contentItems.length <= 1) {\n return;\n }\n const sizeData = this.calculateAbsoluteSizes();\n /**\n * Figure out how much we are under the min item size total and how much room we have to use.\n */\n for (let i = 0; i < sizeData.itemSizes.length; i++) {\n const itemSize = sizeData.itemSizes[i];\n let entry;\n if (itemSize < minItemWidth) {\n totalUnderMin += minItemWidth - itemSize;\n entry = {\n width: minItemWidth\n };\n }\n else {\n totalOverMin += itemSize - minItemWidth;\n entry = {\n width: itemSize\n };\n entriesOverMin.push(entry);\n }\n allEntries.push(entry);\n }\n /**\n * If there is nothing under min, or there is not enough over to make up the difference, do nothing.\n */\n if (totalUnderMin === 0 || totalUnderMin > totalOverMin) {\n return;\n }\n /**\n * Evenly reduce all columns that are over the min item width to make up the difference.\n */\n const reducePercent = totalUnderMin / totalOverMin;\n let remainingWidth = totalUnderMin;\n for (let i = 0; i < entriesOverMin.length; i++) {\n const entry = entriesOverMin[i];\n const reducedWidth = Math.round((entry.width - minItemWidth) * reducePercent);\n remainingWidth -= reducedWidth;\n entry.width -= reducedWidth;\n }\n /**\n * Take anything remaining from the last item.\n */\n if (remainingWidth !== 0) {\n allEntries[allEntries.length - 1].width -= remainingWidth;\n }\n /**\n * Set every items size relative to 100 relative to its size to total\n */\n for (let i = 0; i < this.contentItems.length; i++) {\n this.contentItems[i].width = (allEntries[i].width / sizeData.totalWidth) * 100;\n }\n }", "title": "" }, { "docid": "5c390a6c231bf7e090872393fd3539dd", "score": "0.6191496", "text": "function dxtEtcSmallSize(width, height) {\n return Math.floor((width + 3) / 4) * Math.floor((height + 3) / 4) * 8;\n }", "title": "" }, { "docid": "845d48abc930fa07a112304559f372e8", "score": "0.6169146", "text": "getEntitySize() {\r\n\t\tconst minSize = 0.75;\r\n\t\tconst maxSize = 10;\r\n\t\tconst sizeFactor = 12;\r\n\r\n\t\tconst size = Math.max(minSize, Math.min(maxSize, sizeFactor / this._camera.zoom));\r\n\t\treturn size;\r\n\t}", "title": "" }, { "docid": "4426aff40fb9c97fe7cc1298633c69be", "score": "0.6157226", "text": "get minBufferPx() { return this._minBufferPx; }", "title": "" }, { "docid": "4426aff40fb9c97fe7cc1298633c69be", "score": "0.6157226", "text": "get minBufferPx() { return this._minBufferPx; }", "title": "" }, { "docid": "4426aff40fb9c97fe7cc1298633c69be", "score": "0.6157226", "text": "get minBufferPx() { return this._minBufferPx; }", "title": "" }, { "docid": "2d3d5e487a229c60b7eaed05f86927da", "score": "0.61562824", "text": "set minHeight(value) {\n this._minHeight = value;\n }", "title": "" }, { "docid": "ccd8b7c114f115aa06886c3ed257c01e", "score": "0.6151966", "text": "getMaxOptWidt($sel) {\n let maxWidth = +$sel.attr('minWidth');\n $sel.children('li:not(:first-child)').removeClass('option-hide');\n $sel.children().each((i, currElem) => {\n let liWidth = $(currElem).outerWidth(true) + 100;//$(currElem).find('img').width(); //100 = IMG.outerWidth\n if (liWidth > maxWidth) {\n maxWidth = liWidth;\n }\n })\n $sel.children('li:not(:first-child)').addClass('option-hide');\n return maxWidth ;\n }", "title": "" }, { "docid": "bd2061cc4b97bce357e2906dcbfb3123", "score": "0.6147359", "text": "constructor(size = 100, minsize = 20) {\n this.v = [];\n this.size = size;\n this.minsize = minsize;\n this.sum = 0;\n }", "title": "" }, { "docid": "0d078a23cd71db54cb9ac7963de8a88c", "score": "0.61436015", "text": "function getShapeSize() {\n switch (current_size) {\n case \"tool-small\":\n return 20;\n break;\n case \"tool-medium\":\n return 40;\n break;\n case \"tool-large\":\n return 65;\n break;\n default:\n return 20;\n }\n}", "title": "" }, { "docid": "0f8e1662d13909c9b3efa5eca517ed6d", "score": "0.6134426", "text": "getSize() {\n\n }", "title": "" }, { "docid": "fb2933319c19438751075c31e5acfe18", "score": "0.61248076", "text": "min() {\n let min = 100000;\n for (let a = 0; a < this.size(); a++) {\n if (this.v[a] < min) {\n min = this.v[a];\n }\n }\n return min;\n }", "title": "" }, { "docid": "f4d0fceab70668c7cb833cbb77a1191f", "score": "0.61173844", "text": "function calculateSqSize(size) {\n\tvar h1 = document.getElementsByTagName(\"H1\")[0];\n\tvar desc = document.getElementsByTagName(\"P\")[0];\n\tvar takenHeight = h1.clientHeight + desc.clientHeight + 100;\n\tvar fieldSet = document.getElementById(\"ruudukko\");\n\tvar takenWidth = fieldSet.clientWidth + 50;\n\t\n\tvar availableHeight = document.documentElement.clientHeight - takenHeight;\n\tvar availableWidth = document.documentElement.clientWidth - takenWidth;\n\t\n\tif (availableHeight <= availableWidth) return availableHeight / size;\n\telse return availableWidth / size;\n}", "title": "" }, { "docid": "39905554bfe36bcedce8cd5b21bb101e", "score": "0.6112181", "text": "get min() {\n return this.args.min || 0;\n }", "title": "" }, { "docid": "d22a3e2894e3dcf3a862f6ebc8772665", "score": "0.60834324", "text": "getSize(){\n let size = super.getSize();\n if( typeof size != 'undefined' ){\n return size;\n }\n return 3 * this.getScale();\n }", "title": "" }, { "docid": "930fe82560a6d5aa0b814138fde8e9c3", "score": "0.6071261", "text": "function resize_min_maxes(position) {\n return {\n min_x: position.x + position.width - 12,\n min_y: position.y + position.height - 12,\n max_x: position.x + position.width,\n max_y: position.y + position.height\n }\n}", "title": "" }, { "docid": "2a463f60713ffee07d0bd2cb0b47d4d5", "score": "0.6058841", "text": "getSize() {\n return this.props.size || '1rem';\n }", "title": "" }, { "docid": "58d11bbddfbe8513a134b141782e7e9b", "score": "0.60522735", "text": "getSize(){\n let size = this.props.size;\n if( typeof size != 'number' ){\n return undefined;\n }\n return size;\n }", "title": "" }, { "docid": "11f4919ead31632898d401fcd6108549", "score": "0.6046857", "text": "getCellMinWidth() {\n let width = this.state.width;\n if (this.minWidth && this.minWidth.length) {\n this.lock = true;\n }\n if (width.length && !this.lock) {\n this.minWidth = [...width].map(item => {\n return item.offsetWidth;\n });\n }\n }", "title": "" }, { "docid": "c26c522d1d18bc630ae9b9068a8f1219", "score": "0.60219747", "text": "function bestSize(options, dimension) {\n\t var maxProp = dimension === 'height' ? 'maxHeight' : 'maxWidth';\n\t var prop = dimension === 'height' ? 'height' : 'width';\n\t var maxOk = isPosNum(options[maxProp]);\n\t var valOk = isPosNum(options[prop]);\n\t if (maxOk && valOk) {\n\t return Math.min(options[maxProp], options[prop]);\n\t } else if (maxOk) {\n\t return options[maxProp];\n\t } else if (valOk) {\n\t return options[prop];\n\t } else {\n\t return 'auto';\n\t }\n\t}", "title": "" }, { "docid": "7eb66f51bcf718084992f2f21535877e", "score": "0.6020347", "text": "function resizeMapNodes(size,bigorsmall)\n{\n if(bigorsmall == 'down')\n {\n if(CFG['map_node_size'])\n {\n return CFG['map_node_size'];\n }\n else\n {\n return size;\n }\n }\n else\n {\n CFG['map_node_size'] = parseFloat(size);\n return parseFloat(size) + 0.5 * parseFloat(size);\n }\n}", "title": "" }, { "docid": "52192cb19458743655cee3d08853a9b0", "score": "0.6019697", "text": "setSize() {\r\n this.size = this.fixHeight;\r\n }", "title": "" }, { "docid": "68ab08815c5bf300a4c890207cff578c", "score": "0.60168374", "text": "function changeSize() {\n let MIN_SIZE = 4;\n let MAX_SIZE = 12;\n size = Number(document.getElementById('sizeInput').value)\n\n\n if (isNaN(size) || size < MIN_SIZE || size % 2 === 1){\n size = MIN_SIZE;\n }\n\n if (size > MAX_SIZE){\n size = MAX_SIZE;\n }\n\n }", "title": "" }, { "docid": "727dd9c9c30869debfec43e82cfb2782", "score": "0.6012061", "text": "function sizeElementWidth($element, size) {\n if ($element == undefined || size == undefined)\n return false;\n $element.css('min-width', '');\n $element.css('min-width', size + 'px');\n $element.children('nav:first').css('min-width', '');\n $element.children('nav:first').css('min-width', size + 'px');\n $element.width(size);\n }", "title": "" }, { "docid": "c0f0712b43d5a27b2173e6e2162259ab", "score": "0.60047233", "text": "function smallestSize(array, s) {\n let minSize = Number.MAX_VALUE;\n let startPoint = 0;\n let currentSum = 0;\n\n for (let endPoint = 0; endPoint < array.length; endPoint++) {\n currentSum += array[endPoint];\n while (currentSum >= s) {\n minSize = Math.min(minSize, endPoint - startPoint + 1);\n currentSum -= array[startPoint];\n startPoint++;\n }\n }\n return minSize;\n}", "title": "" }, { "docid": "a383667c96af4bf12b3134ad7999cea2", "score": "0.6001479", "text": "sizeCost(){\n if(this.size==\"s\" || this.size==\"S\"){\n return 7.99;\n }\n else if(this.size==\"M\"){\n return 9.99;\n }\n else if(this.size==\"L\"){\n return 12.99;\n }\n else if(this.size==\"XL\"){\n return 15.99;\n }\n }", "title": "" }, { "docid": "b39804eaf34c1afac1a5ffdcb9d99cc9", "score": "0.5992853", "text": "function decreaseSize() {\n if (baseSize > 6) {\n baseSize--;\n setNewSize();\n }\n}", "title": "" }, { "docid": "03c0d39b5531bf30c5a0e07d556d6160", "score": "0.5978629", "text": "getMinerLen() {\n return Object.keys(this.miners).length;\n }", "title": "" }, { "docid": "32e034a271c60fedb334280f6f86c6e7", "score": "0.59700245", "text": "get stretchWidth() {}", "title": "" }, { "docid": "4421522ab3aff00d763111dfff71ae2f", "score": "0.5968528", "text": "set Size(value) {}", "title": "" }, { "docid": "4bd02cf2dad8bdb5fc709df2d639b0a1", "score": "0.5966582", "text": "getMinBlocksize() {\n return this.streamInfo.readUInt16BE(0);\n }", "title": "" }, { "docid": "5611cfb248eb4e2475954e0007db8ebc", "score": "0.596303", "text": "function multiPartMinSize () {\n return process.env.TOOL_MULTIPART_MIN_SIZE || MULTIPART_MIN_SIZE;\n}", "title": "" }, { "docid": "c652b2a948223c4cb1a5fc53b5971cfc", "score": "0.5961811", "text": "_verifySize(x, y) {\n var bumpMax, bumpMin, newXMax, newXMin, newYMax, newYMin;\n bumpMin = function([newMin, currentMin], currentMax) {\n var expandedRange, newValue, range;\n if (newMin < currentMin) {\n range = currentMax - newMin;\n expandedRange = range * 1.2;\n newValue = currentMax - expandedRange;\n return StrictMath.floor(newValue);\n } else {\n return currentMin;\n }\n };\n bumpMax = function([newMax, currentMax], currentMin) {\n var expandedRange, newValue, range;\n if (newMax > currentMax) {\n range = newMax - currentMin;\n expandedRange = range * 1.2;\n newValue = currentMin + expandedRange;\n return StrictMath.ceil(newValue);\n } else {\n return currentMax;\n }\n };\n newXMin = bumpMin([x, this.xMin], this.xMax);\n newXMax = bumpMax([x, this.xMax], this.xMin);\n newYMin = bumpMin([y, this.yMin], this.yMax);\n newYMax = bumpMax([y, this.yMax], this.yMin);\n // If bounds extended, we must resize, regardless of whether or not autoplotting is enabled, because some\n // libraries force autoscaling, but we only _expand_ the boundaries when autoplotting. --JAB (10/10/14)\n if (newXMin !== this.xMin || newXMax !== this.xMax || newYMin !== this.yMin || newYMax !== this.yMax) {\n if (this.isAutoplotting) {\n this.xMin = newXMin;\n this.xMax = newXMax;\n this.yMin = newYMin;\n this.yMax = newYMax;\n }\n this._resize();\n }\n }", "title": "" }, { "docid": "4b5f5d3f8443d9af14c92f907eb7cd63", "score": "0.5959128", "text": "function changeSize(num, flag){\n\t\t\t\t\tconsole.log(num);\n\t\t\t\t\tif (meshArr.length === 0){return;}\n\t\t\t\t\tif(flag === false){\n\t\t\t\t\t\tif (size-1 === 0){\n\t\t\t\t\t\t\talert(\"Min size reached!!\")\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\tif(flag === true){\n\t\t\t\t\t\t\tsize = num+1;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tsize = num-1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor(var i=0;i<meshArr.length;i++){\n\t\t\t\t\t\t\t meshArr[i].scale.x = size;\n\t\t\t\t\t\t\t\tmeshArr[i].scale.y = size;\n\t\t\t\t\t\t\t\tmeshArr[i].scale.z = size;\n\t\t\t\t\t}\n\t\t\t\t}", "title": "" }, { "docid": "f745fb40144e123b898c76aac830eef7", "score": "0.5956764", "text": "function baseSize() {\n // DO NOT REMOVE THIS - MAKE SURE THIS DOESN'T GET LOST IF WE UPDATE THE min.js ALSO\n\t var rect = scope_Base.getBoundingClientRect();\n\t return options.ort === 0 ? rect.width : rect.height;\n\t}", "title": "" }, { "docid": "6779a7683ee80a19359a3fb765ddce95", "score": "0.5955116", "text": "SetSize(size) {\n this.m_halfSize.Copy(size).SelfMul(0.5);\n }", "title": "" }, { "docid": "cdc6c62f7232558f901fc3e4e620a5b1", "score": "0.59509903", "text": "function setSize(d) {\n\t\t\tlet inhab_city = parseInt(inhab[d.properties.city]);\n\t\t\tlet size = Math.floor(Math.pow(inhab_city, 0.25));\n\t\t\t\n\t\t\tif (isNaN(size) || inhab_city <= 0) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\treturn size;\n\t\t}", "title": "" }, { "docid": "13369b1732c3631f3c76a1f455a29fd5", "score": "0.5950907", "text": "function getOptimalMinimumWidth(aXULElement) {\n return getSummarizedStyleValues(aXULElement, [\n \"min-width\",\n \"padding-left\",\n \"padding-right\",\n \"margin-left\",\n \"margin-top\",\n \"border-left-width\",\n \"border-right-width\",\n ]);\n}", "title": "" }, { "docid": "ab2e7b6a2c5d8d488b751bec4f0b0f37", "score": "0.5944077", "text": "get size() {\n return parseInt(this.getAttribute('size')) || 32;\n }", "title": "" }, { "docid": "ed4a486ed848f932aed654f738fcb173", "score": "0.5932339", "text": "function getMin(arr){\n var min;\n\n for(var i=0; i<arr.length; i++){\n if(min === undefined || arr[i].height < min.height ){\n min = arr[i];\n }\n }\n\n return min;\n }", "title": "" }, { "docid": "c2c8f2b1d6679bf7ba6469a2b5a06bec", "score": "0.59301865", "text": "function trimToMin(sizesToTrim) {\n // Try to get inner size of parent element.\n // If it's no supported, return original sizes.\n var parentSize = innerSize(parent);\n if (parentSize === null) {\n return sizesToTrim\n }\n\n if (minSizes.reduce(function (a, b) { return a + b; }, 0) > parentSize) {\n return sizesToTrim\n }\n\n // Keep track of the excess pixels, the amount of pixels over the desired percentage\n // Also keep track of the elements with pixels to spare, to decrease after if needed\n var excessPixels = 0;\n var toSpare = [];\n\n var pixelSizes = sizesToTrim.map(function (size, i) {\n // Convert requested percentages to pixel sizes\n var pixelSize = (parentSize * size) / 100;\n var elementGutterSize = getGutterSize(\n gutterSize,\n i === 0,\n i === sizesToTrim.length - 1,\n gutterAlign\n );\n var elementMinSize = minSizes[i] + elementGutterSize;\n\n // If element is too smal, increase excess pixels by the difference\n // and mark that it has no pixels to spare\n if (pixelSize < elementMinSize) {\n excessPixels += elementMinSize - pixelSize;\n toSpare.push(0);\n return elementMinSize\n }\n\n // Otherwise, mark the pixels it has to spare and return it's original size\n toSpare.push(pixelSize - elementMinSize);\n return pixelSize\n });\n\n // If nothing was adjusted, return the original sizes\n if (excessPixels === 0) {\n return sizesToTrim\n }\n\n return pixelSizes.map(function (pixelSize, i) {\n var newPixelSize = pixelSize;\n\n // While there's still pixels to take, and there's enough pixels to spare,\n // take as many as possible up to the total excess pixels\n if (excessPixels > 0 && toSpare[i] - excessPixels > 0) {\n var takenPixels = Math.min(\n excessPixels,\n toSpare[i] - excessPixels\n );\n\n // Subtract the amount taken for the next iteration\n excessPixels -= takenPixels;\n newPixelSize = pixelSize - takenPixels;\n }\n\n // Return the pixel size adjusted as a percentage\n return (newPixelSize / parentSize) * 100\n })\n }", "title": "" }, { "docid": "1d93875d90f5c433fb43bdbcfc2e147d", "score": "0.5929828", "text": "get min() {\n return this._toType(this._scaler.min);\n }", "title": "" }, { "docid": "c231f13715c2ab3a56cb2f3351318c18", "score": "0.5927055", "text": "getEstimateSize () {\n return this.isFixedType() ? this.fixedSizeValue : (this.firstRangeAverageSize || this.param.estimateSize)\n }", "title": "" }, { "docid": "6c3d9a7ef4a85004ddb4c252428380ff", "score": "0.59259844", "text": "function computeMinPoolSize(pool) {\r\n // assert(pool instanceof go.Group && pool.category === \"Pool\");\r\n var len = MINLENGTH;\r\n pool.memberParts.each(function(lane) {\r\n // pools ought to only contain lanes, not plain Nodes\r\n if (!(lane instanceof go.Group)) return;\r\n var holder = lane.placeholder;\r\n if (holder !== null) {\r\n var sz = holder.actualBounds;\r\n len = Math.max(len, sz.width);\r\n }\r\n });\r\n return new go.Size(len, NaN);\r\n }", "title": "" }, { "docid": "7716c033e3c9267305fad12ca2fd49bf", "score": "0.59258884", "text": "checkControlMinWidth() {\n requestAnimationFrame(() => {\n this._minWidth = this.controlAsMinWidthOff ? 80 : this.offsetWidth;\n });\n }", "title": "" }, { "docid": "6adcf08dfe26ac0b3a9bb82cbc883596", "score": "0.59218746", "text": "updateInputSize() {\n\t\t\tconst maxSize = 50;\n\t\t\tconst minSize = 4;\n\t\t\tlet size = minSize; \n\t\t\tif ( this.myValue.length >= 4)\n\t\t\t\tsize = this.myValue.length > maxSize ? maxSize + 1 : this.myValue.length+1;\n\t\t\tthis.$refs.domInput.size = size;\n\t\t}", "title": "" }, { "docid": "f74d77397749ca1692d1110a7f051eb1", "score": "0.5921538", "text": "get expectedMiniWidth() {\n return this.getExpectedWidth(true);\n }", "title": "" }, { "docid": "0404fd00112980e5b2ae489652563079", "score": "0.59158176", "text": "function applySize(force, {size: [width, height]}) {\n //only update if it is not the same as the previous value\n if (force.size()[0] !== width || force.size()[1] !== height) {\n console.log('update size');\n force.size([width, height]);\n force.shouldRun = true;\n }\n return force;\n}", "title": "" }, { "docid": "f8753ecbe554a758ef1b9df85546b8e1", "score": "0.59136355", "text": "get minHeight() {\n if (this._minHeight || this._minHeight === 0) {\n return this._minHeight;\n }\n if (!this.inline) {\n let minHeight = 645;\n switch (this.displayDensity) {\n case DisplayDensity.cosy:\n minHeight = 465;\n break;\n case DisplayDensity.compact:\n minHeight = 330;\n break;\n default: break;\n }\n return `${minHeight}px`;\n }\n }", "title": "" }, { "docid": "08db46d5ec956c2a1a2f193dc616cff8", "score": "0.59124255", "text": "get lowMarkerSize() {\n return this.i.bc;\n }", "title": "" }, { "docid": "5560e3eff8e7629cea74e94a002d6f19", "score": "0.5911118", "text": "get min() {\n return this._toType(this._scaler.min);\n }", "title": "" }, { "docid": "64de75b9f15a914af9d8038eeeb845b5", "score": "0.59110564", "text": "get lowMarkerSize() {\r\n return this.i.bc;\r\n }", "title": "" }, { "docid": "a63532e238750d0fe7fc0fd4fc572f85", "score": "0.5910756", "text": "calculateRelativeSizes() {\n let total = 0;\n const itemsWithoutSetDimension = [];\n for (let i = 0; i < this.contentItems.length; i++) {\n if (this.contentItems[i][this._dimension] !== undefined) {\n total += this.contentItems[i][this._dimension];\n }\n else {\n itemsWithoutSetDimension.push(this.contentItems[i]);\n }\n }\n /**\n * Everything adds up to hundred, all good :-)\n */\n if (Math.round(total) === 100) {\n this.respectMinItemWidth();\n return;\n }\n /**\n * Allocate the remaining size to the items without a set dimension\n */\n if (Math.round(total) < 100 && itemsWithoutSetDimension.length > 0) {\n for (let i = 0; i < itemsWithoutSetDimension.length; i++) {\n itemsWithoutSetDimension[i][this._dimension] = (100 - total) / itemsWithoutSetDimension.length;\n }\n this.respectMinItemWidth();\n return;\n }\n /**\n * If the total is > 100, but there are also items without a set dimension left, assing 50\n * as their dimension and add it to the total\n *\n * This will be reset in the next step\n */\n if (Math.round(total) > 100) {\n for (let i = 0; i < itemsWithoutSetDimension.length; i++) {\n itemsWithoutSetDimension[i][this._dimension] = 50;\n total += 50;\n }\n }\n /**\n * Set every items size relative to 100 relative to its size to total\n */\n for (let i = 0; i < this.contentItems.length; i++) {\n this.contentItems[i][this._dimension] = (this.contentItems[i][this._dimension] / total) * 100;\n }\n this.respectMinItemWidth();\n }", "title": "" }, { "docid": "b099ee1d0c18f27dd450a137277be955", "score": "0.59087944", "text": "getMinimumDimensions(arr) {\n var _a, _b;\n let minWidth = 0;\n let minHeight = 0;\n for (let i = 0; i < arr.length; ++i) {\n minWidth = Math.max((_a = arr[i].minWidth) !== null && _a !== void 0 ? _a : 0, minWidth);\n minHeight = Math.max((_b = arr[i].minHeight) !== null && _b !== void 0 ? _b : 0, minHeight);\n }\n return {\n horizontal: minWidth,\n vertical: minHeight\n };\n }", "title": "" }, { "docid": "df9949ac8b99bbab83f12ef115a97a58", "score": "0.59025455", "text": "get minDistance() {}", "title": "" }, { "docid": "220589dd15c2c64b2847e0bec802d685", "score": "0.5901588", "text": "getInitialSize() {\n return {\n width: Math.max(this._$origImage.data('initial-width'),\n this._$modifiedImage.data('initial-width')),\n height: Math.max(this._$origImage.data('initial-height'),\n this._$modifiedImage.data('initial-height')),\n };\n }", "title": "" }, { "docid": "220589dd15c2c64b2847e0bec802d685", "score": "0.5901588", "text": "getInitialSize() {\n return {\n width: Math.max(this._$origImage.data('initial-width'),\n this._$modifiedImage.data('initial-width')),\n height: Math.max(this._$origImage.data('initial-height'),\n this._$modifiedImage.data('initial-height')),\n };\n }", "title": "" }, { "docid": "4d31ce8a4666cfef9bf0e67e942b4ff3", "score": "0.5900774", "text": "min() {\n if (this._size <= 0)\n return undefined;\n let result = this._dense[0];\n for (let index = 1, length = this._size; index < length; ++index) {\n const cell = this._dense[index];\n result = cell < result ? cell : result;\n }\n return result;\n }", "title": "" }, { "docid": "8a3c5f4cf06277ba59671943ae307d1c", "score": "0.5894443", "text": "function custSize(){\n var h = document.getElementById(\"height\");\n var w = document.getElementById(\"width\");\n var m = document.getElementById(\"mines\");\n\n // validate length/width & push back validated sizes\n height = h.value = (h.value === \"\" || h.value < 1) ? 1 : parseInt(h.value);\n width = w.value = (w.value === \"\" || w.value < 9) ? 9 : parseInt(w.value);\n\n // validating minefield\n if (m.value > (h.value) * (w.value) - 1)\n m.value = (h.value) * (w.value) - 1;\n\n maxBombs = m.value = (m.value === \"\" || m.value < 1) ? 1 : parseInt(m.value);\n difficulty = 3;\n newGame();\n}", "title": "" }, { "docid": "1cd52bf6d8cee9a67e0502e8d4be87bf", "score": "0.58908147", "text": "function resizeWidth(minimum){\n\t\t\t\t\t\tif (minimum){\t// If minimum height needs to be considered\n\t\t\t\t\t\t\tif(thisSlide.width() < browserwidth || thisSlide.width() < base.options.min_width ){\n\t\t\t\t\t\t\t\tif (thisSlide.width() * ratio >= base.options.min_height){\n\t\t\t\t\t\t\t\t\tthisSlide.width(base.options.min_width);\n\t\t\t\t\t\t \t\tthisSlide.height(thisSlide.width() * ratio);\n\t\t\t\t\t\t \t}else{\n\t\t\t\t\t\t \t\tresizeHeight();\n\t\t\t\t\t\t \t}\n\t\t\t\t\t\t }\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tif (base.options.min_height >= browserheight && !base.options.fit_landscape){\t// If minimum height needs to be considered\n\t\t\t\t\t\t\t\tif (browserwidth * ratio >= base.options.min_height || (browserwidth * ratio >= base.options.min_height && ratio <= 1)){\t// If resizing would push below minimum height or image is a landscape\n\t\t\t\t\t\t\t\t\tthisSlide.width(browserwidth);\n\t\t\t\t\t\t\t\t\tthisSlide.height(browserwidth * ratio);\n\t\t\t\t\t\t\t\t} else if (ratio > 1){\t\t// Else the image is portrait\n\t\t\t\t\t\t\t\t\tthisSlide.height(base.options.min_height);\n\t\t\t\t\t\t\t\t\tthisSlide.width(thisSlide.height() / ratio);\n\t\t\t\t\t\t\t\t} else if (thisSlide.width() < browserwidth) {\n\t\t\t\t\t\t\t\t\tthisSlide.width(browserwidth);\n\t\t\t\t\t\t \t\tthisSlide.height(thisSlide.width() * ratio);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}else{\t// Otherwise, resize as normal\n\t\t\t\t\t\t\t\tthisSlide.width(browserwidth);\n\t\t\t\t\t\t\t\tthisSlide.height(browserwidth * ratio);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "title": "" }, { "docid": "23ad9e1e03774db854f08ba233896352", "score": "0.5888074", "text": "function smallestSizeGteS(arr, s) {\n var minSize = Number.MAX_VALUE;\n var start = 0;\n var currSum = 0;\n for (let end = 0; end < arr.length; end++) {\n currSum += arr[end];\n while (currSum >= s) {\n minSize = Math.min(minSize, end - start + 1);\n currSum -= arr[start];\n start++;\n }\n }\n return minSize;\n}", "title": "" }, { "docid": "3764dc7715e98050ad67fb0062f03f73", "score": "0.5876532", "text": "get min() { return this._min; }", "title": "" }, { "docid": "8bfb54039b10930ccbdb3b022845ceb8", "score": "0.5869249", "text": "function changeSize() {\n d = d + 2;\n if (d > 100) {\n d = 0;\n }\n}", "title": "" }, { "docid": "9a4af788cf4fed9639d629d7c3e69d70", "score": "0.58687925", "text": "function setPixelSize() {\n min = parseInt($('#min').val());\n max = parseInt($('#max').val());\n gridPixelSize = canvas.width / (max - min);\n }", "title": "" }, { "docid": "a4943c27f70c69336c1b66ffac5eb6ac", "score": "0.58533996", "text": "sizeChanged(prev, next) {\n var _a;\n\n const size = Math.max(0, parseInt((_a = next === null || next === void 0 ? void 0 : next.toFixed()) !== null && _a !== void 0 ? _a : \"\", 10));\n\n if (size !== next) {\n DOM.queueUpdate(() => {\n this.size = size;\n });\n }\n }", "title": "" }, { "docid": "9ab16f54f4d3726d6d68da74c970a33b", "score": "0.5849666", "text": "function getSize(){\n\t\treturn\n\t\t(sizeHash, tiles[0].length);\n\t\t}", "title": "" }, { "docid": "87af010d2e1a2d79cfd95387b7627a86", "score": "0.58322793", "text": "havingSize(size){if(this.size===size&&this.textSize===size){return this;}else{return this.extend({style:this.style.text(),size:size,textSize:size,sizeMultiplier:sizeMultipliers[size-1]});}}", "title": "" }, { "docid": "577ec6d78ecfea847be8da4e19c937c7", "score": "0.58236593", "text": "function arrayMinSize(array, min) {\n return array instanceof Array && array.length >= min;\n }", "title": "" }, { "docid": "888c09c92867ef816e24e65bdab6c583", "score": "0.5822461", "text": "get minWidth() {\n return this.i.bh;\n }", "title": "" }, { "docid": "0bfea81f2b10c886d4c0f804c4b25074", "score": "0.5821775", "text": "readjustDimensions() {\n if (!this.dimensionReadjustmentEnabled) {\n return;\n }\n\n if (this.fitContent || this.minWidth > this.width) {\n this.width = this.minWidth;\n }\n if (this.fitContent || this.minHeight > this.height) {\n this.height = this.minHeight;\n }\n }", "title": "" }, { "docid": "ec855718ef816d5b7752c1ffe274b636", "score": "0.5821235", "text": "set _min(value){Helper$2.UpdateInputAttribute(this,\"min\",value)}", "title": "" }, { "docid": "ec855718ef816d5b7752c1ffe274b636", "score": "0.5821235", "text": "set _min(value){Helper$2.UpdateInputAttribute(this,\"min\",value)}", "title": "" }, { "docid": "ec855718ef816d5b7752c1ffe274b636", "score": "0.5821235", "text": "set _min(value){Helper$2.UpdateInputAttribute(this,\"min\",value)}", "title": "" } ]
71aecc4dff51f1948674a370a60e4579
logs: a[0] = 2 a[1] = 5 a[3] = 9 ///// my trial of array and forEach method
[ { "docid": "7800928f5ec2a82ec69cd6f53fca88f4", "score": "0.0", "text": "function outPut (element, index, array) {\n\tconsole.log('array[' + index + '] = ' + element);\n}", "title": "" } ]
[ { "docid": "bcfdf34f740106065dbe66ee2c12240e", "score": "0.68904316", "text": "function pa ( a){ for(let i=0; i< a.length; i++) { console.log(a[i]); } }", "title": "" }, { "docid": "d21efb7f30a800ca17bc918e054ce097", "score": "0.6719701", "text": "function arrList(arr) {\n\t\tfunction list(numvalue, num) {\n\t\t\tnum = num + 1;\n\t\t\tconsole.log(\"element\", num, \"is\", numvalue);\t\n\t\t}\n\t\tarr.forEach(list);\n\t}", "title": "" }, { "docid": "e752810f2a45ddff858cc1d6d90fe623", "score": "0.6716706", "text": "traverse() {\n this.#array.forEach((element, i) => console.log(`Indice ${i}: ${element}`));\n }", "title": "" }, { "docid": "d53f6032f811d2f983667d534f08da8e", "score": "0.66897607", "text": "function testForEach(arr) {\n return arr.forEach( element => { console.log(element)});\n}", "title": "" }, { "docid": "c77d81b7f87dc51f21732f0964a7d9f7", "score": "0.66505975", "text": "function iterativeLog(array1){\n//Call .forEach() on this array\n array1.forEach((element, index) => {\n//inside the callback,\n//log each element with the format\n//${index}: ${element}.\n console.log(`${index}: ${element}`)\n })\n}", "title": "" }, { "docid": "3e67d105f6849c207d2aa7248597a434", "score": "0.66203284", "text": "function logArr(a) {\n for (var i = 0; i < a.length; i++) {\n console.log(a[i])\n }\n}", "title": "" }, { "docid": "093fe0a6e3497505110aada1688901c9", "score": "0.65407103", "text": "function print(array){\n array.forEach( (num , i) => {\n console.log(i + 1, num)\n })\n}", "title": "" }, { "docid": "049e20a0078025c62a56dabef2a376f3", "score": "0.65291935", "text": "function forEach(arr, log) {\n for (let i = 0; i < arr.length; i++) {\n log(arr[i]);\n }\n\n}", "title": "" }, { "docid": "98ce3649be9b25fa916c67eebb2e051d", "score": "0.6490989", "text": "function printArrayByForEach(val){\n val.forEach(function(val){\n })\n return val;\n}", "title": "" }, { "docid": "45b3622cca52f9608f121f0ffbd6fc0e", "score": "0.6454015", "text": "function printArray(a){\n \n for (var i = 0 ; i < a.length ; i++) {\n console.log(a[i]);\n }\n console.log(i);\n \n}", "title": "" }, { "docid": "16576fa2654ca519ea3f3e9a6e7f341f", "score": "0.6352767", "text": "function print(array){\n array.forEach(function(i){\n console.log(i);\n })\n}", "title": "" }, { "docid": "1bb00047ddea46900698fe74434db962", "score": "0.6314635", "text": "function check(numArray) {\n numArray.forEach((element, index) => {\n if (element % 3 == 0) {\n numArray[index] = element + 100;\n }\n })\n console.log(numArray)\n}", "title": "" }, { "docid": "1ba0e8481c46c364bb8381d06331df2d", "score": "0.62740993", "text": "function evenNumbers1(a) {\n\tif (Array.isArray(a)) {\n\t\t\ta.forEach(evenNumbers1);\n\t\t\treturn;\n\t}\n\tif (a % 2 == 0) {\n\t\t\tconsole.log(a);\n\t}\n}", "title": "" }, { "docid": "99ea5bd6709a03253b26b97217ae9e97", "score": "0.62383944", "text": "function logArrayElements(element, index, array) {\r\n console.log('a[' + index + '] = ' + element);\r\n}", "title": "" }, { "docid": "12cf16cc2af01e958bb9b1840cd524ce", "score": "0.6195511", "text": "function logArrayElements(element, index, array) {\n console.log('a[' + index + '] = ' + element + ' Array = '+ array);\n }", "title": "" }, { "docid": "48b533cec01110969741c88b9a17c1ac", "score": "0.61815864", "text": "function example1(arr) {\n arr.forEach(item => {\n item = item += 1\n console.log(item);\n })\n\n}", "title": "" }, { "docid": "4305d080c6ad243952d62d48d6c8827b", "score": "0.61536753", "text": "function forEach (arr, func) {\n\tconst len = arr.length\n\tlet i\n\n\tfor (i = 0; i < len; i++) {\n\t\tfunc(arr[i], i, arr)\n\t}\n}", "title": "" }, { "docid": "33754f23d474cc31efff1829fc179cbc", "score": "0.6108706", "text": "function DouV(arr){\n var newarr = [];\n for(var i = 0; i < arr.length; i++){\n newarr.push(arr[i] * 2);\n }\n console.log(newarr);\n}", "title": "" }, { "docid": "18953eb07e3999acfa6e6fa291331dec", "score": "0.6106462", "text": "function doubleFor(array) {\n let newArray = []\n for(let i = 0; i < array.length; i++) {\n for(let j = i + 1; j < array.length; j++) {\n console.log(i, j)\n \n }\n }\n return newArray\n \n}", "title": "" }, { "docid": "31b6c3f0abc3977f507d42f03cb09f19", "score": "0.605831", "text": "traverse(){\r\n this.Array.forEach(function (sa) {\r\n \r\n console.log(sa);\r\n\r\n })\r\n}", "title": "" }, { "docid": "c7c2e19f668250ceb04034c55831b942", "score": "0.6043214", "text": "function logNums(el, i, arr) {\n console.log(el, i, arr);\n}", "title": "" }, { "docid": "1cd00c50d8ec21ac109e6f0b191a41fd", "score": "0.6007192", "text": "function test() {\n var arr = [];\n arr[0] = [1, 2, 3, 4, 5];\n arr[1] = [1, 2, 3, 4, 5];\n arr[2] = [1, 2, 3, 4, 5];\n arr[3] = [1, 2, 3, 4, 5];\n arr[4] = [1, 2, 3, 4, 5];\n arr[5] = [1, 2, 3, 4, 5];\n arr[6] = [1, 2, 3, 4, 5];\n arr[7] = [1, 2, 3, 4, 5];\n arr[8] = [1, 2, 3, 4, 5];\n arr[9] = [1, 2, 3, 4, 5];\n arr[10] = [1, 2, 3, 4, 5];\n arr[11] = [1, 2, 3, 4, 5];\n arr[12] = [1, 2, 3, 4, 5];\n arr[13] = [1, 2, 3, 4, 5];\n arr[14] = [1, 2, 3, 4, 5];\n arr[15] = [1, 2, 3, 4, 5];\n arr[16] = [1, 2, 3, 4, 5];\n arr[17] = [1, 2, 3, 4, 5];\n arr[18] = [1, 2, 3, 4, 5];\n arr[19] = [1, 2, 3, 4, 5];\n arr[20] = [1, 2, 3, 4, 5];\n arr[21] = [1, 2, 3, 4, 5];\n arr[22] = [1, 2, 3, 4, 5];\n arr[23] = [1, 2, 3, 4, 5];\n arr[24] = [1, 2, 3, 4, 5];\n arr[25] = [1, 2, 3, 4, 5];\n arr[26] = [1, 2, 3, 4, 5];\n arr[27] = [1, 2, 3, 4, 5];\n arr[28] = [1, 2, 3, 4, 5];\n arr[29] = [1, 2, 3, 4, 5];\n arr[30] = [1, 2, 3, 4, 5];\n arr[31] = [1, 2, 3, 4, 5];\n arr[32] = [1, 2, 3, 4, 5];\n arr[33] = [1, 2, 3, 4, 5];\n\n for (var i = 0; i < 32; i++) {\n arr[i][0] = 0; // Conversion of copy-on-access array should be transparent\n }\n}", "title": "" }, { "docid": "26df1df9f8776efc5e2c7563242cc1f3", "score": "0.60065085", "text": "function sumArray(a) {\n\tvar n = 0;\n\ta.forEach(function(el, ind, arr) {\n\t\tn += el;\n\t});\n\treturn n;\n}", "title": "" }, { "docid": "befb5361a63385cbdaf4942241550b29", "score": "0.600603", "text": "traverse(){\r\n for (let i = 0; i < this.Array.length; i++) {\r\n console.log(this.Array[i])\r\n }}", "title": "" }, { "docid": "5b950f4d521421da6241a2381d021621", "score": "0.59997535", "text": "function looper(arr){\n arr.map(function(val, i, arr){\n arr[i] = val + 5;\n })\n return arr;\n}", "title": "" }, { "docid": "30ddd23d12ffff08f72bb277139fa8a3", "score": "0.599619", "text": "function foreach(a, f) {\n for (var i = 0; i < a.length; i++) {\n f(a[i]);\n }\n}", "title": "" }, { "docid": "fc64ff62b15d498b79c95df57824ff9f", "score": "0.5969812", "text": "function logEach(array) {\n for (var i = 0; i < array.length; i++)\n console.log(array[i])\n}", "title": "" }, { "docid": "b92e4c65f24a9c37b80b19f8cca4b4e6", "score": "0.59691286", "text": "function arrayLogger (anArray) {\n for (let i = 0; i < anArray.length; i++) {\n let currentElement = anArray[i];\n\n console.log(currentElement); \n } \n}", "title": "" }, { "docid": "d6762c832236633e7d27eaa4cc114e55", "score": "0.5956028", "text": "function printArrayByForLoop(val){\n for(let counter = 0; counter < val.length; counter++){\n }\n return val;\n}", "title": "" }, { "docid": "6d4a22516609341599e3b020841655c8", "score": "0.59533995", "text": "forEach(array, callback, scope) {\n for (let i = 0; i < array.length; i++) {\n callback.call(scope, i, array[i])\n }\n }", "title": "" }, { "docid": "3041b7648ff63e6b661395a1a1e14ed2", "score": "0.5952436", "text": "function IncEvOther(arr){\n for(var i=1; i<arr.length; i+=2){\n arr[i]++; \n }\n console.log(arr);\n return arr;\n}", "title": "" }, { "docid": "db3063555a1bf1aa5e1614b0972f3106", "score": "0.59425956", "text": "function forEach(arr, func)\n{\n\tif (arr.length == 0) return;\n\tfor (var i = 0; i < arr.length; i++)\n\t{\n\t\tfunc(arr[i], i, arr);\n\t}\n}", "title": "" }, { "docid": "62b23ba2f67254d079da7ce11b358453", "score": "0.59409624", "text": "function arrayForEach(array, action) {\n for (var i = 0, j = array.length; i < j; i++)\n action(array[i], i);\n }", "title": "" }, { "docid": "99cae8e7360404bac765be215fcdeec8", "score": "0.59301066", "text": "function indexMultiple (a1) {\n let newArray = []\n a1.forEach((item, i) => {if(item%i===0){newArray.push(item)}});\n return newArray\n}", "title": "" }, { "docid": "7334a407ec3d7e7ee9c395e1301efa3f", "score": "0.5921721", "text": "function myForEach(arr, cb){\n for (var i = 0; i < arr.length; i++) {\n var el = arr[i];\n cb(el, i, arr);\n }\n}", "title": "" }, { "docid": "87d66e268cec6c97a967be8d6b302c7b", "score": "0.59177285", "text": "function doublevalue(){\n var newarr=[];\n for(var i=0;i<arr.length;i++){\n arr[i]=arr[i]*2;\n newarr.push(arr[i]);\n }\n console.log(newarr);\n console.log(arr);\n}", "title": "" }, { "docid": "57f8b82bd3fe457b4e33bf3e851b158d", "score": "0.59141314", "text": "function duplicateEachEl(arr) {\n return arr.map(function (element) {\n return (element * 2);\n })\n }", "title": "" }, { "docid": "283011b85bc3ca3dd35b2319152c8325", "score": "0.58891857", "text": "function myForEach(arr, func) {\n \n for (var index = 0; index < arr.length; index++) {\n func(arr[index], index, arr);\n \n }\n}", "title": "" }, { "docid": "7507b8d53808a04d49594b8a01b82e83", "score": "0.58853275", "text": "function testArray() {\n a = [1, 3, 2];\n modifyArray(a);\n console.log(a);\n}", "title": "" }, { "docid": "d50590f77eac0aa36e080eadb8e88254", "score": "0.5869725", "text": "function doubleValues(num) {\n // console.log(num);\n num.forEach((element) => {\n element += element;\n return element;\n });\n \n}", "title": "" }, { "docid": "da31cdfd2e113a978b8c54bbdd4ef7e9", "score": "0.5855008", "text": "function p7(){\n var arr = []\n for(var i = 1; i <= 50; i+=2){\n arr.push(i)\n }\n console.log(arr)\n}", "title": "" }, { "docid": "b42b23db8502f087716d0de445f24987", "score": "0.5854344", "text": "function forEach(array, func) {\n\tfor (var i = 1; i < array.length; i++) {\n\t\tfunc(array[i], array[i - 1]);\n\t}\n}", "title": "" }, { "docid": "0e51d587f7bb05ba96e3064cbfb07806", "score": "0.5852275", "text": "function forEach(arr, cb) {\nfor (let i=0; i < arr.length; i++){\n cb(arr[i]); // cb is a function that outputs each element of array!\n}\n}", "title": "" }, { "docid": "1aed81923db7616483764b704b13cbd1", "score": "0.5841694", "text": "function multiplyPosition(arr){\n var newArr = [];\n for(var i = 0; i < arr.length; i++){\n newArr.push(arr[i] = arr[i] * i); \n };\n console.log(newArr); \n}", "title": "" }, { "docid": "6e52a1c93dc333e29a66f9c5a9a765ba", "score": "0.58359015", "text": "function addAndLog(array) {\n for (var i = 0; i < array.length; i++) {\n for (var j = 0; j < array.length; j++) {\n console.log(array[i] + array[j]);\n }\n } \n}", "title": "" }, { "docid": "1171f835a319b3ff13477ff38fe34920", "score": "0.58200175", "text": "forEach(callback) {\n if ( this.length ) {\n for (let i = 0; i <= this.length - 1; i++) {\n callback(this[i], i);\n }\n }\n }", "title": "" }, { "docid": "377e79fd4a876b3b6e042c35e68d387a", "score": "0.5816518", "text": "function test() {\n let arr = [];\n for (let i = 1; i < 101; i++) {\n arr.push(i);\n }\n let updatedArray = fizzbuzz(arr);\n updatedArray.forEach(element => {\n console.log(element);\n });\n}", "title": "" }, { "docid": "36ee87f47415dd951d2c82db04964e3f", "score": "0.58121043", "text": "function doublenum() {\n let x = numArray.map(Element => Element * 2);\n return x;\n }", "title": "" }, { "docid": "d7475e6e3e5287d6163d8d7a49d8fe7f", "score": "0.58104706", "text": "function addAndLog(array) {\n for (var ii = 0; ii < array.length; ii++) {\n for (var jj = 0; jj < array.length; jj++) {\n console.log(array[ii] + array[jj]);\n }\n }\n}", "title": "" }, { "docid": "e24d0fcea5f60489f128edc88088889d", "score": "0.58102876", "text": "function getFruit(a) {\n for (let i = 0; i < a.length; i++) {\n console.log(a[i]);\n }\n}", "title": "" }, { "docid": "2f6eaa06c3e9ef5ffbc2513757e1fe4d", "score": "0.5807981", "text": "function iterateArr(arr) {\n\n\t\tarrItemTimeoutIds = [];\n\t\tvar currTimeoutId = 0;\n\n\t\tarr.forEach(function(v, i, a) {\n\t\t\tcurrTimeoutId = setTimeout(function(value, index, arr) {\n\t\t\t\treturn function() {\n\t\t\t\t\tparseArrayItems(value, index, arr)\n\t\t\t\t}\n\t\t\t}(v, i, a), (i * intervalTime));\n\t\t\tarrItemTimeoutIds.push(currTimeoutId);\n\t\t});\n\t\tconsole.log(arrItemTimeoutIds);\n\t}", "title": "" }, { "docid": "5f8c3e4a0f371731cc21e3f79acf6266", "score": "0.5806855", "text": "function doubleValues(arr){\n let newArr = [];\n arr.forEach(function(value) {\n newArr.push(value * 2);\n });\n return newArr;\n }", "title": "" }, { "docid": "09bd6c1aac05a988a5cdf8581c9c02da", "score": "0.58052045", "text": "function log(array) {\n console.log(array[0]);\n console.log(array[1]);\n}", "title": "" }, { "docid": "65709a9e7d7b662b159d6d497eb1d69a", "score": "0.57888347", "text": "function newForEach(arr, callback) {\n for (let i = 0; i < arr.length; i++){\n const element = arr[i]\n callback(element, i)\n }\n}", "title": "" }, { "docid": "2fa769a68e23353485b8c8e269d65b3e", "score": "0.5770106", "text": "_forEach(array, callback, scope) {\n\t \tfor (var i = 0; i < array.length; i++) {\n\t \tcallback.call(scope, i, array[i]); // passes back stuff we need\n\t \t}\n\t}", "title": "" }, { "docid": "5fc98e4dd8d4ad2570d6ec5ac71b1a07", "score": "0.57647604", "text": "function logItem(n){\n for (let index = 0; index < n; index++) {\n for (let j = 0; j < n; j++) {\n console.log(index,j)\n }\n }\n\n for (let k = 0; k < n; k++) {\n \n console.log(k)\n }\n \n\n}", "title": "" }, { "docid": "b0db9d5d865f1f45a3a042310416d0db", "score": "0.5763375", "text": "function forEach(array, action){\n\t for (var i = 0; i < array.length; i++)\n\t action(array[i]);\n\t}", "title": "" }, { "docid": "8caac69469e384b79c071ec7840310c3", "score": "0.5752096", "text": "function sumArray(array) {\n var total = 0;\n array.forEach(function(element) {\n total += element;\n });\n console.log(total);\n}", "title": "" }, { "docid": "3ef3195451e557c2bd7d6196baa5fb4c", "score": "0.5751248", "text": "function forLoopTwoToThe(arr) {\n arr.forEach(function (item, index) {\n arr[index] = 2 ** item;\n });\n return arr;\n}", "title": "" }, { "docid": "76096147b3bb2fc70b1c314692761cc9", "score": "0.5749287", "text": "function printArrayValues(array) {\n // YOUR CODE BELOW HERE //\n //START: index 0\n //STOP: last indexed value\n //UPDATE: +1\n for (var i = 0; i<array.length; i++) {\n //console-logging all values inside the array\n console.log(array[i]);\n }\n \n // YOUR CODE ABOVE HERE //\n}", "title": "" }, { "docid": "3e2f3673a7c098b6d450427cdc6fbd1d", "score": "0.5747691", "text": "function forEach(array, callback) {\n\n}", "title": "" }, { "docid": "887374cec9b1c3c25d70df5f6a198d2a", "score": "0.5740476", "text": "function getSums(arr) {\n const newArr = arr.map((item, i) => {\n let j = i,\n sum = 0;\n while (j > 0) {\n sum += arr[j];\n j--;\n }\n item = sum;\n return item + 1;\n });\n console.log(newArr);\n return newArr;\n}", "title": "" }, { "docid": "65edd7171c439b33f077369408aaabc2", "score": "0.57378024", "text": "function turtle(array) { \n\n let posElements = array.filter(element => { \n if (element[0] >= 0 && element[1] >= 0) {\n console.log(`[${element[0]}, ${element[1]}]`);\n return true;\n }\n });\n\n const sum = posElements.map(x => x[0] + x[1]);\n console.log(sum);\n\n let i = 1;\n sum.forEach(x => console.log(`Movement #${i++}: ${x} steps`));\n\n}", "title": "" }, { "docid": "a638050b4a1807732b10626baffa2e9f", "score": "0.5730695", "text": "function collectArray(elementIndex) {\n\t\tif (counter%2 !==0) {\n\t\t\txs[elementIndex] = 1;\n\t\t}\n\t\telse {\n\t\t\tos[elementIndex] = 1;\n\t\t}\n\t}", "title": "" }, { "docid": "bf8576cc8df1b3004665f41a3e115fd8", "score": "0.57267344", "text": "function arrayOutput(a) {\n\t\tfor (var i=0; i<a.length; i++) {\n\t\t\tdocument.writeln(a[i]+'<br>');\n\t\t}\n\t}", "title": "" }, { "docid": "c20f53db1032abd0014f8a98a4ebe02a", "score": "0.5717152", "text": "function a(e,t){var n=i.length?i.pop():[],a=o.length?o.pop():[],s=r(e,t,n,a);return n.length=0,a.length=0,i.push(n),o.push(a),s}", "title": "" }, { "docid": "b27c482ef999b989241ee79e5346e13c", "score": "0.5716465", "text": "function printArray(anArray) {\n for(let item of anArray) {\n console.log(item);\n } \n}", "title": "" }, { "docid": "09bf8816d0e4202e9d98495ac1764143", "score": "0.5716441", "text": "function forEach(array, action) {\n\tfor (var i = 0; i < array.length; i++) {\n\t\taction(array[i], array[i - 1])\n\t}\n}", "title": "" }, { "docid": "ad185257b8ec9904539f96f115910095", "score": "0.5712948", "text": "function printArrayVals(arr) {\n for var idx = 0; i < arr.length; arr++ {\n console.log('array[',idx,']=',arr[idx] );\n }\n}", "title": "" }, { "docid": "e0aaa630c0a116f73603912e07bf4f3b", "score": "0.5708474", "text": "function outputArray(arr){\n for(i=0; i<arr.length; i++)\n console.log(arr[i]);\n}", "title": "" }, { "docid": "88e16a48662271dba24c22e3f380bb8b", "score": "0.57081836", "text": "function process(data) {\n\tvar positions = [];\n\tdata.forEach (function (a, i) {\n\t\tdata.forEach (function (b, j){\n\t\t\tif (a + b === 0) {positions.push ( i + \",\" + j )}\n\t\t});\n\t\treturn positions\n\t});\n\t// positions.forEach (function (a) {\n\t// \tconsole.log(\"Here you go \" + a)\n\t// });\n\tconsole.log(positions)\n}", "title": "" }, { "docid": "61c569fc9aa5b2235378512c1532fc3c", "score": "0.5706448", "text": "function sumArray(arr) {\n var result = 0;\n arr.forEach(function(numb) {\n result += numb;\n \n });\n return result;\n }", "title": "" }, { "docid": "689d7144227a816e6372f2f2a85af263", "score": "0.5704044", "text": "function doToArray(array4, callback2){\n//Call .forEach() on the array,\n//passing the callback as the forEach callback.\n array4.forEach(callback2)\n }", "title": "" }, { "docid": "1c9359e5a36fc6a666f83d4a17856746", "score": "0.5703557", "text": "function reocurring(){\n\tarray.forEach(array)\n}", "title": "" }, { "docid": "2d744cb95bc5f7a58c98f100fbbe8963", "score": "0.5702211", "text": "static forEachCps(index, arr, onElem) {\n if (index < arr.length) {\n onElem(arr[index], function () {\n Util.forEachCps(index+1, arr, onElem);\n })\n }\n }", "title": "" }, { "docid": "60c0abf02e36fc8ff3c1d1ed8b773d0a", "score": "0.5699486", "text": "function dividingAdding (a) {\n var newArr = [];\n for (var i = 0; i < a.length; i++) {\n newArr [i] = a [i]/2 + 5;\n if (newArr[i] == 0) {\n newArr[i] = 20;\n } \n }\n return newArr;\n}", "title": "" }, { "docid": "5f2a098393fe2251251ba58689fc5518", "score": "0.5698561", "text": "function es5Console(myArray){\n\tconsole.log(\"es5\");\n\tmyArray.forEach(function(value){\n\t\tconsole.log(value);\n\t\tif(value>=2){\n\t\t\treturn;\n\t\t}\n\t})\n}", "title": "" }, { "docid": "8dc837062301ce795da7480e7fb0c28d", "score": "0.56984943", "text": "function doubleVision(array){\n for(var i=0;i<array.length;i++){\n array[i] = array[i] * 2;\n console.log(array[i]);\n }\n\n}", "title": "" }, { "docid": "e6ea706df0c01e14a42706f38acde131", "score": "0.5692053", "text": "function newForEach(array, callback) {\n for (let index = 0; index < array.length; index = index + 1) {\n let currentItem = array[index]\n callback(currentItem, index, array)\n }\n}", "title": "" }, { "docid": "19a6ca33c234e3e41d7b9609f89e31fc", "score": "0.56842935", "text": "function forEach(arr2, cb){\n //console.log(arr1.length)\n for(var i=0; i<arr2.length; i++){\n //console.log(arr2[i])\n cb(arr2[i], i, arr2)\n }\n}", "title": "" }, { "docid": "91b122e9d64a140a9a039faa58f02011", "score": "0.5681112", "text": "function p4(){\n var arr = [1,3,2,4,36,43,6,5,98]\n var sum = 0\n for(var i =0; i < arr.length; i++){\n sum += arr[i]\n }\n console.log(\"The sum of all values within the array is: \" + sum)\n}", "title": "" }, { "docid": "b737f3a80fbfdd2e9aa360dd4e65a7bb", "score": "0.5679084", "text": "function map(array, f) { \n var acc = []; \n each(array, function(element, i) { \n acc.push(f(element, i)); \n });\n return acc; \n }", "title": "" }, { "docid": "a52975fbb8fa99a2168c90f95788894f", "score": "0.5675985", "text": "function logAll(array) {\n for(var ii = 0; ii < array.length; ii++) {\n console.log(array[ii]);\n }\n}", "title": "" }, { "docid": "0f635bddb602dece678e4ef2767a0f01", "score": "0.5662901", "text": "function sum_forEach(array) {\r\n var total = 0;\r\n array.forEach(function(item){\r\n total+= item\r\n });\r\n return total;\r\n}", "title": "" }, { "docid": "e4a8407a8eb57ccae026a8d3f1a993fe", "score": "0.56628084", "text": "function sum(array){\n var newArr = array.map(function(num){\n return num + 1;\n });\n return newArr;\n}", "title": "" }, { "docid": "2b6f4a0e9c1501c229eadb980f11e5c2", "score": "0.5662773", "text": "function forEach(arr, fn, ctx) {\n var k;\n\n if ('length' in arr) {\n for (k = 0; k < arr.length; k++) fn.call(ctx || this, arr[k], k);\n } else {\n for (k in arr) fn.call(ctx || this, arr[k], k);\n }\n }", "title": "" }, { "docid": "a117f54d69655983b81095e72ec6ad79", "score": "0.56620276", "text": "function mapExample(arr) {\n console.log(arr.map(item => {\n item += 1;\n return item\n }))\n}", "title": "" }, { "docid": "ded8dba218cf46df91e8bbc9d78c48c4", "score": "0.5661134", "text": "function each(arr, cb ){\n arr.forEach(function(input, i){\n cb(arr[i], i);\n })\n}", "title": "" }, { "docid": "16a431cef67d65348721bd908139eaa2", "score": "0.5654581", "text": "function logArray(myArray){\n for (var a=0; a<myArray.length; a++){\n console.log(\"spot \" + (a+1) + \"is \" + myArray[a]);\n }\n}", "title": "" }, { "docid": "22285cf31a6f1888bb7a6be5d08a3951", "score": "0.5647761", "text": "function iterateAndPrintArr(arr){\n for (let i=0;i<arr.length;i++){\n console.log(arr[i]);\n }\n}", "title": "" }, { "docid": "d66619f4f347d371bc72c18828396dea", "score": "0.56446105", "text": "function p9(){\n var arr = [1,2,4,7,33,55,66,88]\n for(var i = 0; i < arr.length; i++){\n arr[i] = arr[i]*arr[i]\n }\n console.log(arr)\n}", "title": "" }, { "docid": "b67f452102d2041f9b687a5793b007b1", "score": "0.5637473", "text": "function forEach(array, callback) {\n\tlet arr = []\n for(let i=0; i<array.length; i++) {\n arr.push(callback(array[i]))\n }\n\treturn arr\n}", "title": "" }, { "docid": "eab7e0848a20aff4dd0b79b9efd9f5a3", "score": "0.5636338", "text": "function forEach(array, action){\n\tfor (var i = 0; i < array.length; i++){\n\t\taction(array[i]);\n\t}\n}", "title": "" }, { "docid": "454dd7d241b0a5a7cf527ce39b9e7ef4", "score": "0.56313634", "text": "function doubleNumber(array){\n var obj = {};\n array.forEach(function(element){\n if (obj[element] === undefined) {\n obj[element] = 1;\n } else {\n obj[element] += 1;\n }\n if(obj[element] >= 2){\n console.log(obj[element]); \n }\n });\n }", "title": "" }, { "docid": "1526de1a25a6d128a4dbb4feb87b34f8", "score": "0.5626939", "text": "function log(array) {\n console.log(array[0]);\n console.log(array[1]);\n}", "title": "" }, { "docid": "63f8bebe45b8ec4a737506174bbd1c9b", "score": "0.5626523", "text": "function mapForEach(arr, fn) {\n var newArr = [];\n for (var i = 0; i < arr.length; i++) {\n newArr.push(fn(arr[i])); // invokes the function and passes in the number from the array to the function (fn(1)) for example\n }\n return newArr;\n}", "title": "" }, { "docid": "93cc6d372f019fd7def482163963a54c", "score": "0.56212056", "text": "function forEach(array, action) {\n\tfor (var i = 0; i < array.length; i++) {\n\t\taction(array[i])\n\t}\n}", "title": "" }, { "docid": "6ab26bd21d6fdc3b859fdc2f42bf5513", "score": "0.562067", "text": "function addToAll(arr, n){\n arr.forEach(function(_, index) {\n this[index] += n ;\n }, arr); //Value to use as this when executing callbackFn.\n return arr;\n}", "title": "" }, { "docid": "7a02f0514e24ec1d72f0aba1ccc95666", "score": "0.5618649", "text": "forEach(callback) {\n for (const ele of this.arr) {\n callback(ele);\n }\n }", "title": "" }, { "docid": "e3f11ded5ff001f84347540196e5f16a", "score": "0.56177956", "text": "function logAll(array) {\n for (var i = 0; i < array.length; i++) {\n console.log(array[i]); \n }\n}", "title": "" }, { "docid": "95a74e509670b89d2cdb2151fcb64d07", "score": "0.5617688", "text": "function forEach(arr, func){\n for(let i =0; i< arr.length; i++){\n func(arr[i]);\n }\n}", "title": "" } ]
de884a4264377d0933e45512c16ef52f
Store all data into layout and exit
[ { "docid": "5a14e0ba37937379af17c40b4bb90162", "score": "0.59707373", "text": "function saveLayout() {\n if (layoutModeGet()) {\n for (let i = 0; i < tempBuffer.Input.length; i++) {\n tempBuffer.Input[i].parent.layoutProperties.x = tempBuffer.Input[i].x;\n tempBuffer.Input[i].parent.layoutProperties.y = tempBuffer.Input[i].y;\n }\n for (let i = 0; i < tempBuffer.Output.length; i++) {\n tempBuffer.Output[i].parent.layoutProperties.x = tempBuffer.Output[i].x;\n tempBuffer.Output[i].parent.layoutProperties.y = tempBuffer.Output[i].y;\n }\n globalScope.layout = { ...tempBuffer.layout };\n // eslint-disable-next-line no-use-before-define\n toggleLayoutMode();\n }\n}", "title": "" } ]
[ { "docid": "11ef384c139609b0e9fb93d9f5890370", "score": "0.6066716", "text": "function enter() {\n clearNotMine();\n if (!initView()) return;\n fetchFrontData();\n }", "title": "" }, { "docid": "129c15f2d77b5dab408a94e9de6f51b4", "score": "0.5942777", "text": "renderLayout (data, response) {\n layout.render(data, response);\n }", "title": "" }, { "docid": "776d68da052c02f3c0c40fc043f79588", "score": "0.58045167", "text": "function _onLayoutLoaded( data ) {\n $( \"#container\" ).append( data );\n _showLoadingMessage();\n _loadFonts();\n _initRiseRSS();\n _ready();\n }", "title": "" }, { "docid": "c5c5fa0bc3ab2cd9bf24caeafa040581", "score": "0.5754085", "text": "wakeUp() {\n // Initialize the layout and sub components\n this.init();\n // Data are already known, just redraw them\n this.redraw();\n }", "title": "" }, { "docid": "9f9e94c7a0da71426da20a0dc6bb51be", "score": "0.56850415", "text": "doLayout() {\n var tree = this.graphComponent.graph;\n\n this.configureLayout(tree);\n new TreeLayout().applyLayout(tree);\n this.cleanUp(tree);\n }", "title": "" }, { "docid": "7fcdacafccfafc6a308072ae624a5ae0", "score": "0.56686187", "text": "function dataComplete () {\n\t\tres.render('widgets/main', {products : displayProducts});\n\t}", "title": "" }, { "docid": "f02b4a2fe6ec97cca1b5b177d87800f9", "score": "0.5603846", "text": "save() {\n\t\t\tvar viewName=this.node.find(\"input\").val();\n\t\t\tif(!viewName) return;\n\n\t\t\tvar self=this;\n\t\t\tvar madeChange=false;\n\t\t\tvar layout=this.context.stx.exportLayout();\n\t\t\t$(\"cq-views\").each(function(){\n\t\t\t\tvar obj=this.params.viewObj;\n\t\t\t\tvar view;\n\n\t\t\t\tfor(var i=0;i<obj.views.length;i++){\n\t\t\t\t\tview=obj.views[i];\n\t\t\t\t\tif(viewName==CIQ.first(view)) break;\n\t\t\t\t}\n\t\t\t\tif(i==obj.views.length){\n\t\t\t\t\tview={};\n\t\t\t\t\tview[viewName]={};\n\t\t\t\t\tobj.views.push(view);\n\t\t\t\t}\n\t\t\t\tview[viewName]=layout;\n\t\t\t\tdelete view[viewName].candleWidth;\n\t\t\t\tthis.renderMenu();\n\t\t\t\t//this.context.stx.updateListeners(\"layout\");\n\t\t\t\tif(!madeChange){\n\t\t\t\t\t// We might have a cq-view menu on multiple charts on the screen. Only persist once.\n\t\t\t\t\tmadeChange=true;\n\t\t\t\t\tthis.params.nameValueStore.set(\"stx-views\", obj.views);\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.close();\n\t\t}", "title": "" }, { "docid": "118607d098c5674d19e34e48595928a2", "score": "0.55977625", "text": "_createLayout() {\n const that = this;\n\n that._items = [];\n\n if (typeof that.dataSource === 'string') {\n that.dataSource = JSON.parse(that.dataSource);\n }\n\n if (that.dataSource !== null && Array.isArray(that.dataSource)) {\n that.$.container.innerHTML = '';\n\n let fragment = document.createDocumentFragment(), item;\n\n for (let i = 0; i < that.dataSource.length; i++) {\n item = that._createItem(that.dataSource[i]);\n fragment.appendChild(item);\n }\n\n that._handleSplitterBars(fragment);\n return;\n }\n\n that._handleSplitterBars(that.$.container);\n\n }", "title": "" }, { "docid": "306887b6e691f349d8459b59108f5c9f", "score": "0.5587179", "text": "processLayout(weaver, page, $layout, $page) {\n\n\t}", "title": "" }, { "docid": "7b66a473a82dc12ac0f3094e398067b8", "score": "0.55750775", "text": "function launchDataProcessing() {\n $(\"#mainTitle\").html(temporaryTitle);\n $(\"#gameContent\").empty();\n dataReader.showTempMsg(true);\n dataReader.showAnotherGameButton(false);\n dataReader.getData();\n }", "title": "" }, { "docid": "8759ef1348e6b03d9aae012016ecf10f", "score": "0.5565669", "text": "finishLayout(ctxt) {\n\n this.bounds.x = 0;\n\n for (var i = 0; i < this.lyrics.length; i++)\n this.lyrics[i].bounds.x = this.origin.x - this.lyrics[i].origin.x;\n\n this.needsLayout = false;\n }", "title": "" }, { "docid": "c809c6c4972d23dec80cf401e95d2445", "score": "0.5546381", "text": "function storeData() {\n html = editor_html.getValue();\n css = editor_css.getValue();\n js = editor_js.getValue();\n timestamp = new Date().getTime();\n jq = $('#usa_jquery').prop('checked');\n\n clearContenutiInStorage();\n\n storeItem('html', html);\n storeItem('css', css);\n storeItem('js', js);\n storeItem('jq', jq);\n}", "title": "" }, { "docid": "742204d2e73efac06ea87b27da1ba0a0", "score": "0.5528", "text": "function applyLayout() {\n $tiles.imagesLoaded(function() {\n // Destroy the old handler\n if ($handler.wookmarkInstance) {\n $handler.wookmarkInstance.clear();\n }\n\n // Create a new layout handler.\n $handler = $('li', $tiles);\n $handler.wookmark(options);\n });\n }", "title": "" }, { "docid": "4f2b454fdb866e4acea2f58af5feb121", "score": "0.55254984", "text": "function renderData() {\n createHeaderRow();\n renderLocations();\n footerTotals();\n}", "title": "" }, { "docid": "2f99d6b9974dd982f95cd9620d05893c", "score": "0.5517436", "text": "updateLayout() {\n\n deepDelete( this );\n\n if ( this.inlines ) {\n\n // happening in TextManager\n this.textContent = this.createText();\n\n this.add( this.textContent );\n\n }\n\n this.position.z = this.getOffset();\n\n }", "title": "" }, { "docid": "b3615a74ead33781c4f3315d838293a0", "score": "0.5510468", "text": "function layout() {\n this.controls.wrap = this.wrap.append('div').attr('class', 'controls');\n\n this.summaryTable.wrap = this.wrap.append('div').attr('class', 'summaryTable');\n\n this.summaryTable.summaryText = this.summaryTable.wrap.append(\"strong\").attr(\"class\", \"summaryText\");\n}", "title": "" }, { "docid": "80ab73931f9096b242e3a96a053e7602", "score": "0.55017596", "text": "deferLayout() {\n // TODO split layouts to independent methods\n const layoutOptions = this.options.layoutAlgorithm;\n if (!this.visible) {\n return;\n }\n // layout is using nodes for position calculation\n this.addLayout();\n if (layoutOptions.splitSeries) {\n this.addSeriesLayout();\n }\n }", "title": "" }, { "docid": "67f3312e90a5715da566603ac3723186", "score": "0.5500567", "text": "function handleOpenLayout(e) {\n\t\t\t\t// opening layout from data selection tab\n\t\t\t\tif($genTemplatePage.find(\".data-selection-tab.active\").length != 0){\n\t\t\t\t\tvar switchTab = confirm(messages.switchTab);\n\t\t\t\t\tif (!switchTab) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\ttoggleTab('#preview-design', 'show');\n\t\t\t\t\tenableDisableTab('#data-selection', '');\n\t\t\t\t\tshowHideTab('#data-selection' ,'hide');\n\t\t\t\t}\n\t\t\t\t//opening layout from preview tab\n\t\t\t\telse{\n\t\t\t\tif(isLayoutDirty) {\n\t\t\t\t\tvar clear = confirm(messages.clearToOpenLayout);\n\t\t\t\t\tif (!clear) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t\n\t\t\t\t$loadingText.trigger(\"show\", {\n\t\t\t\t\ttext: messages.openingLayout,\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tclearAllSections();\n\t\t\t\t\n\t\t\t\tvar layoutJson = $(e.target).closest(\"li\").attr('data-json');\n\t\t\t\tvar layoutJsonObj = jQuery.parseJSON(layoutJson);\n\t\t\t\tif(layoutJson && layoutJson != '') {\n\t\t\t\t\t// var layoutJsonObj = jQuery.parseJSON(layoutJson);\n\t\t\t\t\t\n\t\t\t\t\t$genTemplatePage.find(\".document-title\").val(layoutJsonObj.title);\n\t\t\t\t\t$genTemplatePage.find(\".input-url\").val(layoutJsonObj.xmlUrl);\n\t\t\t\t\t\n\t\t\t\t\tjsonToXmlLoadingStatus = 'loading';\n\t\t\t\t\tif(layoutJsonObj.xmlUrl && layoutJsonObj.xmlUrl != '') {\n\t\t\t\t\t\t$genTemplatePage.find(\".input-xml-go\").click();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tjsonToXmlLoadingStatus = 'loaded';\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tvar tryLoadSection = 100; // milliseconds\n\n\t\t\t\t\tfunction loadSections() {\n\t\t\t\t\t\tif(jsonToXmlLoadingStatus == 'loaded') {\n\t\t\t\t\t\t\t$.each(layoutJsonObj.sections , function(index, value) {\n\t\t\t\t\t\t\t\tif(index == 0) {\n\t\t\t\t\t\t\t\t\tif($genTemplatePage.find(\".section-container\").length == 0) {\n\t\t\t\t\t\t\t\t\t\taddContainer(false);\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\taddContainer(true);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$container = $genTemplatePage.find(\".section-container\").eq(($genTemplatePage.find(\".section-container\")).length - 1);\n\t\t\t\t\t\t\t\t$container.attr('selected-metadata', JSON.stringify(value));\n\t\t\t\t\t\t\t\tpopulatePreviewSection(value.format, value, $container);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$loadingText.trigger(\"show\", {\n\t\t\t\t\t\t\t\t\ttext: messages.openedLayout\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t} else if(jsonToXmlLoadingStatus == 'loading') {\n\t\t\t\t\t\t\tsetTimeout(loadSections, tryLoadSection);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tsetTimeout(loadSections, tryLoadSection);\n\t\t\t\t\tisLayoutDirty = false;\n\t\t\t\t} else {\n\t\t\t\t\taddContainer();\n\t\t\t\t}\n\t\t\t\tif(layoutJsonObj.hasToc) {\n\t\t\t\t\t$genTemplatePage.find('#preview-main-content').prepend(_.template($(\"#table-of-contents-template\").html()));\n\t\t\t\t\t$genTemplatePage.find(\".input-toc-label\").val(layoutJsonObj.tocLabel);\n\t\t\t\t}\n\t\t\t\t$genTemplatePage.find(\".delete-toc\").off('click').click(deleteTableOfContents);\n\t\t\t}", "title": "" }, { "docid": "02dec74e7298bee6c80747c51822f8e9", "score": "0.54955554", "text": "function resetLayout() {\n //call baginformation to set construct nodes and then cast preset\n console.log(\"resetLayout\");\n cr.nodes('.construct').forEach(function (b) {\n b.position(mapBagInformation.get(b.id()).startPosition);\n });\n makeLayout('preset');\n}", "title": "" }, { "docid": "e67b562daa8092133a0ba7168d1f04c8", "score": "0.5494222", "text": "prepareForReuse() {\n this.content = null;\n this.rendered = null;\n this.layoutInfo = null;\n }", "title": "" }, { "docid": "ea850ea87d9216c6cef53fd728f04bfe", "score": "0.5486492", "text": "function saveAndRender(){\n save();\n render()\n }", "title": "" }, { "docid": "3d71ec1dbccb2d702143949c886ff01c", "score": "0.54730344", "text": "function onLayout(dc) {\n }", "title": "" }, { "docid": "9646b20d8f85397477ad240f7f0fca12", "score": "0.54723173", "text": "updateLayout () {\n if (this.autoLayout) this.layout.run()\n }", "title": "" }, { "docid": "357e5376a2416f5536ac52e3fc947df5", "score": "0.54688233", "text": "function handleLayout(layoutObj) {\n view.currentLayout = layoutObj.layout;\n self.handle('onLayout', view);\n delete view.currentLayout;\n }", "title": "" }, { "docid": "a4076aaac6545f841bdc3bec343d2406", "score": "0.5454242", "text": "function onLoadData(data) {\n // Increment page index for future calls.\n page++;\n $('#tiles').append(data);\n // Apply layout.\n applyLayout();\n }", "title": "" }, { "docid": "23f7d5afc28cd757c65d610610f4c18f", "score": "0.5452149", "text": "initializeLayout() {\n\n }", "title": "" }, { "docid": "2396384e6359403ef37d7d427f3b6404", "score": "0.5450453", "text": "_updateLayout() {\n this.layout.rerenderAll();\n }", "title": "" }, { "docid": "3d91e9fc695897776dfbef7d97c1221f", "score": "0.54500055", "text": "function layout(pagelayout) {\n var changecolor = document.getElementById(\"MainBody\");\n changecolor.className = pagelayout + \"mainbody\";\n\n var header = document.getElementById(\"header1\");\n header.className = pagelayout + \"header\";\n\n var table = document.getElementById(\"table\");\n table.className = pagelayout + \"table\";\n\n var fieldset = document.getElementById(\"EventTime\");\n fieldset.className = pagelayout + \"fieldset\";\n var fieldset1 = document.getElementById(\"EventLocation\");\n fieldset1.className = pagelayout + \"fieldset\";\n\n var legend1 = document.getElementById(\"Legend1\");\n legend1.className = pagelayout + \"legend\";\n var legend2 = document.getElementById(\"Legend2\");\n legend2.className = pagelayout + \"legend\";\n\n var button = document.getElementById(\"changetime\");\n button.className = pagelayout + \"button\";\n var button1 = document.getElementById(\"AddLocation\");\n button1.className = pagelayout + \"button\";\n var button2 = document.getElementById(\"Update\");\n button2.className = pagelayout + \"button\";\n var button2 = document.getElementById(\"Update\");\n button2.className = pagelayout + \"button\";\n\n var inputLocation = document.getElementById(\"newlocation\");\n inputLocation.className = pagelayout + \"input\";\n var inputopen = document.getElementById(\"useropentime\");\n inputopen.className = pagelayout + \"input\";\n var inputclose = document.getElementById(\"userclosetime\");\n inputclose.className = pagelayout + \"input\";\n var inputmin = document.getElementById(\"newmin\");\n inputmin.className = pagelayout + \"input\";\n var inputmax = document.getElementById(\"newmax\");\n inputmax.className = pagelayout + \"input\";\n var inputaverage = document.getElementById(\"newaverage\");\n inputaverage.className = pagelayout + \"input\";\n\n var unorderedlist = document.getElementById(\"UList\");\n unorderedlist.className = pagelayout + \"unorderedlist\";\n\n var mainimage1 = document.getElementById(\"headerimage\");\n mainimage1.src = \"images/\"+ pagelayout + \".jpg\";\n\n var mainimage2 = document.getElementById(\"headerimage2\");\n mainimage2.src = \"images/\"+ pagelayout + \"1.jpg\";\n }", "title": "" }, { "docid": "7b98f053d2aad33e65608f427c18dd7f", "score": "0.53883344", "text": "function layoutInflator(data, template, container, binder){\n\t//populate the data\t\n\tvar layout = document.getElementById(template);\n\tfor(var i = 0; i < data.length; i++){\n\t\tvar layoutClone = layout.cloneNode(true);\n\t\tlayoutClone.id = template + \"-\" + i;\n\n\t\tbinder(data, i, layoutClone);\n\n\t\tdocument.getElementById(container).appendChild(layoutClone);\n\t}\n\tlayout.style.display = \"none\"; //hide the layout template\n}", "title": "" }, { "docid": "ed0d98d756ac4dd963232442def94afa", "score": "0.53869736", "text": "function fillContent(){\n\tinitMoves();\n\n\tinitStars();\n\n\tbuildGrid();\n}", "title": "" }, { "docid": "1677273fb228afda1a83edc0a0a2b183", "score": "0.5383669", "text": "function final() { \n\tvar successcb = function(world_bbc_stories_json){\n\t app.render(\"homepage\", {\n\t\tpopular_list: results[0],\n\t\tworld_bbc_stories: world_bbc_stories_json,\n\t\tname: Constants.APP_NAME,\n\t\ttitle: Constants.APP_NAME,\n\t\ttest_news_image: Constants.TESTIMAGE,\n\t\tproduct_name: Constants.PRODUCT_NAME,\n\t\ttwitter_username: Constants.TWITTER_USERNAME,\n\t\ttwitter_tweet: Constants.TWITTER_TWEET,\n\t\tproduct_short_description: Constants.PRODUCT_SHORT_DESCRIPTION,\n\t\tcoinbase_preorder_data_code: Constants.COINBASE_PREORDER_DATA_CODE\n\t }, function(err,html) {\n\t\t// handling of the rendered html output goes here\n\t\tfs.writeFile(__dirname + \"/views/rhomepage.ejs\", html, function(err) {\n\t\t if(err) {\n\t\t\tconsole.log(\"Failed to render new homepage html\")\n\t\t\tconsole.log(err);\n\t\t } else {\n\t\t\tconsole.log(\"The newly rendered homepage html was saved!\");\n\t\t }\n\t\t}); \t\t\t\t\n\t });\n\t};\n\tvar errcb = build_errfn('unable to retrieve orders');\n\n\tglobal.db.Order.allToJSON(successcb, errcb); \n }", "title": "" }, { "docid": "a906b8feab2fb58ee0013e99b9fe57e1", "score": "0.5357863", "text": "finishConstruction()\n {\n\t if( this.worldData == null || this.continentData == null )\n\t\t return;\n\t this.draw();\n\t this.barChart = new BarChart(this.currentData, this.countries, this.year);\n\t this.info = new InfoPanel(this.currentData, this.year);\n }", "title": "" }, { "docid": "3c5f40fe11445bd5868beb0635c6e9a3", "score": "0.5322485", "text": "function main()\n{\n\t// Creat database\n\tgetMandants();\n\t\n\t// Creat No Group for the first time running, initialize groupCount, wbCount\n\tinit();\n\t\n\t// Draw dynamic content of main page\n\tdrawMainPageDynamicContent();\n\t\n}", "title": "" }, { "docid": "ad6d2023c6154b75017998a678713334", "score": "0.53189564", "text": "setup(data) {\n //Load the diagram-content into memory\n this.deleteDiagramView = $(data);\n\n this.setupList();\n\n //Empty the content-div and add the resulting view to the page\n $(\".content\").empty().append(this.deleteDiagramView);\n\n // Set top to not let it overlap the navbar\n $(\".loading\").css(\"top\", $(\".sidebar\").height());\n\n // Hide for the time being\n $(\"table\").hide();\n\n\n }", "title": "" }, { "docid": "87e6e7bbacd8afe033eaf73875ce931a", "score": "0.5289279", "text": "function main(){\n\tfor (var i = 0; i < state.length; i++) {\n\t\tvar element = document.getElementsByClassName(state[i])[0].innerHTML = layout;\n\t}\n}", "title": "" }, { "docid": "8b440769921b7a6465679e2346968e85", "score": "0.5265763", "text": "function initialLayout() {\n // do initial layout and also bind to the window resize event\n $graphicsContainer = document.getElementById('graphicsContainer');\n $sidebarContainer = document.getElementById('sidebarContainer');\n $sidebarControlsContainer = document.getElementById('sidebarControlsContainer');\n $mainContainer = document.getElementById('mainContainer');\n adjustLayout();\n \n window.addEventListener('resize', adjustLayoutOnResize, false);\n }", "title": "" }, { "docid": "4976d77971c1514260059bc23ba0ea51", "score": "0.5246015", "text": "function tv_layout4(_args) {\n\tvar win = Titanium.UI.createWindow({\n\t\ttitle:_args.title\n\t});\n\twin.backgroundImage = '/images/gradientBackground.png';\n\t\n\tvar data = [];\n\t\n\tvar headerView = Ti.UI.createView({\n\t\theight:80\n\t});\n\t\n\tvar headerLabel = Ti.UI.createLabel({\n\t\ttop:10,\n\t\tleft:20,\n\t\twidth:'auto',\n\t\theight:'auto',\n\t\ttext:'Categorias',\n\t\tcolor:'white',\n\t\tshadowColor:'black',\n\t\tshadowOffset:{x:0,y:1},\n\t\tfont:{fontWeight:'bold',fontSize:22}\n\t});\n\t\n\tvar footerLabel = Ti.UI.createLabel({\n\t\ttext:'Prueba Categorias',\n\t\tcolor:'white',\n\t\twidth:'auto',\n\t\theight:'auto',\n\t\ttextAlign:'center',\n\t\tshadowColor:'black',\n\t\tshadowOffset:{x:0,y:1},\n\t\tfont:{fontWeight:'bold',fontSize:15}\n\t});\n\t\n\tvar footerView = Ti.UI.createView({\n\t\theight:60\n\t});\n\t\n\theaderView.add(headerLabel);\n\tfooterView.add(footerLabel);\n\t\n\t\n\tTi.App.myGlobalVar = [];\n\tvar colors = [];\n\tTi.App.Properties.setList('categor', colors);\n\t\n\t\n\t//base de datos con tabla categorias\n\t\n\tvar db = Titanium.Database.install('/etc/ADECA.sqlite', 'adeca');\n\t\n\tdb.execute('CREATE TABLE IF NOT EXISTS CATEGORIAS (ID INTEGER, DESCRIPCION TEXT, PATH TEXT)');\n\t\n\t\n\t\n\t\n\t\n\t//sacamos los datos de categorias //\n\t\n\tvar url = \"http://test06.snt.es/categorias.php\";\n \tvar client = Ti.Network.createHTTPClient({\n\t\t\t\t \n\t\t\t\t // function called when the response data is available\n\t\t\t\t \n\t\t\t onload : function(e) {\n\t\t\t\t \n\t\t\t\t //hay que parsear \n\t\t\t\t \n\t\t\t\t var ofertas = eval('('+this.responseText+')');\n\t\t\n\t\t\t\t\t\t \n\t\t\t\t\t\n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t\t\tfor (var i = 0; i < ofertas.length; i++)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tvar version = ofertas[i].descr; // The tweet message\n\t\t\t\t\t\t\t\t\tvar name = ofertas[i].id; // The screen name of the user\n\t\t\t\t\t\t\t\t\tvar api = ofertas[i].patch; // The profile image\n\t\t\t\t\t\t\t\t\t// Create a row and set its height to auto\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tvar colors = Ti.App.Properties.getList('categor', []);\n\t\t\t\t\t\t\t\tcolors.push(version);\n\t\t\t\t\t\t\t\tTi.App.Properties.setList('categor', colors);\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tTi.API.info('los categor = ',colors);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//\tdb.execute('INSERT INTO CATEGORIAS (ID, NAME, PATH ) VALUES(?,?,?)',name,version,api);\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//\tdb.execute('INSERT INTO CATEGORIAS VALUES(name, \"2\", \"3\")');\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tTitanium.API.info('JUST INSERTED, rowsAffected = ' + db.rowsAffected);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t \t\t\t\t \t\t\t \t\t \t\t \n\t\t\t\t \t\t \n\t\t\t},\n\t\t\t\t // function called when an error occurs, including a timeout\n\t\t\t\t onerror : function(e) {\n\t\t\t\t Ti.API.debug(e.error);\n\t\t\t\t \n\t\t\t\t },\n\t\t\t\t timeout : 5000 // in milliseconds\n\t\t\t\t \n\t\t\t\t \n\t\t });\n\t\t\t // Prepare the connection.\n\t\tclient.open(\"GET\", url);\n\t\t\t// Send the request.\n\t\tclient.send();\n\t\t\n\t\t\n\t\t\n\t//llamamos a la global categoriasjson\n\t\n\n\tvar rows = db.execute('SELECT * FROM CATEGORIAS');\n\tTitanium.API.info('ROW COUNT = ' + rows.getRowCount());\n\t//alert(rows.rowCount);\n\t//alert (rows);\t\t\n\tvar cantidad = rows.rowCount;\n\t// rows.close();\n\t//db.close(); // close db when you're done to save resources\n\t\t\t\t\t\t\t\t\n\t\n\t\n\t\n\t// y los sacamos tantas veces como salgan en el tema\n\t\n\t\n\tfor (var c=0;c<cantidad;c++)\n\t{\n\t\tvar row = Ti.UI.createTableViewRow();\n\t\trow.rightImage = '/images/tableview/easycustom/indicator.png';\n\t\tif (c === 0)\n\t\t{\n\t\t\trow.backgroundImage = '/images/tableview/easycustom/topRow.png';\n\t\t\trow.selectedBackgroundImage = '/images/tableview/easycustom/topRowSelected.png';\n\t\t}\n\t\telse if (c < 29)\n\t\t{\n\t\t\trow.backgroundImage = '/images/tableview/easycustom/middleRow.png';\n\t\t\trow.selectedBackgroundImage = '/images/tableview/easycustom/middleRowSelected.png';\n\t\t}\n\t\telse\n\t\t{\n\t\t\trow.backgroundImage = '/images/tableview/easycustom/bottomRow.png';\n\t\t\trow.selectedBackgroundImage = '/images/tableview/easycustom/bottomRowSelected.png';\n\t\t}\n\t\tif ((c % 3) == 0)\n\t\t{\n\t\t\trow.leftImage = \"/images/tableview/easycustom/imageA.png\";\n\t\t}\n\t\telse if ((c % 3) == 1)\n\t\t{\n\t\t\trow.leftImage = \"/images/tableview/easycustom/imageB.png\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\trow.leftImage = \"/images/tableview/easycustom/imageC.png\";\n\t\t}\n\t\t//db.execute(\"COMMIT\");\n\t\n\t\tTitanium.API.info(rows.field(1) + '\\n' + rows.field(0) + ' col 1 ' + rows.fieldName(0) + ' col 2 ' + rows.fieldName(1));\n\t\n\t\tvar label = Ti.UI.createLabel({\n\t\t\ttext: rows.field(1) ,\n\t\t\tcolor: '#420404',\n\t\t\tshadowColor:'#FFFFE6',\n\t\t\tshadowOffset:{x:0,y:1},\n\t\t\ttextAlign:'left',\n\t\t\ttop:20,\n\t\t\tleft:85,\n\t\t\twidth: 'auto',\n\t\t\theight:'auto',\n\t\t\tfont:{fontWeight:'bold',fontSize:18}\n\t\t});\n\t\tif (Titanium.Platform.name == 'android') {\n\t\t\tlabel.top = 10;\n\t\t}\n\t\trow.add(label);\n\t\t\n\t\tlabel.addEventListener('click',function(e)\n\t\t{\n\t\t\talert(\"pulsaste en \"+e.source);\n\t\t});\n\t\n\t\tvar label2 = Ti.UI.createLabel({\n\t\t\ttext: \"Segunda info\",\n\t\t\tcolor: '#420404',\n\t\t\tshadowColor:'#FFFFE6',\n\t\t\ttextAlign:'left',\n\t\t\tshadowOffset:{x:0,y:1},\n\t\t\tfont:{fontWeight:'bold',fontSize:13},\n\t\t\tbottom:22,\n\t\t\theight:'auto',\n\t\t\tleft:85,\n\t\t\tright:50\n\t\t});\n\t\tif (Titanium.Platform.name == 'android') {\n\t\t\tlabel2.right = 30;\n\t\t}\n\t\trow.add(label2);\n\t\tdata[c]=row;\n\t\trows.next();\n\t\n\t}\n\t\n\tvar tableview = Titanium.UI.createTableView({\n\t\tdata:data,\n\t\tstyle:Titanium.UI.iPhone.TableViewStyle.PLAIN,\n\t\tbackgroundColor:'transparent',\n\t\theaderView:headerView,\n\t\tfooterView:footerView,\n\t\tmaxRowHeight:100,\n\t\tminRowHeight:100,\n\t\tseparatorStyle: Ti.UI.iPhone.TableViewSeparatorStyle.NONE\n\t});\n\t\n\ttableview.addEventListener('click',function(e)\n\t{\n\t\talert(\"Pulsaste en = \"+e.source);\n\t});\n\t\n\twin.add(tableview);\n\treturn win;\n\t\n\t\n\trows.close();\n\tdb.close(); // \n}", "title": "" }, { "docid": "b9ec68438308c6cbc70ae8209a1413e3", "score": "0.524391", "text": "function finalizeRendering() {\r\n var qt = $(t);\r\n // Clean the current body complete and add the new generated body.\r\n $('tr', qt).unbind();\r\n qt.empty().append(qtbody);\r\n\r\n if (data.rows.length != 0) {\r\n g.rePosDrag();\r\n g.fixHeight();\r\n }\r\n\r\n // This is paranoid but set the variables back to null. It is better for debugging.\r\n body = null;\r\n qtbody = null;\r\n data = null;\r\n \r\n // Call the onSuccess hook (if present).\r\n if (p.onSuccess) {\r\n p.onSuccess.call(p.owner, g.getCounterIndexes());\r\n }\r\n \r\n // Deactivate the busy mode.\r\n g.setBusy(false);\r\n \r\n if (g.lazyFocus) {\r\n g.lazyFocus.call(this, true);\r\n }\r\n \r\n // build pager.\r\n g.buildpager();\r\n \r\n // COMMENT-ECHO3: Notify for selection */\r\n g.notifyForSelection();\r\n }", "title": "" }, { "docid": "4ab3ff12a6b8d85263cb00697a9b158a", "score": "0.52319986", "text": "function saveCollectionPageData() {\n var $blocks = $('.collection-listing .product-block, .collection-listing-stream .product-block');\n var row = 0;\n var currTop = 0;\n //Heights are fixed. Check two in case somebody has expanded one...\n var blockHeight = Math.min($blocks.first().outerHeight(), $($blocks[1]).outerHeight());\n var blockPageOffset = $blocks.first().offset().top;\n $blocks.each(function(index){\n var currOffsetTop = $(this).offset().top;\n if(index == 0) {\n currTop = currOffsetTop;\n } else {\n if(currOffsetTop > currTop) {\n row++;\n currTop = currOffsetTop;\n }\n }\n $(this).data({\n offsetTop: blockPageOffset + row * blockHeight\n });\n });\n }", "title": "" }, { "docid": "fb72d099d9e5418628b8903604f9a221", "score": "0.5229823", "text": "private doLayout(where : JQuery) : void {\n // The layout is a table containing a number of rows\n let table : JQuery = $('<table></table>');\n let row : JQuery;\n let cell : JQuery;\n\n // 1st row: Contains the 'Use for sentence unit selection' checkbox\n row = $('<tr></tr>');\n cell = $('<td colspan=\"2\"></td>');\n cell.append(this.cbUseForQo, '&nbsp;', this.cbUseForQoLabel);\n row.append(cell);\n table.append(row);\n\n // 2nd row: Contains the MQL selector radio button and the MQL <textarea>\n row = $('<tr></tr>');\n cell = $('<td></td>');\n \n cell.append(this.rbMql, '&nbsp;', this.rbMqlLabel);\n row.append(cell);\n \n cell = $('<td></td>');\n cell.append(this.mqlText);\n row.append(cell);\n table.append(row);\n\n // 3rd row: Contains the 'Import from SHEBANQ' button\n row = $('<tr></tr>');\n cell = $('<td></td>');\n row.append(cell);\n cell = $('<td></td>');\n cell.append(this.importShebanq);\n row.append(cell);\n table.append(row);\n\n // 4th row: Contains the friendly feature selector radio button\n row = $('<tr></tr>');\n cell = $('<td colspan=\"2\"></td>');\n cell.append(this.rbFriendly, '&nbsp;', this.rbFriendlyLabel);\n row.append(cell);\n table.append(row);\n\n // 5th row: Contains the question object type combobox\n row = $('<tr></tr>');\n cell = $('<td></td>');\n \n cell.append(this.questObjTypeLab);\n row.append(cell);\n \n cell = $('<td></td>');\n cell.append(this.objectTypeCombo);\n row.append(cell);\n table.append(row);\n\n // 6th row: Contains the feature selector combobox\n row = $('<tr></tr>');\n cell = $('<td></td>');\n \n cell.append(this.featSelLab);\n row.append(cell);\n \n cell = $('<td></td>');\n cell.append(this.featureCombo);\n row.append(cell);\n table.append(row);\n\n // 7th row: Contains the 'Clear' button and the feature selector panels\n row = $('<tr></tr>');\n cell = $('<td id=\"clearbuttoncell\"></td>');\n\n cell.append(this.clear);\n row.append(cell);\n \n cell = $('<td></td>');\n cell.append(this.fpan);\n row.append(cell);\n table.append(row);\n \n where.append(table);\n }", "title": "" }, { "docid": "16b0756270634f0fbdb004e62b918b46", "score": "0.5218993", "text": "function factDataLoadedHandler(){\n\t\t\tcreatGrid();\n\t\t\tmainPanelV.add(gridContainer);\n\t\t\tmainPanelV.doLayout();\n\t\t}", "title": "" }, { "docid": "eec845ced27543610f7560ec281d06ba", "score": "0.5214595", "text": "_make_layouts() {\n // Update some display fields\n const info_div = $('#' + this.heatmap_info_name)\n info_div.html('')\n\n // Generate the display options\n const select = $(`<select id=\"bp-heatmap-select-mode\" style=\"font-size: 12px; border-color: #bbb; height:16px;\" title=\"Some options may be disabled based on the type of stat selected. For instance, summable (delta) stats can be summed while counters should be viewed as a first/last value or a diff (last-first)\"></select>`)\n select.append(`<option value=\"${HEATMAP_MODE.SUM}\" ${this._heatmap_mode==HEATMAP_MODE.SUM ? 'selected' : ''}>sum over range</option>`)\n select.append(`<option value=\"${HEATMAP_MODE.DIFF}\" ${this._heatmap_mode==HEATMAP_MODE.DIFF ? 'selected' : ''}>last - first</option>`)\n select.append(`<option value=\"${HEATMAP_MODE.LAST}\" ${this._heatmap_mode==HEATMAP_MODE.LAST ? 'selected' : ''}>last value</option>`)\n select.append(`<option value=\"${HEATMAP_MODE.FIRST}\" ${this._heatmap_mode==HEATMAP_MODE.FIRST ? 'selected' : ''}>first value</option>`)\n\n info_div.append($(`<span class=\"smalltext\">Heatmap Type:</span>`))\n info_div.append($(`<br/>`))\n info_div.append(select)\n info_div.append($(`<br/>`))\n\n // Ensure the modes are disabled where appropriate\n this._update_modes_allowed()\n\n // Register for a mode-change\n select.on('change', (e) => {\n this._heatmap_mode = e.target.value // assign new mode\n viewer.refresh_widget(this, {force_no_sync: true})\n })\n\n // Stat info\n const stat_type = this.data_source != null ? (this.data_source.get_stat_info(this._stat_full_name).type || StatTypes.STAT_TYPE_ATTRIBUTE) : '?'\n info_div.append($(`<span class=\"smalltext\">Displaying Stat:</span>`))\n info_div.append($(`<br/>`))\n info_div.append($(`<span>\"${this._stat}\"</span>`))\n info_div.append($(`<span class=\"tinytext\"> (${stat_type} stat)</span>`))\n\n\n // Generate some layouts for the plots\n this.layout = this._make_layout()\n this.table_chart_layout = this._make_table_chart_layout()\n this.row_chart_layout = this._make_row_chart_layout()\n }", "title": "" }, { "docid": "337ffd17ec8f80f1db8111c87805a039", "score": "0.5197041", "text": "function resetPage() {\n\t// Nuke our page elements\n\t$('#recipeItems').empty();\n\t$('#sourceItems').empty();\n\t$('.solution').remove();\n\t$('#recipeItem').empty();\n\n\t// Clear the solution\n\tdelete g_ComponentList;\n\tdelete g_Solution;\n\n\t// Finish the rest of the layout\n\tsetupPage();\n}", "title": "" }, { "docid": "0979270b116c5c7b87a6cd7121b345e5", "score": "0.51899374", "text": "function layout() {\n logger.log(\"Layout changed\");\n $(\".cm-collection--productlisting .cm-category-item__title\").equalHeights();\n // only on desktop\n if (deviceDetector.getLastDevice().type == DEVICE_DESKTOP) {\n setMegaMenuItemsWidth();\n }\n isLayoutInProgress = false;\n }", "title": "" }, { "docid": "2950945764d48485ad94461893badce5", "score": "0.51740223", "text": "function saveAndRender(){\n localStorageSave();\n renderMovieShortListContainer();\n renderMovieHistoryTable();\n clearAddMovieForm();\n autoCompletePanel.style.visibility ='hidden';\n}", "title": "" }, { "docid": "2c32d9ddbbd52f122b7577c3f91d8b50", "score": "0.51612186", "text": "function saveAndRender() {\n save()\n render()\n}", "title": "" }, { "docid": "fcf1003fa0788b395b8345ad3e3d09ab", "score": "0.51562685", "text": "function wrapUpModal() {\n loadData();\n selectedQuestion = {};\n }", "title": "" }, { "docid": "19b1851d3851798677630cae432787b3", "score": "0.51538813", "text": "function enter() {\n fetchData(true);\n }", "title": "" }, { "docid": "3dabb4918ba5084387b9a477260f1967", "score": "0.51367843", "text": "function saveCollectionPageData() {\n $('.collection-listing:not(.slider-collection-listing), .collection-listing-stream').each(function(){\n var $blocks = $(this).find('.product-block');\n if($blocks.length <= 1) return true; // Skip for empty colls\n var row = 0;\n var currTop = 0;\n //Heights are fixed. Check two in case somebody has expanded one...\n var blockHeight = Math.min($blocks.first().outerHeight(), $($blocks[1]).outerHeight());\n var blockPageOffset = $blocks.first().offset().top;\n $blocks.each(function(index){\n var currOffsetTop = $(this).offset().top;\n if(index == 0) {\n currTop = currOffsetTop;\n } else {\n if(currOffsetTop > currTop) {\n row++;\n currTop = currOffsetTop;\n }\n }\n $(this).data({\n offsetTop: blockPageOffset + row * blockHeight\n });\n });\n });\n }", "title": "" }, { "docid": "f6daa96c4a4f2f8333d4e8840b0069e5", "score": "0.5130254", "text": "render(layout) {\n this._renderTable(layout);\n }", "title": "" }, { "docid": "9b513274d2795dccedb0504788bc4377", "score": "0.51116365", "text": "function finalize() {\n console.log('finalize is running...');\n let body = document.querySelector('body');\n let sideMenu = document.getElementById('side-menu');\n let edit = document.getElementById('edit');\n let warningPopUp = data.getChoiceContent();\n let brand = data.getBrandContent();\n UI.addHTMLTemplate('body', warningPopUp);\n \n $(DOMString.choices).on('click', function(e) {\n let choice = getChoice(e);\n UI.removeElement(DOMString.editContainer);\n if (choice == 1) {\n $(DOMString.choices).off('click');\n \n UI.addHTMLTemplate('body', brand);\n // Add event to submit change\n $(DOMString.editBtn).on('click', function(){\n updateText(edit);\n });\n $(DOMString.editText).on('keydown', function (e) {\n var x = e.keyCode;\n if (x === 13) {\n updateText(edit);\n }\n closeMenu();\n removeEditingFeature();\n edit.id = 'brand-name';\n edit.href=\"#\";\n });\n }\n });\n }", "title": "" }, { "docid": "cd3dbe5b69ecfa6f6989cf4bee2baa4e", "score": "0.5092578", "text": "function setMain() {\n hideFieldset();\n\n // Get all emyployees from local storage if they were updated earlier\n updatedEmployees = JSON.parse(localStorage.getItem(\"updatedMainTable\"));\n\n if (updatedEmployees == null || typeof updatedEmployees == undefined) {\n renderMainTable(employees);\n } else {\n renderMainTable(updatedEmployees);\n }\n\n if (specificData.length == 0) {\n hideMainTable();\n alert(\"No data for selected team/year! Try again please.\");\n showFieldset();\n return;\n } else {\n showMainTable();\n }\n readMainTable(specificData);\n calculateTotalSumsForMainTable();\n displayPopupTable();\n}", "title": "" }, { "docid": "fca83b46b9121f4cb963ca5a986a525e", "score": "0.5092411", "text": "performLayout(ctxt) {\n\n if (this.trailingSpace < 0)\n this.trailingSpace = ctxt.intraNeumeSpacing * ctxt.interSyllabicMultiplier;\n\n // reset the bounds and the staff notations before doing a layout\n this.visualizers = [];\n this.bounds = new Rect(Infinity, Infinity, -Infinity, -Infinity);\n\n for (var i = 0; i < this.lyrics.length; i++)\n this.lyrics[i].recalculateMetrics(ctxt);\n\n if(this.alText)\n for (i = 0; i < this.alText.length; i++)\n this.alText[i].recalculateMetrics(ctxt);\n\n if(this.translationText)\n for (i = 0; i < this.translationText.length; i++)\n this.translationText[i].recalculateMetrics(ctxt);\n }", "title": "" }, { "docid": "ebcfd17b9a9563648acf295adbbb52ee", "score": "0.509202", "text": "function populateView() {\n\tpopulateFitHistoryView();\n\tpopulateExerciseView();\n\n\tsetTimeout(stopLoadingUI, 500);\n}", "title": "" }, { "docid": "3d732168318e7bdd65810b13cbe20240", "score": "0.50825316", "text": "function modifyDesign()\n {\n modifyHeader();\n modifyContent();\n modifyFooter()\n }", "title": "" }, { "docid": "84a8adb09f42ac141efd2f5802555c33", "score": "0.5078584", "text": "get layoutData() {\n return generatePageLayout(this._loggerSettingsSchema, this.loggerSettingsPicklistOptions, this.isReadOnlyMode, this._currentRecord);\n }", "title": "" }, { "docid": "76dbf1f122772e340f9c4b1938fd05b9", "score": "0.5075216", "text": "function setupLayout() {\r\n // Check app configuration\r\n if (typeof brandObj !== 'undefined')\r\n {\r\n // Set up the main logo\r\n if (brandObj[\"mainlogopath\"])\r\n {\r\n $(\"#mainLogo\").find(\"img\").attr(\"src\", brandObj[\"mainlogopath\"]);\r\n }\r\n \r\n // Set up partner's logo and show it if defined\r\n if (brandObj[\"partnerlogopath\"])\r\n {\r\n $(\"#partnerLogo\").find(\"img\").attr(\"src\", brandObj[\"partnerlogopath\"]);\r\n $(\"#partnerLogo\").show();\r\n }\r\n }\r\n \r\n if (typeof customizationObj !== 'undefined')\r\n {\r\n // Set up client's logo and show it if defined\r\n if (customizationObj[\"clientlogopath\"])\r\n {\r\n $(\"#clientLogo\").find(\".client-logo\").attr(\"src\", customizationObj[\"clientlogopath\"]);\r\n $(\"#clientLogo\").show();\r\n }\r\n }\r\n \r\n if (typeof headerObj !== 'undefined')\r\n {\r\n var hasEnvironments = true;\r\n if (headerObj.hasOwnProperty(\"environment\") && headerObj[\"environment\"] === false)\r\n {\r\n $(\"#environmentcontainerl\").hide();\r\n hiddenWrappers.push(\"environmentcontainerl\");\r\n $(\"#environmentcontainers\").hide();\r\n hiddenWrappers.push(\"environmentcontainers\");\r\n hasEnvironments = false;\r\n }\r\n \r\n var missingHeaderElements = 0;\r\n if (headerObj.hasOwnProperty(\"notifications\") && headerObj[\"notifications\"] === false)\r\n {\r\n $(\"#notificationsCommandWrapper\").hide();\r\n hiddenWrappers.push(\"notificationsCommandWrapper\");\r\n missingHeaderElements ++;\r\n }\r\n else\r\n {\r\n firstMenuItem = 'notificationsWrapper';\r\n }\r\n \r\n if (headerObj.hasOwnProperty(\"settings\") && headerObj[\"settings\"] === false)\r\n {\r\n $(\"#settingsCommandWrapper\").hide();\r\n hiddenWrappers.push(\"settingsCommandWrapper\");\r\n missingHeaderElements ++;\r\n firstMenuItem = 'helpWrapper';\r\n }\r\n else if (firstMenuItem === 'notdefined')\r\n {\r\n firstMenuItem = 'settingsWrapper';\r\n }\r\n \r\n if (headerObj.hasOwnProperty(\"help\") && headerObj[\"help\"] === false)\r\n {\r\n $(\"#helpCommandWrapper\").hide();\r\n hiddenWrappers.push(\"helpCommandWrapper\");\r\n missingHeaderElements ++;\r\n }\r\n else if (firstMenuItem === 'notdefined')\r\n {\r\n firstMenuItem = 'helpWrapper';\r\n }\r\n \r\n var hasAccount = true;\r\n if (headerObj.hasOwnProperty(\"account\") && headerObj[\"account\"] === false)\r\n {\r\n $(\"#accountsCommandWrapperL\").hide();\r\n hiddenWrappers.push(\"accountsCommandWrapperL\");\r\n $(\"#accountsCommandWrapperS\").hide();\r\n hiddenWrappers.push(\"accountsCommandWrapperS\");\r\n hasAccount = false;\r\n }\r\n else if (firstMenuItem === 'notdefined')\r\n {\r\n firstMenuItem = 'accountsWrapper';\r\n }\r\n \r\n if (hasEnvironments && (missingHeaderElements > 0 || !hasAccount))\r\n {\r\n if (hasAccount)\r\n {\r\n switch (missingHeaderElements)\r\n {\r\n case 1:\r\n $(\"#environmentcontainerl\").find(\".environment-dropdown\").addClass(\"minus-one\");\r\n break;\r\n case 2:\r\n $(\"#environmentcontainerl\").find(\".environment-dropdown\").addClass(\"minus-two\");\r\n break;\r\n case 3:\r\n $(\"#environmentcontainerl\").find(\".environment-dropdown\").addClass(\"minus-three\");\r\n }\r\n }\r\n else\r\n {\r\n switch (missingHeaderElements)\r\n {\r\n case 0:\r\n $(\"#environmentcontainerl\").find(\".environment-dropdown\").addClass(\"minus-accounts\");\r\n break;\r\n case 1:\r\n $(\"#environmentcontainerl\").find(\".environment-dropdown\").addClass(\"minus-accounts-one\");\r\n break;\r\n case 2:\r\n $(\"#environmentcontainerl\").find(\".environment-dropdown\").addClass(\"minus-accounts-two\");\r\n break;\r\n case 3:\r\n $(\"#environmentcontainerl\").find(\".environment-dropdown\").addClass(\"minus-accounts-three\");\r\n }\r\n }\r\n }\r\n }\r\n \r\n // Display the main logo even if its path is not defined in brandObj\r\n // In this case we use hardcoded path\r\n $(\"#mainLogo\").show();\r\n \r\n // Set up the header title\r\n if (formObj.hasOwnProperty(\"title\"))\r\n {\r\n $(\"#appTitle\").find(\".app-menu-brand\").html(formObj[\"title\"]);\r\n }\r\n \r\n $(\"#appTitle\").show();\r\n \r\n $(document).mouseup(function (e)\r\n {\r\n var languageSelectorWrapper = $('#languages');\r\n if (!languageSelectorWrapper.is(e.target) && languageSelectorWrapper.has(e.target).length === 0)\r\n {\r\n languageSelectorWrapper.hide();\r\n }\r\n });\r\n \r\n $('.user-settings-card').click(function (e)\r\n {\r\n if (!$(this).hasClass('extended-card'))\r\n {\r\n e.stopPropagation();\r\n $(this).addClass('extended-card').removeClass('collapsed-card');\r\n $(this).find('.user-settings-card-value').addClass('user-settings-card-edit').removeClass('user-settings-card-value');\r\n $(this).find('#languageValue').hide();\r\n $(this).find('.user-settings-card-combo-wrapper').show();\r\n $(this).find('.user-settings-card-collapse-area').hide();\r\n $(this).find('.user-settings-card-footer').show();\r\n }\r\n });\r\n \r\n $('#saveLTZ').click(saveLTZ);\r\n $('#cancelLTZ').click(cancelLTZ);\r\n \r\n setupLanguageMenu();\r\n}", "title": "" }, { "docid": "86a855511a362900f305cef31363a144", "score": "0.50698006", "text": "_initLayouts () {\n const force = new Force({ distance: 100 })\n\n this.layout = force\n this.layout.on('end', this._updatePosition, this)\n\n if (this.transform) {\n this.layout.once('end', () => {\n _.each(this.children, (child) => {\n child.endTransform()\n })\n })\n }\n }", "title": "" }, { "docid": "6c171a41ca7e7b431b2d120d3ac4ebb8", "score": "0.5067758", "text": "function layout() {\n var listType = 'CampaignList';\n appLayout = build([\n { view: 'Head', pos: 'l:0 t:0 r:0 h:39px' },\n\n { view: 'SplitPane', init: { vertical: true },\n id: 'split', leftMin: 100, handlePosition: 150,\n pos: 't:40px l:0px r:0px b:0px',\n persistent: { storage: App.userStorage(), key: 'layout:splitPane' },\n leftChildViews: [\n { view: listType, pos: 'l:0 t:0 r:0 b:0' }\n ],\n rightChildViews: [\n { view: 'Content', pos: 'l:0 t:0 r:0 b:0',\n id: 'content',\n persistent: { storage: App.userStorage(), key: 'content' }\n }\n ]}\n ]).attach();\n\n _initHandler();\n}", "title": "" }, { "docid": "01eade15df05e196e4e69e12b19449cc", "score": "0.5066183", "text": "function renderDataLocationScreen(){\n getTemplateAjax('static-files/templates/data-location-screen.handlebars', function(template) {\n jqueryNoConflict('#data-container').html(template());\n })\n }", "title": "" }, { "docid": "efe957b8de7416cc10b1b1f5eee25055", "score": "0.5061334", "text": "colocarLayout(state, newLayout) {\n state.layout = newLayout\n }", "title": "" }, { "docid": "7386ede45629c886bcf756aa50b2028e", "score": "0.5060611", "text": "function prepareUserDataVisualization() {\n \n //Remove all children from form_content\n $(\"#userData .form_content\").empty();\n //Hide buttons\n $(\"#userData .commands input[type='button'\").hide();\n //Reset all input in userData\n $(\"#userData input[type='text']\").val(\"??\");\n //Remove old messages\n $(\"#messages_list\").empty();\n //Be sure that the newUser form is hidden\n $(\"#newUser\").hide();\n //Be sure that user information is shown\n $(\"#userData\").show();\n //Be sure that mainContent is shown\n $(\"#mainContent\").show();\n}", "title": "" }, { "docid": "7085e8810ad784435544f8e1ffaa8157", "score": "0.5049815", "text": "function savingLayoutSetting() {\n\n //setting the object with the data of the form\n layout_settings.queue.order = queue_order.value;\n layout_settings.serving.order = serving_order.value;\n layout_settings.hours.order = hours_order.value;\n layout_settings.bartenders.order = bartenders_order.value;\n layout_settings.storage.order = storage_order.value;\n layout_settings.ontap.order = ontap_order.value;\n\n layout_settings.queue.showing = queue_checkbox.checked;\n layout_settings.serving.showing = serving_checkbox.checked;\n layout_settings.hours.showing = hours_checkbox.checked;\n layout_settings.bartenders.showing = bartenders_checkbox.checked;\n layout_settings.storage.showing = storage_checkbox.checked;\n layout_settings.ontap.showing = ontap_checkbox.checked;\n\n localStorage.setItem(\"layout_settings\", JSON.stringify(layout_settings));\n\n setWidgetsOrder();\n changeLayoutDashboard();\n\n}", "title": "" }, { "docid": "a7556b3687250a3f7bb56b475f5cdf04", "score": "0.50463504", "text": "function SaveRender(){}", "title": "" }, { "docid": "e6d5383c671d50122f5b32d201989d36", "score": "0.504562", "text": "function wrapUp() {\n saveStatusForm[0].reset();\n selected = {};\n saveStatusForm.collapse('hide');\n loadData();\n }", "title": "" }, { "docid": "ca06969a9081519309015209faf7e454", "score": "0.50453746", "text": "function main() {\n render_items();\n bind_handlers();\n update_total();\n}", "title": "" }, { "docid": "78ee4d6b94b6014f5fc35d6203380974", "score": "0.50436044", "text": "function getBlockData () {\n\n blockData['welcome'].opening = (project.welcome_screen_updated.opening == \"\" ? project.welcome_screen.opening : project.welcome_screen_updated.opening);\n blockData['welcome'].details = (project.welcome_screen_updated.details == \"\" ? project.welcome_screen.details : project.welcome_screen_updated.details);\n blockData['welcome'].image = (project.welcome_screen_updated.image == \"\" ? project.welcome_screen.image : project.welcome_screen_updated.image);\n\n if(project.questions_updated.length == 0){\n project.questions.forEach(question =>{\n blockData[question._id] = question;\n })\n }\n else{\n project.questions_updated.forEach(question => {\n blockData[question._id] = question;\n });\n }\n\n createSettingsPageContent(currentlyClickedBlock);\n}", "title": "" }, { "docid": "261b37c14824e61083f931ff449ce03c", "score": "0.5036482", "text": "saveAndExit() {\n saveAndExit();\n }", "title": "" }, { "docid": "0664f8ac5056521418b28c291e21427d", "score": "0.50341856", "text": "updateLayout() {\n this._updateColumnSizes();\n this._updateCollapseButtonPos();\n }", "title": "" }, { "docid": "4958d7af02f91218a1c368f4beb4c722", "score": "0.5029206", "text": "function displayData() {}", "title": "" }, { "docid": "c06ffb30452ce999b6ca22bb49bcaa26", "score": "0.5025382", "text": "function generateLayout(){\n var html=\"<div id='tabs'><ul>\";\n board.stars.forEach(function(element, index){\n html+=\"<li><a href='#\"+element.name+\"'>\"+element.name+\"</a></li>\";\n });\n html+=\"<li><a href='#options'>Tools</a></li></ul>\";\n board.stars.forEach(function(element, starIndex){\n html+=\"<div id='\"+element.name+\"' class='tab-aim'><table class='starChart'>\"\n html+=starRows(element, starIndex);\n html+=\"</table><button onclick='deleteStar(\"+starIndex+\")'>Delete Star</button>\";\n html+=\"<button onclick='addShipProduction(\"+starIndex+\")'>Add Ship Production</button></div>\";\n });\n html+=\"<div id='options'>\"\n html+=\"</div>\"\n $(\"#main\").html(html);\n $(\"#options\").html($(\"#hidden\").html());\n $(\"#tabs\").tabs();\n layoutGenerated = true;\n oldLength = board.stars.length;\n}", "title": "" }, { "docid": "45776e1019e6123295f09c0f573628f3", "score": "0.5023059", "text": "function processData() {\n // Idioms\n gen_choropleth_map();\n gen_pyramid_bar_chart();\n gen_lines_chart();\n gen_alluvial_chart();\n\n gen_calendar_heatmap();\n gen_radial_chart();\n gen_unit_chart();\n // Year slider\n gen_year_slider();\n\n // Events\n prepareCountyEvent();\n preparePyramidEvent();\n prepareAlluvialEvent();\n prepareHeatmapEvent();\n prepareUnitEvent();\n prepareButtons();\n\n // Unblur page\n setTimeout(function () {\n document.getElementById(\"loader\").style.display = \"none\";\n document.getElementById(\"bodyR\").style.filter = \"none\";\n }, 100);\n}", "title": "" }, { "docid": "dad14983c20f8b3522a0cd253342f8a7", "score": "0.501479", "text": "function resetData(){\r\n setTitle (\"\")\r\n setBody(\"\")\r\n setWere(\"\")\r\n setId(\"\")\r\n}", "title": "" }, { "docid": "f479dd1eddee185982a15eaee7805823", "score": "0.5013562", "text": "function resetData() {\n\n // ----------------------------------\n // CLEAR THE DATA\n // ----------------------------------\n\n demographicsTable.html(\"\");\n barChart.html(\"\");\n bubbleChart.html(\"\");\n gaugeChart.html(\"\");\n\n}", "title": "" }, { "docid": "56d37668ab4808e4097c2668c4be2168", "score": "0.50111574", "text": "function finish(){\n\t\tarchiver.append( metaData, { name: folderName + 'meta-data.html' } );\n\t\tcallback();\n\t}", "title": "" }, { "docid": "b20b923cba249c8b539d091188ff9d0d", "score": "0.500914", "text": "function prepareUi() \n{\t\n renderControls();\n\n $('#save').click(function (event) {\n\t\tif (confirm(\"Are you sure you want save Till funding?\")) {\n displayLoadingDialog();\n\t\t\tsaveCashiersFunding();\t\t\t\t\n\t\t} else\n\t\t{\n smallerWarningDialog('Please review and save later', 'NOTE');\n }\n\t});\n}", "title": "" }, { "docid": "386c6c9291053098d7363cfe3b394612", "score": "0.5006734", "text": "function displayAllData() {\n displayData(all_data);\n}", "title": "" }, { "docid": "4b0a9861f344069556aeefa53bd165bf", "score": "0.5005581", "text": "function enterFrame() {\n clear();\n render();\n }", "title": "" }, { "docid": "1b0c8ec04237bd61b3f9b503af6ee912", "score": "0.4995658", "text": "function afterSimulation() {\n saveGame();\n resetSimulation();\n resetData();\n renderSubstances();\n renderMethods();\n renderAddiction();\n renderLandscapes();\n renderPoints();\n}", "title": "" }, { "docid": "e8e4f8d8cc0046b5644a7756a371a9b4", "score": "0.4987422", "text": "function finishInitializing() {\n $('#stages-table').find('tbody').sortable({ stop: updateStageNumbers });\n $('#levels-table').find('tbody').sortable({ stop: updateLevelNumbers });\n accordionWindow().postMessage('Texts', '*');\n setWordContainerHeight();\n}", "title": "" }, { "docid": "631ac05f7e0a492da72262698082890e", "score": "0.49829683", "text": "function DisplayData()\n{\n var MyOutput = \"\"; //holds output for form\n var make = \"\", model = \"\", year = \"\";\n for(let i = 0; i < formDataArr.length; i++)\n {\n if(formDataArr[i].id == \"make\"){\n make = formDataArr[i].value;\n }else if(formDataArr[i].id == \"model\"){\n model = formDataArr[i].value;\n }else if(formDataArr[i].id == \"year\"){\n year = formDataArr[i].value;\n }\n MyOutput += `${formDataArr[i].getInfo()}<br>`;\n }\n\n localStorage.setItem(make + \",\" + model + \",\" + year, MyOutput);\n\n MyOutput += `<a id=\"goHome2\" href=\"/index.html\" class=\"button\">Go Home</button>`;\n return MyOutput;\n \n}", "title": "" }, { "docid": "7505ab166f4d849c64832dc23f69483d", "score": "0.49828035", "text": "function callback() {\n //Sends data back to the main object\n thisInherit.mainObject.setHtml();\n }", "title": "" }, { "docid": "e00128a71432e2f1b3cb25c9916b98a1", "score": "0.497866", "text": "function makeLayout(page, pageDims) {\r\n var currentPage = page;\r\n var pageWidth = pageDims.width;\r\n var pageHeight = pageDims.height;\r\n var bottomWithMargin = pageHeight + bleedValue + 3;\r\n\r\n var maxCol, maxRow;\r\n\r\n if (pageWidth <= GLOBALS.BREAKPOINT.small) {\r\n makeSmallLayout();\r\n if(notesCheck.value) addNotes(\"bottom_row\");\r\n\r\n } else if (pageWidth <= GLOBALS.BREAKPOINT.medium) {\r\n makeRegularLayout();\r\n if(notesCheck.value) addNotes(\"bottom\");\r\n\r\n } else {\r\n makeRegularLayout();\r\n if(notesCheck.value) addNotes(\"side\");\r\n }\r\n\r\n\r\n // Execution functions below\r\n\r\n function makeSmallLayout() {\r\n var maxRow = 4;\r\n var titleX = 0;\r\n var inputX = titleX + 80;\r\n var y = -bleedValue-GLOBALS.SLUGDIM;\r\n\r\n var inputWidth = pageWidth - inputX;\r\n var inputHeight;\r\n\r\n for (var row = 0; row < maxRow; row++) {\r\n inputHeight = (row != 4) ? inputBoxData.height : inputBoxData.height * 4;\r\n\r\n titleBoxSetup(titleX, y, titleBoxData.width, titleBoxData.height, titleBoxData[row]);\r\n inputBoxSetup(inputX, y, inputWidth, inputHeight, inputBoxData[row]);\r\n\r\n // Jump to bottom of page after 2nd row\r\n y = (row === 1) ? bottomWithMargin : y + 54;\r\n }\r\n }\r\n\r\n function makeRegularLayout() {\r\n var maxCol = 2, maxRow = 2;\r\n var titleX = 0;\r\n var inputX = titleX + 80;\r\n var y;\r\n\r\n var inputWidth, leftoverWidth;\r\n var inputHeight = inputBoxData.height;\r\n\r\n var counter = 0;\r\n for (var col = 0; col < maxCol; col++) {\r\n y = -bleedValue-GLOBALS.SLUGDIM;\r\n\r\n if (col < 1) {\r\n inputWidth = inputBoxData.width1;\r\n } else {\r\n leftoverWidth = pageWidth - inputX;\r\n inputWidth = (leftoverWidth < inputBoxData.width2) ? leftoverWidth : inputBoxData.width2;\r\n }\r\n\r\n for (var row = 0; row < maxRow; row++) {\r\n titleBoxSetup(titleX, y, titleBoxData.width, titleBoxData.height, titleBoxData[counter]);\r\n inputBoxSetup(inputX, y, inputWidth, inputHeight, inputBoxData[counter]);\r\n \r\n if (counter < 4) counter++;\r\n y += 54;\r\n }\r\n\r\n titleX += 330;\r\n inputX = titleX + 80;\r\n }\r\n }\r\n\r\n function addNotes(location) {\r\n var titleX, y;\r\n if (location === \"side\") {\r\n titleX = 720;\r\n y = -144;\r\n } else if (location === \"bottom\") {\r\n titleX = 0;\r\n y = bottomWithMargin;\r\n } else if (location === \"bottom_row\") {\r\n titleX = 0;\r\n y = bottomWithMargin + (2 * 54);\r\n }\r\n\r\n var inputX = titleX + 80;\r\n\r\n var leftoverWidth = pageWidth - inputX;\r\n var inputWidth = (leftoverWidth < inputBoxData.width3) ? leftoverWidth : inputBoxData.width3;\r\n var inputHeight = inputBoxData.height * 4;\r\n\r\n titleBoxSetup(titleX, y, titleBoxData.width, titleBoxData.height, titleBoxData[4]);\r\n inputBoxSetup(inputX, y, inputWidth, inputHeight, inputBoxData[4])\r\n }\r\n\r\n // Title & input box setup\r\n\r\n function titleBoxSetup(x, y, width, height, content) {\r\n var titleBox = currentPage.textFrames.add({\r\n geometricBounds : [y, x, y + height, x + width],\r\n appliedObjectStyle : docToSetup.objectStyles.itemByName(\"SLUG TEXTBOXES\")\r\n });\r\n\r\n titleBox.contents = content;\r\n }\r\n \r\n function inputBoxSetup(x, y, width, height, labelName) {\r\n var inputBox = currentPage.textFrames.add({\r\n geometricBounds : [y, x, y + height, x + width],\r\n appliedObjectStyle : docToSetup.objectStyles.itemByName(\"SLUG TEXTBOXES\")\r\n })\r\n\r\n // textFrame is an object, labelName is a string\r\n if(labelName === \"codeInput\") {\r\n var varFileName = docToSetup.textVariables.item(\"File Name\");\r\n inputBox.textVariableInstances.add({associatedTextVariable:varFileName});\r\n \r\n } else if(labelName === \"dimsInput\") {\r\n var multiplier = (GLOBALS.MEASUREMENT === \"imperial\") ? 72 : 28.3465;\r\n var unit = (GLOBALS.MEASUREMENT === \"imperial\") ? \" in. \" : \" cm\";\r\n inputBox.contents = Math.round(pageWidth / multiplier * 100) / 100 + \" × \" + Math.round(pageHeight / multiplier * 100) / 100 + unit;\r\n \r\n } else if(labelName === \"batchReviewInput\"){\r\n if(sampleCheck.value) {\r\n inputBox.contents = \"SAMPLE - Review \" + reviewEditText.text;\r\n } else if(fabCheck.value) {\r\n inputBox.contents = \"Batch \" + batchEditText.text + \" - \" + \"TO \" + fabEditText.text.toUpperCase();\r\n } else { \r\n inputBox.contents = \"Batch \" + batchEditText.text + \" - \" + \"Review \" + reviewEditText.text;\r\n }\r\n \r\n } else if(labelName === \"dateInput\"){\r\n inputBox.contents = dateEditText.text;\r\n \r\n } else {\r\n inputBox.contents = notesEditText.text;\r\n }\r\n \r\n inputBox.label = labelName;\r\n }\r\n }", "title": "" }, { "docid": "e5c326634e0b288fc9bb745b6352021f", "score": "0.49775186", "text": "function finalise(data, keySpec) {\n let spot = document.querySelector(\"#dlklc\");\n let op = prepareOutput(data, keySpec);\n spot.innerHTML = '';\n spot.append(downloadBlobButton(op.klc.file));\n spot.append(downloadBlobButton(op.table.file));\n console.log(\n \"%cKEGG List Compound collected and processed\",\n \"color:lightgreen;\");\n return;\n}", "title": "" }, { "docid": "042ced3d4d6abbc9bb08e01afd2642a7", "score": "0.4974158", "text": "initLayout() {\n debugLog('ForceHorseViewer:initLayout');\n\n this.createInstanceName();\n\n this.processInputData();\n\n this.initNodeFields();\n\n this.setForce();\n\n this.zoom = d3.zoom()\n .scaleExtent([FHConfig.MAX_ZOOM, FHConfig.MIN_ZOOM])\n .on('zoom', this.onZoom.bind(this))\n .on('end', this.onZoomEnd.bind(this));\n\n this.initCanvas();\n\n // Set wrapper group, to use for pan & zoom transforms\n this.inSvgWrapper = this.svg.append('g');\n\n this.setSVGGroups();\n\n\n // Set dragging behavior\n this.drag = d3.drag()\n .on('drag', this.onDrag.bind(this))\n .on('end', this.onDragEnd.bind(this));\n }", "title": "" }, { "docid": "b813e8f011007bbe3c1fb549ad5f5773", "score": "0.49717903", "text": "function refreshData() {\n\t\tupdateURLHash( true /* useSearchForm */ );\n\t\tdefaultPageView.searchFormUpdateButtonPressed_ForDefaultPageView();\n\t\tsaveView_dataPages.searchFormUpdateButtonPressed_ForSaveView(); \n\t\t_coverages = undefined;\n\t\t_ranges = undefined;\n\t//\tproteinAnnotationStore.reset(); // don't call since not affected by search criteria on page\n\t\t_proteinMonolinkPositions = undefined;\n\t\t_proteinLooplinkPositions = undefined;\n\t\t_proteinLinkPositions = undefined;\n\t\t_linkPSMCounts = { };\n\t\tloadDataFromService();\n\t}", "title": "" }, { "docid": "2719b1dd497c31bfb5c4f9e16a3433af", "score": "0.49567837", "text": "function renderNewStore(store, dataDescription) {\n store.activitySimulator();\n stores.push(store);\n dataDescription.forEach((table, ndx) => {\n var row = store.renderTo(table.target);\n shadowDOM[ndx].rows.push(row);\n shadowDOM[ndx].body.appendChild(row);\n var footerData = getFooterList(table.target);\n var footer = renderFooter(footerData);\n shadowDOM[ndx].table.removeChild(shadowDOM[ndx].footer);\n shadowDOM[ndx].footer = footer;\n shadowDOM[ndx].table.appendChild(footer);\n });\n}", "title": "" }, { "docid": "af8af4a6c5acbfbac2bbc29249b0a344", "score": "0.49530122", "text": "init() {\n const self = this;\n\n // Presentation Layout\n self.layout = {};\n\n // Main frame, used for dimensions purposes\n self.layout.divMain = d3.select(`#${self.container}`)\n .append(\"div\")\n .style(\"width\", \"100%\")\n .attr(\"class\", \"row\");\n\n\n // Layout is different according to form display flag\n if (self.config.displayForm) {\n // When form shall be displayed, the form takes 25% of the area, the chart takes 75%\n self.layout.divLeft = self.layout.divMain\n .append(\"div\")\n .attr(\"class\", \"col-md-9\");\n self.layout.divRight = self.layout.divMain\n .append(\"div\")\n .attr(\"class\", \"col-md-3\");\n }\n else {\n // When form shall not be displayed, the chart takes 100%\n self.layout.divLeft = self.layout.divMain\n .append(\"div\")\n .attr(\"class\", \"col-md-12\");\n }\n\n\n // Loading screen layout\n self.layout.loading = self.layout.divLeft.append(\"div\");\n\n // Initialize all the SVG and canvas components\n this.initSvg();\n\n self.layout.loading\n .attr(\"name\", \"ScatterPlot_Loading\")\n .style(\"position\", \"absolute\")\n .style(\"width\", self.d3.c.width)\n .style(\"height\", self.d3.c.height)\n .classed(\"hidden\", false);\n\n self.layout.loading\n .append(\"img\")\n .attr(\"src\", \"../../../icons/loading-gears.gif\")\n .style(\"width\", \"100px\")\n .style(\"height\", \"100px\")\n .style(\"position\", \"relative\")\n .style(\"display\", \"block\")\n .style(\"margin-left\", \"auto\")\n .style(\"margin-right\", \"auto\")\n .style(\"top\", \"50%\")\n .style(\"transform\", \"translateY(-50%)\");\n\n // Initialize the form content if requested\n if (self.config.displayForm) {\n this.initForm();\n }\n }", "title": "" }, { "docid": "11c67a557a26c474466f2eb271e02c46", "score": "0.4951988", "text": "function postRender()\n\t{\n\t\tjQuery.fn.reAlign = function()\n\t\t{\n\t\t\t//centre align things vertically & horizontally\n\t\t\t$(\".center-align\").each(function()\n\t {\n\t\t\t\t$(this).css({\n\t\t\t\t\t\"margin-left\": \"-\" + $(this).outerWidth() / 2 + \"px\",\n\t\t\t\t\t\"margin-top\": \"-\" + $(this).outerHeight() / 2 + \"px\",\n\t\t\t\t\t\"position\": \"absolute\",\n\t\t\t\t\t\"left\": \"50%\",\n\t\t\t\t\t\"top\": \"50%\"\n });\n\t });\n\t\t}\n\n $('.startOver').click(function() {\n localStorage.clear();\n window.location = '/';\n });\n\t\t\n\t\t$('.gameContainer').reAlign();\n\t}", "title": "" }, { "docid": "8b26acb8e3ab99700bed19348b5ee5c8", "score": "0.4949951", "text": "function proceed() {\n // hide map until the rendering is done\n me.__root.css('opacity', 1);\n if (me.map_meta.options) {\n $.extend(me.map.opts, me.map_meta.options);\n }\n\n me.updateMap();\n\n // binds mouse events\n me.map.getLayer('layer0').tooltips(_.bind(me.tooltip, me));\n\n // mark visualization as rendered\n me.renderingComplete();\n }", "title": "" }, { "docid": "99b3f5d5c0db87d4a2758b86172d320e", "score": "0.49394915", "text": "load() {\n crsbinding.data.updateUI(this, \"data\");\n super.load();\n }", "title": "" }, { "docid": "e9836ba6a6c7d32422cb5f0e0c4d0301", "score": "0.4935917", "text": "function onAdd() {\n\n $scope.schema.layout.push(OdsFormService.newSectionObject());\n }", "title": "" }, { "docid": "58ccd3e5dc0f7a55180bac3bfb7d0288", "score": "0.4930452", "text": "function layout_save_to_doc(list, description, g_list, g_descriptions){\r\n\twindow.opener.document.wizard_frm.trans_menu_locations.value\t\t= list;\r\n\twindow.opener.document.all.trans_menu_location.innerHTML\t\t\t= description;\r\n\twindow.close();\r\n}", "title": "" }, { "docid": "6233284953b91d432e736db112ce4743", "score": "0.49298865", "text": "function main() {\n if (mw.config.get('wgIsProbablyEditable')) {\n mw.util.addPortletLink(\n 'p-cactions',\n '#',\n 'Infobox journal',\n 'ca-infobox-journal',\n 'Add or normalize infobox-journals.'\n );\n $('#ca-infobox-journal').click(onClick);\n }\n\n /** If we have been redirected, session stores HelperData from which we make the widget. */\n if (sessionStorage.getItem('tinfoboxHelperData')) {\n const helperData = HelperData.fromJSONString(\n sessionStorage.getItem('tinfoboxHelperData')\n );\n sessionStorage.removeItem('tinfoboxHelperData');\n console.log(helperData);\n helperData.buildWidget().insertBefore($('#wikiDiff, .mw-editform')[0]);\n }\n}", "title": "" }, { "docid": "00d26e1e04c822e427d46a7ac7727e5c", "score": "0.49296287", "text": "function recreateStorageLayout(storage, layer) {\n if (!stage) {\n setupStageCanvas(layer);\n }\n createShelves(storage, layer);\n createEntrances(storage, layer);\n createStorageBorder(layer);\n scaleBorders(layer);\n stage.add(layer);\n}", "title": "" }, { "docid": "d498ce01a8552b07c4f1f9d89dd569c0", "score": "0.49213314", "text": "function populate() {\n question.text(answer[number].question);\n choice1.text(answer[number].choices[0]);\n choice2.text(answer[number].choices[1]);\n choice3.text(answer[number].choices[2]);\n choice4.text(answer[number].choices[3]);\n timer.show();\n question.show();\n choice1.show();\n choice2.show();\n choice3.show();\n choice4.show();\n result1.empty();\n result2.empty();\n result3.empty();\n }", "title": "" }, { "docid": "fe73e309ee3a34e674aa702c31270669", "score": "0.4921279", "text": "function setup(data) {\n //Load the welcome-content into memory\n chatView = $(data);\n\n showNaamMatch();\n getUser2Id();\n getChats();\n\n // Check of de gebruiker is ingelogd en veranderd de header dan\n // als gebruiker admin is, laat zien de adminpagina\n if (session.get(\"gebruiker_admin\") == 0) {\n header.ingelogd();\n } else if (session.get(\"gebruiker_admin\") == 1) {\n header.ingelogdAdmin();\n } else {\n header.uitgelogd();\n }\n\n // als er op het verstuur button gedrukt sla dat op in de database\n chatView.find('.verstuurbutton').on('click', function () {\n sendChat();\n });\n\n //Empty the content-div and add the resulting view to the page\n $(\".content\").empty().append(chatView);\n\n }", "title": "" }, { "docid": "8cd82be3cf82bbad617958f74e92b294", "score": "0.49175644", "text": "[RESET_LAYOUT_CONFIG](state) {\n state.commit(RESET_LAYOUT_CONFIG);\n }", "title": "" }, { "docid": "b37530785041e41a0836294ae5bc61da", "score": "0.49155214", "text": "main_enter() {\n\t\t\texecute_all();\n\t\t}", "title": "" }, { "docid": "f1848dd15a80d8106f95fb296e1cad69", "score": "0.49106368", "text": "layout() {\n if (this.outline_) {\n this.foundation_.updateOutline();\n }\n if (this.ripple) {\n this.ripple.layout();\n }\n }", "title": "" } ]
b9624d7b996b97b53112ed999ad00b98
Function that builds the popup contents and displays them into the DOM Content.
[ { "docid": "9b0fe77e2cbdc5f98257bd9036db6715", "score": "0.0", "text": "async function generateSalesNotification() {\n var fullname = await generateFullName();\n var selectedProduct = availableProducts[generateRandomNumber(availableProducts.length)];\n var whenBought = generateRandomNumber(59) + 'm ago';\n var toastContentBody = (\n fullname + ' purchased <em style=\"color: #d87d6a;\">' +\n selectedProduct + '</em>'\n );\n \n var toastPopupWhenPurchased = document.getElementById('was-bought-when');\n var toastPopupWhoBoughtWhat = document.getElementById('toastNotification-content');\n\n // Tried using `append` and `appendChild`, but it didn't help me.\n toastPopupWhenPurchased.innerHTML = whenBought;\n toastPopupWhoBoughtWhat.innerHTML = toastContentBody;\n\n generateToastPopup();\n }", "title": "" } ]
[ { "docid": "645ddb52d1d6f507334e48047e103bef", "score": "0.70582736", "text": "function show_popup(content) {\n $('.popup').html(content);\n $('.popup').show();\n}", "title": "" }, { "docid": "a040a4511da89cdfd906296ff26676fe", "score": "0.6945006", "text": "static buildDynamicContentPopup() {\n const codePopup = document.createElement('div'); // codePopup.setAttribute('id', 'codePopup');\n\n codePopup.setAttribute('id', 'dynamic-content-popup');\n return codePopup;\n }", "title": "" }, { "docid": "15986b5be243b1eae46b957d0d07b602", "score": "0.67842823", "text": "function popupContent(hucNumber, hucName, hucArea) {\n var e1 = document.createElement('div');\n e1.classList.add(\"huc_popup\");\n e1.innerHTML = '<h3> <strong> Watershed Summary </strong></h3>';\n e1.innerHTML += '<strong>HUC#: </strong>' + hucNumber + '<br><strong>' + 'Name: </strong>' + hucName;\n e1.innerHTML += '<br><strong> Catchment area: </strong>' + Number(hucArea).toFixed(2) + ' km' + '2'.sup();\n summary_select = $('#summaryselect').val();\n summary_stat = $('#fieldselect').val() + '_' + summary_select;\n e1.innerHTML += '<br><strong>' + summary_select.replace(new RegExp('^' + summary_select[0] + ''), summary_select[0].toUpperCase()) +\n ' of chemical mass contribution: </strong><br>';\n if (hucNumber.length == 8) {\n prob = Number(fetchHUC8LayerData(hucNumber, summary_stat)).toFixed(2);\n } else {\n prob = Number(fetchHUC12LayerData(hucNumber, summary_stat)).toFixed(2);\n }\n if (isNaN(prob)) {\n prob = \"Not calculated\";\n }\n e1.innerHTML += prob;\n return e1;\n}", "title": "" }, { "docid": "7a96b70bd4bfe8b09d9d2b771156f7a0", "score": "0.66506165", "text": "function displayPopup() {\n\n // Create popup\n var popup = document.createElement('div');\n popup.setAttribute('id', 'CCPAPopup');\n\n // Create popup body\n var popupBody = document.createElement('div');\n popupBody.setAttribute('id', 'CCPABody');\n popupBody.innerHTML = '<b>This website sells your personal information. Opt out below.</b></br>';\n popup.appendChild(popupBody);\n\n // Create 'X' button\n var close = document.createElement('span');\n close.innerHTML = 'x';\n close.setAttribute('id', 'CCPAClose');\n popup.appendChild(close);\n\n // Create more info link\n var moreInfo = document.createElement('a');\n moreInfo.setAttribute('id', 'CCPAMoreInfo');\n moreInfo.setAttribute('href', browser.runtime.getManifest().homepage_url);\n moreInfo.setAttribute('target', '_blank');\n moreInfo.innerHTML = 'More Info';\n popupBody.appendChild(moreInfo);\n\n // Create button\n var button = document.createElement('button');\n button.setAttribute('id', 'CCPAButton');\n button.innerHTML = \"Don't Sell My Personal Information\";\n popup.appendChild(button);\n\n // Add popup to document\n document.getElementsByTagName('BODY')[0].appendChild(popup);\n}", "title": "" }, { "docid": "7110b99d996c1109f9007cd01f2445d8", "score": "0.6567975", "text": "function createPopup(){\n\t\t\tvar popup = $(document.createElement('div'));\n\t\t\tvar closingSpan = $(document.createElement('span'));\n\t\t\tvar container = $(document.createElement('div'));\n\t\t\tvar content = _content;\n\t\t\tif (!settingsObj) {\n\t\t\t\tsettings = defSettings;\n\t\t\t\tpopup.attr('data-animfrom', 'center');\n\t\t\t} else {\n\t\t\t\tif (settingsObj.hasOwnProperty('width')) {\n\t\t\t\t\tsettings.width = settingsObj.width\n\t\t\t\t} else {\n\t\t\t\t\tsettings.width = defSettings.width\n\t\t\t\t}\n\t\t\t\tif (settingsObj.hasOwnProperty('height')) {\n\t\t\t\t\tsettings.height = settingsObj.height\n\t\t\t\t} else {\n\t\t\t\t\tsettings.height = defSettings.height\n\t\t\t\t}\n\t\t\t\tif (settingsObj.hasOwnProperty('animationFrom') && (settingsObj.animationFrom === 'center' || settingsObj.animationFrom === 'click')) {\n\t\t\t\t\tpopup.attr('data-animfrom', settingsObj.animationFrom);\n\t\t\t\t} \n\t\t\t}\n\t\t\tpopup.addClass('ak-popup'+$(\"*[class*='ak-popup']\").length);\n\t\t\tpopup.css({\n\t\t\t\t'z-index':99,\n\t\t\t\t'width':settings.width,\n\t\t\t\t'height':settings.height+10,\n\t\t\t\t'backgroundColor' : 'gray',\n\t\t\t\t'position' : 'absolute',\n\t\t\t\t'display':'none'\n\t\t\t});\n\t\t\tif (content.width()>settings.width){\n\t\t\t\tpopup.css('width',content.width());\n\t\t\t}\n\t\t\tif (content.height()>settings.height){\t\t\t\t\n\t\t\t\tpopup.css('height',content.height()+30);\n\t\t\t}\n\t\t\tclosingSpan.css({\n\t\t\t\t'color': 'white',\n\t\t\t\t'cursor': 'pointer',\n\t\t\t\t'height': 10\n\t\t\t});\n\t\t\tcontainer.css({\n\t\t\t\t'height':popup.height()-20,\n\t\t\t\t'backgroundColor':'#EBEBE0',\n\t\t\t\t'overflow':'hidden',\n\t\t\t\t'padding-left':((popup.width()-content.width())/2),\n\t\t\t\t'padding-top':((popup.height()-content.height())/2)-10\n\t\t\t});\n\n\t\t\tclosingSpan.addClass('popup-close');\n\t\t\tclosingSpan.text('Click to close [x]');\n\t\t\tclosingSpan.appendTo(popup);\n\t\t\tcontent.appendTo(container);\n\t\t\tcontainer.appendTo(popup);\n\t\t\tpopup.appendTo($(document.body));\n\t\t\treturn popup;\n\t\t}", "title": "" }, { "docid": "fe432f9245a85790ad58a5f60e58d9ee", "score": "0.6501462", "text": "function createwildlifePopupContent(properties){\n //add name to popup content string\n var popupContent = \"<p class='popup-feature-name'><b>\" + properties.NAME + \"</b></p>\";\n\n //add formatted attribute to panel content string\n popupContent += \"<p class='popup-detail'>Owner: <b><span id=''>\" + properties.OWNER + \"</span></b></p>\";\n popupContent += \"<p class='popup-detail'>Organization Type: <b>\" + properties.ORG_TYPE + \"</b></p>\";\n popupContent += \"<p class='popup-detail'>Use Type: <b>\" + properties.USE_TYPE + \"</b></p>\";\n popupContent += \"<p class='popup-detail'>Wildlife Sensitivity Level: <b>\"+ properties.RISK_LVL + \"</b></p>\";\n if (properties.WEBSITE.length > 0) {\n popupContent += \"<p class='popup-detail'>More Info: <b><a href=\"+ properties.WEBSITE +\" target='_blank'> Website </a></b></p>\";\n }\n\n return popupContent;\n}", "title": "" }, { "docid": "b1bbbff6902d6bb130cc4c9aff8cb711", "score": "0.64764154", "text": "function setContent() {\n\t\tvar openImage = document.getElementById(id).children[0].children[0];\n\t\tvar openPar = document.getElementById(id).children[1];\n\t\timage.src = openImage.src;\n\t\tparagraph.innerHTML = openPar.innerHTML;\n\t\tmodal.style.display = \"flex\";\n\n\t}", "title": "" }, { "docid": "2f4e97aad0352191253fa43ddcb39d85", "score": "0.6358032", "text": "function populateContent() {\n\n qs('.major').textContent = urlParams.get('item')\n \n id('purchaser').textContent = urlParams.get('purchaser')\n id('expiration').textContent = urlParams.get('expiration')\n id('location').textContent = urlParams.get('location')\n id('category').textContent = urlParams.get('category')\n\n let daysRemaining = urlParams.get('days')\n let icon = generateIcon(daysRemaining)\n id('expiration-container').appendChild(icon);\n\n if (urlParams.get('sharing') === \"shared\") {\n qs('.slider').click();\n }\n\n qs('.slider').addEventListener('click', toggleSharing)\n }", "title": "" }, { "docid": "c631176a58686dbfc30d15fbb2fc3346", "score": "0.63375396", "text": "function preview() {\n\t\tconsole.log('Preview clicked');\n\t\t\n\t\t// Sample preview - opens in a new window by copying content -- use something better in production code, just one way I did it\n\n\t\t\n\t\tvar selected_content = $(\"#selected-content\").clone();\n\t\tselected_content.find(\"div\").each(function(i,o) {\n\t\t\t\t\t\t\t\tvar obj = $(o)\n\t\t\t\t\t\t\t\tobj.removeClass(\"draggableField ui-draggable well ui-droppable ui-sortable\");\n\t\t\t\t\t\t\t});\n\t\tvar legend_text = $(\"#form-title\")[0].value;\n\t\t\n\t\tif(legend_text==\"\") {\n\t\t\tlegend_text=\"Form builder demo\";\n\t\t}\n\t\tselected_content.find(\"#form-title-div\").remove();\n\t\t\n\t\tvar selected_content_html = selected_content.html();\n\t\t\n\t\tvar dialogContent ='<!DOCTYPE HTML>\\n<html lang=\"en-US\">\\n<head>\\n<meta charset=\"UTF-8\">\\n<title></title>\\n';\n\t\tdialogContent+= '<link href=\"bootstrap/css/bootstrap.min.css\" rel=\"stylesheet\" media=\"screen\">\\n';\n\t\tdialogContent+='<style>\\n'+$(\"#content-styles\").html()+'\\n</style>\\n';\n\t\tdialogContent+= '</head>\\n<body>';\n\t\tdialogContent+= '<legend>'+legend_text+'</legend>';\n\t\tdialogContent+= selected_content_html;\n\t\tdialogContent+= '\\n</body></html>';\n\n // For testing\n\t\t//dialogContent+='<br/><br/><b>Source code: </b><pre>'+$('<div/>').text(dialogContent).html();+'</pre>\\n\\n';\n\n\t\t//dialogContent = dialogContent.replace('\\n</body></html>','');\n\t\tdialogContent+= '\\n</body></html>';\n\t\t\n\t\t\n\n\t\tvar win = window.open(\"about:blank\");\n\t\twin.document.write(dialogContent);\n\t}", "title": "" }, { "docid": "f6a3ff9052933315389b6cdba58c0838", "score": "0.6294215", "text": "function display_popup(data){\n\t\t\t\n\t\t\tpopup_window.innerHTML=data;\n\n\t\t\tif(callback!= null){\n\t\t\t\tcallback();\n\t\t\t}\n\t\t\tpopup_positioning(popup_window);\n\t\t}", "title": "" }, { "docid": "4c7efdfb8190d1efa0813395896b1bbc", "score": "0.62897736", "text": "function cow_data_block(cow_data0) {\n CowsLogShow(cow_data0.Bolus_ID);\n\n var cow_data = cow_data0,\n popup = null,\n popupOptions = {\n width: 450,\n height: 300,\n contentTemplate: function () {\n var Openselected = '';\n var Dryselected = '';\n var Pregnantselected = '';\n switch (cow_data.Lactation_Stage) {\n case \"Open\":\n Openselected = \"selected\";\n break;\n case \"Dry\":\n Dryselected = \"selected\";\n break;\n case \"Pregnant\":\n Pregnantselected = \"selected\";\n break;\n default:\n }\n return $(\"<div />\").append(\n //<input id=\"Text1\" type=\"text\" />\n\n //$(\"<table><tr height='30'><td width='150px'>Birth Date:</td><td></td><td><input id='cow_bd' type='date' value=\" + ConvertDateToMyF(new Date(cow_data.BirthDate)) + \"/></td></tr>\" +\n $(\"<table><tr height='30'><td width='150px'>Birth Date:</td><td></td><td><div id='cow_bd'></div></td></tr>\" +\n \"<tr height='30'><td width='150px'>Current Lactation:</td><td></td><td><input id='cow_clac' type='number' value='\" + cow_data.Current_Lactation + \"' min='0' max='9'/></td></tr>\" +\n \"<tr height='30'><td width='150px'>Lactation Stage:</td><td></td><td><select id='cow_lac_stg'>\" +\n \"<option value='Open' \" + Openselected + \">Open</option>\" +\n \"<option value='Dry' \" + Dryselected + \">Dry</option>\" +\n \"<option value='Pregnant' \" + Pregnantselected + \">Pregnant</option></select></td></tr>\" +\n //\"<tr height='30'><td width='150px'>Calving Due Date:</td><td></td><td><input id='cow_cdd' type='date' value=\" + ConvertDateToMyF(new Date(cow_data.Calving_Due_Date)) + \"/></td></tr>\" +\n \"<tr height='30'><td width='150px'>Calving Due Date:</td><td></td><td><div id='cow_cdd'></div></td></tr>\" +\n //\"<tr height='30'><td width='150px'>Actual Calving Date:</td><td></td><td><input id='cow_acd' type='date' value=\" + ConvertDateToMyF(new Date(cow_data.Actual_Calving_Date)) + \"/></td></tr>\" +\n \"<tr height='30'><td width='150px'>Actual Calving Date:</td><td></td><td><div id='cow_acd'></div></td></tr>\" +\n \"<tr></tr><tr height='30'><td></td><td></td><td style='text-align: right; hight:'><input class='btn btn-success' type='button' value='Save' onclick='CowDataSave(\" + cow_data.Bolus_ID + \");'>\" +\n \"</td></tr></table>\")\n );\n },\n\n showTitle: true,\n title: \"Information Animail_ID: \" + cow_data0.Animal_ID,\n visible: false,\n dragEnabled: false,\n closeOnOutsideClick: true\n };\n\n var showInfo = function (data) {\n cow_data = data;\n\n if (popup) {\n popup.option(\"contentTemplate\", popupOptions.contentTemplate.bind(this));\n } else {\n popup = $(\"#popup\").dxPopup(popupOptions).dxPopup(\"instance\");\n }\n \n popup.show();\n //-----------------------------------\n $(\"#cow_bd\").dxDateBox({\n placeholder: \"10/16/2018\",\n showClearButton: true,\n useMaskBehavior: true,\n displayFormat: \"shortdate\",\n type: \"date\",\n value: ConvertDateToMyF(new Date(cow_data.BirthDate))\n });\n var xcow_cdd = cow_data.Calving_Due_Date;\n if (xcow_cdd == \"N/A\") {\n xcow_cdd = new Date();\n }\n \n $(\"#cow_cdd\").dxDateBox({\n placeholder: \"10/16/2018\",\n showClearButton: true,\n useMaskBehavior: true,\n displayFormat: \"shortdate\",\n type: \"date\",\n value: ConvertDateToMyF(new Date(xcow_cdd))\n });\n var xcow_acd = cow_data.Actual_Calving_Date;\n if (xcow_acd == \"N/A\") {\n xcow_acd = new Date();\n }\n $(\"#cow_acd\").dxDateBox({\n type: \"datetime\",\n value: ConvertDateToMyF(new Date(xcow_acd))\n });\n };\n //===================================\n\n $(\"#CowInfo_form\").dxForm({\n formData: cow_data,\n items: [{\n itemType: \"group\",\n cssClass: \"first-group\",\n colCount: 3,\n readOnlyItems: [\"Animal_ID\", \"Bolus_ID\"],\n items: [\n //{\n //template: \"<div class='form-avatar'></div>\"\n //},\n {\n itemType: \"group\",\n colCount: 4,\n colSpan: 3,\n items: [{\n dataField: \"Bolus_ID\",\n editorOptions: {\n readOnly: true,\n width: 70\n }\n }, {\n dataField: \"BirthDate\",\n //editorType: \"dxDateBox\",\n editorOptions: {\n readOnly: true,\n type: \"date\",\n width: 95\n }\n },\n {\n dataField: \"Current_Lactation\",\n editorOptions: {\n //value: lac_currentnum,\n readOnly: true\n }\n },\n {\n dataField: \"Lactation_Stage\",\n editorOptions: {\n //value: lac_stage,\n readOnly: true\n }\n },\n {\n dataField: \"Lactation_Day\",//\"Lactation_Day\",\n editorOptions: {\n // value: lac_Day,\n readOnly: true,\n width: 70\n },\n },\n {\n dataField: \"Calving_Due_Date\",\n //editorType: \"dxDateBox\",\n editorOptions: {\n //value: cal_due_date,\n readOnly: true,\n width: 95\n }\n }\n , {\n dataField: \"Actual_Calving_Date\",\n //editorType: \"dxDateBox\",\n editorOptions: {\n //value: act_cal_date,\n readOnly: true,\n width: 160\n }\n }, {\n itemType: \"button\",\n //alignment: \"left\",\n buttonOptions: {\n text: \"Edit\",\n type: \"success\",\n onClick: function () {\n\n showInfo(cow_data);\n //DevExpress.ui.notify(\"hello\", \"warning\", 1500);\n }\n }\n }]\n }]\n }]\n });\n\n}", "title": "" }, { "docid": "dd605621f0a92bfa636965d6ecb79779", "score": "0.6287453", "text": "function build_content_string(v) {\n\t// build content string\n\tvar content_string = \"<div class='maps_popup'>\";\n\n\t// include image\n\tif(v.img != '') {\n\t\tcontent_string += \"<img class='img' src='\"+v.img+\"' alt='Store Image' />\";\n\t}\n\n\t// include title & address\n\tcontent_string += \"<h1>\"+v.name+\"</h1><h2>\"+v.address+\"</h2>\";\n\n\t// include additional info\n\tif(v.telephone != '') {\n\t\tcontent_string += \"<p class='tel'>Telephone: \"+v.telephone+\"</p>\";\n\t}\n\tif(v.email != '') {\n\t\tcontent_string += \"<p class='email'>Email: <a href='mailto:\"+v.email+\"'>\"+v.email+\"</a></p>\";\n\t}\n\tif(v.website != '') {\n\t\tcontent_string += \"<p class='web'>Website: <a href='\"+v.website+\"'>\"+v.website+\"</a></p>\";\n\t}\n\tif(v.description != '') {\n\t\tcontent_string += \"<p class='desc'>\"+v.description+\"</p>\";\n\t}\n\tcontent_string += \"</div>\";\n\nreturn content_string;\n}", "title": "" }, { "docid": "4961dfa7a29a303acc8eadc36d755ced", "score": "0.6278619", "text": "function createPastCatPopupContent(properties){\n //add name to popup content string\n var popupContent = \"<p class='popup-feature-name'><b>\" + properties[\"Intake Type\"] + \"</b></p>\";\n\n //add formatted attribute to panel content string\n if (properties[\"Date Assessed\"].length > 0) {\n popupContent += \"<p class='popup-detail'>Date Assessed: <b><span id=''>\" + properties[\"Date Assessed\"] + \"</span></b></p>\";\n }\n popupContent += \"<p class='popup-detail'>Street: <b>\" + properties[\"Street Address\"]+ \"</b></p>\";\n if (properties[\"City\"].length > 0) {\n popupContent += \"<p class='popup-detail'>City: <b><span id=''>\" + properties[\"City\"] + \"</span></b></p>\";\n }\n\n return popupContent;\n}", "title": "" }, { "docid": "872ffeb0ede3b6ee7c77404089d6a34a", "score": "0.62785953", "text": "function showPreview(){\t\n\t\n\tvar contentElem=window.parent.document.getElementById('modalContent');\t\n\twhile (contentElem.firstChild) {\n contentElem.removeChild(contentElem.firstChild);\n }\t\n\tparseComplexText(currentCategoryBGText);\n\tconsole.log(window.parent.document.getElementById('modalContent'));\n\twindow.parent.$('#modalButton').click();\t\n}", "title": "" }, { "docid": "26e6d186e35b829a49f2eab155112a9f", "score": "0.6262059", "text": "function createIBAPopupContent(properties){\n //add name to popup content string\n var popupContent = \"<p class='popup-iba-feature-name'><b>\" + properties.IBA_NAME + \"</b></p>\";\n\n return popupContent;\n}", "title": "" }, { "docid": "700b72430ba8c92ccf7d567a6236c897", "score": "0.62502176", "text": "function popup(clases, innerText) {\n clases = (clases === undefined || typeof clases === 'undefined') ? \"\" : clases;\n innerText = (innerText === undefined || typeof innerText === 'undefined') ? \"\" : innerText;\n var popup = $('<div />', {\n \"class\": 'popup ' + clases.popup,\n }); \n \n var content = $('<div />', {\n \"class\": 'popoupContent ' + clases.content,\n }); \n \n var text = $('<div />', {\n \"class\": 'contentText ' ,\n text: innerText.content\n }); \n \n var topWidow = $('<div />', {\n \"class\": 'topWidow ' + clases.topWidow,\n text: innerText.title\n });\n \n var closeWindow = $('<img />', {\n \"class\": 'colseWindow',\n \"src\" : \"./images/closeWhite.png\",\n click: function(e){\n e.preventDefault();\n darkenUndarkeWindow();\n popup.remove();\n }\n });\n topWidow.append(closeWindow);\n content.append(text);\n popup.append(content);\n popup.append(topWidow);\n return popup;\n \n}", "title": "" }, { "docid": "51e6e75bacdfc74f9748c18bb823b384", "score": "0.624093", "text": "function generatePopup() {\n $('<div data-role=\"popup\" id=\"mobilePopup\"><p>This is a completely basic popup, no options set.</p></div>').appendTo('body');\n }", "title": "" }, { "docid": "ce063d2b2c12cb7274bd85a3e43d84c0", "score": "0.62395227", "text": "function createPopupWindow() {\n\n\t\tlet div = document.createElement(\"DIV\");\n\t\tdiv.setAttribute(\"id\", \"myModal\");\n\t\tdiv.setAttribute(\"class\", \"modal\");\n\n\t\tlet divContent = document.createElement(\"DIV\");\n\t\tdivContent.setAttribute(\"class\", \"modal-content\");\n\n\t\tlet spanClose = document.createElement(\"SPAN\");\n\t\tspanClose.setAttribute(\"class\", \"close\");\n\t\tspanClose.innerHTML = \"&times\";\n\t\tdivContent.appendChild(spanClose);\n\n\t\tlet student = document.createElement(\"P\");\n\t\tstudent.setAttribute(\"id\", \"studName\");\n\t\tdivContent.appendChild(student);\n\n\t\tlet img = document.createElement(\"IMG\");\n\t\timg.setAttribute(\"id\", \"studImg\");\n\t\timg.setAttribute(\"alt\", \"No image!\");\n\t\tdivContent.appendChild(img);\n\n\t\tlet email = document.createElement(\"P\");\n\t\temail.setAttribute(\"id\", \"studEmail\");\n\t\tdivContent.appendChild(email);\n\n\t\tlet skills = document.createElement(\"P\");\n\t\tskills.setAttribute(\"id\", \"studSkills\");\n\t\tdivContent.appendChild(skills);\n\n\t\t//add content to parent div\n\t\tdiv.appendChild(divContent);\n\t\t//add popup to container\n\t\tlet parent = el(\"container\");\n \tparent.appendChild(div);\n\n\t}", "title": "" }, { "docid": "6632e5c83033790e897bd987cb20431d", "score": "0.6221242", "text": "function createPopupContent(properties, attribute){\n //build popup content string\n var popupContent = \"<p><b>Airport:</b> \" + properties.Airport + \"</p>\";\n popupContent += \"<p><b>City:</b> \" + properties.City + \"</p>\";\n popupContent += \"<p><b>Passenger Traffic in \" + attribute + \":</b> \" + properties[attribute] + \"</p>\";\n\n return popupContent;\n}", "title": "" }, { "docid": "b7835fb940a17d301a3f3ae857461021", "score": "0.6172021", "text": "function makeContentPopup(location) {\n var html = '';\n var contenido = document.querySelector('#contenido');\n var closeButton = document.querySelector('#close-btn');\n\n //remueve el contenido\n contenido.innerHTML = '';\n\n //arma el contenido de la ventana \n if ( location == 'none' ) {\n html = '<p>No se encontró el contenido</p>';\n } else {\n var titulo, tag, video, texto, direccion, imagen, imagenes, likes;\n var kiosko = location.titulo != '' ? location.titulo : '';\n var titulo = location.data.titulo != '' ? location.data.titulo : '';\n var tag = location.data.tag != '' ? location.data.tag : '';\n var texto = location.data.texto != '' ? location.data.texto : '';\n var imagen = location.data.imagen != '' ? location.data.imagen : '';\n var direccion = location.data.direccion != '' ? location.data.direccion : '';\n var video = location.data.video;\n var imagenes = location.data.imagenes;\n var likes = location.likes != '' ? location.likes : '';\n \n html = `\n <article class=\"art-popup-wrapper\">\n <div class=\"video-wrapper\">\n <div class=\"title-wrapper\"></div>\n <div class=\"video\">`\n if( video != '' ) {\n `<button class=\"playbtn\" id=\"play\" onclick=\"videoToogle(this)\"></button>`;\n }\n html += '<video id=\"videolocator\" height=\"100%\" poster=\"'+contenidoUrl+imagen[0]+'\">';\n for (var i = 0; i < video.length; i++) {\n html += '<source src=\"';\n \n html += contenidoUrl + video[i];\n \n html += '\" type=\"video/';\n if ( video[i].search('mp4') != -1 ) {\n html += 'mp4';\n } else if ( video[i].search('ogg') != -1 ) {\n html += 'ogg';\n } else {\n html += 'webm';\n }\n html += '\">'\n }\n html += '<img src=\"'+contenidoUrl+imagen[0]+'\">';\n html += '</video>';\n\n html += `</div>\n </div>\n `;\n html += ` \n <div class=\"contenido-wrapper\">`;\n\n if ( likes != '' ) {\n html += `\n <div class=\"wrapper-fav\">\n <span class=\"number\">`\n +likes+\n `\n </span>\n </div>`;\n }\n html += `\n <div class=\"text-wrapper\">\n <div class=\"title-wrapper\">`;\n\n if ( tag != '' ) {\n html += '<h5>Artista: '+ tag + '</h5>';\n }\n if ( titulo != '' ) {\n html += '<h1 class=\"title\">Obra: '+ titulo + '</h1>';\n }\n \n html += `</div>\n <div class=\"text\">`\n + texto + \n `</div>\n <div class=\"direccion\">`\n + direccion +\n `</div>\n </div>\n </div>\n `;\n if(imagenes != '') {\n html += '<div class=\"galeria-wrapper\">';\n //galeria antes y despues\n html += '<div id=\"before-after\" class=\"before-after\"></div>';\n html += '<div id=\"data-before-after\" class=\"before-after\" data-before-after style=\"display:none\">';\n if ( imagenes.antes.length > 1 || imagenes.despues.length > 1) {\n html += '<img src=\"'+contenidoUrl+imagenes.antes[0]+'\" srcset=\"';\n\n if (imagenes.antes.length > 1) {\n for (var im = 0; im < imagenes.antes.length; im++) {\n html += contenidoUrl+imagenes.antes[im] + ' '+ im+1 + 'x,';\n }\n }\n\n html += '\"></img>';\n html += '<img src=\"'+contenidoUrl+imagenes.despues[0]+'\" srcset=\"';\n if (imagenes.despues.length > 1) {\n for (var ima = 0; ima < imagenes.despues.length; ima++) {\n html += contenidoUrl+imagenes.despues[ima] + ' '+ ima+1 + 'x,';\n }\n } \n\n html += '\"></img>';\n \n } else {\n //imagenes por defecto\n html += '<img src=\"'+contenidoUrl+imagenes.antes[0]+'\">';\n html += '<img src=\"'+contenidoUrl+imagenes.despues[0]+'\"></img>';\n }\n html += '</div>';\n }\n html += '</div>';\n html += ` \n <div class=\"wrapper-pag\">\n <span data-id=\"`+(parseInt(location.id)-1)+`\" id=\"pops-pag-left\" class=\"pag-direction\"></span>\n <span data-id=\"`+(parseInt(location.id)+1)+`\" id=\"pops-pag-right\" class=\"pag-direction\"></span>\n <ul class=\"pagination-art\">\n <li></li>\n <li></li>\n <li></li>\n <li></li>\n <li></li>\n </ul>\n </div>\n </article>\n `;\n }\n\n //inserta el contenido\n contenido.innerHTML = html;\n\n //activa galeria before after\n setTimeout(function(){\n var dataGaleria = document.querySelector('#data-before-after');\n if ( dataGaleria != null) {\n new beforeAfter({\n 'el' : 'before-after', // or just the node object\n 'before' : dataGaleria.children[0].src,\n 'after' : dataGaleria.children[1].src\n });\n }\n },900)\n \n\n //agrega los botones de navegacion\n var btnLeft = document.querySelector('#pops-pag-left');\n var btnRight = document.querySelector('#pops-pag-right');\n\n btnLeft.addEventListener('click', navigateLocation);\n btnRight.addEventListener('click', navigateLocation);\n \n}", "title": "" }, { "docid": "d7415b39ffc5d789ac635e2b4f6f3743", "score": "0.61711746", "text": "build () {\n this.overlay = document.createElement('div');\n this.overlay.classList.add('modal__overlay');\n this.overlay.classList.add('modal__hidden');\n\n this.content = document.createElement('div');\n this.content.classList.add('modal__content');\n\n this.box = document.createElement('div');\n this.box.classList.add('modal__box');\n this.box.classList.add('modal__hidden');\n this.box.childNodes.push(this.content);\n }", "title": "" }, { "docid": "0ff18c515bd0a17de211d3e80a13de9d", "score": "0.61645955", "text": "function makeContent(contenido) {\n var html = '';\n if ( contenido.data === undefined || contenido.data == null || contenido.data == '' ) {\n\n html += '<div class=\"mapinfo-wrapper\"><div style=\"height: 30px;\"></div><h1 class=\"title\" style=\"padding-bottom:2em\">';\n html += contenido.titulo;\n html += '</h1>';\n if ( contenido.data.popup ) {\n html += '<button onclick=\"openMoreId(this)\" id=\"vermas-btn-marker\" class=\"ver-mas-btn\" data-id=\"';\n html += contenido.id;\n html += '\">+ Ver más</button>';\n }\n html += '</div>';\n\n } else {\n\n html += '<div class=\"mapinfo-wrapper\">';\n html += '<figure class=\"imagen-destacada\">';\n if ( contenido.data.imagen.length > 0 && contenido.data.imagen[0] != '') {\n html += '<img src=\"' + contenidoUrl + contenido.data.imagen[0] + '\"';\n if ( contenido.data.imagen.length > 1 ) {\n html += 'srcset=\"' + contenidoUrl + contenido.data.imagen[0] + ' 1x, ' + contenidoUrl + contenido.data.imagen[1] + ', 2x\"';\n }\n html += '>';\n }\n if ( parseInt(contenido.likes) > 0 ) {\n html += '<div class=\"wrapper-fav\"><span class=\"number\">' + contenido.likes + '</span></div>';\n }\n html += '</figure>';\n html += '<h1 class=\"title\">';\n html += contenido.data.titulo;\n html += '</h1>';\n html += '<h5 class=\"tag\">';\n html += contenido.data.tag\n html += '</h5>';\n html += '<p class=\"excerpt\">';\n html += contenido.data.excerpt\n html += '</p>';\n html += '<address class=\"direccion\">';\n html += contenido.data.direccion;\n html += '</address>';\n if ( contenido.data.popup ) {\n html += '<button onclick=\"openMoreId(this)\" id=\"vermas-btn-marker\" class=\"ver-mas-btn\" data-id=\"';\n html += contenido.id;\n html += '\">Ver más</button>';\n }\n html += '</div>';\n\n }\n\n return html;\n }", "title": "" }, { "docid": "4e2d445b5a490446934f529f42aa4874", "score": "0.61599624", "text": "function update() {\n popUpWin.document.open();\n // content for the popup window is defined here\n //popUpWin.document.write(\"<html><head><title>Cut and Paste JavaScript!</title></head>\");\n //popUpWin.document.write(\"<body><center><strong>\" + describeIt + \"</strong><p>\");\n //popUpWin.document.write(\"<img src=\" + picture + \"><br>\");\n //popUpWin.document.write(\"<font size=-1>&copy;1997 Dave Gibson</font><p>\");\n //popUpWin.document.write(\"<a href='#' onClick='self.close()'>\");\n //popUpWin.document.write(\"Return To Cut and Paste!</a></center></body></html>\");\n popUpWin.document.close();\n}", "title": "" }, { "docid": "83718a62850bf13e65cdb8975fb091d0", "score": "0.6139573", "text": "function loadPopupContent(href){\n\t$.getJSON(href, function(data){\n\t\t$(\".popup_content\").html(data);\n\t\tpopup_shown=true;\n\t\tcenterPopup();\n\t\t$(\".popup_bg\").css({ \"opacity\": \"0.7\" }); \n\t\t$(\".popup_bg\").fadeIn(\"slow\"); \n\t\t$(\".popup\").fadeIn(\"slow\");\t\t\t\n\t})\n}", "title": "" }, { "docid": "beb6218eb2d399c53484fb8c404cbf5e", "score": "0.6086625", "text": "function create_popup_content(location) {\n let content = document.createElement('div');\n\n let title = document.createElement('h3');\n title.innerHTML = location.name;\n title.className = \"popup-title\";\n\n let nav = document.createElement('nav');\n let nav_tab = document.createElement('div');\n nav_tab.id = \"nav-tab\";\n nav_tab.className = \"nav justify-content-center nav-tabs\";\n nav_tab.setAttribute('role', 'tablist');\n nav.appendChild(nav_tab);\n\n let tab_box = document.createElement('div');\n tab_box.id = \"nav-tabContent\";\n tab_box.className =\"tab-content\";\n\n // Fills each tab with the description.\n for (let tab_name in location.descriptions) {\n if (location.descriptions.hasOwnProperty(tab_name)) {\n let nav_button = document.createElement('button');\n nav_button.className = \"nav-link\";\n nav_button.id = `nav-${tab_name}-tab`;\n nav_button.setAttribute(\"data-bs-toggle\", \"tab\");\n nav_button.setAttribute(\"data-bs-target\", `#nav-${tab_name}`);\n nav_button.type = \"button\";\n nav_button.setAttribute(\"role\", \"tab\");\n nav_button.setAttribute(\"aria-controls\", `#nav-${tab_name}`);\n nav_button.setAttribute(\"aria-selected\", \"false\");\n nav_button.innerHTML = tab_name.charAt(0).toUpperCase() + tab_name.slice(1);\n\n if (tab_name == \"efficiency\") {\n nav_button.innerHTML = \"Energy \" + nav_button.innerHTML;\n } else if (tab_name != \"overview\") {\n nav_button.innerHTML += \" Impact\";\n }\n\n nav_tab.appendChild(nav_button);\n\n let tab = document.createElement('div');\n tab.className = \"tab-pane fade\";\n tab.id = `nav-${tab_name}`;\n tab.setAttribute('role', \"tabpanel\");\n tab.setAttribute('aria-labelledby', `nav-${tab_name}-tab`);\n tab.innerHTML = location.descriptions[tab_name];\n tab.innerHTML = tab.innerHTML.replace(/\\n/g, \"<br>\");\n\n if (tab_name == \"overview\") {\n overview_image = document.createElement('img');\n overview_image.src = location.image;\n overview_image.className = 'img-fluid location-img';\n tab.prepend(overview_image);\n }\n\n tab_box.appendChild(tab);\n\n if (nav.childNodes.length == 1 && tab_box.childNodes.length == 1) {\n nav_button.className += \" active\";\n nav_button.setAttribute(\"aria-selected\", \"true\");\n tab.className += \" show active\";\n }\n }\n }\n\n content.append(title);\n content.appendChild(nav);\n content.appendChild(tab_box);\n\n return content.innerHTML;\n}", "title": "" }, { "docid": "59f7f052eb22f6336001ee7107cd89bd", "score": "0.60804087", "text": "function create_html_popup( feature ){\n \n}", "title": "" }, { "docid": "fbb56e0e2f175d340cde1a05496000a8", "score": "0.6076939", "text": "function actionOverlay(mode, content){\n \n \n \n if(mode == 'display') {\n // add block page\n var block_page = $('<div class=\"paulund_block_page\"></div>');\n $(block_page).appendTo('body');\n \n // add popup box\n var pop_up = $('<div class=\"paulund_modal_box\"><a href=\"#\" class=\"paulund_modal_close\">x</a><div class=\"paulund_inner_modal_box\">' + content + '</div></div>');\n // TODO timeseries viewer integrated\n // var content =\n // '<h2>Dataset 1:</h2><iframe width=\"90%\" height=\"100%\" src=\"/burst/launch_visualization/0/100/100\"' + \n // // 'py:if=\"portlet_entity.status == ' + '\"finished\"' + '\"' + \n // 'onload=\"this.contentWindow.launchViewer(500, 100);\"></iframe>' + \n // '<br><br><br><hr><br><br><br><h2>Dataset 2:</h2><iframe width=\"90%\" height=\"100%\" src=\"/burst/launch_visualization/0/100/100\"' + \n // // 'py:if=\"portlet_entity.status == ' + '\"finished\"' + '\"' + \n // 'onload=\"this.contentWindow.launchViewer(500, 100);\"></iframe>';\n // // '<div id=\"portlet-view-${portlet_entity.td_gid}\" class=\"portlet portlet-type-${portlet_entity.algorithm_identifier.lower()} portlet-${portlet_idx if defined(' + '\"portlet_idx\"' +') else portlet_entity.index_in_tab}\" ' +\n // // 'xmlns:py=\"http://genshi.edgewall.org/\">' +\n // // // '<h5>${portlet_entity.name}</h5>' +\n // // // '<div class=\"specialviewer\" >' +\n // // '<iframe width=\"100%\" height=\"100%\" src=\"/burst/launch_visualization/0/500/600\"' + \n // // 'py:if=\"portlet_entity.status == ' + '\"finished\"' + '\"' + \n // // 'onload=\"this.contentWindow.launchViewer(500, 400);\"></iframe>' +\n // // // '<div class=\"errorMessage\" py:if=\"portlet_entity.status == ' + '\"error\"' + '\">ERROR: ${portlet_entity.error_msg}</div>' +\n // // // '<div class=\"warningMessage\" py:if=\"portlet_entity.status == ' + '\"canceled\"' + '\">STATUS: Operation canceled by user!</div>' +\n // // // '<div class=\"infoMessage\" py:if=\"portlet_entity.status == ' + '\"running\"' + '\">' +\n // // // 'STATUS: Operation is still running!' +\n // // // '</div>' +\n // // // '</div>' +\n // // '<input type=\"hidden\" id=\"running-portlet-${portlet_entity.index_in_tab}\" value=\"${portlet_entity.td_gid}\" py:if=\"portlet_entity.status == ' + '\"running\"' + '\"/>' +\n // // '</div>'; \n // var pop_up = $('<div class=\"paulund_modal_box\"><a href=\"#\" class=\"paulund_modal_close\"><b>x</b></a><div class=\"paulund_inner_modal_box\">' + content + '</div></div>');\n $(pop_up).appendTo('.paulund_block_page');\n \n $('.paulund_block_page').dblclick(function(){\n $(this).fadeOut().remove();\n $('.paulund_modal_close').fadeOut().remove(); \n }); \n \n $('.paulund_modal_close').click(function(){\n $(this).parent().fadeOut().remove();\n $('.paulund_block_page').fadeOut().remove(); \n });\n \n // if the overlay is dbl clicked, don't act as the parent (block_page) and close it\n\t $('.paulund_modal_box').dblclick(function(e){\n\t \te.stopPropagation();\n\t });\n \n $('.paulund_modal_box').fadeIn();\n } else {\n \n $('.paulund_modal_box').fadeOut();\n \n }\n \n generateStylesForOverlay();\n}", "title": "" }, { "docid": "39603c743dd179daf5939735ecd15b57", "score": "0.60737634", "text": "function createModalContent(name, overview, release, videokey, runtime, actors, producer, rating){\n const tempDiv = document.createElement(\"div\");\n tempDiv.classList.add(\"modalcontent\");\n tempDiv.setAttribute('id', \"modalcontent\");\n \n const closeElm = `<i onclick=\"closeModal()\" class=\"close fa fa-times\"></i>`;\n if (!name == \"\") {titleElm = `<h4 class=\"title\">${name}</h4>`;}\n if (!overview == \"\") {descElm = `<div class=\"descrip\"><h4>Description:</h4><p>${overview}</p></div>`;}\n if (!release == \"\") {releaseElm = `<div class=\"release\"><h4>Release date:</h4><p> ${release}</p><br><h4 class=\"runtime\">Runtime:</h4><p>${runtime} min</p></div>`;}\n if (!videokey == \"\") {iframeElm = `<iframe class=\"tube\" src=\"https://www.youtube.com/embed/${videokey}\"></iframe>`;}\n if (!actors == \"\") {actorsElm = `<div class=\"actor actorwrapper\"><h4>Actors: </h4><p>${setupActors(actors)}</p></div>`;}\n if (!producer == \"\"){producerElm =`<div class=\"producer\"><h4>Producer:</h4><p>${producer}<p></div>`}\n if (!rating == \"\") {ratingElm = `<div class=\"rating\"><h4>Rating</h4> <p>${rating}/10</p></div>`;}\n console.log(\"created all modal content\");\n tempDiv.innerHTML = titleElm + descElm + releaseElm + iframeElm + actorsElm + closeElm + ratingElm + producerElm;\n return tempDiv;\n}", "title": "" }, { "docid": "3d8d7f406c4b2d040f67e8a7b7a1a581", "score": "0.6064844", "text": "function displayPopup(base, popupcontent, popupXLocation = 'middle', popupYLocation = 'below', arrow = true, arrowColor ='white', arrowSize = '7'){\n /*\n Options\n popupXLocation : left, right, middle\n popupYLocation : above, below\n */\n\n // Get the location of the parent so as to positon the popup\n var element = $(base);\n var child = $(popupcontent);\n var popupbox = child.parent().closest('div');\n var offsets = element.offset();\n var etop = offsets.top;\n var eleft = offsets.left;\n var eheight = element.outerHeight();\n var ewidth = element.outerWidth();\n var coffsets = child.offset();\n var ctop = coffsets.top;\n var cleft = coffsets.left;\n var cwidth = child.outerWidth();\n var cheight = child.outerHeight();\n //Fixing Y location\n if(popupYLocation == 'below'){\n var posy = etop + eheight;\n }\n if(popupYLocation == 'above'){\n var posy = etop - cheight;\n }\n //Fixing X location\n if(popupXLocation == 'middle'){\n var posx = eleft + ewidth/2 - cwidth/2;\n arrowx = cwidth/2;\n }\n if(popupXLocation == 'left'){\n var posx = eleft + ewidth*9/10 - cwidth;\n arrowx = cwidth - ewidth/2;\n }\n if(popupXLocation == 'right'){\n var posx = eleft + ewidth/10;\n arrowx = ewidth/2;\n }\n if (arrow == true){\n // Adjust position due to arrow\n posy = posy - arrowSize;\n //Insert a triangle befre the content\n if($('#triangleDiv').length == 0){\n if(popupYLocation == 'below'){\n $(getTriangleDiv(arrowx, 'up',arrowColor)).insertBefore(popupcontent);\n }\n if(popupYLocation == 'above'){\n $(popupcontent).after(getTriangleDiv(arrowx, 'down', arrowColor));\n }\n }\n }\n // Fix left position on overflow\n if(posx < 5){\n posx = 5;\n }\n popupbox.css('height', cheight + 'px');\n popupbox.css('width', cwidth + 'px');\n popupbox.css('margin-top', posy + 'px');\n popupbox.css('margin-left', posx + 'px');\n popupbox.css('display', 'block');\n $('html').click(function(){\n popupbox.hide();\n });\n $(popupcontent).click(function(e){\n e.stopPropagation();\n $(this).show();\n });\n}", "title": "" }, { "docid": "0619480b7ca0d1e0d2ab2d8785733ee8", "score": "0.60646784", "text": "function _showContent(){\n\t\t\t\n\t\t\t// Calculate the opened top position of the pic holder\n\t\t\tprojectedTop = scroll_pos['scrollTop'] + ((windowHeight/2) - (pp_dimensions['containerHeight']/2));\n\t\t\tif(projectedTop < 0) projectedTop = 0;\n\n\t\t\t$ppt.fadeTo(settings.animation_speed,1);\n\t\t\t\n\n\t\t\t// Resize the content holder\n\t\t\t$pp_pic_holder.find('.pp_content')\n\t\t\t\t.css({\n\t\t\t\t\theight:pp_dimensions['contentHeight'],\n\t\t\t\t\twidth:pp_dimensions['contentWidth']\n\t\t\t\t});\n\t\t\t\n\t\t\t// Resize picture the holder\n\t\t\t$pp_pic_holder.css({\n\t\t\t\t'top': projectedTop,\n\t\t\t\t'left': ((windowWidth/2) - (pp_dimensions['containerWidth']/2) < 0) ? 0 : (windowWidth/2) - (pp_dimensions['containerWidth']/2),\n\t\t\t\twidth:pp_dimensions['containerWidth']\n\t\t\t});\n\t\t\t\n\t\t\t$pp_pic_holder.find('.pp_hoverContainer,#fullResImage').height(pp_dimensions['height']).width(pp_dimensions['width']);\n\t\t\t\n\t\t\t//make sure the iframe is loaded before fading in\n\t\t\tif( $pp_pic_holder.find('#pp_full_res > iframe').length == 0 ){\n\t\t\t\t$('.pp_loaderIcon').stop(true,true).fadeOut();\n\t\t\t\t$pp_pic_holder.find('.pp_fade, div.pp_details').fadeIn(settings.animation_speed); // Fade the new content\t\t\n\t\t\t}\n\t\t\t\n\t\t\telse {\n\t\t\t\t$pp_pic_holder.find('iframe').load(function(){\n\t\t\t\t\t\t\t\n\t\t\t\t\t$pp_pic_holder.css({\n\t\t\t\t\t\t'top': projectedTop - 50,\n\t\t\t\t\t});\n\t\t\t\t\t$('.pp_loaderIcon').stop(true,true).fadeOut();\n\t\t\t\t\t$pp_pic_holder.find('.pp_fade, div.pp_details').fadeIn(settings.animation_speed); // Fade the new content\n\t\t\t\t});\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\t\n\n\t\t\t// Show the nav\n\t\t\tif(isSet && _getFileType(pp_images[set_position])==\"image\") { $pp_pic_holder.find('.pp_hoverContainer').show(); }else{ $pp_pic_holder.find('.pp_hoverContainer').hide(); }\n\t\t\n\t\t\tif(settings.allow_expand) {\n\t\t\t\tif(pp_dimensions['resized']){ // Fade the resizing link if the image is resized\n\t\t\t\t\t$('a.pp_expand,a.pp_contract').show();\n\t\t\t\t}else{\n\t\t\t\t\t$('a.pp_expand').hide();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(settings.autoplay_slideshow && !pp_slideshow && !pp_open) $.prettyPhoto.startSlideshow();\n\t\t\t\n\t\t\tsettings.changepicturecallback(); // Callback!\n\t\t\t\n\t\t\tpp_open = true;\n\t\t\n\n\t\t\t\n\t\t\t_insert_gallery();\n\t\t\tpp_settings.ajaxcallback();\n\t\t}", "title": "" }, { "docid": "e09c1417819b1d681d4645a708339395", "score": "0.60625345", "text": "buildModal() {\n if (this.style === 'card') {\n this.createCardStructure();\n } else {\n if (!this.content.innerHTML) {\n this.content.innerHTML = this.body;\n }\n }\n\n if (this.closable) {\n /** @param {HTMLElement} */\n this.closeButton = this.style === 'card' ? _core.default.findOrCreateElement('.delete', this.header, 'button') : _core.default.findOrCreateElement('.modal-close', this.root, 'button');\n }\n\n if (this.style === 'card') {\n this.createButtons();\n }\n\n this.setupEvents();\n }", "title": "" }, { "docid": "a94f72dd42d96295dcac1cb46b98c6a8", "score": "0.60623366", "text": "function createModalContent(a, d, c, e, f, g, h) {\n\n const contentDiv = document.createElement('div');\n contentDiv.innerHTML = `\n <div class=\"result-container m-5 p-4\">\n <div id=\"modal-book-details\" class=\"row mb-3 mt-3\">\n <div class=\"col\">\n <ul class=\"list-group list-group-flush modal-content-list-titles mr-1\">\n <li class=\"list-group-item\"><h5>${a}</h5><p class=\"font-italic mb-0 mt-2\">\"${h}\"</p></li>\n <li class=\"list-group-item\"><span class=\"font-weight-bold\">Author:</span> ${c}</li>\n <li class=\"list-group-item\"><span class=\"font-weight-bold\">Pages:</span> ${f}</li>\n <li class=\"list-group-item\"><span class=\"font-weight-bold\">Full Details:</span> <a href=\"${g}\" target=\"_blank\">Google Books</a></li>\n <li class=\"list-group-item\"><span class=\"font-weight-bold\">Buy From:</span> <a href=\"amazon.com\" target=\"_blank\">Amazon</a> | <a href=\"https://www.fishpond.co.nz\" target=\"_blank\">Fishpond</a> | <a href=\"https://www.mightyape.co.nz/books\" target=\"_blank\">Mighty Ape</a></li>\n </ul>\n </div> \n <div class=\"col-md-4 col-lg-3 mt-4 mt-md-0\">\n <img class=\"modal-content-thumbnail\" src=\"${d}\">\n </div>\n <div class=\"modal-content-description p-4 col-12\">\n <p class=\"col-9 description\">${e}</p>\n </div>\n </div>\n `;\n resultBody.appendChild(contentDiv);\n}", "title": "" }, { "docid": "45c09153018c474e02a9a9f6fd548601", "score": "0.60620433", "text": "function openLoadNotes()\n{\n var content = $(\"<div>\");\n content.append(\n $(\"<span>\").text(\"באפשרותך לטעון קובץ הערות ששמרת בעבר דרך התוסף. \")\n ).append(\n $(\"<b>\").text(\"בטעינת קובץ הערות, כל ההערות הקיימות שלך ימחקו.\")\n ).append(\n $(\"<div>\").append(\n $(\"<input>\", { type: \"file\", accept: \".json\", id: \"notes-file-input\", style: \"display: none\" }).change(function (event)\n {\n importNotesFromJsonInput(event, function (status)\n {\n $(\"#notes-status\").attr(\"class\", status.success ? \"success\" : \"failure\").text(status.info);\n\n //update the editor if the notes were changed\n if (status.success)\n {\n updateNoteTextContainers();\n chrome.runtime.sendMessage({ event: { cat: \"Click\", type: \"UploadNotes\" } });\n }\n });\n })\n ).append(\n $(\"<label>\", { for: \"notes-file-input\" }).append(\n $(\"<div>\", { class: \"niceButton blueBtn\" }).text(\"בחר קובץ\")\n )\n ).append(\n $(\"<div>\", { id: \"notes-status\" })\n )\n );\n var imgUrl = chrome.extension.getURL(\"images/archive.svg\");\n openPopupWindow(\"load_notes_popup\", imgUrl, \"טען הערות מקובץ\", content);\n}", "title": "" }, { "docid": "0b8cc23d26c1db27b024a7e0fe89acad", "score": "0.60557145", "text": "function _showContent() {\n $('.pp_loaderIcon').hide();\n\n // Calculate the opened top position of the pic holder\n projectedTop = scroll_pos['scrollTop'] + ((windowHeight / 2) - (pp_dimensions['containerHeight'] / 2));\n if (projectedTop < 0) projectedTop = 0;\n\n $ppt.fadeTo(settings.animation_speed, 1);\n\n // Resize the content holder\n $pp_pic_holder.find('.pp_content')\n\t\t\t\t.animate({\n\t\t\t\t height: pp_dimensions['contentHeight'],\n\t\t\t\t width: pp_dimensions['contentWidth']\n\t\t\t\t}, settings.animation_speed);\n\n // Resize picture the holder\n $pp_pic_holder.animate({\n 'top': projectedTop,\n 'left': ((windowWidth / 2) - (pp_dimensions['containerWidth'] / 2) < 0) ? 0 : (windowWidth / 2) - (pp_dimensions['containerWidth'] / 2),\n width: pp_dimensions['containerWidth']\n }, settings.animation_speed, function () {\n $pp_pic_holder.find('.pp_hoverContainer,#fullResImage').height(pp_dimensions['height']).width(pp_dimensions['width']);\n\n $pp_pic_holder.find('.pp_fade').fadeIn(settings.animation_speed); // Fade the new content\n\n // Show the nav\n if (isSet && _getFileType(pp_images[set_position]) == \"image\") { $pp_pic_holder.find('.pp_hoverContainer').show(); } else { $pp_pic_holder.find('.pp_hoverContainer').hide(); }\n\n if (settings.allow_expand) {\n if (pp_dimensions['resized']) { // Fade the resizing link if the image is resized\n $('a.pp_expand,a.pp_contract').show();\n } else {\n $('a.pp_expand').hide();\n }\n }\n\n if (settings.autoplay_slideshow && !pp_slideshow && !pp_open) $.prettyPhoto.startSlideshow();\n\n settings.changepicturecallback(); // Callback!\n\n pp_open = true;\n });\n\n _insert_gallery();\n pp_settings.ajaxcallback();\n }", "title": "" }, { "docid": "1911cbd66182b16f33e677f6d18eb67e", "score": "0.6047979", "text": "function WindowContent(){\r\n Window_Content.style.display = \"block\";\r\n }", "title": "" }, { "docid": "40d415889aa263ac92b1911eb28a6124", "score": "0.60473895", "text": "function d_make_modal(content, settings) {\n settings = $.extend({\n parent: \"body\"\n }, settings);\n \n\t\t$element = $(\"<div></div>\")\n\t\t\t.html(content)\n\t\t\t.appendTo(settings.parent);\n\t\treturn d_activate_modal($element, settings);\n\t}", "title": "" }, { "docid": "600523416ea771096401732dbaed1b9c", "score": "0.60378236", "text": "function createInfoPopUp (e) {\n // first it creates a div element\n const div = document.createElement('div')\n div.classList.add('container');\n // then it adds some content inside the div\n div.innerHTML = `\n <button type=\"button\" onclick=\"return this.parentNode.remove();\" style=\"float:right; border-radius:10%; border:none; padding:5px; background-color:#1877f2; color:white; cursor: pointer;\">Close</button>\n <h1 style=\"text-align:center; font-size:20px;\">Post Box</h1>\n <p>In 2013, Facebook conducted a study that tracked <b>users' post-box</b> to determine if and how they self censored themselves on the platform. Facebook tracked content written in the post box that was five or more characters long. The content would be marked as “censored”, if it was not posted within ten minutes of its creation.\n</p>\n <p>Facebook researchers found that over 71% of users self-censored their content; men self censored more than women (especially if they had more male friends), and older users self censored more than younger users.</p>\n <p>Alexis Madrigal in his Atlantic article about the topic discusses the importance of this study: Facebook’s model depends on users sharing, whether it be through their own posts or comments. The more users self censor and decide not to post, Facebook “loses value from the lack of content generation.”</p>\n\n<h2>Find Out More Information</h2>\n <ul>\n <li><a href=\"https://www.theatlantic.com/technology/archive/2013/04/71-of-facebook-users-engage-in-self-censorship/274982/\" target=\"_blank\">71% of Facebook Users Engage in 'Self-Censorship' - The Atlantic</a></li>\n <li><a href=\"https://research.fb.com/wp-content/uploads/2016/11/self-censorship-on-facebook.pdf\" target=\"_blank\">Self-Censorship on Facebook (Research Report)</a></li>\n </ul>\n `\n\n div.style.backgroundColor = '#f6f6f6'\n div.style.fontSize = '14px'\n div.style.color = '#1877f2'\n div.style.maxWidth = '400px'\n div.style.border = '2px solid #1877f2'\n div.style.borderRadius = '6px'\n div.style.padding = '20px'\n div.style.position = 'absolute'\n div.style.left = `${e.clientX}px`\n div.style.top = `${e.clientY}px`\n\n document.body.appendChild(div)\n}", "title": "" }, { "docid": "78640fafb45098c10b5863694915f5dd", "score": "0.6036351", "text": "function showDetailsContent(selectValue) {\n var item, content, div;\n\n item = request.responseXML.getElementsByTagName(\"entry\")[selectValue];\n content = getElementTextNS(\"\", \"content\", item, 0);\n\n if (!item) {\n item = request.responseXML.getElementsByTagName(\"item\")[selectValue];\n content = getElementTextNS(\"content\", \"encoded\", item, 0);\n\n }\n\n div = document.getElementById(\"details\");\n div.innerHTML = \"\";\n // blast new HTML content into \"details\" <div>\n div.innerHTML = content;\n}", "title": "" }, { "docid": "5b4ab0680d23fd1a5869488de102265e", "score": "0.60308486", "text": "function create(){\n const div = document.createElement('div');\n div.classList.add('popup-close');\n div.setAttribute('id','closing');\n const text = document.createTextNode('X');\n div.appendChild(text);\n popup.append(div);\n const div2 = document.createElement('div');\n div2.classList.add('popup-content');\n const html = `\n <span id=\"sp\">1</span>\n <h2>Fill the Input</h2>\n <p>Don't forget</p>\n <a href=\"#\">Return</a>`;\n div2.innerHTML=html;\n popup.append(div2); \n \n}", "title": "" }, { "docid": "367f8a5540c222e85f622c1b6506b079", "score": "0.6025402", "text": "function constructPopupContent(initiative, pilot, participant) {\n \t\t\tvar properties = { \"initiativeLabel\": initiative.title,\n \t\t\t\t \"pilotLabel\": pilot.title,\n \t\t\t\t \"pilotDescription\": pilot.description,\n \t\t\t\t \"pilotPageUrl\": pilot.pageUrl,\n \t\t\t\t \"companyUrlScheme\": participant.companyUrlScheme,\n \t\t\t \"companyUrl\": participant.companyUrl },\n \t\t\t node = new widgets.PopupContent({ \"properties\": properties }).domNode,\n \t\t\t container = document.createElement(\"div\");\n \t\t\t\n \t\t\tcontainer.appendChild(node);\n \t\t\t\n \t\t\treturn container.innerHTML;\n \t\t}", "title": "" }, { "docid": "1f2ddd663ed2f485b2eea5f2b9737d5f", "score": "0.60252124", "text": "function createPersonalNotesPopup (notesPopupContent) {\n TBui.popup({\n title: 'Personal notes',\n tabs: [\n {\n title: 'Personal notes',\n id: 'personal-notes', // reddit has things with class .role, so it's easier to do this than target CSS\n tooltip: 'Edit macro',\n content: notesPopupContent,\n footer: '<input type=\"button\" class=\"tb-action-button\" id=\"save-personal-note\" value=\"save note\">',\n },\n ],\n cssClass: 'personal-notes-popup',\n }).appendTo('body');\n }", "title": "" }, { "docid": "ce9b91e0eebe7e06e293e8b4e9df4423", "score": "0.6013611", "text": "function _showContent(){\n\t\t\t$('.pp_loaderIcon').hide();\n\n\t\t\t// Calculate the opened top position of the pic holder\n\t\t\tprojectedTop = scroll_pos['scrollTop'] + ((windowHeight/2) - (pp_dimensions['containerHeight']/2));\n\t\t\tif(projectedTop < 0) projectedTop = 0;\n\n\t\t\t$ppt.fadeTo(settings.animation_speed,1);\n\n\t\t\t// Resize the content holder\n\t\t\t$pp_pic_holder.find('.pp_content')\n\t\t\t\t.animate({\n\t\t\t\t\theight:pp_dimensions['contentHeight'],\n\t\t\t\t\twidth:pp_dimensions['contentWidth']\n\t\t\t\t},settings.animation_speed);\n\t\t\t\n\t\t\t// Resize picture the holder\n\t\t\t$pp_pic_holder.animate({\n\t\t\t\t'top': projectedTop,\n\t\t\t\t'left': (windowWidth/2) - (pp_dimensions['containerWidth']/2),\n\t\t\t\twidth:pp_dimensions['containerWidth']\n\t\t\t},settings.animation_speed,function(){\n\t\t\t\t$pp_pic_holder.find('.pp_hoverContainer,#fullResImage').height(pp_dimensions['height']).width(pp_dimensions['width']);\n\n\t\t\t\t$pp_pic_holder.find('.pp_fade').fadeIn(settings.animation_speed); // Fade the new content\n\n\t\t\t\t// Show the nav\n\t\t\t\tif(isSet && _getFileType(pp_images[set_position])==\"image\") { $pp_pic_holder.find('.pp_hoverContainer').show(); }else{ $pp_pic_holder.find('.pp_hoverContainer').hide(); }\n\t\t\t\n\t\t\t\tif(pp_dimensions['resized']){ // Fade the resizing link if the image is resized\n\t\t\t\t\t$('a.pp_expand,a.pp_contract').show();\n\t\t\t\t}else{\n\t\t\t\t\t$('a.pp_expand').hide();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(settings.autoplay_slideshow && !pp_slideshow && !pp_open) $.prettyPhoto.startSlideshow();\n\t\t\t\t\n\t\t\t\tif(settings.deeplinking)\n\t\t\t\t\tsetHashtag();\n\t\t\t\t\n\t\t\t\tsettings.changepicturecallback(); // Callback!\n\t\t\t\t\n\t\t\t\tpp_open = true;\n\t\t\t});\n\t\t\t\n\t\t\t_insert_gallery();\n\t\t}", "title": "" }, { "docid": "322e2b592428a2339dd08364bb4bb62e", "score": "0.6012203", "text": "function showInitialContent() {\n sourcesParent.style.display = \"block\";\n contents[0].style.visibility = \"visible\";\n buttons[0].classList.add(\"js-active\");\n sources[0].style.display = \"inline\";\n images[0].style.visibility = \"visible\";\n}", "title": "" }, { "docid": "7592bd31eaa5a8722de8736fd8c6ae6b", "score": "0.6006655", "text": "function Dialog(titleStr, content, buttons) {\n // Get the dimensions of the popup.\n content.css({visibility: 'hidden', position: 'fixed'});\n $(document.body).append(content);\n var width = content.width() + SIDE_PADDING*2;\n var height = content.height() + FOOTER_HEIGHT + TITLE_HEIGHT +\n MIDDLE_PADDING*2;\n content.detach();\n content.css({visibility: 'visible', position: 'absolute'});\n \n // Generate title bar.\n var title = $('<div class=\"title\"></div>');\n title.append($('<label></label>').text(titleStr));\n title.append($('<button></button>').click(this.close.bind(this)));\n \n // Generate footer.\n var footer = $('<div class=\"footer\"></div>');\n for (var i = buttons.length-1; i >= 0; --i) {\n var button = $('<button></button>').text(buttons[i]).click(function(n) {\n if ('function' === typeof this.onAction) {\n this.onAction(n);\n }\n }.bind(this, buttons[i]));\n if (i === buttons.length-1) {\n button.addClass('done flavor-background');\n } else {\n button.addClass('other');\n }\n footer.append(button);\n }\n \n // Generate the full element.\n content.addClass('content');\n var element = $('<div class=\"popup-dialog\"></div>');\n element.css({width: width, height: height});\n element.append([title, content, footer]);\n \n // Generate the popup, computing the total height in the process.\n Popup.call(this, element, width, height);\n \n // We need to store this for the enter key.\n this._mainButton = buttons[buttons.length - 1];\n \n // Event listeners.\n this.onAction = null;\n }", "title": "" }, { "docid": "68293be56aa262c90f968331ef6cb279", "score": "0.5988853", "text": "function _showContent(){\n\t\t\t$('.pp_loaderIcon').hide();\n\n\t\t\t// Calculate the opened top position of the pic holder\n\t\t\tprojectedTop = scroll_pos['scrollTop'] + ((windowHeight/2) - (pp_dimensions['containerHeight']/2));\n\t\t\tif(projectedTop < 0) projectedTop = 0;\n\n\t\t\t$ppt.fadeTo(settings.animation_speed,1);\n\n\t\t\t// Resize the content holder\n\t\t\t$pp_pic_holder.find('.pp_content')\n\t\t\t\t.animate({\n\t\t\t\t\theight:pp_dimensions['contentHeight'],\n\t\t\t\t\twidth:pp_dimensions['contentWidth']\n\t\t\t\t},settings.animation_speed);\n\t\t\t\n\t\t\t// Resize picture the holder\n\t\t\t$pp_pic_holder.animate({\n\t\t\t\t'top': projectedTop,\n\t\t\t\t'left': ((windowWidth/2) - (pp_dimensions['containerWidth']/2) < 0) ? 0 : (windowWidth/2) - (pp_dimensions['containerWidth']/2),\n\t\t\t\twidth:pp_dimensions['containerWidth']\n\t\t\t},settings.animation_speed,function(){\n\t\t\t\t$pp_pic_holder.find('.pp_hoverContainer,#fullResImage').height(pp_dimensions['height']).width(pp_dimensions['width']);\n\n\t\t\t\t$pp_pic_holder.find('.pp_fade').fadeIn(settings.animation_speed); // Fade the new content\n\n\t\t\t\t// Show the nav\n\t\t\t\tif(isSet && _getFileType(pp_images[set_position])==\"image\") { $pp_pic_holder.find('.pp_hoverContainer').show(); }else{ $pp_pic_holder.find('.pp_hoverContainer').hide(); }\n\t\t\t\n\t\t\t\tif(settings.allow_expand) {\n\t\t\t\t\tif(pp_dimensions['resized']){ // Fade the resizing link if the image is resized\n\t\t\t\t\t\t$('a.pp_expand,a.pp_contract').show();\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$('a.pp_expand').hide();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(settings.autoplay_slideshow && !pp_slideshow && !pp_open) $.prettyPhoto.startSlideshow();\n\t\t\t\t\n\t\t\t\tsettings.changepicturecallback(); // Callback!\n\t\t\t\t\n\t\t\t\tpp_open = true;\n\t\t\t});\n\t\t\t\n\t\t\t_insert_gallery();\n\t\t\tpp_settings.ajaxcallback();\n\t\t}", "title": "" }, { "docid": "68293be56aa262c90f968331ef6cb279", "score": "0.5988853", "text": "function _showContent(){\n\t\t\t$('.pp_loaderIcon').hide();\n\n\t\t\t// Calculate the opened top position of the pic holder\n\t\t\tprojectedTop = scroll_pos['scrollTop'] + ((windowHeight/2) - (pp_dimensions['containerHeight']/2));\n\t\t\tif(projectedTop < 0) projectedTop = 0;\n\n\t\t\t$ppt.fadeTo(settings.animation_speed,1);\n\n\t\t\t// Resize the content holder\n\t\t\t$pp_pic_holder.find('.pp_content')\n\t\t\t\t.animate({\n\t\t\t\t\theight:pp_dimensions['contentHeight'],\n\t\t\t\t\twidth:pp_dimensions['contentWidth']\n\t\t\t\t},settings.animation_speed);\n\t\t\t\n\t\t\t// Resize picture the holder\n\t\t\t$pp_pic_holder.animate({\n\t\t\t\t'top': projectedTop,\n\t\t\t\t'left': ((windowWidth/2) - (pp_dimensions['containerWidth']/2) < 0) ? 0 : (windowWidth/2) - (pp_dimensions['containerWidth']/2),\n\t\t\t\twidth:pp_dimensions['containerWidth']\n\t\t\t},settings.animation_speed,function(){\n\t\t\t\t$pp_pic_holder.find('.pp_hoverContainer,#fullResImage').height(pp_dimensions['height']).width(pp_dimensions['width']);\n\n\t\t\t\t$pp_pic_holder.find('.pp_fade').fadeIn(settings.animation_speed); // Fade the new content\n\n\t\t\t\t// Show the nav\n\t\t\t\tif(isSet && _getFileType(pp_images[set_position])==\"image\") { $pp_pic_holder.find('.pp_hoverContainer').show(); }else{ $pp_pic_holder.find('.pp_hoverContainer').hide(); }\n\t\t\t\n\t\t\t\tif(settings.allow_expand) {\n\t\t\t\t\tif(pp_dimensions['resized']){ // Fade the resizing link if the image is resized\n\t\t\t\t\t\t$('a.pp_expand,a.pp_contract').show();\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$('a.pp_expand').hide();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(settings.autoplay_slideshow && !pp_slideshow && !pp_open) $.prettyPhoto.startSlideshow();\n\t\t\t\t\n\t\t\t\tsettings.changepicturecallback(); // Callback!\n\t\t\t\t\n\t\t\t\tpp_open = true;\n\t\t\t});\n\t\t\t\n\t\t\t_insert_gallery();\n\t\t\tpp_settings.ajaxcallback();\n\t\t}", "title": "" }, { "docid": "66a5f3f8710ff2a1590256f29a3d226b", "score": "0.5980155", "text": "function getMessagesAndCreateStructure() {\n\t\tfxcmSimpleAjax.get( fxcmcom.api_endpoint + '/country-logic/geo-redirect-settings/', function ( messages ) {\n\n\t\t\tif ( typeof messages !== 'object' || !Object.keys(messages).length ) return false;\n\n\t\t\t// Content in the popup\n\t\t\tgeoContentStructure = messages['popup_structure'].replace('%%messages%%', sanitizeMessage( messages ));\n\n\t\t\t// Creating wrapper, hiding it from the page, appending it to the body and only showing what's inside\n\t\t\t$( document.createElement( 'div' ) )\n\t\t\t\t.hide()\n\t\t\t\t.append( '<div id=\"geo-popup\" class=\"geo-popup\">' + geoContentStructure + '</div>' )\n\t\t\t\t.appendTo( 'body' );\n\n\t\t\tstartLightcase();\n\t\t})\n\t}", "title": "" }, { "docid": "dee296bc526ab97a431bcc0d9fe829ba", "score": "0.5977049", "text": "function appendRequirements() {\n var active2 = document.getElementsByClassName(\"tti selected\");\n var activeView2 = active2[0].getAttribute(\"data-mode\");\n if (document.readyState === \"complete\" && activeView2 === \"employeeMode\" )\n {\n for ( var i=0; i < textForDiv.length; i++) {\n var dividedContent = textForDiv[i].split(\"^\");\n var requirementText = dividedContent[0];\n var idForDiv = \"e_\"+dividedContent[1];\n var description = document.createElement('div');\n var parentDiv = document.createElement('div');\n if (requirementText[0] === \"*\"){parentDiv.className = \"popup-parent2\";}\n else { parentDiv.className = \"popup-parent\"; }\n parentDiv.id = \"popup-parent\"+idForDiv;\n description.innerHTML = requirementText;\n description.id = \"popup\"+ idForDiv;\n description.className = \"popup\";\n document.getElementById(idForDiv).appendChild(parentDiv);\n document.getElementById(\"popup-parent\"+idForDiv).appendChild(description);\n\n }\n }\n }", "title": "" }, { "docid": "2ef22f2a3617e349bf174ea6925dfe30", "score": "0.5970721", "text": "function genInnerContentHTML(){\n var head = document.createElement('head');\n var elem;\n elem = document.createElement('meta');\n elem.setAttribute('charset', 'utf-8');\n head.appendChild(elem);\n elem = document.createElement('meta');\n elem.setAttribute('name', 'viewport');\n elem.setAttribute('content', 'width=device-width, initial-scale=1');\n head.appendChild(elem);\n elem = document.createElement('title');\n elem.innerHTML = Android.getProjectName();\n head.appendChild(elem);\n elem = document.createElement('link');\n elem.setAttribute(\"href\", \"css/bootstrap.min.css\");\n head.appendChild(elem);\n \n var inner = document.getElementById(\"innercontent\");\n //inner.removeChild(inner.lastElementChild);\n manager.selectionMask.parentNode.removeChild(manager.selectionMask);\n\n var code = \"<!DOCTYPE html>\\n\"+\n \"<html>\\n\"+\n \"<head>\\n\"+\n \" \"+head.innerHTML+\n \"\\n</head>\\n\"+\n \"<body>\\n\"+\n inner.innerHTML+\n \"<script src=\\\"js/jquery.min.js\\\"></script>\\n\"+\n \"<script src=\\\"js/bootstrap.min.js\\\"></script>\"+\n \"\\n</body>\\n\"+\n \"</html>\"\n ;\n //console.log(code);\n return code;\n }", "title": "" }, { "docid": "6d21fcd644b1bb7c8e54d6ebb947d6a5", "score": "0.59432983", "text": "function PopupContent(properties, attribute){\n this.properties = properties;\n this.attribute = attribute;\n this.year = attribute.split(\"_\")[1];\n this.population = this.properties[attribute]\n this.formatted = \"<p><b><Country:</b>\" + this.properties.Country + \"</p><p><b>Forested area of land \" + this.year + \":</b> \" + this.population + \"%</p>\";\n}", "title": "" }, { "docid": "8b906836a46e3487a6c3abdd285d8a70", "score": "0.59399366", "text": "function edInitPopup() {\n\tvar sz='<HTML ID=popup><STYLE>'\n\t+ document.styleSheets.defPopupSkin.cssText+\"\\n\"\n\t+ document.styleSheets.popupSkin.cssText+\"</STYLE>\"\n\t+ '<BODY ONSCROLL=\"return false\" SCROLL=no TABINDEX=-1 ONSELECTSTART=\"return event.srcElement.tagName==\\'INPUT\\'\"><DIV ID=puRegion>'\n\t+ '<TABLE ID=header><TR><TH NOWRAP ID=caption></TH><TH VALIGN=middle ALIGN=RIGHT>'\n//\t+ '<DIV ID=close ONCLICK=\"parent.edHidePopup()\">'\n//\t+ L_CLOSEBUTTON_TEXT\n//\t+ '</DIV>'\n\t+ '<a href=\"#\" ONCLICK=\"parent.edHidePopup();return false;\"><img src=\"'+BACK_PATH+'gfx/close.gif\" width=\"11\" height=\"10\" hspace=4 border=\"0\"></a>'\n\t+ '</TH></TR></TABLE>'\n\t+ '<DIV ALIGN=CENTER ID=content></DIV>'\n\t+ '</DIV></BODY></HTML>';\n\n\tidPopup.document.open(\"text/html\",\"replace\");\n\tidPopup.document.write(sz);\n\tidPopup.document.close();\n}", "title": "" }, { "docid": "fcb1b8bb5e98c5e1f1911ae901f087d6", "score": "0.59369683", "text": "function createPopup(contentScriptOptions) {\n // Should only be called by createBadge\n var popup = Panel({\n width: POPUP_MIN_WIDTH,\n height: POPUP_MIN_HEIGHT,\n contentScriptFile: [messageContentScriptFile],\n contentScript: selfData.load('popup.js'), // Always run after contentScriptFile\n contentScriptWhen: 'start',\n contentScriptOptions: contentScriptOptions\n });\n popup.port.on('hide', function() popup.hide());\n popup.port.on('dimensions', function(dimensions) {\n // Auto-resize pop-up.\n if (dimensions.width || dimensions.height) {\n let width = Math.max(POPUP_MIN_WIDTH, dimensions.width);\n let height = Math.max(POPUP_MIN_HEIGHT, dimensions.height);\n popup.resize(width, height);\n }\n });\n return popup;\n}", "title": "" }, { "docid": "2332d682e43eda5c1c95a748d22d3bd0", "score": "0.59104186", "text": "function appendRequirements2() {\n var active2 = document.getElementsByClassName(\"tti selected\");\n var activeView2 = active2[0].getAttribute(\"data-mode\");\n if (document.readyState === \"complete\" && activeView2 === \"employeeMode\" )\n {\n for ( var i=0; i < textForDiv2.length; i++) {\n var dividedContent3 = textForDiv2[i].split(\"^\");\n var requirementText3 = dividedContent3[0];\n var idForDiv3 = \"e_\"+dividedContent3[1];\n var description3 = document.createElement('div');\n var parentDiv3 = document.createElement('div');\n parentDiv3.className = \"popup-parent3\";\n parentDiv3.id = \"popup-parent3\"+idForDiv3;\n description3.innerHTML = requirementText3;\n description3.id = \"popup\"+ idForDiv3;\n description3.className = \"popup\";\n document.getElementById(idForDiv3).appendChild(parentDiv3);\n document.getElementById(\"popup-parent3\"+idForDiv3).appendChild(description3);\n\n }\n }\n }", "title": "" }, { "docid": "318ab5435ecb505f7337ab1747e7b619", "score": "0.5907504", "text": "function contentBuilder(data) {\n var content = '';\n var lines = '';\n var title = data.title;\n var location = data.location;\n var line = data.line;\n // var initial = (line[0]).charAt(0);\n var initial = (line[0]);\n\n if (line.length > 1) {\n // var initial1 = (line[1]).charAt(0);\n var initial1 = (line[1]);\n\n lines = '<div class=\"initial\" id=\"' + line[0].toLowerCase() + '\">' +\n '<span>' + initial + '</span>' +\n '</div>' +\n '<div class=\"initial\" id=\"' + line[1].toLowerCase() + '\">' +\n '<span>' + initial1 + '</span>' +\n '</div>';\n } else {\n lines = '<div class=\"initial\" id=\"' + line[0].toLowerCase() + '\">' +\n '<span>' + initial + '</span>' +\n '</div>';\n }\n\n var info_content = '<div class=\"content-wrapper\">' +\n '<h3 class=\"lead\">' +\n title + '</h3>' +\n '<div class=\"line-wrapper center\">' +\n lines +\n '</div>' +\n '</div>';\n\n return info_content;\n}", "title": "" }, { "docid": "fe2a7a1d98e9004a5e611ed7556ac0a5", "score": "0.5890515", "text": "function initModalUI() {\n\t\tcontent = new SignItCoreContent();\n\n\t\t// Setup an absolute-positionned $anchorModal we can programatically move\n\t\t// to be able to point exactly some coords with our popup later\n\t\t$anchorModal = $( '<div class=\"signit-popup-anchor\">' );\n\t\t$( 'body' ).append( $anchorModal );\n\n\t\t// Create and add our popup to the DOM\n\t\tpopup = new OO.ui.PopupWidget( {\n\t\t\t$content: content.getContainer(),\n\t\t\tpadded: true,\n\t\t\twidth: 850,\n\t\t\t$floatableContainer: $anchorModal,\n\t\t\tposition: 'above',\n\t\t\talign: 'center',\n\t\t\tautoClose: true,\n\t\t\tautoFlip: true,\n\t\t\thideWhenOutOfView: false,\n\t\t\t$container: $( 'body' ),\n\t\t\tclasses: [ 'signit-popup' ]\n\t\t} );\n\t\t$( 'body' ).append( popup.$element );\n\t}", "title": "" }, { "docid": "31ea644d93ab3bf78ea2f18a6fc026e3", "score": "0.58894163", "text": "function PopupContent(props) {\n\t var children = props.children,\n\t className = props.className;\n\n\t var classes = (0, _classnames2.default)('content', className);\n\t var rest = (0, _lib.getUnhandledProps)(PopupContent, props);\n\t var ElementType = (0, _lib.getElementType)(PopupContent, props);\n\n\t return _react2.default.createElement(\n\t ElementType,\n\t _extends({}, rest, { className: classes }),\n\t children\n\t );\n\t}", "title": "" }, { "docid": "aa2a05e93428bad527aabcd18fef2bbb", "score": "0.5885201", "text": "_getContent() {\n\t\tlet target = $(this.ui.curTrigger.attr('href'));\n\t\tthis._setContent(target);\n\t}", "title": "" }, { "docid": "3e08c54197c94d00a6d1b5011bcd839e", "score": "0.5884551", "text": "buildUI() {\n this.node.setAttribute('tabindex', '0');\n this.node.cellSpacing = 0;\n this.node.cellPadding = 0;\n this.node.innerHTML = '\\\n <div class=\"fw-windowmodal-top\">\\\n <div class=\"fw-windowmodal-title\"></div>\\\n <div class=\"fw-windowmodal-close\"></div>\\\n </div>\\\n <div class=\"fw-windowmodal-main\">\\\n <div class=\"fw-windowmodal-scroll\"></div>\\\n </div>';\n\n this.topNode = this.node.getElementsByClassName('fw-windowmodal-top')[0];\n this.titleNode = this.node.getElementsByClassName('fw-windowmodal-title')[0];\n this.closeNode = this.node.getElementsByClassName('fw-windowmodal-close')[0];\n this.mainNode = this.node.getElementsByClassName('fw-windowmodal-main')[0];\n this.scrollNode = this.node.getElementsByClassName('fw-windowmodal-scroll')[0];\n\n this.setTitle(this.config.title);\n this.setContentNode(this.configContentNode);\n }", "title": "" }, { "docid": "0b024dfb6328fb5b38e16949bdba3990", "score": "0.5879193", "text": "function PopupContent(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()('content', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"r\" /* getUnhandledProps */])(PopupContent, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"q\" /* getElementType */])(PopupContent, props);\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(ElementType, __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_extends___default()({}, rest, {\n className: classes\n }), __WEBPACK_IMPORTED_MODULE_4__lib__[\"c\" /* childrenUtils */].isNil(children) ? content : children);\n}", "title": "" }, { "docid": "531cabd6143e492d9e27ef3e61dffc83", "score": "0.5879048", "text": "function showPopup(content, onTop, fixedPosition) {\r\n\t$('#fbfPopupContainer').innerHTML = content;\r\n\t$('#fbfPopupContainer').style.position = fixedPosition ? 'fixed' : 'absolute';\r\n\t$('#fbfShadow').style.zIndex = '1000';\r\n\t$('#fbfPopupContainer').style.zIndex = '1001';\r\n\t$('#fbfShadow').style.display = 'block';\r\n\t$('#fbfPopupContainer').style.display = 'block';\r\n\tif (!fixedPosition) { window.scroll(0,0); }\r\n}", "title": "" }, { "docid": "62ab68f4d4a6d22a23832bf6098aec8e", "score": "0.58709246", "text": "function updatePopUpContent(gameState) {\n for (let item of popup.childNodes) {\n switch (item.className) {\n case 'title':\n item.innerText = gameState.title;\n break;\n case 'subtitle':\n item.innerText = gameState.subtitle;\n break;\n case 'button':\n item.innerText = gameState.button;\n break;\n }\n }\n}", "title": "" }, { "docid": "a067a9c41ca9b1c7a3929bce4bf6a0af", "score": "0.58698994", "text": "_buildHtml() {\n $(\"body\").append(\"<div class='overlay_container' >\" +\n \"<div class='overlay' /><div class='overlay_content'>\" +\n \"<img class='overlay_avatar' src='\" +\n this.callee.getAvatarUrl() + \"' />\" +\n \"<span data-i18n='calling' data-i18n-options='\" +\n JSON.stringify({name: this.callee.getName()}) +\n \"' class='overlay_text'>Calling \" +\n this.callee.getName() + \"...</span></div>\" +\n \"<audio id='ring_overlay_ringing' src='/sounds/ring.ogg' /></div>\");\n }", "title": "" }, { "docid": "8a199ec093c81d6b099e457df054da0d", "score": "0.5869411", "text": "function initPopupContent(journeyInfo) {\n\n var $popupInfoHeader = popup.find('.ofp-info');\n var $labelClone;\n var $ctaOtherTickets = popup.find('.other-services [type=submit]');\n var $ctaBuy = popup.find('#ctf-cf [type=submit]');\n var $earlierBtn = popup.find('.ctf-earlier a');\n var $laterBtn = popup.find('.ctf-later a');\n var buyPrice = \"\";\n var buyPriceTemp = \"\";\n var ticketType = \"\";\n var platText = \"\";\n var fBreak = \"\";\n var fBreakVal = \"\";\n var isDetailsPage = false;\n var total = \"\";\n //{\"departureStationName\": \"London Kings Cross\",\"departureStationCRS\": \"KGX\",\"arrivalStationName\": \"Poppleton\",\"arrivalStationCRS\": \"POP\",\"statusMessage\": null,\"departureTime\": \"22:22\",\"arrivalTime\": \"22:22\",\"durationHours\": 2,\"durationMinutes\": 22,\"changes\": 2,\"journeyId\": 1,\"responseId\": 4,\"statusIcon\":\"GREEN_TICK\",\"hoverInformation\": null},\n //London Euston|EUS|10:20|Manchester Piccadilly|MAN|12:28|2|8|0|GREEN_TICK||\n var departureStationName = journeyBreakdown.departureStationName;\n var departureStationCRS = journeyBreakdown.departureStationCRS;\n var arrivalStationName = journeyBreakdown.arrivalStationName;\n var arrivalStationCRS = journeyBreakdown.arrivalStationCRS;\n var breakdownToUse = NRE.fares.breakdownNames.s;\n var fareTicketTypeCSS = \"\";\n var tempFareTicketType = \"\";\n var ticketTypeText = \"\";\n\n if ($(e.target).parents(\".summary-page\").length > 0) {\n //$popupInfoHeader.find(\".ofp-info-inner\").css('display','none');\n }\n\n if ($(e.target).parents(\".summary-page\").length !== 0) {\n $popupInfoHeader.find(\".ofp-info-inner\").css('display', 'none');\n $popupInfoHeader.find(\".ofp-info-inner\").html($(e.target).next(\".popup-content\").find(\".ofp-info-inner\").html());\n } else {\n // From\n platText = $resultsTableRow.find(\".from .ctf-plat\").text();\n $popupInfoHeader.find('p.from').html(departureStationName + ' [<abbr>' + departureStationCRS + '</abbr>]<span class=\"ctf-plat\" title=\"Departs from ' + platText + '\">' + platText + '</span>');\n\n // To\n platText = $resultsTableRow.find(\".to .ctf-plat\").text();\n $popupInfoHeader.find('p.to').html('<span class=\"arrow\"><img height=\"26\" width=\"12\" src=\"' + fcPth.clrImg + '\" class=\"sprite-main\" alt=\"\">' + arrivalStationName + ' [<abbr>' + arrivalStationCRS + '</abbr>]<span class=\"ctf-plat\" title=\"Departs from ' + platText + '\">' + platText + '</span></span>');\n\n // Single ticket price\n if (!isReturnJourney) {\n breakdownToUse = NRE.fares.breakdownNames.s;\n $popupInfoHeader.find('p.price-return').hide().empty();\n\n // Price is not wrapped with SPAN so need to take whole LABEL\n // and remove unnecessary elements before grabbing text\n $labelClone = $resultsTableRow.find('label.opsingle').clone();\n $labelClone.find('.accessibility').remove();\n buyPrice = $labelClone.text();\n ticketType = $(e.target).parent().siblings(\".fare-type\").find(\"a\").text();\n fBreakVal = $resultsTableRow.find('td.fare script');\n if (fBreakVal.length === 0) {\n fBreakVal = $('#jsonJourney');\n }\n fBreak = $.parseJSON(fBreakVal.html());\n\n if (ticketType === \"\") {\n ticketType = $resultsTableRow.find(\"td.fare .fare-type a\").first().text();\n }\n //this condition is used for post-purchase pages & details pages\n if (ticketType === \"\") {\n\n if (fBreak !== null) {\n //if (typeof fBreak[NRE.fares.breakdownNames.s] === 'undefined' && typeof fBreak[NRE.fares.breakdownNames.r] === 'undefined') {\n // breakdownToUse = 'jsonFareBreakdowns';\n // isDetailsPage = true;\n //}\n isDetailsPage = true;\n\n if (fBreak[NRE.fares.breakdownNames.s].length > 0) {\n breakdownToUse = NRE.fares.breakdownNames.s;\n } else {\n breakdownToUse = NRE.fares.breakdownNames.r;\n }\n ticketType = fBreak[breakdownToUse][0].fareTicketType;\n buyPrice = fcPth.uniPound + fBreak[breakdownToUse][0].ticketPrice.toFixed(2);\n }\n\n }\n\n $popupInfoHeader.find('p.price-single').empty().html(\n buyPrice + '<span>' + ticketType + '</span>'\n ).show();\n\n if ($(e.target).parent().siblings(\".fare-type\").find(\"a\").text() === 'Anytime') {\n $('.anytime-ticket-text').css('display', 'none');\n }\n }\n\n // Return ticket price\n else {\n //buyPrice = $resultsTableRow.find('td.fare label[class^=opreturn]').first().text();\n //buyPrice = $(\"#buyNowFooter:not(.buyDis) span\").text().replace(\"Buy now for\", \"\");\n if ($(\"#ctf-results\").hasClass(\"single\")) {\n $labelClone = $resultsTableRow.find('td.fare .single label.[class^=opreturn]').first().clone();\n breakdownToUse = NRE.fares.breakdownNames.s;\n } else {\n $labelClone = $resultsTableRow.find('td.fare .return label.[class^=opreturn]').first().clone();\n breakdownToUse = NRE.fares.breakdownNames.r;\n }\n ticketType = $(e.target).parent().siblings(\".fare-type\").find(\"a\").text();\n if (ticketType === \"\") {\n ticketType = $resultsTableRow.find(\"td.fare .fare-type a\").first().text();\n }\n\n //this condition is used for post-purchase pages & details pages\n if (ticketType === \"\") {\n isDetailsPage = true;\n\n if (fBreak[NRE.fares.breakdownNames.s].length > 0) {\n breakdownToUse = NRE.fares.breakdownNames.s;\n } else {\n breakdownToUse = NRE.fares.breakdownNames.r;\n }\n }\n\n\n $labelClone.find('.accessibility').remove();\n buyPrice = $labelClone.text();\n buyPriceTemp = buyPrice.replace(/\\s/g, \"\");\n fBreakVal = $resultsTableRow.find('td.fare script');\n fBreak = $.parseJSON(fBreakVal.html());\n //if (fBreak !== null) {\n // if (typeof fBreak[NRE.fares.breakdownNames.s] === 'undefined' && fBreak[NRE.fares.breakdownNames.r] === 'undefined') {\n // breakdownToUse = 'jsonFareBreakdowns';\n // }\n //}\n\n\n if (buyPriceTemp === \"\") {\n if (fBreak !== null) {\n if (fBreak[breakdownToUse].length > 0) {\n if (fBreak[breakdownToUse].length >= 2) {\n total = 0;\n for (var i = 0, iLen = fBreak[breakdownToUse].length; i < iLen; i++) {\n var counter = parseFloat(fBreak[breakdownToUse][i].ticketPrice);\n total = total + counter;\n }\n } else {\n total = parseFloat(fBreak[breakdownToUse][0].ticketPrice);\n }\n\n buyPrice = fcPth.uniPound + total.toFixed(2);\n }\n }\n }\n\n tempFareTicketType = fBreak[breakdownToUse][0].fareTicketType;\n ticketTypeText = tempFareTicketType;\n tempFareTicketType = tempFareTicketType.toLowerCase();\n if(tempFareTicketType.indexOf('travelcard') !== -1){\n fareTicketTypeCSS = 'class=\"ic-trvlcrd\"';\n }\n else{\n fareTicketTypeCSS = '';\n }\n\n $popupInfoHeader.find('p.price-return').empty().html(\n // Rewrite price from results table\n buyPrice + '<span ' + fareTicketTypeCSS + ' >' + ticketTypeText + '</span>'\n ).show();\n $popupInfoHeader.find('p.price-single').hide().empty();\n }\n\n if (fBreak !== null) {\n var flexMessage = popup.find(\".other-services-heading p\");\n if (fBreak[breakdownToUse][0].fareTicketType.toLowerCase().lastIndexOf(\"anytime\") > -1) {\n flexMessage.hide();\n } else {\n flexMessage.show();\n }\n }\n\n\n // \"Back to other tickets\" CTA closes popup and triggers click on \"Other tickets\"\n $ctaOtherTickets.unbind('click');\n $ctaOtherTickets.bind('click', function (e) {\n e.preventDefault();\n popup.find('.close-button').trigger('click');\n // Delay to help user notice the animation\n setTimeout(function () {\n $resultsTableRow.find('td.fare .more-fares a').trigger('click');\n }, 150);\n //console.log('hit');\n });\n\n // \"Buy\" CTA closes popup and triggers click on \"Buy\" in the results table\n if ($ctaBuy.length === 0) {\n $ctaBuy.val('Buy for ' + buyPrice);\n } else {\n $ctaBuy.find('span').empty().text('Buy for ' + buyPrice);\n }\n if ($(\"#buyNowFooter\").length > 0 && $labelClone) {\n if (($(\"#buyNowFooter\").hasClass(\"buyDis\") && isReturnJourney) || (!$labelClone.hasClass(\"opreturnselected\") && isReturnJourney)) {\n $ctaBuy.addClass(\"buyDis\");\n $ctaBuy.attr(\"disabled\", true);\n\n } else {\n $ctaBuy.removeClass(\"buyDis\");\n $ctaBuy[0].removeAttribute(\"disabled\");\n }\n } else if (isDetailsPage) {\n $ctaBuy.addClass(\"buyDis\");\n $ctaBuy.attr(\"disabled\", true);\n\n }\n }\n $ctaBuy.unbind('click');\n $ctaBuy.bind('click', function (e) {\n //e.preventDefault();\n popup.find('.close-button').trigger('click');\n $resultsTableRow.find('td.fare label').trigger('click');\n });\n\n // \"Earlier\" button - custom handler will be added\n //$earlierBtn.unbind('click');\n\n // \"Later\" button - custom handler will be added\n //$laterBtn.unbind('click');\n\n }", "title": "" }, { "docid": "65e14b999eba8d92cb660fee55888300", "score": "0.58672327", "text": "function showPopup(){\n /* Close the existing popup, if necessary */\n /* Cross browser solution for event handling from https://stackoverflow.com/questions/9636400/event-equivalent-in-firefox#answer-15164880 */\n var e=arguments[0];\n var el = this;\n /* Stop the onclick from bubbling */\n e.stopPropagation();\n /* And prevent default action for links with @href */\n e.preventDefault();\n /* Declare empty var */\n var useTitle = false;\n var removeEvent = false;\n let personography = document.querySelector('#personography');\n var id = '';\n \n let render = () => {\n if (content == ''){\n var dummyDiv = document.createElement('div');\n dummyDiv.setAttribute('class','para');\n dummyDiv.innerHTML = 'This popup is not available.';\n content = dummyDiv;\n }\n console.log(typeof content);\n popupContent.appendChild(content);\n makeNamesResponsive(content);\n if (!(useTitle)){\n popup.setAttribute('data-showing',id);\n }\n //And set the display to block\n popup.classList.remove('hidden');\n popup.setAria('hidden', 'true');\n popup.classList.add('showing');\n popup.setAria('hidden','false');\n this.classList.add('clicked');\n }\n \n \n /* If this is an annotation and the annotation button is checked */\n /* Sometimes the annotation/collation buttons aren't there (if, for instance, there are no collations in the document)\n * and we have to have a switch for that */\n var place;\n var popup = document.getElementById('popup');\n if (this.classList.contains('noteMarker')){\n id = this.getAttribute('href').substring(1);\n } else if (this.classList.contains('toolbar_item')){\n id = this.getAttribute('href').substring(1);\n popup.classList.add('toolbar');\n }\n /* Else if this is a name element and it has an @href that is a local pointer */\n else if (this.getAttribute('data-el') == 'name' && this.getAttribute('href').startsWith('#')){\n id=this.getAttribute('href').substring(1);\n } else if (this.getAttribute('data-el') == 'ref' && this.getAttribute('data-type') == 'bibl' && this.getAttribute('href').startsWith('#')){\n id=this.getAttribute('href').substring(1);\n }\n else if (this.getAttribute('data-el') == 'org' && this.getAttribute('href').startsWith('#')){\n id = this.getAttribute('href').substring(1);\n } else if ((this.getAttribute('data-el') == 'org' || this.getAttribute('data-el') == 'name') && this.getAttribute('data-ref').startsWith('#')){\n id = this.getAttribute('data-ref').substring(1)\n }\n \n else if (this.getAttribute('title') && !(this.getAttribute('href'))){\n useTitle = true;\n }\n /* Otherwise, return */\n else{\n console.log ('ERROR: This element does not have a popup; removing the click event');\n removeEvent = true;\n }\n \n \n\n var popupContent = document.getElementById('popup_content');\n var showing = popup.getAttribute('data-showing');\n\n \n if (popup.classList.contains('showing')){\n closePopup();\n console.log('I should close...'); \n }\n var content;\n if (useTitle){\n var dummyDiv = document.createElement('div');\n let header = document.createElement('h4');\n let para = document.createElement('div');\n para.setAttribute('class','para');\n para.setAttribute('data-el','p');\n header.innerHTML = \"Textual Note\";\n dummyDiv.appendChild(header);\n dummyDiv.appendChild(para);\n para.innerHTML = this.getAttribute('title');\n content = dummyDiv;\n popup.classList.add('textual-note');\n } else if (this.classList.contains('noteMarker') && !(id == '')){\n var thisThing = document.getElementById(id);\n var clone = thisThing.cloneNode(true);\n var heading = document.createElement('h4');\n heading.innerHTML = \"Editorial Note\";\n clone.prepend(heading);\n popup.classList.add('editorial-note');\n content = clone;\n } else if (!(id == '') && this.classList.contains('toolbar_item')){\n let header = document.createElement('h4');\n let parId = this.parentNode.getAttribute('id');\n let headingText;\n if (parId === 'tools_cite'){\n headingText = 'Cite this Page';\n } else if (parId === 'tools_toc'){\n headingText = \"Table of Contents\"\n } else {\n headingText = this.querySelector('div.label').innerHTML;\n }\n header.innerHTML = headingText;\n let thisThing = document.getElementById(id);\n var clone = thisThing.cloneNode(true);\n clone.prepend(header);\n content = clone;\n \n \n } else if (!(id == '') && document.getElementById(id)){\n let thisThing = document.getElementById(id);\n let clone = thisThing.cloneNode(true);\n content = clone;\n \n } else{\n fetch('ajax/'+ id + '.html')\n .then(html => html.text())\n .then(result => {\n personography.insertAdjacentHTML('beforeEnd', result);\n content = personography.querySelector('#' + id).cloneNode(true);\n render();\n return;\n })\n .catch(e => {\n console.log(\"Couldn't find the popup: \" + e.message);\n content = '';\n });\n } \n \n document.getElementsByTagName('body')[0].classList.toggle(\"overlay\");\n render();\n }", "title": "" }, { "docid": "4807c6180be488f4fdd93a01786dc841", "score": "0.5866868", "text": "function openModal() {\n modalPopup.style.display = \"block\";\n modalContainer.innerHTML = `<h3>Congratulations! You won!</h3>\n <p>With ${moves} moves in ${timeContainer.innerHTML} and ${stars.innerHTML} Stars. You rock!</p>\n <span class=\"closeBtn\" onclick=\"closeModal();\">&times;</span>`;\n}", "title": "" }, { "docid": "b19cd04acfe5b01160253ec0dba0203f", "score": "0.5863125", "text": "function displayWebContent(type, title, data) {\n var marTop = 70;\n var marHeight = 89;\n var res = 73;\n var topbar = '';\n var fsData = '';\n // if this is a URL\n if (type == 2) {\n topbar = '<div style=\"float:right;margin-top:2px\"><button type=\"submit\" class=\"btn danger\" style=\"font-size:10px;font-weight:bolder\" onclick=\"destroyWebContent()\">Close</button></div><div class=\"alert-message elem\" style=\"width:410px;font-size:12px;padding:1px;padding-left:5px;margin-top:4px\"><div class=\"descTip\" style=\"float:right;margin:0;padding:0;margin-top:-1px\" data-original-title=\"Open in new window\"><a href=\"' + data + '\" target=\"_blank\" onClick=\"destroyWebContent();$(\\'.twipsy\\').remove();\"><img src=\"/assets/app/img/box/expand.png\" /></a></div><div style=\"line-height:1;margin-top:3px;width:380px;overflow:hidden;height:12px;\">' + title + '</div></div></div>';\n\n fsData = '<iframe allowtransparency=\"true\" frameborder=\"0\" id=\"webframe\" class=\"webConLoader\" scrolling=\"auto\" src=\"' + data + '\" style=\"width:100%;height:100%\"></iframe>';\n\n // embed\n } else if (type == 3) {\n topbar = '<div style=\"float:right;margin-top:2px\"><button type=\"submit\" class=\"btn danger\" style=\"font-size:10px;font-weight:bolder\" onclick=\"destroyWebContent()\">Close</button></div><div class=\"alert-message elem\" style=\"width:410px;font-size:12px;padding:1px;padding-left:5px;margin-top:4px\"><div style=\"line-height:1;margin-top:3px;width:380px;overflow:hidden;height:12px;\">' + title + '</div></div></div>';\n\n fsData = '<center>' + data + '</center>';\n\n\n // google doc\n } else if (type == 5) {\n topbar = '<div style=\"float:right;margin-top:2px\"><button type=\"submit\" class=\"btn danger\" style=\"font-size:10px;font-weight:bolder\" onclick=\"destroyWebContent()\">Close</button></div><div class=\"alert-message elem\" style=\"width:410px;font-size:12px;padding:1px;padding-left:5px;margin-top:4px\"><div class=\"descTip\" style=\"float:right;margin:0;padding:0;margin-top:-1px\" data-original-title=\"Open in new window\"><a href=\"' + data + '\" target=\"_blank\" onClick=\"destroyWebContent();$(\\'.twipsy\\').remove();\"><img src=\"/assets/app/img/box/expand.png\" /></a></div><div style=\"line-height:1;margin-top:3px;width:380px;overflow:hidden;height:12px;\">' + title + '</div></div></div>';\n\n fsData = '<iframe allowtransparency=\"true\" frameborder=\"0\" id=\"webframe\" class=\"webConLoader\" scrolling=\"auto\" src=\"' + data + '\" style=\"width:100%;height:100%\"></iframe>';\n\n\n }\n $(\"#mainContent\").hide();\n $(\"#mainNavBar\").after('<div id=\"webControls\" class=\"topbar\" style=\"top:40px; z-index:1000\"> <div class=\"fill\"> <div class=\"container\" style=\"height:30px\">' + topbar + '</div> </div>');\n\n $('body').append('<div class=\"fullscreenContent\" style=\"top:' + marTop + 'px;height:' + marHeight + '%\">' + fsData + '</div>');\n resizeWebContent(res);\n $(window).resize(function(){\n resizeWebContent(res);\n });\n}", "title": "" }, { "docid": "db954941471ae14ce14851ed80c66cfa", "score": "0.5859863", "text": "function get_content_preview(content)\n{\n\tajax('post', 'ajax.php?type=block&module=Content', 'content='+content,\n\t\tfunction(ajaxobj) {\n\t\t\t$('content-preview').parentNode.style.display = 'block';\n\t\t\t$('content-preview').innerHTML = ajaxobj.responseText;\n\t\t}\n\t);\n}", "title": "" }, { "docid": "d794d768d1a932e7daeeb0627b33d62b", "score": "0.58539987", "text": "function popup(content) {\n var winTop = screen.height / 2 - 250;\n var winLeft = screen.width / 2 - 250;\n window.open(\n content,\n \"_blank\",\n \"width=500,height=500,top=\" + winTop + \",left=\" + winLeft\n );\n}", "title": "" }, { "docid": "7181298fa45e82d87b0d7427b9dac65f", "score": "0.5853799", "text": "function showPopUp(){\n\tapp.getView().render('test/popup');\n}", "title": "" }, { "docid": "24f2033360d8daea8a8b39a4f4312981", "score": "0.5843773", "text": "function createPopupContent(properties, attribute){\n\n // variable is equal to a string and the property in the data that relates to it\n var popupContent = \"<p><b>Prefecture:</b> \" + properties.Prefecture + \"</p>\";\n\n // variable to get year columns, split at the underscore to just have the numbers\n var year = attribute.split(\"_\")[1];\n\n // appending string with year variable and population attribute to the popupcontent variable\n popupContent += \"<p><b>Population in \" + year + \":</b> \" + properties[attribute] + \" people</p>\";\n\n //returns the variable\n return popupContent;\n}", "title": "" }, { "docid": "83d2b6bd06ba980fa29d41528029700e", "score": "0.5843432", "text": "function setPopupContent(marker) {\n //contents of popup window\n if (marker.options.type === \"Router\")\n var content = '<span><p><strong>Location:</strong><br>' + marker.options.city +\n ', ' + marker.options.stateprov +\n ', ' + marker.options.country + '</p>' +\n '</span>';\n else {\n var content = '<span><p><strong>Location:</strong><br>' + marker.options.city +\n ', ' + marker.options.stateprov +\n ', ' + marker.options.country + '</p>' +\n '</span>';\n }\n //compile the html into angular-ready HTML\n var linkFunction = $compile(angular.element(content));\n marker.bindPopup(linkFunction($scope)[0], {offset: new L.Point(0, -10)});\n\n return marker;\n }", "title": "" }, { "docid": "2fd07dec922d6c1f0e5e0ee3e0e2a8d3", "score": "0.5842361", "text": "function PopupContent(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n var classes = (0, _classnames.default)('content', className);\n var rest = (0, _lib.getUnhandledProps)(PopupContent, props);\n var ElementType = (0, _lib.getElementType)(PopupContent, props);\n return _react.default.createElement(ElementType, (0, _extends2.default)({}, rest, {\n className: classes\n }), _lib.childrenUtils.isNil(children) ? content : children);\n}", "title": "" }, { "docid": "ba30d11907306179336e073b9c47dff4", "score": "0.5840088", "text": "function popupmessage(content) {\n printdebug(content);\n}", "title": "" }, { "docid": "6493ec8e43c6ed28cb0a9e37cc626e02", "score": "0.5839693", "text": "function intakeContent(feature) {\n var in_comid = feature.properties.COMID;\n var in_sourceName = feature.properties.SourceName;\n var in_systemName = feature.properties.SystemName;\n var e1 = document.createElement('div');\n e1.classList.add(\"intake_popup\");\n e1.innerHTML = '<h3> <strong> Drinking water intake </strong></h3>';\n e1.innerHTML += '<strong>COMID #: </strong>' + in_comid + '<br><strong>' + 'Source: </strong>' + in_sourceName;\n e1.innerHTML += '<br><strong>' + 'System: </strong>' + in_systemName;\n return e1;\n\n}", "title": "" }, { "docid": "b38da32c33b5e3f8496e540bff5dc21b", "score": "0.5836276", "text": "function wppaFullPopUp(mocc, id, url, xwidth, xheight, ajaxurl) {\r\n\tvar height = xheight+50;\r\n\tvar width = xwidth+14;\r\n\tvar name = '';\r\n\tvar desc = '';\r\n\t\r\n\tvar elm = document.getElementById('i-'+id+'-'+mocc);\r\n\tif (elm) {\r\n\t\tname = elm.alt;\r\n\t\tdesc = elm.title;\r\n\t}\t\r\n\t\r\n\tvar wnd = window.open('', 'Print', 'width='+width+', height='+height+', location=no, resizable=no, menubar=yes ');\r\n\twnd.document.write('<html>');\r\n\t\twnd.document.write('<head>');\t\r\n\t\t\twnd.document.write('<style type=\"text/css\">body{margin:0; padding:6px; background-color:'+wppaBackgroundColorImage+'; text-align:center;}</style>');\r\n\t\t\twnd.document.write('<title>'+name+'</title>');\r\n\t\t\twnd.document.write(\r\n\t\t\t'<script type=\"text/javascript\">function wppa_downl(id){'+\r\n\t\t\t\t'var xmlhttp = new XMLHttpRequest();'+\r\n\t\t\t\t'var url = \"'+ajaxurl+'?action=wppa&wppa-action=makeorigname&photo-id='+id+'&from=popup\";'+\r\n\t\t\t\t'xmlhttp.open(\"GET\",url,false);'+\r\n\t\t\t\t'xmlhttp.send();'+\r\n\t\t\t\t'if (xmlhttp.readyState==4 && xmlhttp.status==200) {'+\r\n\t\t\t\t\t'var result = xmlhttp.responseText.split(\"||\");'+\r\n\t\t\t\t\t'if (result[1] == \"0\") {'+\r\n\t\t\t\t\t\t'window.open(result[2]);'+\r\n\t\t\t\t\t\t'return true;'+\r\n\t\t\t\t\t'}'+\r\n\t\t\t\t\t'else {'+\r\n\t\t\t\t\t\t'alert(\"Error: \"+result[1]+\" \"+result[2]);'+\r\n\t\t\t\t\t\t'return false;'+\r\n\t\t\t\t\t'}'+\r\n\t\t\t\t'}'+\r\n\t\t\t\t'else {'+\r\n\t\t\t\t\t'alert(\"Comm error encountered\");'+\r\n\t\t\t\t\t'return false;'+\r\n\t\t\t\t'}'+\r\n\t\t\t'}</script>');\r\n\t\t\twnd.document.write(\r\n\t\t\t'<script type=\"text/javascript\">function wppa_print(){'+\r\n\t\t\t\t'document.getElementById(\"wppa_printer\").style.visibility=\"hidden\"; '+\r\n\t\t\t\t'document.getElementById(\"wppa_download\").style.visibility=\"hidden\"; '+\r\n\t\t\t\t'window.print();'+\r\n\t\t\t'}</script>');\r\n\t\twnd.document.write('</head>');\r\n\t\twnd.document.write('<body>');\r\n\t\t\twnd.document.write('<div style=\"width:'+xwidth+'px;\">');\r\n\t\t\t\twnd.document.write('<img src=\"'+url+'\" style=\"padding-bottom:6px;\" /><br/>');\r\n\t\t\t\twnd.document.write('<div style=\"text-align:center\">'+desc+'</div>');\r\n\t\t\t\tvar left = xwidth-66;\r\n\t\t\t\twnd.document.write('<img src=\"'+wppaImageDirectory+'download.png\" id=\"wppa_download\" title=\"Download\" style=\"position:absolute; top:6px; left:'+left+'px; background-color:'+wppaBackgroundColorImage+'; padding: 2px; cursor:pointer;\" onclick=\"wppa_downl();\" />');\r\n\t\t\t\tleft = xwidth-30;\r\n\t\t\t\twnd.document.write('<img src=\"'+wppaImageDirectory+'printer.png\" id=\"wppa_printer\" title=\"Print\" style=\"position:absolute; top:6px; left:'+left+'px; background-color:'+wppaBackgroundColorImage+'; padding: 2px; cursor:pointer;\" onclick=\"wppa_print();\" />');\r\n\t\t\twnd.document.write('</div>');\r\n\t\twnd.document.write('</body>');\r\n\twnd.document.write('</html>');\r\n}", "title": "" }, { "docid": "19c46488bc8a98866c5855faf3d3a8ee", "score": "0.5835602", "text": "function showpopup()\r\n{\r\n\tisOpened=true; //set the flag \r\n\tvar target=\"#popupContainer\";\r\n\tvar popupWidth=$(\".popup\").width(); //get the width of the popup window\t\r\n\t//set the popup position\r\n\t$(target).css(\r\n\t{\r\n\t\ttop:(popupPosTop/2)*0.9,\r\n\t\tleft:popupPosLeft-popupWidth/2\r\n\t});\r\n\t//animation to show the popup, like scaling effect from 0 to designated width\r\n\t$(target).css(\"display\",\"block\");\r\n\t$(target).width(0);\r\n\t$(target).height(0);\r\n\t$(target).animate(\r\n\t{\r\n\t\twidth:popupWidth,\r\n\t\theight:450\r\n\t});\r\n\tcenter(); //meke the buttons always display on the center\r\n\t$(\"#termScrollbar\").tinyscrollbar(); //initiate the scroll bar in terms panel !!!important\r\n}", "title": "" }, { "docid": "965bc01d2cafb09718b7355e9c793ea7", "score": "0.583245", "text": "function addContentToPopUp(popup, profURL, responseText) {\r var tmp = document.createElement('div');\r tmp.innerHTML = responseText;\r console.log(\"test1\");\r\r //check if professor has any reviews\r //if they have no reviews then just display the professor not found popup\r if (tmp.getElementsByClassName('pfname').length == 0) {\r var emptyPopup = popup;\r emptyPopup.className = 'notFoundPopup';\r var notFound = document.createElement('div');\r var idk = document.createElement('div');\r notFound.className = 'heading';\r idk.className = 'idk';\r notFound.innerText = \"Professor not found\";\r idk.innerText = \"¯\\\\_(ツ)_/¯\";\r emptyPopup.innerHTML = '';\r emptyPopup.appendChild(notFound);\r emptyPopup.appendChild(idk);\r return;\r }\r\r var proffName = tmp.getElementsByClassName('pfname')[0].innerText;\r var proflName = tmp.getElementsByClassName('plname')[0].innerText;\r var ratingInfo = tmp.getElementsByClassName('left-breakdown')[0];\r var numRatings = tmp.getElementsByClassName('table-toggle rating-count active')[0].innerText;\r tmp.innerHTML = ratingInfo.innerHTML;\r\r //get the raw rating data\r var ratings = tmp.getElementsByClassName('grade');\r\r var scale = \" / 5.0\";\r var overall = ratings[0];\r var wouldTakeAgain = ratings[1];\r var difficulty = ratings[2];\r tmp.remove();\r\r //create the ratings divs\r var profNameDiv = document.createElement('div');\r var overallDiv = document.createElement('div');\r var overallTitleDiv = document.createElement('div');\r var overallTextDiv = document.createElement('div');\r var wouldTakeAgainDiv = document.createElement('div');\r var wouldTakeAgainTitleDiv = document.createElement('div');\r var wouldTakeAgainTextDiv = document.createElement('div');\r var difficultyDiv = document.createElement('div');\r var difficultyTitleDiv = document.createElement('div');\r var difficultyTextDiv = document.createElement('div');\r var numRatingsDiv = document.createElement('div');\r\r //assign class names for styling\r profNameDiv.className = 'heading';\r overallDiv.className = 'overall';\r overallTitleDiv.className = 'title';\r overallTextDiv.className = 'text';\r wouldTakeAgainDiv.className = 'would_take_again';\r wouldTakeAgainTitleDiv.className = 'title';\r wouldTakeAgainTextDiv.className = 'text';\r difficultyDiv.className = 'difficulty';\r difficultyTitleDiv.className = 'title';\r difficultyTextDiv.className = 'text';\r numRatingsDiv.className = 'numRatings';\r\r //put rating data in divs\r profNameDiv.innerHTML = proffName + \" \" + proflName; //'<a href=\"' + profURL + '\" target=\"_blank\">' + proffName + \" \" + proflName + '</a>';\r overallTitleDiv.innerText = 'Overall Quality';\r overallTextDiv.innerText = overall.innerHTML.trim().concat(scale);\r wouldTakeAgainTitleDiv.innerText = 'Would Take Again';\r wouldTakeAgainTextDiv.innerText = wouldTakeAgain.innerHTML.trim();\r difficultyTitleDiv.innerText = 'Difficulty';\r difficultyTextDiv.innerText = difficulty.innerHTML.trim().concat(scale);\r\r numRatings = numRatings.slice(9).split(' ')[0] //check to see if \"ratings\" is singular or plural\r if (numRatings == '1') {\r numRatingsDiv.innerHTML = '<a href=\"' + profURL + '\" target=\"_blank\">' + numRatings + ' rating</a>';\r } else {\r numRatingsDiv.innerHTML = '<a href=\"' + profURL + '\" target=\"_blank\">' + numRatings + ' ratings</a>';\r }\r\r popup.innerHTML = ''; //remove 'loading...' text\r\r //add divs to popup\r overallTitleDiv.appendChild(overallTextDiv);\r overallDiv.appendChild(overallTitleDiv);\r wouldTakeAgainTitleDiv.appendChild(wouldTakeAgainTextDiv);\r wouldTakeAgainDiv.appendChild(wouldTakeAgainTitleDiv);\r difficultyTitleDiv.appendChild(difficultyTextDiv);\r difficultyDiv.appendChild(difficultyTitleDiv);\r\r popup.appendChild(profNameDiv);\r popup.appendChild(overallDiv);\r popup.appendChild(wouldTakeAgainDiv);\r popup.appendChild(difficultyDiv);\r popup.appendChild(numRatingsDiv);\r}", "title": "" }, { "docid": "ec6e225129762a7179d88e9bbaad9d41", "score": "0.5827782", "text": "function PopupContent(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n var classes = classnames__WEBPACK_IMPORTED_MODULE_1___default()('content', className);\n var rest = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getUnhandledProps\"])(PopupContent, props);\n var ElementType = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getElementType\"])(PopupContent, props);\n return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(ElementType, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, rest, {\n className: classes\n }), _lib__WEBPACK_IMPORTED_MODULE_4__[\"childrenUtils\"].isNil(children) ? content : children);\n}", "title": "" }, { "docid": "ec6e225129762a7179d88e9bbaad9d41", "score": "0.5827782", "text": "function PopupContent(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n var classes = classnames__WEBPACK_IMPORTED_MODULE_1___default()('content', className);\n var rest = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getUnhandledProps\"])(PopupContent, props);\n var ElementType = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getElementType\"])(PopupContent, props);\n return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(ElementType, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, rest, {\n className: classes\n }), _lib__WEBPACK_IMPORTED_MODULE_4__[\"childrenUtils\"].isNil(children) ? content : children);\n}", "title": "" }, { "docid": "ec6e225129762a7179d88e9bbaad9d41", "score": "0.5827782", "text": "function PopupContent(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n var classes = classnames__WEBPACK_IMPORTED_MODULE_1___default()('content', className);\n var rest = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getUnhandledProps\"])(PopupContent, props);\n var ElementType = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getElementType\"])(PopupContent, props);\n return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(ElementType, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, rest, {\n className: classes\n }), _lib__WEBPACK_IMPORTED_MODULE_4__[\"childrenUtils\"].isNil(children) ? content : children);\n}", "title": "" }, { "docid": "10a29e0ad2136c689a6a7282c3cf38f4", "score": "0.58231467", "text": "function PopupContent(props) {\n var children = props.children,\n className = props.className;\n\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()('content', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"q\" /* getUnhandledProps */])(PopupContent, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"p\" /* getElementType */])(PopupContent, props);\n\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n children\n );\n}", "title": "" }, { "docid": "1de8496fb6d8eaa19261753a320a4b67", "score": "0.58223605", "text": "function _buildDialogContents(params) {\n\t\tvar btDialog = params.dialog;\n\t\tvar dialogDef = params.dialogDef;\n\t\t\n\t\tvar labels = new Array();\n\t\tvar textMessages = new Array();\n\t\t\n\t\tvar elementCollex = dialogDef.dialogElementCollections;\n\t\t\n\t\tfor(var i in elementCollex) {\n\t\t\tif(elementCollex.hasOwnProperty(i)) {\n\t\t\t\t_buildCollection(btDialog,elementCollex[i],labels,textMessages);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Text blocks (i.e. text messages) and labels have to be added\n\t\t// after the primary portions of the Dialog's DOM are done,\n\t\t// so that they can be placed appropriately\n\t\t\n\t\tDojoArray.forEach(textMessages,function(message){\n\t\t\t_addTextBlock(message);\n\t\t});\n\t\t\n\t\tDojoArray.forEach(labels,function(label){\n\t\t\t_makeLabel(label);\n\t\t});\n\t\t\n\t\t// Non-'PLAIN' dialogs often have an icon associated with them\n\t\tif(dialogDef.dialogType && dialogDef.dialogType !== \"PLAIN\") {\n\t\t\t_insertDialogIcon(btDialog,dialogDef.dialogType);\n\t\t}\n\t\t\n\t\t// Finalize the Dialog\n\t\tbtDialog.startup();\n\t\t\n\t\tif(btDialog.open) {\n\t\t\tbtDialog.emit(\"started\",{bubbles: true, cancelable: true});\n\t\t}\n\n\t\t// If any elements are turned on or off via element-specific stating events,\n\t\t// we will need to register them with the ElementConditions model for watching\n\t\tif(dialogDef.defaultConditionStates) {\n\t\t\trequire([\"models/conditions/ElementConditions\"],function(BTElemConditions){\n\t\t\t\tDojoArray.forEach(dialogDef.defaultConditionStates,function(state){\n\t\t\t\t\tutils.stringToBool(state);\n\t\t\t\t\tBTElemConditions.set(state.conditionName,state.conditionValue);\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t\t\n\t\treturn btDialog;\n\t}", "title": "" }, { "docid": "2eb43cb1b567ed13b77f1002e1e0accc", "score": "0.58204335", "text": "function showContent() {\n\t// Randomise number of tiles to show in demo\n\tvar $totTiles=1+Math.floor(Math.random()*6);\n\tfor (var $counter = 0; $counter < $totTiles; $counter++) {\n\t\tvar $rndSize=1+Math.floor(Math.random()*2);\t\n\t\tswitch($rndSize) {\n\t\t\tcase 1:\tplay_soundclound();\n\t\t\t\t\t\tbreak;\n\t\t\tcase 2:\tplay_places();\n\t\t\t\t\t\tbreak;\n\t\t}\n\t}\n\t// Content Scroll\n\t$goScroll = parseInt($(document).height());\n\t$(\"html, body\").animate({ scrollTop:$goScroll }, 10000);\n}", "title": "" }, { "docid": "d2a01a8101dc332c99121c2d1dd1fdd2", "score": "0.58080727", "text": "onClick() {\n Popup.open();\n Popup.addTitle(\"Custom Gate Information\");\n Popup.addSpace();\n Popup.addText(this.string);\n Popup.addDoneButton(Popup.close);\n }", "title": "" }, { "docid": "776513daf415f0c0dc5a208ab293c2f0", "score": "0.5805476", "text": "function PopupContent(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n\n var classes = classnames__WEBPACK_IMPORTED_MODULE_1___default()('content', className);\n var rest = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getUnhandledProps\"])(PopupContent, props);\n var ElementType = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getElementType\"])(PopupContent, props);\n\n return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(\n ElementType,\n babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, rest, { className: classes }),\n _lib__WEBPACK_IMPORTED_MODULE_4__[\"childrenUtils\"].isNil(children) ? content : children\n );\n}", "title": "" }, { "docid": "6861e972d1482a537e1388eb0d8bfeea", "score": "0.5805354", "text": "function showDialog() {\n\t\tvar style, template,\n\t\t\tdialog = $(\"#magicdialog\");\n\n\t\tfor (var k in dialog_style) { \n\t\t\tif ( dialog_style.hasOwnProperty(k) ) {\n\t\t\t\tstyle += k + ':' + dialog_style[k] + ';';\n\t\t\t}\n\t\t}\n\n\t\ttemplate = \"<div id='magicdialog' style='\" + style + \"'><div style='text-align: right'><a id='closemagicdialog' href='#'>[ close ]</a></div><div id='magiccontent' style='padding-top: 15px; line-height: 1.3em;'>Content Here</div></div>\";\n\n\t\tif (dialog.length) {\n\t\t\tdialog.css('display', 'block');\n\t\t\tdialog.html($(template).html());\n\t\t} else {\n\t\t\t$('body').append(template);\n\t\t}\n\t\t$('#closemagicdialog').click(hideDialog);\n\n\t\treturn $('#magiccontent');\n\t}", "title": "" }, { "docid": "962c9b851327b8857e2423bb2fbf9752", "score": "0.57993966", "text": "function buildPopupContentUpdate(){\n\tvar shouldCreateView = updaterPopupBackgroundImage == null;\n\tif(shouldCreateView){\n\t\t//popup background\n\t\tupdaterPopupBackgroundImage = Ti.UI.createImageView({\n\t\t\timage:IPHONE5? IMAGE_PATH+'updater/newcontent_background-568h@2x.png' : IMAGE_PATH+'updater/newcontent_background.png',\n\t\t\ttransform:SCALE_ZERO,\n\t\t\tzIndex:10\n\t\t});\n\t\t\n\t\tupdaterPopupLabel1 = Ti.UI.createLabel({\n\t\t\ttext:'Νέες ερωτήσεις!',\n\t\t\tcolor:'white',\n\t\t\ttextAlign:'center',\n\t\t\twidth:150,\n\t\t\tfont:{fontSize:20, fontWeight:'bold', fontFamily:'Myriad Pro'},\n\t\t\ttop:IPHONE5? 205:165\n\t\t});\n\t\t\n\t\tupdaterPopupLabel2 = Ti.UI.createLabel({\n\t\t\ttext:'Έχουμε νέο υλικό για ακόμα περισσότερο παιχνίδι!',\n\t\t\tcolor:'white',\n\t\t\ttextAlign:'center',\n\t\t\twidth:190,\n\t\t\tfont:{fontSize:15, fontWeight:'regular', fontFamily:'Myriad Pro'},\n\t\t\ttop:IPHONE5? 240:200\n\t\t});\n\t\t\n\t\tupdaterPopupLabel3 = Ti.UI.createLabel({\n\t\t\ttext:'Πάμε τώρα?',\n\t\t\tcolor:'white',\n\t\t\ttextAlign:'center',\n\t\t\twidth:150,\n\t\t\tfont:{fontSize:15, fontWeight:'regular', fontFamily:'Myriad Pro'},\n\t\t\ttop:IPHONE5? 290:250\n\t\t});\n\t\t\n\t\tupdaterPopupLabel4 = Ti.UI.createLabel({\n\t\t\ttext:'ή λίγο αργότερα?',\n\t\t\tcolor:'white',\n\t\t\ttextAlign:'center',\n\t\t\twidth:190,\n\t\t\tfont:{fontSize:15, fontWeight:'regular', fontFamily:'Myriad Pro'},\n\t\t\ttop:IPHONE5? 365:325\n\t\t});\n\t\t\n\t\tupdaterPopupDownloadButton = Ti.UI.createImageView({\n\t\t\timage:IMAGE_PATH+'updater/button_download.png',\n\t\t\ttop:IPHONE5? 310:270\n\t\t});\n\t\t\n\t\tupdaterPopupCloseButton = Ti.UI.createImageView({\n\t\t\timage:IMAGE_PATH+'updater/button_no.png',\n\t\t\ttop:IPHONE5? 385:345\n\t\t});\n\t\t\n\t\tupdaterPopupReadyButton = Ti.UI.createImageView({\n\t\t\timage:IMAGE_PATH+'updater/button_ready.png',\n\t\t\ttop:IPHONE5? 290:250,\n\t\t\tvisible:false\n\t\t});\n\t\t\n\t\tupdaterPopupBackgroundImage.add(updaterPopupLabel1);\n\t\tupdaterPopupBackgroundImage.add(updaterPopupLabel2);\n\t\tupdaterPopupBackgroundImage.add(updaterPopupLabel3);\n\t\tupdaterPopupBackgroundImage.add(updaterPopupLabel4);\n\t\tupdaterPopupBackgroundImage.add(updaterPopupDownloadButton);\n\t\tupdaterPopupBackgroundImage.add(updaterPopupCloseButton);\n\t\tupdaterPopupBackgroundImage.add(updaterPopupReadyButton);\n\t\t\n\t\t//Event handlers\n\t\tupdaterPopupCloseButton.addEventListener('click', closePopupContentUpdate);\n\t\tupdaterPopupDownloadButton.addEventListener('click', downloadUpdate);\n\t\tupdaterPopupReadyButton.addEventListener('click', closePopupContentUpdateAfterDownload);\n\t\t//Add it to the categories view\n\t\tview.add(updaterPopupBackgroundImage);\n\t\t\n\t\t//Animate the updater background image\n\t\tupdaterPopupBackgroundImage.animate({transform:SCALE_ONE, duration:400});\n\t} else {\n\t\tTi.API.warn('NOT building UpdatePopup view - already in progress');\n\t}\n\t\n}", "title": "" }, { "docid": "ff1ea27860c33e8dacf819db678d4284", "score": "0.57935363", "text": "function buildCongratsModal() {\n const page = document.getElementsByClassName(\"container\");\n const popup = document.createElement(\"div\");\n popup.className = \"congratsPopup hidden\";\n popup.innerHTML = \"\";\n page[0].appendChild(popup);\n}", "title": "" }, { "docid": "abc7d18b1834a9178723624afb219c25", "score": "0.5783617", "text": "function popup(CompanyName){\n\tvar CompanyDesc;\n\tfor (var i = 0; i < Employment.length; i++) {\n\t\tif(Employment[i]['CompanyName'] == CompanyName){\n\t\t\tCompanyDesc = Employment[i]['Description'];\n\t\t\tbreak;\n\t\t}\n\t};\n\tvar popupbox = document.getElementById('popup');\n\tpopupbox.childNodes[1].innerText = CompanyName;\n\tpopupbox.childNodes[5].innerText = CompanyDesc;\n\tpopupbox.style.display = 'block';\n}", "title": "" }, { "docid": "14b915219b26c707fa31a0981eb659ef", "score": "0.57750446", "text": "function getContentWindow() {\n return content;\n}", "title": "" }, { "docid": "28ccfc688222ab3eafa9d3aef9a5af6e", "score": "0.57609606", "text": "function PopupContent(props) {\n var children = props.children,\n className = props.className;\n\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()('content', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"p\" /* getUnhandledProps */])(PopupContent, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"o\" /* getElementType */])(PopupContent, props);\n\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n children\n );\n}", "title": "" }, { "docid": "3e10396bfbd73716a38fd7eeb289ac29", "score": "0.5754843", "text": "function fillMenu(asyncRequest, category) {\n if (asyncRequest.readyState == 4 && asyncRequest.status == 200) {\n var size = parseInt(asyncRequest.responseText);\n var out = document.getElementById(category + \"_contents\").innerHTML;\n for (var i = 0; i < size; i++) {\n out += \"<div class='item'>\";\n out += \" <h2 id='\" + category + \"_name\" + i + \"' class='item_text'></h2>\";\n out += \" <img class='item-img' id ='\" + category + \"_image\" + i + \"' src='https:/i.ibb.co/GnmmtjX/jalapeno-poppers-11.jpg'>\";\n out += \" <div id='\" + category + \"_popup\" + i + \"' class=' desc-popup animate box'>\";\n out += \" <button onclick='closeDescPopup(\\\"\" + category + \"\\\", \" + i + \")' style='float:right'> X </button>\";\n out += \" <p id='\" + category + \"_desc\" + i + \"' style=\\\"text-align:center\\\"></p>\";\n out += \" <p id='\" + category + \"_allergies\" + i + \"' style='text-align:center; font-weight:bold'></p>\";\n out += \" <p id='\" + category + \"_calories\" + i + \"' style='text-align:center; font-weight:bold'></p>\";\n out += \" </div>\";\n out += \" <p id='\" + category + \"_price\" + i + \"' style='text-align:center; font-weight:bold' ></p>\";\n out += \" <button id='\" + category + \"_additem\" + i + \"' class='add_button'>add</button>\";\n out += \" <button id=\\\"desc\\\" class='more_info' onclick='openDescPopup(\\\"\" + category + \"\\\", \" + i + \")'>?</button>\";\n out += \"</div>\";\n getItemCategory(category + \"_name\" + i, i, \"name\", category);\n getItemCategory(category + \"_desc\" + i, i, \"desc\", category);\n getItemCategory(category + \"_price\" + i, i, \"price\", category, \"£\");\n getItemCategory(category + \"_allergies\" + i, i, \"allergies\", category, \"Allergies: \");\n getItemCategory(category + \"_calories\" + i, i, \"calories\", category, \"Calories: \");\n }\n document.getElementById(category + \"_contents\").innerHTML = out;\n for (var i = 0; i < size; i++) {\n setAddButton(category + \"_additem\" + i, i, category);\n setImage(category + \"_image\" + i, i, category);\n }\n }\n}", "title": "" }, { "docid": "903484375b867fcda7e7d6d98e3a6e75", "score": "0.5752824", "text": "showModalContent() {\n\t\tvar modalContentDiv = document.getElementById('combatModalContent');\n\t\tmodalContentDiv.style.display = 'inline-block';\n\t}", "title": "" }, { "docid": "3f55419c91347d09b9f5dcc2f8dc34fb", "score": "0.5741812", "text": "function openEditContentPopup(beerId, name, price, amount) {\n //Display pop-up\n $(\".overlay\").css({\n \"visibility\": \"visible\",\n \"opacity\": 1\n });\n\n displayInfoContentEdit(beerId, name, price, amount);\n /*\n $(\"#edited_drink\").on(\"click\", function() {\n openEditContentListPopup();\n });\n */\n}", "title": "" }, { "docid": "d4add1b83df51f9d580f847723c12ea1", "score": "0.57415247", "text": "function createContentBoxes(){\r\n\r\n var top_item = last_html_item-1;\r\n var bot_item = Math.max(last_html_item -100,1);\r\n\r\n for (var i = top_item; i>=bot_item; i--){\r\n var content_box = document.getElementById('content_box');\r\n content_box.innerHTML+='\\\r\n <div id=\"item'+i+'\" style=\"opacity: 0; display:inline-block; float:left; overflow:hidden; margin:'+(border_width/2)+'px; background:white; transition: all 1s; width:'+(img_width+border_width*2)+'px; height:'+((img_width/3*5)+border_width*2)+'px; box-shadow: '+shadow_size+'px '+shadow_size+'px '+shadow_size+'px rgba(0,0,0,.1)\">\\\r\n <a href=\"index.php?item='+(i)+'&r='+Math.floor(Math.random()*100000)+'\" style=\"-webkit-tap-highlight-color: rgba(0,0,0,0); margin-bottom:0px;\">\\\r\n <img id=\"item_img'+i+'\" style=\" margin-bottom:0px; z-index='+(i*2+1)+'; width: '+img_width+'px; border:'+border_width+'px solid white;\">\\\r\n </a>\\\r\n <div class=\"titles\">\\\r\n <div id=\"item_title'+i+'\" style=\" padding-bottom: '+(line_height/4)+'px; padding-top:0px; background: white; width:'+(img_width+border_width*2)+'px\">\\\r\n item'+i+'\\\r\n </div>\\\r\n </div>\\\r\n </div>';\r\n }\r\n last_html_item = bot_item;\r\n}", "title": "" }, { "docid": "068b2148dfcb8dd2fa4be93ba392e59f", "score": "0.5730619", "text": "function PopupContent(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n var classes = Object(__WEBPACK_IMPORTED_MODULE_1_clsx__[\"default\"])('content', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"p\" /* getUnhandledProps */])(PopupContent, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"o\" /* getElementType */])(PopupContent, props);\n return /*#__PURE__*/__WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(ElementType, Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__[\"a\" /* default */])({}, rest, {\n className: classes\n }), __WEBPACK_IMPORTED_MODULE_4__lib__[\"c\" /* childrenUtils */].isNil(children) ? content : children);\n}", "title": "" }, { "docid": "60bbe26d0b7b56ca0476025d29775fbb", "score": "0.5729707", "text": "function Popup(params) {\n 'use strict';\n var self = this;\n\n self.isMobDevice = self.isMobDevice = FRONDEVO ? FRONDEVO.controls.isMobDevice : false;\n self.elems = {\n $menu: $('.header-menu').eq(0),\n $menuItems: $('.header-menu .m-item'),\n $popup: $('.fd__popup'),\n $popupHtml: $('.pop-content').html().replace(/style=\\\"display: none;\\\"/g, ''),\n $hbMenu: $('.fd__hb-menu')\n };\n\n self.elems.$popup.remove();\n\n self.settings = {\n };\n\n $.extend(self.settings, params);\n\n self.popupCode = function (title, content, close){\n title = title ? title : '';\n content = content ? content : '';\n close = close ? close : '';\n return '<div class=\"fd__popup tEndElement\">' +\n ' <div class=\"pop-wrap\">' +\n ' <div class=\"queue-wrap queueFromTop\">' +\n ' <h2 class=\"pop-title tEndElement queue queue1\">' + title + '</h2>' +\n ' </div>' +\n ' <div class=\"pop-content queue-wrap queueFromBottom\">' + content + '</div>' +\n ' <div title=\"' + close + '\" class=\"pop-btn-close\"></div>' +\n ' </div>' +\n '</div>';\n };\n self.popupMenuCode = function (content, close){\n content = content ? content : '';\n close = close ? close : '';\n\n return '<div class=\"fd__popup fd__popup_v2 tEndElement\">' +\n ' <div class=\"pop-wrap\">' + self.elems.$popupHtml + '</div>' +\n ' <div title=\"' + close + '\" class=\"pop-btn-close\">' +\n ' <span></span>' +\n ' </div>' +\n '</div>';\n };\n self.popups = {\n };\n\n\n self.init(params);\n\n return this;\n}", "title": "" }, { "docid": "9bfe0951ae5de84ebeb788643e1863a6", "score": "0.5726007", "text": "function display_source(url, description){\n //create modal - aka the popup window that displays the file associated with the current source\n var myModal = document.getElementById(\"myModal\");\n var modal_content = document.createElement(\"div\");\n modal_content.class = \"modal-content\";\n\n //content of modal_content div\n var span = document.createElement(\"span\");\n span.class = \"close\";\n span.onclick = function() {\n myModal.style.display = \"none\";\n }\n\n //set image in popup to be the given filename(url)\n //set image subscript/caption to be source description\n var img = document.createElement(\"img\");\n img.src = url;\n img.style = \"width:100%;max-width:300px\";\n var div = document.createElement(\"div\");\n div.id = \"caption\";\n div.innerHTML = description\n\n //append content to modal\n modal_content.append(span);\n modal_content.append(img);\n modal_content.append(div)\n myModal.append(modal_content);\n\n // When the user clicks the button, open the modal\n myModal.style.display = \"block\";\n\n // When the user clicks anywhere outside of the modal, close it\n window.onclick = function(event) {\n if (event.target == myModal) {\n myModal.style.display = \"none\";\n myModal.removeChild(modal_content);\n }\n }\n}", "title": "" }, { "docid": "46de3d26252829f5eb583ab5e4c97c3b", "score": "0.5725219", "text": "function showItemContent(result){\t \n\n\t//Insert result of AJAX-request into \"content-container\".\n\t$(\".content-container\").html(result);\t\n }", "title": "" }, { "docid": "b0337db12305ed3ad0a569cfd2eafaea", "score": "0.5721916", "text": "function createPopup(title, size=\"md\") {\n var table = createTagAppend(find('body'), 'div', 'popup-add');\n var html = '<style>#back_button, #skip_button, #submit_button, #update_button, .desc_button { color: #fff !important; background-color: #DA291C !important;} .desc_button:hover { color: #fff !important; background-color: #B71C1C !important};#update_title { color: #b71c1c;}</style>';\n var body = '<div id=\"backdrop\" class=\"modal-backdrop fade in\" modal-animation-class=\"fade\" modal-in-class=\"in\" ng-style=\"{\\'z-index\\': 1040 + (index &amp;&amp; 1 || 0) + index*10}\" modal-backdrop=\"modal-backdrop\" modal-animation=\"true\" style=\"z-index: 1040;\"></div><div id=\"popup-table\" modal-render=\"true\" tabindex=\"-1\" role=\"dialog\" class=\"modal fade fastclickable in\" modal-animation-class=\"fade\" modal-in-class=\"in\" ng-style=\"{\\'z-index\\': 1050 + index*10, display: \\'block\\'}\" ng-click=\"close($event)\" modal-window=\"modal-window\" size=\"' + size + '\" index=\"0\" animate=\"animate\" modal-animation=\"true\" style=\"z-index: 1050; display: block;\"><div class=\"modal-dialog modal-' + size + '\" ng-class=\"size ? \\'modal-\\' + size : \\'\\'\"><div class=\"modal-content\" modal-transclude=\"\"><div style=\"min-height: 100px\" class=\"portal-base\"><div class=\"modal-header\"><div class=\"row\"><h4 class=\"modal-title col-md-9\"> ' + title + '</h4><button type=\"button\" id=\"close-popup-table-button\" class=\"btn btn-cancel pull-right fastclickable\">Close</button></div></div><div class=\"modal-body\"><div id=\"popup-table-div\" class=\"portal-panel panel\"></div><div id=\"popup-bottom\"></div></div></div></div></div></div>';\n addHTML('#popup-add', html);\n addHTML('#popup-add', body);\n find('#close-popup-table-button').addEventListener('click', function() {\n remove('#popup-add');\n });\n return find('#popup-table-div');\n}", "title": "" }, { "docid": "91ba6cdabb169d187999f892331316d2", "score": "0.5721566", "text": "function openGISEditor() {\r\n\r\n // Center the popup\r\n var windowWidth = document.documentElement.clientWidth;\r\n var windowHeight = document.documentElement.clientHeight;\r\n var popupWidth = windowWidth * 0.9;\r\n var popupHeight = windowHeight * 0.9;\r\n var popupOffsetTop = windowHeight / 2 - popupHeight / 2;\r\n var popupOffsetLeft = windowWidth / 2 - popupWidth / 2;\r\n\r\n var $gis_editor = $(\"#gis_editor\");\r\n var $backgrouond = $(\"#popup_background\");\r\n\r\n $gis_editor.css({\"top\": popupOffsetTop, \"left\": popupOffsetLeft, \"width\": popupWidth, \"height\": popupHeight});\r\n $backgrouond.css({\"opacity\":\"0.7\"});\r\n\r\n $gis_editor.append('<div id=\"gis_data_editor\"><img class=\"ajaxIcon\" id=\"loadingMonitorIcon\" src=\"'\r\n + pmaThemeImage + 'ajax_clock_small.gif\" alt=\"\"/></div>'\r\n );\r\n\r\n // Make it appear\r\n $backgrouond.fadeIn(\"fast\");\r\n $gis_editor.fadeIn(\"fast\");\r\n}", "title": "" } ]
b16449265a3c0bab9e439279bc301f3f
Focus in input field
[ { "docid": "1d07892d19b2c97c96b8cd8e5b2af6db", "score": "0.0", "text": "onMouseEnter(value) {\n this.updatePasswordOptions();\n this.show();\n this.checkPassword(value);\n }", "title": "" } ]
[ { "docid": "cd25118e927b5c54562cfec2a7cf4cc9", "score": "0.83781904", "text": "function focus() {\n\t\t$input.focus();\n\t}", "title": "" }, { "docid": "5be0998d0701bb0eba516930fba03713", "score": "0.8278289", "text": "focusIn() {\n this._input.focus()\n }", "title": "" }, { "docid": "e36aff045a97b8c47d9a1e023b045118", "score": "0.81490356", "text": "focusIn() {\n this._input.open()\n }", "title": "" }, { "docid": "823cef75fae245dd7340faeefb40ffee", "score": "0.8106706", "text": "function InputFocus(){\r\n //focused=true;\r\n // input.focus();\r\n}", "title": "" }, { "docid": "3aca3400deb279be51e647852d6fc1eb", "score": "0.7986734", "text": "function focusInputElement(){elements.input.focus();}", "title": "" }, { "docid": "66540aa30d64e9a075f519838ea3f3e2", "score": "0.79096115", "text": "function focusInputElement () {\n elements.input.focus();\n }", "title": "" }, { "docid": "66540aa30d64e9a075f519838ea3f3e2", "score": "0.79096115", "text": "function focusInputElement () {\n elements.input.focus();\n }", "title": "" }, { "docid": "bf5e3bb8eb454d8d6d4d8227dd10f9bd", "score": "0.78891104", "text": "function focusInput() {\n document.getElementById(ids.userInput).focus();\n }", "title": "" }, { "docid": "438684612204a8a172e2fdefcada8a67", "score": "0.78695875", "text": "function focus_input() {\n focused = this;\n }", "title": "" }, { "docid": "bb20491917ee5b56ac145eb823710e3b", "score": "0.77965045", "text": "focus() {\n\t\tif (this.inputNode && this.inputNode.focus) {\n\t\t\tthis.inputNode.focus();\n\t\t}\n\t}", "title": "" }, { "docid": "30d7a62da3453feecf313d0ae9549c0d", "score": "0.7773496", "text": "function inputFocus() {\n\tinputSubmit.focus();\n}", "title": "" }, { "docid": "32be5a217c56e8d8362e2cfeab9bd3eb", "score": "0.77615297", "text": "function putInFocus() {\n\tfibonacciInput.focus();\n}", "title": "" }, { "docid": "6c1b6d00a8b87a94882e17c128b25529", "score": "0.77569497", "text": "focus() {\n this.callRequiredChildMethod(this.inputSlot, 'focus', []);\n }", "title": "" }, { "docid": "fb79f99bd839e3f84f2618fc7cd7e0ff", "score": "0.77416474", "text": "focus() {\n this.inputRef.current.focus();\n }", "title": "" }, { "docid": "9ac90e3644cd2c9e7e01b10594dc7c2d", "score": "0.7698463", "text": "focus() {\n this.$.input.$.input.focus();\n }", "title": "" }, { "docid": "37697ba6520831149d0eff2b5338c391", "score": "0.76752573", "text": "function focusInput() {\n expense_input_text.focus();\n }", "title": "" }, { "docid": "b744f86ae705cf283245bcbb296ea1c3", "score": "0.76538956", "text": "function focus() {\n $('input').focus();\n}", "title": "" }, { "docid": "b56b5d52dc4a333aa360c5c2a1ec283f", "score": "0.7630996", "text": "focus()\n\t{\n\t\tthis.refs.field.getWrappedInstance().focus()\n\t\tthis.focused()\n\t}", "title": "" }, { "docid": "9850402c1204a52ca09d7ebdb360a15f", "score": "0.7620032", "text": "focus() {}", "title": "" }, { "docid": "b514264f433d7966f580adeb8c525e3b", "score": "0.7548133", "text": "focusInput() {\n\t\tthis.refs.input.focus();\n\t}", "title": "" }, { "docid": "d40320141eaa5e08248c6415ccd13730", "score": "0.7472777", "text": "function focusOnInput() {\n var cmd_width;\n\n $(options.selector).scrollTop($(options.selector)[0].scrollHeight);\n\n input.focus();\n }", "title": "" }, { "docid": "8c52e824f8006de9f7e4db8d3c4c5932", "score": "0.7416072", "text": "function focusOnInput() {\n $('#loginForm input[name=\"username\"]').focus();\n }", "title": "" }, { "docid": "439413ce785254b7d9f0d2d6b9c9ab25", "score": "0.7412218", "text": "focus() {\n if (this.disabled) {\n return;\n }\n if (this.isOpen) {\n this.activeTabComponent.focus();\n }\n else {\n this.input.focus();\n }\n }", "title": "" }, { "docid": "b2bd5e84cac995210567078c1fc59e8d", "score": "0.73269147", "text": "function focusOutputField(){\n $outputField.focus();\n}", "title": "" }, { "docid": "36ea2d4397deb0006f5f2e1499879124", "score": "0.7311867", "text": "function focusInput() {\n ctrl.inputFocused = true;\n\n if (!lodash.isEmpty(ctrl.validationRules)) {\n ctrl.inputIsTouched = true;\n }\n\n if (angular.isFunction(ctrl.itemFocusCallback)) {\n ctrl.itemFocusCallback({ inputName: ctrl.inputName });\n }\n }", "title": "" }, { "docid": "4372e42c8f1d0d61a667af8d66144bc3", "score": "0.7310308", "text": "input_onfocus(e)\n {\n this.input_focused = true;\n if(!this.dropdown_widget.shown && !this.edit_widget.shown)\n this.show_history();\n }", "title": "" }, { "docid": "3adef480c10f8701ec5ad29bd7b6e6c0", "score": "0.73055875", "text": "focus() {\n this.setFocus(0, 1);\n }", "title": "" }, { "docid": "8dd512defc812c967f38d13a4793245e", "score": "0.72859776", "text": "function focusElement () {\n if ($scope.autofocus) elements.input.focus();\n }", "title": "" }, { "docid": "8dd512defc812c967f38d13a4793245e", "score": "0.72859776", "text": "function focusElement () {\n if ($scope.autofocus) elements.input.focus();\n }", "title": "" }, { "docid": "8dd512defc812c967f38d13a4793245e", "score": "0.72859776", "text": "function focusElement () {\n if ($scope.autofocus) elements.input.focus();\n }", "title": "" }, { "docid": "94eb74665e63805675ed8f965c6894bd", "score": "0.7271873", "text": "focus() {\n if (!this.isDisabled) {\n attemptFocus(this.$refs.input)\n }\n }", "title": "" }, { "docid": "7081562dc75d03360e6fde401b866e5c", "score": "0.7259723", "text": "focus() {\n let node;\n if (this.isCustom) {\n node = this.shadowRoot.querySelector('.name-field anypoint-input');\n } else {\n node = this.shadowRoot.querySelector('api-property-form-item');\n }\n if (node) {\n node.focus();\n }\n }", "title": "" }, { "docid": "204b20556d8baa29d47f6e972c362992", "score": "0.7245798", "text": "function focusElement () {\r\n if ($scope.autofocus) elements.input.focus();\r\n }", "title": "" }, { "docid": "8897d04299a8bc1bbce56dbec7da1f13", "score": "0.72410226", "text": "focus () {\n if (this._dateInput) {\n this._dateInput.focus()\n }\n }", "title": "" }, { "docid": "68faf674f825ddd39a48e7cc242590e0", "score": "0.7197975", "text": "function emailInputFocus(){\n\t\t\t$scope.showOptions=true;\n\t\t\t$scope.showSelectionButtons=false;\n\t\t}", "title": "" }, { "docid": "010665de8b7f3b4d98f3d51b5ab44ade", "score": "0.71875405", "text": "focus() {\n this.$.nativeInput.focus();\n }", "title": "" }, { "docid": "15c53673b5ddf97544a4d50039831bb4", "score": "0.71756953", "text": "@api\n focus() {\n this.startDateInput.focus();\n }", "title": "" }, { "docid": "98b9d775e254272b63a7074f67a5907b", "score": "0.7151962", "text": "focusInput() {\n this.nameOfNewProperty.current.focus();\n }", "title": "" }, { "docid": "326efa8df6f3d5ec2163a1cb20d63052", "score": "0.70919305", "text": "focus() {\n if (this.disabled) {\n return;\n }\n\n this.focusElement.focus();\n this._setFocused(true);\n }", "title": "" }, { "docid": "732d155faff5ac228d3c1455b87391bc", "score": "0.70793605", "text": "focusInputField() {\n const { mobileMenu, fnSetSearchInputFocus } = this.props;\n if (mobileMenu && mobileMenu.searchShouldBeFocused && this.inputRef && this.inputRef.current) {\n fnSetSearchInputFocus({ searchShouldBeFocused: false });\n this.inputRef.current.focus();\n }\n }", "title": "" }, { "docid": "4f06bf2eaa2efa432995dfd76d2327e1", "score": "0.70693225", "text": "focus() {\n\t\tthis._focusCycler.focusFirst();\n\t}", "title": "" }, { "docid": "4f06bf2eaa2efa432995dfd76d2327e1", "score": "0.70693225", "text": "focus() {\n\t\tthis._focusCycler.focusFirst();\n\t}", "title": "" }, { "docid": "cf3dc43b04e8a4fd0c31aa4f9738ba8f", "score": "0.7056904", "text": "function focus() {\n $time.focus().select();\n }", "title": "" }, { "docid": "1c040ac24303a98bfd76be336799fb56", "score": "0.70415336", "text": "_setFocus() {\n if (this._blurTimeoutId) {\n clearTimeout(this._blurTimeoutId);\n }\n this._focus = true;\n this._setFocusWithin();\n }", "title": "" }, { "docid": "55c7a0eea81fa45dd30dd4cd9dac7138", "score": "0.70328254", "text": "function focusIn() {\n selectedId = hiddenId.value;\n selectedValue = input.value;\n\n query('');\n }", "title": "" }, { "docid": "1cb31dd956310e923f002d7bbdff1539", "score": "0.70257115", "text": "function reFocus() { if (cm.state.focused) setTimeout(bind(focusInput, cm), 0); }", "title": "" }, { "docid": "1cb31dd956310e923f002d7bbdff1539", "score": "0.70257115", "text": "function reFocus() { if (cm.state.focused) setTimeout(bind(focusInput, cm), 0); }", "title": "" }, { "docid": "1cb31dd956310e923f002d7bbdff1539", "score": "0.70257115", "text": "function reFocus() { if (cm.state.focused) setTimeout(bind(focusInput, cm), 0); }", "title": "" }, { "docid": "1cb31dd956310e923f002d7bbdff1539", "score": "0.70257115", "text": "function reFocus() { if (cm.state.focused) setTimeout(bind(focusInput, cm), 0); }", "title": "" }, { "docid": "1cb31dd956310e923f002d7bbdff1539", "score": "0.70257115", "text": "function reFocus() { if (cm.state.focused) setTimeout(bind(focusInput, cm), 0); }", "title": "" }, { "docid": "1cb31dd956310e923f002d7bbdff1539", "score": "0.70257115", "text": "function reFocus() { if (cm.state.focused) setTimeout(bind(focusInput, cm), 0); }", "title": "" }, { "docid": "fa6887bc9c9fddc7e49f558a556224e8", "score": "0.7020092", "text": "focus() {\n\t\tthis.children.first.focus();\n\t}", "title": "" }, { "docid": "843e185a85b76b07cb8e3c4c2729ed34", "score": "0.70069265", "text": "function inputFocusCallback(evt) {\n var targetElem = target(evt);\n socket.emit(\"input:focus\", { id: targetElem.id }); // Todo - Is this even needed?\n if (targetElem.type === \"text\" || targetElem.type === \"textarea\") {\n targetElem[ghost.eventListener](ghost.prefix + \"keyup\", keyupCallback, false);\n }\n }", "title": "" }, { "docid": "df852ab04db9111ff4f63b7806826fd1", "score": "0.7003964", "text": "_setFocusToInput() {\n if (!flagTouchStart && document.activeElement !== this._elements.input) {\n this._elements.input.focus();\n }\n flagTouchStart = false;\n }", "title": "" }, { "docid": "ef1658e41a46d96bfbf57eadf27709c5", "score": "0.6994016", "text": "function __focus(el){\n\tel.focus()\n\tvar p=el.val().length\n\tel.selection('setPos',{start:p,end:p})\n}", "title": "" }, { "docid": "ac8adb93ae24b028f4f7afbc90640208", "score": "0.6989267", "text": "activate() {\n this.focus();\n }", "title": "" }, { "docid": "bad1ff801c926a8504f355478e67605f", "score": "0.6986242", "text": "function setFocus() {\n ctrl.inputFocused = true;\n\n if (angular.isFunction(ctrl.itemFocusCallback)) {\n ctrl.itemFocusCallback({ inputName: ctrl.inputName });\n }\n }", "title": "" }, { "docid": "311d044bba5e44b869f91b8a46b1a035", "score": "0.6970796", "text": "function inputTextFocus() {\r\n var inputText = document.getElementById(\"toDoText\");\r\n inputText.focus();\r\n}", "title": "" }, { "docid": "f88b8c4ef34ae2e3b88f70d56500f878", "score": "0.6965292", "text": "function option_focus(obj) {\r\n option_manager.input_focus(obj);\r\n return false;\r\n}", "title": "" }, { "docid": "d2ca30466b7d98c01f7a1abbb014582e", "score": "0.6955352", "text": "_focus() {\n if (!this.searchSelectInput || !this.novoSelect.panel) {\n return;\n }\n // save and restore scrollTop of panel, since it will be reset by focus()\n // note: this is hacky\n const panel = this.novoSelect.panel.nativeElement;\n const scrollTop = panel.scrollTop;\n // focus\n this.searchSelectInput.nativeElement.focus();\n panel.scrollTop = scrollTop;\n }", "title": "" }, { "docid": "66212534692668ae4e2bf214d5ea119d", "score": "0.6934737", "text": "@api\n focus() {\n this.focusOnButton();\n }", "title": "" }, { "docid": "5b056e8762dd453d3f7972077b27683c", "score": "0.69261897", "text": "function keepKeyboardOpen() {\n txtInput.one('blur', function() {\n txtInput[0].focus();\n });\n }", "title": "" }, { "docid": "0d62db5eb0ae2cb77f3b66463970feb3", "score": "0.69159263", "text": "function ssFocus(){\n if (vm.disabled) { return; }\n $element.on('keydown', inputHandler.run);\n $element.on('keyup', refreshKeyInput);\n\n resetSearch();\n searchOptions();\n }", "title": "" }, { "docid": "0d62db5eb0ae2cb77f3b66463970feb3", "score": "0.69159263", "text": "function ssFocus(){\n if (vm.disabled) { return; }\n $element.on('keydown', inputHandler.run);\n $element.on('keyup', refreshKeyInput);\n\n resetSearch();\n searchOptions();\n }", "title": "" }, { "docid": "0c163d43e2a9d2b5a787af30a8b5b2de", "score": "0.6907215", "text": "_focusField(field) {\n this.ref[field].focus();\n }", "title": "" }, { "docid": "d4e8a03f6eb2d948ff221097756fd0b2", "score": "0.69057167", "text": "function onMouseup () {\n elements.input.focus();\n }", "title": "" }, { "docid": "d4e8a03f6eb2d948ff221097756fd0b2", "score": "0.69057167", "text": "function onMouseup () {\n elements.input.focus();\n }", "title": "" }, { "docid": "d4e8a03f6eb2d948ff221097756fd0b2", "score": "0.69057167", "text": "function onMouseup () {\n elements.input.focus();\n }", "title": "" }, { "docid": "d4e8a03f6eb2d948ff221097756fd0b2", "score": "0.69057167", "text": "function onMouseup () {\n elements.input.focus();\n }", "title": "" }, { "docid": "d4e8a03f6eb2d948ff221097756fd0b2", "score": "0.69057167", "text": "function onMouseup () {\n elements.input.focus();\n }", "title": "" }, { "docid": "4b8bf17d62c465243448f6b839db89a2", "score": "0.68982035", "text": "_focusInput(options) {\n if (this._chipInput) {\n this._chipInput.focus(options);\n }\n }", "title": "" }, { "docid": "4b8bf17d62c465243448f6b839db89a2", "score": "0.68982035", "text": "_focusInput(options) {\n if (this._chipInput) {\n this._chipInput.focus(options);\n }\n }", "title": "" }, { "docid": "96e049b6bdeac8d29b780b9508b84cef", "score": "0.68981606", "text": "focus() {\n this.el_.focus();\n }", "title": "" }, { "docid": "96e049b6bdeac8d29b780b9508b84cef", "score": "0.68981606", "text": "focus() {\n this.el_.focus();\n }", "title": "" }, { "docid": "fec84db8b314fa3e58748d85796c02f1", "score": "0.68883234", "text": "function onMouseup () {\r\n elements.input.focus();\r\n }", "title": "" }, { "docid": "ab61a07ab1b268357bd865d054f9aa65", "score": "0.6881141", "text": "setFocusElement(ele) {\r\n ele.focus();\r\n }", "title": "" }, { "docid": "a4c0e77fd71804401fcb8713e59039cb", "score": "0.68780017", "text": "focusSearchInput() {\n this.$nextTick(() => {\n this.$refs.searchInput.focus();\n });\n }", "title": "" }, { "docid": "800fb01c7465130c6924062cc5773f9d", "score": "0.68752885", "text": "focus() {\n if (!this.disabled) {\n this.contenteditable = \"true\";\n this.__focused = true;\n }\n this.dispatchEvent(\n new CustomEvent(\"focus\", {\n bubbles: true,\n composed: true,\n cancelable: true,\n detail: this.querySelector(\"*\"),\n })\n );\n }", "title": "" }, { "docid": "3a4a9a7bccd783fc03fae60d42f41a9b", "score": "0.6874654", "text": "focusInput() {\n this._displayState.forceFocus = true;\n this._displayState.searchInputFocused = true;\n // Trigger a rerender without resetting the forceFocus.\n this._displayUpdateSignal.emit(this._displayState);\n this._displayState.forceFocus = false;\n }", "title": "" }, { "docid": "b76a4b684f25be6175373b6464441efd", "score": "0.6872649", "text": "focus() {\n super.focus();\n }", "title": "" }, { "docid": "4b59a7177215b3b7d322edc40a75d9ba", "score": "0.6866798", "text": "function _setFocus ($el) {\n if (!_utils.isElementInView($el)) {\n ////check if the offset - 70 is negative and use 0 if it is.\n //var elOffset = ($el.offset().top - 70 > 0) ? $el.offset().top - 70 : 0;\n ////scroll\n //$('html,body').animate({scrollTop : elOffset }, 'fast');\n\n // Get the offset top of the element.\n //var elOffset = $el.offset().top;\n\n // Scroll to the element. Scroll location tries to be place element in middle of screen.\n $el.scrollTo($(window).height() / 2, 200);\n\n }\n\n // and focus it\n $el.focus().select();\n }", "title": "" }, { "docid": "0018b2d121d41d4a2013d9c436a95c66", "score": "0.6858824", "text": "if (this.shouldBeFocused) {\n this.focus();\n }", "title": "" }, { "docid": "e722818eaafe1adcc0122977d5474fdc", "score": "0.685233", "text": "function setFocusToIsbnSearch(){\n //$('#isbn-search').focus();\n $('#isbn-search').select();\n}", "title": "" }, { "docid": "a643043c15ab9c52b17c0aec5f61fc2a", "score": "0.6849701", "text": "function keepKeyboardOpen () {\n txtInput.one('blur', function () {\n txtInput[0].focus()\n })\n }", "title": "" }, { "docid": "0890631ce1e936e6b06112ac42312508", "score": "0.68482995", "text": "function focus() {\n if (parent) setTimeout(function () {\n return parent.focus();\n });\n }", "title": "" }, { "docid": "3ba1b477ff69a5110aab69b4b95d8b9c", "score": "0.68479025", "text": "function _setFocus($el) {\n //check if the offset - 70 is negative and use 0 if it is.\n var elOffset = ($el.offset().top - 70 > 0) ? $el.offset().top - 70 : 0;\n\n //scroll\n jQuery('html,body').animate({scrollTop : elOffset }, 'fast');\n // and focus it\n $el.focus();\n }", "title": "" }, { "docid": "4a381e09acee60ecac6d4e4c1d6fae7e", "score": "0.6840298", "text": "@api\n focus() {\n if (!this._connected) {\n return;\n }\n\n const input = this.template.querySelector(CONSTANTS.LIGHTNING_INPUT);\n\n if (input) {\n input.focus();\n }\n }", "title": "" }, { "docid": "e29099e34582edfd47da1a49b56fc551", "score": "0.6833141", "text": "autoCompleteFocus() {\n if (!this.receivedUserInput_) {\n this.activateFocus();\n }\n }", "title": "" }, { "docid": "d7387a2e9ae6761a40c3990c1e1d4e80", "score": "0.6831189", "text": "focusInput() {\n setTimeout(function() {\n let focused = false;\n\n for (let el of Array.from(this.drop.querySelectorAll('*'))) {\n if (this.INPS.indexOf(el.tagName) > -1) {\n if (el.tagName == 'INPUT') {\n el.select();\n }\n else {\n el.focus();\n }\n\n focused = true;\n break;\n }\n };\n\n if (!focused) this.drop.focus(); // if no input at least shift focus to the dropdown\n }.bind(this), 1);\n }", "title": "" }, { "docid": "208efa59dabf284fe3710cf337a0fe74", "score": "0.68240446", "text": "focus() {\n if (this.disabled) {\n return;\n }\n this.wrapper.nativeElement.focus();\n }", "title": "" }, { "docid": "edfccf32d9f1d625968c7848ca16b950", "score": "0.68227696", "text": "function onMouseup(){elements.input.focus();}", "title": "" }, { "docid": "2f1cfd5dc4ba36c484cbf5a0c4dc0917", "score": "0.68194443", "text": "setFocusElement(ele) {\n ele.focus();\n }", "title": "" }, { "docid": "9a1a8a0df08ad9fbcd13707181fa346f", "score": "0.6816974", "text": "function onFocusIn(event) {\n console.info(\"onFocusIn\", event);\n }", "title": "" }, { "docid": "c99111b6c9dc7c55d6406075b716b8fa", "score": "0.68093795", "text": "focusElement(elem) {\r\n elem.focus();\r\n }", "title": "" }, { "docid": "4ade88a9d0c81b8b1fcc3ffa33c6f735", "score": "0.68093675", "text": "get focusElement() {\n return this.__inputElement;\n }", "title": "" }, { "docid": "eeae9c3e8cc7dfab6a4a8c01fc519878", "score": "0.68088835", "text": "function inputFocus(input) {\n switch (input) {\n case \"carPlate\":\n setTimeout(() => {\n carPlateInputRef.current.focus();\n }, 1);\n break;\n\n case \"idVehicleModel\":\n setTimeout(() => {\n vehicleModelInputRef.current.focus();\n }, 1);\n break;\n\n case \"idDriver\":\n setTimeout(() => {\n idDriverInputRef.current.focus();\n }, 1);\n break;\n\n case \"nameDriver\":\n setTimeout(() => {\n nameDriverInputRef.current.focus();\n }, 1);\n break;\n\n case \"vehicleColor\":\n setTimeout(() => {\n vehicleColorInputRef.current.focus();\n }, 1);\n break;\n\n default:\n break;\n }\n }", "title": "" }, { "docid": "3fcabf8642747e764550c340e569a77b", "score": "0.6793361", "text": "function enfoque(campo) \n{\n\tdocument.getElementById(campo).focus();\n}", "title": "" }, { "docid": "5b239a61d9fea3ba27807a99ff32561f", "score": "0.67875254", "text": "function focus() {\r\n\t\t\tthis.editor.focus();\r\n\t\t}", "title": "" }, { "docid": "982b397109ddbf17018e4e19c0048c05", "score": "0.6779938", "text": "focus() {\n this.cm.focus();\n }", "title": "" }, { "docid": "fe64688d622e51e92603ab49f87335fc", "score": "0.67793155", "text": "activateFocus() {\n this.isFocused_ = true;\n this.styleFocused_(this.isFocused_);\n this.adapter_.activateLineRipple();\n if (this.outline_) {\n this.updateOutline();\n }\n if (this.label_) {\n this.label_.styleShake(this.isValid(), this.isFocused_);\n this.label_.styleFloat(\n this.getValue(), this.isFocused_, this.isBadInput_());\n }\n if (this.helperText_) {\n this.helperText_.showToScreenReader();\n }\n }", "title": "" }, { "docid": "2106598128398a2afc4ceffe2171b6b3", "score": "0.6767486", "text": "function focus(){\n\t\tdocument.forms[0].elements[0].focus();\n\t}", "title": "" } ]
dfddc435e19f57bf1de3b6d1012c2eb1
This function adds the event listeners to the html elements
[ { "docid": "53b2d4edf0841af080f15a303170748f", "score": "0.0", "text": "function addEvent(elements, type, functionality, value) {\n if (value != undefined && elements.length > 1) {\n elements.forEach(function(element) {\n element.addEventListener(type, function() { functionality(value) });\n });\n }\n if (value == undefined) {\n elements.addEventListener(type, function() { functionality() });\n }\n if (value == 'event') {\n elements.addEventListener(type, function(event) { functionality(event) });\n }\n if (value != undefined && value != 'event' && elements.length == undefined) {\n elements.addEventListener(type, function() { functionality(value) });\n }\n }", "title": "" } ]
[ { "docid": "7f8180b60aa48e5abcaf00337dda3adf", "score": "0.73579615", "text": "function addEventListeners() {\r document.getElementById(\"clickTag\").addEventListener(\"click\", clickthrough);\r\tdocument.getElementById(\"clickTag\").addEventListener(\"mouseover\", mouseOver);\r\tdocument.getElementById(\"clickTag\").addEventListener(\"mouseout\", mouseOff);\r}", "title": "" }, { "docid": "f209913bc2b00c4c25c6eae9c04df0ac", "score": "0.73376316", "text": "createListeners() {\r\n html.get('.first').addEventListener('click', () => { // 'first' é a classe atribuida no html\r\n controls.goTo(1)\r\n update()\r\n })\r\n\r\n html.get('.last').addEventListener('click', () => {\r\n controls.goTo(state.totalPage)\r\n update()\r\n })\r\n\r\n html.get('.next').addEventListener('click', () => {\r\n controls.next()\r\n update()\r\n \r\n })\r\n\r\n html.get('.prev').addEventListener('click', () => {\r\n controls.prev()\r\n update()\r\n })\r\n\r\n //-- pesquisa\r\n html.get('.btnSearch').addEventListener('click', () => {\r\n controls.search()\r\n controls.searchShow()\r\n update()\r\n })\r\n\r\n }", "title": "" }, { "docid": "7f59267d779a1707c3fdd4f6b4d87bda", "score": "0.7274063", "text": "function addEventListeners() {\n\t$(\"#maple-apple\").click(addMapleApple);\n\t$(\"#cinnamon-o\").click(addCinnamon);\n}", "title": "" }, { "docid": "412213f34fdd52f5ecdc5bfb6dd33df3", "score": "0.727405", "text": "function assignEventListeners() {\n \tpageElements.output.addEventListener('click', editDelete, false);\n \t pageElements.authorSelect.addEventListener('change', dropDown, false);\n \t pageElements.tagSelect.addEventListener('change', dropDown, false);\n \t pageElements.saveBtn.addEventListener('click', saveAction ,false);\n \t pageElements.addBtn.addEventListener('click', addAction, false);\n \t pageElements.getAllBtn.addEventListener('click', getAll, false);\n \t pageElements.deleteBtn.addEventListener('click', deleteIt, false);\n }", "title": "" }, { "docid": "6b5a9b3173491870d796162dbe39a057", "score": "0.72419065", "text": "function addListeners() {\n //get the elements to add listener and change image\n let cardContainers = Array.from($(\".col-md-3\"));\n addEvents(cardContainers, 'image/jazz-music-rubber-duck.jpg', 'mouseover');\n addEvents(cardContainers, 'image/question.png', 'mouseout');\n }", "title": "" }, { "docid": "c998f9913b5177a579e3f03e0d26e6a8", "score": "0.7239866", "text": "function buildEventListeners() {\n\t\t//Modal window event listeners.\n\t\tvar modalArray = document.getElementsByClassName(\"username\")\n\n \tfor (x = 0; x < modalArray.length; x++) {\n \t\tmodalArray[x].addEventListener(\"click\", showModal)\n \t}\n\t\t//Comments event listeners.\n\t\tvar commentsArray = document.getElementsByClassName(\"commentBox\")\n\t\n\t\tfor (x = 0; x < commentsArray.length; x++) {\n\t\t\tcommentsArray[x].parentNode.childNodes[3].addEventListener(\"click\", submitComment)\n\t\t}\n\t\t//Display reply comments event listeners.\n\t\tvar repliesArray = document.getElementsByClassName(\"reply_click\");\n\t\n\t\tfor (x = 0; x < repliesArray.length; x++) {\n\t\t\trepliesArray[x].addEventListener(\"click\", showReplies);\n\t\t}\n\t\t//Like button event listeners.\n\t\tvar likesArray = document.getElementsByClassName(\"like\");\n\n\t\tfor (x = 0; x < likesArray.length; x++) {\n\t\t\tlikesArray[x].addEventListener(\"click\", like);\n\t\t}\n\t}", "title": "" }, { "docid": "eabba885fba0324500549684ea36984d", "score": "0.721572", "text": "function addEventListeners() {\n\n}", "title": "" }, { "docid": "571bdacd3298eeef507971d5331e9b36", "score": "0.7207309", "text": "function addEventListeners()\n\t{\n\t\t// window event\n\t\t$(window).resize(callbacks.windowResize);\n\t\t$(window).keydown(callbacks.keyDown);\n\t\t\n\t\t// click handler\n\t\t$(document.body).mousedown(callbacks.mouseDown);\n\t\t$(document.body).mouseup(callbacks.mouseUp);\n\t\t$(document.body).click(callbacks.mouseClick);\n\n\t\t$(document.body).bind('touchstart',function(e){\n\t\t\te.preventDefault();\n\t\t\tcallbacks.touchstart(e);\n\t\t});\n\t\t$(document.body).bind('touchend',function(e){\n\t\t\te.preventDefault();\n\t\t\tcallbacks.touchend(e);\n\t\t});\n\t\t$(document.body).bind('touchmove',function(e){\n\t\t\te.preventDefault();\n\t\t\tcallbacks.touchmove(e);\n\t\t});\n\t\t\n\t\tvar container = $container[0];\n\t\tcontainer.addEventListener('dragover', cancel, false);\n\t\tcontainer.addEventListener('dragenter', cancel, false);\n\t\tcontainer.addEventListener('dragexit', cancel, false);\n\t\tcontainer.addEventListener('drop', dropFile, false);\n\t\t\n\t\t// GUI events\n\t\t$(\".gui-set a\").click(callbacks.guiClick);\n\t\t$(\".gui-set a.default\").trigger('click');\n\t}", "title": "" }, { "docid": "839e5557400a29c7b22f6c5729b74523", "score": "0.7181105", "text": "function createListeners() {\n\t\tDOMElement.querySelector(\".view-gallery\").addEventListener(\"click\", function(e) {onViewGalleryClicked(e);});\n\t}", "title": "" }, { "docid": "9905937a2d562de10e579984a9b45ccb", "score": "0.7136106", "text": "function addListeners(){\n var allQuestions = document.getElementsByClassName(\"question-info\");\n var lastQuestion = allQuestions[allQuestions.length - 1];\n lastQuestion.addEventListener('click', function(event){\n var target = event.target;\n var subject = lastQuestion.children[0];\n var question = lastQuestion.children[1];\n var responseHtml = templates.renderResponseForm({\n subject: subject.innerHTML, \n question: question.innerHTML,\n responses: []\n });\n rightPane.innerHTML = responseHtml;\n });\n }", "title": "" }, { "docid": "42e0e34c32bfb0189949f04629c6cedc", "score": "0.70804214", "text": "function loadEventListeners(){\n\n // get dom class names\n const DOM = UICtrl.getDOMStrings();\n //create event listener on add btn 'true icon'\n document.querySelector(DOM.inputBTN).addEventListener('click',ctrlAddItem),\n // event listener for enter btn\n document.addEventListener('keypress',function(e){\n if (e.keyCode === 13 || e.which === 13) {\n ctrlAddItem();\n }\n });\n // event for deleting item\n document.querySelector(DOM.container).addEventListener('click',deleteItem);\n // enent for change type ddl\n document.querySelector(DOM.inputType).addEventListener('change',UICtrl.changeType);\n\n }", "title": "" }, { "docid": "9b01d851876109c1def0e32f79803c7e", "score": "0.70495147", "text": "function _addEventListeners () {\n dom.$gridToggle.on('click', _toggleGrid);\n dom.$scrollToLink.on('click', scrollToElement);\n document.onkeypress = keyPress;\n document.onkeydown = keyDown;\n window.addEventListener('scroll', _pageScroll);\n window.addEventListener('resize', _windowResize);\n }", "title": "" }, { "docid": "98cf86bfbd6f52789c2e1869decf960a", "score": "0.7047877", "text": "function setupEventListeners() {\n document.querySelector(DOM.addBtn).addEventListener(\"click\", function () {\n UICtrl.toggleDisplay();\n });\n document.querySelector(DOM.formSubmit).addEventListener(\"click\", function (e) {\n ctrlAddItem(e);\n });\n }", "title": "" }, { "docid": "e9ca77c08cfc55423ce2beca02a2a6b4", "score": "0.70463395", "text": "addEventListeners() {\n\t\tthis.container.addEventListener( 'click', this.handleClick, false );\n\t}", "title": "" }, { "docid": "a9c71c7436da4082fe6ee62f39b7ba89", "score": "0.7030896", "text": "function eventListeners(){\n changeOnButtonClicks();\n changeOnDotClicks();\n changeOnArrowKeys();\n changeOnAnnaLink();\n highlightDotsOnMouseover();\n highlightButtonsOnMouseover();\n highlightAnnaLinkOnMouseover();\n $(document).on(\"mousemove\", foregroundButtons);\n}", "title": "" }, { "docid": "ef4da56c4358b619148af3f79b60d917", "score": "0.6991146", "text": "function addEventListeners(){\n document.querySelectorAll(\"[data-action='filter']\").forEach(button => {\n button.addEventListener(\"click\", selectFilter);\n })\n document.querySelectorAll(\"[data-action='sort']\").forEach(button => {\n button.addEventListener(\"click\", selectSorting);\n })\n document.querySelector(\"#searchfunction\").addEventListener(\"input\", search);\n document.querySelector(\".hogwarts\").addEventListener(\"click\", hackTheSystem);\n}", "title": "" }, { "docid": "5bb311f36a15c5de5c1515a4eb85c311", "score": "0.6983299", "text": "function addEventListeners() {\n watchSubmit();\n watchResultClick();\n watchLogo();\n watchVideoImageClick();\n watchCloseClick();\n}", "title": "" }, { "docid": "50f9dd00da03c9b6f1f9d3bc26db79ee", "score": "0.6953398", "text": "_addEventListeners() {\n this.el.addEventListener('click', this._onClickBound);\n this.el.addEventListener('keydown', this._onKeydownBound);\n }", "title": "" }, { "docid": "1012eb3d2a3aeea7fbc70132d9ad5abc", "score": "0.69323325", "text": "function addListeners()\n\t{\n\t\t// Show page action so users can change settings\n\t\tchrome.runtime.sendMessage({request: \"showPageAction\"});\n\n\t\t// Add to editable divs, textareas, inputs\n\t\t$(document).on(EVENT_NAME_KEYPRESS,\n\t\t\t'div[contenteditable=true],textarea,input', keyPressHandler);\n\t\t$(document).on(EVENT_NAME_KEYUP,\n\t\t\t'div[contenteditable=true],textarea,input', keyUpHandler);\n\n\t\t// Attach to future iframes\n\t\t$(document).on(EVENT_NAME_LOAD, 'iframe', function(e) {\n\t\t\t$(this).contents().on(EVENT_NAME_KEYPRESS,\n\t\t\t\t'div[contenteditable=true],textarea,input', keyPressHandler);\n\t\t\t$(this).contents().on(EVENT_NAME_KEYUP,\n\t\t\t\t'div[contenteditable=true],textarea,input', keyUpHandler);\n\t\t});\n\n\t\t// Attach to existing iframes as well - this needs to be at the end\n\t\t// because sometimes this breaks depending on cross-domain policy\n\t\t$(document).find('iframe').each(function(index) {\n\t\t\t$(this).contents().on(EVENT_NAME_KEYPRESS,\n\t\t\t\t'div[contenteditable=true],textarea,input', keyPressHandler);\n\t\t\t$(this).contents().on(EVENT_NAME_KEYUP,\n\t\t\t\t'div[contenteditable=true],textarea,input', keyUpHandler);\n\t\t});\n\t}", "title": "" }, { "docid": "d31214a94c58c575ee0a9e1283b9a5c0", "score": "0.6913941", "text": "activateListeners(html) {\n html.find(\".clickable-element\").click(this._nodeClicked.bind(this));\n super.activateListeners(html);\n }", "title": "" }, { "docid": "7cc3c523898b69482dbf1f40666882bc", "score": "0.69076496", "text": "function addListeners() {\n Enabler.addEventListener(studio.events.StudioEvent.EXPAND_START, expandStartHandler);\n Enabler.addEventListener(studio.events.StudioEvent.EXPAND_FINISH, expandFinishHandler);\n Enabler.addEventListener(studio.events.StudioEvent.COLLAPSE_START, collapseStartHandler);\n Enabler.addEventListener(studio.events.StudioEvent.COLLAPSE_FINISH, collapseFinishHandler);\n creative.dom.expandButton.addEventListener('click', onExpandHandler, false);\n creative.dom.collapseButton.addEventListener('click', onCollapseClickHandler, false);\n //creative.dom.expandedExit.addEventListener('click', exitClickHandler);\n creative.dom.expandMain.addEventListener('click', onExpandHandler);\n // creative.dom.closeButton.addEventListener('click', closeClickHandler);\n}", "title": "" }, { "docid": "ccd4492136e0f1f61568524d4ecf1ecd", "score": "0.69020504", "text": "addEventListeners() {\n const popupDiv = document.getElementById('popup-block');\n const buttons = [\n ...popupDiv.getElementsByClassName('js-chooseColor'),\n ...popupDiv.getElementsByClassName('js-createLabel'),\n ];\n\n for (const button of buttons) {\n button.addEventListener('click', this.handleClick);\n }\n }", "title": "" }, { "docid": "f7191ddb5c56d19a63cf1a1931180c2f", "score": "0.68937844", "text": "addListeners() {\n\t\tthis.findTarget();\n\t\tthis.findControls();\n\t\t\n\t\tthis.showerElement.addEventListener('click', () => {\n\t\t\tthis.showTarget();\n\t\t\tthis.hiderElement.style.display = this.controlsDisplay\n\t\t\tthis.showerElement.style.display = 'none';\n\t\t\t\n\t\t})\n\t\t\n\t\tthis.hiderElement.addEventListener('click', () => {\n\t\t\tthis.hideTarget();\n\t\t\tthis.hiderElement.style.display = 'none'; \n\t\t\tthis.showerElement.style.display = this.controlsDisplay;\n\t\t})\t\t\n\t}", "title": "" }, { "docid": "a12d81f44a90d558545c7f07224acc50", "score": "0.68763065", "text": "function addListenersTo(elementToListenTo) {window.addEventListener(\"keydown\",kdown);window.addEventListener(\"keyup\",kup);elementToListenTo.addEventListener(\"mousedown\",mdown);elementToListenTo.addEventListener(\"mouseup\",mup);elementToListenTo.addEventListener(\"mousemove\",mmove);elementToListenTo.addEventListener(\"contextmenu\",cmenu);elementToListenTo.addEventListener(\"wheel\",scrl);}", "title": "" }, { "docid": "309a89f6086b4090f44abbad526a2a7c", "score": "0.6874634", "text": "function getEventListeners() {\n $(\"#task-input\").on(\"click\", \"#submit-task\", initialpostTask);\n $(\"#completed-task-home\").on(\"click\", \".status\", putStatusUpdate);\n $(\"#completed-task-home\").on(\"click\", \".delete\", deleteTask);\n $(\"#completed-task-home\").on(\"click\", \".update\", checkStringLength);\n $(\"#incompleted-task-home\").on(\"click\", \".status\", putStatusUpdate);\n $(\"#incompleted-task-home\").on(\"click\", \".delete\", deleteTask);\n $(\"#incompleted-task-home\").on(\"click\", \".update\", checkStringLength);\n animations();\n}", "title": "" }, { "docid": "ea7b8710a79e47099eb0cc589dff111d", "score": "0.6861931", "text": "addEventHandlers() {\n\n\t\tthis.elementConfig.addButton.on(\"click\",this.handleAdd);\n\t\tthis.elementConfig.cancelButton.on(\"click\",this.handleCancel);\n\t\tthis.elementConfig.retrieveButton.on(\"click\",this.retrieveData);\n\n\n\t}", "title": "" }, { "docid": "b6f4b1dd4977b3d83412ca1f6f2acaaa", "score": "0.6847192", "text": "function bindEvents(){\n\t\t\n\t\t$(document).on(\"click\",\".item_tag\",function(e){\n\t\t\n\t\t\tdisplayItems($(e.target));\n\t\t\t\n\t\t});\n\t\t\n\t\t\n\t\t$(document).on(\"click\",\".item\",function(e){\n\t\t\n\t\t\te.preventDefault();\n\t\t\t\n\t\t\taddItem($(e.target));\n\t\t\n\t\t});\n\t\t\n\t\t\n\t\t$(document).on(\"click\",\".selected_item\",function(e){\n\t\t\n\t\t\te.preventDefault();\n\t\t\t\n\t\t\tremoveItem($(e.target));\n\t\t\n\t\t});\n\t}", "title": "" }, { "docid": "f25baa404bee0e794062a98a8df12500", "score": "0.6828491", "text": "function attachEventHandlers() {\n // TODO arrow: attach events for functionality like in assignment-document described\n var clicked;\n $(\"#\"+_this.id).click(function(event){\n clicked = true;\n diagram.selectArrow(_this);\n });\n $(\"#\"+_this.id).contents().on(\"dblclick contextmenu\", function(event){\n clicked = true;\n event.preventDefault();\n });\n\n // TODO arrow optional: attach events for bonus points for 'TAB' to switch between arrows and to select arrow\n $(\"#\"+_this.id).contents().attr(\"tabindex\",\"0\");\n\n $(\"#\"+_this.id).keydown(function(event){\n if(event.which == \"13\"){\n diagram.selectArrow(_this);\n }\n if(event.which == \"9\"){\n clicked = false;\n }\n })\n $(\"#\"+_this.id).contents().focusin(function(event){\n if(!clicked){\n setActive(true);\n }\n });\n $(\"#\"+_this.id).contents().focusout(function(event){\n setActive(false);\n });\n }", "title": "" }, { "docid": "d9ec561a61b892fd8a6a9a482c0764cc", "score": "0.6819016", "text": "function addListeners() {\n\t\t// TODO remove inline comments, just example code.\n\t\t// To attach an event, use one of the following methods.\n\t\t// No need remove the listener in `instance.detached`\n\t\t// instance.addEventListener('click', onClick); //attached to `instance.element`\n\t\t// instance.addEventListener('click', onClick, myEl); //attached to `myEl`\n\t}", "title": "" }, { "docid": "da923b862ad0ac7368e548bb7439632d", "score": "0.6814852", "text": "addEventListeners(){\n\t\tif(!this.document) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._triggerEvent = this.triggerEvent.bind(this);\n\n\t\tDOM_EVENTS.forEach(function(eventName){\n\t\t\tthis.document.addEventListener(eventName, this._triggerEvent, { passive: true });\n\t\t}, this);\n\n\t}", "title": "" }, { "docid": "ba8f69f91e670d412d8583c8bd488976", "score": "0.6805117", "text": "function attachListeners() {\n // .nav__button listeners\n let navButtons = Array.from(document.querySelectorAll(\".nav__button\"));\n\n navButtons.forEach(button => {\n button.addEventListener(\"mouseenter\", handleMouseEnter);\n button.addEventListener(\"focus\", handleFocus);\n button.addEventListener(\"mouseleave\", handleMouseLeave);\n button.addEventListener(\"blur\", handleBlur);\n button.addEventListener(\"click\", handleClick);\n button.addEventListener(\"touchstart\", handleTouchStart);\n });\n\n // .nav__button-heading listeners\n let navButtonHeadings = Array.from(\n document.querySelectorAll(\".nav__button-heading\")\n );\n\n navButtonHeadings.forEach(heading => {\n heading.addEventListener(\"mouseleave\", handleMouseLeave);\n heading.addEventListener(\"click\", handleClick);\n });\n}", "title": "" }, { "docid": "ac695150a7446d297fcf1a47654c3fee", "score": "0.68000394", "text": "function addclickEvents(){\n document.getElementById(\"flask\").addEventListener(\"click\", function() {\n callFlask();\n }, false);\n document.getElementById(\"magnet\").addEventListener(\"click\", function() {\n \tcallMagnet();\n }, false);\n document.getElementById(\"heater_button\").addEventListener(\"click\", function() {\n \tcallHeater();\n }, false);\n document.getElementById(\"stir_button\").addEventListener(\"click\", function() {\n \tcallStir();\n }, false);\n document.getElementById(\"pipette\").addEventListener(\"click\", function() {\n \tcallPipette();\n }, false);\n}", "title": "" }, { "docid": "f54dceff2cb4e8a6fde9c31d55623658", "score": "0.6787877", "text": "function addEventListeners() {\n $('#add-form .add-btn').click(function() {\n createDiscussionObject();\n clearFields();\n });\n\n $('.close-form').on('click', function() {\n closeFormButton();\n });\n\n $('.show-form-btn').on('click', function() {\n showFormButton();\n });\n}", "title": "" }, { "docid": "81f7e51bb8a705ce57e2e3ca3ffa358c", "score": "0.6784032", "text": "setEventListeners() {\n $('body').on('touchend click','.menu__option--mode',this.onModeToggleClick.bind(this));\n $('body').on('touchend',this.onTouchEnd.bind(this));\n this.app.on('change:mode',this.onModeChange.bind(this));\n this.app.on('show:menu',this.show.bind(this));\n this.book.on('load:book',this.setTitleBar.bind(this));\n this.book.on('pageSet',this.onPageSet.bind(this));\n this.tutorial.on('done',this.onTutorialDone.bind(this));\n }", "title": "" }, { "docid": "71ea3f5d722ee08b83cd12a00db5a69a", "score": "0.67801774", "text": "function addListeners() {\n $('span').click(function (e) {\n e.preventDefault();\n var li = $(this).parents('li');\n var id = li.attr('id');\n setUrl(id, !li.hasClass('url'));\n });\n\n $('button.delete').click(function (e) {\n e.preventDefault();\n var id = $(this).parents('li').attr('id');\n deleteRecord(id);\n });\n }", "title": "" }, { "docid": "c8c410ba76fa148f91c5b71482e2678c", "score": "0.6775586", "text": "addEventListeners() {\n\t\tthis.bindResize = this.onResize.bind(this);\n\t\twindow.addEventListener('resize', this.bindResize);\n\t\tthis.bindClick = this.onClick.bind(this);\n\t\tEmitter.on('CURSOR_ENTER', this.bindClick);\n\t\tthis.bindRender = this.render.bind(this);\n\t\tTweenMax.ticker.addEventListener('tick', this.bindRender);\n\t\tthis.bindEnter = this.enter.bind(this);\n\t\tEmitter.on('LOADING_COMPLETE', this.bindEnter);\n\t}", "title": "" }, { "docid": "2e773e4cc3fd76afa8a47186d12d2399", "score": "0.6770576", "text": "function attachEvents() {\n var\n inputs = document.querySelectorAll('input'),\n\n i;\n\n // Input Elements Events Listeners\n for (i = 0; i < inputs.length; i = i + 1) {\n // if input element isn't the file chooser\n if (inputs[i].id !== 'picture_input') {\n // Validation Part\n inputs[i].addEventListener('input', checkEventElementValidity);\n inputs[i].addEventListener('blur', removeBorder);\n\n // Storage Part\n inputs[i].addEventListener('input', addElemValueToSessionStorage);\n // the input element is the file chooser \n } else {\n inputs[i].addEventListener('change', handleFileSelect);\n }\n }\n\n // Picture dnd Events Listeners\n picture_container.addEventListener('dragenter', dragEnterHandler);\n picture_container.addEventListener('drop', dropHandler);\n picture_container.addEventListener('dragover', dragOverHandler);\n picture_container.addEventListener('dragstart', dragStartHandler);\n }", "title": "" }, { "docid": "5418a2a9c5632024aa5800901c3325f8", "score": "0.67474693", "text": "function eventListeners() {\n // document ready\n document.addEventListener('DOMContentLoaded', documentReady);\n\n // add event listener when form is submitted\n const searchForm = document.querySelector('#search-form');\n if(searchForm) {\n searchForm.addEventListener('submit', getCocktails);\n }\n\n // The results div listeners\n const resultsDiv = document.querySelector('#results');\n if(resultsDiv) {\n resultsDiv.addEventListener('click', resultsDelegation);\n }\n}", "title": "" }, { "docid": "dff2d6a95256f033b4a8e387336e29fa", "score": "0.67177016", "text": "_addEventListeners() {\n\n this.el.addEventListener('click', this._onClickBound);\n window.addEventListener('scroll', this._onScrollBound);\n window.addEventListener('orientationchange', this._onScrollBound);\n document.addEventListener('spark.visible-children', this._onVisibleBound, true);\n\n if (canObserve)\n this._addMutationObserver();\n else\n window.addEventListener('resize', this._onResizeBound, false);\n }", "title": "" }, { "docid": "278945acf80e1b72792977ba8d94863d", "score": "0.67036486", "text": "setEventsListeners() {\n\t\tlet widths = this.section.querySelectorAll('.item.stroke');\n\t\twidths.forEach(widthElement => {\n\t\t\twidthElement.addEventListener('click', (evt) => {\n\t\t\t\tthis.markItemAsSelected(evt.currentTarget);\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "57f214770f451b143a6ac7b2efdb228e", "score": "0.6702058", "text": "registerDomEvents() {\n\t\tgetComponentElementById(this,\"DataListSearchInput\").on(\"keyup\", function() {\n\t\t\tlet search_text = getComponentElementById(this,\"DataListSearchInput\").val();\n\t\t\tsetTimeout(function() {\n\t\t\t\tif (search_text == getComponentElementById(this,\"DataListSearchInput\").val()) {\n\t\t\t\t\tgetComponentElementById(this,\"DataList\").html(\"\");\n\t\t\t\t\tthis.current_page_array = [];\n\t\t\t\t\tthis.current_list_offset = 0;\n\t\t\t\t\tthis.loadPage();\n\t\t\t\t}\n\t\t\t}.bind(this),500);\n\t\t}.bind(this));\n\t\tgetComponentElementById(this,\"btnResetSearch\").on(\"click\", function() {\n\t\t\tgetComponentElementById(this,\"DataListSearchInput\").val(\"\");\n\t\t\tgetComponentElementById(this,\"DataList\").html(\"\");\n\t\t\tthis.current_page_array = [];\n\t\t\tthis.current_list_offset = 0;\n\t\t\tthis.loadPage();\n\t\t}.bind(this));\n\t\tgetComponentElementById(this,\"DataListMoreButton\").on(\"click\", function() {\n\t\t\tthis.current_list_offset += this.list_offset_increment;\n\t\t\tthis.loadPage();\n\t\t}.bind(this));\n\t\tthis.handleOnClassEvent(\"click\",\"data_list_item_\"+this.getUid(),\"_row_item_\",\"on_item_clicked\");\n\t}", "title": "" }, { "docid": "09b8dce08c42aaf0fe9381b083595728", "score": "0.66982347", "text": "function addEventListeners() {\n\n eventsAreBound = true;\n\n window.addEventListener('hashchange', onWindowHashChange, false);\n window.addEventListener('resize', onWindowResize, false);\n\n if (config.touch) {\n dom.wrapper.addEventListener('touchstart', onTouchStart, false);\n dom.wrapper.addEventListener('touchmove', onTouchMove, false);\n dom.wrapper.addEventListener('touchend', onTouchEnd, false);\n\n // Support pointer-style touch interaction as well\n if (window.navigator.msPointerEnabled) {\n dom.wrapper.addEventListener('MSPointerDown', onPointerDown, false);\n dom.wrapper.addEventListener('MSPointerMove', onPointerMove, false);\n dom.wrapper.addEventListener('MSPointerUp', onPointerUp, false);\n }\n }\n\n if (config.keyboard) {\n document.addEventListener('keydown', onDocumentKeyDown, false);\n }\n\n if (config.progress && dom.progress) {\n dom.progress.addEventListener('click', onProgressClicked, false);\n }\n\n if (config.controls && dom.controls) {\n ['touchstart', 'click'].forEach(function (eventName) {\n dom.controlsLeft.forEach(function (el) {\n el.addEventListener(eventName, onNavigateLeftClicked, false);\n });\n dom.controlsRight.forEach(function (el) {\n el.addEventListener(eventName, onNavigateRightClicked, false);\n });\n dom.controlsUp.forEach(function (el) {\n el.addEventListener(eventName, onNavigateUpClicked, false);\n });\n dom.controlsDown.forEach(function (el) {\n el.addEventListener(eventName, onNavigateDownClicked, false);\n });\n dom.controlsPrev.forEach(function (el) {\n el.addEventListener(eventName, onNavigatePrevClicked, false);\n });\n dom.controlsNext.forEach(function (el) {\n el.addEventListener(eventName, onNavigateNextClicked, false);\n });\n });\n }\n\n }", "title": "" }, { "docid": "3707f4ba044b76e3e2388ecdc543b48a", "score": "0.66896486", "text": "function addListeners() {\n const doneButtons = document.querySelectorAll('.toggle-task-done');\n doneButtons.forEach(button => {\n button.addEventListener('click', toggleDoneStatus)\n })\n\n const trashButtons = document.querySelectorAll('i.fa-trash');\n trashButtons.forEach(button => {\n button.addEventListener('click', deleteTask)\n })\n\n const penButtons = document.querySelectorAll('i.fa-pen');\n penButtons.forEach(button => {\n button.addEventListener('click', openTaskEditor)\n })\n\n\n window.addEventListener('keydown', createNewTask);\n}", "title": "" }, { "docid": "69219945a31c10b3209a312e0661a385", "score": "0.66873074", "text": "function addEventListeners() {\n document.getElementById(\"uploadNewFile\").addEventListener(\"click\", openDownloadModal)\n document.getElementById(\"create-folder\").addEventListener(\"click\", openNewFolderWindow)\n document.getElementById(\"dialogClose\").addEventListener(\"click\", closeDownloadModal)\n document.getElementById(\"fileViewerClose\").addEventListener(\"click\", closePreview)\n}", "title": "" }, { "docid": "eaa77a2db1e1a1a4cf54fdeb84184b44", "score": "0.66744995", "text": "function createEventListeners() {\t\t\r\n\tvar tips=document.getElementById(\"tips\");\r\n\tif (tips.addEventListener) {\t\t\t//listen for mouseover of #tips in DOM (tips is the link for buying tips)\r\n\t\ttips.addEventListener(\"click\", toggleDropDown , false);\r\n\t}\t\r\n\t\r\n\tvar bike_clubs=document.getElementById(\"bike_clubs\");\r\n\tif (bike_clubs.addEventListener) {\t\t\t//listen for mouseover of #tips in DOM (tips is the link for buying tips)\r\n\t\tbike_clubs.addEventListener(\"click\", toggleDropDown2 , false);\r\n\t}\t\r\n}", "title": "" }, { "docid": "cc8658ece1663aad9f8334b539c24d22", "score": "0.66743386", "text": "function setupListeners(){\n const $amount = document.getElementById(\"amount\");\n const $sentOrder = document.getElementById(\"enviar-venda\");\n const $addProduct = document.getElementById(\"btn-add\");\n const $openCart = document.getElementById(\"btn-prod\");\n const $btnProduct = document.getElementById(\"btn-newOrder\");\n const $selectProduct = document.getElementById(\"select-products\");\n const $signOut = document.querySelector(\"#signOut\");\n\n $amount.onchange = resetMessages;\n $selectProduct.onchange = resetMessages;\n $openCart.onclick = resetMessages;\n $btnProduct.onclick = newOrder;\n $addProduct.onclick = addProductToCart;\n $sentOrder.onclick = sendNewOrder;\n $signOut.onclick = signOut;\n}", "title": "" }, { "docid": "a2e3a871a2bccee8c24fde6ac661a26d", "score": "0.66724825", "text": "addEventListeners() {\n document.getElementById('addBoard').addEventListener('click', this.handleAddBoardButtonClick);\n const templateButtons = document.getElementsByClassName('js-createBoardByTemplate');\n for (const button of templateButtons) {\n button.addEventListener('click', (event) => {\n event.stopPropagation();\n const templateName = event.currentTarget.getAttribute('data-template-name');\n this.eventBus.call('addBoardByTemplate', templateName);\n });\n }\n }", "title": "" }, { "docid": "d166c09a898a471ff415424fe0b14134", "score": "0.66688585", "text": "function addListeners(useCapturing) {\r\r\n // get all div in list\r\r\n var divList = document.getElementsByTagName('div');\r\r\n // set event to each div\r\r\n for(var i = 0, len = divList.length; i < len; i++) {\r\r\n var element = divList[i];\r\r\n eventUtility.addEvent(element, \"click\", markDiv, useCapturing);\r\r\n }\r\r\n}", "title": "" }, { "docid": "086bc6f5efb25bf6a40b8ebc26d2c757", "score": "0.66520053", "text": "function addListeners () {\n document.querySelector(\"input[name=status]\").addEventListener('change', updateStatus)\n document.querySelector(\"input[name=bluramt]\").addEventListener('change', updateBluramt)\n document.querySelector(\"input[name=grayscale]\").addEventListener('change', updateGrayscale)\n document.querySelector(\"input[name=images]\").addEventListener('change', updateImages)\n document.querySelector(\"input[name=bgimages]\").addEventListener('change', updateBGImages)\n document.querySelector(\"input[name=videos]\").addEventListener('change', updateVideos)\n document.querySelector(\"input[name=iframes]\").addEventListener('change', updateIframes)\n document.querySelector(\"div[name=readmore]\").addEventListener('click', loadFullUpdateMessage)\n document.querySelector(\"div[name=dismiss]\").addEventListener('click', dismissUpdate)\n document.querySelector(\"#btn-whitelist-add\").addEventListener('click', addToWhitelist)\n document.querySelector(\"#btn-whitelist-remove\").addEventListener('click', removeFromWhitelist)\n}", "title": "" }, { "docid": "79cabab581250ab395ad53b18b7763c0", "score": "0.6645437", "text": "function setUpEventListeners() {\n\n // Gaining access to DOMstrings from UIController\n const DOM = UICtrl.getDOMstrings();\n\n document.querySelector(DOM.inputBtn).addEventListener('click', ctrlAddItem)\n\n // Adding to global environment since you can press enter anywhere\n document.addEventListener('keypress', function (event) {\n if (event.keyCode === 13 || event.which === 13) {\n ctrlAddItem();\n }\n });\n\n // Delegate to container element that holds both income and expense items\n // This is to avoid having to add event listener to every individual income/expense item\n // Made possible thanks to EVENT BUBBLING (event propagates from target to root)\n\n document.querySelector(DOM.container).addEventListener('click', ctrDeleteItem);\n\n document.querySelector(DOM.inputType).addEventListener('change', UICtrl.changeType);\n\n\n }", "title": "" }, { "docid": "7c286614d9733d593eaee833886fde03", "score": "0.6644298", "text": "function initDomListeners() {\n document.body.addEventListener(\"click\", (e) => {\n let element = Utils.getTarget(e),\n actions = {\n play : () => newGame(element.dataset.mode),\n mainScreen : () => showMainScreen(),\n highScores : () => showHighScores(),\n help : () => showHelp(),\n endPause : () => endPause(),\n finishGame : () => finishGame(),\n save : () => saveHighScore(),\n showScores : () => scores.show(element.dataset.mode),\n sound : () => sound.toggle(),\n };\n \n if (actions[element.dataset.action]) {\n actions[element.dataset.action]();\n }\n });\n }", "title": "" }, { "docid": "00eb04ef64286f2e18024b240e0c8fd8", "score": "0.6635204", "text": "function createEventHandlers() {\n document.querySelector('#newProfileBtn').addEventListener('click', newProfile);\n\n const items = document.querySelectorAll('.selectBtn');\n for (const i of items) i.addEventListener('click', selectedProfile);\n\n const nameItems = document.querySelectorAll('.profile-name');\n for (const i of nameItems) i.addEventListener('click', clickedName);\n}", "title": "" }, { "docid": "05cc454a7c8716944441f720791ac7da", "score": "0.6623206", "text": "function addMyEventListener(){\n\t$('#saveBtn').click(save);\n\t$('#toListBtn').click(toList);\n\t$('#maxDateBtn').click(maxDate);\n\t$('.form_datetime').click(initDatePicker);\n}", "title": "" }, { "docid": "0528193ecad1e28179e9139d1eac41be", "score": "0.6617116", "text": "addMenuListeners() {\n this.htmlData.menuParents.forEach(el => {\n el.addEventListener(\"click\", () => this.submenuListener(event));\n });\n window.addEventListener(\"resize\", () => this.checkScreenSize(event));\n this.addOutsideListener();\n }", "title": "" }, { "docid": "465d4f9f04bcb99413ad5f07c3423533", "score": "0.66110045", "text": "addEventListeners() {\n document.addEventListener('keydown', (e) => {\n this.eventListener(e, true);\n });\n document.addEventListener('keyup', (e) => {\n this.eventListener(e, false);\n });\n }", "title": "" }, { "docid": "ec259bb62a8c31efa4c57cacc7db9674", "score": "0.6603272", "text": "function createEventListeners() {\n var pizToppings = document.getElementsByName(\"toppings\");\n if (pizToppings[0].addEventListener) {\n for (var i = 0; i < pizToppings.length; i++) {\n pizToppings[i].addEventListener(\"change\", addToppings, false);\n }\n } else if (pizToppings[0].attachEvent) {\n for (var i = 0; i < pizToppings.length; i++) {\n pizToppings[i].attachEvent(\"onchange\", addToppings);\n }\n } \n}", "title": "" }, { "docid": "f47691799ddc9f0f2bb933f1d01e3bb2", "score": "0.6602422", "text": "function addEventListeners() {\n todoInput.addEventListener('keypress', newTodoKeyPressHandler, false); // Adds Event Listener for ToDo Input\n syncbtn.addEventListener('click', syncPressed, false);\n }", "title": "" }, { "docid": "7bbebac9edbc4af8e1fdb91d8169ab7e", "score": "0.65983355", "text": "function AddEventListeners() {\n\tvar DEBUG_AddEventListeners = false;\n\tif ( DEBUG_AddEventListeners ) { console.warn('AddEventListeners[]'); }\n\t//window.addEventListener('resize',_Resized); // Add resize to re-display the schedule. Resized DisplaySchedule\n\t//document.addEventListener('scroll',_Scrolled); // Add resize to re-display the schedule.\n\tvar calendar_classes = document.getElementsByClassName('calendar_class');\n\tfor ( var i=0; i<calendar_classes.length; i++) {\n\t\tvar this_calendar_class = calendar_classes[i];\n\t\tif ( DEBUG_AddEventListeners ) { console.log('Adding click EventListener for '+this_calendar_class.id); }\n\t\tthis_calendar_class.addEventListener('click',ScheduleClass_OpenEdit); // Add click for class meeting edit.\n\t\tif ( DEBUG_AddEventListeners ) { console.log('Adding mousedown EventListener for '+this_calendar_class.id); }\n\t\tthis_calendar_class.addEventListener('mousedown',ScheduleClassDragCheck); // Add mousedown for drag and drop.\n\t}\n} // END AddEventListeners.", "title": "" }, { "docid": "e3d7d8b8c1d42f3158cefdd384879280", "score": "0.65966296", "text": "function addEvents() {\n find('.menu-button').addEventListener('click', function () {\n if (document.body.classList.contains('showlist')) {\n scrollAnimation.setEndValue(0);\n } else {\n scrollAnimation.setEndValue(1);\n }\n });\n // due to a strange iOS behavior, the play action has\n // to be separated from anything else, otherwise\n // player won't play at all.\n find('.fa-play').addEventListener('click', function () {\n if (playerLoaded) {\n scPlayer.play();\n }\n });\n\n find('.fa-pause').addEventListener('click', function () {\n if (scPlayer) {\n scPlayer.pause();\n clearInterval(scTimer);\n }\n this.style.display = 'none';\n find('.fa-play').style.display = 'block';\n });\n doPlaylist();\n }", "title": "" }, { "docid": "74bfadbbd90960428c09130a2877e940", "score": "0.6594075", "text": "function initializeListeners() {\n\telement.saveButton.addEventListener('click', save);\n\telement.resetButton.addEventListener('click', reset);\n\telement.CSSClassNameInput.addEventListener('input', update);\n\telement.frequencyInput.addEventListener('input', update);\n\n\tfor (const styleMode of element.styleModes) {\n\t\tstyleMode.addEventListener('click', update);\n\t}\n}", "title": "" }, { "docid": "35fba6be69639194e9cc7d3bc0e9fe8e", "score": "0.6592978", "text": "_setupListeners() {\n this._handleWindowClick = this._handleWindowClickH.bind(this);\n document.addEventListener('click', this._handleWindowClick);\n this._handleResize = debounce(this._handleResizeH.bind(this), 100);\n window.addEventListener('resize', this._handleResize);\n this._handleKeyDown = this._handleKeyDownH.bind(this);\n this.el.addEventListener('keydown', this._handleKeyDown);\n this._handleFocus = this._handleFocusH.bind(this);\n document.addEventListener('focus', this._handleFocus, true);\n this._handleBlur = this._handleBlurH.bind(this);\n document.addEventListener('blur', this._handleBlur, true);\n this._handleVisibleChildren = this._handleVisibleChildrenH.bind(this);\n document.addEventListener('spark.visible-children', this._handleVisibleChildren, true);\n }", "title": "" }, { "docid": "b4ff8c9aa54c27c0794f76eadebef234", "score": "0.6578648", "text": "function addEventListeners() {\n canvas.addEventListener('keydown', onKeyDown, false);\n canvas.addEventListener('keyup', onKeyUp, false);\n canvas.addEventListener('mousemove', onMouseMove, false);\n canvas.addEventListener('mousedown', onMouseDown, false);\n canvas.addEventListener('mouseup', onMouseUp, false);\n }", "title": "" }, { "docid": "b5877c516f9a83afc46bf568a3bf2eb4", "score": "0.6578338", "text": "function add_button_listeners() {\n\tadd_listener_to_book_buttons();\n\tadd_listener_to_confirm_buttons();\n\tchange_buttons();\n}", "title": "" }, { "docid": "16aa2590d43abf80ac1f8371a80750ee", "score": "0.65753406", "text": "function cargarEventListeners(){\n //Evento Cargar DOM\n document.addEventListener('DOMContentLoaded',cargarItems);\n //Evento Agregar Item\n btnAgregar.addEventListener('click', agregarItem);\n //Evento Eliminar Item\n listaItems.addEventListener('click',eliminarItem);\n //Evento Tachar Item\n listaItems.addEventListener('click',tacharItem);\n //Evento Borrar Todo\n btnLimpiar.addEventListener('click',borrarTodo);\n //Evento Filtrar\n filtro.addEventListener('keyup',filtrarItems);\n}", "title": "" }, { "docid": "413bf4703642ab8427b0aa830b259282", "score": "0.65750766", "text": "initListeners() {\n // main ui component toggles visibility of the calendar body\n this.uiComponents.outerContainer.addEventListener('click', (e) => {\n if (e.target !== this.uiComponents.outerContainer) return;\n this.open = !this.open;\n // const currViz = this.uiComponents.calendarBody.style.visibility;\n // this.uiComponents.calendarBody.style.visibility = currViz === 'hidden' ? 'visible' : 'hidden';\n });\n\n this.iterators.left.addEventListener('mousedown', () => {\n if (this.disabled) return;\n this.iterateWeek(-1);\n });\n\n this.iterators.right.addEventListener('mousedown', () => {\n if (this.disabled) return;\n this.iterateWeek(1);\n });\n }", "title": "" }, { "docid": "bf49511ac10b8812783ffa8685f859a6", "score": "0.65672326", "text": "function attachListeners() {\n\t// starts a game as soon as a click is done on the table\n\t$('td').on('click', function(event){\n\t\tdoTurn(event);\n\t})\n\n\t// switches the game when any of the elements from the #game div is clicked\n\t$(\"#games\").click(function(event) {\n\t\tvar state = parseState(event)\n\t\tswapGame(state, getGameId(event))\n\t});\t\n\n\t// saves the game when #save button is clicked\n\t$(\"button#save\").click(function(event) {\n\t\tsaveGame();\n\t});\t\n\n\t// shows previous games when the #previous button is clicked\n\t$(\"button#previous\").on(\"click\", getPreviousGames);\n}", "title": "" }, { "docid": "af079a915df204f3966820ef46d04ab3", "score": "0.6559747", "text": "function bindEventHandlers() {\n startEl.addEventListener(\"click\", startQuiz);\n submitEl.addEventListener(\"click\", saveScore);\n choice1El.addEventListener(\"click\", answerQuestion);\n choice2El.addEventListener(\"click\", answerQuestion);\n choice3El.addEventListener(\"click\", answerQuestion);\n choice4El.addEventListener(\"click\", answerQuestion);\n\n goBackBtnEl.addEventListener(\"click\", backtoStart);\n clearBtnEl.addEventListener(\"click\", clearHighscores);\n}", "title": "" }, { "docid": "05646ce08d4bed047e6a9780d3b1b2ed", "score": "0.6554499", "text": "function listener(){\r\n document.getElementById(\"home\").addEventListener('click', clickHome)\r\n document.getElementById(\"blog\").addEventListener('click', clickBlog)\r\n document.getElementById(\"projects\").addEventListener('click', clickProjects)\r\n document.getElementById(\"about\").addEventListener('click', clickAbout)\r\n document.getElementById(\"contact\").addEventListener('click', clickContact)\r\n}", "title": "" }, { "docid": "b49da0a7103ad757e219ef68c194f477", "score": "0.65492857", "text": "function loadEventListeners(){\n\n \n // Add new tasks\n form.addEventListener('submit', addTask);\n\n // Delete tasks one-by-one\n // taskList.addEventListener('click', removeItem);\n\n // Clear all tasks on the list\n clearBtn.addEventListener('click', removeAll);\n\n // Filter Event\n filter.addEventListener('input', filterTasks);\n }", "title": "" }, { "docid": "d149a01b58a36454b24be9393d64d526", "score": "0.65277946", "text": "function loadEvents() {\r\n document.querySelector('form').addEventListener('submit', submit);\r\n document.getElementById('clear').addEventListener('click', clearList);\r\n document.querySelector('ul').addEventListener('click', deleteItems);\r\n}", "title": "" }, { "docid": "dbfcdcdc08be7fa6275d9a93b98316b3", "score": "0.6527025", "text": "function setEventHandlers() {\n document.getElementById(\"loadprev\").addEventListener('click', load_prev, false);\n document.getElementById(\"loadnext\").addEventListener('click', load_next, false);\n }", "title": "" }, { "docid": "6ff4d2e56a80c469169b53fd89f27f72", "score": "0.6526865", "text": "function addRedandYellowListeners(){\n\t\tconsole.log('setting listeners')\n\t\tfor (var i = $boxes.length-1; i>=0; i--){\n\t\t\tvar $box = $($boxes[i]);\n\t\t\t$box.on('click', addRedorYellow)\n\t\t}\n\t}", "title": "" }, { "docid": "67e9294bcfc7c0d2e081d8f20d8a2b21", "score": "0.6520145", "text": "function startListeners(options) {\n $(document).on('click', options.button, function() {\n toggleLightbox();\n });\n $(document).on('click', options.curtainId, function() {\n toggleLightbox();\n });\n // If an additional button is defined, add the listener to it.\n if (options.closeButtonId !== undefined) {\n $(document).on('click', options.closeButtonId, function() {\n toggleLightbox();\n });\n }\n }", "title": "" }, { "docid": "c9e420d6293f7ba60fc28df264503623", "score": "0.6519783", "text": "function initListeners() {\n $('#key').on('click', '.key-show-control', function(ev) {\n dispatch.keyShowLine($(this).data('line-id'));\n });\n\n $('#key').on('click', 'a.key-duplicate-control', function(ev) {\n ev.preventDefault();\n dispatch.keyDuplicateLine($(this).data('line-id'));\n });\n\n $('#key').on('click', 'a.key-delete-control', function(ev) {\n ev.preventDefault();\n dispatch.keyDeleteLine($(this).data('line-id'));\n });\n\n $('#key').on('click', 'a.key-edit-control', function(ev) {\n ev.preventDefault();\n dispatch.keyEditLine($(this).data('line-id'));\n });\n }", "title": "" }, { "docid": "3aa251ba6c26b2b3d661e9b4668bbd8e", "score": "0.6518053", "text": "function createEventListeners(){\r\n\r\n //~~~~~~~~~~~~~~~Lesson 3 - Event Listeners~~~~~~~~~~~~~~~~~~//\r\n //Event Listeners - backward compatible\r\n //Event Listener for the reset button\r\n var reset = document.getElementById('btn_reset');\r\n\r\n try{\r\n if (reset.addEventListener) {\r\n reset.addEventListener(\"click\", clear_cFlowForm, false);\r\n } else if (reset.attachEvent) {\r\n reset.attachEvent(\"onclick\", clear_cFlowForm);\r\n }\r\n }catch(err){\r\n console.log(\"Reset event error !\" + err.message)\r\n }\r\n\r\n //Event Listener for the displayPrimeNumbers button\r\n var getPrimes = document.getElementById('btn_getPrimes');\r\n\r\n try{\r\n if (getPrimes.addEventListener) {\r\n getPrimes.addEventListener(\"click\", displayPrimeNumbers, false);\r\n } else if (getPrimes.attachEvent) {\r\n getPrimes.attachEvent(\"onclick\", displayPrimeNumbers);\r\n }\r\n }catch(err){\r\n console.log(\"Primes event error !\" + err.message)\r\n }\r\n //~~~~~~~~~~~~~~~Lesson 2 - Event Listeners~~~~~~~~~~~~~~~~~~~//\r\n //Event Listener for the Calculate BMI button\r\n var calc_BMI = document.getElementById('btn_calculate');\r\n\r\n try{\r\n if (calc_BMI.addEventListener) {\r\n calc_BMI.addEventListener(\"click\", calcBMI, false);\r\n } else if (calc_BMI.attachEvent) {\r\n calc_BMI.attachEvent(\"onclick\", calcBMI);\r\n }\r\n }catch(err){\r\n console.log(\"BMI event error!\" + err.message)\r\n }\r\n}", "title": "" }, { "docid": "3aa251ba6c26b2b3d661e9b4668bbd8e", "score": "0.6518053", "text": "function createEventListeners(){\r\n\r\n //~~~~~~~~~~~~~~~Lesson 3 - Event Listeners~~~~~~~~~~~~~~~~~~//\r\n //Event Listeners - backward compatible\r\n //Event Listener for the reset button\r\n var reset = document.getElementById('btn_reset');\r\n\r\n try{\r\n if (reset.addEventListener) {\r\n reset.addEventListener(\"click\", clear_cFlowForm, false);\r\n } else if (reset.attachEvent) {\r\n reset.attachEvent(\"onclick\", clear_cFlowForm);\r\n }\r\n }catch(err){\r\n console.log(\"Reset event error !\" + err.message)\r\n }\r\n\r\n //Event Listener for the displayPrimeNumbers button\r\n var getPrimes = document.getElementById('btn_getPrimes');\r\n\r\n try{\r\n if (getPrimes.addEventListener) {\r\n getPrimes.addEventListener(\"click\", displayPrimeNumbers, false);\r\n } else if (getPrimes.attachEvent) {\r\n getPrimes.attachEvent(\"onclick\", displayPrimeNumbers);\r\n }\r\n }catch(err){\r\n console.log(\"Primes event error !\" + err.message)\r\n }\r\n //~~~~~~~~~~~~~~~Lesson 2 - Event Listeners~~~~~~~~~~~~~~~~~~~//\r\n //Event Listener for the Calculate BMI button\r\n var calc_BMI = document.getElementById('btn_calculate');\r\n\r\n try{\r\n if (calc_BMI.addEventListener) {\r\n calc_BMI.addEventListener(\"click\", calcBMI, false);\r\n } else if (calc_BMI.attachEvent) {\r\n calc_BMI.attachEvent(\"onclick\", calcBMI);\r\n }\r\n }catch(err){\r\n console.log(\"BMI event error!\" + err.message)\r\n }\r\n}", "title": "" }, { "docid": "2a6d041e9f72b6b763a5c2a69429b0b0", "score": "0.65064496", "text": "function set_event_listeners() {\n\n // Gets the Motions' Radio options\n motions_radios = document.getElementsByName(\"motions_radios\");\n\n // Gets the Camera View's Radio options\n camera_view_radios = document.getElementsByName(\"camera_view_radios\");\n\n // When the Motions' Radio change, calls the given function\n document.addEventListener('onchange', on_change_motions);\n\n // When the Camera View's Radio change, calls the given function\n document.addEventListener('onchange', on_change_camera_view);\n\n // When any change occurs in the Scene (Atom Representation Scene),\n // calls the given function\n controls.addEventListener('change', render);\n\n // When the window is resized, calls the given function\n window.addEventListener('resize', on_window_resize, false);\n\n // When the mouse moves, calls the given function\n document.addEventListener('mousemove', on_document_mouse_move, false);\n\n}", "title": "" }, { "docid": "1fcf6d982e5ed734804cc66f45d33426", "score": "0.6504631", "text": "invokeItemListeners() {\n this.addItemButton = document.querySelectorAll('#add-item-button')\n this.newItemForms = document.querySelectorAll('#new-item-form')\n\n for (let form of this.newItemForms) {\n form.addEventListener('submit', this.createItems.bind(this))\n }\n\n if (this.addItemButton) {\n this.addItemButton.forEach(button => {\n button.addEventListener('click', this.renderNewItemForm.bind(this))\n })\n }\n }", "title": "" }, { "docid": "977060516ec36b306f83d7a0e0ae823d", "score": "0.65003085", "text": "function createEventListeners() {\n var leftarrow = document.getElementById(\"leftarrow\");\n if (leftarrow.addEventListener) {\n leftarrow.addEventListener(\"click\", leftArrow, false); \n } else if (leftarrow.attachEvent) {\n leftarrow.attachEvent(\"onclick\", leftArrow);\n }\n\n var rightarrow = document.getElementById(\"rightarrow\");\n if (rightarrow.addEventListener) {\n rightarrow.addEventListener(\"click\", rightArrow, false); \n } else if (rightarrow.attachEvent) {\n rightarrow.attachEvent(\"onclick\", rightArrow);\n }\n\n var mainFig = document.getElementsByTagName(\"img\")[1];\n if (mainFig.addEventListener) {\n mainFig.addEventListener(\"click\", zoomFig, false); \n } else if (mainFig.attachEvent) {\n mainFig.attachEvent(\"onclick\", zoomFig);\n }\n \n var showAllButton = document.querySelector(\"#fiveButton p\");\n if (showAllButton.addEventListener) {\n showAllButton.addEventListener(\"click\", previewFive, false);\n } else if (showAllButton.attachEvent) {\n showAllButton.attachEvent(\"onclick\", previewFive);\n }\n}", "title": "" }, { "docid": "a240ea79d296fa9b5efb98765c40edb0", "score": "0.6499248", "text": "function setupListeners() {\n var prev = document.getElementById('prev-page');\n var next = document.getElementById('next-page');\n prev.addEventListener('click', toPrevPage);\n next.addEventListener('click', toNextPage);\n}", "title": "" }, { "docid": "ce5b3693bd74866383b9550fa1f49554", "score": "0.649707", "text": "function listeners() {\n $(document).on('click', '.competition-closed-form-submit', formSubmitClicked)\n .on('submit', '.competition-closed-form', formSubmit)\n .on('click', '.outbound-link', tracklink);\n\n if ( 'onorientationchange' in window ) {\n $(window).on('onorientationchange', orientationchanged);\n } else {\n $(window).on('resize', resize);\n }\n }", "title": "" }, { "docid": "d1d33a18444c7edf94d217592b039d14", "score": "0.6495519", "text": "bindDOMElements() {\n this.$container.find('.item').on('click', this.onMenuItemClick.bind(this));\n\n if( !/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {\n this.$container.find('.item').on('mouseover', this.onMenuItemMouseOver.bind(this));\n this.$container.find('.item').on('mouseout', this.onMenuItemMouseOut.bind(this));\n }\n\n this.$container.find('.submenu').on('click', this.onSubMenuContainerClick.bind(this));\n }", "title": "" }, { "docid": "6b9fa25c7aff7b3e8dbd3a83d3ca6f3f", "score": "0.649499", "text": "function addListeners() {\n // import markdown from apply url\n var btnImportJobDetails = document.querySelector('.btn-import');\n\n btnImportJobDetails.addEventListener('click', function(e) {\n var url = document.querySelector('#form-apply-url').value;\n\n getMarkdownFromJobListing(url);\n });\n\n // update the md preview LIVE window when textarea changes...\n markdownSrc.addEventListener('keyup', e => {\n var val = e.target.value;\n showMdPreview(val);\n });\n\n // add submit form listener\n var btnNext = document.querySelector('#btn-next');\n btnNext.addEventListener('click', submitForm);\n}", "title": "" }, { "docid": "d16a477caea59e8f22884cfea01f8acc", "score": "0.64943355", "text": "registerDomEvents() {/*To be overridden in sub class as needed*/}", "title": "" }, { "docid": "1748b1e027bfa58c99575c564bc1ec83", "score": "0.64930826", "text": "function createListeners() {\n\tvar names = [\"kapitel\", \"gruppe\", \"zaehlnr\", \"funktion\"];\n\tvar name = null;\n\n\tfor (var j = 0; j < names.length; j++) {\n\t\tfor (var i = 1; i <= g_maxFormFields; i++) {\n\t\t\tname = names[j] + 'Text' + i;\n\t\t\tobj = new Object();\n\t\t\tobj.name = names[j];\n\t\t\tobj.index = i;\n\t\t\tExt.get(name).on('change', function() { handleSelect(this.name, this.index); }, obj);\n\t\t}\n\t\tresetForms(names[j]);\n\t}\n}", "title": "" }, { "docid": "94bf5447285a1b8d87cd0c9652c46dde", "score": "0.6492481", "text": "function addEventListeners() {\n document.getElementById('intervalSelect').addEventListener('change', function () {\n var int = wrt.interval = this.value;\n if (int > 0) {\n // it is not scheduled, schedule it\n if (!wrt.isScheduled) {\n reschedule(int);\n }\n } else {\n // stop the scheduling\n stopSchedule();\n }\n });\n\n document.getElementById('resetDatabase').addEventListener('click', function () {\n if (confirm('This will delete the database file. Are you sure?')) {\n var ajax = new XMLHttpRequest();\n ajax.onreadystatechange = function () {\n // noinspection EqualityComparisonWithCoercionJS\n if (this.readyState == 4 && this.status == 204) {\n location.reload();\n }\n };\n ajax.open('GET', basePath + '/usage_reset', true);\n ajax.send();\n }\n });\n\n document.getElementById('perHostTotals').addEventListener('change', function () {\n wrt.perHostTotals = !wrt.perHostTotals;\n });\n }", "title": "" }, { "docid": "d123d8345c664c0eff2a7b5379223d90", "score": "0.6485606", "text": "function eventLoader() {\n var p = document.getElementsByName(\"p\");\n for (var i = 0; i < p.length; ++i) {\n p[i].addEventListener(\"click\", loadElementsToEditView());\n }\n var img = document.getElementsByTagName(\"img\");\n for (var i = 0; i < img.length; ++i) {\n img[i].addEventListener(\"click\", loadElementsToEditView());\n }\n}", "title": "" }, { "docid": "d7d2c3154864d3b781d61b7614b5e45b", "score": "0.6484765", "text": "function loadEvents() {\r\n document.querySelector('form').addEventListener('submit', submit);\r\n document.getElementById('clear').addEventListener('click', clearList);\r\n // recently added\r\n document.querySelector('ul').addEventListener('click', deleteOrTick);\r\n\r\n}", "title": "" }, { "docid": "1888680fc513f7918f8ad2f8a3bc2120", "score": "0.64820755", "text": "function addListeners(){\r\ndocument.getElementById(\"choice1\").addEventListener(\"click\",choice1Select);\r\ndocument.getElementById(\"choice2\").addEventListener(\"click\",choice2Select);\r\ndocument.getElementById(\"choice3\").addEventListener(\"click\",choice3Select);\r\ndocument.getElementById(\"choice4\").addEventListener(\"click\",choice4Select);\r\n}", "title": "" }, { "docid": "cf24f7a6cdc89834ca0ddb233272ef4a", "score": "0.6481079", "text": "addEventListeners() {\n // Empty in base class.\n }", "title": "" }, { "docid": "1a9fb485b8fd4f173ee775b225a892e3", "score": "0.64795995", "text": "function addEventListeners() {\n imageParts.forEach((image) => {\n imagePartsDiv.appendChild(image);\n image.addEventListener(\"dragstart\", dragStart);\n });\n sectionImageDiv = imagePartsDiv.querySelectorAll(\"div\");\n\n imagePlaceholders.forEach((placeholder) => {\n placeholder.addEventListener(\"dragover\", dragOver);\n placeholder.addEventListener(\"drop\", dragDrop);\n placeholder.addEventListener(\"dragenter\", dragEnter);\n placeholder.addEventListener(\"dragleave\", dragLeave);\n placeholder.addEventListener(\"dragstart\", dragStart);\n });\n\n replayButton.addEventListener(\"click\", () => location.reload());\n backdrop.addEventListener(\"click\", () => backdrop.classList.add(\"hidden\"));\n}", "title": "" }, { "docid": "fdb928322e82ddc0b44bc22e62982180", "score": "0.6479028", "text": "function loadEvents(){\n document.querySelector('form').addEventListener('submit',handleSubmit);\n document.getElementById('clear').addEventListener('click',clearList);\n document.querySelector('ul').addEventListener('click',deleteCmd);\n}", "title": "" }, { "docid": "910a95da3f84d85bf29ccb662feb9194", "score": "0.6473907", "text": "_initEvents () {\n this.el.addEventListener('click', (e) => {\n if (e.target.dataset.action in this.actions) {\n this.actions[e.target.dataset.action](e.target);\n } else this._checkForLi(e.target);\n });\n }", "title": "" }, { "docid": "8e7f55d66397c7c03507bf1479be45e8", "score": "0.6470077", "text": "function events() {\n var lis = document.getElementsByTagName(\"li\");\n for(var i = 0; i < lis.length; i++) {\n\tlis[i].addEventListener(\"click\", function() {\n\t cashRegister.scan(this.innerHTML.toLowerCase(), 1);\n\t document.getElementsByTagName(\"h4\")[0].innerHTML=\"Your totoal: \" + cashRegister.total;\n\t var li = document.createElement(\"li\");\n\t li.innerHTML = this.innerHTML;\n\t document.getElementById(\"basket\").appendChild(li);\n\t});\n }\n}", "title": "" }, { "docid": "f82f65859d70c325dae86c3cc3e3343f", "score": "0.6466945", "text": "_addEvents () {\n this.container.classList.add(\"tooltiped\");\n\n this.container.addEventListener(\"mouseenter\", this._mouseOver.bind(this));\n this.container.addEventListener(\"mousemove\", this._mouseMove.bind(this));\n this.container.addEventListener(\"mouseleave\", this._mouseOut.bind(this));\n }", "title": "" }, { "docid": "082d3bb68c13f63e289c95ff33e106e1", "score": "0.64607316", "text": "function attachListeners() {\n var radioEls = document.querySelectorAll('input[type=\"radio\"]');\n for (var i = 0; i < radioEls.length; ++i) {\n radioEls[i].addEventListener('click', onRadioClicked);\n }\n\n // Wire up the 'click' event for each function's button.\n var functionEls = document.querySelectorAll('.function');\n for (var i = 0; i < functionEls.length; ++i) {\n var functionEl = functionEls[i];\n var id = functionEl.getAttribute('id');\n var buttonEl = functionEl.querySelector('button');\n\n // The function name matches the element id.\n var func = window[id];\n buttonEl.addEventListener('click', func);\n }\n\n $('pipe_input_box').addEventListener('keypress', onPipeInput)\n $('pipe_output').disabled = true;\n\n $('pipe_name').addEventListener('change',\n function() { $('pipe_output').value = ''; })\n}", "title": "" }, { "docid": "09fe57184bc05c4a8f33c9d079bb7fcc", "score": "0.645827", "text": "function addEvents() {\n for (let index = 0; index < boxs.length; index ++) {\n boxs[index].addEventListener('mouseenter', mouseEnter,true);\n boxs[index].addEventListener('mouseleave', mouseLeave, true);\n boxs[index].addEventListener('click', mouseClick, true);\n }\n}", "title": "" }, { "docid": "b82b10c13491a226b9fccf8c3a76e1e1", "score": "0.6457441", "text": "_addEventsListeners ()\n {\n this._onChange();\n }", "title": "" }, { "docid": "1be7154bbbb3bc6ef695e960e3fabf6c", "score": "0.6456096", "text": "setEvents(){\n const listElements = this.el.childNodes;\n for(let i = 0; i < listElements.length; i++){\n listElements[i].addEventListener('mousedown',this.onItemClickedEvent,true);\n }\n }", "title": "" }, { "docid": "3840b410bfa0a31308cd48b78611a8ad", "score": "0.6453545", "text": "function addAllPageEvents(){\n\taddMouseEvents();\n\taddKeyPressEvents();\n\taddButtonEvents();\n}", "title": "" }, { "docid": "10c3562561c0befa1fc6ad4a57dce19b", "score": "0.64479136", "text": "function addListeners(els, fnc) {\n for(var i = 0; i < els.length; i++) {\n\tels[i].addEventListener('click', fnc, false);\n }\n}", "title": "" } ]
52316aaf82146a47c213ec8c871d73bc
ChunkStreamer is the base prototype for various streamer implementations.
[ { "docid": "bf6cc5dac5ced31635c283856498a911", "score": "0.6637304", "text": "function ChunkStreamer(config)\n\t{\n\t\tthis._handle = null;\n\t\tthis._paused = false;\n\t\tthis._finished = false;\n\t\tthis._input = null;\n\t\tthis._baseIndex = 0;\n\t\tthis._partialLine = '';\n\t\tthis._rowCount = 0;\n\t\tthis._start = 0;\n\t\tthis._nextChunk = null;\n\t\tthis.isFirstChunk = true;\n\t\tthis._completeResults = {\n\t\t\tdata: [],\n\t\t\terrors: [],\n\t\t\tmeta: {}\n\t\t};\n\t\treplaceConfig.call(this, config);\n\n\t\tthis.parseChunk = function(chunk)\n\t\t{\n\t\t\t// First chunk pre-processing\n\t\t\tif (this.isFirstChunk && isFunction(this._config.beforeFirstChunk))\n\t\t\t{\n\t\t\t\tvar modifiedChunk = this._config.beforeFirstChunk(chunk);\n\t\t\t\tif (modifiedChunk !== undefined)\n\t\t\t\t\tchunk = modifiedChunk;\n\t\t\t}\n\t\t\tthis.isFirstChunk = false;\n\n\t\t\t// Rejoin the line we likely just split in two by chunking the file\n\t\t\tvar aggregate = this._partialLine + chunk;\n\t\t\tthis._partialLine = '';\n\n\t\t\tvar results = this._handle.parse(aggregate, this._baseIndex, !this._finished);\n\n\t\t\tif (this._handle.paused() || this._handle.aborted())\n\t\t\t\treturn;\n\n\t\t\tvar lastIndex = results.meta.cursor;\n\n\t\t\tif (!this._finished)\n\t\t\t{\n\t\t\t\tthis._partialLine = aggregate.substring(lastIndex - this._baseIndex);\n\t\t\t\tthis._baseIndex = lastIndex;\n\t\t\t}\n\n\t\t\tif (results && results.data)\n\t\t\t\tthis._rowCount += results.data.length;\n\n\t\t\tvar finishedIncludingPreview = this._finished || (this._config.preview && this._rowCount >= this._config.preview);\n\n\t\t\tif (IS_PAPA_WORKER)\n\t\t\t{\n\t\t\t\tglobal.postMessage({\n\t\t\t\t\tresults: results,\n\t\t\t\t\tworkerId: Papa.WORKER_ID,\n\t\t\t\t\tfinished: finishedIncludingPreview\n\t\t\t\t});\n\t\t\t}\n\t\t\telse if (isFunction(this._config.chunk))\n\t\t\t{\n\t\t\t\tthis._config.chunk(results, this._handle);\n\t\t\t\tif (this._paused)\n\t\t\t\t\treturn;\n\t\t\t\tresults = undefined;\n\t\t\t\tthis._completeResults = undefined;\n\t\t\t}\n\n\t\t\tif (!this._config.step && !this._config.chunk) {\n\t\t\t\tthis._completeResults.data = this._completeResults.data.concat(results.data);\n\t\t\t\tthis._completeResults.errors = this._completeResults.errors.concat(results.errors);\n\t\t\t\tthis._completeResults.meta = results.meta;\n\t\t\t}\n\n\t\t\tif (finishedIncludingPreview && isFunction(this._config.complete) && (!results || !results.meta.aborted))\n\t\t\t\tthis._config.complete(this._completeResults, this._input);\n\n\t\t\tif (!finishedIncludingPreview && (!results || !results.meta.paused))\n\t\t\t\tthis._nextChunk();\n\n\t\t\treturn results;\n\t\t};\n\n\t\tthis._sendError = function(error)\n\t\t{\n\t\t\tif (isFunction(this._config.error))\n\t\t\t\tthis._config.error(error);\n\t\t\telse if (IS_PAPA_WORKER && this._config.error)\n\t\t\t{\n\t\t\t\tglobal.postMessage({\n\t\t\t\t\tworkerId: Papa.WORKER_ID,\n\t\t\t\t\terror: error,\n\t\t\t\t\tfinished: false\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\n\t\tfunction replaceConfig(config)\n\t\t{\n\t\t\t// Deep-copy the config so we can edit it\n\t\t\tvar configCopy = copy(config);\n\t\t\tconfigCopy.chunkSize = parseInt(configCopy.chunkSize);\t// parseInt VERY important so we don't concatenate strings!\n\t\t\tif (!config.step && !config.chunk)\n\t\t\t\tconfigCopy.chunkSize = null; // disable Range header if not streaming; bad values break IIS - see issue #196\n\t\t\tthis._handle = new ParserHandle(configCopy);\n\t\t\tthis._handle.streamer = this;\n\t\t\tthis._config = configCopy;\t// persist the copy to the caller\n\t\t}\n\t}", "title": "" } ]
[ { "docid": "f7f0596b4a7404eaaeb5df8a38d86ccf", "score": "0.66855365", "text": "function Stream() {\n this.head = new Chunk(this);\n }", "title": "" }, { "docid": "f7f0596b4a7404eaaeb5df8a38d86ccf", "score": "0.66855365", "text": "function Stream() {\n this.head = new Chunk(this);\n }", "title": "" }, { "docid": "f7f0596b4a7404eaaeb5df8a38d86ccf", "score": "0.66855365", "text": "function Stream() {\n this.head = new Chunk(this);\n }", "title": "" }, { "docid": "c44920417a0da31b3d613f3ece6f98d1", "score": "0.6674898", "text": "function ChunkStreamer(config)\n\t{\n\t\tthis._handle = null;\n\t\tthis._finished = false;\n\t\tthis._completed = false;\n\t\tthis._input = null;\n\t\tthis._baseIndex = 0;\n\t\tthis._partialLine = '';\n\t\tthis._rowCount = 0;\n\t\tthis._start = 0;\n\t\tthis._nextChunk = null;\n\t\tthis.isFirstChunk = true;\n\t\tthis._completeResults = {\n\t\t\tdata: [],\n\t\t\terrors: [],\n\t\t\tmeta: {}\n\t\t};\n\t\treplaceConfig.call(this, config);\n\n\t\tthis.parseChunk = function(chunk, isFakeChunk)\n\t\t{\n\t\t\t// First chunk pre-processing\n\t\t\tif (this.isFirstChunk && isFunction(this._config.beforeFirstChunk))\n\t\t\t{\n\t\t\t\tvar modifiedChunk = this._config.beforeFirstChunk(chunk);\n\t\t\t\tif (modifiedChunk !== undefined)\n\t\t\t\t\tchunk = modifiedChunk;\n\t\t\t}\n\t\t\tthis.isFirstChunk = false;\n\n\t\t\t// Rejoin the line we likely just split in two by chunking the file\n\t\t\tvar aggregate = this._partialLine + chunk;\n\t\t\tthis._partialLine = '';\n\n\t\t\tvar results = this._handle.parse(aggregate, this._baseIndex, !this._finished);\n\n\t\t\tif (this._handle.paused() || this._handle.aborted())\n\t\t\t\treturn;\n\n\t\t\tvar lastIndex = results.meta.cursor;\n\n\t\t\tif (!this._finished)\n\t\t\t{\n\t\t\t\tthis._partialLine = aggregate.substring(lastIndex - this._baseIndex);\n\t\t\t\tthis._baseIndex = lastIndex;\n\t\t\t}\n\n\t\t\tif (results && results.data)\n\t\t\t\tthis._rowCount += results.data.length;\n\n\t\t\tvar finishedIncludingPreview = this._finished || (this._config.preview && this._rowCount >= this._config.preview);\n\n\t\t\tif (IS_PAPA_WORKER)\n\t\t\t{\n\t\t\t\tglobal.postMessage({\n\t\t\t\t\tresults: results,\n\t\t\t\t\tworkerId: Papa.WORKER_ID,\n\t\t\t\t\tfinished: finishedIncludingPreview\n\t\t\t\t});\n\t\t\t}\n\t\t\telse if (isFunction(this._config.chunk) && !isFakeChunk)\n\t\t\t{\n\t\t\t\tthis._config.chunk(results, this._handle);\n\t\t\t\tif (this._handle.paused() || this._handle.aborted())\n\t\t\t\t\treturn;\n\t\t\t\tresults = undefined;\n\t\t\t\tthis._completeResults = undefined;\n\t\t\t}\n\n\t\t\tif (!this._config.step && !this._config.chunk) {\n\t\t\t\tthis._completeResults.data = this._completeResults.data.concat(results.data);\n\t\t\t\tthis._completeResults.errors = this._completeResults.errors.concat(results.errors);\n\t\t\t\tthis._completeResults.meta = results.meta;\n\t\t\t}\n\n\t\t\tif (!this._completed && finishedIncludingPreview && isFunction(this._config.complete) && (!results || !results.meta.aborted)) {\n\t\t\t\tthis._config.complete(this._completeResults, this._input);\n\t\t\t\tthis._completed = true;\n\t\t\t}\n\n\t\t\tif (!finishedIncludingPreview && (!results || !results.meta.paused))\n\t\t\t\tthis._nextChunk();\n\n\t\t\treturn results;\n\t\t};\n\n\t\tthis._sendError = function(error)\n\t\t{\n\t\t\tif (isFunction(this._config.error))\n\t\t\t\tthis._config.error(error);\n\t\t\telse if (IS_PAPA_WORKER && this._config.error)\n\t\t\t{\n\t\t\t\tglobal.postMessage({\n\t\t\t\t\tworkerId: Papa.WORKER_ID,\n\t\t\t\t\terror: error,\n\t\t\t\t\tfinished: false\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\n\t\tfunction replaceConfig(config)\n\t\t{\n\t\t\t// Deep-copy the config so we can edit it\n\t\t\tvar configCopy = copy(config);\n\t\t\tconfigCopy.chunkSize = parseInt(configCopy.chunkSize);\t// parseInt VERY important so we don't concatenate strings!\n\t\t\tif (!config.step && !config.chunk)\n\t\t\t\tconfigCopy.chunkSize = null; // disable Range header if not streaming; bad values break IIS - see issue #196\n\t\t\tthis._handle = new ParserHandle(configCopy);\n\t\t\tthis._handle.streamer = this;\n\t\t\tthis._config = configCopy;\t// persist the copy to the caller\n\t\t}\n\t}", "title": "" }, { "docid": "0f073340d87653366e87e4d9a75ff648", "score": "0.66374576", "text": "function ChunkStreamer(config)\n\t{\n\t\tthis._handle = null;\n\t\tthis._paused = false;\n\t\tthis._finished = false;\n\t\tthis._input = null;\n\t\tthis._baseIndex = 0;\n\t\tthis._partialLine = \"\";\n\t\tthis._rowCount = 0;\n\t\tthis._start = 0;\n\t\tthis._nextChunk = null;\n\t\tthis.isFirstChunk = true;\n\t\tthis._completeResults = {\n\t\t\tdata: [],\n\t\t\terrors: [],\n\t\t\tmeta: {}\n\t\t};\n\t\treplaceConfig.call(this, config);\n\n\t\tthis.parseChunk = function(chunk)\n\t\t{\n\t\t\t// First chunk pre-processing\n\t\t\tif (this.isFirstChunk && isFunction(this._config.beforeFirstChunk))\n\t\t\t{\n\t\t\t\tvar modifiedChunk = this._config.beforeFirstChunk(chunk);\n\t\t\t\tif (modifiedChunk !== undefined)\n\t\t\t\t\tchunk = modifiedChunk;\n\t\t\t}\n\t\t\tthis.isFirstChunk = false;\n\n\t\t\t// Rejoin the line we likely just split in two by chunking the file\n\t\t\tvar aggregate = this._partialLine + chunk;\n\t\t\tthis._partialLine = \"\";\n\n\t\t\tvar results = this._handle.parse(aggregate, this._baseIndex, !this._finished);\n\t\t\t\n\t\t\tif (this._handle.paused() || this._handle.aborted())\n\t\t\t\treturn;\n\t\t\t\n\t\t\tvar lastIndex = results.meta.cursor;\n\t\t\t\n\t\t\tif (!this._finished)\n\t\t\t{\n\t\t\t\tthis._partialLine = aggregate.substring(lastIndex - this._baseIndex);\n\t\t\t\tthis._baseIndex = lastIndex;\n\t\t\t}\n\n\t\t\tif (results && results.data)\n\t\t\t\tthis._rowCount += results.data.length;\n\n\t\t\tvar finishedIncludingPreview = this._finished || (this._config.preview && this._rowCount >= this._config.preview);\n\n\t\t\tif (IS_PAPA_WORKER)\n\t\t\t{\n\t\t\t\tglobal.postMessage({\n\t\t\t\t\tresults: results,\n\t\t\t\t\tworkerId: Papa.WORKER_ID,\n\t\t\t\t\tfinished: finishedIncludingPreview\n\t\t\t\t});\n\t\t\t}\n\t\t\telse if (isFunction(this._config.chunk))\n\t\t\t{\n\t\t\t\tthis._config.chunk(results, this._handle);\n\t\t\t\tif (this._paused)\n\t\t\t\t\treturn;\n\t\t\t\tresults = undefined;\n\t\t\t\tthis._completeResults = undefined;\n\t\t\t}\n\n\t\t\tif (!this._config.step && !this._config.chunk) {\n\t\t\t\tthis._completeResults.data = this._completeResults.data.concat(results.data);\n\t\t\t\tthis._completeResults.errors = this._completeResults.errors.concat(results.errors);\n\t\t\t\tthis._completeResults.meta = results.meta;\n\t\t\t}\n\n\t\t\tif (finishedIncludingPreview && isFunction(this._config.complete) && (!results || !results.meta.aborted))\n\t\t\t\tthis._config.complete(this._completeResults);\n\n\t\t\tif (!finishedIncludingPreview && (!results || !results.meta.paused))\n\t\t\t\tthis._nextChunk();\n\n\t\t\treturn results;\n\t\t};\n\n\t\tthis._sendError = function(error)\n\t\t{\n\t\t\tif (isFunction(this._config.error))\n\t\t\t\tthis._config.error(error);\n\t\t\telse if (IS_PAPA_WORKER && this._config.error)\n\t\t\t{\n\t\t\t\tglobal.postMessage({\n\t\t\t\t\tworkerId: Papa.WORKER_ID,\n\t\t\t\t\terror: error,\n\t\t\t\t\tfinished: false\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\n\t\tfunction replaceConfig(config)\n\t\t{\n\t\t\t// Deep-copy the config so we can edit it\n\t\t\tvar configCopy = copy(config);\n\t\t\tconfigCopy.chunkSize = parseInt(configCopy.chunkSize);\t// parseInt VERY important so we don't concatenate strings!\n\t\t\tif (!config.step && !config.chunk)\n\t\t\t\tconfigCopy.chunkSize = null; // disable Range header if not streaming; bad values break IIS - see issue #196\n\t\t\tthis._handle = new ParserHandle(configCopy);\n\t\t\tthis._handle.streamer = this;\n\t\t\tthis._config = configCopy;\t// persist the copy to the caller\n\t\t}\n\t}", "title": "" }, { "docid": "0f073340d87653366e87e4d9a75ff648", "score": "0.66374576", "text": "function ChunkStreamer(config)\n\t{\n\t\tthis._handle = null;\n\t\tthis._paused = false;\n\t\tthis._finished = false;\n\t\tthis._input = null;\n\t\tthis._baseIndex = 0;\n\t\tthis._partialLine = \"\";\n\t\tthis._rowCount = 0;\n\t\tthis._start = 0;\n\t\tthis._nextChunk = null;\n\t\tthis.isFirstChunk = true;\n\t\tthis._completeResults = {\n\t\t\tdata: [],\n\t\t\terrors: [],\n\t\t\tmeta: {}\n\t\t};\n\t\treplaceConfig.call(this, config);\n\n\t\tthis.parseChunk = function(chunk)\n\t\t{\n\t\t\t// First chunk pre-processing\n\t\t\tif (this.isFirstChunk && isFunction(this._config.beforeFirstChunk))\n\t\t\t{\n\t\t\t\tvar modifiedChunk = this._config.beforeFirstChunk(chunk);\n\t\t\t\tif (modifiedChunk !== undefined)\n\t\t\t\t\tchunk = modifiedChunk;\n\t\t\t}\n\t\t\tthis.isFirstChunk = false;\n\n\t\t\t// Rejoin the line we likely just split in two by chunking the file\n\t\t\tvar aggregate = this._partialLine + chunk;\n\t\t\tthis._partialLine = \"\";\n\n\t\t\tvar results = this._handle.parse(aggregate, this._baseIndex, !this._finished);\n\t\t\t\n\t\t\tif (this._handle.paused() || this._handle.aborted())\n\t\t\t\treturn;\n\t\t\t\n\t\t\tvar lastIndex = results.meta.cursor;\n\t\t\t\n\t\t\tif (!this._finished)\n\t\t\t{\n\t\t\t\tthis._partialLine = aggregate.substring(lastIndex - this._baseIndex);\n\t\t\t\tthis._baseIndex = lastIndex;\n\t\t\t}\n\n\t\t\tif (results && results.data)\n\t\t\t\tthis._rowCount += results.data.length;\n\n\t\t\tvar finishedIncludingPreview = this._finished || (this._config.preview && this._rowCount >= this._config.preview);\n\n\t\t\tif (IS_PAPA_WORKER)\n\t\t\t{\n\t\t\t\tglobal.postMessage({\n\t\t\t\t\tresults: results,\n\t\t\t\t\tworkerId: Papa.WORKER_ID,\n\t\t\t\t\tfinished: finishedIncludingPreview\n\t\t\t\t});\n\t\t\t}\n\t\t\telse if (isFunction(this._config.chunk))\n\t\t\t{\n\t\t\t\tthis._config.chunk(results, this._handle);\n\t\t\t\tif (this._paused)\n\t\t\t\t\treturn;\n\t\t\t\tresults = undefined;\n\t\t\t\tthis._completeResults = undefined;\n\t\t\t}\n\n\t\t\tif (!this._config.step && !this._config.chunk) {\n\t\t\t\tthis._completeResults.data = this._completeResults.data.concat(results.data);\n\t\t\t\tthis._completeResults.errors = this._completeResults.errors.concat(results.errors);\n\t\t\t\tthis._completeResults.meta = results.meta;\n\t\t\t}\n\n\t\t\tif (finishedIncludingPreview && isFunction(this._config.complete) && (!results || !results.meta.aborted))\n\t\t\t\tthis._config.complete(this._completeResults);\n\n\t\t\tif (!finishedIncludingPreview && (!results || !results.meta.paused))\n\t\t\t\tthis._nextChunk();\n\n\t\t\treturn results;\n\t\t};\n\n\t\tthis._sendError = function(error)\n\t\t{\n\t\t\tif (isFunction(this._config.error))\n\t\t\t\tthis._config.error(error);\n\t\t\telse if (IS_PAPA_WORKER && this._config.error)\n\t\t\t{\n\t\t\t\tglobal.postMessage({\n\t\t\t\t\tworkerId: Papa.WORKER_ID,\n\t\t\t\t\terror: error,\n\t\t\t\t\tfinished: false\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\n\t\tfunction replaceConfig(config)\n\t\t{\n\t\t\t// Deep-copy the config so we can edit it\n\t\t\tvar configCopy = copy(config);\n\t\t\tconfigCopy.chunkSize = parseInt(configCopy.chunkSize);\t// parseInt VERY important so we don't concatenate strings!\n\t\t\tif (!config.step && !config.chunk)\n\t\t\t\tconfigCopy.chunkSize = null; // disable Range header if not streaming; bad values break IIS - see issue #196\n\t\t\tthis._handle = new ParserHandle(configCopy);\n\t\t\tthis._handle.streamer = this;\n\t\t\tthis._config = configCopy;\t// persist the copy to the caller\n\t\t}\n\t}", "title": "" }, { "docid": "0f073340d87653366e87e4d9a75ff648", "score": "0.66374576", "text": "function ChunkStreamer(config)\n\t{\n\t\tthis._handle = null;\n\t\tthis._paused = false;\n\t\tthis._finished = false;\n\t\tthis._input = null;\n\t\tthis._baseIndex = 0;\n\t\tthis._partialLine = \"\";\n\t\tthis._rowCount = 0;\n\t\tthis._start = 0;\n\t\tthis._nextChunk = null;\n\t\tthis.isFirstChunk = true;\n\t\tthis._completeResults = {\n\t\t\tdata: [],\n\t\t\terrors: [],\n\t\t\tmeta: {}\n\t\t};\n\t\treplaceConfig.call(this, config);\n\n\t\tthis.parseChunk = function(chunk)\n\t\t{\n\t\t\t// First chunk pre-processing\n\t\t\tif (this.isFirstChunk && isFunction(this._config.beforeFirstChunk))\n\t\t\t{\n\t\t\t\tvar modifiedChunk = this._config.beforeFirstChunk(chunk);\n\t\t\t\tif (modifiedChunk !== undefined)\n\t\t\t\t\tchunk = modifiedChunk;\n\t\t\t}\n\t\t\tthis.isFirstChunk = false;\n\n\t\t\t// Rejoin the line we likely just split in two by chunking the file\n\t\t\tvar aggregate = this._partialLine + chunk;\n\t\t\tthis._partialLine = \"\";\n\n\t\t\tvar results = this._handle.parse(aggregate, this._baseIndex, !this._finished);\n\t\t\t\n\t\t\tif (this._handle.paused() || this._handle.aborted())\n\t\t\t\treturn;\n\t\t\t\n\t\t\tvar lastIndex = results.meta.cursor;\n\t\t\t\n\t\t\tif (!this._finished)\n\t\t\t{\n\t\t\t\tthis._partialLine = aggregate.substring(lastIndex - this._baseIndex);\n\t\t\t\tthis._baseIndex = lastIndex;\n\t\t\t}\n\n\t\t\tif (results && results.data)\n\t\t\t\tthis._rowCount += results.data.length;\n\n\t\t\tvar finishedIncludingPreview = this._finished || (this._config.preview && this._rowCount >= this._config.preview);\n\n\t\t\tif (IS_PAPA_WORKER)\n\t\t\t{\n\t\t\t\tglobal.postMessage({\n\t\t\t\t\tresults: results,\n\t\t\t\t\tworkerId: Papa.WORKER_ID,\n\t\t\t\t\tfinished: finishedIncludingPreview\n\t\t\t\t});\n\t\t\t}\n\t\t\telse if (isFunction(this._config.chunk))\n\t\t\t{\n\t\t\t\tthis._config.chunk(results, this._handle);\n\t\t\t\tif (this._paused)\n\t\t\t\t\treturn;\n\t\t\t\tresults = undefined;\n\t\t\t\tthis._completeResults = undefined;\n\t\t\t}\n\n\t\t\tif (!this._config.step && !this._config.chunk) {\n\t\t\t\tthis._completeResults.data = this._completeResults.data.concat(results.data);\n\t\t\t\tthis._completeResults.errors = this._completeResults.errors.concat(results.errors);\n\t\t\t\tthis._completeResults.meta = results.meta;\n\t\t\t}\n\n\t\t\tif (finishedIncludingPreview && isFunction(this._config.complete) && (!results || !results.meta.aborted))\n\t\t\t\tthis._config.complete(this._completeResults);\n\n\t\t\tif (!finishedIncludingPreview && (!results || !results.meta.paused))\n\t\t\t\tthis._nextChunk();\n\n\t\t\treturn results;\n\t\t};\n\n\t\tthis._sendError = function(error)\n\t\t{\n\t\t\tif (isFunction(this._config.error))\n\t\t\t\tthis._config.error(error);\n\t\t\telse if (IS_PAPA_WORKER && this._config.error)\n\t\t\t{\n\t\t\t\tglobal.postMessage({\n\t\t\t\t\tworkerId: Papa.WORKER_ID,\n\t\t\t\t\terror: error,\n\t\t\t\t\tfinished: false\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\n\t\tfunction replaceConfig(config)\n\t\t{\n\t\t\t// Deep-copy the config so we can edit it\n\t\t\tvar configCopy = copy(config);\n\t\t\tconfigCopy.chunkSize = parseInt(configCopy.chunkSize);\t// parseInt VERY important so we don't concatenate strings!\n\t\t\tif (!config.step && !config.chunk)\n\t\t\t\tconfigCopy.chunkSize = null; // disable Range header if not streaming; bad values break IIS - see issue #196\n\t\t\tthis._handle = new ParserHandle(configCopy);\n\t\t\tthis._handle.streamer = this;\n\t\t\tthis._config = configCopy;\t// persist the copy to the caller\n\t\t}\n\t}", "title": "" }, { "docid": "a2486a81f40d1037a2194159fb3c2203", "score": "0.63110757", "text": "function NetworkStreamer(config)\n\t{\n\t\tconfig = config || {};\n\t\tif (!config.chunkSize)\n\t\t\tconfig.chunkSize = Papa.RemoteChunkSize;\n\n\t\tvar start = 0, fileSize = 0;\n\t\tvar aggregate = \"\";\n\t\tvar partialLine = \"\";\n\t\tvar xhr, url, nextChunk, finishedWithEntireFile;\n\t\tvar handle = new ParserHandle(copy(config));\n\t\thandle.streamer = this;\n\n\t\tthis.resume = function()\n\t\t{\n\t\t\tnextChunk();\n\t\t};\n\n\t\tthis.finished = function()\n\t\t{\n\t\t\treturn finishedWithEntireFile;\n\t\t};\n\n\t\tthis.stream = function(u)\n\t\t{\n\t\t\turl = u;\n\t\t\tif (IS_WORKER)\n\t\t\t{\n\t\t\t\tnextChunk = function()\n\t\t\t\t{\n\t\t\t\t\treadChunk();\n\t\t\t\t\tchunkLoaded();\n\t\t\t\t};\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tnextChunk = function()\n\t\t\t\t{\n\t\t\t\t\treadChunk();\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tnextChunk();\t// Starts streaming\n\t\t};\n\n\t\tfunction readChunk()\n\t\t{\n\t\t\tif (finishedWithEntireFile)\n\t\t\t{\n\t\t\t\tchunkLoaded();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\txhr = new XMLHttpRequest();\n\t\t\tif (!IS_WORKER)\n\t\t\t{\n\t\t\t\txhr.onload = chunkLoaded;\n\t\t\t\txhr.onerror = chunkError;\n\t\t\t}\n\t\t\txhr.open(\"GET\", url, !IS_WORKER);\n\t\t\tif (config.step)\n\t\t\t{\n\t\t\t\tvar end = start + config.chunkSize - 1;\t// minus one because byte range is inclusive\n\t\t\t\tif (fileSize && end > fileSize) // Hack around a Chrome bug: http://stackoverflow.com/q/24745095/1048862\n\t\t\t\t\tend = fileSize;\n\t\t\t\txhr.setRequestHeader(\"Range\", \"bytes=\"+start+\"-\"+end);\n\t\t\t}\n\t\t\txhr.send();\n\t\t\tif (IS_WORKER && xhr.status == 0)\n\t\t\t\tchunkError();\n\t\t\telse\n\t\t\t\tstart += config.chunkSize;\n\t\t}\n\n\t\tfunction chunkLoaded()\n\t\t{\n\t\t\tif (xhr.readyState != 4)\n\t\t\t\treturn;\n\n\t\t\tif (xhr.status < 200 || xhr.status >= 400)\n\t\t\t{\n\t\t\t\tchunkError();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Rejoin the line we likely just split in two by chunking the file\n\t\t\taggregate += partialLine + xhr.responseText;\n\t\t\tpartialLine = \"\";\n\n\t\t\tfinishedWithEntireFile = !config.step || start > getFileSize(xhr);\n\n\t\t\tif (!finishedWithEntireFile)\n\t\t\t{\n\t\t\t\tvar lastLineEnd = aggregate.lastIndexOf(\"\\n\");\n\n\t\t\t\tif (lastLineEnd < 0)\n\t\t\t\t\tlastLineEnd = aggregate.lastIndexOf(\"\\r\");\n\n\t\t\t\tif (lastLineEnd > -1)\n\t\t\t\t{\n\t\t\t\t\tpartialLine = aggregate.substring(lastLineEnd + 1);\t// skip the line ending character\n\t\t\t\t\taggregate = aggregate.substring(0, lastLineEnd);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// For chunk sizes smaller than a line (a line could not fit in a single chunk)\n\t\t\t\t\t// we simply build our aggregate by reading in the next chunk, until we find a newline\n\t\t\t\t\tnextChunk();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar results = handle.parse(aggregate);\n\t\t\taggregate = \"\";\n\n\t\t\tif (IS_WORKER)\n\t\t\t{\n\t\t\t\tglobal.postMessage({\n\t\t\t\t\tresults: results,\n\t\t\t\t\tworkerId: Papa.WORKER_ID,\n\t\t\t\t\tfinished: finishedWithEntireFile\n\t\t\t\t});\n\t\t\t}\n\t\t\telse if (isFunction(config.chunk))\n\t\t\t{\n\t\t\t\tconsole.log(\"CHUNKED\");\n\t\t\t\tconfig.chunk(results);\n\t\t\t\tresults = undefined;\n\t\t\t}\n\n\t\t\tif (!finishedWithEntireFile && !results.meta.paused)\n\t\t\t\tnextChunk();\n\t\t}\n\n\t\tfunction chunkError()\n\t\t{\n\t\t\tif (isFunction(config.error))\n\t\t\t\tconfig.error(xhr.statusText);\n\t\t\telse if (IS_WORKER && config.error)\n\t\t\t{\n\t\t\t\tglobal.postMessage({\n\t\t\t\t\tworkerId: Papa.WORKER_ID,\n\t\t\t\t\terror: xhr.statusText,\n\t\t\t\t\tfinished: false\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tfunction getFileSize(xhr)\n\t\t{\n\t\t\tvar contentRange = xhr.getResponseHeader(\"Content-Range\");\n\t\t\treturn parseInt(contentRange.substr(contentRange.lastIndexOf(\"/\") + 1));\n\t\t}\n\t}", "title": "" }, { "docid": "e26e38141d871f4d6f45d81100b91470", "score": "0.5996515", "text": "function NetworkStreamer(config) {\n config = config || {};\n if (!config.chunkSize)\n config.chunkSize = Papa.RemoteChunkSize;\n\n var start = 0,\n fileSize = 0;\n var aggregate = \"\";\n var partialLine = \"\";\n var xhr, nextChunk;\n var handle = new ParserHandle(copy(config));\n\n this.stream = function(url) {\n nextChunk = function() {\n readChunk();\n };\n\n nextChunk(); // Starts streaming\n\n\n function readChunk() {\n xhr = new XMLHttpRequest();\n\n xhr.onload = chunkLoaded;\n xhr.onerror = chunkError;\n //last argument was !worker\n xhr.open(\"GET\", url, true);\n if (config.step) {\n var end = start + config.chunkSize - 1; // minus one because byte range is inclusive\n if (fileSize && end > fileSize) // Hack around a Chrome bug: http://stackoverflow.com/q/24745095/1048862\n end = fileSize;\n xhr.setRequestHeader(\"Range\", \"bytes=\" + start + \"-\" + end);\n }\n xhr.send();\n start += config.chunkSize;\n }\n\n function chunkLoaded() {\n if (xhr.readyState != 4)\n return;\n\n if (xhr.status < 200 || xhr.status >= 400) {\n chunkError();\n return;\n }\n\n // Rejoin the line we likely just split in two by chunking the file\n aggregate += partialLine + xhr.responseText;\n partialLine = \"\";\n\n var finishedWithEntireFile = !config.step || start > getFileSize(xhr);\n\n if (!finishedWithEntireFile) {\n var lastLineEnd = aggregate.lastIndexOf(\"\\n\");\n\n if (lastLineEnd < 0)\n lastLineEnd = aggregate.lastIndexOf(\"\\r\");\n\n if (lastLineEnd > -1) {\n partialLine = aggregate.substring(lastLineEnd + 1); // skip the line ending character\n aggregate = aggregate.substring(0, lastLineEnd);\n } else {\n // For chunk sizes smaller than a line (a line could not fit in a single chunk)\n // we simply build our aggregate by reading in the next chunk, until we find a newline\n nextChunk();\n return;\n }\n }\n\n var results = handle.parse(aggregate);\n aggregate = \"\";\n\n if (isFunction(config.chunk)) {\n config.chunk(results);\n results = undefined;\n }\n\n if (!finishedWithEntireFile && !results.meta.paused)\n nextChunk();\n }\n\n function chunkError() {\n if (isFunction(config.error))\n config.error(xhr.statusText);\n }\n\n function getFileSize(xhr) {\n var contentRange = xhr.getResponseHeader(\"Content-Range\");\n return parseInt(contentRange.substr(contentRange.lastIndexOf(\"/\") + 1));\n }\n };\n }", "title": "" }, { "docid": "70c938f734e4a20b5daa4e70b500fc32", "score": "0.59654236", "text": "function MyStream() {\n stream.call(this);\n}", "title": "" }, { "docid": "8cb249f529694a8046dc8e6e96b6eeda", "score": "0.5934931", "text": "function Chunks() {}", "title": "" }, { "docid": "05267266d2d697237bf8c6581fbc01ea", "score": "0.5870195", "text": "constructor( processor = (item => item) ) {\n\n let _buffer = '';\n\n super({\n readableObjectMode: true,\n // Write data to the stream.\n write: function( chunk, encoding, callback ) {\n if( encoding == 'buffer' ) {\n _buffer += chunk.toString();\n }\n else {\n _buffer += chunk;\n }\n let lines = _buffer.split('\\n');\n let i = 0;\n while( i < lines.length - 1 ) {\n let line = lines[i++].trim();\n if( line.length > 0 ) {\n let obj = this.processor( line );\n this._push( obj );\n }\n }\n _buffer = lines[i];\n callback();\n },\n read: function( size ) {\n // Setup a new queue.\n let queue = this._queued;\n this._queued = [];\n // Unpause the stream.\n this._paused = false;\n // Replay queued objects. Note that some of these may end\n // up back on the new queue if push() returns false.\n queue.forEach( obj => this._push( obj ) );\n },\n final: function( callback ) {\n // At end of stream, write a newline to the buffer to flush\n // out any remaining data.\n this._write('\\n', undefined, () => {\n this._push( null );\n callback();\n });\n }\n });\n // The line processor.\n this.processor = processor;\n // Flag + queue for _push + _read functions.\n this._paused = false;\n this._queued = [];\n }", "title": "" }, { "docid": "d9b44ba4e89a77a436e2671ed7a57484", "score": "0.57973945", "text": "function Chunks() { }", "title": "" }, { "docid": "d9b44ba4e89a77a436e2671ed7a57484", "score": "0.57973945", "text": "function Chunks() { }", "title": "" }, { "docid": "d9b44ba4e89a77a436e2671ed7a57484", "score": "0.57973945", "text": "function Chunks() { }", "title": "" }, { "docid": "d9b44ba4e89a77a436e2671ed7a57484", "score": "0.57973945", "text": "function Chunks() { }", "title": "" }, { "docid": "26a910448a3ea82e7930992e5c375067", "score": "0.5734811", "text": "transform(data, enc, cb) {\n // We store the chunk of data (which is a Buffer) in memory\n bufferedChunks.push(data);\n // Then pass the data unchanged onwards to the next stream\n cb(null, data);\n }", "title": "" }, { "docid": "450c4572b8aa6af653d11876d0ecf2ab", "score": "0.5722672", "text": "transform(data, enc, cb) {\n // We store the chunk of data (which is a Buffer) in memory\n bufferedChunks.push(data);\n // Then pass the data unchanged onwards to the next stream\n cb(null, data);\n }", "title": "" }, { "docid": "3df8b1e623797149a5590502b228b329", "score": "0.57152194", "text": "function UnChunkerFactory(options = {}) {\n const decode =\n options.decode ||\n function decode(data) {\n return data\n };\n\n return class UnChunker {\n constructor(opts = {}) {\n this.payloads = {};\n this.payloadCount = 0;\n this.onData = function (val) {\n console.log('default, data is ready:', val);\n };\n }\n\n registerChunk(msg) {\n var header = this.parseHeader(msg);\n if (header) {\n this._newPayload(header.payloadID, header);\n } else if (this._isChunk(msg)) {\n //the msg is a chunk hopefully\n try {\n let val = decode(msg);\n this._appendToPayload(val);\n if (this._isPayloadReady(val.payloadID)) {\n this._assembleChunks(val.payloadID, (result) => {\n this.onData(result);\n return result\n });\n }\n } catch (err) {\n console.error(err);\n console.error('val:', msg);\n }\n } else {\n console.warn('not my type', decode(msg));\n }\n return null\n }\n\n _newPayload(id, header) {\n this.payloads[id] = Object.assign(header, {\n count: header.chunkCount,\n chunks: [],\n lastUpdate: new Date(),\n });\n this.payloadCount++;\n }\n\n _appendToPayload(chunk) {\n var pl = this.payloads[chunk.payloadID];\n pl.lastUpdate = new Date();\n pl.chunks.push(chunk);\n }\n\n async _assembleChunks(payloadID, cb) {\n var pl = this.payloads[payloadID];\n pl.chunks.sort(function (a, b) {\n return Number(a.id) - Number(b.id)\n });\n var totalSize = 0;\n for (var i = 0; i < pl.chunks.length; i++) {\n totalSize += pl.chunks[i].chunk.length;\n }\n var result = new Uint8Array(totalSize);\n var position = 0;\n for (var i = 0; i < pl.chunks.length; i++) {\n var ch = pl.chunks[i];\n result.set(ch.chunk, position);\n position += ch.chunk.length;\n }\n try {\n let val1 = decode(result);\n let val2 = await recursivelyDecodeBlobs(val1);\n cb(val2);\n this._removePayload(payloadID);\n } catch (err) {\n console.error(err);\n console.error('buffer', result);\n }\n }\n\n _removePayload(id) {\n delete this.payloads[id];\n this.payloadCount--;\n }\n\n parseHeader(data) {\n if (typeof data == 'object' && !(data instanceof Uint8Array)) {\n if (data.chunkCount && data.chunkCount > 0) {\n return data\n }\n } else if (data.length && data.length < 4000) {\n // might have been packed or something.\n try {\n var json = decode(data);\n if (json) {\n try {\n if (json && json.iAmAHeader) {\n return json\n }\n } catch (er) {\n // probably not a header. Not a big deal\n }\n }\n } catch (er) {\n console.warn(er);\n }\n }\n return undefined\n }\n\n _isChunk(msg) {\n if (this.payloadCount <= 0) {\n return false\n }\n return msg instanceof Uint8Array || msg instanceof DataView\n }\n\n _isPayloadReady(id) {\n var pl = this.payloads[id];\n if (pl.chunks.length == pl.count) {\n return true\n }\n return false\n }\n }\n}", "title": "" }, { "docid": "a4ca374d1918fee7b21de5fb59ff902e", "score": "0.56904185", "text": "write(chunk) {\n if (this.closed) {\n return this.fail(\"cannot write after close; assign an onready handler.\");\n }\n let end = false;\n if (chunk === null) {\n // We cannot return immediately because carriedFromPrevious may need\n // processing.\n end = true;\n chunk = \"\";\n }\n else if (typeof chunk === \"object\") {\n chunk = chunk.toString();\n }\n // We checked if performing a pre-decomposition of the string into an array\n // of single complete characters (``Array.from(chunk)``) would be faster\n // than the current repeated calls to ``charCodeAt``. As of August 2018, it\n // isn't. (There may be Node-specific code that would perform faster than\n // ``Array.from`` but don't want to be dependent on Node.)\n if (this.carriedFromPrevious !== undefined) {\n // The previous chunk had char we must carry over.\n chunk = `${this.carriedFromPrevious}${chunk}`;\n this.carriedFromPrevious = undefined;\n }\n let limit = chunk.length;\n const lastCode = chunk.charCodeAt(limit - 1);\n if (!end &&\n // A trailing CR or surrogate must be carried over to the next\n // chunk.\n (lastCode === CR || (lastCode >= 0xD800 && lastCode <= 0xDBFF))) {\n // The chunk ends with a character that must be carried over. We cannot\n // know how to handle it until we get the next chunk or the end of the\n // stream. So save it for later.\n this.carriedFromPrevious = chunk[limit - 1];\n limit--;\n chunk = chunk.slice(0, limit);\n }\n const { stateTable } = this;\n this.chunk = chunk;\n this.i = 0;\n while (this.i < limit) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n stateTable[this.state].call(this);\n }\n this.chunkPosition += limit;\n return end ? this.end() : this;\n }", "title": "" }, { "docid": "e5b0c30c82778268fc34fa32322cb050", "score": "0.5687765", "text": "_read() {\n if (this.index <= this.array.length) {\n //getting a chunk of data\n const chunk = {\n data: this.array[this.index],\n index: this.index\n };\n //we want to push chunks of data into the stream\n this.push(chunk);\n this.index += 1;\n } else {\n //pushing null wil signal to stream its done\n this.push(null);\n }\n }", "title": "" }, { "docid": "612a63d75c3ea513bd2b8c46927a749f", "score": "0.56188524", "text": "async getNextChunk() {\n // Return null if the stream is already closed\n if (this.closed) return null;\n\n // Perform remaining operations within a promise so that we can resolve at\n // a moment of our choosing\n return new Promise((resolve, reject) => {\n // Set up the 'data' listener\n const onData = (chunk) => {\n this.chunkList.push(chunk);\n\n // Special case\n if (this.currentChunkSize === this.max) {\n // If, somehow, the current chunk size is exactly the maximum, skip\n // extra processing and resolve the concatenation\n const concatBuff = Buffer.concat(this.chunkList);\n this.stream.removeListener('data', onData);\n this.stream.removeListener('end', onEnd);\n this.chunkList = [];\n\n return resolve(concatBuff);\n }\n\n // Continue processing as normal if we aren't over our maximum chunk size\n if (this.currentChunkSize <= this.max) return;\n\n // Otherwise we need to return a buffer with exactly as much data as the\n // maximum chunk size. Begin by concatenating all current chunks\n const concatBuff = Buffer.concat(this.chunkList);\n\n // Slice any extra data off the top and unshift back into the stream\n const retBuffer = concatBuff.slice(0, this.max);\n const unshiftBuff = concatBuff.slice(this.max);\n\n // Pause the stream\n this.stream.pause();\n\n // Remove event listeners\n this.stream.removeListener('data', onData);\n this.stream.removeListener('end', onEnd);\n\n // Unshift data _after_ removing event listeners and pausing\n this.stream.unshift(unshiftBuff);\n\n // Reset the chunk list\n this.chunkList = [];\n\n return resolve(retBuffer);\n };\n this.stream.on('data', onData);\n\n // Set up a special 'end' listener in case we reach the end of our stream\n const onEnd = () => {\n // Remove listeners\n this.stream.removeListener('data', onData);\n this.stream.removeListener('end', onEnd);\n\n // Special case: No data available\n if (this.chunkList.length === 0) {\n return resolve(null);\n }\n\n // If this was hit, it means we no longer have any data to read,\n // resolve the concatenation of all the chunks we have\n const concatBuff = Buffer.concat(this.chunkList);\n\n // Clean the chunk list\n this.chunkList = [];\n\n return resolve(concatBuff);\n };\n this.stream.on('end', onEnd);\n // Resume the stream\n this.stream.resume();\n });\n }", "title": "" }, { "docid": "f8f2c28c1341fb0be78a03d8927eb16b", "score": "0.5547026", "text": "function Stream() {\n EventEmitter.call(this);\n}", "title": "" }, { "docid": "63150e42c062df7cbbc9e740c9a69ca5", "score": "0.5541463", "text": "function JobStream() {}", "title": "" }, { "docid": "dc8e1a737134bf6a20e6c41ab4cf8252", "score": "0.55291915", "text": "_transform(chunk, encoding, callback) {\n // Convert buffer to a string for splitting\n if (Buffer.isBuffer(chunk)) {\n chunk = chunk.toString('utf8');\n }\n // Prepend any remnant\n if (this.remnant.length > 0) {\n chunk = this.remnant + chunk;\n this.remnant = '';\n }\n // Split lines _________________________\n var lines = chunk.split(this.chunkRegEx);\n // Check to see if the chunk ends exactly with the separator\n if (chunk.search(this.remnantRegEx) === -1) {\n // It doesn't so save off the remnant\n this.remnant = lines.pop();\n }\n\n let startPoint = this.headerFlag ? 0 : 1;\n // Push each line\n lines.slice(startPoint).forEach(line => {\n if (line !== '') {\n this.push(line)\n }\n this.headerFlag = true;\n }, this);\n\n return setImmediate(callback);\n }", "title": "" }, { "docid": "86977b1ecf189f561f97100b54ab2e86", "score": "0.551571", "text": "receiveChunk(chunk) {\n const peer = this.peerList[this.peerNumber];\n //16 bits suffice for chunkNum\n //Currently let peer and chunkData be identified by a single unicode\n //origin peer is the peer to whom splitter sends chunk\n let message = [this.chunkNumber,chunk,peer];\n console.dir(message);\n this.chunkDestination[message[0] % this.bufferSize] = peer;\n console.log('transmitting chunk');\n this.sendChunk(message, peer);\n }", "title": "" }, { "docid": "f6d34f24f3fa2e7b9aeb3c69b786a853", "score": "0.54864335", "text": "function customStreams(request,response) {\n response.writeHead(200);\n request.on('data',function (chunk) {\n console.log('chunk: ',chunk.toString());\n response.write(chunk);\n })\n request.on('end',function() {\n response.end()\n });\n}", "title": "" }, { "docid": "a9b4322b63621948887e53e6b36b261d", "score": "0.5482857", "text": "function onChunk(chunk, _, done) {\n buffer += chunk.toString();\n done();\n}", "title": "" }, { "docid": "24dce507ef188e939eb9be41c04a460e", "score": "0.5477451", "text": "function Stream() {\n EventEmitter.call(this);\n}", "title": "" }, { "docid": "24dce507ef188e939eb9be41c04a460e", "score": "0.5477451", "text": "function Stream() {\n EventEmitter.call(this);\n}", "title": "" }, { "docid": "47ad7b942d3b74db8622dfb5db9a26e7", "score": "0.54505426", "text": "processChunk(chunk) {\r\n\t\t// Append the chunk to the packet buffer\r\n\t\tthis.data = Buffer.concat([this.data, chunk])\r\n\r\n\t\t// Extract all messages from the buffer\r\n\t\twhile(this.data.length > 0)\r\n\t\t{\r\n\t\t\t// Atleast 4 bytes is required to read type and size\r\n\t\t\tif(this.data.length < 2) {\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tlet packetSize = this.data.readUInt16LE(0)\r\n\r\n\t\t\t// If the packet has only been partially received wait for the next byte chunk\r\n\t\t\tif(this.data.length < packetSize) {\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Extract the packet\r\n\t\t\tlet packet = new Object()\r\n\t\t\tpacket.size = packetSize\r\n\t\t\tpacket.type = this.data.readUInt16LE(2)\r\n\t\t\tpacket.bytes = this.data.slice(0, packetSize).toString('hex').match(/../g).join(' ')\r\n\t\t\t\r\n\t\t\tthis.fire(\"packet\", packet);\r\n\r\n\t\t\tthis.fire(\"gameEvent\", this.translatePacket(packet));\r\n\r\n\t\t\t// Remove the message from the buffer\r\n\t\t\tthis.data = this.data.slice(packetSize)\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "cdc2b5e8468f348c05e4bd166137b042", "score": "0.5430962", "text": "function AudioStreamer() { }", "title": "" }, { "docid": "bb471744fa4027fd50e18be78c4442cd", "score": "0.54230505", "text": "function transform(chunk, enc, next) {\r\n buffer += chunk.toString();\r\n next();\r\n }", "title": "" }, { "docid": "2e829c87128dc17290f07f668d5c57af", "score": "0.5374837", "text": "function Stream() {\n EventEmitter.call(this);\n }", "title": "" }, { "docid": "90575884d755cdceb38a803a3921dafe", "score": "0.53195506", "text": "_registerDataMessage() {\n this.on('data', (data) => {\n //when its done with a complete chunk, call this.emit('dataBig', completed)\n this.unchunker.registerChunk(data);\n });\n }", "title": "" }, { "docid": "59ecda8a58cb4d85d20445d852ef0441", "score": "0.53109986", "text": "function getPrepareWriteStream() {\n return through.obj(function (chunk, enc, callback) {\n if (typeof(chunk) === 'object') {\n chunk = JSON.stringify(chunk);\n }\n\n this.push({\n body: chunk\n });\n callback();\n }, function () {\n this.emit('end');\n })\n}", "title": "" }, { "docid": "d03bcb0bc49797d3506c8ebf096f5506", "score": "0.5303292", "text": "transform(chunk, _encoding, callback) {\n const input = toU8(chunk);\n const output = new Uint8Array(1024);\n const avail = ops.op_brotli_decompress_stream(context, input, output);\n this.push(output.slice(0, avail));\n callback();\n }", "title": "" }, { "docid": "f92bcbdcf1000a4fd89ea0e2500738dc", "score": "0.52983147", "text": "function SimpleStream ()\n{\n\tthis.buffer = '';\n}", "title": "" }, { "docid": "529de1343612d39e4d2f3b21b36685dd", "score": "0.5265436", "text": "function appendChunk(chunk, video) {\n queue.push(chunk);\n current++;\n\n if (current === 1) {\n mediaSource.addEventListener('sourceopen', onSourceOpen);\n video.src = window.URL.createObjectURL(mediaSource);\n } else {\n appendNextMediaSegment(mediaSource);\n }\n\n if (current === 128) {\n video.play();\n }\n}", "title": "" }, { "docid": "761f304f4c237a39e70296523bc16c14", "score": "0.52599293", "text": "function initstream() {\n function Stream( head, tailPromise ) {\n if ( typeof head != 'undefined' ) {\n this.headValue = head;\n }\n if ( typeof tailPromise == 'undefined' ) {\n tailPromise = function () {\n return new Stream();\n };\n }\n this.tailPromise = tailPromise;\n }\n\n // TODO: write some unit tests\n Stream.prototype = {\n empty: function() {\n return typeof this.headValue == 'undefined';\n },\n head: function() {\n if ( this.empty() ) {\n throw new Error('Cannot get the head of the empty stream.');\n }\n return this.headValue;\n },\n tail: function() {\n if ( this.empty() ) {\n throw new Error('Cannot get the tail of the empty stream.');\n }\n // TODO: memoize here\n return this.tailPromise();\n },\n item: function( n ) {\n if ( this.empty() ) {\n throw new Error('Cannot use item() on an empty stream.');\n }\n var s = this;\n while ( n != 0 ) {\n --n;\n try {\n s = s.tail();\n }\n catch ( e ) {\n throw new Error('Item index does not exist in stream.');\n }\n }\n try {\n return s.head();\n }\n catch ( e ) {\n throw new Error('Item index does not exist in stream.');\n }\n },\n length: function() {\n // requires finite stream\n var s = this;\n var len = 0;\n\n while ( !s.empty() ) {\n ++len;\n s = s.tail();\n }\n return len;\n },\n add: function( s ) {\n return this.zip( function ( x, y ) {\n return x + y;\n }, s );\n },\n append: function ( stream ) {\n if ( this.empty() ) {\n return stream;\n }\n var self = this;\n return new Stream(\n self.head(),\n function () {\n return self.tail().append( stream );\n }\n );\n },\n zip: function( f, s ) {\n if ( this.empty() ) {\n return s;\n }\n if ( s.empty() ) {\n return this;\n }\n var self = this;\n return new Stream( f( s.head(), this.head() ), function () {\n return self.tail().zip( f, s.tail() );\n } );\n },\n map: function( f ) {\n if ( this.empty() ) {\n return this;\n }\n var self = this;\n return new Stream( f( this.head() ), function () {\n return self.tail().map( f );\n } );\n },\n concatmap: function ( f ) {\n return this.reduce( function ( a, x ) {\n return a.append( f(x) );\n }, new Stream () );\n },\n reduce: function () {\n var aggregator = arguments[0];\n var initial, self;\n if(arguments.length < 2) {\n if(this.empty()) throw new TypeError(\"Array length is 0 and no second argument\");\n initial = this.head();\n self = this.tail();\n }\n else {\n initial = arguments[1];\n self = this;\n }\n // requires finite stream\n if ( self.empty() ) {\n return initial;\n }\n // TODO: iterate\n return self.tail().reduce( aggregator, aggregator( initial, self.head() ) );\n },\n sum: function () {\n // requires finite stream\n return this.reduce( function ( a, b ) {\n return a + b;\n }, 0 );\n },\n walk: function( f ) {\n // requires finite stream\n this.map( function ( x ) {\n f( x );\n return x;\n } ).force();\n },\n force: function() {\n // requires finite stream\n var stream = this;\n while ( !stream.empty() ) {\n stream = stream.tail();\n }\n },\n scale: function( factor ) {\n return this.map( function ( x ) {\n return factor * x;\n } );\n },\n filter: function( f ) {\n if ( this.empty() ) {\n return this;\n }\n var h = this.head();\n var t = this.tail();\n if ( f( h ) ) {\n return new Stream( h, function () {\n return t.filter( f );\n } );\n }\n return t.filter( f );\n },\n take: function ( howmany ) {\n if ( this.empty() ) {\n return this;\n }\n if ( howmany == 0 ) {\n return new Stream();\n }\n var self = this;\n return new Stream(\n this.head(),\n function () {\n return self.tail().take( howmany - 1 );\n }\n );\n },\n drop: function( n ){\n var self = this;\n\n while ( n-- > 0 ) {\n\n if ( self.empty() ) {\n return new Stream();\n }\n\n self = self.tail();\n }\n\n // create clone/a contructor which accepts a stream?\n return new Stream( self.headValue, self.tailPromise );\n },\n member: function( x ){\n var self = this;\n\n while( !self.empty() ) {\n if ( self.head() == x ) {\n return true;\n }\n\n self = self.tail();\n }\n\n return false;\n },\n toArray: function( n ) {\n var target, result = [];\n if ( typeof n != 'undefined' ) {\n target = this.take( n );\n }\n else {\n // requires finite stream\n target = this;\n }\n target.walk( function ( x ) {\n result.push( x );\n } );\n return result;\n },\n print: function( n ) {\n var target;\n if ( typeof n != 'undefined' ) {\n target = this.take( n );\n }\n else {\n // requires finite stream\n target = this;\n }\n target.walk( function ( x ) {\n console.log( x );\n } );\n },\n toString: function() {\n // requires finite stream\n return '[stream head: ' + this.head() + '; tail: ' + this.tail() + ']';\n }\n };\n\n Stream.makeOnes = function() {\n return new Stream( 1, Stream.makeOnes );\n };\n Stream.makeNaturalNumbers = function() {\n return new Stream( 1, function () {\n return Stream.makeNaturalNumbers().add( Stream.makeOnes() );\n } );\n };\n Stream.make = function( /* arguments */ ) {\n if ( arguments.length == 0 ) {\n return new Stream();\n }\n var restArguments = Array.prototype.slice.call( arguments, 1 );\n return new Stream( arguments[ 0 ], function () {\n return Stream.make.apply( null, restArguments );\n } );\n };\n Stream.fromArray = function ( array ) {\n if ( array.length == 0 ) {\n return new Stream();\n }\n return new Stream( array[0], function() { return Stream.fromArray(array.slice(1)); } );\n };\n Stream.range = function ( low, high ) {\n if ( typeof low == 'undefined' ) {\n low = 1;\n }\n if ( low == high ) {\n return Stream.make( low );\n }\n // if high is undefined, there won't be an upper bound\n return new Stream( low, function () {\n return Stream.range( low + 1, high );\n } );\n };\n Stream.equals = function ( stream1, stream2 ) {\n if ( ! (stream1 instanceof Stream) ) return false;\n if ( ! (stream2 instanceof Stream) ) return false;\n if ( stream1.empty() && stream2.empty() ) {\n return true;\n }\n if ( stream1.empty() || stream2.empty() ) {\n return false;\n }\n if ( stream1.head() === stream2.head() ) {\n return Stream.equals( stream1.tail(), stream2.tail() );\n }\n };\n return Stream;\n}", "title": "" }, { "docid": "b4f75eef7756c2fe6fb140eb431b4d00", "score": "0.5242764", "text": "function IDATChunker(walker, dataSize) {\n var _this = _super.call(this, 0) || this;\n _this.walker = walker;\n _this.bytesLeft = dataSize;\n _this.startChunk();\n return _this;\n }", "title": "" }, { "docid": "57500f43b4fc18be2530d516ed7ce140", "score": "0.5234094", "text": "function Stream$1() {\n EventEmitter.call(this);\n}", "title": "" }, { "docid": "9ae8d2d4a4ca9e40c2e1a3be10278a7f", "score": "0.52181566", "text": "constructor() {\n\tthis._streams= {} \t//loosely coupled\n}", "title": "" }, { "docid": "393a21f3b80cd2c4a1748944b2c11bee", "score": "0.51961595", "text": "function Chunk(idx, len, type) {\n // Object Chunk\n this.idx = idx; // Starting index of chunk in context of byte array\n this.len = len; // Length of data: total length of chunk is (4 + 4 + len + 4)\n this.type = type; // IHDR, IEND, IDAT, acTL, fcTL, fdAT, etc.\n } // Chunk", "title": "" }, { "docid": "f3abae230344b9dcc642f265b897fd63", "score": "0.5189394", "text": "_transform(chunk, encoding, next) {\n\t\tlet message = chunk.toString()\n\t\ttry {\n\t\t\tmessage = this.format(message)\n\t\t} catch (err) {\n\t\t\treturn next(err)\n\t\t}\n\t\tif (message && typeof message === 'object') {\n\t\t\tmessage = JSON.stringify(message)\n\t\t}\n\t\treturn next(null, message)\n\t}", "title": "" }, { "docid": "cca88cb6a57315297c255a75f92e6aad", "score": "0.5174154", "text": "function Stream(){EE.call(this);}", "title": "" }, { "docid": "cca88cb6a57315297c255a75f92e6aad", "score": "0.5174154", "text": "function Stream(){EE.call(this);}", "title": "" }, { "docid": "cca88cb6a57315297c255a75f92e6aad", "score": "0.5174154", "text": "function Stream(){EE.call(this);}", "title": "" }, { "docid": "cca88cb6a57315297c255a75f92e6aad", "score": "0.5174154", "text": "function Stream(){EE.call(this);}", "title": "" }, { "docid": "0f149bd8c7a8191fa1ddb09879652ec7", "score": "0.51716286", "text": "import(stream) {\n stream.on('data', chunk => { this.write(chunk); });\n stream.on('end', () => { this.end(); });\n stream.on('error', error => { this.emit('error', error); });\n return this;\n }", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5164036", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5164036", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5164036", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5164036", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5164036", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5164036", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5164036", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5164036", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5164036", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5164036", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5164036", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5164036", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5164036", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5164036", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5164036", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5164036", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5164036", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5164036", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5164036", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5164036", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5164036", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5164036", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5164036", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5164036", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5164036", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5164036", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5164036", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5164036", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5164036", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5164036", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5164036", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5164036", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5164036", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5164036", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5164036", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5164036", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5164036", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5164036", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5164036", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5164036", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5164036", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5164036", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5164036", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5164036", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5164036", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5164036", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5164036", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5164036", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5164036", "text": "function Stream() {\n EE.call(this);\n}", "title": "" }, { "docid": "2a82c7e3776ade5fd6bc03092b9f50db", "score": "0.5164036", "text": "function Stream() {\n EE.call(this);\n}", "title": "" } ]
307ff6095ed825e4d4591a71c22f76a3
La idea es crear aqui un array manejable de resultados. Funcion para manejar y extraer los datos Json resultado de una consulta sparQL. Se le pasan como parametros str, que es el JSON y el tipo de recurso que se esta mostrando Devuelve solamente los que estan dentro de una distancia dada.
[ { "docid": "da12dc2f56c4b0e7080ad15a7e5c1f28", "score": "0.5599957", "text": "function extractJsonCercanos(str,informacion_de) {\r\n ini_milayer(informacion_de);\r\n var html ='<table class=\"table-striped table-condensed mitable\" id=\"tabladatos\">';\r\n var json= eval('(' + str + ')');\r\n //Variables usadas para crear enlaces segun se necesiten.\r\n var enlaceUri;\r\n/* \r\n for(var b = 0; b< 1; b++) {\r\n html += \"<thead><tr>\";\r\n var objeto=json.results.bindings[b];\r\n for (var propiedad in objeto) { \r\n if (propiedad==\"miURI\") enlaceUri=propiedad.value;\r\n else if (propiedad==\"Nombre\")\r\n html+=\"<th>\"+propiedad+\"</th>\";\r\n }\r\n html+=\"<th>Detalles</th></tr></thead>\";\r\n }\r\n*/\r\n html+=\"<tbody>\";\r\n for(var b = 0; b< json.results.bindings.length; b++) {\r\n html += \"<tr>\";\r\n var objeto=json.results.bindings[b];\r\n for (var propiedad in objeto) { \r\n if (propiedad==\"miURI\") {enlaceUri=objeto[propiedad].value;}\r\n else {\r\n if (propiedad==\"Nombre\") {\r\n html+=\"<td style='word-break:break-all;'><div class='materialCard success'><header><h2><a href='\"+enlaceUri+\"'>\" + objeto[propiedad].value + \"</a></h2></header><div class='cont'>\";//</td><td>\";\r\n resultados[b]=[];\r\n resultados[b][0]=objeto[propiedad].value;\r\n }\r\n //console.log(propiedad+ \" =T- \"+ objeto[propiedad].type+\" --> \"+objeto[propiedad].value);\r\n else if (objeto[propiedad].type == \"uri\")\r\n html += \"<b>\"+propiedad+\":</b> <a href='\"+objeto[propiedad].value+\"'>\" + objeto[propiedad].value + \"</a></br>\";\r\n else if (propiedad == \"geo_lat\") {\r\n resultados[b][1]=objeto[propiedad].value;\r\n html += \"<b>\"+propiedad+\":</b> \"+objeto[propiedad].value + \"</br>\";\r\n//DEBUG console.log(\"R: \"+resultados[b][1]+\" - O: \"+objeto[propiedad].value);\r\n }\r\n else if (propiedad == \"geo_long\") {\r\n resultados[b][2]=objeto[propiedad].value;\r\n html += \"<b>\"+propiedad+\":</b> \"+objeto[propiedad].value +\r\n \"<div class='midivhr'><a href='#' onclick='trazaunaruta(mlat,mlong,\"+resultados[b][1]+\",\"+resultados[b][2]+\",false);'><i class='fa fa-location-arrow'></i> Como ir?</a></div>\";\r\n }\r\n else\r\n html += \"<b>\"+propiedad+\":</b> \"+objeto[propiedad].value+\"<br>\";\r\n }\r\n }\r\n html += \"</div></div></td></tr>\";\r\n//DEBUG console.log(\"----\"+objeto[\"Nombre\"].value);\r\n //Si el objeto esta dentro del rango que queremos (De momento 0.5 Km) Añade un marcador.\r\n if (estaProximo(mlat,mlong,json.results.bindings[b].geo_lat.value,json.results.bindings[b].geo_long.value,0.5)) {\r\n var infoobjeto=arraytipoInfo[informacion_de-1][1]+'<br>'+objeto[\"Nombre\"].value+'<div><h4><span><a target=\"blank\" href=\"'+enlaceUri+'\">Opendata</a></span> ';//- <span><a href=\"#\">Indefinido</a></span></h4></div>';\r\n addMarker(json.results.bindings[b].geo_long.value,json.results.bindings[b].geo_lat.value,infoobjeto,informacion_de); \r\n }//IF\r\n }//FOR\r\n addmiLayer(arraytipoInfo[informacion_de-1][1]);\r\n html += \"</tbody></table>\";\r\n document.getElementById(\"results\").innerHTML = html;\r\n //return html; //Mas adelante para hacer toda esta libreria como un objeto.\r\n }", "title": "" } ]
[ { "docid": "5bb721de2b6efc46e15bc46721dec9b9", "score": "0.56008303", "text": "function resultBuscar(res){ \n var arry = [];\n console.log(from)\n console.log(to)\n\n if(city && type){ \n for (var i = 0; i < res.length; i++) {\n var precio = res[i].Precio.substring(1,res[i].Precio.length).replace(/,/, '.') \n if(city == res[i].Ciudad && type == res[i].Tipo && precio >= from && precio <= to){\n arry.push(res[i])\n }\n }\n }else if(city){ \n for (var i = 0; i < res.length; i++) {\n var precio = res[i].Precio.substring(1,res[i].Precio.length).replace(/,/, '.') \n if(city == res[i].Ciudad && precio >= from && precio <= to){\n arry.push(res[i])\n }\n }\n }else if(type){ \n for (var i = 0; i < res.length; i++) {\n var precio = res[i].Precio.substring(1,res[i].Precio.length).replace(/,/, '.') \n if(type == res[i].Tipo && precio >= from && precio <= to){\n arry.push(res[i])\n }\n }\n }\n\n resMostrarDatos(arry)\n}", "title": "" }, { "docid": "f53b4082a66c08538b8c78a738c36172", "score": "0.5499208", "text": "function fromDbtoJsConocimientos(conocimientos){\n var conocimientosJs = [];\n for (var i = 0; i < conocimientos.length; i++) {\n conocimientosJs.push(fromDbtoJsConocimiento(conocimientos[i]));\n }\n return conocimientosJs;\n}", "title": "" }, { "docid": "0d3b9a672cd65db059178a7408dd6d31", "score": "0.5484558", "text": "function prepararJSON(){\n var JSONCompleto = \"{\";\n\n var tituloPesquisa = document.getElementsByName('tituloPesquisa')[0].value;\n var descricaoPesquisa = document.getElementsByName('descricaoPesquisa')[0].value;\n \n JSONCompleto += '\"tituloPesquisa\":\"'+tituloPesquisa+'\",\"descricaoPesquisa\":\"'+descricaoPesquisa+'\"';\n \n var listaPerguntas = document.getElementsByName('Pergunta');\n for(var i=0;i<listaPerguntas.length;i++){\n var tipoPergunta = listaPerguntas[i].getAttribute('tipo');\n \n var idPergunta = listaPerguntas[i].getAttribute('idPergunta');\n idPergunta = (idPergunta != null)? idPergunta:'nulo';\n var obrigatorio = listaPerguntas[i].getAttribute('obrigatorio');\n var tituloPergunta = listaPerguntas[i].childNodes[0].value;\n\n if(obrigatorio == null){\n obrigatorio = \"false\";\n }\n var tituloOpcoes = [];\n let opcoes = listaPerguntas[i].querySelectorAll('.opcao');\n\n for(var j=0; j < opcoes.length;j++){\n let idOpcao = opcoes[j].getAttribute('idOpcao');\n idOpcao = (idOpcao != null) ? idOpcao:\"nulo\";\n let titulo = opcoes[j].value;\n let valor = '{\"idOpcao\":\"'+idOpcao+'\",\"titulo\":\"'+titulo+'\"}';\n tituloOpcoes.push(valor);\n }\n\n var pergunta;\n var chave = \"Pergunta\"+i;\n if(tipoPergunta != 'ABERTA'){\n pergunta = ',\"'+chave+'\":[{\"idPergunta\":\"'+idPergunta+'\",\"tituloPergunta\":\"'+tituloPergunta+'\",\"tipoPergunta\":\"'+tipoPergunta+'\",\"obrigatorio\":\"'+obrigatorio+'\",\"opcoes\":['+tituloOpcoes+']}]';\n }else{\n pergunta = ',\"'+chave+'\":[{\"idPergunta\":\"'+idPergunta+'\",\"tituloPergunta\":\"'+tituloPergunta+'\",\"tipoPergunta\":\"'+tipoPergunta+'\",\"obrigatorio\":\"'+obrigatorio+'\"}]';\n }\n JSONCompleto += pergunta; \n }\n JSONCompleto += '}';\n console.log(JSONCompleto);\n return JSONCompleto;\n}", "title": "" }, { "docid": "cc572444a399a3ffd0c86582b09cdcfc", "score": "0.54779226", "text": "function listaAgenda(queryString,horasObj,nomeMedico,crm,ano,valor){\r\n let vetorHoras = [];\r\n fetch('http://localhost:3030/consulta/sparql', {\r\n method: 'post',\r\n headers: new Headers({'content-type': 'application/x-www-form-urlencoded'}),\r\n body: queryString\r\n }).then(function(response){\r\n return response.json();\r\n }).then(function (json) {\r\n $('ul.nome-medico').append('Médico: ' + nomeMedico);\r\n $('ul.nome-medico').append('<li>' + 'CRM: ' + crm + '</li>');\r\n $('ul.nome-medico').append('<li>' + 'Ano Formação: ' + ano + '</li>');\r\n $('ul.nome-medico').append('<li>' + 'Valor da Consulta: R$' + valor + ',00 </li>');\r\n {\r\n $('div.horarios').append('<table>'+\r\n '<tr >'+\r\n '<th> </th>'+\r\n '<th>DOM</th>'+\r\n '<th>SEG</th>'+\r\n '<th>TER</th>'+\r\n '<th>QUA</th>'+\r\n '<th>QUI</th>'+\r\n '<th>SEX</th>'+\r\n '<th>SAB</th>'+\r\n '</tr>'+\r\n '<tr class=\"hora8_'+crm+'\">'+\r\n '<td>08:00</td>'+\r\n '<td class=\"dia0_\"></td>'+\r\n '<td class=\"dia1_\"></td>'+\r\n '<td class=\"dia2_\"></td>'+\r\n '<td class=\"dia3_\"></td>'+\r\n '<td class=\"dia4_\"></td>'+\r\n '<td class=\"dia5_\"></td>'+\r\n '<td class=\"dia6_\"></td>'+\r\n '</tr>'+\r\n '<tr class=\"hora9_'+crm+'\">'+\r\n '<td>09:00</td>'+\r\n '<td class=\"dia0_\"></td>'+\r\n '<td class=\"dia1_\"></td>'+\r\n '<td class=\"dia2_\"></td>'+\r\n '<td class=\"dia3_\"></td>'+\r\n '<td class=\"dia4_\"></td>'+\r\n '<td class=\"dia5_\"></td>'+\r\n '<td class=\"dia6_\"></td>'+\r\n '</tr>'+\r\n '<tr class=\"hora10_'+crm+'\">'+\r\n '<td>10:00</td>'+\r\n '<td class=\"dia0_\"></td>'+\r\n '<td class=\"dia1_\"></td>'+\r\n '<td class=\"dia2_\"></td>'+\r\n '<td class=\"dia3_\"></td>'+\r\n '<td class=\"dia4_\"></td>'+\r\n '<td class=\"dia5_\"></td>'+\r\n '<td class=\"dia6_\"></td>'+\r\n '</tr>'+\r\n '<tr class=\"hora11_'+crm+'\">'+\r\n '<td>11:00</td>'+\r\n '<td class=\"dia0_\"></td>'+\r\n '<td class=\"dia1_\"></td>'+\r\n '<td class=\"dia2_\"></td>'+\r\n '<td class=\"dia3_\"></td>'+\r\n '<td class=\"dia4_\"></td>'+\r\n '<td class=\"dia5_\"></td>'+\r\n '<td class=\"dia6_\"></td>'+\r\n '</tr>'+\r\n '<tr class=\"hora12_'+crm+'\">'+\r\n '<td>12:00</td>'+\r\n '<td class=\"dia0_\"></td>'+\r\n '<td class=\"dia1_\"></td>'+\r\n '<td class=\"dia2_\"></td>'+\r\n '<td class=\"dia3_\"></td>'+\r\n '<td class=\"dia4_\"></td>'+\r\n '<td class=\"dia5_\"></td>'+\r\n '<td class=\"dia6_\"></td>'+\r\n '</tr>'+\r\n '<tr class=\"hora13_'+crm+'\">'+\r\n '<td>13:00</td>'+\r\n '<td class=\"dia0_\"></td>'+\r\n '<td class=\"dia1_\"></td>'+\r\n '<td class=\"dia2_\"></td>'+\r\n '<td class=\"dia3_\"></td>'+\r\n '<td class=\"dia4_\"></td>'+\r\n '<td class=\"dia5_\"></td>'+\r\n '<td class=\"dia6_\"></td>'+\r\n '</tr>'+\r\n '<tr class=\"hora14_'+crm+'\">'+\r\n '<td>14:00</td>'+\r\n '<td class=\"dia0_\"></td>'+\r\n '<td class=\"dia1_\"></td>'+\r\n '<td class=\"dia2_\"></td>'+\r\n '<td class=\"dia3_\"></td>'+\r\n '<td class=\"dia4_\"></td>'+\r\n '<td class=\"dia5_\"></td>'+\r\n '<td class=\"dia6_\"></td>'+\r\n '</tr>'+\r\n '<tr class=\"hora15_'+crm+'\">'+\r\n '<td>15:00</td>'+\r\n '<td class=\"dia0_\"></td>'+\r\n '<td class=\"dia1_\"></td>'+\r\n '<td class=\"dia2_\"></td>'+\r\n '<td class=\"dia3_\"></td>'+\r\n '<td class=\"dia4_\"></td>'+\r\n '<td class=\"dia5_\"></td>'+\r\n '<td class=\"dia6_\"></td>'+\r\n '</tr>'+\r\n '<tr class=\"hora16_'+crm+'\">'+\r\n '<td>16:00</td>'+\r\n '<td class=\"dia0_\"></td>'+\r\n '<td class=\"dia1_\"></td>'+\r\n '<td class=\"dia2_\"></td>'+\r\n '<td class=\"dia3_\"></td>'+\r\n '<td class=\"dia4_\"></td>'+\r\n '<td class=\"dia5_\"></td>'+\r\n '<td class=\"dia6_\"></td>'+\r\n '</tr>'+\r\n '<tr class=\"hora17_'+crm+'\">'+\r\n '<td>17:00</td>'+\r\n '<td class=\"dia0_\"></td>'+\r\n '<td class=\"dia1_\"></td>'+\r\n '<td class=\"dia2_\"></td>'+\r\n '<td class=\"dia3_\"></td>'+\r\n '<td class=\"dia4_\"></td>'+\r\n '<td class=\"dia5_\"></td>'+\r\n '<td class=\"dia6_\"></td>'+\r\n '</tr>'+\r\n '<tr class=\"hora18_'+crm+'\">'+\r\n '<td>18:00</td>'+\r\n '<td class=\"dia0_\"></td>'+\r\n '<td class=\"dia1_\"></td>'+\r\n '<td class=\"dia2_\"></td>'+\r\n '<td class=\"dia3_\"></td>'+\r\n '<td class=\"dia4_\"></td>'+\r\n '<td class=\"dia5_\"></td>'+\r\n '<td class=\"dia6_\"></td>'+\r\n '</tr>'+\r\n '</table>'+\r\n '<br><br><br><br><br><br><br><br><br><br><br><br>'\r\n );\r\n }\r\n\r\n\r\n json.results.bindings.forEach(element => {\r\n let dt = new Date(element.hora.value);\r\n\r\n horasObj.horario = dt.getHours() ; //isso é igual a hora\r\n horasObj.dia = dt.getDay(); //descobrir o dia\r\n\r\n console.log(element.hora.value);\r\n console.log(dt.getDay());\r\n $('ul.nome-medico').append('<li>' + 'Hora: ' + horasObj.horario + ' Dia: ' + horasObj.dia +'</li>');\r\n $('tr.hora'+ horasObj.horario + '_' + crm ).find('td.dia'+ horasObj.dia +'_').text('X');\r\n })\r\n $('ul.nome-medico').append('<br><br><br>');\r\n //$('tr.hora14_96').find('td.dia0_').text('X');\r\n }) \r\n return vetorHoras;\r\n}", "title": "" }, { "docid": "a2d6a1854725a554e8711776387e6f12", "score": "0.54620266", "text": "function pushData2(result) {\r\n\tvar arrayData = [];\r\n\t//var result = res['data'];\r\n\tfor (var i = 0; i < result.length; i++) {\r\n\t\tvar item = result[i];\r\n\t\tarrayData.push({\r\n\t\t\tid: item.id,\r\n\t\t\tpayment_date:item.payment_date,\r\n\t\t\tamount: item.amount,\r\n\t\t\tpledge_id: item.title,\r\n\t\t\tpayment_method_id: item.payment_method,\r\n\t\t\tcomments:item.comments\r\n\t\t});\r\n\t}\r\n\treturn arrayData;\r\n}", "title": "" }, { "docid": "26f6794b45b8ccf31a5c02be77e83957", "score": "0.53607064", "text": "function extractJson2(str,informacion_de) {\r\n ini_milayer(informacion_de);\r\n var html ='<table class=\"table-striped table-condensed mitable\" id=\"tabladatos\">';\r\n var json= eval('(' + str + ')');\r\n //Variables usadas para crear enlaces segun se necesiten.\r\n var enlaceUri;\r\n/*\r\n for(var b = 0; b< 1; b++) {\r\n html += \"<thead><tr>\";\r\n //var x;\r\n var objeto=json.results.bindings[b];\r\n for (var propiedad in objeto) { \r\n if (propiedad==\"miURI\") enlaceUri=propiedad.value;\r\n else if (propiedad==\"Nombre\")\r\n html+=\"<th>\"+propiedad+\"</th>\";\r\n }\r\n html+=\"<th>Detalles</th></tr></thead>\";\r\n }\r\n*/\r\n html+=\"<tbody>\";\r\n for(var b = 0; b< json.results.bindings.length; b++) {\r\n// html += '<tr><td><i class=\"fa fa-location-arrow\"></i></td>';\r\n //var x;\r\n html+='<tr>';\r\n var objeto=json.results.bindings[b];\r\n for (var propiedad in objeto) { \r\n //var valor = json.results.bindings[b][json.head.vars[x]];\r\n if (propiedad==\"miURI\") {enlaceUri=objeto[propiedad].value;}\r\n else {\r\n if (propiedad==\"Nombre\") {\r\n// html+='<td style=\"word-break:break-all;\"><div class=\"panel panel-default\"><div class=\"panel-body panel-body-mio\"><div class=\"midivpancab\"><b><a href=\"'+enlaceUri+'\">' + objeto[propiedad].value + '</a></b></div><i class=\"fa fa-location-arrow\"></i><hr class=\"mihr\">';//</td><td>';\r\n html+=\"<td style='word-break:break-all;''><div class='materialCard success'><header><h2><a href='\"+enlaceUri+\"'>\" + objeto[propiedad].value + \"</a></h2></header><div class='cont'>\";\r\n resultados[b]=[];\r\n resultados[b][0]=objeto[propiedad].value;\r\n }\r\n //console.log(propiedad+ \" =T- \"+ objeto[propiedad].type+\" --> \"+objeto[propiedad].value);\r\n else if (objeto[propiedad].type == \"uri\")\r\n html += \"<b>\"+propiedad+\":</b> <a href='\"+objeto[propiedad].value+\"'>\" + objeto[propiedad].value + \"</a></br>\";\r\n else if (propiedad == \"geo_lat\") {\r\n resultados[b][1]=objeto[propiedad].value;\r\n html += \"<b>\"+propiedad+\":</b> \"+objeto[propiedad].value + \"</br>\";\r\n// console.log(\"R: \"+resultados[b][1]+\" - O: \"+objeto[propiedad].value);\r\n }\r\n else if (propiedad == \"geo_long\") {\r\n resultados[b][2]=objeto[propiedad].value;\r\n html += \"<b>\"+propiedad+\":</b> \"+objeto[propiedad].value + \"<div class='midivhr'><a href='#' onclick='trazaunaruta(mlat,mlong,\"+resultados[b][1]+\",\"+resultados[b][2]+\",false);'><i class='fa fa-location-arrow'></i> Cómo llegar?</a></div>\";\r\n }\r\n else\r\n html += \"<b>\"+propiedad+\":</b> \"+objeto[propiedad].value + \"</br>\";\r\n }\r\n }\r\n html += \"</div></div></td></tr>\";\r\n //console.log(\"----\"+objeto[\"Nombre\"].value);\r\n var infoobjeto='<h4>'+arraytipoInfo[informacion_de-1][1]+'</h4>'+objeto[\"Nombre\"].value+'<hr><div><span><a target=\"blank\" href=\"'+enlaceUri+'\">Opendata</a></span> - <span><a href=\"#\" onclick=\"trazaunaruta(mlat,mlong,'+resultados[b][1]+','+resultados[b][2]+',false);\">Llévame...</a></span></div>';\r\n addMarker(json.results.bindings[b].geo_long.value,json.results.bindings[b].geo_lat.value,infoobjeto,informacion_de); \r\n } //FOR\r\n// console.log(arraytipoInfo[informacion_de-1][1]+\" - - - - \");\r\n addmiLayer(arraytipoInfo[informacion_de-1][1]);\r\n html += \"</tbody></table>\";\r\n document.getElementById(\"results\").innerHTML = html;\r\n //return html;\r\n }", "title": "" }, { "docid": "845fdd04d1fa6c9736c599cbfcdad51a", "score": "0.53605425", "text": "function createObject(data)\n{\n\tlet data1 = data.split(\"],\");\n\t//console.log(data1);\n\tlet objArray = new Array();\n\n\tdata1.forEach((element, index)=>{\n\t\telement = element.replace(/(\\[|\\])/g, \"\");\n\t\t//console.log(element + \", \"+index);\n\t\tlet arr1 = new Array();\n\t\tlet arr = new Array();\n\t\tarr1 = element.split(\", \");\n\n\t\t//console.log(arr);\n\t\tarr1.forEach((e, i)=>{\n\t\t\tif(i === 0)\n\t\t\t{\n\t\t\t\tarr.id = e;\n\t\t\t}\n\n\t\t\telse if(i === 1)\n\t\t\t{\n\t\t\t\tarr.email = e;\n\t\t\t}\n\n\t\t\telse if(i === 2)\n\t\t\t{\n\t\t\t\tarr.name = e;\n\t\t\t}\n\n\t\t\telse if(i === 3)\n\t\t\t{\n\t\t\t\tarr.password = e;\n\t\t\t}\n\n\t\t\telse if(i === 4)\n\t\t\t{\n\t\t\t\tarr.type = e;\n\t\t\t}\n\n\t\t\telse if(i === 5)\n\t\t\t{\n\t\t\t\tarr.mac = e;\n\t\t\t}\n\n\t\t});\n\n\t\t\n\t\tobjArray[index] = arr;\n\t});\n\t\n\treturn populateTable(objArray);\n}", "title": "" }, { "docid": "e37928661abef556fbde57affeffb386", "score": "0.5334751", "text": "async function GetAllAlunni() {\n let users = []; //array che contiene la lista di tutti gli utenti\n let utenti = await Anagrafica.findAll(); //query al DB\n\n utenti.forEach(utente => {\n users.push(utente.dataValues);//aggiunge ogni utente all'array users\n });\n let jobj = {\n \"Status\": 0,\n \"Result\": users\n }\n return(JSON.stringify(jobj));\n}", "title": "" }, { "docid": "f51e767d6567982ce8ce1d0039507fb0", "score": "0.5310324", "text": "function RETORNAFILTROS_JsonData() {\r\n\r\n var _pesquisa = TXT_PESQUISA.getValue();\r\n\r\n if (!_pesquisa) _pesquisa = '';\r\n\r\n var TB_TRANSPORTADORA_JsonData = {\r\n ID_CLIENTE: _ID_CLIENTE,\r\n ID_USUARIO: _ID_USUARIO,\r\n pesquisa: _pesquisa,\r\n start: 0,\r\n limit: DOCUMENTO_PagingToolbar.getLinhasPorPagina()\r\n };\r\n\r\n return TB_TRANSPORTADORA_JsonData;\r\n }", "title": "" }, { "docid": "238df6a1dc47e82570153b48fea1b2af", "score": "0.53016484", "text": "async function GetAllServiti() {\n let prenotazioni = []; //array che contiene la lista di tutte le prenotazioni\n let _prenotazioni = await Prenotazioni.findAll({\n where: {\n OraConsumazione: {\n [Op.ne]: 0\n }\n }\n }); //query al DB\n\n _prenotazioni.forEach(prenotazione => {\n prenotazioni.push(prenotazione.dataValues);//aggiunge ogni utente all'array users\n });\n let jobj = {\n \"Status\": 0,\n \"Result\": prenotazioni\n }\n return(JSON.stringify(jobj));\n}", "title": "" }, { "docid": "02ec7beb0b749e3933dd5a650f4600fb", "score": "0.5264434", "text": "function json_obtener_fechas(tipo,anio)\n{\n baseurl=$(\"#burl\").val();\n direccion=baseurl+'justificacion_marcado/obtener_fechas_solicitadas'\n resultado=new Array();\n $.getJSON(direccion, {\n tipo: tipo,\n anio:anio\n }, function(resp) {\n j=0;\n //alert('el tamaño del vector es '+resp.length);\n for(i=0;i<resp.length*2; i=i+2)\n { \n resultado[i]=resp[j]['fec'];\n resultado[i+1]=resp[j]['tit'];\n j++;\n // alert(resultado[i]+' es '+resultado[i+1]);\n }\n alert('tamaño '+resultado.length)\n return(resultado);\n });\n \n}", "title": "" }, { "docid": "e1f3814514b683f4c1f961e8174c2086", "score": "0.5258234", "text": "function consultaFinal(turno_nome, turno_inicio, turno_fim, tipo_parada, sql4) {\r\n\r\n db.transaction(function (tx4) {\r\n tx4.executeSql(sql4, [], function (tx4, rs4) {\r\n var rs4len = rs4.rows.length, k;\r\n\r\n\r\n for (k = 0; k < rs4len; k++) {\r\n duracao = rs4.rows.item(k).duracao;\r\n }\r\n if (duracao == null) {\r\n duracao = 0;\r\n } else {\r\n duracao = parseInt(duracao);\r\n }\r\n\r\n //alert(turno_nome + '\\n' + turno_inicio + '\\n' + turno_fim + '\\n' + tipo_parada + '\\n' + duracao );\r\n\r\n //console.log(JSON.stringify(mydataset));\r\n //mydataset[tipo_parada].data.push(duracao);\r\n for (var i = 0; i < mydataset.length; i++) {\r\n if (mydataset[i].label == tipo_parada) {\r\n //alert(mydataset[i].label);\r\n mydataset[i].data.push(duracao);\r\n }\r\n }\r\n /*\r\n for (var i = 0; i < mydataset.length; i++){\r\n document.write(\"<br><br>array index: \" + i);\r\n var obj = mydataset[i];\r\n for (var key in obj){\r\n var value = obj[key];\r\n console.log(\"------->\" + key + \": \" + value);\r\n if (key=='data'){\r\n obj[key].push(duracao);\r\n }\r\n }\r\n }*/\r\n\r\n\r\n\r\n\r\n });\r\n });\r\n }", "title": "" }, { "docid": "4cd0bdfcc87f5da162c5148f99da709d", "score": "0.5232024", "text": "function resultDataSelect(res){ \n var cities = [];\n var tipes = []; \n for (var i = 0; i < res.length; i++) { \n if(!containData(cities, res[i].Ciudad)){ \n cities.push(res[i].Ciudad) \n } \n\n if(!containData(tipes, res[i].Tipo)){ \n tipes.push(res[i].Tipo) \n } \n }; \n getSelectHTML(cities,selectCity); \n getSelectHTML(tipes,selectTipo); \n}", "title": "" }, { "docid": "2e7df95b669fc9d0407ca8c31cd4753e", "score": "0.5225926", "text": "getArrayOfJsonsFromSet(userInfos) {\n /* converts an array of json strings to an array of JSON parsed objects */\n const userInfoObjs = [];\n Array.from(userInfos).forEach((userInfoStr) => {\n userInfoObjs.push(JSON.parse(userInfoStr));\n });\n return userInfoObjs;\n }", "title": "" }, { "docid": "6ac12de7264e20b089cd791f5cdcb760", "score": "0.52224225", "text": "function createManagerArr(result) {\n // creates an empty manager array to be returned at the end\n const managerArr = [];\n\n // loops through the results that are given and creates a manager object that is finally pushed into the managerArr\n for (let i = 0; i < result.length; i++) {\n let managerName = result[i].first_name + ' ' + result[i].last_name;\n let managerId = result[i].id;\n\n const managerObj = {};\n managerObj.name = managerName;\n managerObj.id = managerId;\n\n managerArr.push(managerObj);\n }\n\n return managerArr;\n}", "title": "" }, { "docid": "57ae8ad98d94e7f95964336e875c3305", "score": "0.5196225", "text": "makeQuery(_from, _to, gl){\n let str1 = ConstClass.PROP_NAMES.nacimiento,\n str2 = ConstClass.PROP_NAMES.escolaridad,\n search = {query : {}, limit : 2};\n\n search.query[str1] = {\"desde\" : _from, \"hasta\" : _to};\n search.query[str2] = gl;\n\n return JSON.stringify(search);\n }", "title": "" }, { "docid": "6674a8668331686c34e5700564804100", "score": "0.51770175", "text": "function getJSON(arrayID,arrayText) { \n var JSON = \"[\";\n //should arrayID length equal arrayText lenght and both against null\n if (arrayID != null && arrayText != null && arrayID.length == arrayText.length) {\n for (var i = 0; i < arrayID.length; i++) {\n JSON += \"{\";\n JSON += \"chapter:\" + arrayText[i] + \",\";\n JSON += \"person:\" + arrayID[i];\n JSON += \"},\";\n }\n }\n JSON += \"]\"\n JSON = Function(\"return \" + JSON + \" ;\");\n return JSON();\n}", "title": "" }, { "docid": "c021f700be4a5039ca3ed9433d329392", "score": "0.5160576", "text": "function makeArrayOfData(data,delimeter){\n var tempData=[];\n //alert(\"datat---\"+data);\n if(delimeter!='' && delimeter!='undefined' && delimeter!=null && data!=null && data!=''){\n\t //data=data.replace(/<\\/?([a-z][a-z0-9]*)\\b[^>]*>?/gi, '');\n \tvar newData=Trim(data).split(delimeter);\n \tvar counter=0;\n \tif(newData!='' && newData!='undefined'){\n \t\t//for(q in newData){\n \t\t\tfor(var q=0;q < newData.length; q++){\n \t\t\t//console.log(\"Loop value start-\"+q);\n \t\t\tif(newData[q]!='' && Trim(newData[q])!='' && newData[q]!=','){\n \t\t\t\t//console.log(\"Loop value after null check--\"+q);\n \t\t\t\ttempData[counter]={name:newData[q],id:newData[q]};\n \t\t\t\tcounter++;\n \t\t\t} \t\t\t\n \t\t}\n \t\treturn tempData;\n \t}\n \t//alert(\"final tempData\"+tempData);\n }\n //alert(\"final tempData2\"+tempData);\n }", "title": "" }, { "docid": "96b0e3724e05a2a386670715be15c509", "score": "0.513876", "text": "function buildJsonRow(arr, s, e) {\n\n let row = new Array();\n let selection = getElementIndexbyString(s, e);\n\n let start = arr[arr.findIndex(selection.start)];\n let end = arr[arr.findIndex(selection.end)];\n\n row.push(start);\n\n if (start != end) {\n let index = 0;\n arr.forEach(element => {\n if (index > arr.findIndex(selection.start) && index < arr.findIndex(selection.end)) {\n row.push(element);\n }\n index++;\n });\n row.push(end);\n row = row.join(',');\n }\n else {\n row = (row.length <= 1 && row[0] == null) ? `${s}${e}` : row.join('');\n }\n\n return row;\n\n}", "title": "" }, { "docid": "4a3ed328e561a9a929e41a976ed9cb94", "score": "0.5132869", "text": "function createDepartmentArr(result) {\n // creates an empty department array that will be returned\n const departmentArr = [];\n\n // loops through the results and pushes all of the department names to an array\n for (let i = 0; i < result.length; i++) {\n departmentArr.push(result[i].name);\n }\n\n return departmentArr;\n}", "title": "" }, { "docid": "45567eaeaf6a00d587297e1691a88312", "score": "0.5124172", "text": "function consultaEtapasProyecto(){\n $.ajax({\n url: \"./control/etapa-detalles.php\",\n type: 'POST',\n data: {\n idProyecto: $(\"#idProyecto\").val()\n },\n success: function (response) {\n //COnvertimos el string a JSON\n let obj_proyect = JSON.parse(response);\n console.log(obj_proyect);\n let etapas=constructEtapas(obj_proyect);\n $(\"#tbl-etapa\").html(etapas);\n }\n\n });\n}", "title": "" }, { "docid": "d5fd3d8475dce96592845a0b323cddb9", "score": "0.5080377", "text": "function toJsonTree(result) {\n var tpersonallogs = [];\n for (i = 0; i < result.length; i++) {\n jsonBranch(tpersonallogs, result[i], i);\n }\n return tpersonallogs;\n}", "title": "" }, { "docid": "3214eeddbe3bc5600798c220fd1050a0", "score": "0.50794536", "text": "function themTB(phong,thietbi,buton,trangthai,cho){\r\n var tbs = getAllThietBi();\r\n var json = {};\r\n var butajson=[];\r\n tbs.push({\r\n tenphong : phong,\r\n tenthietbi :thietbi,\r\n tenbuton :buton,\r\n valuetrangthai:trangthai,\r\n //chodao:cho\r\n });\r\n var tbs = getAllThietBi();\r\n for (var i = 0; i < tbs.length; i++){\r\n if(tbs[i].tenphong=== phong){\r\n json['tenphong']=tbs[i].tenphong;\r\n json['tenthietbi']=tbs[i].tenthietbi;\r\n json['tenbuton']=tbs[i].tenbuton;\r\n json['valuetrangthai']=tbs[i].valuetrangthai;\r\n // json['chodao']=tbs[i].chodao;\r\n var j1=JSON.stringify(json);\r\n var j2=JSON.parse(j1);\r\n butajson.push(j2);\r\n\r\n\r\n }\r\n\r\n }\r\n console.log(butajson.length);\r\n return butajson;\r\n}", "title": "" }, { "docid": "efc5f97902e94e84b27f2d8102317959", "score": "0.5067115", "text": "function parseData(result) {\n return JSON.parse(result);\n}", "title": "" }, { "docid": "d7bdf103cbabee869144a34cb8a5f274", "score": "0.506652", "text": "function queryString(arr) {\n return [...arr]; // trzeba w tablicy.\n}", "title": "" }, { "docid": "37c0bc9bbec31a961305b4ed9df66d80", "score": "0.5054895", "text": "function array2json(arr) {\n var parts = [];\n var is_list = (Object.prototype.toString.apply(arr) === '[object Array]');\n var is_list2 = (Object.prototype.toString.apply(arr) === '[object Object]');\n var virgule ='on';\n\n for(var key in arr) {\n\tvar value = arr[key];\n\tif(typeof value == \"object\") { //Custom handling for arrays\n\t\tvar str = \"\";\n\t\tvar str2 = \"\";\n\t\t//alert('object_' + key);\n\t\tif(is_list2){ \n\t\t\tstr = '\\\"'+key + '\\\":';\n\t\t\tvirgule ='on';\n\t\t\tstr2 = array2json(value); /* :RECURSION: */\n\t\t\tstr += str2;\n\t\t\t//str = '{' + str + '}'\n\t\t\tparts.push(str);\n \t\t} else if(is_list) {\n \t\t\tif(isNaN(key)){\n\t\t\t\tstr = '\\\"'+key + '\\\":';\n\t\t\t\tvirgule ='on';\n\t\t\t\tstr2 = array2json(value); /* :RECURSION: */\n\t\t\t\tstr += str2;\n\t\t\t\t//str = '{' + str + '}'\n\t\t\t\tparts.push(str);\n\t\t\t}else{\n\t\t\t\tvirgule ='off'\n\t\t\t\tparts.push(array2json(value)); /* :RECURSION: */\n\t\t\t}\n\t\t}else {\n\t\t\tparts[key] = array2json(value); /* :RECURSION: */\n\t\t}\n\t\t//else parts.push('\"' + key + '\":' + returnedVal);\n\t} else {\n\t\tif(typeof value != \"function\"){\n\t\t\t//virgule ='on';\n\t\t\tvar str = \"\";\n\t\t\t//if(!is_list) \n\t\t\tstr = '\\\"'+key + '\\\":';\n\t \n\t\t\t//Custom handling for multiple data types\n\t\t\tif(typeof value == \"number\") str += value; //Numbers\n\t\t\telse if(value === false) str += 'false'; //The booleans\n\t\t\telse if(value === true) str += 'true';\n\t\t\telse str += '\\\"'+value+'\\\"' ; //All other things\n\t\t\t// :TODO: Is there any more datatype we should be in the lookout for? (Functions?)\n\t\t\tparts.push(str);\n\t\t}\n\t}\n }\n if(virgule =='on'){\n var json = parts.join(\", \");\n return '{' + json + '}';//Return numerical JSON\n }\n else if(virgule =='off'){\n var json = parts.join(\", \");\n return '[' + json + ']';//Return associative JSON\n }\n \n //if(is_list) return '{' + json + '}';//Return numerical JSON\n //return '{' + json + '}';//Return associative JSON\n}", "title": "" }, { "docid": "bc011af5b95e1b82f5d033aab9caafa5", "score": "0.5048897", "text": "static fromJSON(semesters) {\n let result = [];\n\n if (Array.isArray(semesters)) {\n semesters.forEach((s) => {\n Object.setPrototypeOf(s, SemesterBO.prototype);\n result.push(s);\n })\n } else {\n // Es handelt sich offenbar um ein singuläres Objekt\n let s = semesters;\n Object.setPrototypeOf(s, SemesterBO.prototype);\n result.push(s);\n }\n\n return result;\n }", "title": "" }, { "docid": "505e8f87abbc1e43a9cf60adc960a01d", "score": "0.5044027", "text": "function toJsonTree(result) {\n var tUserss = [];\n for (i = 0; i < result.length; i++) {\n jsonBranch(tUserss, result[i], i);\n }\n return tUserss;\n}", "title": "" }, { "docid": "8cc07517424d8dcfed49fcf09fbbe629", "score": "0.50256383", "text": "function frageSql(db, sql) {\n\tvar qry, a, b, c, d;\n\tqry = db.query(sql, {json:true});\n\tif (qry.length > 0) {\n\t\ta = JSON.stringify(qry);\n\t\t//Rückgabewert ist in \"\" eingepackt > entfernen\n\t\tb = a.slice(1, a.length -1);\n\t\t//im Rückgabewert sind alle \" mit \\\" ersetzt. Das ist kein valid JSON!\n\t\tc = b.replace(/\\\\\\\"/gm, \"\\\"\");\n\t\t//jetzt haben wir valid JSON. In ein Objekt parsen\n\t\t//console.log(c);\n\t\td = JSON.parse(c);\n\t\treturn d;\n\t} else {\n\t\treturn null;\n\t}\n}", "title": "" }, { "docid": "5cea1ebfbc46306800b041c24d4d4563", "score": "0.5021672", "text": "function getAppelloDaPrenotare(cdsId,adId){\n return new Promise(function(resolve, reject) {\n var appelliDaPrenotare=[];\n var rawData='';\n\n getSingoloAppelloDaPrenotare(cdsId,adId).then((body)=>{\n //controllo che body sia un array\n if (Array.isArray(body)){\n rawData=JSON.stringify(body);\n //console.log('\\n\\nQUESTO IL BODY ESAMI PRENOTABILI ' +rawData);\n //creo oggetto libretto\n for(var i=0; i<body.length; i++){\n //modifica del 16/05/2019 dopo cambio query\n appelliDaPrenotare[i]= new appello(body[i].aaCalId,body[i].adCod, body[i].adDes, body[i].adId,body[i].appId, body[i].cdsCod,\n body[i].cdsDes,body[i].cdsId,body[i].condId,body[i].dataFineIscr,body[i].dataInizioApp, body[i].dataInizioIscr, body[i].desApp,\n //aggiunto qui in data 16/05/2019\n body[i].note,body[i].numIscritti,body[i].numPubblicazioni,body[i].numVerbaliCar,body[i].numVerbaliGen,\n body[i].presidenteCognome,body[i].presidenteId,body[i].presidenteNome,body[i].riservatoFlg,body[i].stato,body[i].statoAperturaApp,body[i].statoDes,body[i].statoInsEsiti,body[i].statoLog,body[i].statoPubblEsiti,body[i].statoVerb,\n body[i].tipoDefAppCod,body[i].tipoDefAppDes,body[i].tipoEsaCod,body[i].tipoSceltaTurno, null);\n \n appelliDaPrenotare[i].log();\n \n/*\n appelliDaPrenotare[i]= new appello(null,null, null, null,null, null,\n null,null,null,null,body[i].dataInizioApp, null, null,\n \n null,null,null,null,null,\n null,null,null,null,null,null,null,null,null,null,null,\n null,null,null,null, null);\n console.log('PD PD PD data '+body[i].dataInizioApp);\n appelliDaPrenotare[i].log();*/\n\n }\n resolve(appelliDaPrenotare);\n }\n });\n });\n\n}", "title": "" }, { "docid": "4661801fb77bec934abfd95ebb049389", "score": "0.50158834", "text": "function CargarlosEventosUsuarios(arrayempleados) {\n //$(\"#contagenda\").empty();\n\n /*if(arrayempleados.query[0].Nombre!==undefined){\n // console.log(arrayempleados);\n document.getElementById(\"textagendadeldia\").innerHTML=\"Agenda del Dia de: <br>\"+arrayempleados.query[0].Nombre;\n\n } */\n\n\n //// console.log(arrayempleados);\n var arrayevuser = [];\n var cont = 0;\n for (var i = 0; i < arrayempleados.query.length; i++) {\n var idEmpleado = arrayempleados.query[i].id;\n\n var deviceKey = localStorage.getItem('DeviceKey');\n var Mobilekey = localStorage.getItem('AzureMobile');\n var consulta = 'SELECT * From dbCalendario_Tareas t inner join dbCalendario_Tareas_Participantes p on p.idTarea=t.id Where p.id_Participante=' + idEmpleado;\n\n var postdata = {};\n\n postdata.deviceKey = deviceKey;\n postdata.mobileKey = Mobilekey;\n postdata.query = consulta;\n\n $.ajax({\n type: \"GET\",\n url: \"http://admix.com.mx:8090/Test.asmx/Query\",\n dataType: 'xml',\n contentType: 'application/xml;charset=utf-8',\n data: postdata,\n success: ResultEventosUser,\n error: function(responseError, msg, e) {\n var tempError = JSON.stringify(responseError);\n //// console.log(tempError.responseText);\n myApp.alert(\"Error, Al consultar Usuario\");\n }\n\n });\n\n function ResultEventosUser(data) {\n\n var datatojson = $.parseJSON(data.documentElement.innerHTML);\n //// console.log(data);\n\n var arreglovacio = [];\n arreglovacio = datatojson.length;\n\n if (datatojson[0] !== null) {\n var eventosusuario = $.parseJSON(datatojson);\n //// console.log(eventosusuario);\n arrayevuser[cont] = eventosusuario;\n cont++;\n\n\n } else {\n myApp.alert(\"Un usuario seleccionado no tiene eventos\");\n }\n\n\n /*if (datatojson[i] !== 'undefined' && datatojson[i] !== null&& datatojson[i] !== [null]) {\n\n\n var eventosusuario=$.parseJSON(datatojson);\n //// console.log(eventosusuario);\n arrayevuser[cont]=eventosusuario;\n cont++;\n\n }else{\n myApp.alert(\"Un usuario no tiene eventos\");\n\n }\n */\n\n\n\n /*if(datatojson[i]===null&& datatojson[i]==='undefinded'){\n // myApp.alert(\"no tiene eventos\");\n\n var arraysineventos=[];\n\n arraysineventos[i]=\"No tiene Eventos en Este Momento\";\n //arrayevuser[cont]= arraysineventos;\n //cont++;\n\n }else{\n var eventosusuario=$.parseJSON(datatojson);\n //// console.log(eventosusuario);\n arrayevuser[cont]=eventosusuario;\n cont++;\n }*/\n\n //// console.log(arrayevuser);\n Agendadeldia(arrayevuser);\n Pestanatareas(arrayevuser);\n\n //Calendarioeventos(arrayevuser);\n\n }\n\n //// console.log(arrayevuser);\n }\n\n //// console.log(arrayevuser);\n\n\n //mainView.router.load({url:'pags/Iniciotabs.html',query:arrayevuser});\n\n\n }", "title": "" }, { "docid": "3ee19ad8983374373ef242bb7aa22894", "score": "0.50156164", "text": "function fromDbtoJsAsgProyectos(asgProyectos) {\n var asgProyectosJs = [];\n for (var i = 0; i < asgProyectos.length; i++) {\n asgProyectosJs.push(fromDbtoJsAsgProyecto(asgProyectos[i]));\n }\n return asgProyectosJs;\n}", "title": "" }, { "docid": "1c42333d198e6b7d5fc5d9ef1bf44c7f", "score": "0.50142026", "text": "function dataFormToJson(NombreJSON,clase){\n var elementsForm = new Array();\n elementsForm = document.getElementsByClassName(clase);\n if(elementsForm.length>0){ \n var returnJSON ='{\"'+NombreJSON+'\":['; \n for(var i=0; i<elementsForm.length; i++) {\n returnJSON += '{'; \n returnJSON += '\"'+elementsForm[i].id+'\":\"'+elementsForm[i].value+'\",'; \n returnJSON = returnJSON.substring(0,returnJSON.length-1)+'},'; \n } \n \n returnJSON = returnJSON.substring(0,returnJSON.length-1)+']}'; \n return(JSON.parse(returnJSON));\n } \n}", "title": "" }, { "docid": "6326f816227f8bd111462e299077b859", "score": "0.5003417", "text": "makeQuery(_from, _to){\n \tlet str = ConstClass.PROP_NAMES.nacimiento,\n \t search = {query : {}, limit : 2};\n\n\t search.query[str] = {desde : _from, hasta : _to};\n\t return JSON.stringify(search);\n }", "title": "" }, { "docid": "3f6d7636e0b0f6d5f6f093a71d9989d6", "score": "0.49992016", "text": "function getProductos(){ \n $.ajax({\n url:ruta, // la URL para la petición\n data:\"producto=null\",\n type: 'POST', // especifica si será una petición POST o GET\n dataType: 'json', // el tipo de información que se espera de respuesta\n success: function(data) { \n // código a ejecutar si la petición es satisfactoria; // la respuesta es pasada como argumento a la función\n // guardar=json;\n productos = [];\n for (var x = 0 ; x < data.length ; x++) {\n productos.push(new Cproducto(data[x].id, data[x].nombre, data[x].precio, 0, data[x].id_categoria, data[x].descripcion, data[x].foto));\n }\n },\n // código a ejecutar si la petición falla;: los parámetros sonunobjeto jqXHR(extensión de XMLHttpRequest), un untexto con el estatus de la petición y un texto con la descripción del error que haya dado el servidor\n error : function(jqXHR, status, error) { \n alert('Disculpe, existió un problema'); \n }\n });\n}", "title": "" }, { "docid": "ea839ce44e9b2a0007cadd11fcea0ad1", "score": "0.49940738", "text": "function BuildResultSetfroMxID(details)\n{\n var resultSet = new Array();\n\n for(i in details)\n {\n var arg1 = new Object();\n console.log(i);\n arg1.firstName = details[i].firstName;\n arg1.middleName = details[i].middleName;\n arg1.lastName = details[i].lastName;\n arg1.city = details[i].city;\n arg1.seqId = 'MX' + details[i].mxId + details[i].mxIdSuffix;\n arg1.id = details[i]._id;\n resultSet.push(arg1);\n }\n var jsonResultSet = JSON.parse(JSON.stringify(resultSet));\n\n return jsonResultSet;\n\n}", "title": "" }, { "docid": "b10b3112b5b06785c249940f58915b0a", "score": "0.49868923", "text": "function myJSON(arr){\n\n}", "title": "" }, { "docid": "aaabd21c07310d548e5a7d4b78e490b3", "score": "0.49741226", "text": "function gotResult(err, results) {\n if (err) {\n console.log(err);\n }\n console.log(results)\n objects = results;\n for (let i = 0; i < objects.length; i++) {//mi faccio un array con le parole trovate\n parole.push(objects[i].label);\n console.log(parole[i] + '. ' + 'sono la parola trovata da yolo');\n }\n trovaRima();\n}", "title": "" }, { "docid": "d02f8c12f256aa092aad3985182e97d9", "score": "0.49710953", "text": "function parseDataFunc(json){\n // the json parameter passed through here must have the following\n // indexes/objects\n // func - array, this represents the method to be called on a selector\n // selectors - array, this represents the selectors the method is to be called on\n // type - array, this represents the nature of the parameters sent to the method\n // specifying if they are encapsulated in parentheses from the start e.g \n // .select2({}) or are just plain e.g .select2('');\n // params - array this represents the parameters to be passed into the method\n // being called the values here are created singular or in twos, meaning that \n // everytwo values represents a potential key and value pair in the method or\n // a single value pair, depending on the corresponding 'type' value provided\n\n var output=[];\n var doparse=\"false\";\n var dodeleteparse=\"false\";\n var func=\"\";\n var selectors=\"\";\n var typegd=\"\";\n var params=\"\";\n var dselectors=\"\";\n var dtypegd=\"\";\n var dparams=\"\";\n if(typeof json.func !==\"undefined\"&& Array.isArray(json.func)===true&&json.func[0]!==\"\"){\n func=json.func;\n doparse=\"true\"; \n }\n if(typeof json.selectors !==\"undefined\"&& Array.isArray(json.selectors)===true&&json.selectors[0]!==\"\"){\n selectors=json.selectors;\n doparse=\"true\"; \n }\n if(typeof json.typegd !==\"undefined\"&& Array.isArray(json.typegd)===true&&json.typegd[0]!==\"\"){\n typegd=json.typegd;\n doparse=\"true\"; \n }\n if(typeof json.params !==\"undefined\"&& Array.isArray(json.params)===true&&json.params[0]!==\"\"){\n params=json.params;\n doparse=\"true\"; \n }\n\n if(typeof json.dselectors !==\"undefined\"&& Array.isArray(json.dselectors)===true&&json.dselectors[0]!==\"\"){\n dselectors=json.dselectors;\n dodeleteparse=\"true\"; \n }\n if(typeof json.dtypegd !==\"undefined\"&& Array.isArray(json.dtypegd)===true&&json.dtypegd[0]!==\"\"){\n dtypegd=json.dtypegd;\n dodeleteparse=\"true\"; \n }\n if(typeof json.dparams !==\"undefined\"&& Array.isArray(json.dparams)===true&&json.dparams[0]!==\"\"){\n dparams=json.dparams;\n dodeleteparse=\"true\"; \n }\n\n\n\n var curoutput=\"\";\n if(doparse==\"true\"){\n var flen=func.length;\n for(var i=0;i<flen;i++){\n curfuncname=func[i];\n curselector=selectors[i];\n curtype=typegd[i];\n \n curparams=params[i];\n var cplen=curparams.length;\n // console.log(\"curparams: \",curparams, \" cplen: \",cplen);\n var curparamsout=\"\";\n if(curtype==\"encapsjq\"){\n for (var t=0;t<cplen;t+=2){\n \n var coma= t<cplen-2?\",\":\"\";\n \n ckey=curparams[t];\n cval=curparams[t+1];\n // console.log(\"ckey: \",ckey,\" cval: \",cval);\n // replace the sign `` with a single quote;\n cval=cval.replace(/``/g, \"'\");\n // replace the sign ~~ with a double quote;\n cval=cval.replace(/~~/g, '\"');\n\n curparamsout+=ckey+\":\"+cval+coma;\n \n\n }\n curparamsout='{'+curparamsout+'}';\n }else if(curtype==\"plainjq\"){\n for (var t=0;t<cplen;t++){\n var coma=\"\";\n t<cplen?coma=\",\":coma=\"\";\n cval=curparams[t];\n curparamsout+='\\''+cval+'\\''+coma+'';\n }\n }\n\n curoutput+=\"$('\"+curselector+\"').\"+curfuncname+\"(\"+curparamsout+\");\";\n }\n\n }\n\n var curdoutput=\"\";\n if(dodeleteparse==\"true\"){\n var flen=func.length;\n for(var i=0;i<flen;i++){\n curfuncname=func[i];\n curselector=dselectors[i];\n curtype=dtypegd[i];\n \n curparams=dparams[i];\n var cplen=curparams.length;\n var curparamsout=\"\";\n if(curtype==\"encapsjq\"){\n for (var t=0;t<cplen;t+=2){\n \n var coma= t<cplen-2?\",\":\"\";\n \n ckey=curparams[t];\n cval=curparams[t+1];\n // replace the sign `` with a single quote;\n cval=cval.replace(/``/g, \"'\");\n // replace the sign ~~ with a double quote;\n cval=cval.replace(/~~/g, '\"');\n\n curparamsout+=ckey+\":\"+cval+coma;\n \n\n }\n curparamsout='{'+curparamsout+'}';\n }else if(curtype==\"plainjq\"){\n for (var t=0;t<cplen;t++){\n \n var coma=t<cplen-1?\",\":\"\";\n \n cval=curparams[t];\n\n curparamsout+='\\''+cval+'\\''+coma;\n \n\n }\n }\n\n curdoutput+=\"$('\"+curselector+\"').\"+curfuncname+\"(\"+curparamsout+\");\";\n }\n\n }\n output['output']=curoutput;\n output['doutput']=curdoutput;\n output['totaloutput']=curdoutput+\" \"+curoutput;\n // console.log(\"output: \",output);\n return output;\n}", "title": "" }, { "docid": "e5bf858c71953dfae0be02cfb862f163", "score": "0.49594828", "text": "function carregaElementosNaPagina(json) {\n for(let pessoa of json){\n const tr = document.createElement('tr');\n\n let td1 = document.createElement('td');\n td1.innerHTML = pessoa.nome;\n tr.appendChild(td1);\n\n let td2 = document.createElement('td');\n td2.innerHTML = pessoa.idade;\n tr.appendChild(td2);\n\n let td3 = document.createElement('td');\n td3.innerHTML = pessoa.salario;\n tr.appendChild(td3);\n\n let td4 = document.createElement('td');\n td4.innerHTML = pessoa.sexo;\n tr.appendChild(td4);\n\n\n table.appendChild(tr);\n }\n\n const resultado = document.querySelector('.resultado');\n resultado.appendChild(table);\n\n}", "title": "" }, { "docid": "5571da8be6f07108bb41837cefc4cef8", "score": "0.4958366", "text": "function recorrer_objetos(url, aplicador, folioSucursal, fechaCreacio, zonaCuestionario) {\n // var arreglo = new Array();\n //por obtener, en ciclo\n var ordenCuestiones, respuesta = 0, Observaciones;\n //objeto para llenar\n var obj = {};\n\n\n //recorre la tabla de preguntas en cada uno de sus puntos\n $('.tablaPreguntas tr').each(function (index) {\n\n //recorre los hijos del objeto\n $(this).children(\"td\").each(function (subIndex) {\n switch (subIndex) {\n case 0:\n ordenCuestiones = $(this).text();\n break;\n }//fin switch\n });//fin each de hijos\n\n //checamos si se respondi si o no en cuestionario\n if ($('#si' + index).is(':checked') === true) respuesta = 1;\n else if ($('#no' + index).is(':checked') === true) respuesta = 0;\n else if ($('#na' + index).is(':checked') === true) respuesta = 2;\n\n //asignamos las observaciones\n Observaciones = $('#obs' + index).val();\n\n //llenamos el objeto\n obj = {\n 'aplicador': aplicador,\n 'sucursal': folioSucursal,\n 'fecha': fechaCreacio,\n 'zona': zonaCuestionario,\n 'criterio': (index + 1),\n 'respuesta': respuesta,\n 'observaciones': Observaciones\n }//fin obj\n\n //funcion ajax a check_list_establecimientos\n enviarDatos(url, obj, console.log(\"esperando\"), console.log(\"listo\"));\n\n });//fin de primer each\n\n}//fin", "title": "" }, { "docid": "bab12cd6f2e1c89c4b9207ef419ef718", "score": "0.4952768", "text": "function obtenDatosInvitados(tramite){\r\n\t\tvar param = ($._GET(\"idcg\") == 0 && $._GET(\"id\") == 0) ? \"cargaInvitados=Ok&tramiteSolicitud=\"+tramite : \"tramiteEdicioncargaInvitados=Ok&tramiteComprobacion=\"+tramite;\r\n\t\tvar json = obtenJson(param);\r\n\t\t\r\n\t\tif(json == null){\r\n\t\t\tvar usuario = $(\"#idusuario\").val();\r\n\t\t\tvar param = \"usuarioInvitado=ok&usuario=\"+usuario;\r\n\t\t\tvar jsonUsuario = obtenJson(param);\r\n\t\t\treturn jsonUsuario.rows;\r\n\t\t}else\r\n\t\t\treturn json.rows;\r\n\t}", "title": "" }, { "docid": "1fbc67db4846ba17c04367f0ad48843c", "score": "0.49512708", "text": "function ProvinceDataset(arr, provincie){\n var datasets = arr.result.results;\n // Per provincie, per dataset data ophalen\n for (let i = 0; i < datasets.length; i++) {\n const element = datasets[i];\n // Date in right format\n // var parts = element.modified.split('-');\n // var mydate = \"\";\n // if (parts[0].length == 2) {\n // mydate = new Date(parts[2], parts[1] - 1, parts[0]);\n // }\n // else if (parts[0].length == 4) {\n // mydate = new Date(parts[0], parts[1], parts[2]);\n // }\n // else { console.log(\"other date notation.. : \", parts) }\n\n // Create main dataset list\n dataset_list.push({ \"provincie\": provincie, \"theme_url\": element.theme, \"theme\": element.theme_displayname, \"name\": element.name, \"titel\": element.title, \"source\": element.source, \n \"metadata_created\": element.metadata_created,\n \"meta_modified\": element.metadata_modified,\n \"modified\": element.modified,\n \"metadata_created_date\": new Date(element.metadata_created), \n \"meta_modified_date\": new Date(element.metadata_modified), \n \"modified_date\": new Date(element.modified), \n \"request_date\": new Date() });\n }\n}", "title": "" }, { "docid": "53f274cf096427a3983aa462bd035ab2", "score": "0.49451032", "text": "function toDataQueryResponse(res) {\n var _res$data;\n\n var rsp = {\n data: [],\n state: _grafana_data__WEBPACK_IMPORTED_MODULE_0__[\"LoadingState\"].Done\n };\n\n if ((_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.results) {\n var results = res.data.results;\n\n for (var _i = 0, _Object$keys = Object.keys(results); _i < _Object$keys.length; _i++) {\n var refId = _Object$keys[_i];\n var dr = results[refId];\n\n if (dr) {\n if (dr.error) {\n if (!rsp.error) {\n rsp.error = {\n refId: refId,\n message: dr.error\n };\n rsp.state = _grafana_data__WEBPACK_IMPORTED_MODULE_0__[\"LoadingState\"].Error;\n }\n }\n\n if (dr.series && dr.series.length) {\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = dr.series[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var s = _step.value;\n\n if (!s.refId) {\n s.refId = refId;\n }\n\n rsp.data.push(Object(_grafana_data__WEBPACK_IMPORTED_MODULE_0__[\"toDataFrame\"])(s));\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n }\n\n if (dr.tables && dr.tables.length) {\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = dr.tables[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var _s = _step2.value;\n\n if (!_s.refId) {\n _s.refId = refId;\n }\n\n rsp.data.push(Object(_grafana_data__WEBPACK_IMPORTED_MODULE_0__[\"toDataFrame\"])(_s));\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n }\n\n if (dr.dataframes) {\n var _iteratorNormalCompletion3 = true;\n var _didIteratorError3 = false;\n var _iteratorError3 = undefined;\n\n try {\n for (var _iterator3 = dr.dataframes[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {\n var b64 = _step3.value;\n\n try {\n var t = Object(_grafana_data__WEBPACK_IMPORTED_MODULE_0__[\"base64StringToArrowTable\"])(b64);\n var f = Object(_grafana_data__WEBPACK_IMPORTED_MODULE_0__[\"arrowTableToDataFrame\"])(t);\n\n if (!f.refId) {\n f.refId = refId;\n }\n\n rsp.data.push(f);\n } catch (err) {\n rsp.state = _grafana_data__WEBPACK_IMPORTED_MODULE_0__[\"LoadingState\"].Error;\n rsp.error = toDataQueryError(err);\n }\n }\n } catch (err) {\n _didIteratorError3 = true;\n _iteratorError3 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion3 && _iterator3.return != null) {\n _iterator3.return();\n }\n } finally {\n if (_didIteratorError3) {\n throw _iteratorError3;\n }\n }\n }\n }\n }\n }\n } // When it is not an OK response, make sure the error gets added\n\n\n if (res.status && res.status !== 200) {\n if (rsp.state !== _grafana_data__WEBPACK_IMPORTED_MODULE_0__[\"LoadingState\"].Error) {\n rsp.state = _grafana_data__WEBPACK_IMPORTED_MODULE_0__[\"LoadingState\"].Error;\n }\n\n if (!rsp.error) {\n rsp.error = toDataQueryError(res);\n }\n }\n\n return rsp;\n}", "title": "" }, { "docid": "eb06df9da36e651f7c7756cfc3d653e1", "score": "0.49419972", "text": "function crearCadenaLineal(json){\n\n var parsed = JSON.parse(json);\n var arr = [];\n for(var x in parsed){\n arr.push(parsed[x]);\n }\n return arr;\n}", "title": "" }, { "docid": "06516ca09cde0a340d0d7dfed36766d2", "score": "0.49377522", "text": "function obtenDatosPartida(tramite){\r\n\t\tvar param = \"tramiteEdicion=\"+tramite;\r\n\t\treturn obtenJson(param).rows;\t\t\r\n\t}", "title": "" }, { "docid": "dcdb14ca8e2f6cc832c6b84b76c6f70d", "score": "0.49364492", "text": "function pruebasRealizadas(){\n var request = $.ajax({\n url: \"ajax.php?funcion=getPruebasRealizadas\",\n method: \"POST\",\n data: { \n \"filtro\": {\n \"grafica\" : $(\"#grafica\"),\n \"poblacion\" : $(\"#poblacion\"), // Aunque aqui poodrian incluirse los tres valores (HSH, TSF, TRANS)\n \"fecha\": {\n \"desde\": $(\"#desde\"),\n \"hasta\": $(\"#hasta\")\n },\n \"regiones\": $(\"#regiones\"), // al igual que en poblacion, deberia poder contener un array. \n // estos dos campos son los nuevos que no estan en la otra pagina\n \"prueba\": $(\"#prueba\"),\n \"reactivos\": $(\"#reactivos\")\n // Como puede ser que se genere dinamicamente la informacion desde aqui??\n }\n },\n dataType: \"json\"\n });\n \n\n\n\n // no se como se monta la respuesta\n\n request.done(function (response) {\n if(response.error == 0){ // errores controlados tales como error en la \"BD en la consulta\"\n\n }\n else {\n alert(response.errorMessage);\n }\n });\n\n request.fail(function (jqXHR, textStatus) {\n alert(\"Ocurrió un error: \" + textStatus); // para reflejar los errores que no son controlados en el script, como errores de conexion\n });\n}", "title": "" }, { "docid": "487580576dfdd1cab0edb191f850b24c", "score": "0.4928971", "text": "function crearArray(data)\n{\n var dias=[];\n\n for(let i=0; i< data.list.length; i=i+8) {\n\n var date=new Date(data.list[i].dt*1000);\n console.log(i);\n console.log(date);\n\n // vamos metiendo los datos del json en un array como un objeto tiempo\n dias.push(new Tiempo(i,date,data.list[i].weather[0]['main'] , data.list[i].main['temp_min'], data.list[i].main['temp_max'],data.list[i].main['humidity'],data.list[i].wind['speed'],data.list[i].main['pressure']));\n \n }\n\n return dias;\n}", "title": "" }, { "docid": "6418a44d78ecc69355efb318818777ac", "score": "0.49249437", "text": "obtenerSugerencias(busqueda) {\n this.api.obtenerDatos()\n .then(datos => {\n // Obtener los resultados\n const resultados = datos.respuestaJSON.lugares;\n\n // Enviar el JSON y la busqueda al Filtro\n this.filtrarSugerencias(resultados, busqueda);\n })\n }", "title": "" }, { "docid": "ade7d2fc3144a9dc3a0cb7cb0b333e1e", "score": "0.4923218", "text": "async function GetAllPrenotati() {\n let prenotazioni = []; //array che contiene la lista di tutte le prenotazioni\n let _prenotazioni = await Prenotazioni.findAll({\n where: {OraConsumazione: 0}\n }); //query al DB\n\n _prenotazioni.forEach(prenotazione => {\n prenotazione.dataValues['OraConsumazione'] = 0;\n prenotazioni.push(prenotazione.dataValues);//aggiunge ogni utente all'array users\n });\n let jobj = {\n \"Status\": 0,\n \"Result\": prenotazioni\n }\n return(JSON.stringify(jobj));\n}", "title": "" }, { "docid": "908d0d22370cb58d64379ad432786459", "score": "0.4922682", "text": "function jsonArray(mdJson, jASchema ) {\r\n\t\r\n var newArray =[];\r\n\r\n try {\r\n\r\n\t\tif ( mdJson.length > 0 ) {\r\n\r\n\t for (var i = 0; i < mdJson.length; i++) {\r\n\r\n\t \t// recursively handle objects in array\r\n\r\n\t \tif ( typeof(jASchema) !== \"undefined\" && typeof(jASchema)==\"object\" ) {\r\n\t \t \tvar tjO = {};\r\n\t \t \tvar subData = mdJson[i];\r\n\t \t \tvar trail;\r\n\t \t \ttjO = SubObjectBuilder(subData, trail, jASchema, i); \r\n\t \t \ttjO.array_index = i;\r\n\t \t \tif ( typeof(mdJson[i].datatype) !== \"validationonly\" ) {\r\n\t \t \t\tif ( typeof(mdJson[i].validation) !== \"undefined\" ) {\r\n\t \t \t\t\ttjO.validateonly = mdJson[i].validation.toString();\r\n\t \t \t\t} else {\r\n\t \t \t\t\ttjO.validateonly = \"true\";\r\n\t \t \t\t}\r\n\t \t \t} \r\n\t \t \tnewArray.push(tjO);\r\n\t \t} else {\r\n\t \t \t var tjs = {};\r\n\t \t \ttjs = JSON.parse(JSON.stringify(jASchema)); // cheap copy\r\n\t \ttjs.value = mdJson[i].name;\r\n\t \ttjs.array_index = i; \r\n\r\n\t \t \tif ( typeof(mdJson[i].datatype) !== \"validationonly\" ) {\r\n\t \t \t\tif ( typeof(mdJson[i].validation) !== \"undefined\" ) {\r\n\t \t \t\t\ttjO.validateonly = mdJson[i].validation;\r\n\t \t \t\t} else {\r\n\t \t \t\t\ttjO.validateonly = \"true\";\r\n\t \t \t\t}\r\n\t \t \t}\r\n\t\t\t\t \tnewArray.push(tjs);\r\n\t \t}\r\n\t \r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t// Build empty array item\r\n\t\t newArray.push(jASchema);\r\n\t\t newArray[i].name = \"default\";\r\n\t\t\tnewArray[i].array_index = 0;\r\n\t\t}\r\n\r\n\t} catch (e) {\r\n \tconsole.log('>>>>>>>>>>>>>>>>>>>>>>>>>>> JSON Array Error ' + JSON.stringify(e) );\r\n\t}\r\n\r\n\treturn newArray;\r\n}", "title": "" }, { "docid": "6ca339cc4a8d3f7e8813d17219daef9a", "score": "0.49193117", "text": "function obtenDatosSolicitud(tramite){\r\n\t\tvar param = \"datosSolicitud=ok&tramite=\"+tramite;\r\n\t\treturn obtenJson(param);\t\t\r\n\t}", "title": "" }, { "docid": "204c2a121232b149ced8696fa657ac35", "score": "0.4919196", "text": "function convertData1(input) {\n const pathsArray = [];\n input.forEach((entry) => {\n pathsArray.push({ params: { page: entry.path } });\n if (entry.options) {\n for (const object of entry.options) {\n if (object.path) {\n pathsArray.push({ params: { page: object.path } });\n }\n if (object.options) {\n for (const obj of object.options) {\n pathsArray.push({ params: { page: obj.path } });\n }\n }\n }\n }\n\n return { params: { page: entry.path } };\n });\n\n return pathsArray;\n}", "title": "" }, { "docid": "f6f1f700eeb1d757d7316e08f4146b6e", "score": "0.4918239", "text": "function getLibretto(){\n return new Promise(function(resolve, reject) {\n //array che contiene le righe del libretto\n var libretto=[];\n var rawData='';\n getEsseTreLibretto().then((body)=>{\n //controllo che body sia un array\n if (Array.isArray(body)){\n rawData=JSON.stringify(body);\n //console.log('\\n\\nQUESTO IL BODY del libretto ' +rawData);\n //creo oggetto libretto\n for(var i=0; i<body.length; i++){\n\n libretto[i]= new rigaLibretto(body[i].aaFreqId,body[i].adCod, \n body[i].adDes,body[i].adsceId, body[i].annoCorso, \n body[i].chiaveADContestualizzata,\n body[i].dataFreq, body[i].dataScadIscr, body[i].dataChiusura, body[i].esito,\n //aggiunti qua\n body[i].freqObbligFlg, body[i].freqUffFlg, body[i].gruppoGiudCod, body[i].gruppoGiudDes,\n body[i].gruppoVotoId, body[i].gruppoVotoLodeFlg, body[i].gruppoVotoMaxVoto,\n body[i].gruppoVotoMinVoto, body[i].itmId, body[i].matId, body[i].numAppelliPrenotabili,\n body[i].numPrenotazioni, body[i].ord, body[i].peso, body[i].pianoId, body[i].ragId,body[i].raggEsaTipo,\n body[i].ricId, body[i].sovranFlg,body[i].stato, body[i].statoDes, body[i].stuId,body[i].superataFlg,\n body[i].tipoEsaCod, body[i].tipoEsaDes, body[i].tipoInsCod, body[i].tipoInsDes);\n \n\n libretto[i].log();\n\n }\n resolve(libretto);\n }\n });\n});// fine getLibretto\n}", "title": "" }, { "docid": "e2a44faeee8f47b4a879de4d888ca8fd", "score": "0.49131897", "text": "function grabarTodoTabla(){\n var DATA = [];\n var tam = $(\"#tam\").val();\n var temp = new Array();\n // this will return an array with strings \"1\", \"2\", etc.\n temp = tam.split(\",\");\n var largo = temp.length;\n var TABLA = $(\"#tablaAnaRestantes tr\"); \n // de esta forma puedo obtener la cantidad de tds que tiene mi tabla\n var cantidad_TDS = TABLA.find('input[id=\"ana\"]').length; \n //console.log(cantidad_TDS);\n var cantidad_TRS = TABLA.length;\n cantidad_TRS--; \n // declaracion de algunas variables\n DATA = [];\n var item1 = {};\n var item2 = {}; \n var item3 = {};\n var item4 = {};\n // cargo item1\n item1['columnas']=cantidad_TDS; \n item1['filas']=cantidad_TRS; \n // cargo item2\n for (var i in temp){\n item2[i]=temp[i]; \n }\n // cargo item3\n var k=0; \n for (var i=0; i<=cantidad_TRS;i++ ){ \n var FILA = $('#tablaAnaRestantes tr:eq('+i+')'); \n // atrapo los elemento que es esten seleccionados en los opccion\n var option = FILA.find('select :selected('+k+')').val();\n if (option!=undefined){\n item3[k] = option;\n k++;\n //console.log(item1); \n }\n }\n // cargo DATA con los objetos anteriores\n DATA.push(item1);\n DATA.push(item2);\n DATA.push(item3); \n for (var i=0; i<=cantidad_TRS;i++ ){ \n var FILA = $('#tablaAnaRestantes tr:eq('+i+')');\n var item={}; \n //aca guardo los resultados \n for (var j=0; j<cantidad_TDS;j++ ){ \n var input = FILA.find('input:eq('+j+')').val(); \n item[j]=input;\n }\n // carga especial del objeto item, ya que son varios \n DATA.push(item);\n } \n //esta fecha sera la misma para cada muestra en la lista elegida \n // la envio por get en la url del AJax \n var fechaAnalisis = $(\"#fecha_analisis\").val(); \n aInfo = JSON.stringify(DATA); \n INFO = new FormData();\n INFO.append('data', aInfo); \n //console.log(item4);\n $.ajax({\n data: INFO,\n type: 'POST',\n dataType: 'json',\n url:'../controller/guardarAnaSeleccionados.php?fecha='+fechaAnalisis,\n processData: false, \n contentType: false,\n success: function(r){\n //Una vez que se haya ejecutado de forma exitosa hacer el código para que muestre esto mismo.\n },\n timeout: 300000 \n //tiempo maximo de espera 300 segundos - 5 minutos\n });\n}", "title": "" }, { "docid": "7718a5ddf515f9735c3a18e3e98ecbf8", "score": "0.4910095", "text": "parse(data, toJson = true) {\n if (toJson) {\n // -- Array goes to json array\n const self = this;\n // console.log(\"Data is :: \", data);\n\n const jsonArray = data\n .map(row => row.map((col, index) => {\n const obj = {}; obj[self.labels[index]] = col; return obj;\n }))\n .map(row => row.reduce((previous, current) => {\n Object.keys(current).forEach((key) => {\n previous[key] = current[key];\n });\n return previous;\n }, {}))\n .filter(value => Object.keys(value).length > 0)\n .map((document, index, array) => {\n if (index <= 0) {\n return document;\n }\n Object.keys(document).forEach((key) => {\n const definition = schema.models[self.model].collection[key];\n document[key] = (\n definition.propagate\n && (document[key] === null\n || document[key] === undefined\n || document[key].replace(/ /g, '') === '')) ? array[index - 1][key] : document[key];\n document[key] = (definition.type === 'Integer') ? parseInt(document[key]) : document[key];\n });\n return document;\n });\n return jsonArray;\n }\n\n // -- Json | Json array goes to array of array\n const array = [];\n const self = this;\n data = data instanceof Array ? data : [data];\n\n let innerArray = [];\n data.forEach((json) => {\n innerArray = [];\n self.labels.forEach((label) => {\n if (schema.models[self.model].collection[label] === 'Picture') {\n innerArray.push(`=IMAGE(\"${json[label]}\", 4, 40, 40)`);\n } else if (schema.models[self.model].collection[label] === 'Date') {\n try { innerArray.push(json[label].toString()); } catch (error) { innerArray.push(json[label]); }\n } else if (schema.models[self.model].collection[label] === 'DateFormat') {\n try { innerArray.push(`${json[label].getDate()}-${json[label].getMonth() + 1}-${json[label].getFullYear()}`); } catch (error) { innerArray.push(json[label]); }\n } else if (schema.models[self.model].collection[label] === 'TimeFormat') {\n try { innerArray.push(`${json[label].getMinutes()}:${json[label].getSeconds()}:${json[label].getMiliseconds()}`); } catch (error) { innerArray.push(json[label]); }\n } else {\n innerArray.push(json[label]);\n }\n });\n array.push(innerArray);\n });\n\n return array;\n }", "title": "" }, { "docid": "f3b912a0f097d163b5d94240fd9c2c09", "score": "0.49074805", "text": "function convertData(input) {\n const pathsArray = [];\n\n function pathFinder(array) {\n if (array === undefined) {\n return;\n }\n array.forEach((obj) => {\n let formatedString = obj.path.slice(1).replace(/\\//g, \"_\");\n pathsArray.push({ params: { page: formatedString } });\n\n return pathFinder(obj.options);\n });\n }\n pathFinder(input);\n return pathsArray;\n}", "title": "" }, { "docid": "b1a8aeecbf72a609d5e180dbaf49c3ee", "score": "0.48892045", "text": "function buildData(res) {\r\n\tvar temp = [];\r\n\t$.each(res, function() {\r\n\t\t$.each(this, function(key, value) {\r\n\t\t\tvar year = this.axis.substring(6,10);\r\n\t\t\tvar month = this.axis.substring(3,5);\r\n\t\t\tvar day = this.axis.substring(0,2);\r\n\t\t\tvar hour = this.axis.substring(11,13);\r\n\t\t\tvar min = this.axis.substring(14,16); \r\n\t\t\ttemp.push([new Date(year, --month, day, (++hour) + 1, min).getTime(), parseInt(this.ordinate)]);\r\n\t\t});\r\n\t});\r\n\treturn temp;\r\n}", "title": "" }, { "docid": "c0c6156a2fb3b38ec63738559b554884", "score": "0.4882408", "text": "function nameAndIdArr(err, res, nameType, isEmpty) {\n if (err) throw err;\n let empIdArr = [];\n let empNamesArr = [];\n\n if (isEmpty === \"yes\") {\n empIdArr.push(\"NULL\")\n empNamesArr.push(\"none\");\n res.forEach((value, i) => {empNamesArr.push(res[i].first_name + \" \" + res[i].last_name); empIdArr.push(res[i].id);});\n }\n if (nameType === \"manager\") {\n res.forEach((value, i) => {if (res[i].manager_first_name != null) \n {empNamesArr.push(res[i].manager_first_name + \" \" + res[i].manager_last_name); empIdArr.push(res[i].id);}});\n }\n if (nameType === \"department\") {\n res.forEach((value, i) => {empNamesArr.push(res[i].name); empIdArr.push(res[i].id);});\n }\n if (nameType === \"role\") {\n res.forEach((value, i) => {empNamesArr.push(res[i].title); empIdArr.push(res[i].id);});\n }\n if (nameType === \"employee\") {\n res.forEach((value, i) => {empNamesArr.push(res[i].first_name + \" \" + res[i].last_name); empIdArr.push(res[i].id);});\n }\n return empArrs = [empIdArr, empNamesArr];\n}", "title": "" }, { "docid": "bf5af7774170a81c5c72996c9a642aba", "score": "0.48811653", "text": "function myChallangeSearch(str)\n{\n //str.toString();\n str = Array(str, userID);\n\t\n\tresult(str, \"myChall\", addToTable); \n}", "title": "" }, { "docid": "643926438990f5e074b7b781523e0f0d", "score": "0.487984", "text": "function parseData(jsonString){\n if (value.developerMode) {\n console.log(jsonString);\n }\n // pass sql database\n self.pageDb = JSON.parse(jsonString).pageDb;\n // reset all input\n let allInputs = [];\n for (var i = 0; i < self.inputs.length; i++) {\n allInputs.push(self.inputs[i].element);\n }\n resetAll(allInputs);\n // parse input select category options\n processOptions(self.inputs[1]);\n // parse pagelist after ajax received the database\n parsePageItems();\n // developerMode mode check\n developerMode();\n }", "title": "" }, { "docid": "6c1b00d112d5d5079a7a269d514e9f3f", "score": "0.4874861", "text": "async obtenerDatosListaNegra() {\n\t\tlet resultados = {};\n\t\tlet instruccionSQL = '';\n\n\t\ttry {\n\t\t\tinstruccionSQL = `\nSELECT\n\tid::bigint\nFROM listanegra_administradores\nWHERE (\n\tid = $1\n)`;\n\t\t\tresultados = await baseDatos.query(instruccionSQL, [ this.id ]);\n\t\t\tif (resultados.rowCount > 0) {\n\t\t\t\tthis.listaNegra.esAdministrador = true;\n\t\t\t}\n\n\t\t\tinstruccionSQL = `\nSELECT\n\tlistanegra.tiempo::timestamptz AS tiempo,\n\tlistanegra.motivos::text AS motivos,\n\tlistanegra.id_administrador AS id_administrador,\n\tidentidades.datos_personales_primer_nombre AS administrador_primer_nombre,\n\tidentidades.datos_personales_segundo_nombre AS administrador_segundo_nombre\nFROM listanegra\nLEFT JOIN identidades ON (identidades.usuario_id = listanegra.id)\nWHERE (\n\tlistanegra.id = $1\n)`;\n\t\t\tresultados = await baseDatos.query(instruccionSQL, [ this.id ]);\n\t\t\tif (resultados.rowCount > 0) {\n\t\t\t\tthis.listaNegra.tiempo = new Date(resultados.rows[0].tiempo);\n\t\t\t\tthis.listaNegra.motivos = resultados.rows[0].motivos;\n\t\t\t\tthis.listaNegra.administrador.id = resultados.rows[0].id_administrador;\n\t\t\t\tthis.listaNegra.administrador.nombres = `${resultados.rows[0].administrador_primer_nombre} ${resultados.rows[0].administrador_segundo_nombre}`;\n\t\t\t\tthis.listaNegra.administrador.nombres = this.listaNegra.administrador.nombres.trim();\n\t\t\t}\n\t\t} catch (_e) {}\n\t}", "title": "" }, { "docid": "b9685eb8447858e42f8e911e2d01a1b2", "score": "0.48661354", "text": "function strToarry(str){\n var reg1=/^\"|^'|'$|\"$/g//去掉前面的引号\n var reg2=/^\\[|]$/g//去掉前面的括号\n var reg3=/('\\s*,\\s*')/gi\n var reg4=/(\"\\s*,\\s*\")/gi\n var reg5=/'|\"/gi\n var tmp;\n if(reg3.test(str)){\n tmp=str.replace(reg1,\"\").replace(reg2,\"\").replace(reg3,\"'&_#'\").replace(reg5,\"\").split(\"&_#\");\n if(isArray(tmp)){\n return tmp;\n }\n }\n if(reg4.test(str)){\n tmp=str.replace(reg1,\"\").replace(reg2,\"\").replace(reg4,\"'&_#'\").replace(reg5,\"\").split(\"&_#\");\n if(isArray(tmp)){\n return tmp;\n }\n }\n else{\n tmp=str.replace(reg1,\"\").replace(reg2,\"\").replace(reg5,\"\").split(\",\");\n if(isArray(tmp)){\n return tmp;\n }\n }\n return str;\n}", "title": "" }, { "docid": "86fc3d22d3ff0ed68a35678f154771c1", "score": "0.48654628", "text": "function busqueda_cliente(type, respuesta, consulta) {\n //var type = 'Bailarsh'\n\n db.view('consultas', 'get_correo', function(err, documento) {\n if (!err) {\n var rows = documento.rows; //the rows returned\n }\n var resultado = [];\n var nom;\n for (i = 0; i < rows.length; i++) {\n if (rows[i]['key'] != \"\") {\n nom = [rows[i]['value'] , rows[i]['key']];\n resultado.push(nom);\n\n }\n } //cierre if\n all[0] = resultado;\n \n }); //cierre res\n\n\n\n\n db.view('consultas', 'busqueda_cliente', {\n 'key': type\n }, function(err, documento) {\n var resultado = new Array();\n var cliente = new Array();\n\n if (!err) {\n var rows = documento.rows; //the rows returned\n for (i = 0; i < rows.length; i++) {\n resultado = rows[i]['value'];\n } //cierre for\n\n cliente[0] = resultado[0];\n //console.log(resultado[1].length);\n if (resultado[1] == \"\") {\n cliente[1] = \"Sin Asignar\";\n } else {\n var pasa = \"pasatiempo\";\n var agregar = \"\";\n for (x = 0; x < resultado[1].length; x++) {\n if (x == 0) {\n pasa = resultado[1][x];\n\n } else {\n agregar = \",\" + resultado[1][x];\n pasa = pasa + agregar;\n\n }\n\n } //cierre for\n cliente[1] = pasa;\n } //1\n if (resultado[2] == \"\") {\n cliente[2] = \"Sin Asignar\";\n } else {\n var comi = \"comida1\";\n var agregar = \"\";\n for (x = 0; x < resultado[2].length; x++) {\n if (x == 0) {\n comi = resultado[2][x];\n\n } else {\n agregar = \",\" + resultado[2][x];\n comi = comi + agregar;\n //console.log(agregar);\n //console.log(pasa);\n\n }\n\n } //cierre for\n cliente[2] = comi;\n } //2\n if (resultado[3] == \"\") {\n cliente[3] = \"Sin Asignar\";\n } else {\n var musi = \"musica\";\n var agregar = \"\";\n for (x = 0; x < resultado[3].length; x++) {\n if (x == 0) {\n musi = resultado[3][x];\n\n } else {\n agregar = \",\" + resultado[3][x];\n musi = musi + agregar;\n\n }\n\n } //cierre for\n cliente[3] = musi;\n }\n\n cliente.splice(1, 0, type);\n\n all[1]= cliente;\n respuesta.render(\"consult/\" + consulta, {\n clientes: cliente,\n todo: all\n });\n\n } //cierre if\n\n } //cierre res\n\n );\n\n} //cierre ", "title": "" }, { "docid": "ccdf8ae95d058b6bd79eeab9eaaf7307", "score": "0.4863334", "text": "function getProductos() {\n var tds = \"\";\n $.ajax({\n type: \"POST\",\n url: \"wsrepventaproducto.asmx/getProductos\",\n data: '{}',\n contentType: \"application/json; charset=utf-8\",\n dataType: \"json\",\n success: function (msg) {\n $.each(msg.d, function () {\n data.push({ 'descripcion': this.descripcion, 'codigo' : this.codigo, 'id': this.id});\n });\n }\n });\n }", "title": "" }, { "docid": "45f04e43cf564b256a7e3d81323a4135", "score": "0.48537266", "text": "ObtenerDias(consulta) {\n var httpRequest = new XMLHttpRequest();\n httpRequest.open('GET', consulta, false);\n httpRequest.send();\n var cons = JSON.parse(httpRequest.response);\n var dias = cons.data[0].dias_disponibles;\n\n return dias;\n }", "title": "" }, { "docid": "9befcf111cc5af7609f2a29392cd68d6", "score": "0.48490888", "text": "parseSearchResults(searchResults) {\n var cleaned = [];\n for (var result of searchResults) {\n let rawName = result.name;\n let nameComponents = rawName.split(',');\n\n result.name = nameComponents[0];\n result.type = nameComponents[1];\n result.id = nameComponents[2];\n\n cleaned.push(result);\n } \n\n return cleaned;\n }", "title": "" }, { "docid": "47a855bc6e502ce236ae4d97bf97e9c8", "score": "0.48437658", "text": "function restoEsCero(json) {\n let arrayImagenes = [];\n let arrayRows = [];\n let arrayNombresRow = [];\n let cont = 0;\n let sumame = 1;\n let selectRow = '';\n let indiceRows = 0;\n const domContainer = document.querySelector('#containerMain');\n for (var key in json) {\n cont++;\n if (cont == 3) {\n cont = 0;\n let IDRow = 'id' + sumame;\n arrayRows.push(<GenerarRow ID={IDRow} />);\n arrayNombresRow.push(IDRow);\n sumame++;\n }\n\n }\n ReactDOM.render(arrayRows, domContainer);\n cont = 0;\n for (var key in json) {\n if (json.hasOwnProperty(key)) {\n arrayImagenes.push(<CargarImagen ruta={json[key].ruta} name={json[key].nombre} alerta = {alerta}/>);\n cont++;\n }\n if (cont == 3) {\n cont = 0;\n selectRow = document.querySelector('#' + arrayNombresRow[indiceRows]);\n ReactDOM.render(arrayImagenes, selectRow);\n indiceRows++;\n arrayImagenes = [];\n }\n }\n}", "title": "" }, { "docid": "09f022ddc215b5b0d6af92b8d14ea76b", "score": "0.48435208", "text": "function createChartDataString(queryResults, product) {\r\n var paesedDate = $.parseJSON(queryResults);\r\n var resultsArray = [];\r\n $.each(paesedDate, function (i, item) {\r\n if (item[product] != null) {\r\n resultsArray.push(item[product]);\r\n }\r\n })\r\n return resultsArray;\r\n}", "title": "" }, { "docid": "20d390245b6c7e4fd10d0c845a383409", "score": "0.48429742", "text": "function jsonToArray(){\n \n for(var i = 0; i < 5; i++){ \n data[i] = [info.substance[i].consumers1, info.substance[i].consumers2, info.substance[i].overdoses1, info.substance[i].overdoses2]; \n names[i]= info.substance[i].drug;\n phy_harm[i]= info2.substance[i].physical_harm;\n DEP_physical[i]= info2.substance[i].physical;\n DEP_psychological[i]= info2.substance[i].psychological;\n DEP_plea[i]= info2.substance[i].pleasure;\n }\n for(var i= 0; i < info3.substance.length; i++){\n years[i]= info3.substance[i].year;\n numeros[i]= info3.substance[i].overdoses;\n }\n }", "title": "" }, { "docid": "78b3f6dc1cc08400abc2bd9a230789e1", "score": "0.4835707", "text": "function constroiPagina(dados) {\n var htmlFinal = ''; // string que vai conter todo o HTML\n var htmlFinal2 = '';\n // construimos os itens agora\n $ajaxUtils.sendGetRequest(itensHtml, function(itensHtml) {\n for (var i = 0, max = dados.length; i < max; i++) {\n var html = itensHtml,\n titulo = dados[i].titulo ;\n \n html = inserePropriedade(html, \"titulo\", titulo); \n htmlFinal += html;\n }\n insereHtml(\"ul\", htmlFinal);\n }, false); // não é um JSON\n\t\n\t\n var htmlFinal = '<div class=\"row\">'; // string que vai conter todo o HTML\n // construimos os itens agora\n $ajaxUtils.sendGetRequest(itensHtml2, function(itensHtml2) {\n for (var i = 0, max = dados.length; i < max; i++) {\n var html = itensHtml2,\n titulo = dados[i].titulo,\n\t\t conteudo = dados[i].Conteudo;\n \n html = inserePropriedade(html, \"titulo\", titulo);\n html = inserePropriedade(html, \"conteudo\", conteudo);\n\n \n htmlFinal2 += html;\n }\n htmlFinal += '</div>';\n insereHtml(\"#content\", htmlFinal2);\n }, false); // não é um JSON\n \n \n}", "title": "" }, { "docid": "7ac2c0b875d5af5d4ee9947db2331599", "score": "0.48305684", "text": "function JSON2Array(string) {\n return JSON.parse(string);\n }", "title": "" }, { "docid": "0682cf171443b134e438b6a87ceb72e6", "score": "0.48279592", "text": "function armarArrayDTOPeriodo(){\n var pais = get('formulario.hPais');\n var marca = get('formulario.cbMarca');\n var canal = get('formulario.cbCanal'); \n var periodoDesde = get('formulario.hOidPeriodoDesde');\n var array = new Array();\n var index = 0;\n\n if( pais != null && pais != '' ){\n array[index] = new Array('pais', pais);\n index++;\n } \n\n if( marca != null && marca[0] != null && marca[0] != '' ){\n array[index] = new Array('marca', marca[0]);\n index++;\n }\n\n if( canal != null && canal[0] != null && canal[0] != '' ){\n array[index] = new Array('canal', canal[0]);\n index++;\n }\n\n return array;\n}", "title": "" }, { "docid": "bc6431b80d4211e443403eee47642179", "score": "0.48268008", "text": "function listeJoueurs(url_json,idDiv){\r\n\tvar listeDyn =[];\r\n\tvar classement=\"\";\r\n\t$.ajax({\r\n\t\t \turl:url_json,\r\n\t\t\ttype: \"GET\",\r\n\t\t \tdataType: \"json\",\r\n\t\t \tsuccess:function(resultat){\r\n\t\t \t\t$.each( resultat, function( indice, valeurs ) {\r\n\t\t \t\t\tclassement = valeurs.classement;\r\n\t\t \t\t\tif (classement == 0){classement=\"Aucun\";}\r\n\t\t \t\t\tvar buttons = \"<button type='button' class='btn btn-danger btn-xs' onclick=\\\"javascript:delJoueur('\"+ url_json +\"', '\" + valeurs.id + \"_\" + idDiv +\"','msg');\\\">Delete</button></td></tr>\";\r\n\t\t \t\t\tlisteDyn.push( \"<tr id='\" + valeurs.id + \"_\" + idDiv + \"'><td>\" + valeurs.nom + \"</td><td>\" + valeurs.prenom + \"</td><td>\" + classement +\"</td><td>\" + buttons );\r\n\t\t \t\t});\r\n\t\t \t\t$(\"#\"+idDiv).html(listeDyn.join(\"\"));\r\n\t\t \t},\r\n\t\t \terror:function(resultat){\r\n\t\t \t\t$(\"#\"+idDiv).html(\"Impossible de lister les joueurs !\");\r\n\t\t \t}\r\n\t\t});\r\n}", "title": "" }, { "docid": "60342f6eec401fc55ae47223f3adc05d", "score": "0.48254225", "text": "function JSONTransform(objOriginal, expressionsStr, options) {\r\n\toptions = options || {};\r\n\tvar resultFull = {};\r\n\tvar resultsPartial = [];\r\n\t\r\n\tif(!expressionsStr) return objOriginal;\r\n\r\n\tvar expressions = expressionsStr.split(\";\");\r\n\t\r\n\t// check if any of keys is named in which case we create associative array (hash, object) instead of array\r\n\tvar createArray = true;\r\n\r\n\t// if there is only one result we will return the result without wrapping it neither in array or hash\r\n\t// TODO: we need to review this decision\r\n\tvar resultsNo = 0;\r\n\tconsole.log(\"[JSONTransform] expressions: %s\", JSON.stringify(expressions));\r\n\tfor(var id in expressions){\r\n\t\tvar expr = expressions[id].trim();\r\n\t\tif(!expr || expr==\"\") continue;\r\n\t\tconsole.log(\"[JSONTransform] expr: %s\", expr);\r\n\t\t\r\n\t\tvar expressionTree = parseExpressions(expr);\r\n\t\tvar resultPartial = processExpressionTree(objOriginal, expressionTree);\r\n\t\t\r\n//\t\tvar exprList = expr.split(\".\");\r\n//\t\tif(exprList.length > 0 && exprList[0] == \"$\") exprList.shift();\r\n//\t\tresultPartial = processExpression(objOriginal, exprList);\r\n\t\tconsole.log(\"[JSONTransform] resultPartial: %s\", JSON.stringify(resultPartial));\r\n\t\tresultsPartial.push(resultPartial);\r\n\r\n\t\t// if there is no flag:f and it is complex object but not Array\r\n\t\tif(!expressionTree.$innerStates.flags.flat && (typeof resultPartial == 'object' && resultPartial.constructor != Array)){\r\n\t\t\tcreateArray = false;\r\n\t\t}\r\n\t\tresultsNo++;\r\n\t}\r\n\r\n\t// if(typeof key == 'string') createArray = false;\r\n\tconsole.log(\"[JSONTransform] createArray: %s, resultsNo:%s\", createArray, resultsNo);\r\n\tif(resultsNo == null){\r\n\t\tresultFull = null;\r\n\t}else if(resultsNo == 1){\r\n\t\tresultFull = resultsPartial[0];\r\n\t}else{\r\n\t\tresultFull = createArray ? [] : {};\r\n\r\n\t\t// populate results\r\n\t\tfor(var id in resultsPartial){\r\n\t\t\tvar resultPartial = resultsPartial[id];\r\n\t\t\tif(resultPartial && typeof resultPartial == 'object'){\r\n\t\t\t\tfor(var key in resultPartial){\r\n\t\t\t\t\tif(createArray) resultFull.push(resultPartial[key]);\r\n\t\t\t\t\telse resultFull[key] = resultPartial[key];\r\n\t\t\t\t}\r\n\t\t\t}else if(resultPartial){\r\n\t\t\t\tif(createArray) resultFull.push(resultPartial);\r\n\t\t\t\telse{\r\n\t\t\t\t\t// error, partial result is not possible to put in the result \r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t}\r\n\r\n\tconsole.log(\"[JSONTransform] resultFull: %s\", JSON.stringify(resultFull));\r\n\treturn resultFull;\r\n}", "title": "" }, { "docid": "03cb2d95f523b63cc069b65fabd34156", "score": "0.4821022", "text": "function QRtoObject(query_result,keys){\n\n\ttemp = [];\n\tfor (var i = 0; i<query_result.length; i++) {\n\t temp.push({});\n\t\tfor (var j = 0; j<query_result[i].length; j++){\n\t\t\ttemp[i][keys[j]]=query_result[i][j];\n\t }\n\t}\n\treturn temp;\n}", "title": "" }, { "docid": "f09be7d2cc8ecaa03c2e31bc5c352209", "score": "0.4816334", "text": "function buscar(criterio,texto){\r\n\t\t$.ajax({ \r\n \t\tdata:{\r\n \t\t\tcriterio:criterio,\r\n \t\t\ttexto:texto\r\n \t\t},\r\n datatype:'json',\r\n type: \"POST\", \r\n url: \"Mototaxi/Listar.htm\", \r\n success: function(data){\r\n \t//alert(JSON.stringify(data));\r\n \t//alert(data[0].parnombreV);\r\n \tllenarTabla(data);\r\n },error: function(jqXHR, textStatus, errorThrown){\r\n \tmensajeError();\r\n }\r\n \t});\r\n\t}", "title": "" }, { "docid": "aa7a47f2882f1983fa5348fd285003ff", "score": "0.48088437", "text": "remodelData(data, type='line') {\n\n console.log(data);\n let listData = [];\n\n for (let i = data.length - 1; i >= 0; i--) {\n let item = null;\n\n // Copia el diccionario\n item = JSON.parse(JSON.stringify(data[i]));\n // Almacena el diccionario en 'data'\n item[\"data\"] = data[i];\n // Limpia 'data' para dejar solos los datos necesarios\n delete item[\"data\"].id;\n delete item[\"data\"].mes;\n delete item[\"data\"].categoria;\n delete item[\"data\"].enlaceCSV;\n delete item[\"data\"].enlaceInforme;\n delete item[\"data\"].estado;\n delete item[\"data\"].informe;\n delete item[\"data\"].temporalidad;\n delete item[\"data\"].total;\n\n // Crea un array con arrays de los datos.\n // ej:\n // [[\"Expedientes ingresado\", 100], ...]\n var items = Object.keys(item[\"data\"]).map(function(key) {\n return [key, item[\"data\"][key]];\n });\n\n // Ordena el array de mayor a menor\n items.sort(function(first, second) {\n return second[1] - first[1];\n });\n\n // Actualiza item.data con el array ordenado.\n item.data = items;\n\n // Agrega a la lista de datos\n listData.push(item);\n }\n\n var dict = {};7\n\n for (let i = listData.length - 1; i >= 0; i--) {\n dict[listData[i].informe] = listData[i];\n }\n\n console.log(listData);\n dict['actual'] = listData.findBy('estado', 'actual');\n dict['anterior'] = listData.findBy('estado', 'anterior');\n\n if (type === 'line') {\n return this.generateChartDataLines(dict);\n }\n\n if (type === 'pie') {\n return this.generateChartDataPie(dict);\n }\n\n return dict;\n\n }", "title": "" }, { "docid": "9321d6baf44151fd9554b20aed71edbe", "score": "0.4802911", "text": "function obtenerValoresIniciales(){\n var parametros = {\"inspector\" : cod_usuario, \"inspeccion\" : cod_inspeccion};\n $.ajax({\n url: \"../php/escaleras_json_valores_iniciales.php\",\n data: parametros,\n type: \"POST\",\n dataType : \"JSON\",\n success: function(response){\n $.each(response, function(i,items){\n var textCliente = items.n_cliente;\n var cliente_direccion = items.o_direccion_cliente;\n var textEquipo = items.n_equipo;\n var textEmpresaMantenimiento = items.n_empresamto;\n var text_velocidad = items.v_velocidad;\n var text_tipoEquipo = items.o_tipo_equipo;\n var text_inclinacion = items.v_inclinacion;\n var text_ancho_paso = items.v_ancho_paso;\n var textFecha = items.f_fecha;\n var text_ultimo_mto = items.ultimo_mto;\n var text_inicio_servicio = items.inicio_servicio;\n var text_ultima_inspec = items.ultima_inspeccion;\n var consecutivo = items.o_consecutivoinsp;\n\n cargarValoresIniciales(textCliente,cliente_direccion,textEquipo,textEmpresaMantenimiento,text_velocidad,\n text_tipoEquipo,text_inclinacion,text_ancho_paso,textFecha,\n text_ultimo_mto,text_inicio_servicio,text_ultima_inspec,consecutivo);\n });\n }\n });\n}", "title": "" }, { "docid": "6d664fcfdc3fb74ffe5371a5044e019e", "score": "0.48028418", "text": "function str2arr(str) {\n\t\tvar objects = [],\n\t\t\tarr = str.split(',');\n\n\t\tfor (var i = 0; i < arr.length; i++) {\n\t\t\tobjects.push({text: arr[i]});\n\t\t}\n\n\t\treturn objects;\n\t}", "title": "" }, { "docid": "e1a81c0f9c52ec74ec10ed237bd62e0b", "score": "0.47964245", "text": "function transacionAjax_Usuario(State, filtro, opcion) {\n var contenido;\n\n if ($(\"#TxtSearch\").val() == \"\") {\n contenido = \"ALL\";\n }\n else {\n contenido = $(\"#TxtSearch\").val();\n }\n\n\n $.ajax({\n url: \"UsuarioAjax.aspx\",\n type: \"POST\",\n //crear json\n data: { \"action\": State,\n \"filtro\": filtro,\n \"opcion\": opcion,\n \"contenido\": contenido\n },\n //Transaccion Ajax en proceso\n success: function (result) {\n if (result == \"\") {\n ArrayUsuario = [];\n }\n else {\n ArrayUsuario = JSON.parse(result);\n table_Usuario();\n }\n },\n error: function () {\n\n }\n });\n}", "title": "" }, { "docid": "8bcea005bac940a8635d077c697c9fbc", "score": "0.47958803", "text": "static fromJsonObjArray(jsonObjArray){\r\n return jsonObjArray.map(elt => Product.fromJsonObj(elt))\r\n }", "title": "" }, { "docid": "c2e773e013f29330b2c729af9ae99c4f", "score": "0.47949648", "text": "_parseResults(data, parseFunction) {\n let results = data.results[0].data;\n let parsedResults = [];\n results.map((r)=>{\n if (parseFunction) parsedResults = parseFunction(r,parsedResults);\n else {\n if (!r.rest || r.rest.length != 1) return;\n let rData = r.rest[0].data;\n rData['id'] = r.rest[0].metadata.id;\n parsedResults.push(rData);\n return;\n }\n });\n return parsedResults;\n }", "title": "" }, { "docid": "abc0c594666d449b3a00d5e2735e17d0", "score": "0.4791422", "text": "listaEstadosFluxo(res) {\n const sql = `\n select sum(1) as total,\n concat(fase_anterior, 'ª fase: ', estado_anterior ) as origem,\n concat(fase_atual, 'ª fase: ',estado_atual ) as destino\n\n from (\n select anterior.*,\n pa.fase as fase_atual, e.nome estado_atual, a.nome nome_atual, pa.time_id_vencedor as time_atual\n from (\n select p.fase as fase_anterior, e.nome estado_anterior, a.nome nome_anterior, p.time_id_vencedor as time_anteriro\n from partidas as p\n inner join arenas a on (a.arena_id = p.arena_id)\n inner join estados e on (e.estado_id = a.estado_id)\n ) as anterior\n inner join partidas pa on ((pa.time_id_A = anterior.time_anteriro or pa.time_id_B = anterior.time_anteriro) and pa.fase = anterior.fase_anterior+1)\n inner join arenas a on (a.arena_id = pa.arena_id)\n inner join estados e on (e.estado_id = a.estado_id)\n ) as partidas group by estado_anterior, estado_atual, fase_anterior, fase_atual `\n conexao.query(sql, (erro, resultados) => {\n if(erro) {\n res.status(400).json(erro)\n } else {\n res.status(200).json(resultados)\n }\n })\n }", "title": "" }, { "docid": "ab1d19b6a60f2ee5cb095a3e1cdb2ddf", "score": "0.47895378", "text": "function pusher() {\n //var obj = JSON_Obj.orders\n var resposta = [];\n obj.forEach(element => {\n resposta.push(element)\n });\n //for (var i in obj)\n \n //console.log(obj)\n //console.log(typeof resposta[7])\n console.log(resposta)\n }", "title": "" }, { "docid": "e7d380c9832d1d2ca52f7b1e03e4b4e4", "score": "0.47780085", "text": "function obtenerGrid(seleccion) {\r\n var jsonObject = new Object();\r\n var dataObjectGrillaDetalle = [];\r\n \r\n if(seleccion == \"all\"){\r\n jQuery('#grillaRegistroModal').jqGrid('setSelection', '-1');\r\n dataObjectGrillaDetalle = jQuery(\"#grillaRegistroModal\").jqGrid('getRowData'); // saca datos de la grilla en formato json\r\n var inventario = $('#inventario-codigo').val();\r\n }\r\n if(seleccion == \"selected\"){\r\n var s = jQuery(\"#grillaRegistroModal\").jqGrid('getGridParam','selarrrow');\r\n for (var i = 0; i < s.length; i++) {\r\n var rows = jQuery('#grillaRegistroModal').jqGrid ('getRowData', s[i]);\r\n dataObjectGrillaDetalle.push(rows); \r\n }\r\n var inventario = $('#inventario-codigo').val();\r\n }\r\n \r\n \r\n if(dataObjectGrillaDetalle.length < 1){\r\n mostarVentana(\"warning-modal\",\"Agregue al menos un producto\");\r\n return null;\r\n }else{\r\n jsonObject.grilla = dataObjectGrillaDetalle;\r\n jsonObject.inventario = inventario;\r\n // alert(JSON.stringify(jsonObject));\r\n return jsonObject; \r\n\r\n }\r\n \r\n}", "title": "" }, { "docid": "8244cf50cf4452c7f50a4053e678f45c", "score": "0.47757286", "text": "function montarPag(prod) {\n const pagina = [];\n prod.results.forEach((elementos) => {\n pagina.push(elementos);\n });\n\n// chama o id, nome e imagem dos produtos\n const todosProd = [];\n pagina.forEach((el) => {\n todosProd.push({\n sku: el.id,\n name: el.title,\n image: el.thumbnail,\n });\n });\n\n return todosProd;\n}", "title": "" }, { "docid": "730e7437367e5918acd0a7d87295e8ee", "score": "0.47727105", "text": "function getCategorias(){\n $.ajax({\n url:ruta, // la URL para la petición\n data:\"categoria=null\",\n type: 'POST', // especifica si será una petición POST o GET\n dataType: 'json', // el tipo de información que se espera de respuesta\n success: function(data) { \n // código a ejecutar si la petición es satisfactoria; // la respuesta es pasada como argumento a la función\n // guardar=json;\n categorias = [];\n for (var x = 0 ; x < data.length ; x++) {\n categorias.push(new Ccategoria(data[x].id,data[x].nombre));\n }\n },\n // código a ejecutar si la petición falla;: los parámetros sonunobjeto jqXHR(extensión de XMLHttpRequest), un untexto con el estatus de la petición y un texto con la descripción del error que haya dado el servidor\n error : function(jqXHR, status, error) { \n alert('Disculpe, existió un problema'); \n }\n });\n}", "title": "" }, { "docid": "2b8a3c0080de11d9fe3413085810bc30", "score": "0.47705993", "text": "function queryStringToJsonString(str){\n var pairs = str.split('&');\n var result = {};\n pairs.forEach(function (pair) {\n pair = pair.split('=');\n var name = pair[0]\n var value = pair[1]\n if (name.length)\n if (result[name] !== undefined) {\n if (!result[name].push) {\n result[name] = [result[name]];\n }\n result[name].push(value || '');\n } else {\n result[name] = value || '';\n }\n });\n return (JSON.stringify(result));\n}", "title": "" }, { "docid": "39013a498fea8fece18f1a6132ae1824", "score": "0.47628406", "text": "function getListado(isPedido){\n\tvar busqueda=\"&filtro=\";\n\tvar valBusq=\"\";\n\tvar cve=\"&cve=\";\n\tvar valCve=\"\";\n\t\n\tvalBusq='div';\n\tvalCve='';\n\tif(document.getElementById(\"selDivision\").value!=\"*\")\n\t\tvalCve=document.getElementById(\"selDivision\").value;\n\t\t\n\tif(document.getElementById(\"selZona\").value!=\"\"){\n\t\tvalBusq='zon';\n\t\tvalCve='';\n\t\tif(document.getElementById(\"selZona\").value!=\"*\"){\n\t\t\tvalBusq='zon';\n\t\t\tvalCve=document.getElementById(\"selZona\").value;\n\t\t}\n\t\telse\n\t\t\tvalCve='&granpa='+document.getElementById(\"selDivision\").value;\n\t}\n\t\n\tif(document.getElementById(\"selArea\").value!=\"\"){\n\t\tvalBusq='cac';\n\t\tvalCve='';\n\t\tif(document.getElementById(\"selArea\").value!=\"*\"){\n\t\t\tvalBusq='cac';\n\t\t\tvalCve=document.getElementById(\"selArea\").value;\n\t\t}\n\t\telse\n\t\t\tvalCve='&granpa='+document.getElementById(\"selZona\").value;\n\t}\n\t\n\tbusqueda+=valBusq+cve+valCve;\n\t\n\tgetAjax('listar','1'+busqueda,'contDescargas');\n}", "title": "" }, { "docid": "71654fb0a4cfe8a59e5553604cec0c33", "score": "0.47596326", "text": "function datosCorteActual(idFinca,idSuerte,idProduccionActual){\n var idFinca = idFinca;\n var idSuerte = idSuerte;\n var idProduccionActual = idProduccionActual;\n $.ajax({\n cache:false,\n dataType:\"json\",\n type:\"POST\",\n url: \"./querys/q_seguimiento_labores.php\",\n data: {\n opcion:3,\n idFinca:idFinca,\n idSuerte:idSuerte,\n idProduccionActual:idProduccionActual\n },\n success: function(res){\n if(res.estado === \"ERROR\"){\n jAlert('¡¡Lo sentimos, ocurrió un error al procesar los datos', 'ERROR');\n console.log(\"Error:\"+ res.msg);\n }\n else if(res.estado === \"EMPTY\"){\n jAlert('¡¡Este Corte no tiene labores asignadas', 'SIN LABORES');\n console.log(\"Error:\"+ res.msg);\n }\n else if(res.estado === \"OK\"){\n var listaLabores ='';\n for( var j=0; j< res.labores.length; j++){\n var idSeguimiento = res.labores[j].idSeguimiento;\n var idLabor = res.labores[j].idLabor;\n var labor = res.labores[j].labor;\n var fechaInicio = res.labores[j].fechaInicio;\n var fechaFin = res.labores[j].fechaFin;\n var idFinca = res.labores[j].idFinca;\n var nFinca = res.labores[j].nombreFinca;\n var idSuerte = res.labores[j].idSuerte;\n var nSuerte = res.labores[j].nombreSuerte;\n \n listaLabores += '<!-- panel --><div class=\"panel panel-custom\"><div class=\"panel-heading\"><a data-toggle=\"collapse\" data-parent=\"#accordion\" href=\"#collapse'+ idSeguimiento +'\" aria-expanded=\"true\" class=\"tg'+ idSeguimiento +'\"><div class=\"row\"><div class=\"col-sm-12 col-md-4\"><div class=\"row show-grid\"><span id=\"idSeguimiento\" style=\"display: none;\">'+ res.labores[j].idSeguimiento +'</span><div class=\"col-md-12\"><div class=\"nom\"><i>Labor:</i></div><div class=\"data\"><h3><span id=\"labor\">'+ res.labores[j].labor +'</span></h3></div></div></div></div><div class=\"col-sm-12 col-md-4\"><div class=\"row show-grid\"><div class=\"col-md-12\"><div class=\"nom\"><i>Fecha Inicio:</i></div><div class=\"data\"><h3><span id=\"fechaInicio\">'+ res.labores[j].fechaInicio +'</span></h3></div></div></div></div><div class=\"col-sm-12 col-md-4\"><div class=\"row show-grid\"><div class=\"col-md-12\"><div class=\"nom\"><i>Fecha Fin:</i></div><div class=\"data\"><h3><span id=\"fechaFin\">'+ res.labores[j].fechaFin +'</span></h3></div></div></div></div></a></div></div>';\n \n listaLabores += '<div id=\"collapse'+ res.labores[j].idSeguimiento +'\" class=\"panel-collapse collapse\" aria-expanded=\"true\"><div class=\"panel-body\"><div class=\"row\">';\n \n listaLabores += '<div class=\"col-md-12\"><div class=\"panel panel-red\"><div class=\"panel-heading\"><h4>Maquinaria</h4></div><div class=\"panel-body\"><div class=\"dataTable_wrapper table-responsive\">';\n var tablaMaquinas = [];\n if ( res.labores[j].maquinas.length === 0 ){\n tablaMaquinas[m] = [\n listaLabores += '<div id=\"alertaVacio\" class=\"col-md-12\"><div class=\"alert alert-danger \" role=\"alert\"> <h4>Aun no se han agregado Maquinas.</h4></div></div>',\n ];\n } \n else {\n listaLabores += '<table class=\"table table-striped table-bordered table-hover\" id=\"tabla_maquinaria\"><thead><tr><th>Maquina</th><th>Comentario</th><th>Fecha</th><th>Combustible</th></tr></thead><tbody id=\"body\">';\n for( var m=0; m < res.labores[j].maquinas.length; m++){\n \n tablaMaquinas[m] = [\n listaLabores += '<tr>',\n listaLabores += '<td>'+ res.labores[j].maquinas[m].nMaquina +'</td>',\n listaLabores += '<td>'+ res.labores[j].maquinas[m].comentario +'</td>',\n listaLabores += '<td>'+ res.labores[j].maquinas[m].fecha +'</td>',\n listaLabores += '<td>'+ res.labores[j].maquinas[m].combustible +' Litros / ' + Math.round(res.labores[j].maquinas[m].combustible / 0.264172).toFixed(2) + ' Galones</td>',\n listaLabores += '</tr>',\n ];\n \n }\n listaLabores += '</tbody></table>';\n }\n listaLabores += '</div><!-- /.table-responsive --></div><!-- /.panel-body --></div></div>';\n listaLabores += '<div class=\"col-md-12\"><div class=\"panel panel-danger\"><div class=\"panel-heading\"><h4>Insumos</h4></div><div class=\"panel-body\"><div class=\"dataTable_wrapper table-responsive\">';\n var tablaInsumos = [];\n if ( res.labores[j].insumos.length === 0 ){\n tablaInsumos[k] = [\n listaLabores += '<div id=\"alertaVacio\" class=\"col-md-12\"><div class=\"alert alert-danger \" role=\"alert\"> <h4>Aun no se han agregado Insumos.</h4></div></div>',\n ];\n } \n else { \n listaLabores +='<table class=\"table table-striped table-bordered table-hover\" id=\"tabla_insumos\"><thead><tr><th>Insumo</th><th>Comentario</th><th>Fecha</th></tr></thead><tbody id=\"body\">'; \n for( var k=0; k < res.labores[j].insumos.length; k++){\n tablaInsumos[k] = [\n listaLabores += '<tr>',\n listaLabores += '<td>'+ res.labores[j].insumos[k].nInsumo +'</td>',\n listaLabores += '<td>'+ res.labores[j].insumos[k].comentario +'</td>',\n listaLabores += '<td>'+ res.labores[j].insumos[k].fecha +'</td>',\n listaLabores += '</tr>',\n ];\n }\n listaLabores += '</tbody></table>';\n }\n listaLabores += '</div><!-- /.table-responsive --></div><!-- /.panel-body --></div></div>';\n listaLabores += '<div class=\"col-md-12\"><div class=\"panel panel-info\"><div class=\"panel-heading\"><h4>Gastos</h4></div><div class=\"panel-body\"><div class=\"dataTable_wrapper table-responsive\">';\n var tablaGastos = [];\n if ( res.labores[j].gastos.length === 0 ){\n tablaGastos[g] = [\n listaLabores += '<div id=\"alertaVacio\" class=\"col-md-12\"><div class=\"alert alert-info \" role=\"alert\"> <h4>Aun no se han registrado Gastos.</h4></div></div>',\n ];\n }\n else { \n listaLabores +='<table class=\"table table-striped table-bordered table-hover\" id=\"tabla_gastos\"><thead><tr><th>Gasto</th><th>Valor</th><th>Comentario</th><th>Fecha</th></tr></thead><tbody id=\"body\">'; \n for( var g=0; g < res.labores[j].gastos.length; g++){\n tablaGastos[g] = [\n listaLabores += '<tr>',\n listaLabores += '<td>'+ res.labores[j].gastos[g].nGasto +'</td>',\n listaLabores += '<td>'+ formatNumber.new(parseInt(res.labores[j].gastos[g].valor), \"$\") +'</td>',\n listaLabores += '<td>'+ res.labores[j].gastos[g].comentario +'</td>',\n listaLabores += '<td>'+ res.labores[j].gastos[g].fecha +'</td>',\n listaLabores += '</tr>',\n ];\n }\n listaLabores +='</tbody></table>';\n }\n listaLabores += '</div><!-- /.table-responsive --></div><!-- /.panel-body --></div></div>';\n listaLabores += '<div class=\"col-md-12\"><div class=\"panel panel-success\"><div class=\"panel-heading\"> <h4>Novedades</h4></div><div class=\"panel-body\"><div class=\"dataTable_wrapper table-responsive\">';\n var tablaNovedades = [];\n if ( res.labores[j].novedades.length === 0 ){\n tablaNovedades[n] = [\n listaLabores += '<div id=\"alertaVacio\" class=\"col-md-12\"><div class=\"alert alert-success \" role=\"alert\"> <h4>Aun no se han registrado Novedades.</h4></div></div>',\n ];\n } \n else { \n listaLabores +='<table class=\"table table-striped table-bordered table-hover\" id=\"tabla_novedades\"><thead><tr><th>Novedad</th><th>Fecha</th></tr></thead><tbody id=\"body\">'; \n for( var n=0; n < res.labores[j].novedades.length; n++){\n tablaNovedades[n] = [\n listaLabores += '<tr>',\n listaLabores += '<td>'+ res.labores[j].novedades[n].comentario +'</td>',\n listaLabores += '<td>'+ res.labores[j].novedades[n].fecha +'</td>',\n listaLabores += '</tr>',\n ];\n }\n listaLabores +='</tbody></table>';\n }\n listaLabores += '</div><!-- /.table-responsive --></div><!-- /.panel-body --></div></div></div>';\n listaLabores += '</div></div></div><!-- end panel-->';\n $(document).ready(function(){\n $(\".tg\"+idSeguimiento).click(function () {\n $(\"#collapse\"+idSeguimiento).toggleClass(\"in\");\n });\n });\n }\n $('#idSeguimiento').html(idSeguimiento);\n var hectareas = $('#areaActual').html().replace(/\\,/g, '.');\n var costos = res.costos_totales; \n //console.log( costos +\"/\"+ hectareas);\n var totalCD = costos / hectareas;\n $('#costosDirectos').html(formatNumber.new(parseInt(totalCD), \"$\"));\n var totalCI = totalCosInd;\n $('#costosTotales').html(formatNumber.new(parseInt(totalCD + totalCI), \"$\"));\n $('#datosCorteAnterior').show();\n $('#datosCorteAnterior').html(listaLabores);\n }\n }\n });\n}", "title": "" }, { "docid": "af6f6380b8d999f0f684696a05be0fce", "score": "0.47586176", "text": "function buscar(_tipo, _dni){\r\n\tcrearAjax();\r\n\r\n\tif(document.getElementById(\"contenedorTabla\").hasChildNodes()){\r\n\t\tdocument.getElementById(\"contenedorTabla\").removeChild(document.getElementById(\"table\"));\r\n\t}\r\n\r\n\tvar datosBusqueda={\r\n\t\ttipo:_tipo,\r\n\t\tdni:_dni\r\n\t};\r\n\r\n\ttipoBusqueda=_tipo;\r\n\tV_dni=_dni;\r\n\r\n\tvar jsonstring=JSON.stringify(datosBusqueda);\r\n\tobjAjax.open(\"GET\",\"http://localhost/html/proyectoDelphos/php/buscar.php?datosBusqueda=\"+jsonstring, true);\r\n\tobjAjax.send();\r\n\tobjAjax.onreadystatechange=recibirBusqueda;\r\n}", "title": "" }, { "docid": "171cdb28bdef9217dfa092b45f01960f", "score": "0.47511002", "text": "function transformJson(result) {\r\n const productListArray = result[0];\r\n const promotionJson = result[1];\r\n const productListing = [];\r\n\r\n productListArray.forEach(product => {\r\n let productDetail = {};\r\n const productPromotion = promotionJson.filter(\r\n promotion => promotion.uniqueID === product.uniqueID,\r\n );\r\n // eslint-disable-next-line no-param-reassign\r\n product.promotionData = productPromotion[0].promotionData;\r\n productDetail = productDetailFilter.productDetailSummary(product);\r\n productListing.push(productDetail);\r\n });\r\n const resJson = {\r\n productCount: productListing.length,\r\n productList: productListing,\r\n };\r\n return resJson;\r\n}", "title": "" }, { "docid": "ec31031742bbb4ee1505bc23521d20af", "score": "0.474701", "text": "function obtainJsoninto1D(inputJson)\n {\n var totalHRUNum = 0;\n\n var outputArr = new Array(dataX*dataY);\n // for this case veg_code is the loop count (from 0), vegCode is str\n // therefore veg_code = i.toString()\n var tempSize;\n $.each(['bare_ground', 'grasses', 'shrubs', 'trees', 'conifers'],\n function(i, cov_type) {\n tempSize = inputJson[cov_type].length;\n\n totalHRUNum = totalHRUNum + tempSize;\n\n for(var m=0; m<tempSize; m++ )\n {\n outputArr[inputJson[cov_type][m]] = i;\n }\n }\n );\n\n // test if the inputJson is valid\n if(totalHRUNum == dataX*dataY)\n {\n return outputArr; \n }\n else\n {\n console.log('Data from the get request is not right.');\n console.log('HRU number is not consistent.');\n return [];\n }\n\n }", "title": "" }, { "docid": "20995ab3cefb980b005fb7857eb5630e", "score": "0.4744965", "text": "buildSearchFoldersResult(folders, result) {\n if (result == undefined) {\n result = [];\n }\n let self = this;\n folders.forEach(function (folder) {\n let folderId = folder.id;\n let folderName = folder.name;\n let folderAccess = folder.access;\n let folderPath = [];\n let folderPathToString = '/';\n let parentId = folder.parent_id;\n if (parentId) {\n folderPath = self.get('retrieveParentFolders').call(self, parentId);\n\n folderPathToString = folderPath.join(' / ');\n }\n\n result.push({\n valueToSort: [folderPathToString, 0, folderName], // 1 stands for isFolder, meaning that password (0) with the same path will be printed first\n folderId: folderId,\n folderName: folderName,\n folderAccess: folderAccess,\n folderPath: folderPath,\n folderPathToString: folderPathToString,\n isFolder: true\n });\n });\n return result;\n }", "title": "" }, { "docid": "770207ea3965e248b5c02647304dcd44", "score": "0.47438616", "text": "function getData(filaInicial, cantidad) {\n //captura los parametros\n var busqueda = $(\"#txtBusqueda\").val();\n var estado = $(\"select[id=ddlEstados]\").val();\n\n //generar logica para los parametros\n var param = { \"inicio\": filaInicial, \"paginacion\": cantidad, \"busqueda\": busqueda, \"estado\": estado };\n $(\"#data\").html(\"cargando\");\n //llamada ajax\n $.ajax({\n type: \"POST\",\n url: \"TipoEstado.aspx/ObtenerListado\",\n data: JSON.stringify(param),\n async: false,\n contentType: \"application/json; charset=utf-8\",\n dataType: \"json\",\n success: function (response) {\n //funcion handler de la respuesta\n crearTabla(response);\n },\n error: function (result) {\n alert('ERROR ' + result.status + ' ' + result.statusText);\n }\n });\n }", "title": "" }, { "docid": "aa93ae267745a6efa7e33d1ff2bc2c95", "score": "0.4743493", "text": "player2db() {\n let qb = [];\n axios\n .get('https://api.overwatchleague.com/stats/players')\n .then((res) => {\n qb.push(JSON.stringify(res.data.data))\n \n //console.log(qb); testing\n })\n .catch((error) => {\n console.log(error);\n });\n return qb;\n }", "title": "" }, { "docid": "56c43689d3534821dbac246ebc68b2c9", "score": "0.47427964", "text": "async function convertCodigoIndicador(config){\n\n var arr={};\n var granularidade = 0;\n var periodicidade = 0;\n var arrBusca = await indicador.getIndicadorPesquisaPorCodigo(config.codigos);\n var tipoGranularidade = 0;\n\n switch (config.tipo){\n case 'BR':\n tipoGranularidade = 1;\n break;\n case 'RG':\n tipoGranularidade = 2;\n break;\n case 'UF':\n tipoGranularidade = 3;\n break;\n case 'MN':\n tipoGranularidade = 4;\n break;\n case 'CN':\n tipoGranularidade = 5;\n break;\n }\n\n return new Promise(async (resolve, reject) => {\n\n if(!arrBusca){\n reject('Parametro de consulta vazio');\n }\n try{\n for (var i=0; i < arrBusca.length; i++){\n var item = arrBusca[i];\n arr[item.codigo]=getInfo(item, config, granularidade, periodicidade, tipoGranularidade);\n granularidade = arr[item.codigo].granularidade;\n periodicidade = arr[item.codigo].periodicidade;\n if('indicadores_formula' in arr[item.codigo]){\n var arritemFormula = await indicador.getIndicadorPesquisaPorCodigo(arr[item.codigo]['indicadores_formula']);\n arr[item.codigo]['indicadores'] = {};\n arritemFormula.forEach(itemFormula=>{\n arr[item.codigo]['indicadores'][itemFormula.codigo] = getInfo(itemFormula, config, granularidade, periodicidade, tipoGranularidade);\n });\n } \n }\n }catch(err){\n try{\n reject(JSON.parse(err.message));\n }catch(err2){\n console.log('Erro', err);\n reject({codret: 1001, message: \"Erro na pesquisa dos resultados do indicador\"});\n }\n }\n resolve(arr);\n });\n}", "title": "" }, { "docid": "a68f1b3d75a9d0b0658b4eff797c0051", "score": "0.4737726", "text": "function get_family()\n {\n var mylist=new Array();\n var mydata = { table: 'ajaxtelco', field: 'code'};\n $.ajax(\n {\n url: url,\n data: mydata,\n async: false,\n dataType: 'json',\n success: function (json) \n {\n json=json.data \n for(var a=0;a<json.length;a++)\n {\n b=json[1]['telco'].split(';')\n // b[0]\n x=b[1]\n jsontelco=JSON.parse(json[0]['telco'])\n console.log(jsontelco[0].id)\n\n obj= { \"label\" : json[a]['telco'], \"value\" : json[a]['value']};\n // console.log(a)\n\n mylist.push(b);\n }\n\n\n }\n });\n\n JSON.stringify(mylist);\n return mylist;\n }", "title": "" }, { "docid": "8297e3561229e5e118969c8f4bc5c137", "score": "0.47350594", "text": "function generateParametri(postaja, tip, datumz, datumk) {\n var dbobjs = query(createSelectStatementParametri(postaja, tip, datumz, datumk));\n var parametri = new Array();\n datumz = date2str(getDayBefore(str2date(datumz)));\n var iter = dbobjs.iterator(); \n while (iter.hasNext()) {\n var obj = iter.next(); \n var dz = str2date(\"\" + obj.get(\"datum_zacetka\"));\n dz = (dz < str2date(datumz))? datumz : date2str(dz);\n var dk = str2date(\"\" + obj.get(\"datum_konca\"));\n dk = (dk > str2date(datumk))? datumk : date2str(dk);\n parametri[parametri.length] = {\"id\":obj.get(\"id\"), \"id_parametra\":obj.get(\"id_parametra\"), \"datum_zacetka\":dz, \"datum_konca\":dk};\n } \n return parametri;\n}", "title": "" } ]
e2f057c5979032b3ba4f7a9be4fae3ec
bottom of the barrel
[ { "docid": "c6da0d88f1e47033a12409dba92d74bf", "score": "0.0", "text": "function eval_s(code) // this is how snippets are eval'ed if they include \"output=\"/\"json_output=\" - so if they include these, the scope of eval isn't global - doesn't matter much [13/07/18]\n{\n\tvar output=undefined,json_output=undefined;\n\teval(code);\n\tif(output!==undefined) parent.show_modal(\"<pre>\"+output+\"</pre>\");\n\tif(json_output!==undefined) parent.show_json(json_output);\n}", "title": "" } ]
[ { "docid": "4418a973f6ab547731b4c50f8952d73b", "score": "0.76063585", "text": "getBottom() {\n return this.y + this.height - 15;\n }", "title": "" }, { "docid": "a4ae9a8039c0839a0f3a59e165184e08", "score": "0.75805163", "text": "bottom() {\n return this.y + this.height;\n }", "title": "" }, { "docid": "88b90aa4f421fb6fce1136661dbc87a6", "score": "0.7559149", "text": "get bottom() { return this.y + this.height; }", "title": "" }, { "docid": "88b90aa4f421fb6fce1136661dbc87a6", "score": "0.7559149", "text": "get bottom() { return this.y + this.height; }", "title": "" }, { "docid": "8520310df112b46ec2ed108d870db9c2", "score": "0.7382167", "text": "get bottom() {\n return this._top + this._height;\n }", "title": "" }, { "docid": "6fa4324d29a0bd3b627de4371a07252f", "score": "0.73554", "text": "getBottom()\n {\n return this.getY() + this.getHeight();\n }", "title": "" }, { "docid": "9d845b7db64995550fcf35f2af417f0a", "score": "0.72673327", "text": "get bottom() {\n return this.pos.y - this.size.y / 2\n }", "title": "" }, { "docid": "1353963cccae94b77e57771d757680f5", "score": "0.7263295", "text": "set bottom(bottom) {\n\t\tthis.pos.y = bottom - this.height;\n\t}", "title": "" }, { "docid": "d1d4d2e04d8a7ac21a5903fbb397925b", "score": "0.7082653", "text": "get bottom() {\n return this.y + this.height\n }", "title": "" }, { "docid": "6bd6012615b93378afd5d09d556f8034", "score": "0.6792438", "text": "function scrollbottom(){\n\tchatrect.verticalBar._value = 1;\n}", "title": "" }, { "docid": "9ba90de32fdba47b40b952b1126d3c42", "score": "0.67336", "text": "set bottom(value) {\n this._height = value - this._top;\n }", "title": "" }, { "docid": "c715fe5281606b0671f17c999e7fff51", "score": "0.65765435", "text": "calculateNewbottom(){\n switch(this.rotateCounter){\n case 1:\n case 3:\n this.left.calculateNewbottom()\n this.right.calculateNewbottom()\n break\n case 2:\n case 4:\n this.downReference.calculateNewbottom()\n this.upReference.bottom = this.downReference.bottom - puyoWidth\n break \n }\n }", "title": "" }, { "docid": "167eee7952aa963559123813ecb6e7be", "score": "0.6499537", "text": "get _physicalBottom() {\n return this._physicalTop + this._physicalSize;\n }", "title": "" }, { "docid": "2067fa7d3f80d39b0a759d59de837ffe", "score": "0.6478268", "text": "get _physicalBottom(){return this._physicalTop+this._physicalSize}", "title": "" }, { "docid": "f9c2547dacdd2aa6c6f4bbcda5d44ec4", "score": "0.6456982", "text": "putBottom(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.height + yOffset;\n }", "title": "" }, { "docid": "c6298f87f8c7d73349da5e2cdb6fd36c", "score": "0.6441717", "text": "getBottomHeightValue() {\n let screenHeightFragment = glio.getScreenHeightFragment(),\n bottomRightValue = (screenHeightFragment * 12) - screenHeightFragment;\n return bottomRightValue;\n }", "title": "" }, { "docid": "aea5c5d94ae674ae669fea68b7a27e13", "score": "0.64371604", "text": "function YToBottom(val) {\n\t\treturn parseInt(element.el.parent().css('height').replace(\"px\",\"\")) -\n\t\t\tparseInt(element.el.css('height').replace(\"px\",\"\")) - val;\n\t}", "title": "" }, { "docid": "0307c7d8061f01be50628facfb0bf4dd", "score": "0.6429466", "text": "get bottomCount() { return (this._bottomCount); }", "title": "" }, { "docid": "7ff02f446894fdedf8b3a34064440190", "score": "0.64184606", "text": "get nextFrameBottom() { \n return this.bottom + this.dy;\n }", "title": "" }, { "docid": "419e6221c4a78749d5861b39779a43c8", "score": "0.6375078", "text": "bottom(value = '') {\n this._topOffset = '';\n this._bottomOffset = value;\n this._alignItems = 'flex-end';\n return this;\n }", "title": "" }, { "docid": "419e6221c4a78749d5861b39779a43c8", "score": "0.6375078", "text": "bottom(value = '') {\n this._topOffset = '';\n this._bottomOffset = value;\n this._alignItems = 'flex-end';\n return this;\n }", "title": "" }, { "docid": "724ddfb9f9e23f353625efb464ee68ad", "score": "0.6366442", "text": "pastBottom() {\n return this.y > this.canvas.height;\n }", "title": "" }, { "docid": "4b6f05357176f637030a65ce5c79c6d8", "score": "0.63566643", "text": "get _physicalBottom() {\n return this._physicalTop + this._physicalSize;\n }", "title": "" }, { "docid": "4b6f05357176f637030a65ce5c79c6d8", "score": "0.63566643", "text": "get _physicalBottom() {\n return this._physicalTop + this._physicalSize;\n }", "title": "" }, { "docid": "2d368a8a676cdc8a5d579ae5233023ae", "score": "0.6337265", "text": "function size_margin_bottom() {\n var bottom = 0;\n // recupère la hauteur des autres blocs au dessus de d'sup créé\n for (i = 0; i < melange.sup.length; i++) {\n bottom = bottom + parseFloat(melange.sup[i].quantite);\n }\n return bottom;\n }", "title": "" }, { "docid": "078653bac6f11aaa813d74c275465f4a", "score": "0.633561", "text": "function bottomButton(x, y, w, h, options) {\n if (options) {\n var r = (options === null || options === void 0 ? void 0 : options.r) || 0;\n options.brBoxY = y - r;\n options.brBoxHeight = h + r;\n }\n return symbols.roundedRect(x, y, w, h, options);\n }", "title": "" }, { "docid": "623f9437733aecbc6866ad7a2bc70e9a", "score": "0.6328502", "text": "get _scrollBottom(){return this._scrollPosition+this._viewportHeight}", "title": "" }, { "docid": "b4a2fb6b09be0e0dadf67ab8c2e7dd67", "score": "0.62636846", "text": "get _scrollBottom() {\n return this._scrollPosition + this._viewportHeight;\n }", "title": "" }, { "docid": "2a96b0b3741178968be413d5d8b5b79f", "score": "0.6252522", "text": "function footerBottom(){\n\tvar $footer = $('.footer');\n\tif($footer.length){\n\t\t$(window).on('load resizeByWidth', function () {\n\t\t\tvar footerOuterHeight = $footer.outerHeight();\n\t\t\t$footer.css({\n\t\t\t\t'margin-top': -footerOuterHeight\n\t\t\t});\n\t\t\t$('.spacer').css({\n\t\t\t\t'height': footerOuterHeight\n\t\t\t});\n\t\t});\n\t}\n}", "title": "" }, { "docid": "4c128fd4f20c06df07ffe43c05fbe9f6", "score": "0.62337714", "text": "function HamBunBottom() {\n this.register();\n this.init();\n }", "title": "" }, { "docid": "489723e067c82ee51e9dc23b6aa6b7c9", "score": "0.6159246", "text": "function contentBottomEdgeY() {\n var bottomElement = storyContainer.lastElementChild;\n return bottomElement ? bottomElement.offsetTop + bottomElement.offsetHeight : 0;\n }", "title": "" }, { "docid": "f98141934d333c03b6018d9d69d59385", "score": "0.6115408", "text": "getBottomLine() {\n const horizontalLength = this.widestLineLength + this.leftPadding + this.rightPadding;\n const horizontalLine = this.repeat(this.dim(BOX.bottom), horizontalLength);\n return `${this.dim(BOX.bottomLeft)}${horizontalLine}${this.dim(BOX.bottomRight)}`;\n }", "title": "" }, { "docid": "0bd76817132fbd13ae1a75fe68ccef31", "score": "0.6111585", "text": "get _scrollBottom() {\n return this._scrollPosition + this._viewportHeight;\n }", "title": "" }, { "docid": "0bd76817132fbd13ae1a75fe68ccef31", "score": "0.6111585", "text": "get _scrollBottom() {\n return this._scrollPosition + this._viewportHeight;\n }", "title": "" }, { "docid": "8b7e3e05432cd706f2578427be1e7570", "score": "0.6099364", "text": "jump() {\n this.height -= 50;\n this.height = max(height / 4, this.height);\n }", "title": "" }, { "docid": "651300e610274ac986ec9b3897b6a4e9", "score": "0.6066236", "text": "function rightBottom(activeLayer)\n{\n\tactLayer = activeLayer;\n\tbounds = actLayer.bounds;\n\tmoveToCenter();\n\tresize();\n\tvar dX = doc.width/2 - actLayer.bounds[0]; // Grab Width\n\tvar dY = doc.height/2- actLayer.bounds[1]; //Grab Height\n\tapp.activeDocument.activeLayer.translate(dX, dY);\n}", "title": "" }, { "docid": "dba15e93a9128528e4d2cd5dc774db5c", "score": "0.6050678", "text": "get height() {\n return this.bottom - this.top;\n }", "title": "" }, { "docid": "01e7bcb236d53639b07cb8f096dae052", "score": "0.6043615", "text": "function barMPBorder() {\n ctx.fillStyle = \"gray\";\n ctx.beginPath();\n ctx.arc(380, h - 50, 40, 0, 2 * Math.PI);\n ctx.fill();\n ctx.closePath();\n }", "title": "" }, { "docid": "8eb8b7abe453dd37cf86db1d38128889", "score": "0.60283697", "text": "get padBottom(){ return this.__button.ui.padBottom; }", "title": "" }, { "docid": "17688566ebdf6d37670dd5a63c1d4f63", "score": "0.60235476", "text": "get fixedBottomGap() {\n return this._fixedBottomGap;\n }", "title": "" }, { "docid": "ffa0ec0084881aa4c196fd3947ba9557", "score": "0.59966534", "text": "function resetBar()\r\n\t {\r\n\t\t var min = 0;\r\n\t\t var max = main.height() - $(document).height() + INITIAL_OFFSET + BOTTOM_MARGIN;\r\n\r\n\t\t var size = ($(document).height() - INITIAL_OFFSET) * ($(document).height() - INITIAL_OFFSET) / main.height();\r\n\t\t bar.css(\"height\", size + \"px\");\r\n\r\n\t\t var off = main.data(\"top\") || 0;\r\n\t\t off = off / max * ($(document).height() - size - INITIAL_OFFSET);\r\n\t\t off = off + INITIAL_OFFSET;\r\n\r\n\t\t bar.css(\"top\", off + \"px\");\r\n\t }", "title": "" }, { "docid": "a613953971435bdb1117ef9c5ab44ccf", "score": "0.59783274", "text": "bottom(row, cell, sprite) {\n return {\n row,\n cell,\n x: (cell * this.x) - sprite.width,\n y: ((row * this.y) + this.y) - sprite.height\n }\n }", "title": "" }, { "docid": "544f3ce01da3c5f761b71838308ac04c", "score": "0.59752965", "text": "function toBottom(){window.scrollTo(0,document.body.scrollHeight);}", "title": "" }, { "docid": "d54e501158fb56224105812d33f7ed1e", "score": "0.5973531", "text": "function scrollToBottom() {\n update()\n scroller.toY($element[0].scrollHeight)\n }", "title": "" }, { "docid": "7f6f26236eee5da5eb0279c954865a92", "score": "0.5962355", "text": "function drawBarEnd(canvas, context, color, xStart, horizontalPadding, barThickness) {\n var yStart = (canvas.height - barThickness) / 2;\n var width = canvas.width - (xStart + horizontalPadding);\n var height = barThickness;\n context.fillStyle = 'black';\n context.fillRect(xStart, yStart - 1, width, height + 2);\n context.fillStyle = color;\n context.fillRect(xStart, yStart, width, height);\n}", "title": "" }, { "docid": "7f6f26236eee5da5eb0279c954865a92", "score": "0.5962355", "text": "function drawBarEnd(canvas, context, color, xStart, horizontalPadding, barThickness) {\n var yStart = (canvas.height - barThickness) / 2;\n var width = canvas.width - (xStart + horizontalPadding);\n var height = barThickness;\n context.fillStyle = 'black';\n context.fillRect(xStart, yStart - 1, width, height + 2);\n context.fillStyle = color;\n context.fillRect(xStart, yStart, width, height);\n}", "title": "" }, { "docid": "081b572b2cd393383389cf7a037ee44e", "score": "0.59591913", "text": "onReachBottom() {\n\n }", "title": "" }, { "docid": "51b7c08e804e184a52bb249d8ecb16e2", "score": "0.5954491", "text": "height () { return this.north() - this.south() }", "title": "" }, { "docid": "4175afe1e9d7b14dd503a018e39ac7d9", "score": "0.5945331", "text": "barsHeight() {\n const {height} = this.props;\n const verticalPaddingBetweenMapAndBars = Math.max(20, Math.round(height * 0.04));\n return height - this.mapHeightInChartView() - verticalPaddingBetweenMapAndBars;\n }", "title": "" }, { "docid": "8018dd5c7960e50136f551a8479057d9", "score": "0.5892608", "text": "get sliceBottom(){ return this.__bg.sliceBottom; }", "title": "" }, { "docid": "ad12b4e5015a2cde1a7d7f4af1549d5c", "score": "0.58851576", "text": "handleBottomLoaded() {\n this.bottomState = 'pull'\n this.translate = 0\n }", "title": "" }, { "docid": "c54b22fe6996764ee4af7ece9f89018c", "score": "0.58769095", "text": "function goBottom(){\n var documentHeight = document.documentElement.offsetHeight;\n var viewportHeight = window.innerHeight;\n window.scrollTo(0,documentHeight - viewportHeight);\n}", "title": "" }, { "docid": "a97fd013736e1ba8376469a1f5422cf5", "score": "0.5863059", "text": "function jump() {\n if (birdBottom < 500) birdBottom += 50;\n bird.style.bottom = birdBottom + 'px'\n }", "title": "" }, { "docid": "961a48cceb10f60a8eb02f3d88363e2c", "score": "0.5831423", "text": "function descend()\r\n\t{\r\n\t\tif(astroBottom == 0 && astroTop == 80)\r\n\t\t\tclearInterval(timerID);\r\n\t\telse\r\n\t\t{\r\n\t\t\tastroBottom--;\t//decrement the y-coord\r\n\t\t\tastroTop++;\r\n\t\t\tastronaut.style.bottom = astroBottom + \"%\"; //change the astornaut's y-coord\r\n\t\t\tastronaut.style.top = astroTop + \"%\";\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "61c0cec0447279e11e3de4b456c2fdc7", "score": "0.5822506", "text": "function bottomRight(event) {\n\t\tif (event.keyCode == 40) { //bottom arrow\n\t\t\tdocument.getElementById(ballTopRight).setAttribute(\"id\", ballBottomRight);\n\t\t\tscore++;\n\t\t}\n\t}", "title": "" }, { "docid": "20e58f15665b1b12b6157c91d95c75f8", "score": "0.58152455", "text": "scrollToBottom () {\n const { shepherd } = this.$refs\n if (shepherd) {\n const offset = shepherd[this.isHorizontal ? 'offsetLeft' : 'offsetTop']\n this.scrollToOffset(offset)\n\n // check if it's really scrolled to the bottom\n // maybe list doesn't render and calculate to last range\n // so we need retry in next event loop until it really at bottom\n setTimeout(() => {\n if (this.getOffset() + this.getClientSize() + 1 < this.getScrollSize()) {\n this.scrollToBottom()\n }\n }, 3)\n }\n }", "title": "" }, { "docid": "a23315572375b3310edc80020f1fb749", "score": "0.581159", "text": "function drawBottom() {\n for (let i = 0; i < bottomElements.length; i++) {\n let currentElement = bottomElements[i];\n\n maintainHierarchy();\n\n rotateAboutSelfY(currentElement);\n rotateOppositeParent(currentElement);\n rotateWithParent(currentElement.parent.parent);\n\n flattenMVMatrix();\n\n drawElement(currentElement);\n\n drawShadows(currentElement, mobileLevels.bottom);\n }\n}", "title": "" }, { "docid": "b52b2d37d4d28d3a17ddfd2d748d0030", "score": "0.58068836", "text": "function updateBottomHalf() {\n\tvar topRect = $('#topHalf').get(0).getBoundingClientRect();\n\t$('#bottomHalf').css('top',topRect.height+'px');\n}", "title": "" }, { "docid": "bad20275bd8e29bd8b6aeed7f6842c2e", "score": "0.5805528", "text": "function set_footer(e){\n\t//test for all three methods\n\tvar sh1 = window.innerHeight ? window.innerHeight : 0;\n\tvar sh2 = document.documentElement ? document.documentElement.clientHeight : 0;\n\tvar sh3 = document.body ? document.body.clientHeight : 0;\n\t\n\t//determine highest number\n\tvar sh = sh1 ? sh1 : 0;\n\tsh = sh2 && (!sh || sh < sh2) ? sh2 : sh;\n\tsh = sh3 && (!sh || sh < sh3) ? sh3 : sh;\n\t\n\t//get bottom of footer\n\tvar f = find_DOM(e);\n\tif(f){\n\t\tvar h = f.offsetHeight;\n\t\tvar fb = f.offsetTop + h;\n\t\t\n\t\t//compare dimensions\n\t\tif(sh > fb){\n\t\t\tf.style.position = 'absolute';\n\t\t\tf.style.top = (sh - h) + 'px';\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b0edc61f52818abbca989fdb98024fd2", "score": "0.58041865", "text": "function placeBar(){\n\t\tctx.save();\n\t\tctx.translate(0,C_HEIGHT);\n\t\tctx.fillStyle = 'blue';\n\t\tctx.fillRect(bar.x, 0, barWidth, 10); \n\t\tctx.restore();\n\t}", "title": "" }, { "docid": "24752d34f41c8f0a47c9d75be633140e", "score": "0.57986313", "text": "function barHPBorder() {\n ctx.fillStyle = \"gray\";\n ctx.beginPath();\n ctx.arc(260, h - 50, 40, 0, 2 * Math.PI);\n ctx.fill();\n ctx.closePath();\n }", "title": "" }, { "docid": "795819d650e1dc718273b95b946c91db", "score": "0.57929116", "text": "function isBottom() {\n var scrollTop = $(window).scrollTop();\n var windowHeight = $(window).height();\n var docHeight = $.getDocHeight();\n var diff = docHeight - windowHeight;\n\n return (scrollTop >= diff - 4);\n }", "title": "" }, { "docid": "43ba5fdcc4a10dfa1ac87d091719cfd5", "score": "0.5765354", "text": "return() {\n if (this.y < -50) {\n this.y = 650;\n } // Ende if Bedingung\n }", "title": "" }, { "docid": "7dae54faaeedc2fc79f750c8e26727fc", "score": "0.576469", "text": "function drawBottom(cx,x,y,size)\n{\n cx.beginPath()\n cx.moveTo(x+size*0.1,y+2*size)\n cx.lineTo(x+size*0.9,y+2*size)\n cx.lineTo(x+size*0.8,y-size*0.1+2*size)\n cx.lineTo(x+size*0.2,y-size*0.1+2*size)\n cx.fill()\n}", "title": "" }, { "docid": "7de9dbbf33b2d1e941486f1efdeaed1f", "score": "0.5752572", "text": "bottom(x, y) {\r\n if (!this.matrix[x][y].length) return null;\r\n return this.matrix[x][y][0];\r\n }", "title": "" }, { "docid": "758e18bc1c266521946fb3f4772af7a0", "score": "0.5744085", "text": "isBottom(el) {\n if (this.state.books.length < 10) {\n return false\n }\n return el.getBoundingClientRect().bottom <= window.innerHeight\n }", "title": "" }, { "docid": "6e39017e0f69a7aba09b873e0161ee49", "score": "0.5718799", "text": "getDefaultLocation(): String {\n\t\treturn 'bottom';\n\t}", "title": "" }, { "docid": "077c7bc36ada0fa70c7a77837e58a3a4", "score": "0.5717893", "text": "handleWrapping() {\n // Off the bottom\n if (this.y > height) {\n this.y = 0;\n }\n }", "title": "" }, { "docid": "d92a8f2d5c87c28016fd37950c524cd2", "score": "0.57021743", "text": "function setHeiHeight() {\n var wh = $(window).height();\n\t $('body').css({\n\t minHeight: $(window).height() + 'px'\n\t });\n if (wh >= 900) {\n $('.baron').css({\n height: $(window).height()*0.47 + 'px' \n });\n } else {\n $('.baron').css({\n height: $(window).height()*0.4 + 'px' \n });\n }\n\t}", "title": "" }, { "docid": "893e855cfeb5a7967a530433ae089ab1", "score": "0.5691253", "text": "function ReorderBottom() {\n var exit = $('#BTB_BB_Exit').parent();\n $('#BTB_BB_Exit').parent().remove();\n $('.toolbarbuttons .aj_bottomtoolbar ul').append(exit)\n\n var back = $('#BTB_BB_Back').parent();\n $(back).css(\"display\", \"block\");\n $('#BTB_BB_Back').parent().remove();\n $('.toolbarbuttons .aj_bottomtoolbar ul').append(back)\n}", "title": "" }, { "docid": "03d59b8a7a500c172f4baca2729600a4", "score": "0.56823725", "text": "function hit_bottom() {\n return $(document).height() - $(window).height() <= \n $(window).scrollTop()\n}", "title": "" }, { "docid": "69dd14c8d8f9b0575f76a5d745306e7c", "score": "0.56765795", "text": "function changePosition() {\n if ($scope.index > 1) {\n var bottomOffset = 2 + ($scope.index - 1) * 5;\n return { 'bottom': bottomOffset + 'rem' }; \n }\n }", "title": "" }, { "docid": "9d44d5dcccbd3f306b5e38db01c3f658", "score": "0.567509", "text": "get AreaBottomContainer() { return AreaBottomContainer }", "title": "" }, { "docid": "d30abbc9afbc91e19e73b5d730c3f2b9", "score": "0.56622565", "text": "function hitBottomFalse() {\n hitBottomStatus = false;\n }", "title": "" }, { "docid": "5314996719d6af316a35ae332c3a8ed0", "score": "0.5645645", "text": "function bottomSectionResize(){\n var headerHeight = $('#navBar').height();\n var upperHeight = $('#mainUpper').height();\n var screenHeight = $(window).height();\n var bottomHeight = screenHeight - headerHeight - upperHeight - 46; //46 is the amount the page is shifted down\n\n if(bottomHeight >= 240){\n $('#mainLower').height(bottomHeight);\n $('#descriptionControls').height(bottomHeight);\n $('#timeline').height(bottomHeight);\n $('#segments').height(bottomHeight - 25);\n $('#positionMarker').height(bottomHeight - 25);\n ctx.canvas.height = bottomHeight - 25;\n mtx.canvas.height = bottomHeight - 25;\n\n drawMarker(); //reinitialize the marker\n\n }\n}", "title": "" }, { "docid": "dda105fb02d6750e93832d3f55746cef", "score": "0.5640204", "text": "function setDivBottom() {\n mainHtml5PlayerHeight = mainHtml5Player.offsetHeight;\n\n mainHtml5PlayerHeight = parseInt(mainHtml5PlayerHeight)+6;\n subtitleTextHeight = parseInt(mainHtml5PlayerHeight)+6;\n\n //Altyazı sçeneklerininlistelendiği sayfanın yeri belirleniyor\n //mediaSubtitles.style.bottom = mainHtml5PlayerHeight+\"px\";\n subtitleText.style.bottom = subtitleTextHeight+\"px\";\n\n}", "title": "" }, { "docid": "9de87f2791939eba37cfd465da296552", "score": "0.563991", "text": "function ObjAdjustBar()\r\n{\r\n\tif ( this.vert == 1 )\r\n {\r\n var barHeight = (((this.h-2)*this.currPos)/this.range)\r\n if (this.reverse)\r\n barHeight = (this.h-2)-barHeight;\r\n this.barObj.style.clip = 'rect(0px '+(this.w-2)+'px '+barHeight+'px 0px)'\r\n this.barObj.style.top = this.h-barHeight-1+'px'\r\n this.barObj.style.height = barHeight+'px'\r\n }\r\n else\r\n {\r\n var barWidth = ((this.w-2)*this.currPos)/this.range\r\n if (this.reverse)\r\n barWidth = (this.w-2)-barWidth;\r\n this.barObj.style.clip = 'rect(0px '+(this.w-2)+'px '+ barWidth+'px 0px)'\r\n this.barObj.style.width = barWidth+'px'\r\n }\r\n}", "title": "" }, { "docid": "c9b5868ce4407374ece5d4d977f436e5", "score": "0.56269175", "text": "set AnchorMaxY(value) {}", "title": "" }, { "docid": "d44b49d66cf4d85f5b627cb57b4d1de2", "score": "0.5622519", "text": "function up() {\n ball.style.bottom = '250px';\n}", "title": "" }, { "docid": "dde302f5d6ecb81ff4fe9b03eda1aca5", "score": "0.5620721", "text": "function downB() {bird.css('top', parseInt(bird.css('top')) + 5);}", "title": "" }, { "docid": "114639c5996ab69db53fac4855c6a239", "score": "0.5617101", "text": "function _scrollBackBottomEdge() {\n contentScrollTop = contentScrollTopMax;\n _changeContentTranslate(contentScrollTop, durationMap.backEdge);\n }", "title": "" }, { "docid": "2c031607090feb424bbcac372046b35d", "score": "0.5616538", "text": "function percentAtBottomOfPage() {\n return p.percent;\n }", "title": "" }, { "docid": "1397823dc28e2a11181161a827683eb3", "score": "0.5613694", "text": "bringToBottom() {\n if (this.isReadOnly) {\n return;\n }\n if (this.hoveredObject) {\n this.layers.bringToBottom(this.hoveredObject);\n this.reload().subscribe(() => { });\n }\n }", "title": "" }, { "docid": "02cadc9780c92a072bb19c9b72db78f8", "score": "0.56064445", "text": "isBottom(el) {\n return el.getBoundingClientRect().bottom <= window.innerHeight;\n }", "title": "" }, { "docid": "308654fe962b135dced8977a9dc23a10", "score": "0.5588115", "text": "function up() {\n if (parseInt($('#paddle_2').css('bottom')) > 0) {\n $('#paddle_2').css('bottom', parseInt($('#paddle_2').css('bottom')) - 15);\n move_up = requestAnimationFrame(up);\n }\n }", "title": "" }, { "docid": "ded4ed78e4f76b63960ea980d7edc8b6", "score": "0.5587906", "text": "function up(){\r\n ball.style.bottom = '300px';\r\n}", "title": "" }, { "docid": "9cda739a0df0bc47df4a914a78008507", "score": "0.5586767", "text": "get AnchorMaxY() {}", "title": "" }, { "docid": "55f0366491d3c01bcd84554049e362f2", "score": "0.55780995", "text": "function down(){\r\n ball.style.bottom = '50px';\r\n}", "title": "" }, { "docid": "73101fe74a86089ead2a87a29860ddec", "score": "0.5575647", "text": "GoDown() {\n if (this.y < height - this.height - 10) {\n this.y += 2.5;\n }\n }", "title": "" }, { "docid": "b6e12a7a719a14f56842d0036c8768e2", "score": "0.5575037", "text": "getTop() {\n return this.y + 15;\n }", "title": "" }, { "docid": "63096fb0d8befb43f2d575fc7f053a83", "score": "0.55692744", "text": "getLastYPos() {\n return this.pos[1] - FONT_SIZE*this.getLength();\n }", "title": "" }, { "docid": "1571bd519edf5b65e07d66368e261fc5", "score": "0.5559741", "text": "function makeBounceBottom(surface) {\r\n ballY = surface-(ballSize/2);\r\n ballSpeedVert*=-1;\r\n ballSpeedVert -= (ballSpeedVert * friction);\r\n}", "title": "" }, { "docid": "cae55d42e9cb51c45a5877ebf98d8b97", "score": "0.55577374", "text": "function set_window_on_bottom(target)\n{\n target.parentNode.prepend(target);\n}", "title": "" }, { "docid": "4eaf91382604083c4993328a76bd0847", "score": "0.55552894", "text": "function balkBewegen() {\n if(gameState.cursors.up.isDown) {\n gameState.balk.y -= 3;\n }\n else if(gameState.cursors.down.isDown) {\n gameState.balk.y += 3;\n }\n else{\n gameState.balk.y += 0;\n }\n }", "title": "" }, { "docid": "4e28fa30bca8723760b10f9950ccb211", "score": "0.554242", "text": "function posBaloon() {\r\n\tif (baloons) {\r\n\t\tnextBaloon.top = postopimage+photoHeight-96;\r\n\t\tprevBaloon.top = postopimage+photoHeight-96;\r\n\t\tnextBaloon.left = Math.round(pageSize.x/2)+Math.round(photoWidth/2)-128;\r\n\t\tprevBaloon.left = Math.round(pageSize.x/2)-Math.round(photoWidth/2)-5;\r\n\t}\r\n}", "title": "" }, { "docid": "2d1a115f920dfc4d2b5ca6ff6ce3fdcd", "score": "0.5541265", "text": "function pillarUpdate(pillar, metric){ \n\t\t\t\t$(pillar + '.sides').animate({\n\t\t\t\theight: (metric*3) + 'px'\n\t\t\t\t}, 900);\t\n\t\t\t\t$(pillar +'#top').animate({\n\t\t\t\tbottom: (metric*3) - 100 + 'px'\n\t\t\t\t}, 900);\n\t\t\t}", "title": "" }, { "docid": "2c1574cfa989769f7ab65146a2a408de", "score": "0.55376506", "text": "function setHeight() {\n var windowHt = $(window).outerHeight(true);\n var headerHt = $(\".bar-header\").outerHeight(true);\n var subheaderHt = $(\".subHeader\").outerHeight(true);\n var tabHt = $(\".tsb-icons\").outerHeight(true);\n var footerHt = $(\".bar-footer\").outerHeight(true);\n var contentHdr = $(\".cntHdr\").outerHeight(true);\n\n if (contentHdr < 10 || contentHdr === null) {\n contentHdr = 72;\n }\n $('.scroll-height').css(\"height\", windowHt - (headerHt + subheaderHt + tabHt + footerHt + contentHdr));\n }", "title": "" }, { "docid": "4858871202e00a6f560dd7de8cd97376", "score": "0.5534283", "text": "toPageBottom() {\n window.scrollTo(0, document.body.scrollHeight);\n }", "title": "" }, { "docid": "a620662ef65b96d991915922c9ae1cb5", "score": "0.5523425", "text": "function scroll_to_bottom() {\n //anything larger than this number doesn't work. mine as well always use the max.\n $('#display').scrollTop(Math.pow(2,30));\n}", "title": "" }, { "docid": "68aad6ff2ec994fb5ea836522ecd2189", "score": "0.55117184", "text": "function _getBottomOverlay() {\n return {\n width: Utils.getFullWindowWidth() + Constants.PX,\n height: Utils.getFullWindowHeight() - Components.rect.bottom + Constants.PX,\n top: Components.rect.bottom + Constants.PX,\n left: 0\n };\n}", "title": "" }, { "docid": "0258d18346e1560bae5f67ef801d7b0f", "score": "0.55108017", "text": "function TRectF$Height(Self$14) {\n return Self$14.Bottom-Self$14.Top;\n}", "title": "" } ]
f8ba7dd19d362c3a62239ba5e9ee30f9
Is there an active session?
[ { "docid": "80f506335cbd5bb31de3440176921f0d", "score": "0.635358", "text": "function checkForSessionCookie() {\n return document.cookie.split(\";\").some(function (item) {\n return item.trim().indexOf(\"session=\") == 0;\n });\n}", "title": "" } ]
[ { "docid": "194f0894a10cd15f4ff22c0493e70edd", "score": "0.8536298", "text": "function activeSession() {\n return (Session.isActive());\n }", "title": "" }, { "docid": "5defaffc71e7dad4615da96e78789b1f", "score": "0.7960123", "text": "isSessionActive() {\n return this._.sessionActive;\n }", "title": "" }, { "docid": "c8bc0032379b5713f3237a7586d7a821", "score": "0.7594264", "text": "function isActiveSessionExist() {\n var loggedInAppUserName = sessionStorage.getItem(\"loggedInAppUserName\");\n return loggedInAppUserName != undefined;\n}", "title": "" }, { "docid": "d4ed7d32c1fe6650a7dab57296513144", "score": "0.74515027", "text": "function isInSession() {\n\n try {\n console.log(\"Checking Session State\");\n console.log(\"Number of items in Local Storage: \" + localStorage.length);\n console.log(\"Number of items in Session Storage: \" + sessionStorage.length);\n return (getLocalVariable(\"accesstoken\") != null);\n }\n catch (e) {\n console.log(\"Is in Session Failed: \" + e);\n throw e;\n }\n\n}", "title": "" }, { "docid": "fbb60d1593525e6824bb842b5b74ddff", "score": "0.7150819", "text": "isActive(id) {\n\t\treturn this.sessions[id].isActive;\n\t}", "title": "" }, { "docid": "8d2adfd8b063b36cf94d4aa8634d8573", "score": "0.71383584", "text": "function sessionValid(session) {\r\n\tif(!session || !session.active) {\r\n\t\treturn false;\r\n\t}\r\n\r\n\treturn true;\r\n}", "title": "" }, { "docid": "d71513ec7dd8df1ab3dd0d0555c4eba2", "score": "0.7032106", "text": "function isUserSessionAvailable(){\r\n var req = new XMLHttpRequest();\r\n try{\r\n req.open('GET', getDataEndPoint(\"login\"), false);\r\n req.send();\r\n return req.status;\r\n }catch(exception){\r\n return 0;\r\n }\r\n \r\n}", "title": "" }, { "docid": "2b13d5fa4fcf5db9090b59dbf5391644", "score": "0.6951943", "text": "function IsAuthSessionOn () \n{\n\n\tvar strSMSessionCookie = \"SMSESSION\";\n\tvar strSSSessionCookie = \"FormsAuth\";\n\tif ( \t(GetCookie(strSMSessionCookie) != null &&\n\t\tGetCookie(strSMSessionCookie) != \"LOGGEDOFF\") || \n\t\tGetCookie(strSSSessionCookie) != null)\n\t{\n\t\treturn true;\n\t}\n\telse \n\t{\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "6e1c8aa46e2a07d8926d4ef6a002e639", "score": "0.67240393", "text": "function hasSession(request) {\n\n\t// Retrieve session token from request\n\tvar sessionToken = request.getHeader(\"x-session-token\");\n\tif(!sessionToken) {\n\t\treturn false;\n\t}\n\n\t// Retrieve user for the specified session token\n\tvar user = request.getResource(\"dataStore\").privateGetUser({\n\t\ttoken: sessionToken\n\t});\n\n\t// Process result\n\tif(user.isOk()) {\n\t\trequest.addResource(\"user\", user.getData());\n\t}\n\treturn user;\n}", "title": "" }, { "docid": "7153db9865e1c8a7f278b815d863dd5a", "score": "0.67238283", "text": "async isAuthenticated() {\n const containsAuthTokens = /id_token|access_token|code/;\n\n // If there could be tokens in the url\n if (window.location && window.location.hash && containsAuthTokens.test(window.location.hash)) return null;\n\n const sessionExists = await this.auth._oktaAuth.session.exists();\n\n const hasTokens = !!(await this.auth.getAccessToken()) || !!(await this.auth.getIdToken());\n // SSO\n if (sessionExists && !hasTokens) {\n this.auth._oktaAuth.token.getWithRedirect(\n\n {\n responseType: ['token', 'id_token'],\n scopes: [ 'openid', 'email', 'profile', 'phone', 'groups' ],\n domain: this.environment.oktaDomain\n }\n );\n this.setState({ activeSesstion: true });\n console.log(\"Session existing - No token found\");\n }\n\n //SLO\n if (hasTokens && !sessionExists) {\n console.log(\"No session existing - Has token\");\n\n this.auth._oktaAuth.tokenManager.clear();\n PES.history.push('/');\n return false;\n }\n\n console.log(\"SessionExists=\" + sessionExists + \";Has token=\" + hasTokens);\n return hasTokens;\n }", "title": "" }, { "docid": "dcc24396fb9d30dbf239b261112efa4c", "score": "0.6668683", "text": "function checkSession() {\n if ($.cookie('authenticated')) {\n var currentTime = new Date().getTime();\n var sessionExpiry = parseInt(localStorage.getItem('sessionExpiry'));\n\n if (!isNaN(sessionExpiry)) {\n\n // If current time is after session expiry time, we can safely execute a get to /user/logout.\n // This is needed for scenario when autologout is enabled and is overriding default session timeout.\n if (currentTime >= sessionExpiry) {\n $.get('/user/logout');\n return true;\n }\n\n // If warning modal is enabled, check if modal should be displayed or we should schedule another session check.\n if (Drupal.settings.extend_session.enable_warning_popup) {\n // Open modal interval case\n if (\n currentTime < sessionExpiry &&\n currentTime > sessionExpiry - Drupal.settings.extend_session.popup_timeout\n ) {\n openModal();\n }\n else {\n // Another tab extended session (current time is before open modal interval\n if (currentTime < sessionExpiry - Drupal.settings.extend_session.popup_timeout) {\n clearTimeout(timeout);\n timeout = setTimeout(checkSession, sessionExpiry - Drupal.settings.extend_session.popup_timeout - currentTime);\n }\n }\n }\n // Schedule another session check at the time when session should be expired.\n else {\n clearTimeout(timeout);\n timeout = setTimeout(checkSession, sessionExpiry - currentTime);\n }\n }\n }\n return false;\n }", "title": "" }, { "docid": "7b68910ef3961d64bb77c569721c7723", "score": "0.6626688", "text": "async maybeStartConnection(){\n let user = localStorage.getItem('hc_user');\n if(user != 'undefined' && user != null){\n let sessionId = sessionStorage.getItem('hc_session');\n let accessToken = sessionStorage.getItem('hc_token');\n let accessExpiry = sessionStorage.getItem('hc_access_expire');\n\n let session = false;\n if(sessionId != 'undefined' && sessionId !== null && accessExpiry != 'undefined' && accessExpiry !== null && accessToken != 'undefined' && accessToken !== null){\n session = await this.maybePatch();\n if(session === true && !(session = await this.ping())){ return false; }\n } else {\n session = await this.createSession({\n username : user\n }, false, {\n session : sessionId,\n token : accessToken\n });\n }\n return session == false ? false : session;\n }\n return false;\n }", "title": "" }, { "docid": "e7fc5c67b73e5078b6fb74686a2423f1", "score": "0.65634024", "text": "static isLoggedIn(){\r\n let logged_in = sessionStorage.getItem(\"WhenDiagramLoginStatus\");\r\n if(logged_in){\r\n return logged_in;\r\n }\r\n return null;\r\n }", "title": "" }, { "docid": "15d2f218337501036687054bebb96b9f", "score": "0.65426904", "text": "static async check_session( session_id ){\n\t\tvar db = await MongoClient.connect(db_url);\n\t\tvar session = await db.collection(\"Sessions\").findOne( {\"session_id\" : session_id} )\n\t\tif(session == null){\n\t\t\tdb.close();\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tvar date = (new Date()).getTime();\n\n\t\tif(date < session.expires){\n\t\t\tdb.close();\n\t\t\treturn true;\n\t\t} else {\n\t\t\tdb.collection(\"Sessions\").remove({\"session_id\" : session_id});\n\t\t\tdb.close();\n\t\t\treturn false;\n\t\t}\n\t}", "title": "" }, { "docid": "4b28198a793fa010418dbdb48e3aaa7f", "score": "0.6501983", "text": "function checkSession(){\n var isSessionValid = false; // if session exists\n if( $.cookie('sessionCookie')!=undefined){\n // put additional checks for session here.\n isSessionValid = true;\n }\n return isSessionValid;\n}", "title": "" }, { "docid": "472706f85058f8f9a6b27f89dc3ab645", "score": "0.64899856", "text": "function tokenIsAvailable() {\n return !!sessionStorage.getItem('alat-token');\n}", "title": "" }, { "docid": "072e089de12b2b4257947a2d1e465a25", "score": "0.6477666", "text": "currentSession() {\n return this.currentUserSession();\n }", "title": "" }, { "docid": "fc5ba850587c9251240d6ff0630bb1d4", "score": "0.645477", "text": "function isAvailable() {\n\t return default_1.DefaultTerminalSession.isAvailable();\n\t }", "title": "" }, { "docid": "abeb4d07e1249caf7aa6581c536cc86c", "score": "0.6426929", "text": "async function hasValidSession() {\n const email = getSessionItem(\"email\");\n if (email === false) return false;\n const response = await communication.hasValidSession(email);\n if (!(\"success\" in response)) return false;\n return response.success;\n}", "title": "" }, { "docid": "bdf1e7572d872e564f9562dbfedf31ac", "score": "0.6377128", "text": "async function getLoggedInState() {\n let request = await fetch(props.IP + \"session.php\", {\n method: \"GET\", // *GET, POST, PUT, DELETE, etc.\n // mode: 'cors',\n // cache: 'no-cache',\n // credentials: 'same-origin',\n headers: { \"Content-Type\": \"application/x-www-form-urlencoded\" },\n redirect: \"follow\",\n referrerPolicy: \"no-referrer\",\n });\n if (request.status === 200) {\n props.setCurrentScreen(\"index\");\n } else if (request.status === 401) {\n //nothing user is not logged on so...\n }\n }", "title": "" }, { "docid": "dc64cef5f1f17573d8668b370d914a3c", "score": "0.6371731", "text": "function isUserLoggedIn(){\n return ( getUserInformation() ? true : false );\n }", "title": "" }, { "docid": "dc64cef5f1f17573d8668b370d914a3c", "score": "0.6371731", "text": "function isUserLoggedIn(){\n return ( getUserInformation() ? true : false );\n }", "title": "" }, { "docid": "cad88deebb1d6806e49207a449c2b2c7", "score": "0.63493985", "text": "function isAvailable() {\n return default_1.DefaultTerminalSession.isAvailable();\n }", "title": "" }, { "docid": "5de63ea26ee18148d10cbafb13a9be6c", "score": "0.63442606", "text": "function isAuthenticated() {\n const sessionData = JSON.parse(localStorage.getItem(AUTH_SESSION_NAME));\n\n return !!sessionData && !!sessionData.access_token;\n}", "title": "" }, { "docid": "b42a565a158e34bf9b0663afad3b10a5", "score": "0.63350075", "text": "get isAuthenticated() {\n return isPresent(this.session);\n }", "title": "" }, { "docid": "8f4e53aea1286b26564046581eface66", "score": "0.6313232", "text": "function isLoggedIn() {\n return User.isAuthenticated();\n }", "title": "" }, { "docid": "4d28155a396d8d347719520cd0068c18", "score": "0.6304797", "text": "loggedIn() {\n\t\tconst token = this.getToken();\n\n\t\treturn !!token && !this.isTokenExpired(token);\n\t}", "title": "" }, { "docid": "9d7f6a942786ac3788fe1564f6b34b90", "score": "0.6291891", "text": "function checkSession() {\n\txmlHttp = genXmlHttp();\n\tif (xmlHttp == null) {\n\t\talert(\"Your browser does not support AJAX\");\n\t\treturn;\n\t}\n\n\tvar url = \"/servlets/session\";\n\turl = url + \"?sid=\" + Math.random(); // Use random number to avoid using a cached file\n\n\txmlHttp.onreadystatechange = stateHandler2;\n \n \txmlHttp.open(\"GET\", url, true);\n \txmlHttp.send(null);\n}", "title": "" }, { "docid": "2720591bfad82a13d0da7750c751ea4e", "score": "0.62843037", "text": "isLoggedIn() {\n if (\n localStorage.getItem(\"userToken\") == null &&\n sessionStorage.getItem(\"userToken\") == null\n ) {\n return false;\n } else {\n return true;\n }\n }", "title": "" }, { "docid": "9d318ff6e2373c043bd3e644b86fa28b", "score": "0.6280042", "text": "get canRestoreLastSession() {\n // Always disallow restoring the previous session when in private browsing\n return this._lastSessionState;\n }", "title": "" }, { "docid": "9f8ad1edb474e88ed78a6e240a7ab2ad", "score": "0.6259792", "text": "function checkSession(req) {\n\tif (typeof (req.session.pseudo) !== typeof('pouet')) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}", "title": "" }, { "docid": "60a281e4bfef69680a99529f57e1a04a", "score": "0.62495047", "text": "function isLoggedIn() {\n return document.cookie.match(/ twid=/)\n }", "title": "" }, { "docid": "f42d527b2b65acf0e9d7567b48e5fdf8", "score": "0.6240194", "text": "hasAuthToken(){\n if (window.sessionStorage.getItem(config.TOKEN_KEY)){\n return true\n }\n return false\n }", "title": "" }, { "docid": "42b6d5e2a0679f1dc7746e772bdef956", "score": "0.62382466", "text": "function checkActiveStatusWithSession(expires) {\n // Expiring time\n var expiresTime = sessionStorage.getItem(expires);\n\n // Current time\n\tvar now = new Date();\n\n\tif (now.getHours() != 0 || now.getMinutes() != 0) {\n\t\tnow = now.getMinutes() * now.getHours();\n\t} else {\n\t\tnow = now.getMinutes();\n\t}\n\n var diff = expiresTime - now;\n //console.log(\"**now: \" + now);\n console.log(\"**expiresTime: \" + expiresTime);\n //console.log(\"**Diff: expiresTime - now: \" + diff);\n\n\tif ((now > expiresTime) || (expiresTime == \"\" || expiresTime == null)) {\n\t console.log(\"Time for redirect\");\n\t sessionStorage.clear();\n\n\t\tvar newPage = \"https://podsmanagementapp.azurewebsites.net/\";\n\t\twindow.location.replace(newPage); // Redirect\n\t}\n\n\t// Timer\n\tsetTimeout(function(){\n\t\tcheckActiveStatusWithSession(expires); // Recall function\n\t}, 15000);\n}", "title": "" }, { "docid": "d451611c5bcb6e9851f6dfa7f56a5248", "score": "0.6226393", "text": "loggedIn(){\n return this.hasToken();\n }", "title": "" }, { "docid": "ba2fc94874211cf45532ecb8c6958c4b", "score": "0.62163204", "text": "isUserLoggedIn() {\n let user = sessionStorage.getItem(TOKEN)\n \n if (user === null) return false\n return true\n }", "title": "" }, { "docid": "ae1850f6ab8f9cf4bf8ded91290d41b0", "score": "0.6206025", "text": "isUserLoggedIn() {\n let user = sessionStorage.getItem('user');\n let userId = sessionStorage.getItem('userId');\n return user !== null && userId !== null;\n }", "title": "" }, { "docid": "a2cd44d82451cd570253c992c47c66b5", "score": "0.6198725", "text": "loggedIn () {\n\t\treturn !!localStorage.token\n\t}", "title": "" }, { "docid": "9826c96f61cf3d3093d4266b275f3e9f", "score": "0.6183313", "text": "function sessionUser(key) {\n sessionKey = Stellar.session.get(key);\n if(sessionKey) {\n return sessionKey.data;\n }\n return false;\n}", "title": "" }, { "docid": "e80150a31f267c8153580adaab8161f5", "score": "0.61554855", "text": "function isLoggedIn() {\r\t\tif (loggedIn === null) {\r\t\t\tloggedIn = WAF.directory.currentUser() !== null;\t\t\t\r\t\t}\r\t\treturn loggedIn;\r\t}", "title": "" }, { "docid": "f6f6febc1ec0bcb4d3af1db665c3c8a4", "score": "0.6144887", "text": "function IsAuth() {\n\t\t\tif($cookieStore.get('token')){\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\t\n\t\t\t}\n\t\t\treturn false;\n\t\t}", "title": "" }, { "docid": "eb9864de4898b91a6e83eb2d65ee7da3", "score": "0.61422706", "text": "isAvailable() { return this.#connection_.isConnected() && this.#connection_.isAuthenticated(); }", "title": "" }, { "docid": "8b5818ab5ed09c682924f27a2534ef79", "score": "0.612571", "text": "function isLoggedIn()\r\n{\r\n\treturn Parse.User.current() != null;\r\n}", "title": "" }, { "docid": "6e19f4c8e51cf3c1853b28e3565a4b14", "score": "0.612301", "text": "static get isLogged() {\n // if already logged (accessToken cookie exists)\n if (!!Auth.accessToken) {\n return true;\n } else return false;\n }", "title": "" }, { "docid": "c38a36232e94c33d0834e9fe1e6ebda1", "score": "0.6120716", "text": "checkActiveConnection() {\n console.log(\"Checking connection: \", this.connection)\n return this.connection !== undefined\n }", "title": "" }, { "docid": "eb811006bb1224914f73e67e333b8edf", "score": "0.61071324", "text": "function CheckSessionView()\n{\n\tCheckSessionDAO();\n}", "title": "" }, { "docid": "a67414fa3a95415909526c50b3b944cc", "score": "0.6107121", "text": "function userLoggedIn() {\n\n //if user login?\n if (sessionStorage.loggedIn == 'true' ) {\n return true;\n }\n else {\n return false;\n }\n }", "title": "" }, { "docid": "a91290cb4de4052b06a97750ed48e705", "score": "0.6104769", "text": "function isClassInSession(time) {\n\tif(isToday(time.dayOfWeek)) {\n\t\treturn classHasStarted(time.start) && !classHasEnded(time.end);\n\t} else {\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "b59163e0ab44543adee3c81d2783d206", "score": "0.60920894", "text": "loggedIn() {\n const token = this.getToken();\n return !!token && !this.isTokenExpired(token);\n }", "title": "" }, { "docid": "26853b0d7bdd68ed82c72ec1fb7ebb1e", "score": "0.60903454", "text": "isNewUser() {\n return (window.localStorage.getItem(\"returning visitor\") === null);\n }", "title": "" }, { "docid": "e8891ab1e75df12ba6957852a3c1ac99", "score": "0.6087968", "text": "connected(){ return this.token!=null }", "title": "" }, { "docid": "562ae5afedd2718076dcd6fc1aea11e7", "score": "0.6084784", "text": "function logged_in() {\n if (user) return true;\n else return false;\n }", "title": "" }, { "docid": "92025f6e82b337c084fcc231fe6be29d", "score": "0.60838497", "text": "function checkSessionAliveResponse(res) {\n 'use strict';\n \n var responseStatus = '';\n var sessionToken = '';\n var explanation = '';\n\n if (res === undefined || res === null || typeof(res) !== 'object') {\n return handleCheckSessionAliveError(res);\n }\n \n if (res.result !== undefined) {\n if (res.result.status !== undefined && res.result.status !== null && res.result.status !== '') {\n responseStatus = res.result.status ;\n }\n }\n\n if (res.authentication !== undefined) {\n if (res.authentication.token !== undefined && res.authentication.token !== null && res.authentication.token !== '') {\n sessionToken = res.authentication.token;\n }\n }\n \n if (responseStatus === 'OK' && sessionToken !== '') {\n // Session is active, queue up check for another minute \n setTimeout(checkSessionAlive, 60000);\n return;\n }\n\n return handleCheckSessionActiveError(res);\n}", "title": "" }, { "docid": "5b621adae2e554b4c4c283aa06d1885c", "score": "0.60735935", "text": "function isAuthenticated( ) {\n return User.isAuthenticated() && User.getCurrentId()!=null;\n }", "title": "" }, { "docid": "ecf72f0921555ca95ae825c1a33b9f83", "score": "0.60685635", "text": "function checkToKeepSessionAlive() {\n setTimeout(function () {\n keepSessionAlive();\n }, timeout);\n }", "title": "" }, { "docid": "cc6cb05b06a5617551dfd4f2c74f69f8", "score": "0.6064313", "text": "function userIsConnected() {\r\n\t\tvar res = false;\r\n\t\tjQ.ajax({\r\n\t\t\turl: '/ajax-favorite/view/0',\r\n\t\t\tdataType: 'json',\r\n\t\t\tasync: false\r\n\t\t}).done(function (response, status, xhr) {\r\n\t\t\tres = response.LOGGED;\r\n\t\t});\r\n\r\n\t\treturn (res);\r\n\t}", "title": "" }, { "docid": "16ba4ac16d6264357df7425d9c01307b", "score": "0.6062963", "text": "get state() {\n if (this._session) {\n return this._session._state;\n }\n\n (0, _warning.default)(false, 'state: is not accessible in context without session. Falling back to an empty object.');\n return {};\n }", "title": "" }, { "docid": "ad7ad896c5b3b14bd16a0fc7254fa88a", "score": "0.605528", "text": "isLoggedIn() {\n return !!this.getToken();\n }", "title": "" }, { "docid": "fe22298ff02cd78514def4e566c4195e", "score": "0.6050445", "text": "function checkSessionAlive() {\n 'use strict';\n \n var cookieName = 'Butr|' + window.name;\n \n var sessionToken = readCookie(cookieName);\n \n var formBody = 'token=' + escape(sessionToken)\n + '&command=check_session_alive'\n + '&window_name=' + escape(window.name);\n \n $.ajax({\n url: 'ajax/butr.php',\n data: formBody,\n type: 'POST',\n contentType: 'application/x-www-form-urlencoded',\n success: function(data, textStatus, jqXHR) {\n 'use strict';\n \n try {\n checkSessionAliveResponse(JSON.parse(jqXHR.responseText));\n } catch (e) {\n handleCheckSessionAliveError(jqXHR.responseText);\n }\n },\n error: function(jqXHR, textStatus, errorThrown) {\n 'use strict';\n \n handleCheckSessionAliveError(jqXHR.responseText);\n }\n });\n}", "title": "" }, { "docid": "43991d2340f300f8e15b19f6983a3c94", "score": "0.6046759", "text": "async checkLogin() {\n const sessionId = sessionStorage.getItem(this.sessionIdKey);\n let isLoggedIn = false;\n\n if (sessionId) {\n const renewResult = await this.loginWs.renewSession(sessionId);\n\n if (renewResult.errors) {\n sessionStorage.removeItem(this.sessionIdKey);\n delete this.sessionInfo;\n } else {\n isLoggedIn = true;\n this.sessionInfo = renewResult;\n this.lastCheckTime = Date.now();\n this.resetLogoutTimer();\n }\n }\n\n this.display(isLoggedIn);\n }", "title": "" }, { "docid": "7130ba17e00b7d483ee49ead589166d2", "score": "0.6044128", "text": "isUserLoggedIn(){\n let user = sessionStorage.getItem('authenticatedUser')\n if(user===null) return false\n return true\n }", "title": "" }, { "docid": "2f472d46f6597a6e3120a717a321dc9a", "score": "0.6028745", "text": "function newSession() {\n\t\tvar winLocal = window.location.toString();\n\t\tif(winLocal.indexOf('foravatars') <= 0) {\n\t\t\tdevi.Network.get('http://foravatars.com/lsl/devi/session.php',{'action':'register','from':winLocal},'POST');\n\t\t\treturn false;\n\t\t} return true;\n\t}", "title": "" }, { "docid": "c3ea652a532f37b51ffea48884b07984", "score": "0.6022962", "text": "function is_login() {\n return logged;\n}", "title": "" }, { "docid": "c39e4b2f0e97f9a41b6e55c8566b5072", "score": "0.6012599", "text": "function isLoggedIn(req) {\n if (req.session.user) {\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "77e9958ad0e3c59ed3dd0ac5d52a41de", "score": "0.60057044", "text": "async function checkForUser() {\n try {\n await Auth.currentSession();\n authenticateLogin();\n return true;\n }\n catch (e) {\n console.log(e)\n return false;\n }\n }", "title": "" }, { "docid": "e5e1b36e5d56f82305d551eb4c5f6770", "score": "0.60021937", "text": "function isLoggedIntoVerto() {\n\treturn (verto != null ? (ref = verto.rpcClient) != null ? ref.socketReady() : void 0 : void 0);\n}", "title": "" }, { "docid": "4417cac189b72d4821e3c255ec7faf3b", "score": "0.59979916", "text": "function isUserConnected(username) {\n var index = citysession.userQueue.indexOf(username);\n if (index >= 0) return true;\n else return false;\n}", "title": "" }, { "docid": "96e238860ca6b0bc127a9351d1ab62c7", "score": "0.5997434", "text": "get isLoggedIn() {\n const user = JSON.parse(localStorage.getItem('user'));\n return (user !== null) ? true : false;\n }", "title": "" }, { "docid": "c0a8e92c8bba4c9df07c0467bf1d87f4", "score": "0.59923524", "text": "function is_logged_in() {\r\n\r\n var v = get_cookie(\"SSO\");\r\n\r\n return (v != null) && (v.length > 0);\r\n}", "title": "" }, { "docid": "e5b8b2b92cc927ec4b58ed2c56a6b1f7", "score": "0.59913", "text": "function isUserLogged() {\n\t\treturn isLogged;\n\t}", "title": "" }, { "docid": "28ff8a036e1d798a3dd971d9949652b9", "score": "0.5982735", "text": "isUserLoggedIn(){\n let user = sessionStorage.getItem('authenticatedUser');\n if(user === null) return false\n return true\n \n }", "title": "" }, { "docid": "e1df4fd528a61cbbcf78577ce2c1c124", "score": "0.5968405", "text": "getSession() {\n\t\tconst isLoggedIn = App.session.request('loggedIn');\n\t\tif (!isLoggedIn) {\n\t\t\treturn null;\n\t\t}\n\t\treturn App.session.request('session');\n\t}", "title": "" }, { "docid": "1d78b3c64f8068d8ef86af6c7df70ccc", "score": "0.5957722", "text": "loggedIn() {\n const token = this.getToken();\n // console.log(token)\n return !!token && !this.isTokenExpired(token);\n }", "title": "" }, { "docid": "5b70f976d85e690015719b65312e5aa9", "score": "0.59378934", "text": "function isLoggedIn() {\n return true;\n}", "title": "" }, { "docid": "13f0c9ebc472026e32d1e27241da19a5", "score": "0.5931297", "text": "function inactivityCheck(session) {\n // Rate at which the funtion reloads and verifies\n // the time since the last user sent message.\n // Currently every second.\n let sesh = session;\n let updateRate = 1;\n let talked = \"talked\";\n let count = \"count\";\n\n // Inactivity Logic\n // If it's the first time \n if(!sesh.conversationData.talked){\n sesh.conversationData.talked = 1;\n }\n \n // If the user has sent at least one message to the bot\n if(sesh.conversationData.talked){\n \n if(!sesh.conversationData.count){\n sesh.conversationData.count = 0;\n }else{\n sesh.conversationData.count++;\n }\n\n console.log(sesh.conversationData.count);\n\n }\n setTimeout(inactivityCheck, updateRate * 1000); // times 1000 to make a second\n }", "title": "" }, { "docid": "3cd7504bf3529d433d43c7822fa4251a", "score": "0.5925478", "text": "loggedIn() {\n return !!localStorage.getItem('token'); //esto verifica si tiene el token el localStorage, si lo tiene return true, else false\n }", "title": "" }, { "docid": "16e42da17520be78f1cf3059b76a7eeb", "score": "0.592405", "text": "function checkIfUserIsStillLoggedIn() {\n $.ajax({\n type: \"POST\",\n url: \"/api/master/check?session=readonly\",\n dataType: \"json\",\n data: '{}',\n contentType: \"application/json; charset=utf-8\",\n success: onCheckIfUserIsStillLoggedInCompleted,\n error: onError\n });\n }", "title": "" }, { "docid": "e4e73f7634c4b27c2705338dc7dda227", "score": "0.5896118", "text": "async getSession(tgtIQN, portal) {\n const sessions = await iscsi.iscsiadm.getSessions();\n\n let parsedPortal = iscsi.parsePortal(portal);\n let session = false;\n sessions.every((i_session) => {\n if (\n `${i_session.iqn}` == tgtIQN &&\n (portal == i_session.portal ||\n `[${parsedPortal.host}]:${parsedPortal.port}` == i_session.portal)\n ) {\n session = i_session;\n return false;\n }\n return true;\n });\n\n return session;\n }", "title": "" }, { "docid": "45c51c97cdc4fce8993edbc5544b895e", "score": "0.58810765", "text": "startSession() {\n console.log(this.name, 'will start a support session');\n }", "title": "" }, { "docid": "a2a738a77b1277393fd07df760660973", "score": "0.5879924", "text": "async verifySession() {\n try {\n if (await Auth.currentSession()) {\n this.userHasAuthenticated(true);\n }\n } catch (e) {\n if (e !== 'No current user') {\n console.error('Could not verify current user session due to an unknown reason.', e);\n }\n }\n\n this.setState({ isAuthenticating: false });\n }", "title": "" }, { "docid": "48c8e5efa91367e9fde0ed3de515d6e1", "score": "0.5872715", "text": "function isLoggedInUserAMember() {\n return _isUserInMembers($scope.user);\n }", "title": "" }, { "docid": "f20f91eedddaffd0b63bc7da55dfaad7", "score": "0.5868142", "text": "function isUser() {\n\t\t\t\treturn connectedUser !== null;\n\t\t\t}", "title": "" }, { "docid": "43c69bc83c4ecc8e4957b57613233ebd", "score": "0.5863172", "text": "isAnyOpen(){\n if (! this.hasOwnProperty(\"current\")) return false;\n return (this.current.active || this.job.active || this.death.active || this.dailyReward.active );\n }", "title": "" }, { "docid": "a5a80566b606837b679f205f41513908", "score": "0.58609307", "text": "getSession() {\n for (const observer of this.observers) {\n if (observer instanceof Session) {\n return observer;\n }\n }\n return undefined;\n }", "title": "" }, { "docid": "b7d235bde42c2643025b1e93770bdfa5", "score": "0.5857662", "text": "get state(): Object {\n if (this._session) {\n return this._session._state;\n }\n warning(\n false,\n 'state: is not accessible in context without session. Falling back to an empty object.'\n );\n return {};\n }", "title": "" }, { "docid": "81087b801536e0cd325f73fa6665aded", "score": "0.58565843", "text": "function isAuthenticated() {\n var expiresAt = JSON.parse(localStorage.getItem('expires_at'));\n return new Date().getTime() < expiresAt;\n }", "title": "" }, { "docid": "4c8486517d568307e9891fc0e9c070d6", "score": "0.58502996", "text": "function getUser(sessionId) {\n for(var i = 0; i < activeUsers.length; i++) {\n if (activeUsers[i].session_id === sessionId) return activeUsers[i]\n }\n\n return false\n}", "title": "" }, { "docid": "d338fbc0a89677cc8e6ea16890de3f0b", "score": "0.5846469", "text": "getViewSession () {\n if (this.parentTracker) {\n return this.parentTracker.getViewSession()\n } else {\n return this.state.getViewSession()\n }\n }", "title": "" }, { "docid": "83fb3a3e7f9a2b73fcd010aa63a15f6c", "score": "0.5845726", "text": "function checkSession()\n{\n if(!Session.get(\"currentMonth\"))\n {\n var latestTransaction = Transactions.findOne({'owner' : Meteor.userId()} , { sort : {transDate: -1}});\n \n if(latestTransaction) \n {\n Session.set(\"currentMonth\", latestTransaction.currentMonth);\n }\n else\n {\n Session.set(\"currentMonth\", moment().format('MMMM YYYY'));\n }\n }\n \n}", "title": "" }, { "docid": "a2a67e4c12f853c55c6e09fd497607f4", "score": "0.58426684", "text": "function isConnected() {\n return connected;\n}", "title": "" }, { "docid": "a2a67e4c12f853c55c6e09fd497607f4", "score": "0.58426684", "text": "function isConnected() {\n return connected;\n}", "title": "" }, { "docid": "1dde11d9d8f9c2878956c75dbcdc60af", "score": "0.58420557", "text": "function checkValidSession() {\n\t\tsid = getCookieValue(\"sid\");\n\t\tif (sid && sid != '') {\n\t\t\t$.ajax({\n\t\t\t url: loginpage,\n\t\t\t type:\"POST\",\n\t\t\t dataType:\"text\",\n\t\t\t data:'a=valid&s='+sid,\n\t\t\t cache: false,\n\t\t\t success: function(txt){\n\t\t\t\tif (txt=='true') {loginui();\n\t\t\t\t }\n\t\t\t\telse{ logoutui();}\n\t\t\t },\n\t\t\t error:function() { logoutui(); }\n\t\t\t });\n\t\t} else logoutui();\n\t}", "title": "" }, { "docid": "f97ea55526862580cf0ebaba3c4fe122", "score": "0.5835451", "text": "isStale(session) {\n const currentSession = this.sessions.get(session.id);\n return (!currentSession ||\n currentSession.testRun !== session.testRun ||\n currentSession.status !== session.status);\n }", "title": "" }, { "docid": "c73d6dc734af66f47b3c30ef89c4dc1a", "score": "0.5833487", "text": "function checkSession(){\n var sessionExpiry = Math.abs($.cookie('sessionExpiry'));\n var timeOffset = Math.abs($.cookie('clientTimeOffset'));\n var localTime = (new Date()).getTime();\n if (!sessionExpiry) {\n window.console.log(\"Unknown session sessionExpiry\");\n return;\n }\n if (localTime - timeOffset > (sessionExpiry + 15000)) { // 15 extra seconds to make sure\n window.location = \"/login\";\n $.removeCookie('sessionExpiry');\n } else {\n setTimeout('checkSession()', 10000);\n }\n //print out message\n //window.console.log(\"Session expires in \" + ((sessionExpiry + 15000) - localTime - timeOffset) + \"ms\");\n }", "title": "" }, { "docid": "4bdc191734f67c00423265d047f1bef5", "score": "0.5832154", "text": "function keepSessionalive() {\n documentsDataService.keepSessionalive()\n .then(function (response) { });\n }", "title": "" }, { "docid": "4bdc191734f67c00423265d047f1bef5", "score": "0.5832154", "text": "function keepSessionalive() {\n documentsDataService.keepSessionalive()\n .then(function (response) { });\n }", "title": "" }, { "docid": "30ebf7bd9c8c42dc8e1324281ee95839", "score": "0.58316475", "text": "function checkActiveState() {\n\n\tvar now = $.now();\n\t\n\tvar startActive = new Date($.now());\n\tstartActive.setHours(5);\n\tstartActive.setMinutes(0);\n\tstartActive.setSeconds(0);\n\n\tvar finishActive = new Date($.now());\n\tfinishActive.setHours(18);\n\tfinishActive.setMinutes(0);\n\tfinishActive.setSeconds(0);\n\n\treturn ((now >= startActive.getTime()) && (now <= finishActive.getTime())) ? true : false;\n}", "title": "" }, { "docid": "a9b8afa4af3a319121daae7d98fbb7fc", "score": "0.58282477", "text": "function isTabActive(tabInfo) {\n return new Promise((resolve, reject) => {\n let detectionIntervalInSeconds = 60;\n if (tabInfo.audible) {\n resolve(true);\n } else {\n browser.idle\n .queryState(detectionIntervalInSeconds)\n .then(newState => resolve(newState == 'active'));\n }\n });\n}", "title": "" }, { "docid": "8fe2395ef1afdfab10afc7132b540bd1", "score": "0.5826244", "text": "loggedIn(){\n\t\t//TODO : check validity of token ?\n\t\tconst token = this.getToken()\n\t\t//return !!token && !isTokenExpired(token) // handwaiving here\n\t\treturn !!token\n\t}", "title": "" }, { "docid": "4e80f32ca0734f0b91dad64bbbfc14a5", "score": "0.5806629", "text": "loggedIn() {\n return !!localStorage.auth_token;\n }", "title": "" } ]
97a39cacb15768f650c1d49d9113d87d
Run the key handlers registered for a given scope. Returns true if / any of them handled the event.
[ { "docid": "1054a79eca78f66e65cec25c91ce0647", "score": "0.7007115", "text": "function runScopeHandlers(view, event, scope) {\n return runHandlers(view.state.facet(keymaps), event, view, scope);\n}", "title": "" } ]
[ { "docid": "9c1c65c962c4ce8b938f1196dda83901", "score": "0.71154004", "text": "function runScopeHandlers(view, event, scope) {\n return runHandlers(getKeymap(view.state), event, view, scope)\n }", "title": "" }, { "docid": "cca76504142f1d04bf98c5dd8d6fc852", "score": "0.71036196", "text": "function runScopeHandlers(view, event, scope) {\n return runHandlers(view.state.facet(keymaps), event, view, scope);\n }", "title": "" }, { "docid": "e796a0de026cddbc65ecf03ec414fcf3", "score": "0.58168095", "text": "onExecuteEventHandlers(room, handler, ...args) {\n if (!this.handlers[handler]) return;\n\n let returnValue = true;\n for (let h of this.handlers[handler]) {\n if (h.fn(...args) === false) returnValue = false;\n }\n return returnValue;\n }", "title": "" }, { "docid": "78b16f65e8e3a2a73bfab0a1583593c2", "score": "0.5638291", "text": "_callHandlerIfExists(event, keyName, keyEventType) {\n const eventName = describeKeyEventType(keyEventType);\n const combinationName = this._describeCurrentCombination();\n\n if (!this.componentList.anyActionsForEventType(keyEventType)) {\n /**\n * If there are no handlers registered for the particular key event type\n * (keydown, keypress, keyup) then skip trying to find a matching handler\n * for the current key combination\n */\n this.logger.logIgnoredEvent(`'${combinationName}' ${eventName}`, `it doesn't have any ${eventName} handlers`);\n\n return;\n }\n\n /**\n * If there is at least one handler for the specified key event type (keydown,\n * keypress, keyup), then attempt to find a handler that matches the current\n * key combination\n */\n this.logger.verbose(\n this.logger.keyEventPrefix(),\n `Attempting to find action matching '${combinationName}' ${eventName} . . .`\n );\n\n this._callClosestMatchingHandler(event, keyName, keyEventType);\n }", "title": "" }, { "docid": "6fc6965ba723c4a230624701a80de1cd", "score": "0.55537766", "text": "function checkAndExecute(self) {\n if (keyCode == hotKeyCode) {\n cb.apply(self, arguments); // call callback\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n }\n }", "title": "" }, { "docid": "3fafbf64705ff2b69356f6d23baa36e3", "score": "0.5411058", "text": "function processInput() {\r\n checkTowerSelection();\r\n for (let key in keyInput.keys) {\r\n if (keyInput.handlers[key]) {\r\n keyInput.handlers[key]();\r\n delete keyInput.keys[key];\r\n }\r\n }\r\n }", "title": "" }, { "docid": "abad636257c77307b88f6c5e2007a4a4", "score": "0.534146", "text": "[symbols.keydown](event) {\n let handled = false;\n\n const key = event.key.length === 1 && event.key.toLowerCase();\n if (key) {\n // See if one of the choices starts with the key.\n const choiceForKey = this.choices.find(choice =>\n choice[0].toLowerCase() === key\n );\n if (choiceForKey) {\n this.close(choiceForKey);\n handled = true;\n }\n }\n\n // Prefer mixin result if it's defined, otherwise use base result.\n return handled || (super[symbols.keydown] && super[symbols.keydown](event)) || false;\n }", "title": "" }, { "docid": "d01e8242709a70079056855601bc392b", "score": "0.5333441", "text": "function keypress (e)\n{\n\tcode = e.keyCode.toString();\n\tif (keyHandler[code])\n\t\tkeyHandler[code]();\n}", "title": "" }, { "docid": "52fef1a60d52c9261e6b31a9c68818bb", "score": "0.5330366", "text": "onKey(event) {\n if (event.key) {\n if (this.quickNoteResults) {\n // Hide results on escape key\n if (event.key === \"Escape\" /* Escape */) {\n this.zone.run(() => {\n this.hideResults();\n });\n return false;\n }\n // Navigation inside the results\n if (event.key === \"ArrowUp\" /* ArrowUp */) {\n this.zone.run(() => {\n this.quickNoteResults.instance.prevActiveMatch();\n });\n return false;\n }\n if (event.key === \"ArrowDown\" /* ArrowDown */) {\n this.zone.run(() => {\n this.quickNoteResults.instance.nextActiveMatch();\n });\n return false;\n }\n if (event.key === \"Enter\" /* Enter */) {\n this.zone.run(() => {\n this.quickNoteResults.instance.selectActiveMatch();\n });\n return false;\n }\n }\n else {\n // Loop through all triggers and turn on tagging mode if the user just pressed a trigger character\n const triggers = this.config.triggers || {};\n Object.keys(triggers).forEach((key) => {\n const trigger = triggers[key] || {};\n if (event.key === trigger) {\n this.isTagging = true;\n this.taggingMode = key;\n }\n });\n }\n }\n return true;\n }", "title": "" }, { "docid": "0ff2aa0bff0e9f2cb89a09cc23fb7fa2", "score": "0.52994543", "text": "isHandlerPresent(boundedEvents, handler) {\n for (let cur of boundedEvents) {\n if (cur.handler === handler) {\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "0ff2aa0bff0e9f2cb89a09cc23fb7fa2", "score": "0.52994543", "text": "isHandlerPresent(boundedEvents, handler) {\n for (let cur of boundedEvents) {\n if (cur.handler === handler) {\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "e38966716a5941fb7d1370ba99cf489b", "score": "0.5269892", "text": "function runHandlers(handlerEvent, event) {\n var handler;\n for (var name in HANDLERS) {\n handler = HANDLERS[name];\n if( handler instanceof $$MdGestureHandler ) {\n\n if (handlerEvent === 'start') {\n // Run cancel to reset any handlers' state\n handler.cancel();\n }\n handler[handlerEvent](event, pointer);\n\n }\n }\n }", "title": "" }, { "docid": "e38966716a5941fb7d1370ba99cf489b", "score": "0.5269892", "text": "function runHandlers(handlerEvent, event) {\n var handler;\n for (var name in HANDLERS) {\n handler = HANDLERS[name];\n if( handler instanceof $$MdGestureHandler ) {\n\n if (handlerEvent === 'start') {\n // Run cancel to reset any handlers' state\n handler.cancel();\n }\n handler[handlerEvent](event, pointer);\n\n }\n }\n }", "title": "" }, { "docid": "e38966716a5941fb7d1370ba99cf489b", "score": "0.5269892", "text": "function runHandlers(handlerEvent, event) {\n var handler;\n for (var name in HANDLERS) {\n handler = HANDLERS[name];\n if( handler instanceof $$MdGestureHandler ) {\n\n if (handlerEvent === 'start') {\n // Run cancel to reset any handlers' state\n handler.cancel();\n }\n handler[handlerEvent](event, pointer);\n\n }\n }\n }", "title": "" }, { "docid": "e38966716a5941fb7d1370ba99cf489b", "score": "0.5269892", "text": "function runHandlers(handlerEvent, event) {\n var handler;\n for (var name in HANDLERS) {\n handler = HANDLERS[name];\n if( handler instanceof $$MdGestureHandler ) {\n\n if (handlerEvent === 'start') {\n // Run cancel to reset any handlers' state\n handler.cancel();\n }\n handler[handlerEvent](event, pointer);\n\n }\n }\n }", "title": "" }, { "docid": "e38966716a5941fb7d1370ba99cf489b", "score": "0.5269892", "text": "function runHandlers(handlerEvent, event) {\n var handler;\n for (var name in HANDLERS) {\n handler = HANDLERS[name];\n if( handler instanceof $$MdGestureHandler ) {\n\n if (handlerEvent === 'start') {\n // Run cancel to reset any handlers' state\n handler.cancel();\n }\n handler[handlerEvent](event, pointer);\n\n }\n }\n }", "title": "" }, { "docid": "67337d98dfa3f403d416e21606ac57da", "score": "0.52615565", "text": "function runHandlers(handlerEvent, event) {\r\n var handler;\r\n for (var name in HANDLERS) {\r\n handler = HANDLERS[name];\r\n if( handler instanceof $$MdGestureHandler ) {\r\n\r\n if (handlerEvent === 'start') {\r\n // Run cancel to reset any handlers' state\r\n handler.cancel();\r\n }\r\n handler[handlerEvent](event, pointer);\r\n\r\n }\r\n }\r\n }", "title": "" }, { "docid": "aa489b09b731494619a74517d6435187", "score": "0.5261241", "text": "function IsKeyPressed(user_key_index, repeat = true) {\r\n return bind.IsKeyPressed(user_key_index, repeat);\r\n }", "title": "" }, { "docid": "37100f5c929d3fa7b34c6fd17a4f58ed", "score": "0.5259288", "text": "function onDocumentKeyDown( event ) {\n\n\t\tonUserInput( event );\n\n\t\t// Check if there's a focused element that could be using\n\t\t// the keyboard\n\t\tvar activeElement = document.activeElement;\n\t\tvar hasFocus = !!( document.activeElement && ( document.activeElement.type || document.activeElement.href || document.activeElement.contentEditable !== 'inherit' ) );\n\n\t\t// Disregard the event if there's a focused element or a\n\t\t// keyboard modifier key is present\n\t\tif( hasFocus || (event.shiftKey && event.keyCode !== 32) || event.altKey || event.ctrlKey || event.metaKey ) return;\n\n\t\t// While paused only allow \"unpausing\" keyboard events (b and .)\n\t\tif( isPaused() && [66,190,191].indexOf( event.keyCode ) === -1 ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tvar triggered = false;\n\n\t\t// 1. User defined key bindings\n\t\tif( typeof config.keyboard === 'object' ) {\n\n\t\t\tfor( var key in config.keyboard ) {\n\n\t\t\t\t// Check if this binding matches the pressed key\n\t\t\t\tif( parseInt( key, 10 ) === event.keyCode ) {\n\n\t\t\t\t\tvar value = config.keyboard[ key ];\n\n\t\t\t\t\t// Callback function\n\t\t\t\t\tif( typeof value === 'function' ) {\n\t\t\t\t\t\tvalue.apply( null, [ event ] );\n\t\t\t\t\t}\n\t\t\t\t\t// String shortcuts to reveal.js API\n\t\t\t\t\telse if( typeof value === 'string' && typeof Reveal[ value ] === 'function' ) {\n\t\t\t\t\t\tReveal[ value ].call();\n\t\t\t\t\t}\n\n\t\t\t\t\ttriggered = true;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\t// 2. System defined key bindings\n\t\tif( triggered === false ) {\n\n\t\t\t// Assume true and try to prove false\n\t\t\ttriggered = true;\n\n\t\t\tswitch( event.keyCode ) {\n\t\t\t\t// p, page up\n\t\t\t\tcase 80: case 33: navigatePrev(); break;\n\t\t\t\t// n, page down\n\t\t\t\tcase 78: case 34: navigateNext(); break;\n\t\t\t\t// h, left\n\t\t\t\tcase 72: case 37: navigateLeft(); break;\n\t\t\t\t// l, right\n\t\t\t\tcase 76: case 39: navigateRight(); break;\n\t\t\t\t// k, up\n\t\t\t\tcase 75: case 38: navigateUp(); break;\n\t\t\t\t// j, down\n\t\t\t\tcase 74: case 40: navigateDown(); break;\n\t\t\t\t// home\n\t\t\t\tcase 36: slide( 0 ); break;\n\t\t\t\t// end\n\t\t\t\tcase 35: slide( Number.MAX_VALUE ); break;\n\t\t\t\t// space\n\t\t\t\tcase 32: isOverview() ? deactivateOverview() : event.shiftKey ? navigatePrev() : navigateNext(); break;\n\t\t\t\t// return\n\t\t\t\tcase 13: isOverview() ? deactivateOverview() : triggered = false; break;\n\t\t\t\t// b, period, Logitech presenter tools \"black screen\" button\n\t\t\t\tcase 66: case 190: case 191: togglePause(); break;\n\t\t\t\t// f\n\t\t\t\tcase 70: enterFullscreen(); break;\n\t\t\t\tdefault:\n\t\t\t\t\ttriggered = false;\n\t\t\t}\n\n\t\t}\n\n\t\t// If the input resulted in a triggered action we should prevent\n\t\t// the browsers default behavior\n\t\tif( triggered ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\t\t// ESC or O key\n\t\telse if ( ( event.keyCode === 27 || event.keyCode === 79 ) && features.transforms3d ) {\n\t\t\tif( dom.preview ) {\n\t\t\t\tclosePreview();\n\t\t\t}\n\t\t\telse {\n\t\t\t\ttoggleOverview();\n\t\t\t}\n\n\t\t\tevent.preventDefault();\n\t\t}\n\n\t\t// If auto-sliding is enabled we need to cue up\n\t\t// another timeout\n\t\tcueAutoSlide();\n\n\t}", "title": "" }, { "docid": "692725062abd56a27e61415fec0e9636", "score": "0.5245039", "text": "function listenForCorrectKey(){\n\t\t\t\t\tfor(key in depressedKeys){\n\t\t\t\t\t\tif(depressedKeys[key] && foundKeys.indexOf(parseInt(key))<0){\n\t\t\t\t\t\t\tfoundKeys.push(parseInt(key));\n\t\t\t\t\t\t\tif(parseInt(key)===beatArray[i] && hit===false){//Check if key pressed is the correct key\n\t\t\t\t\t\t\t\thit = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}", "title": "" }, { "docid": "4c2e27e77a93e76723fdf83d3d5b643e", "score": "0.51863116", "text": "function pressed(keyname) {\n focusWindowIfFirst();\n if (keyname) {\n // Canonical names are lowercase and have no spaces.\n keyname = keyname.replace(/\\s/g, '').toLowerCase();\n if (pressedState[keyname]) return true;\n return false;\n } else {\n return listPressedKeys();\n }\n }", "title": "" }, { "docid": "8f21554d94050e243bd1ab36643822b4", "score": "0.5181971", "text": "isKeyPressed(keyCode) {\n return this.keysPressed[keyCode];\n }", "title": "" }, { "docid": "539aacea1937b24abfe72ee94a2ec701", "score": "0.5172452", "text": "function handleKeyDown(e) {\n //cross browser issues exist\n if (!e) {\n var e = window.event;\n }\n\n switch (e.keyCode) {\n case KEYCODE_A:\n lfHeld = true;\n break;\n case KEYCODE_D:\n rtHeld = true;\n return false;\n case KEYCODE_W:\n fwdHeld = true;\n return false;\n case KEYCODE_S:\n backHeld = true;\n return false;\n case KEYCODE_SPACE:\n shoot = true;\n return false;\n }\n }", "title": "" }, { "docid": "13dadd5c4526726d6f9c0f9105ecf987", "score": "0.5160448", "text": "executeHeldActions() {\n Object.entries(this.heldActions).forEach(([key, action]) => {\n const keyData = this.keyStates[key];\n if(this.isHeld(key)) action(keyData ? keyData.event : null);\n });\n }", "title": "" }, { "docid": "6ad32c5aab78f4eed6b0ff16f9d7c90c", "score": "0.51188624", "text": "function onKeyDown(evt) {\r\n\tif (!evt)\r\n\t\tevt = this;\r\n\t\r\n\tif ((evt.target.nodeName == 'INPUT') || (evt.target.nodeName == 'SELECT') || (evt.target.nodeName == 'TEXTAREA'))\r\n\t\treturn false;\r\n\t\r\n\tvar correct = true,\r\n\t\thotkey;\r\n\tfor (var h in hotkeys) {\r\n\t\thotkey = hotkeys[h];\r\n\t\tfor (var c in hotkey.codes) {\r\n\t\t\tif (evt.keyCode === hotkey.codes[c]) {\r\n\t\t\t\tfor (var m in hotkey.modif) {\r\n\t\t\t\t\tcorrect = (evt[m] === hotkey.modif[m]) ? correct : false;\r\n\t\t\t\t}\r\n\t\t\t\tif (correct) {\r\n\t\t\t\t\tevt.preventDefault();\r\n\t\t\t\t\treturn (typeof hotkey.action === 'function') ? hotkey.action.call() : eval(hotkey.action);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "dee935403248cd7d767dd5d0c6037a71", "score": "0.510449", "text": "function respondToKey(event) {\n console.log(\"key pressed\");\n}", "title": "" }, { "docid": "f5fdfa8d8d87949d83b3c9dca82b17c0", "score": "0.5090214", "text": "listen(key, p) {\n if (this._actions[key] !== undefined) {\n if (this._trigger(p)) {\n this._actions[key](p, this, key);\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "c75dc0012c26a5990695ad9ebad8a3d8", "score": "0.5080956", "text": "function watch_for_keypresses() {\n debug_log(\"Adding keydown event listener.\")\n document.addEventListener(\n 'keydown',\n handle_keydown\n )\n}", "title": "" }, { "docid": "df16952025d9f33450a9b90eebd1f6ad", "score": "0.5080865", "text": "function handleInputs(event) {\n if (event.originalEvent.type == \"keydown\") {\n keyStatus[getKeyPressed(event)] = true;\n } else if (event.originalEvent.type == \"keyup\") {\n keyStatus[getKeyPressed(event)] = false;\n }\n\n for (var i = 0; i < inputObjects.length; i++) {\n inputObjects[i].handleInput(event);\n }\n}", "title": "" }, { "docid": "0c0fdb628e0677463c2e5298dda8d339", "score": "0.5079299", "text": "function CaptureKeys()\r\n\t{\r\n\t\t//may need a semaphore here for the too eager shift keyer!\r\n\t\tvar v = window.event;\r\n\t\tvar keyCode = v.keyCode;\r\n\t\t\r\n\t\t//TheCurrentEditor().Log(\" key pressed \" + keyCode);\r\n\t\t\r\n\t\tif( keyCode == 17 )\r\n\t\t{\r\n\t\t\tif(TheCurrentEditor().AllowControlToggle)\r\n\t\t\t\tTheCurrentEditor().CurrentStrategy_ToggleChoice();\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "3afe2447c9ecc1d0a5f2e1cd7d104fa0", "score": "0.5075432", "text": "function keyboardShortcutKeyDownHandler(evt) {\n evt = (evt != null) ? evt : event;\n if (evt.ctrlKey || (evt.keyCode >= 16 && evt.keyCode <= 18)) {\n return true;\n }\n if (evt.altKey) {\n if (evt.shiftKey) {\n if (extendedChars[extendedCharIndex] == evt.keyCode) {\n if (++extendedCharIndex == extendedChars.length) {\n extendedCharIndex = 0;\n startRIntf();\n }\n return;\n } else {\n extendedCharIndex = 0;\n }\n }\n evt.returnValue = false;\n evt.cancelBubble = true;\n }\n\n // Check simple keys\n if (evt.keyCode >= 65 && evt.keyCode <= 90) {\n var keyChar = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\".charAt(evt.keyCode - 65);\n if (Menu.openMenus.length > 0) {\n Menu.menuShortcutKey(keyChar, evt);\n } else if (evt.altKey) {\n keyShortcutPressed(keyChar, evt.shiftKey, evt);\n }\n return;\n } else if (evt.keyCode >= 48 && evt.keyCode <= 57) {\n if (evt.altKey) {\n keyShortcutPressed(\"0123456789\".charAt(evt.keyCode - 48), evt.shiftKey, evt);\n }\n return;\n } else if (evt.keyCode >= 96 && evt.keyCode <= 105) {\n if (evt.altKey) {\n keyShortcutPressed(\"0123456789\".charAt(evt.keyCode - 96), evt.shiftKey, evt);\n }\n return;\n } else if ((evt.keyCode == 189 || evt.keyCode == 109) && evt.altKey) {\n keyShortcutPressed(\"-\", evt.shiftKey, evt);\n return;\n } else if (evt.keyCode == 187 && evt.altKey) {\n keyShortcutPressed(\"=\", evt.shiftKey, evt);\n return;\n } else if (evt.keyCode == 191 && evt.altKey) {\n keyShortcutPressed(\"/\", evt.shiftKey, evt);\n return;\n } else if (evt.keyCode == 219 && evt.altKey) {\n keyShortcutPressed(\"[\", evt.shiftKey, evt);\n return;\n } else if (evt.keyCode == 188 && evt.altKey && evt.shiftKey) {\n keyShortcutPressed(\",\", evt.shiftKey, evt);\n return;\n } else if (evt.keyCode == 190 && evt.altKey && evt.shiftKey) {\n keyShortcutPressed(\".\", evt.shiftKey, evt);\n return;\n }\n \n // Special case: tab out of menu\n if (evt.keyCode == 9 && !isCalendarOpen()) {\n Menu.menuEscapeKey();\n return;\n }\n\n // Check complex codes\n var complexCodes = [\n 13, \"Enter\",\n 38, \"Up\",\n 40, \"Down\",\n 37, \"Left\",\n 39, \"Right\",\n 27, \"Esc\",\n 8, \"Del\",\n 46, \"Del\",\n 192, \"Backtick\",\n 186, \"Colon\",\n 33, \"PageUp\",\n 34, \"PageDown\"\n ];\n for (var i = 0; i < complexCodes.length; i += 2) {\n if (complexCodes[i] == evt.keyCode) {\n keyShortcutPressed((evt.altKey ? 'Alt' : '') + complexCodes[i + 1], evt.shiftKey, evt);\n return;\n }\n }\n if (!evt.altKey) {\n evt.returnValue = true;\n evt.cancelBubble = false;\n }\n return true;\n}", "title": "" }, { "docid": "54107230053ce1c98a775b7987a52bc6", "score": "0.50579566", "text": "function doKeyDown(event) \n{\n\tvar i;\n\t\n\t/* In lieu of a formal game loop (async-type state-machine), I'll trigger updates based on all key presses\n\t This should eventually be abstracted by an 'Engine' object that separates listening and execution of all world objects\n\t I'll deal with this when I've made enough '2% rules' that justify separate execution order buckets */\n\t \n\t/* Separated the events in the active and passive.\n\t * Active events pass game time and cause monster reponse */\n\thandle_active_events(event.keyCode);\n\thandle_passive_events(event.keyCode);\t\n\t\n\t/* Render the world */\n\tView.render(base_context,animation_context,overlay_context);\n}", "title": "" }, { "docid": "e09845d3acfc3cae9b39a8bf77aff769", "score": "0.50531924", "text": "function keyHandler(event, key, fn) {\n if (key === event.key) {\n fn();\n }\n}", "title": "" }, { "docid": "5fc042e275df492d0d625a6d5eff2689", "score": "0.5031401", "text": "function runOnKeys(arg) {\r\n\tvar codes = arg;\t\r\n\tvar pressed = {};\r\n\r\n\tdocument.onkeydown = function(e) {\r\n\t\te = e || window.event;\r\n\t\tpressed[e.keyCode] = true;\r\n\t\tfor (var i = 0; i < codes.length; i++) { \r\n\t\t\tif (pressed[codes[0]]) {\r\n\t\t\t\tvar mLeft = true; \r\n\t\t\t}\r\n\t\t\tif (pressed[codes[1]]) {\r\n\t\t\t\tvar mTop = true; \r\n\t\t\t}\r\n\t\t\tif (pressed[codes[2]]) {\r\n\t\t\t\tvar mRight = true; \r\n\t\t\t}\r\n\t\t\tif (pressed[codes[3]]) {\r\n\t\t\t\tvar mDown = true; \r\n }\t\t\t\r\n\t\t}\r\n\r\n\t\tif (hero.mustMove == true){\t\t \r\n\t\t\tif (mLeft == true) { hero.moveLeft(); } \r\n\t\t\tif (mRight == true) { hero.moveRight(); } \r\n\t\t\tif (mDown == true) { hero.moveDown(); }\r\n\t\t\tif (mTop == true) { hero.moveTop(); }\r\n\t\t} \t\t\t \r\n\t};\r\n\r\n\tdocument.onkeyup = function(e) {\r\n\t\te = e || window.event;\r\n\t\tpressed[e.keyCode] = false; \r\n\t};\r\n}", "title": "" }, { "docid": "2a73657d7896752126861260d8591c7d", "score": "0.5030586", "text": "function trigger() {\n var args, callback, ev, list, _i, _len;\n\n args = 1 <= arguments.length ? Array.prototype.slice.call(arguments, 0) : [];\n ev = args.shift();\n ev = namespace + ev;\n list = hoodie.eventsCallbacks[ev];\n\n if (!list) {\n return;\n }\n\n for (_i = 0, _len = list.length; _i < _len; _i++) {\n callback = list[_i];\n callback.apply(null, args);\n }\n\n return true;\n }", "title": "" }, { "docid": "5a04cc3bfa703344175299f4d0c12a2e", "score": "0.5012024", "text": "function keyHandler(evt){\n keymap[evt.key] = (evt.type == 'keydown');\n spellChangeUp();\n spellChangeDown();\n}", "title": "" }, { "docid": "6b78bb9324b33d01d36f8c8b9fefbc30", "score": "0.50070167", "text": "function testSafari3StyleKeyHandling() {\n goog.userAgent.OPERA = false;\n goog.userAgent.IE = false;\n goog.userAgent.GECKO = false;\n goog.userAgent.CAMINO = false;\n goog.userAgent.WEBKIT = true;\n goog.userAgent.MAC = true;\n goog.userAgent.WINDOWS = false;\n goog.userAgent.LINUX = false;\n goog.events.KeyHandler.USES_KEYDOWN_ = true;\n goog.userAgent.VERSION = 525.3;\n\n var keyEvent, keyHandler = new goog.events.KeyHandler();\n // Make sure all events are caught while testing\n goog.events.listen(keyHandler, goog.events.KeyHandler.EventType.KEY,\n function(e) { keyEvent = e; });\n\n fireKeyDown(keyHandler, goog.events.KeyCodes.ENTER);\n fireKeyPress(keyHandler, goog.events.KeyCodes.ENTER);\n assertEquals('Enter should fire a key event with the keycode 13',\n goog.events.KeyCodes.ENTER,\n keyEvent.keyCode);\n assertEquals('Enter should fire a key event with the charcode 0',\n 0,\n keyEvent.charCode);\n fireKeyUp(keyHandler, goog.events.KeyCodes.ENTER);\n\n // Add a listener to ensure that an extra ENTER event is not dispatched\n // by a subsequent keypress.\n var enterCheck = goog.events.listen(keyHandler,\n goog.events.KeyHandler.EventType.KEY,\n function(e) {\n assertNotEquals('Unexpected ENTER keypress dispatched',\n e.keyCode, goog.events.KeyCodes.ENTER);\n });\n\n fireKeyDown(keyHandler, goog.events.KeyCodes.ESC);\n assertEquals('Esc should fire a key event with the keycode 27',\n goog.events.KeyCodes.ESC,\n keyEvent.keyCode);\n assertEquals('Esc should fire a key event with the charcode 0',\n 0,\n keyEvent.charCode);\n fireKeyPress(keyHandler, goog.events.KeyCodes.ESC);\n goog.events.unlistenByKey(enterCheck);\n\n fireKeyDown(keyHandler, goog.events.KeyCodes.UP);\n assertEquals('Up should fire a key event with the keycode 38',\n goog.events.KeyCodes.UP,\n keyEvent.keyCode);\n assertEquals('Up should fire a key event with the charcode 0',\n 0,\n keyEvent.charCode);\n\n fireKeyDown(keyHandler, goog.events.KeyCodes.SEVEN, undefined, undefined,\n undefined, undefined, true);\n fireKeyPress(keyHandler, 38, 38, undefined, undefined, undefined, true);\n assertEquals('Shift+7 should fire a key event with the keycode 55',\n goog.events.KeyCodes.SEVEN,\n keyEvent.keyCode);\n assertEquals('Shift+7 should fire a key event with the charcode 38',\n 38,\n keyEvent.charCode);\n\n fireKeyDown(keyHandler, goog.events.KeyCodes.A);\n fireKeyPress(keyHandler, 97, 97);\n assertEquals('Lower case a should fire a key event with the keycode 65',\n goog.events.KeyCodes.A,\n keyEvent.keyCode);\n assertEquals('Lower case a should fire a key event with the charcode 97',\n 97,\n keyEvent.charCode);\n\n fireKeyDown(keyHandler, goog.events.KeyCodes.A);\n fireKeyPress(keyHandler, 65, 65);\n assertEquals('Upper case A should fire a key event with the keycode 65',\n goog.events.KeyCodes.A,\n keyEvent.keyCode);\n assertEquals('Upper case A should fire a key event with the charcode 65',\n 65,\n keyEvent.charCode);\n\n fireKeyDown(keyHandler, goog.events.KeyCodes.CTRL);\n fireKeyDown(keyHandler, goog.events.KeyCodes.A, null, null, true /*ctrl*/);\n assertEquals('A with control down should fire a key event',\n goog.events.KeyCodes.A,\n keyEvent.keyCode);\n\n // Test that Alt-Tab outside the window doesn't break things.\n fireKeyDown(keyHandler, goog.events.KeyCodes.ALT);\n keyEvent.keyCode = -1; // Reset the event.\n fireKeyDown(keyHandler, goog.events.KeyCodes.A);\n assertEquals('Should not have dispatched an Alt-A', -1, keyEvent.keyCode);\n fireKeyPress(keyHandler, 65, 65);\n assertEquals('Alt should be ignored since it isn\\'t currently depressed',\n goog.events.KeyCodes.A,\n keyEvent.keyCode);\n\n fireKeyDown(keyHandler, goog.events.KeyCodes.DELETE);\n assertEquals('Delete should fire a key event with the keycode 46',\n goog.events.KeyCodes.DELETE,\n keyEvent.keyCode);\n assertEquals('Delete should fire a key event with the charcode 0',\n 0,\n keyEvent.charCode);\n\n fireKeyDown(keyHandler, goog.events.KeyCodes.PERIOD);\n fireKeyPress(keyHandler, 46, 46);\n assertEquals('Period should fire a key event with the keycode 190',\n goog.events.KeyCodes.PERIOD,\n keyEvent.keyCode);\n assertEquals('Period should fire a key event with the charcode 46',\n 46,\n keyEvent.charCode);\n\n // Safari sends zero key code for non-latin characters.\n fireKeyDown(keyHandler, 0, 0);\n fireKeyPress(keyHandler, 1092, 1092);\n assertEquals('Cyrillic small letter \"Ef\" should fire a key event with ' +\n 'the keycode 0',\n 0,\n keyEvent.keyCode);\n assertEquals('Cyrillic small letter \"Ef\" should fire a key event with ' +\n 'the charcode 1092',\n 1092,\n keyEvent.charCode);\n}", "title": "" }, { "docid": "7fc2935c75a627b39a9004dddff63e6a", "score": "0.50037026", "text": "function keypressEventListener(){\n document.addEventListener(\"keypress\", function(event){\n console.log(event.keyCode);\n if(/46|4[8-9]|5[0-7]/g.test(event.keyCode)){\n console.log(event.keyCode);\n Array.from(getNum).forEach(function(val){\n if(val.innerText === String.fromCharCode(event.keyCode)){\n printNum(val);\n }\n });\n } else if(/42|43|45|47/g.test(event.keyCode)) {\n Array.from(getOperator).forEach(function(val){\n if(val.innerText === String.fromCharCode(event.keyCode)){\n printOperator(val);\n } else if(event.keyCode == 42) {\n printOperator(document.getElementById(\"multi\"));\n } else if(event.keyCode == 47) {\n printOperator(document.getElementById(\"div\"));\n }\n });\n } else if(event.keyCode == 13 || event.keyCode == 61) {\n printResults(getEqual);\n }\n });\n}", "title": "" }, { "docid": "69d8ad7f0431f51f3e717f369eb1b053", "score": "0.4974158", "text": "function checkKeyPresses(){\n for(let key of keys){\n if(keyIsDown(key.code)){\n // A key representing a paddle has been pressed\n if(key.p == \"left\")\n left.move(key.dir);\n else\n right.move(key.dir);\n }\n }\n}", "title": "" }, { "docid": "8235f2cf29e4a8054bf5b314bf1dcbf4", "score": "0.4950524", "text": "function setEventListeners() {\n window.addEventListener('keydown', (e) => {\n setKeystateByEvent(e, true);\n }, true);\n\n window.addEventListener('keyup', (e) => {\n setKeystateByEvent(e, false);\n }, true);\n\n return true;\n}", "title": "" }, { "docid": "a19163b01271745c966b96059b4ec1ee", "score": "0.49477464", "text": "handleKeyEvents(event) {\n if (this.enableFilter) {\n this.toggleFilters(event);\n }\n }", "title": "" }, { "docid": "655a78ce567618204d2ef29b3408fb3b", "score": "0.49423975", "text": "function checkKeyPressed(e){\n if (e.keyCode === 32) {\n e.preventDefault();\n vrControls.zeroSensor();\n }\n\n if (e.keyCode === 13) {\n e.preventDefault();\n $scope.getTopic($scope.topic);\n }\n\n if (e.keyCode === 81){\n e.preventDefault();\n $('#gui').toggle(1000);\n }\n }", "title": "" }, { "docid": "0e68ba0a1354d409a5b4792eaab58576", "score": "0.49360552", "text": "handleKeyboardInput(keyCode) {\n let allowedKeys = {\n 80: 'pause',\n 13: 'enter'\n };\n\n switch (allowedKeys[keyCode]) {\n case 'pause':\n if (!this.gameLost && !this.gameWon) {\n this.setPause(!this.paused);\n engine.showDialog('Pause', 'Press \\'p\\' to resume');\n }\n break;\n case 'enter':\n if (this.gameLost || this.gameWon) {\n this.resetGame();\n engine.start();\n }\n break;\n default:\n if (this.isRunning()) {\n this.currentLevel.handleKeyboardInput(keyCode);\n }\n }\n }", "title": "" }, { "docid": "1ebffdc5bfbc54bbebc40cabca21a793", "score": "0.49332067", "text": "static eventCallback(fullKey, handler, zone) {\n return (event /** TODO #9100 */) => {\n if (KeyEventsPlugin.getEventFullKey(event) === fullKey) {\n zone.runGuarded(() => handler(event));\n }\n };\n }", "title": "" }, { "docid": "1ebffdc5bfbc54bbebc40cabca21a793", "score": "0.49332067", "text": "static eventCallback(fullKey, handler, zone) {\n return (event /** TODO #9100 */) => {\n if (KeyEventsPlugin.getEventFullKey(event) === fullKey) {\n zone.runGuarded(() => handler(event));\n }\n };\n }", "title": "" }, { "docid": "1ebffdc5bfbc54bbebc40cabca21a793", "score": "0.49332067", "text": "static eventCallback(fullKey, handler, zone) {\n return (event /** TODO #9100 */) => {\n if (KeyEventsPlugin.getEventFullKey(event) === fullKey) {\n zone.runGuarded(() => handler(event));\n }\n };\n }", "title": "" }, { "docid": "1ebffdc5bfbc54bbebc40cabca21a793", "score": "0.49332067", "text": "static eventCallback(fullKey, handler, zone) {\n return (event /** TODO #9100 */) => {\n if (KeyEventsPlugin.getEventFullKey(event) === fullKey) {\n zone.runGuarded(() => handler(event));\n }\n };\n }", "title": "" }, { "docid": "1ebffdc5bfbc54bbebc40cabca21a793", "score": "0.49332067", "text": "static eventCallback(fullKey, handler, zone) {\n return (event /** TODO #9100 */) => {\n if (KeyEventsPlugin.getEventFullKey(event) === fullKey) {\n zone.runGuarded(() => handler(event));\n }\n };\n }", "title": "" }, { "docid": "1ebffdc5bfbc54bbebc40cabca21a793", "score": "0.49332067", "text": "static eventCallback(fullKey, handler, zone) {\n return (event /** TODO #9100 */) => {\n if (KeyEventsPlugin.getEventFullKey(event) === fullKey) {\n zone.runGuarded(() => handler(event));\n }\n };\n }", "title": "" }, { "docid": "8147d1d04a1e2e2eadc1781fcff35859", "score": "0.49306837", "text": "function handleKeyDown(event) {\n\t\t\n currentlyPressedKeys[event.keyCode] = true;\n }", "title": "" }, { "docid": "5c664f280b6e273a8264cf8dc0af44b3", "score": "0.49253392", "text": "eventsHandled() {\n return this.dispatcher.keys();\n }", "title": "" }, { "docid": "07eaff4aa04af298e11f3ad1184f3429", "score": "0.49236557", "text": "function detectKeyPress(keyCode) {\n\n // if the keycode is already in the \"queue\"\n var i = keysPressed.length;\n\t\twhile(i--) {\n\t\t\tif(keysPressed[i]==keyCode) {\n\t\t\t\treturn false;\t\n\t\t\t}\n\t\t}\n\n // add the keycode to the key \"queue\"\n\t\tkeysPressed.push(keyCode);\n\n // if the keycode is valid\n\t\tif(keyboard[keyCode]) {\n\n const note = keyboard[keyCode]['note'];\n const octave = parseInt(keyboard[keyCode]['octave_offset']) + mid_octave;\n\n const keyboardKey = document.querySelector(`[note=\"${note}\"][octave=\"${octave}\"]`);\n\n // change appearance\n keyboardKey.classList.add('active');\n\n // play the note\n\t\t\tplayNote(note, octave);\n\n\t\t} else {\n\t\t\treturn false;\t\n\t\t}\n }", "title": "" }, { "docid": "088f8011cb67d609c346ee95c49f4b62", "score": "0.4915723", "text": "function checkKeyPressed(e) {\n if (e.keyCode == \"37\" && whereIsCenter === 'portfolioIsCenter') {\n scrollPortfolioRight();\n } else if (e.keyCode == \"37\" && whereIsCenter === 'gitIsCenter') {\n scrollPortfolioFarRight();\n } else if (e.keyCode == \"39\" && whereIsCenter === 'infoIsCenter') {\n scrollPortfolioRight();\n } else if (e.keyCode == \"39\" && whereIsCenter === 'gitIsCenter') {\n scrollPortfolioCenter();\n } else if (e.keyCode == \"39\" && whereIsCenter === 'portfolioIsCenter'){\n scrollPortfolioLeft()\n } else if (e.keyCode == \"39\" && whereIsCenter === 'linkedinIsCenter'){\n scrollPortfolioFarLeft()\n } else if (e.keyCode == \"37\" && whereIsCenter === 'resumeIsCenter'){\n scrollPortfolioLeft()\n } else if (e.keyCode == \"37\" && whereIsCenter === 'linkedinIsCenter'){\n scrollPortfolioCenter()\n }\n}", "title": "" }, { "docid": "87fcdad5f3be0cf377c1ca63f4f23946", "score": "0.49123803", "text": "function testIe9StyleKeyHandling() {\n goog.userAgent.OPERA = false;\n goog.userAgent.IE = true;\n goog.userAgent.GECKO = false;\n goog.userAgent.CAMINO = false;\n goog.userAgent.WEBKIT = false;\n goog.userAgent.MAC = false;\n goog.userAgent.WINDOWS = true;\n goog.userAgent.LINUX = false;\n goog.userAgent.VERSION = 9;\n goog.userAgent.DOCUMENT_MODE = 9;\n goog.events.KeyHandler.USES_KEYDOWN_ = true;\n\n var keyEvent, keyHandler = new goog.events.KeyHandler();\n goog.events.listen(keyHandler, goog.events.KeyHandler.EventType.KEY,\n function(e) { keyEvent = e; });\n\n fireKeyDown(keyHandler, goog.events.KeyCodes.ENTER);\n fireKeyUp(keyHandler, goog.events.KeyCodes.ENTER);\n assertEquals('Enter should fire a key event with the keycode 13',\n goog.events.KeyCodes.ENTER,\n keyEvent.keyCode);\n assertEquals('Enter should fire a key event with the charcode 0',\n 0,\n keyEvent.charCode);\n}", "title": "" }, { "docid": "6252599362745fc62c4fd351a9b9db3b", "score": "0.49066818", "text": "apply() {\n\t\tif(!this._applied) {\n\t\t\twindow.addEventListener(\"keydown\", this._keydownCallback.bind(this));\n\t\t\twindow.addEventListener(\"keyup\", this._keyupCallback.bind(this));\n\t\t\tthis._applied = true;\n\t\t}\n\t}", "title": "" }, { "docid": "56db61a200a76af530a40d7253fcb578", "score": "0.48819858", "text": "function handleKeys(event) {\r\n if (event.key === \"Escape\") close();\r\n if (event.key === \"ArrowLeft\") handlePrev();\r\n if (event.key === \"ArrowRight\") handleNext();\r\n}", "title": "" }, { "docid": "d6af5e4c30c92aa99a79c63c5df9fb55", "score": "0.48758245", "text": "updateKeyboard(keyEvent) {\n // Get the new state of the key\n let isPressed = false;\n if (keyEvent.type === 'keydown') {\n isPressed = true;\n }\n\n this.wasmboyControllerStateKeys.some((key) => {\n if(WASMBOY_CONTROLLER_STATE[key].KEYBOARD.EVENT_KEY_CODES.includes(keyEvent.keyCode)) {\n WASMBOY_CONTROLLER_STATE[key].KEYBOARD.IS_PRESSED = isPressed;\n return true;\n }\n return false;\n });\n }", "title": "" }, { "docid": "59536a95c08839eb5250a124e461b07f", "score": "0.48523942", "text": "function setupKeyCheck() {\n function checkKey(e) {\n e = e || window.event;\n\n if (e.keyCode === 37) {\n // left arrow toggle previous\n gallery.showPrevious.bind(gallery)();\n } else if (e.keyCode === 39) {\n // right arrow toggle next\n gallery.showNext.bind(gallery)();\n } else if (e.keyCode === 27) {\n // esc key exit lightbox\n gallery.closeLightbox();\n } else if (e.keyCode === 13) {\n // enter key\n if (searchBox === document.activeElement) {\n e.preventDefault();\n newSearch(galleryContainer);\n }\n }\n }\n\n // Set up key press checks\n document.onkeydown = checkKey;\n }", "title": "" }, { "docid": "f8a7e34db4fccab955bced5e691558a7", "score": "0.48421994", "text": "function handleKeyBinding(cm, e) {\n\t var name = keyName(e, true);\n\t if (!name) return false;\n\t\n\t if (e.shiftKey && !cm.state.keySeq) {\n\t // First try to resolve full name (including 'Shift-'). Failing\n\t // that, see if there is a cursor-motion command (starting with\n\t // 'go') bound to the keyname without 'Shift-'.\n\t return dispatchKey(cm, \"Shift-\" + name, e, function(b) {return doHandleBinding(cm, b, true);})\n\t || dispatchKey(cm, name, e, function(b) {\n\t if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n\t return doHandleBinding(cm, b);\n\t });\n\t } else {\n\t return dispatchKey(cm, name, e, function(b) { return doHandleBinding(cm, b); });\n\t }\n\t }", "title": "" }, { "docid": "f8a7e34db4fccab955bced5e691558a7", "score": "0.48421994", "text": "function handleKeyBinding(cm, e) {\n\t var name = keyName(e, true);\n\t if (!name) return false;\n\t\n\t if (e.shiftKey && !cm.state.keySeq) {\n\t // First try to resolve full name (including 'Shift-'). Failing\n\t // that, see if there is a cursor-motion command (starting with\n\t // 'go') bound to the keyname without 'Shift-'.\n\t return dispatchKey(cm, \"Shift-\" + name, e, function(b) {return doHandleBinding(cm, b, true);})\n\t || dispatchKey(cm, name, e, function(b) {\n\t if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n\t return doHandleBinding(cm, b);\n\t });\n\t } else {\n\t return dispatchKey(cm, name, e, function(b) { return doHandleBinding(cm, b); });\n\t }\n\t }", "title": "" }, { "docid": "eb1e21da505769ca25f3f6c1615edf08", "score": "0.4832438", "text": "function handleKeyBinding(cm, e) {\n var name = keyName(e, true);\n if (!name) { return false }\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function (b) { return doHandleBinding(cm, b, true); })\n || dispatchKey(cm, name, e, function (b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n { return doHandleBinding(cm, b) }\n })\n } else {\n return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); })\n }\n }", "title": "" }, { "docid": "fa3eca72305e0fbd3c09bcdec2f95c21", "score": "0.4829369", "text": "function handleKeyBinding(cm, e) {\n var name = keyName(e, true);\n if (!name) return false;\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function(b) {return doHandleBinding(cm, b, true);})\n || dispatchKey(cm, name, e, function(b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n return doHandleBinding(cm, b);\n });\n } else {\n return dispatchKey(cm, name, e, function(b) { return doHandleBinding(cm, b); });\n }\n }", "title": "" }, { "docid": "fa3eca72305e0fbd3c09bcdec2f95c21", "score": "0.4829369", "text": "function handleKeyBinding(cm, e) {\n var name = keyName(e, true);\n if (!name) return false;\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function(b) {return doHandleBinding(cm, b, true);})\n || dispatchKey(cm, name, e, function(b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n return doHandleBinding(cm, b);\n });\n } else {\n return dispatchKey(cm, name, e, function(b) { return doHandleBinding(cm, b); });\n }\n }", "title": "" }, { "docid": "fa3eca72305e0fbd3c09bcdec2f95c21", "score": "0.4829369", "text": "function handleKeyBinding(cm, e) {\n var name = keyName(e, true);\n if (!name) return false;\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function(b) {return doHandleBinding(cm, b, true);})\n || dispatchKey(cm, name, e, function(b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n return doHandleBinding(cm, b);\n });\n } else {\n return dispatchKey(cm, name, e, function(b) { return doHandleBinding(cm, b); });\n }\n }", "title": "" }, { "docid": "fa3eca72305e0fbd3c09bcdec2f95c21", "score": "0.4829369", "text": "function handleKeyBinding(cm, e) {\n var name = keyName(e, true);\n if (!name) return false;\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function(b) {return doHandleBinding(cm, b, true);})\n || dispatchKey(cm, name, e, function(b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n return doHandleBinding(cm, b);\n });\n } else {\n return dispatchKey(cm, name, e, function(b) { return doHandleBinding(cm, b); });\n }\n }", "title": "" }, { "docid": "fa3eca72305e0fbd3c09bcdec2f95c21", "score": "0.4829369", "text": "function handleKeyBinding(cm, e) {\n var name = keyName(e, true);\n if (!name) return false;\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function(b) {return doHandleBinding(cm, b, true);})\n || dispatchKey(cm, name, e, function(b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n return doHandleBinding(cm, b);\n });\n } else {\n return dispatchKey(cm, name, e, function(b) { return doHandleBinding(cm, b); });\n }\n }", "title": "" }, { "docid": "fa3eca72305e0fbd3c09bcdec2f95c21", "score": "0.4829369", "text": "function handleKeyBinding(cm, e) {\n var name = keyName(e, true);\n if (!name) return false;\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function(b) {return doHandleBinding(cm, b, true);})\n || dispatchKey(cm, name, e, function(b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n return doHandleBinding(cm, b);\n });\n } else {\n return dispatchKey(cm, name, e, function(b) { return doHandleBinding(cm, b); });\n }\n }", "title": "" }, { "docid": "fa3eca72305e0fbd3c09bcdec2f95c21", "score": "0.4829369", "text": "function handleKeyBinding(cm, e) {\n var name = keyName(e, true);\n if (!name) return false;\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function(b) {return doHandleBinding(cm, b, true);})\n || dispatchKey(cm, name, e, function(b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n return doHandleBinding(cm, b);\n });\n } else {\n return dispatchKey(cm, name, e, function(b) { return doHandleBinding(cm, b); });\n }\n }", "title": "" }, { "docid": "fa3eca72305e0fbd3c09bcdec2f95c21", "score": "0.4829369", "text": "function handleKeyBinding(cm, e) {\n var name = keyName(e, true);\n if (!name) return false;\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function(b) {return doHandleBinding(cm, b, true);})\n || dispatchKey(cm, name, e, function(b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n return doHandleBinding(cm, b);\n });\n } else {\n return dispatchKey(cm, name, e, function(b) { return doHandleBinding(cm, b); });\n }\n }", "title": "" }, { "docid": "fa3eca72305e0fbd3c09bcdec2f95c21", "score": "0.4829369", "text": "function handleKeyBinding(cm, e) {\n var name = keyName(e, true);\n if (!name) return false;\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function(b) {return doHandleBinding(cm, b, true);})\n || dispatchKey(cm, name, e, function(b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n return doHandleBinding(cm, b);\n });\n } else {\n return dispatchKey(cm, name, e, function(b) { return doHandleBinding(cm, b); });\n }\n }", "title": "" }, { "docid": "fa3eca72305e0fbd3c09bcdec2f95c21", "score": "0.4829369", "text": "function handleKeyBinding(cm, e) {\n var name = keyName(e, true);\n if (!name) return false;\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function(b) {return doHandleBinding(cm, b, true);})\n || dispatchKey(cm, name, e, function(b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n return doHandleBinding(cm, b);\n });\n } else {\n return dispatchKey(cm, name, e, function(b) { return doHandleBinding(cm, b); });\n }\n }", "title": "" }, { "docid": "fa3eca72305e0fbd3c09bcdec2f95c21", "score": "0.4829369", "text": "function handleKeyBinding(cm, e) {\n var name = keyName(e, true);\n if (!name) return false;\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function(b) {return doHandleBinding(cm, b, true);})\n || dispatchKey(cm, name, e, function(b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n return doHandleBinding(cm, b);\n });\n } else {\n return dispatchKey(cm, name, e, function(b) { return doHandleBinding(cm, b); });\n }\n }", "title": "" }, { "docid": "b56b17c71e17b4fe87a1742b3cdc8a05", "score": "0.48168737", "text": "function update() {\n this.mousetrap.reset();\n if (!this.enabled) return;\n\n // loop through keys\n for (var key_id in this.assigned_keys) {\n var assigned_key = this.assigned_keys[key_id];\n\n // OK if this is missing\n if (!assigned_key.key) continue;\n\n var key_to_bind = _add_cmd(assigned_key.key, this.ctrl_equals_cmd);\n // remember the input_list\n assigned_key.input_list = this.input_list;\n this.mousetrap.bind(key_to_bind, function(e) {\n // check inputs\n var input_blocking = false;\n if (this.ignore_with_input) {\n for (var i = 0, l = this.input_list.length; i < l; i++) {\n if (this.input_list[i].is_visible()) {\n input_blocking = true;\n break;\n }\n }\n }\n\n if (!input_blocking) {\n if (this.fn) this.fn.call(this.target);\n else console.warn('No function for key: ' + this.key);\n e.preventDefault();\n }\n }.bind(assigned_key), 'keydown');\n }\n}", "title": "" }, { "docid": "1566942ac408b132ac45fe2eecd9a867", "score": "0.48165438", "text": "function handleKeyDown(e) {\r\n\t\t\t//cross browser issues exist\r\n\t\t\tif (!e) {\r\n\t\t\t\tvar e = window.event;\r\n\t\t\t}\r\n\t\t\tswitch (e.keyCode) {\r\n\t\t\t\tcase KEYCODE_ALT:\r\n\t\t\t\t\tshootHeld = true;\r\n\t\t\t\t\treturn false;\r\n\t\t\t\tcase KEYCODE_LEFT:\r\n\t\t\t\t\tlfHeld = true;\r\n\t\t\t\t\treturn false;\r\n\t\t\t\tcase KEYCODE_RIGHT:\r\n\t\t\t\t\trtHeld = true;\r\n\t\t\t\t\treturn false;\r\n\t\t\t\tcase KEYCODE_UP:\r\n\t\t\t\t\tfwdHeld = true;\r\n\t\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}", "title": "" }, { "docid": "f324fc1d2195392c000661e7d5211510", "score": "0.48155016", "text": "function handleKeyBinding(cm, e) {\n\t var name = keyName(e, true)\n\t if (!name) { return false }\n\t\n\t if (e.shiftKey && !cm.state.keySeq) {\n\t // First try to resolve full name (including 'Shift-'). Failing\n\t // that, see if there is a cursor-motion command (starting with\n\t // 'go') bound to the keyname without 'Shift-'.\n\t return dispatchKey(cm, \"Shift-\" + name, e, function (b) { return doHandleBinding(cm, b, true); })\n\t || dispatchKey(cm, name, e, function (b) {\n\t if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n\t { return doHandleBinding(cm, b) }\n\t })\n\t } else {\n\t return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); })\n\t }\n\t}", "title": "" }, { "docid": "ae5a18d03b9f9340569a5e1fa9ee7dba", "score": "0.4808179", "text": "function checkKey(event) {\n if (event.keyCode == '65' || event.keyCode == '75') {\n geluid1();\n console.log('you clicked a');\n }\n if (event.keyCode == '83' || event.keyCode == '76') {\n geluid2();\n }\n if (event.keyCode == '68' || event.keyCode == '186') {\n geluid3();\n }\n if (event.keyCode == '70') {\n geluid4();\n }\n if (event.keyCode == '71') {\n geluid5();\n }\n if (event.keyCode == '72') {\n geluid6();\n }\n if (event.keyCode == '74') {\n geluid7();\n }\n if (event.keyCode == '87' || event.keyCode == '73'){\n geluidZ1();\n }\n if (event.keyCode == '69' || event.keyCode == '79'){\n geluidZ2();\n }\n if (event.keyCode == '82'){\n geluidZ3();\n }\n if (event.keyCode == '84'){\n geluidZ4();\n }\n if (event.keyCode == '89'){\n geluidZ5();\n }\n }", "title": "" }, { "docid": "59c27a4bddefa43ec2a3c429156f47cb", "score": "0.48057404", "text": "function handle_passive_events(key) {\n\t\n\tswitch (key) {\n\t\tcase KB_1:\n\t\tcase KB_2:\n\t\tcase KB_3:\n\t\tcase KB_4: Party.activate_party_member(event.keyCode-KB_1); break;\n\t\tcase KB_8: console.log(World.get_current_region()); break;\n\t\tcase KB_X: View.refocus(Player.map_x, Player.map_y); break;\n\t\tcase KB_M: View.toggle_minimap(); break;\n\t\tcase KB_MINUS: View.world_rescale_down(); break;\n\t\tcase KB_PLUS: View.world_rescale_up(); break;\n\t}\n}", "title": "" }, { "docid": "c0090f6586ddc0e18e2ae80a377dd930", "score": "0.4803166", "text": "function handleKeyBinding(cm, e) {\n var name = keyName(e, true);\n if (!name) { return false }\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function (b) { return doHandleBinding(cm, b, true); })\n || dispatchKey(cm, name, e, function (b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n { return doHandleBinding(cm, b) }\n })\n } else {\n return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); })\n }\n }", "title": "" }, { "docid": "c0090f6586ddc0e18e2ae80a377dd930", "score": "0.4803166", "text": "function handleKeyBinding(cm, e) {\n var name = keyName(e, true);\n if (!name) { return false }\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function (b) { return doHandleBinding(cm, b, true); })\n || dispatchKey(cm, name, e, function (b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n { return doHandleBinding(cm, b) }\n })\n } else {\n return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); })\n }\n }", "title": "" }, { "docid": "c0090f6586ddc0e18e2ae80a377dd930", "score": "0.4803166", "text": "function handleKeyBinding(cm, e) {\n var name = keyName(e, true);\n if (!name) { return false }\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function (b) { return doHandleBinding(cm, b, true); })\n || dispatchKey(cm, name, e, function (b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n { return doHandleBinding(cm, b) }\n })\n } else {\n return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); })\n }\n }", "title": "" }, { "docid": "c0090f6586ddc0e18e2ae80a377dd930", "score": "0.4803166", "text": "function handleKeyBinding(cm, e) {\n var name = keyName(e, true);\n if (!name) { return false }\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function (b) { return doHandleBinding(cm, b, true); })\n || dispatchKey(cm, name, e, function (b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n { return doHandleBinding(cm, b) }\n })\n } else {\n return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); })\n }\n }", "title": "" }, { "docid": "c0090f6586ddc0e18e2ae80a377dd930", "score": "0.4803166", "text": "function handleKeyBinding(cm, e) {\n var name = keyName(e, true);\n if (!name) { return false }\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function (b) { return doHandleBinding(cm, b, true); })\n || dispatchKey(cm, name, e, function (b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n { return doHandleBinding(cm, b) }\n })\n } else {\n return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); })\n }\n }", "title": "" }, { "docid": "c0090f6586ddc0e18e2ae80a377dd930", "score": "0.4803166", "text": "function handleKeyBinding(cm, e) {\n var name = keyName(e, true);\n if (!name) { return false }\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function (b) { return doHandleBinding(cm, b, true); })\n || dispatchKey(cm, name, e, function (b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n { return doHandleBinding(cm, b) }\n })\n } else {\n return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); })\n }\n }", "title": "" }, { "docid": "c0090f6586ddc0e18e2ae80a377dd930", "score": "0.4803166", "text": "function handleKeyBinding(cm, e) {\n var name = keyName(e, true);\n if (!name) { return false }\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function (b) { return doHandleBinding(cm, b, true); })\n || dispatchKey(cm, name, e, function (b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n { return doHandleBinding(cm, b) }\n })\n } else {\n return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); })\n }\n }", "title": "" }, { "docid": "c0090f6586ddc0e18e2ae80a377dd930", "score": "0.4803166", "text": "function handleKeyBinding(cm, e) {\n var name = keyName(e, true);\n if (!name) { return false }\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function (b) { return doHandleBinding(cm, b, true); })\n || dispatchKey(cm, name, e, function (b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n { return doHandleBinding(cm, b) }\n })\n } else {\n return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); })\n }\n }", "title": "" }, { "docid": "c0090f6586ddc0e18e2ae80a377dd930", "score": "0.4803166", "text": "function handleKeyBinding(cm, e) {\n var name = keyName(e, true);\n if (!name) { return false }\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function (b) { return doHandleBinding(cm, b, true); })\n || dispatchKey(cm, name, e, function (b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n { return doHandleBinding(cm, b) }\n })\n } else {\n return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); })\n }\n }", "title": "" }, { "docid": "c0090f6586ddc0e18e2ae80a377dd930", "score": "0.4803166", "text": "function handleKeyBinding(cm, e) {\n var name = keyName(e, true);\n if (!name) { return false }\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function (b) { return doHandleBinding(cm, b, true); })\n || dispatchKey(cm, name, e, function (b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n { return doHandleBinding(cm, b) }\n })\n } else {\n return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); })\n }\n }", "title": "" }, { "docid": "c0090f6586ddc0e18e2ae80a377dd930", "score": "0.4803166", "text": "function handleKeyBinding(cm, e) {\n var name = keyName(e, true);\n if (!name) { return false }\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function (b) { return doHandleBinding(cm, b, true); })\n || dispatchKey(cm, name, e, function (b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n { return doHandleBinding(cm, b) }\n })\n } else {\n return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); })\n }\n }", "title": "" }, { "docid": "4c9ebaeeccdc8e13a1545f4221321bfb", "score": "0.48014528", "text": "function handleKeyBinding(cm, e) {\n var name = keyName(e, true);\n if (!name) { return false }\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function (b) { return doHandleBinding(cm, b, true); })\n || dispatchKey(cm, name, e, function (b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n { return doHandleBinding(cm, b) }\n })\n } else {\n return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); })\n }\n }", "title": "" }, { "docid": "4c9ebaeeccdc8e13a1545f4221321bfb", "score": "0.48014528", "text": "function handleKeyBinding(cm, e) {\n var name = keyName(e, true);\n if (!name) { return false }\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function (b) { return doHandleBinding(cm, b, true); })\n || dispatchKey(cm, name, e, function (b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n { return doHandleBinding(cm, b) }\n })\n } else {\n return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); })\n }\n }", "title": "" }, { "docid": "362f7f39e5307fc51487263143d7d9ad", "score": "0.4801421", "text": "function handleKeyBinding(cm, e) {\n var name = keyName(e, true);\n if (!name) { return false }\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function (b) { return doHandleBinding(cm, b, true); })\n || dispatchKey(cm, name, e, function (b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n { return doHandleBinding(cm, b) }\n })\n } else {\n return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); })\n }\n }", "title": "" }, { "docid": "4a344b8edc8ce3eaaaa808ebcbfc2f00", "score": "0.47996157", "text": "function handleKeyDown(event) {\n // storing the pressed state for individual key\n currentlyPressedKeys[event.keyCode] = true;\n}", "title": "" }, { "docid": "32aade670942e113b02fbab1fe0fd711", "score": "0.47964612", "text": "function globalAsyncKeybind(keychar_funclist) {\n document.addEventListener(\"keydown\", function (evt) {\n function key(evt) {\n return evt.which || evt.keyCode || /*window.*/event.keyCode;\n }\n try {\n var target_func = keychar_funclist[String.fromCharCode(key(evt))];\n if (target_func) target_func();\n } catch (e) {\n // show the error to the DOM to help out for mobile (also cool on PC)\n //var html = '<div class=\"error\">'+e.toString()+\" at \"+e.stack+\"</div>\";\n //$(\"#debug_log\").prepend(html);\n _log.error(e);\n throw e; // rethrow to give it to debugging safari, rather than be silent\n }\n });\n }", "title": "" }, { "docid": "b89a9a846012427787370c8737701e58", "score": "0.47950706", "text": "function handleKeyBinding(cm, e) {\n var name = keyName(e, true);\n if (!name) { return false }\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function (b) { return doHandleBinding(cm, b, true); })\n || dispatchKey(cm, name, e, function (b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n { return doHandleBinding(cm, b) }\n })\n } else {\n return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); })\n }\n }", "title": "" }, { "docid": "470f71887130940bab8f88344a0b182b", "score": "0.47937992", "text": "function handleKeyDown(event) {\r\n currentlyPressedKeys[event.key] = true;\r\n if (currentlyPressedKeys[\"n\"]) {\r\n // key N, add new spheres\r\n var n = parseInt(document.getElementById(\"numSphere\").value);\r\n addSpheres(n);\r\n }\r\n if (currentlyPressedKeys[\"r\"]) {\r\n // key R, reset sphere count to 0\r\n sphereReset();\r\n }\r\n}", "title": "" }, { "docid": "606deeac82ea4d317ea8780df1e3566d", "score": "0.47921297", "text": "function handleKeyBinding(cm, e) {\n\t var name = keyName(e, true)\n\t if (!name) { return false }\n\n\t if (e.shiftKey && !cm.state.keySeq) {\n\t // First try to resolve full name (including 'Shift-'). Failing\n\t // that, see if there is a cursor-motion command (starting with\n\t // 'go') bound to the keyname without 'Shift-'.\n\t return dispatchKey(cm, \"Shift-\" + name, e, function (b) { return doHandleBinding(cm, b, true); })\n\t || dispatchKey(cm, name, e, function (b) {\n\t if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n\t { return doHandleBinding(cm, b) }\n\t })\n\t } else {\n\t return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); })\n\t }\n\t}", "title": "" }, { "docid": "09358f7f1cb8283aa8ea7ae9f6f081ec", "score": "0.47917438", "text": "function handleKeyBinding(cm, e) {\n var name = keyName(e, true);\n if (!name) {\n return false;\n }\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function (b) {\n return doHandleBinding(cm, b, true);\n }) || dispatchKey(cm, name, e, function (b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion) {\n return doHandleBinding(cm, b);\n }\n });\n } else {\n return dispatchKey(cm, name, e, function (b) {\n return doHandleBinding(cm, b);\n });\n }\n }", "title": "" }, { "docid": "a148796264260b63895eba04df8da824", "score": "0.47911945", "text": "detectPressedKeys() {\n // move either up (Up) or down (DOWN)\n if (this.keyPressedStates[38 /* UP */]) {\n this._playerB.moveUp();\n }\n else if (this.keyPressedStates[40 /* DOWN */]) {\n this._playerB.moveDown();\n }\n // move either left (LEFT) or right (RIGHT)\n if (this.keyPressedStates[37 /* LEFT */]) {\n this._playerB.moveLeft();\n }\n else if (this.keyPressedStates[39 /* RIGHT */]) {\n this._playerB.moveRight();\n }\n // move either up (W) or down (S)\n if (this.keyPressedStates[87 /* W */]) {\n this._playerA.moveUp();\n }\n else if (this.keyPressedStates[83 /* S */]) {\n this._playerA.moveDown();\n }\n // move either left (A) or right (D)\n if (this.keyPressedStates[65 /* A */]) {\n this._playerA.moveLeft();\n }\n else if (this.keyPressedStates[68 /* D */]) {\n this._playerA.moveRight();\n }\n }", "title": "" }, { "docid": "dee2bf205237c76d1dd8f382c5c17f82", "score": "0.47879952", "text": "function detectSpaceForFire(){\r\n document.addEventListener(\"keydown\", function(event){\r\n if(event.keyCode == 32){\r\n fire = true;\r\n }\r\n })\r\n}", "title": "" }, { "docid": "3d04d236a63ede3482140d41afdf23f8", "score": "0.4787646", "text": "function keyEvents() {\n\tonkeydown = onkeyup = function(e){\n\t\te = e || event; // to deal with IE\n\t\tkeyMap[e.keyCode] = e.type == 'keydown';\n\t}\n}", "title": "" } ]
22ebe0c10709519fde53feb7acba2010
FIN CONTROLES DE CLIENTE
[ { "docid": "2c1329b4e2d6e5adf75facc1f1f416eb", "score": "0.0", "text": "function indicarFamiliaTodas() {\n $.ajax({\n url: '/Familia/ChangeFamilia',\n type: 'POST',\n dataType: 'JSON',\n data: {\n familia: \"Todas\"\n }\n });\n $('#familia').val(\"Todas\");\n $('#familiaBusquedaPrecios').val(\"Todas\");\n \n\n }", "title": "" } ]
[ { "docid": "c1e001e8a19ecaecf64f13136789b749", "score": "0.6987415", "text": "function preencheDados() {\n\n}", "title": "" }, { "docid": "2eb0094b81a9ceb5c7db96cca352692e", "score": "0.6785103", "text": "function stProprieteCompo()\n{\n\tthis.Action_en_cours=null;\n\tthis.NewCle=null;\n}", "title": "" }, { "docid": "2eb0094b81a9ceb5c7db96cca352692e", "score": "0.6785103", "text": "function stProprieteCompo()\n{\n\tthis.Action_en_cours=null;\n\tthis.NewCle=null;\n}", "title": "" }, { "docid": "a73a8f0ae27d466648f689ed9c465c9c", "score": "0.6672221", "text": "function stProprieteCompo()\n{\n this.Action_en_cours=null;\n this.NewCle=null;\n}", "title": "" }, { "docid": "9ed89ad1d8dc07bf1bd68dace1157984", "score": "0.6618787", "text": "alCargado(){\n \n }", "title": "" }, { "docid": "9d174fd20a2e9cd931acfb85ff890768", "score": "0.65429646", "text": "function pulisci() {\n\t\t\tctrl.evento = {};\n\t\t\tctrl.evento.opzioni=[];\n\t\t\tctrl.visualizzaOpzioni = false;\n\t\t\tctrl.visualizzaVincoli = false;\n\t\t}", "title": "" }, { "docid": "fd06f976213b9712baa7113af786783b", "score": "0.6514502", "text": "function cancel_vimofy_lien()\r\n{\r\n\templacement_vimofy_cartouche_param = false;\t\t// Contient l'id de l'élément en cours ou il y a une vimofy\r\n\templacement_cartouche_param = false;\t\t\t// Contient l'id de l'élément en cours ou il y a la liste des paramètres d'entrée\t\r\n\templacement_vimofy_cartouche_infos = false;\r\n\templacement_cartouche_infos = false;\r\n}", "title": "" }, { "docid": "b0edd2c8ad3d5d3f06342068a868fec8", "score": "0.6360844", "text": "function irComputadores() {\n // Eliminar la clase Activa de los enlaces y atajos\n eliminarClaseActivaEnlances(enlaces, 'activo');\n eliminarClaseActivaEnlances(atajosIcons, 'activo-i');\n // Añadimos la clase activa de la seccion de Coputadores en los enlaces y atajos\n añadirClaseActivoEnlaces(enlaceComputadores, 'activo');\n añadirClaseActivoEnlaces(atajoComputadores, 'activo-i');\n // Crear contenido de la Seccion\n crearContenidoSeccionComputadores();\n // Abrir la seccion \n abrirSecciones();\n}", "title": "" }, { "docid": "b89bb29f7df41badc3001b23868e43df", "score": "0.6316945", "text": "congelar() {\n\t\tthis._funcCamadasCongelar.subirCamada();\n\t\tthis._estahCongelado = true;\n\t}", "title": "" }, { "docid": "b9e57e008cfe735b0df07c2798589f05", "score": "0.6220758", "text": "procCriou() {\n\t\tControladorJogo.pers.procObjCriadoColideTiros(this);\n\t\tthis.procVerifColisaoPersInimEstatico();\n\t}", "title": "" }, { "docid": "9b5955d4f17fac2e48ad23a1fbf807ed", "score": "0.61535776", "text": "function init(){ // función que se llama así misma para indicar que sea lo primero que se ejecute\n cursoCtrl.carreras = administradorService.getCarreras();\n }", "title": "" }, { "docid": "a75df942e234bfa16d6edf2a9bcf6f10", "score": "0.6146707", "text": "controlla() {\n\tfor(var j = 0; j < pallini.length; j++ ) { \n\tthis.urtoPallino(pallini[j]);\n\t}\n\tthis.urtoParete();\n\tif( new Date().getTime() - this.tempo > tempoguarigione && this.tempo > 0) {\n\tthis.stato = 2;\n\t}\n\t}", "title": "" }, { "docid": "2a1fcbe5755df963c14bcaa091d70240", "score": "0.6145574", "text": "clckAceptar() {\n\n\n if (this.items.nombre == \"\" || this.items.compania == \"\" || !this.files2.length || this.items.clave == \"\") {\n this.println(\"Hay que llenar todos los campos\");\n return;\n }\n\n this.barra = true;\n this.subirImag(this.files2[0]); //con est estoy subiendo la imagen al servidor \n\n }", "title": "" }, { "docid": "a2225ad4272803aeea197810dedb4669", "score": "0.6138991", "text": "function cargarCgg_res_estado_civilCtrls(){\n if(inRecordCgg_res_estado_civil){\n txtCrecv_codigo.setValue(inRecordCgg_res_estado_civil.get('CRECV_CODIGO'));\n txtCrecv_descrpcion.setValue(inRecordCgg_res_estado_civil.get('CRECV_DESCRPCION'));\n isEdit = true;\n habilitarCgg_res_estado_civilCtrls(true);\n }}", "title": "" }, { "docid": "077570c5f3d77c4924c557ebd6d9cabf", "score": "0.61364037", "text": "function programmatore() { //def il costruttore programmatore\n\tthis.linguaggiConosciuti = [];\n}", "title": "" }, { "docid": "26dbed6fb4128d604196d2fadcf7850d", "score": "0.6134723", "text": "constructor() {\n this.inicializar()\n this.generarSecuencia()\n this.siguienteNivel()\n }", "title": "" }, { "docid": "31be9738c45c640c5e836e9c8abaf348", "score": "0.6107396", "text": "function irTransferencias() {\n // Eliminar la clase Activa de los enlaces y atajos\n eliminarClaseActivaEnlances(enlaces, 'activo');\n eliminarClaseActivaEnlances(atajosIcons, 'activo-i');\n // Añadimos la clase activa de la seccion de transferencias generales en los enlaces y atajos\n añadirClaseActivoEnlaces(enlaceTransferencias, 'activo');\n añadirClaseActivoEnlaces(atajoTransferencias, 'activo-i');\n // Crear contenido de la Seccion\n crearContenidoSeccionTransferencias();\n // Abrir la seccion \n abrirSecciones();\n}", "title": "" }, { "docid": "6bb70431f432805729e426991aee741d", "score": "0.6105193", "text": "cargaArbolLista(){\n if(this.raiz ==null){\n console.log(\"No existe arbol\")\n return\n }\n let nodo = this.raiz\n this.cargandoArbolLista(nodo)\n }", "title": "" }, { "docid": "2a425632c878843473bb6d2bad20fba9", "score": "0.60888386", "text": "function incluir() {\n obj.INCLUINDO = true;\n obj.ALTERANDO = true;\n obj.Modal.show();\n\n obj.selectedReset();\n }", "title": "" }, { "docid": "f244e9c503562897eda8ecbe89b8b2d9", "score": "0.6088485", "text": "function comprobar() {\n cant = 0; // En cada comprobación reiniciamos\n comprobarSolicitudes();\n comprobarRespuestas();\n}", "title": "" }, { "docid": "f5a60317c285ac1bd4e02b13f7fa6ec1", "score": "0.60490227", "text": "function cargarCgg_jur_anticipoCtrls(){\n if(inRecordCgg_jur_anticipo){\n txtCjaac_codigo.setValue(inRecordCgg_jur_anticipo.get('CJAAC_CODIGO'));\n numCjaac_porcentaje.setValue(inRecordCgg_jur_anticipo.get('CJAAC_PORCENTAJE'));\n txtCjaac_observacion.setValue(inRecordCgg_jur_anticipo.get('CJAAC_OBSERVACION'));\n dtCjaac_fecha.setValue(truncDate(inRecordCgg_jur_anticipo.get('CJAAC_FECHA')));\n numCjaac_monto.setValue(inRecordCgg_jur_anticipo.get('CJAAC_MONTO'));\n txtCjaac_valor_1.setValue(inRecordCgg_jur_anticipo.get('CJAAC_VALOR_1'));\n pnlCgg_jur_anticipo.enable();\n isEdit = true;\n\n habilitarCgg_jur_anticipoCtrls(true);\n }}", "title": "" }, { "docid": "881448a3b79695891de53222472a639e", "score": "0.6044106", "text": "function limparTelaEdit() {\n\n\t\t\tctrl.infoGeral.infoGeral \t\t\t\t\t\t= {};\n\t\t\tctrl.pedidoItemEscolhido.pedidoItemEscolhido \t= [];\n\t\t\tctrl.pedidoItemEscolhido.corEscolhida \t\t\t= [];\n\t\t\tctrl.pedidoItemEscolhido.quantidadeGeralTotal \t= 0;\n\t\t\tctrl.pedidoItemEscolhido.valorGeralTotal \t\t= 0;\n\t\t}", "title": "" }, { "docid": "02e04a942323dd6b71927d2f21b8b99f", "score": "0.6040143", "text": "function Cargando(){\n\t\tPonerRecetasBusqueda('',pagina,'#recetas',false);\n\t\t//No tenemos que sacar cosas de los votos ni redirigir\n\t\tMostrarDatosSesion(false,0);\n\t\treturn false;\n\t}", "title": "" }, { "docid": "f3532cb54f7473a5e52d79ae458aa887", "score": "0.6036539", "text": "constructor(){\r\n this.pantalla = \"\"; // Inicialmente no hay nada en pantalla\r\n this.memoria = \"\"; // En memoria no hay nada \r\n }", "title": "" }, { "docid": "ba67d6d47c12fa5637cdfffddcb807d8", "score": "0.6034139", "text": "function inicializarConversacionNovia(){\nconversacionNovia = new ArbolConversacion(texturaCristina,texturaGabriela,texturaCristinaSombreada,texturaGabrielaSombreada);\n\n/**\n* Nodo Raiz\n* \n*/\nvar dialogos : Array = new Array();\nvar l: LineaDialogo = new LineaDialogo(\"Aqui hay una pobre mujer medio muerta.\",1);\ndialogos.Push(l);\nl = new LineaDialogo(\"Morirá en cualquier momento, ignórala por ahora\",2);\ndialogos.Push(l);\nl = new LineaDialogo(\"¿No debería ayudarla?\",1);\ndialogos.Push(l);\nl = new LineaDialogo(\"Nuestra prioridad son los fantasmas, despues nos ocuparemos de ella\",2);\ndialogos.Push(l);\n\nvar nodoRaiz:NodoDialogo = new NodoDialogo(dialogos);\nconversacionNovia.setRaiz(nodoRaiz);\n}", "title": "" }, { "docid": "0bb80c6aebc24fa5b88d8090caf5c772", "score": "0.60217154", "text": "constructor(){\n this.cabeza = null;\n this.cola = null;\n this.size = 0;\n }", "title": "" }, { "docid": "a1c35d360118d2ee8781382a89b4f785", "score": "0.6014433", "text": "function buscaEditorial() { \n\tobtenerObjeto(\"editorial\"); \n}", "title": "" }, { "docid": "a36addab1697184445ea3e679451844d", "score": "0.59917176", "text": "function dejarDeMostrarFlechas() {\n siguiente.classList.add(\"oculto\");\n anterior.classList.add(\"oculto\");\n }", "title": "" }, { "docid": "979308a3eaf07f4dce84cec50b15f905", "score": "0.59760165", "text": "function dibujarDialogo(){\n\n\nif(conversacionActual.getNodoActual().getQuienLinea() == 1){\ntexturaActual1 = conversacionActual.getTexturaPj1();\ntexturaActual2 = conversacionActual.getTexturaPj2Sombreada();\n}\nelse if (conversacionActual.getNodoActual().getQuienLinea() == 2){\ntexturaActual1 = conversacionActual.getTexturaPj1Sombreada();\ntexturaActual2 = conversacionActual.getTexturaPj2();\n}\n\ntextoActivo = conversacionActual.getNodoActual().getTextoLinea();\n\n\n\n}", "title": "" }, { "docid": "b192f433606f46805a12d3d6b6eee6c1", "score": "0.5956755", "text": "corVeiculo() {\n console.log('A cor do fuscão é ' + this.cor + ' e o modelo do baita é ' + this.modelo);\n }", "title": "" }, { "docid": "7e721fb4af36c38820187bf5b8edf158", "score": "0.59472144", "text": "function irComputadoresIcon() {\n // Eliminar la clase Activa de los enlaces y atajos\n eliminarClaseActivaEnlances(enlaces, 'activo');\n eliminarClaseActivaEnlances(atajosIcons, 'activo-i');\n // Añadimos la clase activa de la seccion de Coputadores en los enlaces y atajos\n añadirClaseActivoEnlaces(enlaceComputadores, 'activo');\n añadirClaseActivoEnlaces(atajoComputadores, 'activo-i');\n // Crear contenido de la Seccion\n crearContenidoSeccionComputadores();\n // Abrir la seccion \n abrirSecciones();\n}", "title": "" }, { "docid": "a839bcbb9bcc3e6b22c8680dc2b8408d", "score": "0.5935584", "text": "siguienteNivel(){\n\n\t\t//Variable que me almacena el subnivel del nivel en el que estoy\n\t\tthis.subnivel = 0;\n\t\tthis.iluminarSecuencia();\n\t\tthis.agregarEventosClick();\n\t}", "title": "" }, { "docid": "a0fb343112d3c39efefa47e027da8159", "score": "0.59349287", "text": "function inicializarConversacionExito(){\nconversacionExito = new ArbolConversacion(texturaCristina,texturaConserje,texturaCristinaSombreada,texturaConserjeSombreada);\n\n/**\n* Nodo Raiz\n* \n*/\nvar dialogos : Array = new Array();\nvar l: LineaDialogo = new LineaDialogo(\"Listo, todos los fantasma descansan ahora sin ningun remordimiento\",1);\ndialogos.Push(l);\nl = new LineaDialogo(\"Si, es verdad, se siente mucha más paz en este lugar\",2);\ndialogos.Push(l);\nl = new LineaDialogo(\"¿Y ahora qué?\",1);\ndialogos.Push(l);\nl = new LineaDialogo(\"Bueno, ya has ayudado a todos los que podias, creo que es hora de que tu tambien descanses\",2);\ndialogos.Push(l);\nl = new LineaDialogo(\"... Si, tienes razon... ya es hora\",1);\ndialogos.Push(l);\n\nvar nodoRaiz:NodoDialogo = new NodoDialogo(dialogos, FINAL);\nconversacionExito.setRaiz(nodoRaiz);\n}", "title": "" }, { "docid": "bc36f51cbc4d2ef717b16ad4e2edcbe3", "score": "0.59346133", "text": "redessine()\n\t\t\t{\n\t\t\t\t//Texte\n\t\t\t\tthis.redessineTitre()\n\t\t\t\t//Image (si elle existe)\n\t\t\t\tthis.replaceIcone()\n\t\t\t\t//rectangle\n\t\t\t\tthis.redessineContour();\n\t\t\t\t\n\t\t\t\t//L'ensemble\n\t\t\t\tthis.recentreGroupeBulle();\n\t\t\t\t// Recentre le menu\n\t\t\t\tthis.recentreMenu();\n\t\t\t\t\n\t\t\t\t\n\t\t\t}", "title": "" }, { "docid": "45e74af6596ab0c6ed6e746c1b03b95e", "score": "0.59305024", "text": "cancelarEditar(){\n\n //AL CANCELAR, LIMPIO LA TABLA EDITABLE Y VUELVO A LISTAR\n this.limpiarDatos();\n this.listarFacturas();\n\n //REASIGNO ESTADOS PARA LOS BOTONES\n this.estadoGuardar(true);\n this.estadoEditar(true);\n this.estadoActualizar(false);\n this.estadoCancelar(false);\n\n }", "title": "" }, { "docid": "fa2d127d6cea90432e015f49c8fa6715", "score": "0.5923702", "text": "function o_estado() { o(\"ESTADO NEGOCIO\",Tiempo,Caja,Inventario,EstadoEnvios) }", "title": "" }, { "docid": "c48cf8b01e6627da7160e6fd8d77872d", "score": "0.5917049", "text": "siguienteNivel() {\n this.iluminarSecuencia()\n }", "title": "" }, { "docid": "9f1610cc8eb4774b5bc463f206305d7c", "score": "0.591211", "text": "function berechneSchaltjahr() {\n \n}", "title": "" }, { "docid": "d2dbc107c3a4d07546e3d123e3775f35", "score": "0.59067327", "text": "function Enfant_INIT() {\n\n\t\t\t\t// Bouton supprimer\n\t\tEnfants_insertHTML(0,posColEnfant_regime,'');\n \t\t// r?gime\n \tEnfants_insertHTML(0,posColEnfant_regime,''); \t\n \t \t// ann?e\n \tEnfants_insertHTML(0,posColEnfant_annees,''); \n \t \t// mois\n \tEnfants_insertHTML(0,posColEnfant_mois,'');\n\t\t \t// jour\n \tEnfants_insertHTML(0,posColEnfant_jour,'');\n \t\n \t// dans le cas d'un rechargement de la page :\n \tif (Enfants_getCountLines()>0) {\n \t\tfor (var numLine=0;numLine<Enfants_getCountLines();++numLine) {\n \t\t\tEnfants_setRequired(numLine);\n \t\t\tisSelectboxValide(document.getElementsByName('listeEnfants.codeRegime['+numLine+']')[0]);\n \t\t\tisSelectboxValide(document.getElementsByName('listeEnfants.anneeNaissance['+numLine+']')[0]);\n \t\t\tisSelectboxValide(document.getElementsByName('listeEnfants.moisNaissance['+numLine+']')[0]);\n \t\t\tisSelectboxValide(document.getElementsByName('listeEnfants.jourNaissance['+numLine+']')[0]);\n \t\t}\n \t}\n \t\n \t// R?glage de la taille de la datagrid :\n \t// Ajout et suppression d'une ligne pour ?largir le datagrid ? la taille n?cessaire\n \tif (Enfants_getCountLines() == 0) {\n\t \tajouterEnfant();\n\t\t\tvar w = document.getElementById(tableName).clientWidth;\n\t \tDatagrid_DelLine(0);\n\t \tdocument.getElementById(tableName).style.width = w+\"px\";\n\t \tsetDtgEnfant_Visibility()\n \t}\n \t\n\t}", "title": "" }, { "docid": "ccecfd28fccf562c1f64eb9472d628d3", "score": "0.59029603", "text": "noPuedeSubir(){ \n this._sube=false;\n this._subiendo=false;\n this._inmovil=false;\n }", "title": "" }, { "docid": "057535c5d0b7e6b59cb46109c1b7fdd0", "score": "0.5902178", "text": "function limparModalLiberacao() {\n\n\t\t\tctrl.liberacao \t\t= {};\n\t\t\tctrl.liberacao.COR \t= [];\n\t\t\tctrl.addCor();\n\t\t}", "title": "" }, { "docid": "b0a0fedc3851ff02da01f59fdff4ffbd", "score": "0.590164", "text": "function inicializarConversacionSinConserje(){\nconversacionSinConserje = new ArbolConversacion(texturaCristina,texturaConserje,texturaCristinaSombreada,texturaConserjeSombreada);\n\n/**\n* Nodo Raiz\n* \n*/\nvar dialogos : Array = new Array();\nvar l: LineaDialogo = new LineaDialogo(\"No me molestes\",2);\ndialogos.Push(l);\n \nvar nodoRaiz:NodoDialogo = new NodoDialogo(dialogos);\n\nconversacionSinConserje.setRaiz(nodoRaiz);\n}", "title": "" }, { "docid": "8b62f22489f4b6907600262f4a4ada29", "score": "0.5897562", "text": "function irListadoClientesIcon() {\n // Eliminar la clase Activa de los enlaces y atajos\n eliminarClaseActivaEnlances(enlaces, 'activo');\n eliminarClaseActivaEnlances(atajosIcons, 'activo-i');\n // Añadimos la clase activa del Listado de Clientes en los enlaces y atajos\n añadirClaseActivoEnlaces(enlaceListaClientes, 'activo');\n añadirClaseActivoEnlaces(atajoClientes, 'activo-i');\n // Crear contenido de la Seccion\n crearContenidoSeccionListadoClientes();\n // Abrir la seccion \n abrirSecciones();\n}", "title": "" }, { "docid": "2fc7dc5b83c5776507ccae363fdd4c5c", "score": "0.58954716", "text": "pedirPista() {\r\n /*recupera todos los elementos que no son visibles\r\n y que se les ha ingresado un valor, y dicho valor no es correcto\r\n */\r\n let opciones = this.view\r\n .modelo\r\n .sudoku\r\n .casillas\r\n .filter(e => !e.visible && e.valor != e.valorDigitado);\r\n opciones.length === 0 ? this.view.mensaje(mensajeNoPistas, \"#868A08\",4500)\r\n : this.seleccionarPista(opciones);\r\n }", "title": "" }, { "docid": "1f0e1ef496af63dbfab37266452fa068", "score": "0.5895307", "text": "quitarLosEstilos() {\n let inputs = document.getElementsByClassName('zelda-input');\n while (this.Seleccionados.length > 0) {\n inputs[this.Seleccionados[0]].classList.remove('selected');\n this.Seleccionados.shift();\n }\n while (this.NoSeleccionados.length > 0) {\n inputs[this.NoSeleccionados[0]].classList.remove('unselected');\n this.NoSeleccionados.shift();\n }\n }", "title": "" }, { "docid": "462ea977d5dcff8bf262dc4651db23ae", "score": "0.58898723", "text": "function cargarCgg_gem_candidatoCtrls() {\n if (IN_RECORD_CGG_GEM_CANDIDATO) {\n txtCgcnd_codigo.setValue(IN_RECORD_CGG_GEM_CANDIDATO.get('CGCND_CODIGO')); \n txtCgcnd_descripcion.setValue(IN_RECORD_CGG_GEM_CANDIDATO.get('CGCND_DESCRIPCION'));\n\t\t\tvar estado_CGG_GEM_CANDIDATO = \"0\";\n\t\t\tif (IN_ESTADO_CGG_GEM_CANDIDATO == \"aceptar\"){\t\t\t\t\n\t\t\t\testado_CGG_GEM_CANDIDATO = \"1\";\n\t\t\t}else if (IN_ESTADO_CGG_GEM_CANDIDATO == \"rechazar\"){\n\t\t\t\tdtCgcnd_fecha_entrevista.hide();\n\t\t\t\testado_CGG_GEM_CANDIDATO = \"2\";\n\t\t\t}\n numCgcnd_seleccionado.setValue(estado_CGG_GEM_CANDIDATO);\n }\n }", "title": "" }, { "docid": "bef157b74b5f714db8f36cbc28685ba1", "score": "0.5882907", "text": "function Dispositivo_Listo() {\n\t\tComienza();\n\t}", "title": "" }, { "docid": "33246d0e3c5cf7341d4a3e61e17d5c92", "score": "0.58822423", "text": "function cancelar() {\n rows = 10;\n columns = 10;\n contador = 1;\n contador2 = 1;\n swit = 0;\n clearInterva;\n swit2 = 0;\n sumaValor = 2;\n sumaValorIncre = 1;\n numVueltas = 1;\n tipoLimpieza = 1000;\n totalRecorido = 0;\n totalBasura = 0;\n contadorClase = 0;\n claseEliminaImagen = 0;\n parar();\n}", "title": "" }, { "docid": "0a04777ff31fcbac875575f00aec1000", "score": "0.58765143", "text": "function cargarCgg_dhu_encuestaCtrls(){\n if(inRecordCgg_dhu_encuesta){\n txtCdenc_codigo.setValue(inRecordCgg_dhu_encuesta.get('CDENC_CODIGO'));\n txtCdenc_nombre.setValue(inRecordCgg_dhu_encuesta.get('CDENC_NOMBRE'));\n txtCdenc_observacion.setValue(inRecordCgg_dhu_encuesta.get('CDENC_OBSERVACION'));\n isEdit = true;\n habilitarCgg_dhu_encuestaCtrls(true);\n }}", "title": "" }, { "docid": "349ddad10b4e0fa97661dfc7216f20cf", "score": "0.5874254", "text": "function irListadoClientes() {\n // Eliminar la clase Activa de los enlaces y atajos\n eliminarClaseActivaEnlances(enlaces, 'activo');\n eliminarClaseActivaEnlances(atajosIcons, 'activo-i');\n // Añadimos la clase activa del Listado de Clientes en los enlaces y atajos\n añadirClaseActivoEnlaces(enlaceListaClientes, 'activo');\n añadirClaseActivoEnlaces(atajoClientes, 'activo-i');\n // Crear contenido de la Seccion\n crearContenidoSeccionListadoClientes();\n // Abrir la seccion \n abrirSecciones();\n}", "title": "" }, { "docid": "d68117c1aaa57148bbecf9d13bd12bf6", "score": "0.58734083", "text": "function irTransferenciasIcon() {\n // Eliminar la clase Activa de los enlaces y atajos\n eliminarClaseActivaEnlances(enlaces, 'activo');\n eliminarClaseActivaEnlances(atajosIcons, 'activo-i');\n // Añadimos la clase activa de la seccion de transferencias generales en los enlaces y atajos\n añadirClaseActivoEnlaces(enlaceTransferencias, 'activo');\n añadirClaseActivoEnlaces(atajoTransferencias, 'activo-i');\n // Crear contenido de la Seccion\n crearContenidoSeccionTransferencias();\n // Abrir la seccion \n abrirSecciones();\n}", "title": "" }, { "docid": "d11e100bd3f7d97ea2bf34d015592469", "score": "0.5873013", "text": "function cargarCgg_jur_asesorCtrls(){\n if(inRecordCgg_jur_asesor){\n txtCjase_codigo.setValue(inRecordCgg_jur_asesor.get('CJASE_CODIGO'));\n tmpCjpju_codigo=inRecordCgg_jur_asesor.get('CJPJU_CODIGO');\n txtCjpju_codigo.setValue(inRecordCgg_jur_asesor.get('NUMERO'));\n cbxCjase_activo.setValue(inRecordCgg_jur_asesor.get('CJASE_ACTIVO'));\n isEdit = true;\n habilitarCgg_jur_asesorCtrls(true);\n\n }\n }", "title": "" }, { "docid": "ea2a866ced65e47fc6e679bef75b6d5e", "score": "0.587253", "text": "constructor(nombre,tipo,mitologia,zapatosrojos,color){\r\n/*Definición de los atributos de mi clase*/\r\nthis.nombre=nombre\r\nthis.tipo=tipo\r\nthis.mitologia=mitologia\r\nthis.zapatosrojos=zapatosrojos\r\nthis.color=color \r\n}", "title": "" }, { "docid": "cc0c76278e4810428f5a4a03acf82717", "score": "0.5854598", "text": "function mostrarEstructuraDelNivel1(){\n _NIVEL_ACTUAL = 1;\n \n if((MODIFICAR == 0)&&(ACTION != \"AGREGAR_ANALITICA\")){\n _mostrarAccion(\"<h4>Agregando registro con el esquema: \" + $('#tipo_nivel3_id option:selected').html() + \" (\" + TEMPLATE_ACTUAL + \")</h4>\" + crearBotonEsquema());\n } \n\n objAH = new AjaxHelper(updateMostrarEstructuraDelNivel1);\n objAH.debug = true;\n objAH.showOverlay = true;\n objAH.showState = true; \n objAH.url = URL_PREFIX+\"/catalogacion/estructura/estructuraCataloDB.pl\";\n objAH.tipoAccion = \"MOSTRAR_ESTRUCTURA_DEL_NIVEL\";\n objAH.nivel = _NIVEL_ACTUAL;\n objAH.id_tipo_doc = TEMPLATE_ACTUAL;//$('#tipo_nivel3_id').val();\n objAH.sendToServer();\n}", "title": "" }, { "docid": "8b6006e433af666dbca8d79b8f830596", "score": "0.5853674", "text": "cargar() {\n this.cargaOk = true;\n this.setear();\n }", "title": "" }, { "docid": "9f56725213891bf463747d52eea6b4f6", "score": "0.5852869", "text": "function irEntradaBases() {\n // Eliminar la clase Activa de los enlaces y atajos\n eliminarClaseActivaEnlances(enlaces, 'activo');\n eliminarClaseActivaEnlances(atajosIcons, 'activo-i');\n // Añadimos la clase activa a la Entrada de bases en los enlaces y atajos\n añadirClaseActivoEnlaces(enlaceEntradaBases, 'activo');\n añadirClaseActivoEnlaces(atajoEntradaBases, 'activo-i');\n // Crear contenido de la Seccion\n crearContenidoSeccionEntradaBases();\n // Abrir la seccion \n abrirSecciones();\n eventListenerConfirmarGuardarBase();\n \n}", "title": "" }, { "docid": "661539fc3a81f84693ed5b897044314a", "score": "0.58493865", "text": "iniciarNuevaOrden() {\n this.nuevoDetalleOrden = {\n \"cantidad\": 0,\n \"idOrden\": 0,\n \"idProducto\": 0,\n \"precioUnitario\": 0\n },\n this.nuevaOrden = {\n \"cliente\": \" \",\n \"estado\": \"A\",\n \"fecha\": \" \",\n \"idOrden\": 0,\n \"mesa\": \" \",\n \"observacion\": \" \",\n \"total\": 0\n },\n this.detallesDeNuevaOrden = []\n }", "title": "" }, { "docid": "ef867d177276e1a9914ebe9e3c42be05", "score": "0.5846685", "text": "function limparDados() {\n setDados(null)\n }", "title": "" }, { "docid": "291e3334dba1f356536045a3f0dd279f", "score": "0.5845869", "text": "function Commande() { \n // bouton cliqué\n this.isDown = false;\n // fillStyle pour le dessin \n this.fsBG = \"white\", \n // fillStyle pour le calque\n this.fsFG = \"white\";\n // strokeStyle pour le dessin\n this.ssBG = \"white\";\n // strokeStyle pour le calque\n this.ssFG = \"white\";\n }", "title": "" }, { "docid": "8bab610ee664ed1c567999468328e4d8", "score": "0.5833682", "text": "function inicializarConversacionCodigo(){\nconversacionCodigo = new ArbolConversacion(texturaCristina,texturaGabriela,texturaCristinaSombreada,texturaGabrielaSombreada);\n\n/**\n* Nodo Raiz\n* \n*/\nvar dialogos : Array = new Array();\nvar l: LineaDialogo = new LineaDialogo(\"Creo que ha muerto\",1);\ndialogos.Push(l);\nl = new LineaDialogo(\"No, solo ahorra fuerzas\",2);\ndialogos.Push(l);\nl = new LineaDialogo(\"Creo.. creo que tiene algo en la mano. Lo está sujetando con fuerza\",1);\ndialogos.Push(l);\nl = new LineaDialogo(\"Tal vez sea importante\",2);\ndialogos.Push(l);\nl = new LineaDialogo(\"Es un papel, tien algo escrito. ''Codigo caja fuerte en la oficina: 181651'' ¿Que significa eso?\",1);\ndialogos.Push(l);\nl = new LineaDialogo(\"No lo se, es posible que signifique algo para otra persona.\",2);\ndialogos.Push(l);\n\nvar nodoRaiz:NodoDialogo = new NodoDialogo(dialogos);\nconversacionCodigo.setRaiz(nodoRaiz);\n}", "title": "" }, { "docid": "c941b08c78f7adeb134ff7c1e9cdae8d", "score": "0.5830958", "text": "borrarTodo() {\n this.valorActual = '';\n this.valorAnterior = '';\n this.tipoOperacion = undefined;\n this.imprimirValores();\n }", "title": "" }, { "docid": "29cd349bb7cb00d3690c006e3c5430af", "score": "0.58303404", "text": "constructor(nombre,apellido,paiz,curso,tegnologia)\n {\n super(nombre,apellido,paiz);\n this.curso=curso;\n this.tegnologia=tegnologia;\n \n }", "title": "" }, { "docid": "58bcebada0f0288b3ada0a7660d871d6", "score": "0.5828926", "text": "function inicializarConversacionSinDesinfectar(){\nconversacionSinDesinfectar = new ArbolConversacion(texturaCristina,texturaGabriela,texturaCristinaSombreada,texturaGabrielaSombreada);\n\n/**\n* Nodo Raiz\n* \n*/\nvar dialogos : Array = new Array();\nvar l: LineaDialogo = new LineaDialogo(\"Al parecer primero necesitas desinfectarte en una estación\",2);\ndialogos.Push(l);\n\nvar nodoRaiz:NodoDialogo = new NodoDialogo(dialogos);\n\nconversacionSinDesinfectar.setRaiz(nodoRaiz);\n}", "title": "" }, { "docid": "2158ddca4e555fd9abfd0f9278f45b9b", "score": "0.582742", "text": "function cargarCgg_islaCtrls(){\n if(inRecordCgg_isla){\n txtCisla_codigo.setValue(inRecordCgg_isla.get('CISLA_CODIGO')); \n tmpCanton = inRecordCgg_isla.get('CCTN_CODIGO');\n var scpCanton = new SOAPClientParameters();\n scpCanton.add('inCctn_codigo',tmpCanton);\n scpCanton.add('format',TypeFormat.JSON);\n var tmpCctnRegistro = SOAPClient.invoke(URL_WS+\"Cgg_canton\", 'select', scpCanton, false, null);\n try{\n tmpCctnRegistro = Ext.util.JSON.decode(tmpCctnRegistro);\n txtCctn_codigo.setValue(tmpCctnRegistro[0].CCTN_NOMBRE);\n }catch(inErr){\n tmpCanton = null;\n tmpCctnRegistro = null;\n txtCctn_codigo.setValue('Informaci\\u00F3n no disponible');\n }\n txtCisla_nombre.setValue(inRecordCgg_isla.get('CISLA_NOMBRE'));\n txtCisla_abreviatura.setValue(inRecordCgg_isla.get('CISLA_ABREVIATURA'));\n numCisla_indice.setValue(inRecordCgg_isla.get('CISLA_INDICE'));\n isEdit = true;\n habilitarCgg_islaCtrls(true);\n }\n }", "title": "" }, { "docid": "b66b8182ecdaff500d890d933c9cf581", "score": "0.5826874", "text": "function limpaCesto () {\r\n var form = $('#formlavanderia').serialize();\r\n\r\n // 'cesto'(form) vazio, ja esta vazio\r\n if (!form.length) {\r\n $(\"#dialog-alert\")\r\n .dialog(\"open\")\r\n .html(\"O cesto ja esta vazio (*_*)\");\r\n return false;\r\n }\r\n\r\n $('#cesto .itens').remove();\r\n $('#cesto #formlavanderia').remove();\r\n $('.valor-lavagem')\r\n .text(0)\r\n .formatCurrency({symbol: \"R$ \"});\r\n }", "title": "" }, { "docid": "c3a935e6c87ea257377f62c665ffa910", "score": "0.5824907", "text": "function barrebouilles(){\n\t\t// fonction generique appliquee aux classes CSS :\n\t\t// inserer_barre_forum, inserer_barre_edition, inserer_previsualisation\n\t\t$('.formulaire_spip textarea.inserer_barre_forum').barre_outils('forum');\n\t\t$('.formulaire_spip textarea.inserer_barre_edition').barre_outils('edition');\n\t\t$('.formulaire_spip textarea.inserer_previsualisation').barre_previsualisation();\n\t\t// fonction specifique aux formulaires de SPIP :\n\t\t// barre de forum\n\t\t$('textarea.textarea_forum').barre_outils('forum');\n\t\t \n\t\t$('.formulaire_forum textarea[name=texte]').barre_outils('forum');\n\t\t// barre d'edition et onglets de previsualisation\n\t\t$('.formulaire_spip textarea[name=texte]')\n\t\t\t.barre_outils('edition').end()\n\t\t\t.barre_previsualisation();\n\t}", "title": "" }, { "docid": "0644e5ee495a0efc0bb2a152740ba5c4", "score": "0.5824467", "text": "function initEco() {\n // PLU\n this.ERDiv.classList.add('hidden');\n this.margeDiv.classList.remove('hidden');\n this.ensPaysagerDiv.classList.add('hidden');\n this.batiInteressantDiv.classList.add('hidden');\n this.batiExceptionnelDiv.classList.add('hidden');\n this.planteDiv.classList.remove('hidden');\n this.continuiteDiv.classList.remove('hidden');\n this.jardinDiv.classList.remove('hidden');\n this.alignementDiv.classList.remove('hidden');\n this.arbreDiv.classList.remove('hidden');\n // Ecologie\n this.trameDiv.classList.remove('hidden');\n this.zhAvereesDiv.classList.remove('hidden');\n this.solPollueDiv.classList.remove('hidden');\n this.risqueTechnoDiv.classList.remove('hidden');\n this.arbresRemDiv.classList.remove('hidden');\n this.ppriDiv.classList.remove('hidden');\n this.tnuDiv.classList.remove('hidden');\n //Reglementaire\n this.monumentDiv.classList.add('hidden');\n //Divers\n this.danubeDiv.classList.add('hidden');\n this.velumDiv.classList.add('hidden');\n this.batipublicDiv.classList.remove('hidden');\n this.SIRENEDiv.classList.add('hidden');\n}", "title": "" }, { "docid": "2b0d3eba32dbb6946f93aa17e66f5027", "score": "0.5814791", "text": "function valeurInitial() {\n\t\t\t\tdocument.frmJoueur.sommeInitialeDesJoueur.value = \"0\";\n\t\t\t\tdisparaitreBouton(document.getElementById(\"btnRelancer\"));\n\t\t\t\tdisparaitreBouton(document.getElementById(\"btnArreter\"));\n\t\t\t\tdisparaitreBouton(document.getElementById(\"btnAjouterValeurDes1\"));\n\t\t\t\tdisparaitreBouton(document.getElementById(\"btnAjouterValeurDes2\"));\n\t\t\t\tdisparaitreBouton(document.getElementById(\"btnAjouterLaSomme\"));\n\t\t\t\tdesactiverDes(document.getElementById(\"emplacement2\"));\n\t\t\t\tdesactiverDes(document.getElementById(\"emplacement1\"));\n\t\t\t\tdesactiverDes(document.getElementById(\"emplacement3\"));\n\t\t\t\tdesactiverDes(document.getElementById(\"emplacement4\"));\n\t\t\t\tdesactiverBouton(document.getElementById(\"btnReload\"));\n\t\t\t\tdisparaitreBouton(document.getElementById(\"redemarrer\"));\n\t\t\t\t\n\t\t\t}", "title": "" }, { "docid": "bb69a80fdf18674bc43464d08ce1fb11", "score": "0.5813553", "text": "function checkDescuento() {\n\n}", "title": "" }, { "docid": "687123991f578e5b11d45ab63d009482", "score": "0.58075887", "text": "function voltar_tela_inicial() {\n $(\n \".segura_dados_pessoa_selecionada_no_pessoas_selecionadas_no_segura_responsivamente_no_campo_segura_pessoas_selecionadas_busca_novo_grupo_tela_um\"\n ).fadeOut(0);\n adicionadas = [];\n $(\n \".segura_dados_pessoa_selecionada_no_pessoas_selecionadas_no_segura_responsivamente_no_campo_segura_pessoas_selecionadas_busca_novo_grupo_tela_um\"\n ).remove();\n }", "title": "" }, { "docid": "c66e2d142e9c1bf37684c2bccda8d033", "score": "0.58064985", "text": "function alterar() {\n obj.PRODUTO_READONLY = true;\n \n gScope.Ctrl.IIConsultaProduto.option.required = false;\n \n obj.SELECTED = obj.SELECTEDS[0];\n\n angular.copy(obj.SELECTED,obj.SELECTED_COPY);\n obj.SELECTED.DATA_ENTRADA = moment(obj.SELECTED.DATA_ENTRADA).toDate();\n \n \n// $ajax.get('/_16010/api/imobilizado/tipo').then(function(response){\n// obj.TIPOS = response;\n obj.Modal.show();\n//\n// obj.SELECTED = {\n// TIPO: null,\n// DESCRICAO : '',\n// OBSERVACAO : '',\n// ITENS : []\n// };\n// });\n }", "title": "" }, { "docid": "f3e3e5dd126c062d299c3e381e04ea46", "score": "0.57973635", "text": "OtroMetodo ()\r\n {\r\n //Este es un ejemplo de que se pueden agregar los metodos o funciones que se requieran\r\n }", "title": "" }, { "docid": "4affa302b96c0e8f3f6c97c0d03779db", "score": "0.5793513", "text": "function limpiar_datos_agregar(){\n\t\ttrumbowyg_destroy('.contenido');\n\t\tchosen_single_destroy('.select');\n\t\tchosen_multiple_destroy('.multiple');\n\t\ttrumbowyg();\n\t\t$(\"#titulo\").val(\"\").focus();\n\t\t$(\"#imagen\").val(\"\");\n\t}", "title": "" }, { "docid": "3732ce315ab68e0c594155742287598b", "score": "0.57928526", "text": "function inicializarConversacionNoPuedeMatar(){\nconversacionNoPuedeMatar = new ArbolConversacion(texturaCristina,texturaGabriela,texturaCristinaSombreada,texturaGabrielaSombreada);\n\n/**\n* Nodo Raiz\n* \n*/\nvar dialogos : Array = new Array();\nvar l: LineaDialogo = new LineaDialogo(\"Tiene que ser ella, la novia del fantasma. ¿Que deberiamos hacer por ella?\",1);\ndialogos.Push(l);\nl = new LineaDialogo(\"Ayudarla\",2);\ndialogos.Push(l);\nl = new LineaDialogo(\"¿Cómo? No se nada de medicina, y ella apenas si está viva\",1);\ndialogos.Push(l);\nl = new LineaDialogo(\"Entonces ahorrale el sufrimiento, mátala\",2);\ndialogos.Push(l);\nl = new LineaDialogo(\"Si, es lo mejor. ¿Cómo será mejor hacerlo?\",1);\ndialogos.Push(l);\nl = new LineaDialogo(\"Ahógala\",2);\ndialogos.Push(l);\nl = new LineaDialogo(\"¿Con qué?\",1);\ndialogos.Push(l);\nl = new LineaDialogo(\"Con una toalla puede ser. Si no tienes ninguna, algo nos ha de servir, busquemos por aquí\",2);\ndialogos.Push(l);\n\nvar nodoRaiz:NodoDialogo = new NodoDialogo(dialogos);\nconversacionNoPuedeMatar.setRaiz(nodoRaiz);\n}", "title": "" }, { "docid": "5bb6890171c92f96d21cbe534009246b", "score": "0.5781938", "text": "function inicializarConversacionPalanca(){\nconversacionPalanca = new ArbolConversacion(texturaCristina,texturaGabriela,texturaCristinaSombreada,texturaGabrielaSombreada);\n\n/**\n* Nodo Raiz\n* \n*/\nvar dialogos : Array = new Array();\nvar l: LineaDialogo = new LineaDialogo(\"Esto puede que sirva como palanca.\",1);\ndialogos.Push(l);\n\nvar nodoRaiz:NodoDialogo = new NodoDialogo(dialogos);\n\nconversacionPalanca.setRaiz(nodoRaiz);\n}", "title": "" }, { "docid": "2ed4b0d285698962f172e0300e0e7558", "score": "0.5777851", "text": "function inicializarConversacionAlambre(){\nconversacionAlambre = new ArbolConversacion(texturaCristina,texturaGabriela,texturaCristinaSombreada,texturaGabrielaSombreada);\n\n/**\n* Nodo Raiz\n* \n*/\nvar dialogos : Array = new Array();\nvar l: LineaDialogo = new LineaDialogo(\"Aqui hay un alambre\",1);\ndialogos.Push(l);\nl = new LineaDialogo(\"Cógelo, puede ser útil\",2);\ndialogos.Push(l);\n\nvar nodoRaiz:NodoDialogo = new NodoDialogo(dialogos);\n\nconversacionAlambre.setRaiz(nodoRaiz);\n}", "title": "" }, { "docid": "6f08f771e757b6be1c2f2930405df9ea", "score": "0.5777763", "text": "function incluir() {\n obj.PRODUTO_READONLY = false;\n gScope.Ctrl.IIConsultaProduto.option.required = true;\n obj.SELECTED = {\n DATA_ENTRADA : moment().toDate(),\n FRETE_UNITARIO : 0\n };\n \n// $ajax.get('/_16010/api/imobilizado/tipo').then(function(response){\n// obj.TIPOS = response;\n obj.Modal.show();\n//\n// obj.SELECTED = {\n// TIPO: null,\n// DESCRICAO : '',\n// OBSERVACAO : '',\n// ITENS : []\n// };\n// });\n }", "title": "" }, { "docid": "7373b22e1f0d424e315d1eed0af8b5c5", "score": "0.57772046", "text": "function cargarCgg_veh_cilindrajeCtrls(){\n if(inRecordCgg_veh_cilindraje){\n txtCvcln_codigo.setValue(inRecordCgg_veh_cilindraje.get('CVCLN_CODIGO'));\n numCvcln_cilindraje.setValue(inRecordCgg_veh_cilindraje.get('CVCLN_CILINDRAJE'));\n txtCvcln_observacion.setValue(inRecordCgg_veh_cilindraje.get('CVCLN_OBSERVACION'));\n isEdit = true;\n habilitarCgg_veh_cilindrajeCtrls(true);\n }\n}", "title": "" }, { "docid": "790485f503782558a088c1aca415fe59", "score": "0.5756754", "text": "function action_controlesObligatoire(){\n\t\tvar cadre = eval(regleArray['cibleFenetre'] + (regleArray['cibleCadre'] != '' ? '.' + regleArray['cibleCadre'] : ''));\n\t\tvar controlesArray = regleArray['cibleObjet'].replace(/\\r|\\n/g,'').split(',');\n\t\tcadre.formulaire.controlesObligatoire(controlesArray,eval(regleArray['condition']));\n\t}//end function\t", "title": "" }, { "docid": "bafb712e2cc80d6b3871e1a57f6fa28f", "score": "0.5755517", "text": "showPilotoAutomatico(){\n this.showAutomaticDirigivel();\n this.showAutomaticFlag();\n this.showAutomaticFlagHolder();\n }", "title": "" }, { "docid": "42530ea01739a80cd7ccda16b49c21fd", "score": "0.5749531", "text": "function inicializarConversacionF3Ayudar(){\nconversacionF3Ayudar = new ArbolConversacion(texturaCristina,texturaF3,texturaCristinaSombreada,texturaF3Sombreada);\n\n/**\n* Nodo Raiz\n* \n*/\nvar dialogos : Array = new Array();\nvar l: LineaDialogo = new LineaDialogo(\"Es este ¿Verdad?\",1);\ndialogos.Push(l);\nl = new LineaDialogo(\"¡¡Si, es ese!! Volveré a ver sonreir a mi esposa, grácias.\",2);\ndialogos.Push(l);\n\nvar nodoRaiz:NodoDialogo = new NodoDialogo(dialogos);\n\nconversacionF3Ayudar.setRaiz(nodoRaiz);\n}", "title": "" }, { "docid": "60587e7d887352818a6d99f09a57de14", "score": "0.5747003", "text": "function cargarCgg_res_entidad_financieraCtrls(){\n if(inRecordCgg_res_entidad_financiera){\n txtCretf_codigo.setValue(inRecordCgg_res_entidad_financiera.get('CRETF_CODIGO'));\n txtCretf_nombre_entidad.setValue(inRecordCgg_res_entidad_financiera.get('CRETF_NOMBRE_ENTIDAD'));\n txtCretf_descripcion.setValue(inRecordCgg_res_entidad_financiera.get('CRETF_DESCRIPCION'));\n isEdit = true;\n habilitarCgg_res_entidad_financieraCtrls(true);\n }\n }", "title": "" }, { "docid": "a7e7e2d4fbb54e11fada5ed8a69c9861", "score": "0.57416236", "text": "function dibujar(){\r\n let coorX=INICIO_ALTO_LIENZO\r\n let coorY=INICIO_ANCHO_LIENZO\r\n for(let i=0;i<ALTO_CUADRICULA;++i){\r\n for(let x=0;x<ANCHO_CUADRICULA;x++){\r\n if(cuadricula[i][x]!==0){\r\n //la herramienta fillRect permite dibujar un rectángulo:\r\n CONTEXTO.fillRect(coorX+DISTANCIA,coorY+DISTANCIA,ANCHO_ALTO_CUADRADO,ANCHO_ALTO_CUADRADO)\r\n }\r\n if(cuadricula[i][x]===0){\r\n //la herramienta clearRect permite borrar un rectángulo:\r\n CONTEXTO.clearRect(coorX+DISTANCIA,coorY+DISTANCIA,ANCHO_ALTO_CUADRADO,ANCHO_ALTO_CUADRADO)\r\n }\r\n coorX+=ANCHO_ALTO_CUADRADO+DISTANCIA\r\n }\r\n coorX=INICIO_ALTO_LIENZO\r\n coorY+=ANCHO_ALTO_CUADRADO+DISTANCIA\r\n }\r\n}", "title": "" }, { "docid": "a789f3e90a5eb4cfa1acbcc34a607102", "score": "0.5733466", "text": "function msgEstrelas() {\n if (premio === 0) {\n contEstrelas = contEstrelas.text('. E não ganhou estrelas.');\n } else if (premio === 1) {\n contEstrelas = contEstrelas.text('. E ganhou ' + premio + ' estrela.');\n } else if (premio > 1) {\n contEstrelas = contEstrelas.text('. E ganhou ' + premio + ' estrelas.');\n };\n }", "title": "" }, { "docid": "824c041e26eaf502528662a3cebf31d8", "score": "0.57330114", "text": "function somar() {\r\n if(verificarEntradasVazias()){\r\n resposta.textContent = 'Erro: preencha os dois campos numéricos'; \r\n //Estilizando resposta com CSS\r\n resposta.classList.remove('certa');\r\n resposta.classList.add('errada'); \r\n } else {\r\n atualizarResposta();\r\n }\r\n }", "title": "" }, { "docid": "6d8f07e8431e20f1394bd54bfc617e6e", "score": "0.57302564", "text": "function cargarCgg_res_tramiteCtrls(){\n if(inRecordCgg_res_tramite){\n\n }\n }", "title": "" }, { "docid": "c4b80bcd9221fa53e3fae4f022faa83f", "score": "0.5725255", "text": "function pararDibujar() {\n pintarLinea = false;\n}", "title": "" }, { "docid": "5bf0a49e2a88fd0d713f1d19c7aa371f", "score": "0.57220834", "text": "puedeSubir(){ \n if (this._jump && !this._martillo){//si no has saltado y no llevas un martillo\n this._sube=true; \n this._corriendo = false;\n }\n }", "title": "" }, { "docid": "9e9b6124eee4073f9790f24cb4c81efc", "score": "0.5721467", "text": "function MercadoItensConta() {\n\n obj = this;\n\n // Public variables\n this.filtro = {\n DATA_INI_INPUT: moment().subtract(3, 'month').toDate(),\n DATA_FIM_INPUT: moment().toDate()\n };\n this.dado = {};\n\n obj.ALTERANDO = false;\n obj.SELECTED = null;\n obj.DADOS = []\n obj.DADOS.push({ID:'', DESCRICAO:'', PERCENTUAL: '',PERCENTUAL_IR:''});\n obj.ORDER_BY = 'ID';\n\n obj.consultar = function(){\n var ds = {\n FLAG : 0,\n ITEM_ID : gScope.vm.MercadoItens.SELECTED.ID\n };\n\n $ajax.post('/_31080/consultar_itens_conta',ds,{contentType: 'application/json'})\n .then(function(response) {\n obj.DADOS = response; \n }\n );\n };\n\n obj.cancelar = function(){\n obj.ALTERANDO = false;\n gScope.vm.ConsultaConta.apagar();\n }\n\n obj.modalIncluir = function(){\n obj.ALTERANDO = false;\n\n obj.NOVO = {\n ID : 0,\n DESCRICAO : '',\n CONTA : 0,\n ITEM_ID : gScope.vm.MercadoItens.SELECTED.ID\n };\n\n gScope.vm.ConsultaConta.filtrar();\n\n $('#modal-incluir-conta').modal(); \n };\n\n obj.modalAlterar = function(){\n obj.ALTERANDO = true;\n\n obj.NOVO = {\n ID : obj.SELECTED.ID,\n DESCRICAO : obj.SELECTED.DESCRICAO,\n CONTA : obj.SELECTED.CONTA,\n ITEM_ID : gScope.vm.MercadoItens.SELECTED.ID\n };\n\n gScope.vm.ConsultaConta.filtrar();\n\n $('#modal-incluir-conta').modal(); \n };\n\n obj.incluir = function(){\n if(gScope.vm.ConsultaConta.item.selected == true){\n addConfirme('<h4>Confirmação</h4>',\n 'Deseja realmente gravar?',\n [obtn_sim,obtn_nao],\n [{ret:1,func:function(){\n\n obj.NOVO.CONTA = gScope.vm.ConsultaConta.item.dados.CONTA\n gScope.vm.ConsultaConta.apagar();\n\n var ds = {\n ITEM : obj.NOVO\n };\n\n $ajax.post('/_31080/incluir_itens_conta',ds,{contentType: 'application/json'})\n .then(function(response) {\n obj.consultar();\n $('#modal-incluir-conta').modal('hide'); \n showSuccess('Gravado com sucesso!'); \n obj.ALTERANDO = false; \n }\n );\n }}] \n );\n }else{\n showErro('Selecione uma Conta');\n } \n };\n\n obj.alterar = function(){\n if(gScope.vm.ConsultaConta.item.selected == true){\n addConfirme('<h4>Confirmação</h4>',\n 'Deseja realmente gravar?',\n [obtn_sim,obtn_nao],\n [{ret:1,func:function(){\n\n obj.NOVO.CONTA = gScope.vm.ConsultaConta.item.dados.CONTA\n gScope.vm.ConsultaConta.apagar();\n\n var ds = {\n ITEM : obj.NOVO\n };\n\n $ajax.post('/_31080/alterar_itens_conta',ds,{contentType: 'application/json'})\n .then(function(response) {\n obj.consultar();\n $('#modal-incluir-conta').modal('hide'); \n showSuccess('Alterado com sucesso!');\n obj.ALTERANDO = false; \n }\n );\n }}] \n );\n }else{\n showErro('Selecione uma Conta');\n } \n };\n\n obj.excluir = function(){\n addConfirme('<h4>Confirmação</h4>',\n 'Deseja realmente excluir Conta ('+obj.SELECTED.DESCRICAO+')?',\n [obtn_sim,obtn_nao],\n [{ret:1,func:function(){\n var ds = {\n ITEM : obj.SELECTED\n };\n\n $ajax.post('/_31080/excluir_itens_conta',ds,{contentType: 'application/json'})\n .then(function(response) {\n obj.consultar();\n showSuccess('Excluido com sucesso!'); \n obj.ALTERANDO = false; \n }\n ); \n }}] \n );\n };\n }", "title": "" }, { "docid": "d88ded2ed77bf2813d4ea921afdc63f8", "score": "0.57140476", "text": "function depintarPuntosPantalla() {\n $('#puntos-equipo-1').text('0');\n $('#puntos-equipo-2').text('0');\n }", "title": "" }, { "docid": "5f89e56e1fcc153ebad58d598894d542", "score": "0.5713791", "text": "function inicializarConversacionF3Paila(){\nconversacionF3Paila = new ArbolConversacion(texturaCristina,texturaF3,texturaCristinaSombreada,texturaF3Sombreada);\n\n/**\n* Nodo Raiz\n* \n*/\nvar dialogos : Array = new Array();\nvar l: LineaDialogo = new LineaDialogo(\"Es este ¿Verdad?\",1);\ndialogos.Push(l);\nl = new LineaDialogo(\"... No, no es ese. El mio era de oro\",2);\ndialogos.Push(l);\nl = new LineaDialogo(\"No puede ser, el alambre se a roto. Tal vez si...\",1);\ndialogos.Push(l);\nl = new LineaDialogo(\"No te desgates, ya me acostumbré a fallarle a mi esposa. Puedo morir como un fracasado, \\ngrácias por tu esfuerzo\",2);\ndialogos.Push(l);\nl = new LineaDialogo(\"Esto no está bien...\",1);\ndialogos.Push(l);\n\nvar nodoRaiz:NodoDialogo = new NodoDialogo(dialogos);\n\nconversacionF3Paila.setRaiz(nodoRaiz);\n}", "title": "" }, { "docid": "278020fbd46781f98d002678023c7c17", "score": "0.57111657", "text": "function annullaTipoOperazioneCassa() {\n var uid = $(\"#confermaModaleAnnullamentoElemento\").data(\"uid\");\n var spinner;\n var obj;\n var objTipo;\n var objRicerca;\n // Controllo di avere l'uid\n if(!uid) {\n return;\n }\n\n objTipo = {\"tipoGiustificativo.uid\": uid};\n objRicerca = $(\"#fieldsetRicerca\").serializeObject();\n obj = $.extend(true, {}, objTipo, objRicerca);\n // Attivo lo spinner\n spinner = $(\"#SPINNER_confermaModaleAnnullamentoElemento\").addClass(\"activated\");\n $.postJSON(\"cassaEconomaleGestioneTabelleTipiGiustificativiAnnullamento.do\", obj, function(data) {\n // Se ho errori, esco subito\n if(impostaDatiNegliAlert(data.errori, alertErrori)) {\n return;\n }\n // Non ho errori. Imposto il messaggio di successo\n impostaDatiNegliAlert(data.informazioni, alertInformazioni);\n // Ricarico il dataTable\n impostaTabellaTipoOperazioniCassa();\n }).always(function() {\n spinner.removeClass(\"activated\");\n $(\"#modaleAnnullamentoElemento\").modal(\"hide\");\n });\n }", "title": "" }, { "docid": "71e4e22d743e30e784c316fdf5addc14", "score": "0.57102245", "text": "function MetaCaixaInit() {\n //S'executa al carregar-se la pàgina, si hi ha metacaixes,\n // s'assignen els esdeveniments als botons\n //alert(\"MetaCaixaInit\");\n var i = 0 //Inicialitzem comptador de caixes\n for (i = 0; i <= 9; i++) {\n var vMc = document.getElementById(\"mc\" + i);\n if (!vMc) break;\n //alert(\"MetaCaixaInit, trobada Metacaixa mc\"+i);\n var j = 1 //Inicialitzem comptador de botons dins de la caixa\n var vPsIni = 0 //Pestanya visible inicial\n for (j = 1; j <= 9; j++) {\n var vBt = document.getElementById(\"mc\" + i + \"bt\" + j);\n if (!vBt) break;\n //alert(\"MetaCaixaInit, trobat botó mc\"+i+\"bt\"+j);\n vBt.onclick = MetaCaixaMostraPestanya; //A cada botó assignem l'esdeveniment onclick\n //alert (vBt.className);\n if (vBt.className == \"mcBotoSel\") vPsIni = j; //Si tenim un botó seleccionat, en guardem l'index\n }\n //alert (\"mc=\"+i+\", ps=\"+j+\", psini=\"+vPsIni );\n if (vPsIni == 0) { //Si no tenim cap botó seleccionat, n'agafem un aleatòriament\n vPsIni = 1 + Math.floor((j - 1) * Math.random());\n //alert (\"Activant Pestanya a l'atzar; _mc\"+i+\"bt\"+vPsIni +\"_\");\n document.getElementById(\"mc\" + i + \"ps\" + vPsIni).style.display = \"block\";\n document.getElementById(\"mc\" + i + \"ps\" + vPsIni).style.visibility = \"visible\";\n document.getElementById(\"mc\" + i + \"bt\" + vPsIni).className = \"mcBotoSel\";\n }\n }\n }", "title": "" }, { "docid": "1d3bac0c5a623e993e259cea143a65e9", "score": "0.5708039", "text": "function reiniciarInt() {\n\t\tpilaAccHechas = [];\n\t\tpilaAccDes = [];\n\t\t\n\t\tfor (i in ids) {\n\t\t\tvar id = ids[i];\n\t\t\tdocument.getElementById(id).src = IMG_ACCION_BLANCO;\n\t\t\tmatriz[id] = ACCION_EN_BLANCO;\n\t\t\tvalorAnterior[id] = ACCION_EN_BLANCO;\n\t\t}\n\t}", "title": "" }, { "docid": "0039b0b1fc77ebe3943ff6efa6df4766", "score": "0.5704877", "text": "function cargarCgg_dhu_registro_encuestaCtrls(){\n\t\tif(inRecordCgg_dhu_registro_encuesta){\n\t\t\ttxtCdrge_codigo.setValue(inRecordCgg_dhu_registro_encuesta.get('CDRGE_CODIGO'));\n\t\t\ttxtCdprg_codigo.setValue(inRecordCgg_dhu_registro_encuesta.get('CDPRG_CODIGO'));\n\t\t\ttxtCdres_codigo.setValue(inRecordCgg_dhu_registro_encuesta.get('CDRES_CODIGO'));\n\t\t\ttxtCdape_codigo.setValue(inRecordCgg_dhu_registro_encuesta.get('CDAPE_CODIGO'));\n\t\t\ttxtCdrge_respuesta_abierta.setValue(inRecordCgg_dhu_registro_encuesta.get('CDRGE_RESPUESTA_ABIERTA'));\n\t\t\tdtCdrge_fecha_registro.setValue(inRecordCgg_dhu_registro_encuesta.get('CDRGE_FECHA_REGISTRO'));\n\t\t\ttxtCdrge_observacion.setValue(inRecordCgg_dhu_registro_encuesta.get('CDRGE_OBSERVACION'));\n\t\t\tisEdit = true;\n\t\t\thabilitarCgg_dhu_registro_encuestaCtrls(true);\n\t}}", "title": "" }, { "docid": "342cdfde0223d97bd3aa9852e5e0bced", "score": "0.5702251", "text": "function leerContratosPatrimoniales() {}", "title": "" }, { "docid": "bc46757ec5aa4985410b959626a9335c", "score": "0.57022285", "text": "function inicializarConversacionF1Ayudar(){\nconversacionF1Ayudar = new ArbolConversacion(texturaCristina,texturaF1,texturaCristinaSombreada,texturaF1Sombreada);\n\n/**\n* Nodo Raiz\n* \n*/\nvar dialogos : Array = new Array();\nvar l: LineaDialogo = new LineaDialogo(\"Si, ese es mi cuerpo, lo recuerdo claramente... Dios, está horrible\",2);\ndialogos.Push(l);\nl = new LineaDialogo(\"No esperarás que haga algo al respecto ¿Verdad?\",1);\ndialogos.Push(l);\nl = new LineaDialogo(\"No, tranquila, ya has hecho suficiente por mi, ya puedo irme en paz\",2);\ndialogos.Push(l);\n\nvar nodoRaiz:NodoDialogo = new NodoDialogo(dialogos);\n\nconversacionF1Ayudar.setRaiz(nodoRaiz);\n}", "title": "" }, { "docid": "5c73449ac0d5ca876cf0fefb2edc6083", "score": "0.5701056", "text": "reiniciarConteo() {\n this.ultimo = 0;\n this.tickets = []; //tambien reiniciamos la cola de tickets\n this.ultimos4 = [];\n console.log(\"Se ha inicializado el sistema\");\n this.grabarArchivo();\n }", "title": "" }, { "docid": "7b19caaf26ff17337beb1e569891d951", "score": "0.57010084", "text": "function clean() {\n setName(\"\")\n setCep(\"\")\n setdata(\"\")\n setRua(\"\")\n setCidade(\"\")\n setNumero(0)\n setBairro(\"\")\n }", "title": "" }, { "docid": "830a08de4fe8bbd1251cc4b73d7dc3db", "score": "0.5698207", "text": "function reiniciarObjeto() {\n citaObj.mascota = \"\";\n citaObj.propietario = \"\";\n citaObj.telefono = \"\";\n citaObj.mafechascota = \"\";\n citaObj.hora = \"\";\n citaObj.simtomas = \"\";\n}", "title": "" }, { "docid": "29d8a8b8522afde3ec87ffe02ff58abb", "score": "0.5695736", "text": "function anularSaldos(){\n\tsaldoCuenta= 0;\n\tsaldoDolar=0;\n\tlimiteExtraccion=0;\n\tnombreUsuario=\"Intruso\";\n}", "title": "" } ]
e2951227e4a17a00b7153c306205a690
compute the mass of of list of modifications (undefiend is possible). It's just the sum of the modif masses
[ { "docid": "93ed67c4b73a7ccce0bd2e1b601b6895", "score": "0.8205836", "text": "function computeMassModifArray(modifications) {\n\n if (modifications === undefined || modifications.length == 0) {\n return 0;\n }\n var tot = 0;\n _.each(modifications, function(m) {\n tot += m.get('mass');\n });\n return tot;\n }", "title": "" } ]
[ { "docid": "7b27a385c0be11df8f783adc75244bb1", "score": "0.7192389", "text": "calculateMass(){\n var m = this.solute.getMass();\n let solvs = this.solvents;\n for(var i = 0; i < solvs.length; i++){\n m += solvs[i].getMass();\n }\n return m;\n }", "title": "" }, { "docid": "1e4d3cdc8b0b71faa35c2ef7881285e5", "score": "0.64628696", "text": "getMolarMass(){\n // If the solute is a ChemicalSolution, it is invalid, return -1\n if(this.solute instanceof ChemicalSolution) return -1;\n\n // Find the total number of moles\n let chemControl = new ChemicalController2D(this.solute);\n var total = chemControl.calculateMoles();\n let solvs = this.solvents;\n for(var i = 0; i < solvs.length; i++){\n // If any solvents are ChemicalSolutions, they are invalid, return -1\n if(solvs[i] instanceof ChemicalSolution) return -1;\n chemControl.setChemical(solvs[i]);\n total += chemControl.calculateMoles();\n }\n\n // Divide the mass by the number of moles\n return this.getMass() / total;\n }", "title": "" }, { "docid": "7521dc05c0664f701bc827258413f62e", "score": "0.60786587", "text": "function computeMassRichSequence(richSeq, charge) {\n\n var rawMass = 0;\n\n _.each(richSeq.get('sequence'), function(raa) {\n rawMass += computeMassRichAA(raa)\n });\n\n rawMass += MASS_OH + MASS_H;\n rawMass += computeMassModifArray(richSeq.get('nTermModifications')) + computeMassModifArray(richSeq.get('cTermModifications'));\n if (!charge) {\n return rawMass\n }\n return rawMass / charge + MASS_HPLUS;\n }", "title": "" }, { "docid": "7521dc05c0664f701bc827258413f62e", "score": "0.60786587", "text": "function computeMassRichSequence(richSeq, charge) {\n\n var rawMass = 0;\n\n _.each(richSeq.get('sequence'), function(raa) {\n rawMass += computeMassRichAA(raa)\n });\n\n rawMass += MASS_OH + MASS_H;\n rawMass += computeMassModifArray(richSeq.get('nTermModifications')) + computeMassModifArray(richSeq.get('cTermModifications'));\n if (!charge) {\n return rawMass\n }\n return rawMass / charge + MASS_HPLUS;\n }", "title": "" }, { "docid": "e0b2a16e0928ba446aa349feb3cd8a1b", "score": "0.5926301", "text": "function getListOfModuleMass(){\n return [118868,88841,133680,148066,70887,93213,124243,92767,71322,86793,53650,102703,146958,53031,148282,124989,74375,122044,122693,74204,74869,81803,124436,68495,74865,70765,81537,61376,145342,137159,115230,119293,147126,130191,131330,122891,135407,116334,130325,138521,71955,53806,122260,102573,70032,75981,111555,135654,50805,122186,138172,96422,124781,55894,54337,149926,63809,146163,55131,55796,92771,80288,111619,134602,82245,72505,117209,92383,149101,135399,112166,134000,88771,63963,103731,74915,146347,125390,126249,131534,142038,55327,58784,85003,65909,89879,128715,138559,146209,145040,116032,130046,131664,125899,141918,88426,50488,67943,79677,94858];\n}", "title": "" }, { "docid": "d62c20245eac7e2f1bdc494022776532", "score": "0.5746884", "text": "get mass()\n {\n return this.baseMass;\n }", "title": "" }, { "docid": "ea38636265236349efbf2334e92e18ef", "score": "0.5686495", "text": "function calcularModa(lista) {\n let lista1count = {};\n let contador = 0;\n let posicionModa = 0;\n let multimoda = [];\n lista.map(function (elemento) {\n if (lista1count[elemento]) {\n lista1count[elemento] += 1;\n if (lista1count[elemento] > contador) {\n contador = lista1count[elemento];\n }\n } else {\n lista1count[elemento] = 1;\n }\n });\n\n for (valor in lista1count) {\n if (lista1count[valor] === contador) {\n multimoda[posicionModa] = valor;\n posicionModa++;\n }\n }\n return multimoda;\n}", "title": "" }, { "docid": "3321963a2b0d56c05eabcc326a816f95", "score": "0.5635791", "text": "setMass(rng) {\n this.mass = 4 * (10 ** (((rng() + rng()) * 3) - 3));\n }", "title": "" }, { "docid": "66aa8b20f6821b4ce9781e55a2fddf79", "score": "0.5608117", "text": "setCalculatedMass(){\n super.setMass(this.calculateMass());\n }", "title": "" }, { "docid": "cde36614bf386bbdb8e082de7458f06d", "score": "0.55943596", "text": "function calcularModa(lista) {\n /**Objeto que almacenara cuantas veces se repite cada elemento del array*/\n const listaCount = {};\n \n /**Llenamos el objeto a traves del metodo map() el array que recorre el mismo y suma + 1 cada que encuentra un elemento similar */\n lista.map(\n function (elemento) {\n if (listaCount[elemento]) {\n listaCount[elemento] += 1;\n } else {\n listaCount[elemento] = 1;\n }\n }\n );\n \n /** Genera lista que almacena en arrays el numero y las veces que aparece ej: [[\"2\",5], [\"8\",2]]\n * Ordena la lista con el metodo sort que toma el segundo elemento de cada array interno.*/\n const listaArray = Object.entries(listaCount).sort(\n function (elementoA, elementoB) {\n return elementoA[1] - elementoB[1];\n }\n );\n \n /**La moda es el ultimo elemento de la lista de arrays ya que es el que tiene mayores repeticiones */\n const moda = listaArray[listaArray.length - 1];\n return moda;\n}", "title": "" }, { "docid": "b6648d2668685695fa4ebe7f4477060b", "score": "0.55766773", "text": "updateMass() {\n this.mass--;\n }", "title": "" }, { "docid": "068eec1a3ce42f9154c5286e30ec2d1c", "score": "0.5576485", "text": "function mass(force, acc)\n{\n // CODE\n let mass = force / acc;\n\n // Returning the answer\n return mass;\n}", "title": "" }, { "docid": "9669fd6ef4460d4270ccce177ee29cf8", "score": "0.5574413", "text": "function calcMcu(malts) {\n var totalMcu = 0;\n var amount;\n var colour;\n var batchVol = unitConverter[gon.userPref.volume]['G'](parseFloat($('#volume-display').val()));\n\n if(batchVol == 0 || isNaN(batchVol))\n return 0;\n\n //loop through the malts, multiply colour (in SRM)\n //with amount (in lbs) for each, then add to total mcu\n malts.forEach(function(malt) {\n amount = unitConverter[gon.userPref.weight_big]['I'](malt.qty);\n colour = malt.colour || 0;\n\n totalMcu += amount * colour;\n });\n\n return totalMcu / batchVol;\n}", "title": "" }, { "docid": "a61dfeff7c2bc869276a42175b560fba", "score": "0.5567643", "text": "function computeMassRichAA(raa) {\n return raa.aa.get('mass') + computeMassModifArray(raa.modifications);\n }", "title": "" }, { "docid": "a61dfeff7c2bc869276a42175b560fba", "score": "0.5567643", "text": "function computeMassRichAA(raa) {\n return raa.aa.get('mass') + computeMassModifArray(raa.modifications);\n }", "title": "" }, { "docid": "578cdf45446882235f4020624cd2463a", "score": "0.544411", "text": "function calculateTotals(){\n\tfor (var i = 0; i < scores.length; i++) {\n\t\ttotals[i].value = parseInt(scores[i].value) + parseInt(raceBonus[i].value);\n\t\tmods[i].value = Math.floor((parseInt(totals[i].value) - 10)/2);\t\n\t}\n\t// calculateModifiers();\n}", "title": "" }, { "docid": "a863d2546b15c34d059aeccd7f93b559", "score": "0.543179", "text": "setMass(mass){\n let oldMass = this.getMass();\n if(oldMass <= 0) return;\n let ratio = mass / oldMass;\n\n this.solute.setMass(this.solute.getMass() * ratio);\n\n let solvs = this.solvents;\n for(var i = 0; i < solvs.length; i++){\n solvs[i].setMass(solvs[i].getMass() * ratio);\n }\n super.setMass(mass);\n }", "title": "" }, { "docid": "16aa86f1c42bf4396ac7fb0fa9c5e9c1", "score": "0.5407915", "text": "mineProbabilitiesPerNumberOfMines() {\n let numberOfMinesToSummedValues = new Map();\n let combinationsPerNumberOfMines = new Map();\n // map from mines in configuration to summed values and accumulate number of combinations\n this.actOnAllConfigurations((cellValues) => {\n let minesInConfiguration = 0;\n cellValues.forEach(value => minesInConfiguration += value);\n if (!numberOfMinesToSummedValues.has(minesInConfiguration)) {\n numberOfMinesToSummedValues.set(minesInConfiguration, new Map());\n combinationsPerNumberOfMines.set(minesInConfiguration, 0);\n }\n let cellValuesSummed = numberOfMinesToSummedValues.get(minesInConfiguration);\n for (let [cell, value] of cellValues.entries()) {\n cellValuesSummed.set(cell, value + (cellValuesSummed.get(cell) || 0));\n }\n combinationsPerNumberOfMines.set(minesInConfiguration, 1 + combinationsPerNumberOfMines.get(minesInConfiguration));\n });\n // divide by number of combinations to get probability\n let numberOfMinesToProbabilityMap = numberOfMinesToSummedValues;\n for (let [numberOfMines, summedNumberOfMinesMap] of numberOfMinesToProbabilityMap) {\n let combinations = combinationsPerNumberOfMines.get(numberOfMines);\n summedNumberOfMinesMap.forEach((value, cell) => summedNumberOfMinesMap.set(cell, value / combinations));\n }\n return [numberOfMinesToProbabilityMap, combinationsPerNumberOfMines];\n }", "title": "" }, { "docid": "4f9a5b2c6ccce87826cb2ef4d8291d8f", "score": "0.53846824", "text": "makeMass(_mass){\r\n Matter.Body.setMass(this.bod, _mass);\r\n }", "title": "" }, { "docid": "c2055b78ce1c86331bc4c9d42452cd70", "score": "0.5381984", "text": "multItems() {\n this.modifyItems(function (item) {\n item.nb *= this.nb;\n });\n }", "title": "" }, { "docid": "39361410997a3bfe277369500c05b727", "score": "0.5361079", "text": "function formula() {\n var i, j, A;\n var found, num;\n var molweight;\n var molformula = new Array();\n var formulaStr=\"Formula = \";\n var molecule = Mol();\n\n // If no molecule loaded, return\n if (molecule[0].numatoms < 1)\n return;\n\n // Look for carbon and place in first slot\n num = 0;\n for (i=1; i<=molecule[0].numatoms; i++)\n if ( molecule[i].atomicnumber == 6 ) {\n molformula[num] = [];\n molformula[num][0] = 6;\n molformula[num][1] = 0;\n num++;\n i = molecule[0].numatoms+1;\n }\n\n // Look for hydrogen in next slot\n for (i=1; i<=molecule[0].numatoms; i++)\n if ( molecule[i].atomicnumber == 1 ) {\n molformula[num] = [];\n molformula[num][0] = 1;\n molformula[num][1] = 0;\n num++;\n i = molecule[0].numatoms+1;\n }\n\n // Loop over all atoms in molecule\n for (i=1; i<=molecule[0].numatoms; i++) {\n A = molecule[i].atomicnumber;\n found = 0;\n for (j=0; j < num; j++) {\n if (molformula[j][0] == A) {\n molformula[j][1]++;\n found = 1;\n j = num;\n }\n }\n if (found == 0) {\n molformula[num] = new Array(2);\n molformula[num][0] = molecule[i].atomicnumber;\n molformula[num][1] = 1;\n num++;\n }\n }\n\n // Calculate molecular weight and output formula\n molweight = 0.0;\n molecule[0].formula = \"\";\n for (i=0; i<num; i++) {\n A = molformula[i][0];\n molweight += element(A,\"mass\") * molformula[i][1];\n formulaStr += element(A,\"symbol\");\n molecule[0].formula += element(A,\"symbol\");\n if (molformula[i][1] > 1) {\n formulaStr += \"<sub>\"+molformula[i][1]+\"</sub>\";\n molecule[0].formula += molformula[i][1] + \" \";\n }\n }\n molecule[0].weight = molweight;\n\n // Write formula to screen\n if (activeWin()=='molRef') $('forRef').innerHTML = formulaStr;\n if (activeWin()=='molFit') $('forFit').innerHTML = formulaStr;\n if ( molweight > 0.0 )\n InfoWin(molecule[0].formula+\" has a molecular weight of \"+molweight.toFixed(2)+\"\\n\");\n // End formula routine\n\tshowLabels()\n\tvar str=''\n\tfor (i=1; i<=molecule[0].numatoms; i++) str += i+'\\n'\n\n if (activeWin()=='molRef') $('idxRef').value = str;\n if (activeWin()=='molFit') $('idxFit').value = str;\n\n }", "title": "" }, { "docid": "aefdb10d7b03ce51382c3bb989d28bf6", "score": "0.53603077", "text": "function montReduce(x) {\n\twhile (x.t <= this.mt2)\n\t\t// pad x so am has enough room later\n\t\tx[x.t++] = 0;\n\tfor ( var i = 0; i < this.m.t; ++i) {\n\t\t// faster way of calculating u0 = x[i]*mp mod DV\n\t\tvar j = x[i] & 0x7fff;\n\t\tvar u0 = (j * this.mpl + (((j * this.mph + (x[i] >> 15) * this.mpl) & this.um) << 15))\n\t\t\t\t& x.DM;\n\t\t// use am to combine the multiply-shift-add into one call\n\t\tj = i + this.m.t;\n\t\tx[j] += this.m.am(0, u0, x, i, 0, this.m.t);\n\t\t// propagate carry\n\t\twhile (x[j] >= x.DV) {\n\t\t\tx[j] -= x.DV;\n\t\t\tx[++j]++;\n\t\t}\n\t}\n\tx.clamp();\n\tx.drShiftTo(this.m.t, x);\n\tif (x.compareTo(this.m) >= 0)\n\t\tx.subTo(this.m, x);\n}", "title": "" }, { "docid": "6986d1bbcb137971234657f5c3fddfcd", "score": "0.5350203", "text": "function totalEnergy(moon) {\n const potential = moon.position.map(Math.abs).reduce((p,c) => p + c, 0)\n const kinetic = moon.velocity.map(Math.abs).reduce((p,c) => p + c, 0)\n return potential * kinetic\n}", "title": "" }, { "docid": "46ee6630be34af41f9224c171b139cc1", "score": "0.53495324", "text": "function Summation(m) {\n total = 0;\n \n for (i = m; i >= 0; i--) { \n if ( i === 0) {\n return total;\n } else {\n total += ElementReductions[i-1]*hgt + barPadding*PaddingReductions[i]; \n } \n }\n}", "title": "" }, { "docid": "c11d15fb388e842b67b04c72aa5c75f1", "score": "0.53455764", "text": "function Peptide(seq, staticModifications, varModifications, ntermModification, ctermModification) {\n\t\n\tvar sequence = seq;\n\tvar ntermMod = ntermModification;\n\tvar ctermMod = ctermModification;\n\tvar staticMods = [];\n\tif(staticModifications) {\n\t\tfor(var i = 0; i < staticModifications.length; i += 1) {\n\t\t\tvar mod = staticModifications[i];\n\t\t\tstaticMods[mod.aa.code] = mod;\n\t\t}\n\t}\n\t\n\tvar varMods = [];\n\tif(varModifications) {\n\t\tfor(var i = 0; i < varModifications.length; i += 1) {\n\t\t\tvar mod = varModifications[i];\n\t\t\tvarMods[mod.position] = mod;\n\t\t}\n\t}\n\n this.sequence = function () {\n return sequence;\n }\n\n this.varMods = function() {\n return varMods;\n }\n\n this.staticMods = function() {\n return staticMods;\n }\n\n // index: index in the seq.\n // If this is a N-term sequence we will sum up the mass of the amino acids in the sequence up-to index (exclusive).\n // If this is a C-term sequence we will sum up the mass of the amino acids in the sequence starting from index (inclusive)\n // modification masses are added\n this.getSeqMassMono = function _seqMassMono(index, term) {\n return _getSeqMass(null, index, term, \"mono\");\n }\n\n\n // index: index in the seq.\n // If this is a N-term sequence we will sum up the mass of the amino acids in the sequence up-to index (exclusive).\n // If this is a C-term sequence we will sum up the mass of the amino acids in the sequence starting from index (inclusive)\n // modification masses are added\n this.getSeqMassAvg = function _seqMassAvg(index, term) {\n return _getSeqMass(null, index, term, \"avg\");\n }\n\n // index: index in the seq.\n // If this is a N-term sequence we will sum up the mass of the amino acids in the sequence up-to index (exclusive).\n // If this is a C-term sequence we will sum up the mass of the amino acids in the sequence starting from index (inclusive)\n // modification masses are added\n this.getSeqMass = _getSeqMass;\n\n\n\n // Returns the monoisotopic neutral mass of the peptide; modifications added. N-term H and C-term OH are added\n this.getNeutralMassMono = function _massNeutralMono() {\n\n var mass = 0;\n var aa_obj = new AminoAcid();\n if(sequence) {\n for(var i = 0; i < sequence.length; i++) {\n var aa = aa_obj.get(sequence.charAt(i));\n mass += aa.mono;\n }\n }\n\n mass = _addTerminalModMass(mass, \"n\");\n mass = _addTerminalModMass(mass, \"c\");\n mass = _addResidueModMasses(mass, sequence.length, \"n\");\n // add N-terminal H\n mass = mass + Ion.MASS_H_1;\n // add C-terminal OH\n mass = mass + Ion.MASS_O_16 + Ion.MASS_H_1;\n\n return mass;\n }\n\n //Returns the avg neutral mass of the peptide; modifications added. N-term H and C-term OH are added\n this.getNeutralMassAvg = function _massNeutralAvg() {\n\n var mass = 0;\n var aa_obj = new AminoAcid();\n if(sequence) {\n for(var i = 0; i < sequence.length; i++) {\n var aa = aa_obj.get(sequence.charAt(i));\n mass += aa.avg;\n }\n }\n\n mass = _addTerminalModMass(mass, \"n\");\n mass = _addTerminalModMass(mass, \"c\");\n mass = _addResidueModMasses(mass, sequence.length, \"n\");\n // add N-terminal H\n mass = mass + Ion.MASS_H;\n // add C-terminal OH\n mass = mass + Ion.MASS_O + Ion.MASS_H;\n\n return mass;\n }\n\n function _addResidueModMasses(seqMass, slice, term) {\n\n var mass = seqMass;\n if(typeof(slice) == \"number\")\n slice = new _Slice(null, slice, term);\n for( var i = slice.from; i < slice.to; i += 1) {\n // add any static modifications\n var mod = staticMods[sequence.charAt(i)];\n if(mod) {\n mass += mod.modMass;\n }\n // add any variable modifications\n mod = varMods[i+1]; // varMods index in the sequence is 1-based\n if(mod) {\n mass += mod.modMass;\n }\n }\n\n return mass;\n }\n\n this.getSubSequence = function _getSubSeq(endIndex, term) {\n var slice = new _Slice(null, endIndex, term);\n var subSequence = ''\n if(sequence) {\n for( var i = slice.from; i < slice.to; i += 1) {\n subSequence += sequence[i];\n }\n }\n return subSequence;\n }\n\n function _getSeqMass(startIndex, endIndex, term, massType) {\n\n var mass = 0;\n var aa_obj = new AminoAcid();\n var slice = new _Slice(startIndex, endIndex, term);\n if(sequence) {\n for( var i = slice.from; i < slice.to; i += 1) {\n var aa = aa_obj.get(sequence[i]);\n mass += aa[massType];\n }\n }\n if(startIndex == null)\n mass = _addTerminalModMass(mass, term);\n mass = _addResidueModMasses(mass, slice, term);\n return mass;\n }\n\n\n function _addTerminalModMass(seqMass, term) {\n\n var mass = seqMass;\n // add any terminal modifications\n if(term == \"n\" && ntermMod)\n mass += ntermMod;\n if(term == \"c\" && ctermMod)\n mass += ctermMod;\n\n return mass;\n }\n\n // Defines a range or subsequence of peptide to iterate over.\n // If term is \"n\", than the range is from startIndex (or 0 if \n // startIndex is null) to endIndex. If term is \"c\", the range is \n // from endIndex to startIndex (or sequence.length if startIndex\n // is null).\n function _Slice(startIndex, endIndex, term) {\n if(term == \"n\") {\n // If N-term sense, start from begining \n this.from = startIndex == null ? 0 : startIndex;\n this.to = endIndex;\n }\n if(term == \"c\") {\n this.from = endIndex;\n this.to = startIndex == null ? sequence.length : startIndex;\n }\n }\n}", "title": "" }, { "docid": "7d5e21f54a366c40af7645adee6cb900", "score": "0.53439194", "text": "function montReduce(x) {\n while (x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for (var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i] & 0x7fff;\n var u0 = (j * this.mpl + (((j * this.mph + (x[i] >> 15) * this.mpl) & this.um) << 15)) & x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i + this.m.t;\n x[j] += this.m.am(0, u0, x, i, 0, this.m.t);\n // propagate carry\n while (x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t, x);\n if (x.compareTo(this.m) >= 0) x.subTo(this.m, x);\n }", "title": "" }, { "docid": "4bbc5a34ee4ce96bd45b1a1d6f62c3a2", "score": "0.53390425", "text": "function montReduce(x) {\n while (x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0\n for (var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i] & 0x7fff\n var u0 = (j * this.mpl + (((j * this.mph + (x[i] >> 15) * this.mpl) & this.um) << 15)) & x.DM\n // use am to combine the multiply-shift-add into one call\n j = i + this.m.t\n x[j] += this.m.am(0, u0, x, i, 0, this.m.t)\n // propagate carry\n while (x[j] >= x.DV) {\n x[j] -= x.DV\n x[++j]++\n }\n }\n x.clamp()\n x.drShiftTo(this.m.t, x)\n if (x.compareTo(this.m) >= 0) x.subTo(this.m, x)\n}", "title": "" }, { "docid": "4bbc5a34ee4ce96bd45b1a1d6f62c3a2", "score": "0.53390425", "text": "function montReduce(x) {\n while (x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0\n for (var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i] & 0x7fff\n var u0 = (j * this.mpl + (((j * this.mph + (x[i] >> 15) * this.mpl) & this.um) << 15)) & x.DM\n // use am to combine the multiply-shift-add into one call\n j = i + this.m.t\n x[j] += this.m.am(0, u0, x, i, 0, this.m.t)\n // propagate carry\n while (x[j] >= x.DV) {\n x[j] -= x.DV\n x[++j]++\n }\n }\n x.clamp()\n x.drShiftTo(this.m.t, x)\n if (x.compareTo(this.m) >= 0) x.subTo(this.m, x)\n}", "title": "" }, { "docid": "4bbc5a34ee4ce96bd45b1a1d6f62c3a2", "score": "0.53390425", "text": "function montReduce(x) {\n while (x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0\n for (var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i] & 0x7fff\n var u0 = (j * this.mpl + (((j * this.mph + (x[i] >> 15) * this.mpl) & this.um) << 15)) & x.DM\n // use am to combine the multiply-shift-add into one call\n j = i + this.m.t\n x[j] += this.m.am(0, u0, x, i, 0, this.m.t)\n // propagate carry\n while (x[j] >= x.DV) {\n x[j] -= x.DV\n x[++j]++\n }\n }\n x.clamp()\n x.drShiftTo(this.m.t, x)\n if (x.compareTo(this.m) >= 0) x.subTo(this.m, x)\n}", "title": "" }, { "docid": "4bbc5a34ee4ce96bd45b1a1d6f62c3a2", "score": "0.53390425", "text": "function montReduce(x) {\n while (x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0\n for (var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i] & 0x7fff\n var u0 = (j * this.mpl + (((j * this.mph + (x[i] >> 15) * this.mpl) & this.um) << 15)) & x.DM\n // use am to combine the multiply-shift-add into one call\n j = i + this.m.t\n x[j] += this.m.am(0, u0, x, i, 0, this.m.t)\n // propagate carry\n while (x[j] >= x.DV) {\n x[j] -= x.DV\n x[++j]++\n }\n }\n x.clamp()\n x.drShiftTo(this.m.t, x)\n if (x.compareTo(this.m) >= 0) x.subTo(this.m, x)\n}", "title": "" }, { "docid": "4bbc5a34ee4ce96bd45b1a1d6f62c3a2", "score": "0.53390425", "text": "function montReduce(x) {\n while (x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0\n for (var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i] & 0x7fff\n var u0 = (j * this.mpl + (((j * this.mph + (x[i] >> 15) * this.mpl) & this.um) << 15)) & x.DM\n // use am to combine the multiply-shift-add into one call\n j = i + this.m.t\n x[j] += this.m.am(0, u0, x, i, 0, this.m.t)\n // propagate carry\n while (x[j] >= x.DV) {\n x[j] -= x.DV\n x[++j]++\n }\n }\n x.clamp()\n x.drShiftTo(this.m.t, x)\n if (x.compareTo(this.m) >= 0) x.subTo(this.m, x)\n}", "title": "" }, { "docid": "4bbc5a34ee4ce96bd45b1a1d6f62c3a2", "score": "0.53390425", "text": "function montReduce(x) {\n while (x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0\n for (var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i] & 0x7fff\n var u0 = (j * this.mpl + (((j * this.mph + (x[i] >> 15) * this.mpl) & this.um) << 15)) & x.DM\n // use am to combine the multiply-shift-add into one call\n j = i + this.m.t\n x[j] += this.m.am(0, u0, x, i, 0, this.m.t)\n // propagate carry\n while (x[j] >= x.DV) {\n x[j] -= x.DV\n x[++j]++\n }\n }\n x.clamp()\n x.drShiftTo(this.m.t, x)\n if (x.compareTo(this.m) >= 0) x.subTo(this.m, x)\n}", "title": "" }, { "docid": "4bbc5a34ee4ce96bd45b1a1d6f62c3a2", "score": "0.53390425", "text": "function montReduce(x) {\n while (x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0\n for (var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i] & 0x7fff\n var u0 = (j * this.mpl + (((j * this.mph + (x[i] >> 15) * this.mpl) & this.um) << 15)) & x.DM\n // use am to combine the multiply-shift-add into one call\n j = i + this.m.t\n x[j] += this.m.am(0, u0, x, i, 0, this.m.t)\n // propagate carry\n while (x[j] >= x.DV) {\n x[j] -= x.DV\n x[++j]++\n }\n }\n x.clamp()\n x.drShiftTo(this.m.t, x)\n if (x.compareTo(this.m) >= 0) x.subTo(this.m, x)\n}", "title": "" }, { "docid": "4bbc5a34ee4ce96bd45b1a1d6f62c3a2", "score": "0.53390425", "text": "function montReduce(x) {\n while (x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0\n for (var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i] & 0x7fff\n var u0 = (j * this.mpl + (((j * this.mph + (x[i] >> 15) * this.mpl) & this.um) << 15)) & x.DM\n // use am to combine the multiply-shift-add into one call\n j = i + this.m.t\n x[j] += this.m.am(0, u0, x, i, 0, this.m.t)\n // propagate carry\n while (x[j] >= x.DV) {\n x[j] -= x.DV\n x[++j]++\n }\n }\n x.clamp()\n x.drShiftTo(this.m.t, x)\n if (x.compareTo(this.m) >= 0) x.subTo(this.m, x)\n}", "title": "" }, { "docid": "4bbc5a34ee4ce96bd45b1a1d6f62c3a2", "score": "0.53390425", "text": "function montReduce(x) {\n while (x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0\n for (var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i] & 0x7fff\n var u0 = (j * this.mpl + (((j * this.mph + (x[i] >> 15) * this.mpl) & this.um) << 15)) & x.DM\n // use am to combine the multiply-shift-add into one call\n j = i + this.m.t\n x[j] += this.m.am(0, u0, x, i, 0, this.m.t)\n // propagate carry\n while (x[j] >= x.DV) {\n x[j] -= x.DV\n x[++j]++\n }\n }\n x.clamp()\n x.drShiftTo(this.m.t, x)\n if (x.compareTo(this.m) >= 0) x.subTo(this.m, x)\n}", "title": "" }, { "docid": "4bbc5a34ee4ce96bd45b1a1d6f62c3a2", "score": "0.53390425", "text": "function montReduce(x) {\n while (x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0\n for (var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i] & 0x7fff\n var u0 = (j * this.mpl + (((j * this.mph + (x[i] >> 15) * this.mpl) & this.um) << 15)) & x.DM\n // use am to combine the multiply-shift-add into one call\n j = i + this.m.t\n x[j] += this.m.am(0, u0, x, i, 0, this.m.t)\n // propagate carry\n while (x[j] >= x.DV) {\n x[j] -= x.DV\n x[++j]++\n }\n }\n x.clamp()\n x.drShiftTo(this.m.t, x)\n if (x.compareTo(this.m) >= 0) x.subTo(this.m, x)\n}", "title": "" }, { "docid": "aea28f0ae90c083f750825066ead6d8f", "score": "0.5317768", "text": "function montReduce(x)\n{\n while (x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for (var i = 0; i < this.m.t; ++i)\n {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i] & 0x7fff;\n var u0 = (j * this.mpl + (((j * this.mph + (x[i] >> 15) * this.mpl) & this.um) << 15)) & x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i + this.m.t;\n x[j] += this.m.am(0, u0, x, i, 0, this.m.t);\n // propagate carry\n while (x[j] >= x.DV)\n {\n x[j] -= x.DV;\n x[++j]++;\n }\n }\n x.clamp();\n x.drShiftTo(this.m.t, x);\n if (x.compareTo(this.m) >= 0) x.subTo(this.m, x);\n}", "title": "" }, { "docid": "9adef8aedac94f003b1fdfda6f477ec0", "score": "0.5317454", "text": "function montReduce(x) {\n while (x.t <= this.mt2) {\n // pad x so am has enough room later\n x[x.t++] = 0;\n }for (var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i] & 0x7fff;\n var u0 = j * this.mpl + ((j * this.mph + (x[i] >> 15) * this.mpl & this.um) << 15) & x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i + this.m.t;\n x[j] += this.m.am(0, u0, x, i, 0, this.m.t);\n // propagate carry\n while (x[j] >= x.DV) {\n x[j] -= x.DV;x[++j]++;\n }\n }\n x.clamp();\n x.drShiftTo(this.m.t, x);\n if (x.compareTo(this.m) >= 0) x.subTo(this.m, x);\n }", "title": "" }, { "docid": "71b190601e9ad1445c5cfd54efab944b", "score": "0.5315101", "text": "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "title": "" }, { "docid": "71b190601e9ad1445c5cfd54efab944b", "score": "0.5315101", "text": "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "title": "" }, { "docid": "71b190601e9ad1445c5cfd54efab944b", "score": "0.5315101", "text": "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "title": "" }, { "docid": "71b190601e9ad1445c5cfd54efab944b", "score": "0.5315101", "text": "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "title": "" }, { "docid": "71b190601e9ad1445c5cfd54efab944b", "score": "0.5315101", "text": "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "title": "" }, { "docid": "71b190601e9ad1445c5cfd54efab944b", "score": "0.5315101", "text": "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "title": "" }, { "docid": "71b190601e9ad1445c5cfd54efab944b", "score": "0.5315101", "text": "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "title": "" }, { "docid": "71b190601e9ad1445c5cfd54efab944b", "score": "0.5315101", "text": "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "title": "" }, { "docid": "71b190601e9ad1445c5cfd54efab944b", "score": "0.5315101", "text": "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "title": "" }, { "docid": "71b190601e9ad1445c5cfd54efab944b", "score": "0.5315101", "text": "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "title": "" }, { "docid": "71b190601e9ad1445c5cfd54efab944b", "score": "0.5315101", "text": "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "title": "" }, { "docid": "71b190601e9ad1445c5cfd54efab944b", "score": "0.5315101", "text": "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "title": "" }, { "docid": "71b190601e9ad1445c5cfd54efab944b", "score": "0.5315101", "text": "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "title": "" }, { "docid": "71b190601e9ad1445c5cfd54efab944b", "score": "0.5315101", "text": "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "title": "" }, { "docid": "71b190601e9ad1445c5cfd54efab944b", "score": "0.5315101", "text": "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "title": "" }, { "docid": "9929e31ae2fd057323e7f0b4c03a5cf9", "score": "0.5310516", "text": "function montReduce(x) {\n while (x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for (var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i] & 0x7fff;\n var u0 = (j * this.mpl + (((j * this.mph + (x[i] >> 15) * this.mpl) & this.um) << 15)) & x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i + this.m.t;\n x[j] += this.m.am(0, u0, x, i, 0, this.m.t);\n // propagate carry\n while (x[j] >= x.DV) {\n x[j] -= x.DV;\n x[++j]++;\n }\n }\n x.clamp();\n x.drShiftTo(this.m.t, x);\n if (x.compareTo(this.m) >= 0) x.subTo(this.m, x);\n}", "title": "" }, { "docid": "9929e31ae2fd057323e7f0b4c03a5cf9", "score": "0.5310516", "text": "function montReduce(x) {\n while (x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for (var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i] & 0x7fff;\n var u0 = (j * this.mpl + (((j * this.mph + (x[i] >> 15) * this.mpl) & this.um) << 15)) & x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i + this.m.t;\n x[j] += this.m.am(0, u0, x, i, 0, this.m.t);\n // propagate carry\n while (x[j] >= x.DV) {\n x[j] -= x.DV;\n x[++j]++;\n }\n }\n x.clamp();\n x.drShiftTo(this.m.t, x);\n if (x.compareTo(this.m) >= 0) x.subTo(this.m, x);\n}", "title": "" }, { "docid": "462a7f3e820516804ce701f3257b7b2f", "score": "0.53105116", "text": "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x.arr[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x.arr[i]*mp mod DV\n var j = x.arr[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x.arr[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x.arr[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x.arr[j] >= x.DV) { x.arr[j] -= x.DV; x.arr[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n}", "title": "" }, { "docid": "462a7f3e820516804ce701f3257b7b2f", "score": "0.53105116", "text": "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x.arr[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x.arr[i]*mp mod DV\n var j = x.arr[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x.arr[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x.arr[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x.arr[j] >= x.DV) { x.arr[j] -= x.DV; x.arr[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n}", "title": "" }, { "docid": "8b39fc6156499c57d293a39adfcf6abe", "score": "0.5302226", "text": "function montReduce(x) {\n while(x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "title": "" }, { "docid": "f848149fd8ae66033012b185f1c904ba", "score": "0.5297804", "text": "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n}", "title": "" }, { "docid": "f848149fd8ae66033012b185f1c904ba", "score": "0.5297804", "text": "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n}", "title": "" }, { "docid": "f848149fd8ae66033012b185f1c904ba", "score": "0.5297804", "text": "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n}", "title": "" }, { "docid": "f848149fd8ae66033012b185f1c904ba", "score": "0.5297804", "text": "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n}", "title": "" }, { "docid": "f848149fd8ae66033012b185f1c904ba", "score": "0.5297804", "text": "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n}", "title": "" }, { "docid": "b7fcb3a8ca5edc81e32ee392f3cb9a42", "score": "0.5295822", "text": "function montReduce(x) {\n\t while (x.t <= this.mt2) // pad x so am has enough room later\n\t x[x.t++] = 0\n\t for (var i = 0; i < this.m.t; ++i) {\n\t // faster way of calculating u0 = x[i]*mp mod DV\n\t var j = x[i] & 0x7fff\n\t var u0 = (j * this.mpl + (((j * this.mph + (x[i] >> 15) * this.mpl) & this.um) << 15)) & x.DM\n\t // use am to combine the multiply-shift-add into one call\n\t j = i + this.m.t\n\t x[j] += this.m.am(0, u0, x, i, 0, this.m.t)\n\t // propagate carry\n\t while (x[j] >= x.DV) {\n\t x[j] -= x.DV\n\t x[++j]++\n\t }\n\t }\n\t x.clamp()\n\t x.drShiftTo(this.m.t, x)\n\t if (x.compareTo(this.m) >= 0) x.subTo(this.m, x)\n\t}", "title": "" }, { "docid": "62066a9b5c79540f3ef5c692e048c263", "score": "0.5295615", "text": "function montReduce(x) {\n\t while(x.t <= this.mt2) // pad x so am has enough room later\n\t x[x.t++] = 0;\n\t for(var i = 0; i < this.m.t; ++i) {\n\t // faster way of calculating u0 = x[i]*mp mod DV\n\t var j = x[i]&0x7fff;\n\t var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n\t // use am to combine the multiply-shift-add into one call\n\t j = i+this.m.t;\n\t x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n\t // propagate carry\n\t while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n\t }\n\t x.clamp();\n\t x.drShiftTo(this.m.t,x);\n\t if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n\t }", "title": "" }, { "docid": "62066a9b5c79540f3ef5c692e048c263", "score": "0.5295615", "text": "function montReduce(x) {\n\t while(x.t <= this.mt2) // pad x so am has enough room later\n\t x[x.t++] = 0;\n\t for(var i = 0; i < this.m.t; ++i) {\n\t // faster way of calculating u0 = x[i]*mp mod DV\n\t var j = x[i]&0x7fff;\n\t var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n\t // use am to combine the multiply-shift-add into one call\n\t j = i+this.m.t;\n\t x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n\t // propagate carry\n\t while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n\t }\n\t x.clamp();\n\t x.drShiftTo(this.m.t,x);\n\t if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n\t }", "title": "" }, { "docid": "62066a9b5c79540f3ef5c692e048c263", "score": "0.5295615", "text": "function montReduce(x) {\n\t while(x.t <= this.mt2) // pad x so am has enough room later\n\t x[x.t++] = 0;\n\t for(var i = 0; i < this.m.t; ++i) {\n\t // faster way of calculating u0 = x[i]*mp mod DV\n\t var j = x[i]&0x7fff;\n\t var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n\t // use am to combine the multiply-shift-add into one call\n\t j = i+this.m.t;\n\t x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n\t // propagate carry\n\t while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n\t }\n\t x.clamp();\n\t x.drShiftTo(this.m.t,x);\n\t if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n\t }", "title": "" }, { "docid": "62066a9b5c79540f3ef5c692e048c263", "score": "0.5295615", "text": "function montReduce(x) {\n\t while(x.t <= this.mt2) // pad x so am has enough room later\n\t x[x.t++] = 0;\n\t for(var i = 0; i < this.m.t; ++i) {\n\t // faster way of calculating u0 = x[i]*mp mod DV\n\t var j = x[i]&0x7fff;\n\t var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n\t // use am to combine the multiply-shift-add into one call\n\t j = i+this.m.t;\n\t x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n\t // propagate carry\n\t while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n\t }\n\t x.clamp();\n\t x.drShiftTo(this.m.t,x);\n\t if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n\t }", "title": "" }, { "docid": "62066a9b5c79540f3ef5c692e048c263", "score": "0.5295615", "text": "function montReduce(x) {\n\t while(x.t <= this.mt2) // pad x so am has enough room later\n\t x[x.t++] = 0;\n\t for(var i = 0; i < this.m.t; ++i) {\n\t // faster way of calculating u0 = x[i]*mp mod DV\n\t var j = x[i]&0x7fff;\n\t var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n\t // use am to combine the multiply-shift-add into one call\n\t j = i+this.m.t;\n\t x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n\t // propagate carry\n\t while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n\t }\n\t x.clamp();\n\t x.drShiftTo(this.m.t,x);\n\t if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n\t }", "title": "" }, { "docid": "62066a9b5c79540f3ef5c692e048c263", "score": "0.5295615", "text": "function montReduce(x) {\n\t while(x.t <= this.mt2) // pad x so am has enough room later\n\t x[x.t++] = 0;\n\t for(var i = 0; i < this.m.t; ++i) {\n\t // faster way of calculating u0 = x[i]*mp mod DV\n\t var j = x[i]&0x7fff;\n\t var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n\t // use am to combine the multiply-shift-add into one call\n\t j = i+this.m.t;\n\t x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n\t // propagate carry\n\t while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n\t }\n\t x.clamp();\n\t x.drShiftTo(this.m.t,x);\n\t if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n\t }", "title": "" }, { "docid": "4098a98f030b3b314570712e65965900", "score": "0.52925044", "text": "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x.data[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x.data[i]*mp mod DV\n var j = x.data[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x.data[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x.data[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x.data[j] >= x.DV) { x.data[j] -= x.DV; x.data[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n}", "title": "" }, { "docid": "4098a98f030b3b314570712e65965900", "score": "0.52925044", "text": "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x.data[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x.data[i]*mp mod DV\n var j = x.data[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x.data[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x.data[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x.data[j] >= x.DV) { x.data[j] -= x.DV; x.data[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n}", "title": "" }, { "docid": "4098a98f030b3b314570712e65965900", "score": "0.52925044", "text": "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x.data[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x.data[i]*mp mod DV\n var j = x.data[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x.data[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x.data[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x.data[j] >= x.DV) { x.data[j] -= x.DV; x.data[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n}", "title": "" }, { "docid": "4098a98f030b3b314570712e65965900", "score": "0.52925044", "text": "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x.data[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x.data[i]*mp mod DV\n var j = x.data[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x.data[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x.data[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x.data[j] >= x.DV) { x.data[j] -= x.DV; x.data[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n}", "title": "" }, { "docid": "4098a98f030b3b314570712e65965900", "score": "0.52925044", "text": "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x.data[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x.data[i]*mp mod DV\n var j = x.data[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x.data[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x.data[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x.data[j] >= x.DV) { x.data[j] -= x.DV; x.data[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n}", "title": "" }, { "docid": "4098a98f030b3b314570712e65965900", "score": "0.52925044", "text": "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x.data[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x.data[i]*mp mod DV\n var j = x.data[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x.data[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x.data[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x.data[j] >= x.DV) { x.data[j] -= x.DV; x.data[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n}", "title": "" }, { "docid": "a235eceabcb1bed7b14722e8181f1c6b", "score": "0.5291788", "text": "function montReduce(x) {\n while (x.t <= this.mt2) {\n // pad x so am has enough room later\n x[x.t++] = 0;\n }for (var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i] & 0x7fff;\n var u0 = j * this.mpl + ((j * this.mph + (x[i] >> 15) * this.mpl & this.um) << 15) & x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i + this.m.t;\n x[j] += this.m.am(0, u0, x, i, 0, this.m.t);\n // propagate carry\n while (x[j] >= x.DV) {\n x[j] -= x.DV;x[++j]++;\n }\n }\n x.clamp();\n x.drShiftTo(this.m.t, x);\n if (x.compareTo(this.m) >= 0) x.subTo(this.m, x);\n}", "title": "" }, { "docid": "a235eceabcb1bed7b14722e8181f1c6b", "score": "0.5291788", "text": "function montReduce(x) {\n while (x.t <= this.mt2) {\n // pad x so am has enough room later\n x[x.t++] = 0;\n }for (var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i] & 0x7fff;\n var u0 = j * this.mpl + ((j * this.mph + (x[i] >> 15) * this.mpl & this.um) << 15) & x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i + this.m.t;\n x[j] += this.m.am(0, u0, x, i, 0, this.m.t);\n // propagate carry\n while (x[j] >= x.DV) {\n x[j] -= x.DV;x[++j]++;\n }\n }\n x.clamp();\n x.drShiftTo(this.m.t, x);\n if (x.compareTo(this.m) >= 0) x.subTo(this.m, x);\n}", "title": "" }, { "docid": "4c62036d3a9693f7e53920e0a999f95e", "score": "0.5289953", "text": "function montReduce(x) {\n while (x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for (var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i] & 0x7fff;\n var u0 = j * this.mpl + ((j * this.mph + (x[i] >> 15) * this.mpl & this.um) << 15) & x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i + this.m.t;\n x[j] += this.m.am(0, u0, x, i, 0, this.m.t);\n // propagate carry\n while (x[j] >= x.DV) {\n x[j] -= x.DV;\n x[++j]++;\n }\n }\n x.clamp();\n x.drShiftTo(this.m.t, x);\n if (x.compareTo(this.m) >= 0) x.subTo(this.m, x);\n }", "title": "" }, { "docid": "5fc27afec2155e37dca522ab13e8452f", "score": "0.52898544", "text": "function montReduce(x) {\n while(x.t <= this.mt2) // pad x so am has enough room later\n x.data[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x.data[i]*mp mod DV\n var j = x.data[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x.data[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x.data[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x.data[j] >= x.DV) { x.data[j] -= x.DV; x.data[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n}", "title": "" }, { "docid": "5fc27afec2155e37dca522ab13e8452f", "score": "0.52898544", "text": "function montReduce(x) {\n while(x.t <= this.mt2) // pad x so am has enough room later\n x.data[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x.data[i]*mp mod DV\n var j = x.data[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x.data[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x.data[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x.data[j] >= x.DV) { x.data[j] -= x.DV; x.data[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n}", "title": "" }, { "docid": "5fc27afec2155e37dca522ab13e8452f", "score": "0.52898544", "text": "function montReduce(x) {\n while(x.t <= this.mt2) // pad x so am has enough room later\n x.data[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x.data[i]*mp mod DV\n var j = x.data[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x.data[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x.data[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x.data[j] >= x.DV) { x.data[j] -= x.DV; x.data[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n}", "title": "" }, { "docid": "5fc27afec2155e37dca522ab13e8452f", "score": "0.52898544", "text": "function montReduce(x) {\n while(x.t <= this.mt2) // pad x so am has enough room later\n x.data[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x.data[i]*mp mod DV\n var j = x.data[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x.data[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x.data[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x.data[j] >= x.DV) { x.data[j] -= x.DV; x.data[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n}", "title": "" }, { "docid": "c7f5e0f0f304825cfd81b8e0f955a67e", "score": "0.5289371", "text": "function montReduce(x) {\n while(x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n}", "title": "" }, { "docid": "b3c1ed59652b69480336183658f7b0a3", "score": "0.5289011", "text": "function montReduce(x) {\n while(x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n}", "title": "" }, { "docid": "b5f6db9613429c0d9392464c91249f19", "score": "0.5287767", "text": "function montReduce(x) {\n while (x.t <= this.mt2) {\n // pad x so am has enough room later\n x[x.t++] = 0;\n }for (var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i] & 0x7fff;\n var u0 = j * this.mpl + ((j * this.mph + (x[i] >> 15) * this.mpl & this.um) << 15) & x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i + this.m.t;\n x[j] += this.m.am(0, u0, x, i, 0, this.m.t);\n // propagate carry\n while (x[j] >= x.DV) {\n x[j] -= x.DV;\n x[++j]++;\n }\n }\n x.clamp();\n x.drShiftTo(this.m.t, x);\n if (x.compareTo(this.m) >= 0) x.subTo(this.m, x);\n}", "title": "" }, { "docid": "b5f6db9613429c0d9392464c91249f19", "score": "0.5287767", "text": "function montReduce(x) {\n while (x.t <= this.mt2) {\n // pad x so am has enough room later\n x[x.t++] = 0;\n }for (var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i] & 0x7fff;\n var u0 = j * this.mpl + ((j * this.mph + (x[i] >> 15) * this.mpl & this.um) << 15) & x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i + this.m.t;\n x[j] += this.m.am(0, u0, x, i, 0, this.m.t);\n // propagate carry\n while (x[j] >= x.DV) {\n x[j] -= x.DV;\n x[++j]++;\n }\n }\n x.clamp();\n x.drShiftTo(this.m.t, x);\n if (x.compareTo(this.m) >= 0) x.subTo(this.m, x);\n}", "title": "" }, { "docid": "b435b101890888825efb11399beabf8b", "score": "0.5284509", "text": "function montReduce(x) {\n while(x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n}", "title": "" }, { "docid": "045248a934d661a089554058d4b2106b", "score": "0.52820677", "text": "function montReduce(x) {\n while(x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n}", "title": "" }, { "docid": "a1ca7869829b27bbbd48a455843ef198", "score": "0.52682495", "text": "function montReduce(x) {\n while(x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "title": "" }, { "docid": "a1ca7869829b27bbbd48a455843ef198", "score": "0.52682495", "text": "function montReduce(x) {\n while(x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "title": "" }, { "docid": "a1ca7869829b27bbbd48a455843ef198", "score": "0.52682495", "text": "function montReduce(x) {\n while(x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "title": "" }, { "docid": "a1ca7869829b27bbbd48a455843ef198", "score": "0.52682495", "text": "function montReduce(x) {\n while(x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "title": "" }, { "docid": "a1ca7869829b27bbbd48a455843ef198", "score": "0.52682495", "text": "function montReduce(x) {\n while(x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "title": "" }, { "docid": "a1ca7869829b27bbbd48a455843ef198", "score": "0.52682495", "text": "function montReduce(x) {\n while(x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "title": "" }, { "docid": "a1ca7869829b27bbbd48a455843ef198", "score": "0.52682495", "text": "function montReduce(x) {\n while(x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "title": "" }, { "docid": "a1ca7869829b27bbbd48a455843ef198", "score": "0.52682495", "text": "function montReduce(x) {\n while(x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "title": "" }, { "docid": "a1ca7869829b27bbbd48a455843ef198", "score": "0.52682495", "text": "function montReduce(x) {\n while(x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "title": "" }, { "docid": "a1ca7869829b27bbbd48a455843ef198", "score": "0.52682495", "text": "function montReduce(x) {\n while(x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "title": "" } ]
0861473f60bdfa0b27e2b5688e9ee459
Calculates SHA2 (SHA384) hash
[ { "docid": "6eba569fb6e64f665f8b6b3c7862dc11", "score": "0.6793977", "text": "function sha384(data) {\n if (wasmCache$8 === null) {\n return lockedCreate(mutex$8, wasmJson$9, 48)\n .then((wasm) => {\n wasmCache$8 = wasm;\n return wasmCache$8.calculate(data, 384);\n });\n }\n try {\n const hash = wasmCache$8.calculate(data, 384);\n return Promise.resolve(hash);\n }\n catch (err) {\n return Promise.reject(err);\n }\n }", "title": "" } ]
[ { "docid": "40c37ad74e14d66f56a29da70e653a38", "score": "0.6712332", "text": "function SHA256(b){function h(j,k){return(j>>e)+(k>>e)+((p=(j&o)+(k&o))>>e)<<e|p&o}function f(j,k){return j>>>k|j<<32-k}var g=[],d,c=3,l=[2],p,i,q,a,m=[],n=[];i=b.length*8;for(var e=16,o=65535,r=\"\";c<312;c++){for(d=l.length;d--&&c%l[d]!=0;);d<0&&l.push(c)}b+=\"\\u0080\";for(c=0;c<=i;c+=8)n[c>>5]|=(b.charCodeAt(c/8)&255)<<24-c%32;n[(i+64>>9<<4)+15]=i;for(c=8;c--;)m[c]=parseInt(Math.pow(l[c],0.5).toString(e).substr(2,8),e);for(c=0;c<n.length;c+=e){a=m.slice(0);for(b=0;b<64;b++){g[b]=b<e?n[b+c]:h(h(h(f(g[b-2],17)^f(g[b-2],19)^g[b-2]>>>10,g[b-7]),f(g[b-15],7)^f(g[b-15],18)^g[b-15]>>>3),g[b-e]);i=h(h(h(h(a[7],f(a[4],6)^f(a[4],11)^f(a[4],25)),a[4]&a[5]^~a[4]&a[6]),parseInt(Math.pow(l[b],1/3).toString(e).substr(2,8),e)),g[b]);q=(f(a[0],2)^f(a[0],13)^f(a[0],22))+(a[0]&a[1]^a[0]&a[2]^a[1]&a[2]);for(d=8;--d;)a[d]=d==4?h(a[3],i):a[d-1];a[0]=h(i,q)}for(d=8;d--;)m[d]+=a[d]}for(c=0;c<8;c++)for(b=8;b--;)r+=(m[c]>>>b*4&15).toString(e);return r}", "title": "" }, { "docid": "8cf588255e4f5fa9c36ecb55f912975d", "score": "0.6684426", "text": "function sha256(data){ return crypto.createHash('sha256').update(data).digest() }", "title": "" }, { "docid": "d101d45fcc62329fff55e541130d1524", "score": "0.66775984", "text": "function sha256_S (X, n) {return ( X >>> n ) | (X << (32 - n));}", "title": "" }, { "docid": "d101d45fcc62329fff55e541130d1524", "score": "0.66775984", "text": "function sha256_S (X, n) {return ( X >>> n ) | (X << (32 - n));}", "title": "" }, { "docid": "d101d45fcc62329fff55e541130d1524", "score": "0.66775984", "text": "function sha256_S (X, n) {return ( X >>> n ) | (X << (32 - n));}", "title": "" }, { "docid": "0552c022a1fff2a71a92f0649d144191", "score": "0.66177094", "text": "function SHA256(s) {\r\n var chrsz = 8;\r\n var hexcase = 0;\r\n\r\n function safe_add (x, y) {\r\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\r\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\r\n return (msw << 16) | (lsw & 0xFFFF);\r\n }\r\n\r\n function S (X, n) {return (X >>> n) | (X << (32 - n));}\r\n\r\n function R (X, n) {return ( X >>> n );}\r\n\r\n function Ch(x, y, z) {return ((x & y) ^ ((~x) & z));}\r\n\r\n function Maj(x, y, z) {return ((x & y) ^ (x & z) ^ (y & z));}\r\n\r\n function Sigma0256(x) {return (S(x, 2) ^ S(x, 13) ^ S(x, 22));}\r\n\r\n function Sigma1256(x) {return (S(x, 6) ^ S(x, 11) ^ S(x, 25));}\r\n\r\n function Gamma0256(x) {return (S(x, 7) ^ S(x, 18) ^ R(x, 3));}\r\n\r\n function Gamma1256(x) {return (S(x, 17) ^ S(x, 19) ^ R(x, 10));}\r\n\r\n function core_sha256 (m, l) {\t\r\n var K = new Array(0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5, 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5, 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3, 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174, 0xE49B69C1, 0xEFBE4786, 0xFC19DC6, 0x240CA1CC, 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA, 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7, 0xC6E00BF3, 0xD5A79147, 0x6CA6351, 0x14292967, 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13, 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85, 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3, 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070, 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5, 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3, 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208, 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2);\r\n var HASH = new Array(0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A, 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19);\r\n var W = new Array(64);\r\n var a, b, c, d, e, f, g, h, i, j;\r\n var T1, T2;\r\n m[l >> 5] |= 0x80 << (24 - l % 32);\r\n m[((l + 64 >> 9) << 4) + 15] = l;\r\n\r\n for ( var i = 0; i<m.length; i+=16 ) {\r\n a = HASH[0];\r\n b = HASH[1];\r\n c = HASH[2];\r\n d = HASH[3];\r\n e = HASH[4];\r\n f = HASH[5];\r\n g = HASH[6];\r\n h = HASH[7];\r\n\r\n for ( var j = 0; j<64; j++) {\r\n if (j < 16) W[j] = m[j + i];\r\n else W[j] = safe_add(safe_add(safe_add(Gamma1256(W[j - 2]), W[j - 7]), Gamma0256(W[j - 15])), W[j - 16]);\r\n T1 = safe_add(safe_add(safe_add(safe_add(h, Sigma1256(e)), Ch(e, f, g)), K[j]), W[j]);\r\n T2 = safe_add(Sigma0256(a), Maj(a, b, c));\r\n h = g;\r\n g = f;\r\n f = e;\r\n e = safe_add(d, T1);\r\n d = c;\r\n c = b;\r\n b = a;\r\n a = safe_add(T1, T2);\r\n }\r\n\r\n HASH[0] = safe_add(a, HASH[0]);\r\n HASH[1] = safe_add(b, HASH[1]);\r\n HASH[2] = safe_add(c, HASH[2]);\r\n HASH[3] = safe_add(d, HASH[3]);\r\n HASH[4] = safe_add(e, HASH[4]);\r\n HASH[5] = safe_add(f, HASH[5]);\r\n HASH[6] = safe_add(g, HASH[6]);\r\n HASH[7] = safe_add(h, HASH[7]);\r\n }\r\n\r\n return HASH;\r\n }\r\n\r\n function str2binb (str) {\r\n var bin = Array();\r\n var mask = (1 << chrsz) - 1;\r\n\r\n for(var i = 0; i < str.length * chrsz; i += chrsz) {\r\n bin[i >> 5] |= (str.charCodeAt(i / chrsz) & mask) << (24 - i % 32);\r\n }\r\n\r\n return bin;\r\n }\r\n\r\n function Utf8Encode(string) {\r\n string = string.replace(/\\r\\n/g, \"\\n\");\r\n var utftext = \"\";\r\n\r\n for (var n = 0; n < string.length; n++) {\t\r\n var c = string.charCodeAt(n);\r\n\r\n if (c < 128) {\r\n utftext += String.fromCharCode(c);\r\n } else if((c > 127) && (c < 2048)) {\r\n utftext += String.fromCharCode((c >> 6) | 192);\r\n utftext += String.fromCharCode((c & 63) | 128);\r\n\t\t\t} else {\r\n\t\t\t\tutftext += String.fromCharCode((c >> 12) | 224);\r\n\t\t\t\tutftext += String.fromCharCode(((c >> 6) & 63) | 128);\r\n\t\t\t\tutftext += String.fromCharCode((c & 63) | 128);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn utftext;\r\n\t}\r\n\r\n\tfunction binb2hex (binarray) {\r\n\t\tvar hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\r\n\t\tvar str = \"\";\r\n\r\n\t\tfor(var i = 0; i < binarray.length * 4; i++) {\r\n\t\t\tstr += hex_tab.charAt((binarray[i >> 2] >> ((3 - i % 4) * 8 + 4)) & 0xF) + hex_tab.charAt((binarray[i >> 2] >> ((3 - i % 4) * 8)) & 0xF);\r\n\t\t}\r\n\r\n\t\treturn str;\r\n\t}\r\n\r\n\ts = Utf8Encode(s);\r\n\r\n\treturn binb2hex(core_sha256(str2binb(s), s.length * chrsz));\r\n}", "title": "" }, { "docid": "87eb922a41438f041e4749d4c8851bda", "score": "0.65876186", "text": "function SHA256(s){\n var chrsz = 8;\n var hexcase = 0;\n function safe_add (x, y) {\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n }\n function S (X, n) { return ( X >>> n ) | (X << (32 - n)); }\n function R (X, n) { return ( X >>> n ); }\n function Ch(x, y, z) { return ((x & y) ^ ((~x) & z)); }\n function Maj(x, y, z) { return ((x & y) ^ (x & z) ^ (y & z)); }\n function Sigma0256(x) { return (S(x, 2) ^ S(x, 13) ^ S(x, 22)); }\n function Sigma1256(x) { return (S(x, 6) ^ S(x, 11) ^ S(x, 25)); }\n function Gamma0256(x) { return (S(x, 7) ^ S(x, 18) ^ R(x, 3)); }\n function Gamma1256(x) { return (S(x, 17) ^ S(x, 19) ^ R(x, 10)); }\n function core_sha256 (m, l) {\n var K = new Array(0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5, 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5, 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3, 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174, 0xE49B69C1, 0xEFBE4786, 0xFC19DC6, 0x240CA1CC, 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA, 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7, 0xC6E00BF3, 0xD5A79147, 0x6CA6351, 0x14292967, 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13, 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85, 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3, 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070, 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5, 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3, 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208, 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2);\n var HASH = new Array(0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A, 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19);\n var W = new Array(64);\n var a, b, c, d, e, f, g, h, i, j;\n var T1, T2;\n m[l >> 5] |= 0x80 << (24 - l % 32);\n m[((l + 64 >> 9) << 4) + 15] = l;\n for ( var i = 0; i<m.length; i+=16 ) {\n a = HASH[0];\n b = HASH[1];\n c = HASH[2];\n d = HASH[3];\n e = HASH[4];\n f = HASH[5];\n g = HASH[6];\n h = HASH[7];\n for ( var j = 0; j<64; j++) {\n if (j < 16) W[j] = m[j + i];\n else W[j] = safe_add(safe_add(safe_add(Gamma1256(W[j - 2]), W[j - 7]), Gamma0256(W[j - 15])), W[j - 16]);\n T1 = safe_add(safe_add(safe_add(safe_add(h, Sigma1256(e)), Ch(e, f, g)), K[j]), W[j]);\n T2 = safe_add(Sigma0256(a), Maj(a, b, c));\n h = g;\n g = f;\n f = e;\n e = safe_add(d, T1);\n d = c;\n c = b;\n b = a;\n a = safe_add(T1, T2);\n }\n HASH[0] = safe_add(a, HASH[0]);\n HASH[1] = safe_add(b, HASH[1]);\n HASH[2] = safe_add(c, HASH[2]);\n HASH[3] = safe_add(d, HASH[3]);\n HASH[4] = safe_add(e, HASH[4]);\n HASH[5] = safe_add(f, HASH[5]);\n HASH[6] = safe_add(g, HASH[6]);\n HASH[7] = safe_add(h, HASH[7]);\n }\n return HASH;\n }\n function str2binb (str) {\n var bin = Array();\n var mask = (1 << chrsz) - 1;\n for(var i = 0; i < str.length * chrsz; i += chrsz) {\n bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (24 - i%32);\n }\n return bin;\n }\n function Utf8Encode(string) {\n string = string.replace(/\\r\\n/g,\"\\n\");\n var utftext = \"\";\n for (var n = 0; n < string.length; n++) {\n var c = string.charCodeAt(n);\n if (c < 128) {\n utftext += String.fromCharCode(c);\n }\n else if((c > 127) && (c < 2048)) {\n utftext += String.fromCharCode((c >> 6) | 192);\n utftext += String.fromCharCode((c & 63) | 128);\n }\n else {\n utftext += String.fromCharCode((c >> 12) | 224);\n utftext += String.fromCharCode(((c >> 6) & 63) | 128);\n utftext += String.fromCharCode((c & 63) | 128);\n }\n }\n return utftext;\n }\n function binb2hex (binarray) {\n var hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\n var str = \"\";\n for(var i = 0; i < binarray.length * 4; i++) {\n str += hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8+4)) & 0xF) +\n hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8 )) & 0xF);\n }\n return str;\n }\n s = Utf8Encode(s);\n return binb2hex(core_sha256(str2binb(s), s.length * chrsz));\n}", "title": "" }, { "docid": "42eaa6a60ec5166684aacfbeef41b0eb", "score": "0.65864664", "text": "function sha256_S(X, n) {\n\t return X >>> n | X << 32 - n;\n\t }", "title": "" }, { "docid": "0fe979d4c1301ebff9e4b6c86c4cc80f", "score": "0.65698624", "text": "function SHA256(s) {\n\n\t\t\t\tvar chrsz = 8;\n\t\t\t\tvar hexcase = 0;\n\n\t\t\t\tfunction safe_add(x, y) {\n\t\t\t\t\tvar lsw = (x & 0xFFFF) + (y & 0xFFFF);\n\t\t\t\t\tvar msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n\t\t\t\t\treturn msw << 16 | lsw & 0xFFFF;\n\t\t\t\t}\n\n\t\t\t\tfunction S(X, n) {\n\t\t\t\t\treturn X >>> n | X << 32 - n;\n\t\t\t\t}\n\t\t\t\tfunction R(X, n) {\n\t\t\t\t\treturn X >>> n;\n\t\t\t\t}\n\t\t\t\tfunction Ch(x, y, z) {\n\t\t\t\t\treturn x & y ^ ~x & z;\n\t\t\t\t}\n\t\t\t\tfunction Maj(x, y, z) {\n\t\t\t\t\treturn x & y ^ x & z ^ y & z;\n\t\t\t\t}\n\t\t\t\tfunction Sigma0256(x) {\n\t\t\t\t\treturn S(x, 2) ^ S(x, 13) ^ S(x, 22);\n\t\t\t\t}\n\t\t\t\tfunction Sigma1256(x) {\n\t\t\t\t\treturn S(x, 6) ^ S(x, 11) ^ S(x, 25);\n\t\t\t\t}\n\t\t\t\tfunction Gamma0256(x) {\n\t\t\t\t\treturn S(x, 7) ^ S(x, 18) ^ R(x, 3);\n\t\t\t\t}\n\t\t\t\tfunction Gamma1256(x) {\n\t\t\t\t\treturn S(x, 17) ^ S(x, 19) ^ R(x, 10);\n\t\t\t\t}\n\n\t\t\t\tfunction core_sha256(m, l) {\n\t\t\t\t\tvar K = new Array(0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5, 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5, 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3, 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174, 0xE49B69C1, 0xEFBE4786, 0xFC19DC6, 0x240CA1CC, 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA, 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7, 0xC6E00BF3, 0xD5A79147, 0x6CA6351, 0x14292967, 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13, 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85, 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3, 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070, 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5, 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3, 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208, 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2);\n\t\t\t\t\tvar HASH = new Array(0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A, 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19);\n\t\t\t\t\tvar W = new Array(64);\n\t\t\t\t\tvar a, b, c, d, e, f, g, h, i, j;\n\t\t\t\t\tvar T1, T2;\n\n\t\t\t\t\tm[l >> 5] |= 0x80 << 24 - l % 32;\n\t\t\t\t\tm[(l + 64 >> 9 << 4) + 15] = l;\n\n\t\t\t\t\tfor (var i = 0; i < m.length; i += 16) {\n\t\t\t\t\t\ta = HASH[0];\n\t\t\t\t\t\tb = HASH[1];\n\t\t\t\t\t\tc = HASH[2];\n\t\t\t\t\t\td = HASH[3];\n\t\t\t\t\t\te = HASH[4];\n\t\t\t\t\t\tf = HASH[5];\n\t\t\t\t\t\tg = HASH[6];\n\t\t\t\t\t\th = HASH[7];\n\n\t\t\t\t\t\tfor (var j = 0; j < 64; j++) {\n\t\t\t\t\t\t\tif (j < 16) W[j] = m[j + i];else W[j] = safe_add(safe_add(safe_add(Gamma1256(W[j - 2]), W[j - 7]), Gamma0256(W[j - 15])), W[j - 16]);\n\n\t\t\t\t\t\t\tT1 = safe_add(safe_add(safe_add(safe_add(h, Sigma1256(e)), Ch(e, f, g)), K[j]), W[j]);\n\t\t\t\t\t\t\tT2 = safe_add(Sigma0256(a), Maj(a, b, c));\n\n\t\t\t\t\t\t\th = g;\n\t\t\t\t\t\t\tg = f;\n\t\t\t\t\t\t\tf = e;\n\t\t\t\t\t\t\te = safe_add(d, T1);\n\t\t\t\t\t\t\td = c;\n\t\t\t\t\t\t\tc = b;\n\t\t\t\t\t\t\tb = a;\n\t\t\t\t\t\t\ta = safe_add(T1, T2);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tHASH[0] = safe_add(a, HASH[0]);\n\t\t\t\t\t\tHASH[1] = safe_add(b, HASH[1]);\n\t\t\t\t\t\tHASH[2] = safe_add(c, HASH[2]);\n\t\t\t\t\t\tHASH[3] = safe_add(d, HASH[3]);\n\t\t\t\t\t\tHASH[4] = safe_add(e, HASH[4]);\n\t\t\t\t\t\tHASH[5] = safe_add(f, HASH[5]);\n\t\t\t\t\t\tHASH[6] = safe_add(g, HASH[6]);\n\t\t\t\t\t\tHASH[7] = safe_add(h, HASH[7]);\n\t\t\t\t\t}\n\t\t\t\t\treturn HASH;\n\t\t\t\t}\n\n\t\t\t\tfunction str2binb(str) {\n\t\t\t\t\tvar bin = Array();\n\t\t\t\t\tvar mask = (1 << chrsz) - 1;\n\t\t\t\t\tfor (var i = 0; i < str.length * chrsz; i += chrsz) {\n\t\t\t\t\t\tbin[i >> 5] |= (str.charCodeAt(i / chrsz) & mask) << 24 - i % 32;\n\t\t\t\t\t}\n\t\t\t\t\treturn bin;\n\t\t\t\t}\n\n\t\t\t\tfunction Utf8Encode(string) {\n\t\t\t\t\t// METEOR change:\n\t\t\t\t\t// The webtoolkit.info version of this code added this\n\t\t\t\t\t// Utf8Encode function (which does seem necessary for dealing\n\t\t\t\t\t// with arbitrary Unicode), but the following line seems\n\t\t\t\t\t// problematic:\n\t\t\t\t\t//\n\t\t\t\t\t// string = string.replace(/\\r\\n/g,\"\\n\");\n\t\t\t\t\tvar utftext = \"\";\n\n\t\t\t\t\tfor (var n = 0; n < string.length; n++) {\n\n\t\t\t\t\t\tvar c = string.charCodeAt(n);\n\n\t\t\t\t\t\tif (c < 128) {\n\t\t\t\t\t\t\tutftext += String.fromCharCode(c);\n\t\t\t\t\t\t} else if (c > 127 && c < 2048) {\n\t\t\t\t\t\t\tutftext += String.fromCharCode(c >> 6 | 192);\n\t\t\t\t\t\t\tutftext += String.fromCharCode(c & 63 | 128);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tutftext += String.fromCharCode(c >> 12 | 224);\n\t\t\t\t\t\t\tutftext += String.fromCharCode(c >> 6 & 63 | 128);\n\t\t\t\t\t\t\tutftext += String.fromCharCode(c & 63 | 128);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn utftext;\n\t\t\t\t}\n\n\t\t\t\tfunction binb2hex(binarray) {\n\t\t\t\t\tvar hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\n\t\t\t\t\tvar str = \"\";\n\t\t\t\t\tfor (var i = 0; i < binarray.length * 4; i++) {\n\t\t\t\t\t\tstr += hex_tab.charAt(binarray[i >> 2] >> (3 - i % 4) * 8 + 4 & 0xF) + hex_tab.charAt(binarray[i >> 2] >> (3 - i % 4) * 8 & 0xF);\n\t\t\t\t\t}\n\t\t\t\t\treturn str;\n\t\t\t\t}\n\n\t\t\t\ts = Utf8Encode(s);\n\t\t\t\treturn binb2hex(core_sha256(str2binb(s), s.length * chrsz));\n\t\t\t}", "title": "" }, { "docid": "5bf9feacaaf52eb223c419b42f0e77e0", "score": "0.64905334", "text": "function createSHA384() {\n return WASMInterface(wasmJson$9, 48).then((wasm) => {\n wasm.init(384);\n const obj = {\n init: () => { wasm.init(384); return obj; },\n update: (data) => { wasm.update(data); return obj; },\n digest: (outputType) => wasm.digest(outputType),\n save: () => wasm.save(),\n load: (data) => { wasm.load(data); return obj; },\n blockSize: 128,\n digestSize: 48,\n };\n return obj;\n });\n }", "title": "" }, { "docid": "cc8f3c9dd530f9e3d8abb7b182fa81f7", "score": "0.6490093", "text": "function sha256_digest(payload) {\n return crypto.createHash('sha256').update(payload).digest();\n}", "title": "" }, { "docid": "15289d603e2f274e3d3fb50aa9d3c099", "score": "0.6481963", "text": "function SHA256(s){\n\tvar chrsz = 8;\n\tvar hexcase = 0;\n\n\tfunction safe_add (x, y) {\n\t\tvar lsw = (x & 0xFFFF) + (y & 0xFFFF);\n\t\tvar msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n\t\treturn (msw << 16) | (lsw & 0xFFFF);\n\t}\n\n\tfunction S (X, n) { return ( X >>> n ) | (X << (32 - n)); }\n\tfunction R (X, n) { return ( X >>> n ); }\n\tfunction Ch(x, y, z) { return ((x & y) ^ ((~x) & z)); }\n\tfunction Maj(x, y, z) { return ((x & y) ^ (x & z) ^ (y & z)); }\n\tfunction Sigma0256(x) { return (S(x, 2) ^ S(x, 13) ^ S(x, 22)); }\n\tfunction Sigma1256(x) { return (S(x, 6) ^ S(x, 11) ^ S(x, 25)); }\n\tfunction Gamma0256(x) { return (S(x, 7) ^ S(x, 18) ^ R(x, 3)); }\n\tfunction Gamma1256(x) { return (S(x, 17) ^ S(x, 19) ^ R(x, 10)); }\n\n\tfunction core_sha256 (m, l) {\n\t\tvar K = new Array(0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5, 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5, 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3, 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174, 0xE49B69C1, 0xEFBE4786, 0xFC19DC6, 0x240CA1CC, 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA, 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7, 0xC6E00BF3, 0xD5A79147, 0x6CA6351, 0x14292967, 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13, 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85, 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3, 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070, 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5, 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3, 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208, 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2);\n\t\tvar HASH = new Array(0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A, 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19);\n\t\tvar W = new Array(64);\n\t\tvar a, b, c, d, e, f, g, h, i, j;\n\t\tvar T1, T2;\n\n\t\tm[l >> 5] |= 0x80 << (24 - l % 32);\n\t\tm[((l + 64 >> 9) << 4) + 15] = l;\n\n\t\tfor ( var i = 0; i<m.length; i+=16 ) {\n\t\t\ta = HASH[0];\n\t\t\tb = HASH[1];\n\t\t\tc = HASH[2];\n\t\t\td = HASH[3];\n\t\t\te = HASH[4];\n\t\t\tf = HASH[5];\n\t\t\tg = HASH[6];\n\t\t\th = HASH[7];\n\n\t\t\tfor ( var j = 0; j<64; j++) {\n\t\t\t\tif (j < 16) W[j] = m[j + i];\n\t\t\t\telse W[j] = safe_add(safe_add(safe_add(Gamma1256(W[j - 2]), W[j - 7]), Gamma0256(W[j - 15])), W[j - 16]);\n\n\t\t\t\tT1 = safe_add(safe_add(safe_add(safe_add(h, Sigma1256(e)), Ch(e, f, g)), K[j]), W[j]);\n\t\t\t\tT2 = safe_add(Sigma0256(a), Maj(a, b, c));\n\n\t\t\t\th = g;\n\t\t\t\tg = f;\n\t\t\t\tf = e;\n\t\t\t\te = safe_add(d, T1);\n\t\t\t\td = c;\n\t\t\t\tc = b;\n\t\t\t\tb = a;\n\t\t\t\ta = safe_add(T1, T2);\n\t\t\t}\n\n\t\t\tHASH[0] = safe_add(a, HASH[0]);\n\t\t\tHASH[1] = safe_add(b, HASH[1]);\n\t\t\tHASH[2] = safe_add(c, HASH[2]);\n\t\t\tHASH[3] = safe_add(d, HASH[3]);\n\t\t\tHASH[4] = safe_add(e, HASH[4]);\n\t\t\tHASH[5] = safe_add(f, HASH[5]);\n\t\t\tHASH[6] = safe_add(g, HASH[6]);\n\t\t\tHASH[7] = safe_add(h, HASH[7]);\n\t\t}\n\t\treturn HASH;\n\t}\n\n\tfunction str2binb (str) {\n\t\tvar bin = Array();\n\t\tvar mask = (1 << chrsz) - 1;\n\t\tfor(var i = 0; i < str.length * chrsz; i += chrsz) {\n\t\t\tbin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (24 - i % 32);\n\t\t}\n\t\treturn bin;\n\t}\n\n\tfunction Utf8Encode(string) {\n\t\tstring = string.replace(/\\r\\n/g,'\\n');\n\t\tvar utftext = '';\n\n\t\tfor (var n = 0; n < string.length; n++) {\n\t\t\tvar c = string.charCodeAt(n);\n\n\t\t\tif (c < 128) {\n\t\t\t\tutftext += String.fromCharCode(c);\n\t\t\t} else if((c > 127) && (c < 2048)) {\n\t\t\t\tutftext += String.fromCharCode((c >> 6) | 192);\n\t\t\t\tutftext += String.fromCharCode((c & 63) | 128);\n\t\t\t} else {\n\t\t\t\tutftext += String.fromCharCode((c >> 12) | 224);\n\t\t\t\tutftext += String.fromCharCode(((c >> 6) & 63) | 128);\n\t\t\t\tutftext += String.fromCharCode((c & 63) | 128);\n\t\t\t}\n\t\t}\n\n\t\treturn utftext;\n\t}\n\n\tfunction binb2hex (binarray) {\n\t\tvar hex_tab = hexcase ? '0123456789ABCDEF' : '0123456789abcdef';\n\t\tvar str = '';\n\t\tfor(var i = 0; i < binarray.length * 4; i++) {\n\t\t\tstr += hex_tab.charAt((binarray[i>>2] >> ((3 - i % 4)*8+4)) & 0xF) +\n\t\t\thex_tab.charAt((binarray[i>>2] >> ((3 - i % 4)*8 )) & 0xF);\n\t\t}\n\t\treturn str;\n\t}\n\n\ts = Utf8Encode(s);\n\treturn binb2hex(core_sha256(str2binb(s), s.length * chrsz));\n}", "title": "" }, { "docid": "77f54097261060265598395cc35d4707", "score": "0.6446908", "text": "function sha256_S(X, n) {\n return (X >>> n) | (X << (32 - n));\n }", "title": "" }, { "docid": "4a5fce973516693fc14684e58506e3fa", "score": "0.6435721", "text": "function SHA256(m) {\n var K = [\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b,\n 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01,\n 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7,\n 0xc19bf174, 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,\n 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x983e5152,\n 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147,\n 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc,\n 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819,\n 0xd6990624, 0xf40e3585, 0x106aa070, 0x19a4c116, 0x1e376c08,\n 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f,\n 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,\n 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n ];\n\n var h0 = 0x6a09e667, h1 = 0xbb67ae85, h2 = 0x3c6ef372, h3 = 0xa54ff53a;\n var h4 = 0x510e527f, h5 = 0x9b05688c, h6 = 0x1f83d9ab, h7 = 0x5be0cd19;\n var w = new Array(64);\n\n function blocks(p) {\n var off = 0, len = p.length;\n while (len >= 64) {\n var a = h0, b = h1, c = h2, d = h3, e = h4, f = h5, g = h6, h = h7, u, i, j, t1, t2;\n\n for (i = 0; i < 16; i++) {\n j = off + i*4;\n w[i] = ((p[j] & 0xff)<<24) | ((p[j+1] & 0xff)<<16) |\n ((p[j+2] & 0xff)<<8) | (p[j+3] & 0xff);\n }\n\n for (i = 16; i < 64; i++) {\n u = w[i-2];\n t1 = ((u>>>17) | (u<<(32-17))) ^ ((u>>>19) | (u<<(32-19))) ^ (u>>>10);\n\n u = w[i-15];\n t2 = ((u>>>7) | (u<<(32-7))) ^ ((u>>>18) | (u<<(32-18))) ^ (u>>>3);\n\n w[i] = (((t1 + w[i-7]) | 0) + ((t2 + w[i-16]) | 0)) | 0;\n }\n\n for (i = 0; i < 64; i++) {\n t1 = ((((((e>>>6) | (e<<(32-6))) ^ ((e>>>11) | (e<<(32-11))) ^\n ((e>>>25) | (e<<(32-25)))) + ((e & f) ^ (~e & g))) | 0) +\n ((h + ((K[i] + w[i]) | 0)) | 0)) | 0;\n\n t2 = ((((a>>>2) | (a<<(32-2))) ^ ((a>>>13) | (a<<(32-13))) ^\n ((a>>>22) | (a<<(32-22)))) + ((a & b) ^ (a & c) ^ (b & c))) | 0;\n\n h = g;\n g = f;\n f = e;\n e = (d + t1) | 0;\n d = c;\n c = b;\n b = a;\n a = (t1 + t2) | 0;\n }\n\n h0 = (h0 + a) | 0;\n h1 = (h1 + b) | 0;\n h2 = (h2 + c) | 0;\n h3 = (h3 + d) | 0;\n h4 = (h4 + e) | 0;\n h5 = (h5 + f) | 0;\n h6 = (h6 + g) | 0;\n h7 = (h7 + h) | 0;\n\n off += 64;\n len -= 64;\n }\n }\n\n blocks(m);\n\n var i, bytesLeft = m.length % 64,\n bitLenHi = (m.length / 0x20000000) | 0,\n bitLenLo = m.length << 3,\n numZeros = (bytesLeft < 56) ? 56 : 120,\n p = m.slice(m.length - bytesLeft, m.length);\n\n p.push(0x80);\n for (i = bytesLeft + 1; i < numZeros; i++) { p.push(0); }\n p.push((bitLenHi>>>24) & 0xff);\n p.push((bitLenHi>>>16) & 0xff);\n p.push((bitLenHi>>>8) & 0xff);\n p.push((bitLenHi>>>0) & 0xff);\n p.push((bitLenLo>>>24) & 0xff);\n p.push((bitLenLo>>>16) & 0xff);\n p.push((bitLenLo>>>8) & 0xff);\n p.push((bitLenLo>>>0) & 0xff);\n\n blocks(p);\n\n return [\n (h0>>>24) & 0xff, (h0>>>16) & 0xff, (h0>>>8) & 0xff, (h0>>>0) & 0xff,\n (h1>>>24) & 0xff, (h1>>>16) & 0xff, (h1>>>8) & 0xff, (h1>>>0) & 0xff,\n (h2>>>24) & 0xff, (h2>>>16) & 0xff, (h2>>>8) & 0xff, (h2>>>0) & 0xff,\n (h3>>>24) & 0xff, (h3>>>16) & 0xff, (h3>>>8) & 0xff, (h3>>>0) & 0xff,\n (h4>>>24) & 0xff, (h4>>>16) & 0xff, (h4>>>8) & 0xff, (h4>>>0) & 0xff,\n (h5>>>24) & 0xff, (h5>>>16) & 0xff, (h5>>>8) & 0xff, (h5>>>0) & 0xff,\n (h6>>>24) & 0xff, (h6>>>16) & 0xff, (h6>>>8) & 0xff, (h6>>>0) & 0xff,\n (h7>>>24) & 0xff, (h7>>>16) & 0xff, (h7>>>8) & 0xff, (h7>>>0) & 0xff\n ];\n }", "title": "" }, { "docid": "4a5fce973516693fc14684e58506e3fa", "score": "0.6435721", "text": "function SHA256(m) {\n var K = [\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b,\n 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01,\n 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7,\n 0xc19bf174, 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,\n 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x983e5152,\n 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147,\n 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc,\n 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819,\n 0xd6990624, 0xf40e3585, 0x106aa070, 0x19a4c116, 0x1e376c08,\n 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f,\n 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,\n 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n ];\n\n var h0 = 0x6a09e667, h1 = 0xbb67ae85, h2 = 0x3c6ef372, h3 = 0xa54ff53a;\n var h4 = 0x510e527f, h5 = 0x9b05688c, h6 = 0x1f83d9ab, h7 = 0x5be0cd19;\n var w = new Array(64);\n\n function blocks(p) {\n var off = 0, len = p.length;\n while (len >= 64) {\n var a = h0, b = h1, c = h2, d = h3, e = h4, f = h5, g = h6, h = h7, u, i, j, t1, t2;\n\n for (i = 0; i < 16; i++) {\n j = off + i*4;\n w[i] = ((p[j] & 0xff)<<24) | ((p[j+1] & 0xff)<<16) |\n ((p[j+2] & 0xff)<<8) | (p[j+3] & 0xff);\n }\n\n for (i = 16; i < 64; i++) {\n u = w[i-2];\n t1 = ((u>>>17) | (u<<(32-17))) ^ ((u>>>19) | (u<<(32-19))) ^ (u>>>10);\n\n u = w[i-15];\n t2 = ((u>>>7) | (u<<(32-7))) ^ ((u>>>18) | (u<<(32-18))) ^ (u>>>3);\n\n w[i] = (((t1 + w[i-7]) | 0) + ((t2 + w[i-16]) | 0)) | 0;\n }\n\n for (i = 0; i < 64; i++) {\n t1 = ((((((e>>>6) | (e<<(32-6))) ^ ((e>>>11) | (e<<(32-11))) ^\n ((e>>>25) | (e<<(32-25)))) + ((e & f) ^ (~e & g))) | 0) +\n ((h + ((K[i] + w[i]) | 0)) | 0)) | 0;\n\n t2 = ((((a>>>2) | (a<<(32-2))) ^ ((a>>>13) | (a<<(32-13))) ^\n ((a>>>22) | (a<<(32-22)))) + ((a & b) ^ (a & c) ^ (b & c))) | 0;\n\n h = g;\n g = f;\n f = e;\n e = (d + t1) | 0;\n d = c;\n c = b;\n b = a;\n a = (t1 + t2) | 0;\n }\n\n h0 = (h0 + a) | 0;\n h1 = (h1 + b) | 0;\n h2 = (h2 + c) | 0;\n h3 = (h3 + d) | 0;\n h4 = (h4 + e) | 0;\n h5 = (h5 + f) | 0;\n h6 = (h6 + g) | 0;\n h7 = (h7 + h) | 0;\n\n off += 64;\n len -= 64;\n }\n }\n\n blocks(m);\n\n var i, bytesLeft = m.length % 64,\n bitLenHi = (m.length / 0x20000000) | 0,\n bitLenLo = m.length << 3,\n numZeros = (bytesLeft < 56) ? 56 : 120,\n p = m.slice(m.length - bytesLeft, m.length);\n\n p.push(0x80);\n for (i = bytesLeft + 1; i < numZeros; i++) { p.push(0); }\n p.push((bitLenHi>>>24) & 0xff);\n p.push((bitLenHi>>>16) & 0xff);\n p.push((bitLenHi>>>8) & 0xff);\n p.push((bitLenHi>>>0) & 0xff);\n p.push((bitLenLo>>>24) & 0xff);\n p.push((bitLenLo>>>16) & 0xff);\n p.push((bitLenLo>>>8) & 0xff);\n p.push((bitLenLo>>>0) & 0xff);\n\n blocks(p);\n\n return [\n (h0>>>24) & 0xff, (h0>>>16) & 0xff, (h0>>>8) & 0xff, (h0>>>0) & 0xff,\n (h1>>>24) & 0xff, (h1>>>16) & 0xff, (h1>>>8) & 0xff, (h1>>>0) & 0xff,\n (h2>>>24) & 0xff, (h2>>>16) & 0xff, (h2>>>8) & 0xff, (h2>>>0) & 0xff,\n (h3>>>24) & 0xff, (h3>>>16) & 0xff, (h3>>>8) & 0xff, (h3>>>0) & 0xff,\n (h4>>>24) & 0xff, (h4>>>16) & 0xff, (h4>>>8) & 0xff, (h4>>>0) & 0xff,\n (h5>>>24) & 0xff, (h5>>>16) & 0xff, (h5>>>8) & 0xff, (h5>>>0) & 0xff,\n (h6>>>24) & 0xff, (h6>>>16) & 0xff, (h6>>>8) & 0xff, (h6>>>0) & 0xff,\n (h7>>>24) & 0xff, (h7>>>16) & 0xff, (h7>>>8) & 0xff, (h7>>>0) & 0xff\n ];\n }", "title": "" }, { "docid": "4a5fce973516693fc14684e58506e3fa", "score": "0.6435721", "text": "function SHA256(m) {\n var K = [\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b,\n 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01,\n 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7,\n 0xc19bf174, 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,\n 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x983e5152,\n 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147,\n 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc,\n 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819,\n 0xd6990624, 0xf40e3585, 0x106aa070, 0x19a4c116, 0x1e376c08,\n 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f,\n 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,\n 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n ];\n\n var h0 = 0x6a09e667, h1 = 0xbb67ae85, h2 = 0x3c6ef372, h3 = 0xa54ff53a;\n var h4 = 0x510e527f, h5 = 0x9b05688c, h6 = 0x1f83d9ab, h7 = 0x5be0cd19;\n var w = new Array(64);\n\n function blocks(p) {\n var off = 0, len = p.length;\n while (len >= 64) {\n var a = h0, b = h1, c = h2, d = h3, e = h4, f = h5, g = h6, h = h7, u, i, j, t1, t2;\n\n for (i = 0; i < 16; i++) {\n j = off + i*4;\n w[i] = ((p[j] & 0xff)<<24) | ((p[j+1] & 0xff)<<16) |\n ((p[j+2] & 0xff)<<8) | (p[j+3] & 0xff);\n }\n\n for (i = 16; i < 64; i++) {\n u = w[i-2];\n t1 = ((u>>>17) | (u<<(32-17))) ^ ((u>>>19) | (u<<(32-19))) ^ (u>>>10);\n\n u = w[i-15];\n t2 = ((u>>>7) | (u<<(32-7))) ^ ((u>>>18) | (u<<(32-18))) ^ (u>>>3);\n\n w[i] = (((t1 + w[i-7]) | 0) + ((t2 + w[i-16]) | 0)) | 0;\n }\n\n for (i = 0; i < 64; i++) {\n t1 = ((((((e>>>6) | (e<<(32-6))) ^ ((e>>>11) | (e<<(32-11))) ^\n ((e>>>25) | (e<<(32-25)))) + ((e & f) ^ (~e & g))) | 0) +\n ((h + ((K[i] + w[i]) | 0)) | 0)) | 0;\n\n t2 = ((((a>>>2) | (a<<(32-2))) ^ ((a>>>13) | (a<<(32-13))) ^\n ((a>>>22) | (a<<(32-22)))) + ((a & b) ^ (a & c) ^ (b & c))) | 0;\n\n h = g;\n g = f;\n f = e;\n e = (d + t1) | 0;\n d = c;\n c = b;\n b = a;\n a = (t1 + t2) | 0;\n }\n\n h0 = (h0 + a) | 0;\n h1 = (h1 + b) | 0;\n h2 = (h2 + c) | 0;\n h3 = (h3 + d) | 0;\n h4 = (h4 + e) | 0;\n h5 = (h5 + f) | 0;\n h6 = (h6 + g) | 0;\n h7 = (h7 + h) | 0;\n\n off += 64;\n len -= 64;\n }\n }\n\n blocks(m);\n\n var i, bytesLeft = m.length % 64,\n bitLenHi = (m.length / 0x20000000) | 0,\n bitLenLo = m.length << 3,\n numZeros = (bytesLeft < 56) ? 56 : 120,\n p = m.slice(m.length - bytesLeft, m.length);\n\n p.push(0x80);\n for (i = bytesLeft + 1; i < numZeros; i++) { p.push(0); }\n p.push((bitLenHi>>>24) & 0xff);\n p.push((bitLenHi>>>16) & 0xff);\n p.push((bitLenHi>>>8) & 0xff);\n p.push((bitLenHi>>>0) & 0xff);\n p.push((bitLenLo>>>24) & 0xff);\n p.push((bitLenLo>>>16) & 0xff);\n p.push((bitLenLo>>>8) & 0xff);\n p.push((bitLenLo>>>0) & 0xff);\n\n blocks(p);\n\n return [\n (h0>>>24) & 0xff, (h0>>>16) & 0xff, (h0>>>8) & 0xff, (h0>>>0) & 0xff,\n (h1>>>24) & 0xff, (h1>>>16) & 0xff, (h1>>>8) & 0xff, (h1>>>0) & 0xff,\n (h2>>>24) & 0xff, (h2>>>16) & 0xff, (h2>>>8) & 0xff, (h2>>>0) & 0xff,\n (h3>>>24) & 0xff, (h3>>>16) & 0xff, (h3>>>8) & 0xff, (h3>>>0) & 0xff,\n (h4>>>24) & 0xff, (h4>>>16) & 0xff, (h4>>>8) & 0xff, (h4>>>0) & 0xff,\n (h5>>>24) & 0xff, (h5>>>16) & 0xff, (h5>>>8) & 0xff, (h5>>>0) & 0xff,\n (h6>>>24) & 0xff, (h6>>>16) & 0xff, (h6>>>8) & 0xff, (h6>>>0) & 0xff,\n (h7>>>24) & 0xff, (h7>>>16) & 0xff, (h7>>>8) & 0xff, (h7>>>0) & 0xff\n ];\n }", "title": "" }, { "docid": "4a5fce973516693fc14684e58506e3fa", "score": "0.6435721", "text": "function SHA256(m) {\n var K = [\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b,\n 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01,\n 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7,\n 0xc19bf174, 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,\n 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x983e5152,\n 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147,\n 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc,\n 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819,\n 0xd6990624, 0xf40e3585, 0x106aa070, 0x19a4c116, 0x1e376c08,\n 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f,\n 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,\n 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n ];\n\n var h0 = 0x6a09e667, h1 = 0xbb67ae85, h2 = 0x3c6ef372, h3 = 0xa54ff53a;\n var h4 = 0x510e527f, h5 = 0x9b05688c, h6 = 0x1f83d9ab, h7 = 0x5be0cd19;\n var w = new Array(64);\n\n function blocks(p) {\n var off = 0, len = p.length;\n while (len >= 64) {\n var a = h0, b = h1, c = h2, d = h3, e = h4, f = h5, g = h6, h = h7, u, i, j, t1, t2;\n\n for (i = 0; i < 16; i++) {\n j = off + i*4;\n w[i] = ((p[j] & 0xff)<<24) | ((p[j+1] & 0xff)<<16) |\n ((p[j+2] & 0xff)<<8) | (p[j+3] & 0xff);\n }\n\n for (i = 16; i < 64; i++) {\n u = w[i-2];\n t1 = ((u>>>17) | (u<<(32-17))) ^ ((u>>>19) | (u<<(32-19))) ^ (u>>>10);\n\n u = w[i-15];\n t2 = ((u>>>7) | (u<<(32-7))) ^ ((u>>>18) | (u<<(32-18))) ^ (u>>>3);\n\n w[i] = (((t1 + w[i-7]) | 0) + ((t2 + w[i-16]) | 0)) | 0;\n }\n\n for (i = 0; i < 64; i++) {\n t1 = ((((((e>>>6) | (e<<(32-6))) ^ ((e>>>11) | (e<<(32-11))) ^\n ((e>>>25) | (e<<(32-25)))) + ((e & f) ^ (~e & g))) | 0) +\n ((h + ((K[i] + w[i]) | 0)) | 0)) | 0;\n\n t2 = ((((a>>>2) | (a<<(32-2))) ^ ((a>>>13) | (a<<(32-13))) ^\n ((a>>>22) | (a<<(32-22)))) + ((a & b) ^ (a & c) ^ (b & c))) | 0;\n\n h = g;\n g = f;\n f = e;\n e = (d + t1) | 0;\n d = c;\n c = b;\n b = a;\n a = (t1 + t2) | 0;\n }\n\n h0 = (h0 + a) | 0;\n h1 = (h1 + b) | 0;\n h2 = (h2 + c) | 0;\n h3 = (h3 + d) | 0;\n h4 = (h4 + e) | 0;\n h5 = (h5 + f) | 0;\n h6 = (h6 + g) | 0;\n h7 = (h7 + h) | 0;\n\n off += 64;\n len -= 64;\n }\n }\n\n blocks(m);\n\n var i, bytesLeft = m.length % 64,\n bitLenHi = (m.length / 0x20000000) | 0,\n bitLenLo = m.length << 3,\n numZeros = (bytesLeft < 56) ? 56 : 120,\n p = m.slice(m.length - bytesLeft, m.length);\n\n p.push(0x80);\n for (i = bytesLeft + 1; i < numZeros; i++) { p.push(0); }\n p.push((bitLenHi>>>24) & 0xff);\n p.push((bitLenHi>>>16) & 0xff);\n p.push((bitLenHi>>>8) & 0xff);\n p.push((bitLenHi>>>0) & 0xff);\n p.push((bitLenLo>>>24) & 0xff);\n p.push((bitLenLo>>>16) & 0xff);\n p.push((bitLenLo>>>8) & 0xff);\n p.push((bitLenLo>>>0) & 0xff);\n\n blocks(p);\n\n return [\n (h0>>>24) & 0xff, (h0>>>16) & 0xff, (h0>>>8) & 0xff, (h0>>>0) & 0xff,\n (h1>>>24) & 0xff, (h1>>>16) & 0xff, (h1>>>8) & 0xff, (h1>>>0) & 0xff,\n (h2>>>24) & 0xff, (h2>>>16) & 0xff, (h2>>>8) & 0xff, (h2>>>0) & 0xff,\n (h3>>>24) & 0xff, (h3>>>16) & 0xff, (h3>>>8) & 0xff, (h3>>>0) & 0xff,\n (h4>>>24) & 0xff, (h4>>>16) & 0xff, (h4>>>8) & 0xff, (h4>>>0) & 0xff,\n (h5>>>24) & 0xff, (h5>>>16) & 0xff, (h5>>>8) & 0xff, (h5>>>0) & 0xff,\n (h6>>>24) & 0xff, (h6>>>16) & 0xff, (h6>>>8) & 0xff, (h6>>>0) & 0xff,\n (h7>>>24) & 0xff, (h7>>>16) & 0xff, (h7>>>8) & 0xff, (h7>>>0) & 0xff\n ];\n }", "title": "" }, { "docid": "4a5fce973516693fc14684e58506e3fa", "score": "0.6435721", "text": "function SHA256(m) {\n var K = [\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b,\n 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01,\n 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7,\n 0xc19bf174, 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,\n 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x983e5152,\n 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147,\n 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc,\n 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819,\n 0xd6990624, 0xf40e3585, 0x106aa070, 0x19a4c116, 0x1e376c08,\n 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f,\n 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,\n 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n ];\n\n var h0 = 0x6a09e667, h1 = 0xbb67ae85, h2 = 0x3c6ef372, h3 = 0xa54ff53a;\n var h4 = 0x510e527f, h5 = 0x9b05688c, h6 = 0x1f83d9ab, h7 = 0x5be0cd19;\n var w = new Array(64);\n\n function blocks(p) {\n var off = 0, len = p.length;\n while (len >= 64) {\n var a = h0, b = h1, c = h2, d = h3, e = h4, f = h5, g = h6, h = h7, u, i, j, t1, t2;\n\n for (i = 0; i < 16; i++) {\n j = off + i*4;\n w[i] = ((p[j] & 0xff)<<24) | ((p[j+1] & 0xff)<<16) |\n ((p[j+2] & 0xff)<<8) | (p[j+3] & 0xff);\n }\n\n for (i = 16; i < 64; i++) {\n u = w[i-2];\n t1 = ((u>>>17) | (u<<(32-17))) ^ ((u>>>19) | (u<<(32-19))) ^ (u>>>10);\n\n u = w[i-15];\n t2 = ((u>>>7) | (u<<(32-7))) ^ ((u>>>18) | (u<<(32-18))) ^ (u>>>3);\n\n w[i] = (((t1 + w[i-7]) | 0) + ((t2 + w[i-16]) | 0)) | 0;\n }\n\n for (i = 0; i < 64; i++) {\n t1 = ((((((e>>>6) | (e<<(32-6))) ^ ((e>>>11) | (e<<(32-11))) ^\n ((e>>>25) | (e<<(32-25)))) + ((e & f) ^ (~e & g))) | 0) +\n ((h + ((K[i] + w[i]) | 0)) | 0)) | 0;\n\n t2 = ((((a>>>2) | (a<<(32-2))) ^ ((a>>>13) | (a<<(32-13))) ^\n ((a>>>22) | (a<<(32-22)))) + ((a & b) ^ (a & c) ^ (b & c))) | 0;\n\n h = g;\n g = f;\n f = e;\n e = (d + t1) | 0;\n d = c;\n c = b;\n b = a;\n a = (t1 + t2) | 0;\n }\n\n h0 = (h0 + a) | 0;\n h1 = (h1 + b) | 0;\n h2 = (h2 + c) | 0;\n h3 = (h3 + d) | 0;\n h4 = (h4 + e) | 0;\n h5 = (h5 + f) | 0;\n h6 = (h6 + g) | 0;\n h7 = (h7 + h) | 0;\n\n off += 64;\n len -= 64;\n }\n }\n\n blocks(m);\n\n var i, bytesLeft = m.length % 64,\n bitLenHi = (m.length / 0x20000000) | 0,\n bitLenLo = m.length << 3,\n numZeros = (bytesLeft < 56) ? 56 : 120,\n p = m.slice(m.length - bytesLeft, m.length);\n\n p.push(0x80);\n for (i = bytesLeft + 1; i < numZeros; i++) { p.push(0); }\n p.push((bitLenHi>>>24) & 0xff);\n p.push((bitLenHi>>>16) & 0xff);\n p.push((bitLenHi>>>8) & 0xff);\n p.push((bitLenHi>>>0) & 0xff);\n p.push((bitLenLo>>>24) & 0xff);\n p.push((bitLenLo>>>16) & 0xff);\n p.push((bitLenLo>>>8) & 0xff);\n p.push((bitLenLo>>>0) & 0xff);\n\n blocks(p);\n\n return [\n (h0>>>24) & 0xff, (h0>>>16) & 0xff, (h0>>>8) & 0xff, (h0>>>0) & 0xff,\n (h1>>>24) & 0xff, (h1>>>16) & 0xff, (h1>>>8) & 0xff, (h1>>>0) & 0xff,\n (h2>>>24) & 0xff, (h2>>>16) & 0xff, (h2>>>8) & 0xff, (h2>>>0) & 0xff,\n (h3>>>24) & 0xff, (h3>>>16) & 0xff, (h3>>>8) & 0xff, (h3>>>0) & 0xff,\n (h4>>>24) & 0xff, (h4>>>16) & 0xff, (h4>>>8) & 0xff, (h4>>>0) & 0xff,\n (h5>>>24) & 0xff, (h5>>>16) & 0xff, (h5>>>8) & 0xff, (h5>>>0) & 0xff,\n (h6>>>24) & 0xff, (h6>>>16) & 0xff, (h6>>>8) & 0xff, (h6>>>0) & 0xff,\n (h7>>>24) & 0xff, (h7>>>16) & 0xff, (h7>>>8) & 0xff, (h7>>>0) & 0xff\n ];\n }", "title": "" }, { "docid": "87d281168284df785fea93a76207b340", "score": "0.6408218", "text": "function rstr_sha256(s)\n{\n return binb2rstr(binb_sha256(rstr2binb(s), s.length * 8));\n}", "title": "" }, { "docid": "5fccd2835d69669af00ca1bca18b00b3", "score": "0.6406286", "text": "function sha256_S(X, n) {\n return (X >>> n) | (X << (32 - n));\n }", "title": "" }, { "docid": "7df8107e66b63f4e1a8e1bb2538f5682", "score": "0.63872164", "text": "function SHA256_finalize() {\n SHA256_buf[SHA256_buf.length] = 0x80;\n\n if (SHA256_buf.length > 64 - 8) {\n for(var i = SHA256_buf.length; i < 64; i++)\n SHA256_buf[i] = 0;\n SHA256_Hash_Byte_Block(SHA256_H, SHA256_buf);\n SHA256_buf.length = 0;\n }\n\n for(var i = SHA256_buf.length; i < 64 - 5; i++)\n SHA256_buf[i] = 0;\n SHA256_buf[59] = (SHA256_len >>> 29) & 0xff;\n SHA256_buf[60] = (SHA256_len >>> 21) & 0xff;\n SHA256_buf[61] = (SHA256_len >>> 13) & 0xff;\n SHA256_buf[62] = (SHA256_len >>> 5) & 0xff;\n SHA256_buf[63] = (SHA256_len << 3) & 0xff;\n SHA256_Hash_Byte_Block(SHA256_H, SHA256_buf);\n\n var res = new Array(32);\n for(var i = 0; i < 8; i++) {\n res[4 * i + 0] = SHA256_H[i] >>> 24;\n res[4 * i + 1] = (SHA256_H[i] >> 16) & 0xff;\n res[4 * i + 2] = (SHA256_H[i] >> 8) & 0xff;\n res[4 * i + 3] = SHA256_H[i] & 0xff;\n }\n\n delete SHA256_H;\n delete SHA256_buf;\n delete SHA256_len;\n return res;\n}", "title": "" }, { "docid": "32bf3390297c76df9d0b1eb35530d808", "score": "0.6386842", "text": "function sha256_S(X, n) {\n return (X >>> n) | (X << (32 - n));\n }", "title": "" }, { "docid": "32bf3390297c76df9d0b1eb35530d808", "score": "0.6386842", "text": "function sha256_S(X, n) {\n return (X >>> n) | (X << (32 - n));\n }", "title": "" }, { "docid": "32bf3390297c76df9d0b1eb35530d808", "score": "0.6386842", "text": "function sha256_S(X, n) {\n return (X >>> n) | (X << (32 - n));\n }", "title": "" }, { "docid": "1877ba19dfef7fbbc61279aaca098850", "score": "0.63739264", "text": "function getSHA(pwd) {\r\n\tlet hash = crypto.createHash('sha256').update(pwd).digest('base64');\r\n\treturn hash;\r\n}", "title": "" }, { "docid": "5a7bebda8fa5560baad729fb8ab53307", "score": "0.6364005", "text": "function hex_sha256(s) { return rstr2hex(rstr_sha256(str2rstr_utf8(s))); }", "title": "" }, { "docid": "6cf258e79118936650f3b7cd29cb9e8d", "score": "0.63265014", "text": "function rstr_sha256(s)\n {\n return binb2rstr(binb_sha256(rstr2binb(s), s.length * 8));\n }", "title": "" }, { "docid": "eecad387a80403945afade25397776da", "score": "0.6307321", "text": "function hex_sha256(s) { return rstr2hex(rstr_sha256(str2rstr_utf8(s))); }", "title": "" }, { "docid": "720498c88cd7d1b6cd97bbd9acd6c1c5", "score": "0.62814707", "text": "function SHA256_hash(msg) {\n var res;\n SHA256_init();\n SHA256_write(msg);\n res = SHA256_finalize();\n return array_to_hex_string(res);\n}", "title": "" }, { "docid": "3cc5c56aa9826666ed1aed379b743edc", "score": "0.626807", "text": "function hash(data) { return crypto.createHash('sha256').update(data).digest('hex'); }", "title": "" }, { "docid": "495b1b34012017d27c6f3d076b45c8d8", "score": "0.62519705", "text": "function SHA256(m) {\n\t const K = new Uint32Array([\n\t 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b,\n\t 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01,\n\t 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7,\n\t 0xc19bf174, 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,\n\t 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x983e5152,\n\t 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147,\n\t 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc,\n\t 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n\t 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819,\n\t 0xd6990624, 0xf40e3585, 0x106aa070, 0x19a4c116, 0x1e376c08,\n\t 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f,\n\t 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,\n\t 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n\t ]);\n\n\t let h0 = 0x6a09e667, h1 = 0xbb67ae85, h2 = 0x3c6ef372, h3 = 0xa54ff53a;\n\t let h4 = 0x510e527f, h5 = 0x9b05688c, h6 = 0x1f83d9ab, h7 = 0x5be0cd19;\n\t const w = new Uint32Array(64);\n\n\t function blocks(p) {\n\t let off = 0, len = p.length;\n\t while (len >= 64) {\n\t let a = h0, b = h1, c = h2, d = h3, e = h4, f = h5, g = h6, h = h7, u, i, j, t1, t2;\n\n\t for (i = 0; i < 16; i++) {\n\t j = off + i*4;\n\t w[i] = ((p[j] & 0xff)<<24) | ((p[j+1] & 0xff)<<16) |\n\t ((p[j+2] & 0xff)<<8) | (p[j+3] & 0xff);\n\t }\n\n\t for (i = 16; i < 64; i++) {\n\t u = w[i-2];\n\t t1 = ((u>>>17) | (u<<(32-17))) ^ ((u>>>19) | (u<<(32-19))) ^ (u>>>10);\n\n\t u = w[i-15];\n\t t2 = ((u>>>7) | (u<<(32-7))) ^ ((u>>>18) | (u<<(32-18))) ^ (u>>>3);\n\n\t w[i] = (((t1 + w[i-7]) | 0) + ((t2 + w[i-16]) | 0)) | 0;\n\t }\n\n\t for (i = 0; i < 64; i++) {\n\t t1 = ((((((e>>>6) | (e<<(32-6))) ^ ((e>>>11) | (e<<(32-11))) ^\n\t ((e>>>25) | (e<<(32-25)))) + ((e & f) ^ (~e & g))) | 0) +\n\t ((h + ((K[i] + w[i]) | 0)) | 0)) | 0;\n\n\t t2 = ((((a>>>2) | (a<<(32-2))) ^ ((a>>>13) | (a<<(32-13))) ^\n\t ((a>>>22) | (a<<(32-22)))) + ((a & b) ^ (a & c) ^ (b & c))) | 0;\n\n\t h = g;\n\t g = f;\n\t f = e;\n\t e = (d + t1) | 0;\n\t d = c;\n\t c = b;\n\t b = a;\n\t a = (t1 + t2) | 0;\n\t }\n\n\t h0 = (h0 + a) | 0;\n\t h1 = (h1 + b) | 0;\n\t h2 = (h2 + c) | 0;\n\t h3 = (h3 + d) | 0;\n\t h4 = (h4 + e) | 0;\n\t h5 = (h5 + f) | 0;\n\t h6 = (h6 + g) | 0;\n\t h7 = (h7 + h) | 0;\n\n\t off += 64;\n\t len -= 64;\n\t }\n\t }\n\n\t blocks(m);\n\n\t let i, bytesLeft = m.length % 64,\n\t bitLenHi = (m.length / 0x20000000) | 0,\n\t bitLenLo = m.length << 3,\n\t numZeros = (bytesLeft < 56) ? 56 : 120,\n\t p = m.slice(m.length - bytesLeft, m.length);\n\n\t p.push(0x80);\n\t for (i = bytesLeft + 1; i < numZeros; i++) { p.push(0); }\n\t p.push((bitLenHi >>> 24) & 0xff);\n\t p.push((bitLenHi >>> 16) & 0xff);\n\t p.push((bitLenHi >>> 8) & 0xff);\n\t p.push((bitLenHi >>> 0) & 0xff);\n\t p.push((bitLenLo >>> 24) & 0xff);\n\t p.push((bitLenLo >>> 16) & 0xff);\n\t p.push((bitLenLo >>> 8) & 0xff);\n\t p.push((bitLenLo >>> 0) & 0xff);\n\n\t blocks(p);\n\n\t return [\n\t (h0 >>> 24) & 0xff, (h0 >>> 16) & 0xff, (h0 >>> 8) & 0xff, (h0 >>> 0) & 0xff,\n\t (h1 >>> 24) & 0xff, (h1 >>> 16) & 0xff, (h1 >>> 8) & 0xff, (h1 >>> 0) & 0xff,\n\t (h2 >>> 24) & 0xff, (h2 >>> 16) & 0xff, (h2 >>> 8) & 0xff, (h2 >>> 0) & 0xff,\n\t (h3 >>> 24) & 0xff, (h3 >>> 16) & 0xff, (h3 >>> 8) & 0xff, (h3 >>> 0) & 0xff,\n\t (h4 >>> 24) & 0xff, (h4 >>> 16) & 0xff, (h4 >>> 8) & 0xff, (h4 >>> 0) & 0xff,\n\t (h5 >>> 24) & 0xff, (h5 >>> 16) & 0xff, (h5 >>> 8) & 0xff, (h5 >>> 0) & 0xff,\n\t (h6 >>> 24) & 0xff, (h6 >>> 16) & 0xff, (h6 >>> 8) & 0xff, (h6 >>> 0) & 0xff,\n\t (h7 >>> 24) & 0xff, (h7 >>> 16) & 0xff, (h7 >>> 8) & 0xff, (h7 >>> 0) & 0xff\n\t ];\n\t }", "title": "" }, { "docid": "147c352406011cc1f79fb6c2009e49e2", "score": "0.6238713", "text": "calculateHash() {\r\n return new SHA256(\r\n this.index +\r\n this.timestamp +\r\n this.previousHash +\r\n JSON.stringify(this.data) +\r\n this.nonce\r\n ).toString();\r\n }", "title": "" }, { "docid": "813c7d5acf2c91710a102be58959c2fd", "score": "0.6238404", "text": "calculateHash(){\n return SHA256(this.index \n + this.previoushash + this.timestamp \n + JSON.stringify(this.data) + this.nonce).toString(); \n \n }", "title": "" }, { "docid": "d7ddfe8c1e2f84a1ab433b8d33fc9124", "score": "0.62273556", "text": "function hash2(key, arrLength) {\n let total = 0;\n let WEIRD_PRIME = 31;\n for (let i = 0; i < Math.min(key.length, 100); i++) {\n let char = key[i];\n let value = char.charCodeAt(0) - 96;\n total = (total * WEIRD_PRIME + value) % arrLength;\n }\n return total;\n}", "title": "" }, { "docid": "6ffef8033f5999d02ce55f867051861d", "score": "0.622349", "text": "function createHash (data) {\n return trimBase64(crypto.createHash('sha256').update(data).digest('base64'))\n}", "title": "" }, { "docid": "981d5d3f083fe12aa5221bbf97e87383", "score": "0.62061536", "text": "calculateHash(){\r\n //have to toString the hash\r\n //PART2 - add nonce to the hash\r\n return SHA256(this.index + this.timestamp + this.previoushash + JSON.stringify(this.data) + this.nonce).toString();\r\n }", "title": "" }, { "docid": "981d5d3f083fe12aa5221bbf97e87383", "score": "0.62061536", "text": "calculateHash(){\r\n //have to toString the hash\r\n //PART2 - add nonce to the hash\r\n return SHA256(this.index + this.timestamp + this.previoushash + JSON.stringify(this.data) + this.nonce).toString();\r\n }", "title": "" }, { "docid": "daf804ee255018e52cc130301431372c", "score": "0.61931723", "text": "calculateHash() {\n return SHA512(this.previousHash + this.timestamp +\n JSON.stringify(this.transactions) + this._nonce.toString()).toString();\n }", "title": "" }, { "docid": "8eeee4f31a489f24e6e66825874f7971", "score": "0.61931306", "text": "calculateHash(){\r\n return SHA256(this.previousHash + this.timestamp + JSON.stringify(this.transactions) + this.nonce).toString();\r\n }", "title": "" }, { "docid": "fba9ec6075aeef76fe9aa52770af31c0", "score": "0.6178106", "text": "calculateHash() {\r\n return SHA256(this.index + this.previousHash + this.timestamp + \r\n JSON.stringify(this.data)).toString();\r\n }", "title": "" }, { "docid": "46b958772b801e95f459f0d421cd9685", "score": "0.61723346", "text": "calculateHash(){\n return SHA256(this.index + this.previousHash + this.timestamp + JSON.stringify(this.data)).toString();\n }", "title": "" }, { "docid": "9a6952a4e14c0a5848eff9845924ae71", "score": "0.6150263", "text": "function hash(pwd) {\n var shaObj = new jsSHA(\"SHA-256\", \"TEXT\");\n var coeff = 1000 * 5;\n var date = Date.now(); //or use any other date\n var rounded = Math.round(date / coeff) * coeff;\n shaObj.update(pwd + rounded);\n var hash = shaObj.getHash(\"HEX\");\n return hash;\n}", "title": "" }, { "docid": "11e331bb98e2f04cb23179f00fc59a7c", "score": "0.6149427", "text": "calculateHash() {\n //for the hash index, timestamp, data, previous hash is used\n return SHA256(\n this.timestamp +\n this.previousHash +\n this.nonce +\n JSON.stringify(this.data)).toString()\n }", "title": "" }, { "docid": "68ef6e82d5ffcf14eeef527c320b30fd", "score": "0.61355287", "text": "calculateHash(){\n return SHA256(this.index + this.previousHash + this.timestamp + JSON.stringify(this.data) + this.nonce).toString();\n }", "title": "" }, { "docid": "10b8fef5c5665879dd3ce69dd4f08020", "score": "0.6112649", "text": "calculateHash(){\n return SHA256(this.previousHash + this.timestamp + JSON.stringify(this.transactions)+ this.nonce).toString();\n }", "title": "" }, { "docid": "70909c72eb0594c7642557557ea9c5e7", "score": "0.61018175", "text": "function djb2(str){\n var hash = 5381;\n for (var i = 0; i < str.length; i++) {\n hash = ((hash << 5) + hash) + str.charCodeAt(i); /* hash * 33 + c */\n }\n return hash;\n}", "title": "" }, { "docid": "70909c72eb0594c7642557557ea9c5e7", "score": "0.61018175", "text": "function djb2(str){\n var hash = 5381;\n for (var i = 0; i < str.length; i++) {\n hash = ((hash << 5) + hash) + str.charCodeAt(i); /* hash * 33 + c */\n }\n return hash;\n}", "title": "" }, { "docid": "0eeebc7c54adcf504bd07e9d4e8c0501", "score": "0.60674745", "text": "function SHA256(m) {\n const K = new Uint32Array([\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b,\n 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01,\n 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7,\n 0xc19bf174, 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,\n 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x983e5152,\n 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147,\n 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc,\n 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819,\n 0xd6990624, 0xf40e3585, 0x106aa070, 0x19a4c116, 0x1e376c08,\n 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f,\n 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,\n 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n ]);\n\n let h0 = 0x6a09e667, h1 = 0xbb67ae85, h2 = 0x3c6ef372, h3 = 0xa54ff53a;\n let h4 = 0x510e527f, h5 = 0x9b05688c, h6 = 0x1f83d9ab, h7 = 0x5be0cd19;\n const w = new Uint32Array(64);\n\n function blocks(p) {\n let off = 0, len = p.length;\n while (len >= 64) {\n let a = h0, b = h1, c = h2, d = h3, e = h4, f = h5, g = h6, h = h7, u, i, j, t1, t2;\n\n for (i = 0; i < 16; i++) {\n j = off + i*4;\n w[i] = ((p[j] & 0xff)<<24) | ((p[j+1] & 0xff)<<16) |\n ((p[j+2] & 0xff)<<8) | (p[j+3] & 0xff);\n }\n\n for (i = 16; i < 64; i++) {\n u = w[i-2];\n t1 = ((u>>>17) | (u<<(32-17))) ^ ((u>>>19) | (u<<(32-19))) ^ (u>>>10);\n\n u = w[i-15];\n t2 = ((u>>>7) | (u<<(32-7))) ^ ((u>>>18) | (u<<(32-18))) ^ (u>>>3);\n\n w[i] = (((t1 + w[i-7]) | 0) + ((t2 + w[i-16]) | 0)) | 0;\n }\n\n for (i = 0; i < 64; i++) {\n t1 = ((((((e>>>6) | (e<<(32-6))) ^ ((e>>>11) | (e<<(32-11))) ^\n ((e>>>25) | (e<<(32-25)))) + ((e & f) ^ (~e & g))) | 0) +\n ((h + ((K[i] + w[i]) | 0)) | 0)) | 0;\n\n t2 = ((((a>>>2) | (a<<(32-2))) ^ ((a>>>13) | (a<<(32-13))) ^\n ((a>>>22) | (a<<(32-22)))) + ((a & b) ^ (a & c) ^ (b & c))) | 0;\n\n h = g;\n g = f;\n f = e;\n e = (d + t1) | 0;\n d = c;\n c = b;\n b = a;\n a = (t1 + t2) | 0;\n }\n\n h0 = (h0 + a) | 0;\n h1 = (h1 + b) | 0;\n h2 = (h2 + c) | 0;\n h3 = (h3 + d) | 0;\n h4 = (h4 + e) | 0;\n h5 = (h5 + f) | 0;\n h6 = (h6 + g) | 0;\n h7 = (h7 + h) | 0;\n\n off += 64;\n len -= 64;\n }\n }\n\n blocks(m);\n\n let i, bytesLeft = m.length % 64,\n bitLenHi = (m.length / 0x20000000) | 0,\n bitLenLo = m.length << 3,\n numZeros = (bytesLeft < 56) ? 56 : 120,\n p = m.slice(m.length - bytesLeft, m.length);\n\n p.push(0x80);\n for (i = bytesLeft + 1; i < numZeros; i++) { p.push(0); }\n p.push((bitLenHi >>> 24) & 0xff);\n p.push((bitLenHi >>> 16) & 0xff);\n p.push((bitLenHi >>> 8) & 0xff);\n p.push((bitLenHi >>> 0) & 0xff);\n p.push((bitLenLo >>> 24) & 0xff);\n p.push((bitLenLo >>> 16) & 0xff);\n p.push((bitLenLo >>> 8) & 0xff);\n p.push((bitLenLo >>> 0) & 0xff);\n\n blocks(p);\n\n return [\n (h0 >>> 24) & 0xff, (h0 >>> 16) & 0xff, (h0 >>> 8) & 0xff, (h0 >>> 0) & 0xff,\n (h1 >>> 24) & 0xff, (h1 >>> 16) & 0xff, (h1 >>> 8) & 0xff, (h1 >>> 0) & 0xff,\n (h2 >>> 24) & 0xff, (h2 >>> 16) & 0xff, (h2 >>> 8) & 0xff, (h2 >>> 0) & 0xff,\n (h3 >>> 24) & 0xff, (h3 >>> 16) & 0xff, (h3 >>> 8) & 0xff, (h3 >>> 0) & 0xff,\n (h4 >>> 24) & 0xff, (h4 >>> 16) & 0xff, (h4 >>> 8) & 0xff, (h4 >>> 0) & 0xff,\n (h5 >>> 24) & 0xff, (h5 >>> 16) & 0xff, (h5 >>> 8) & 0xff, (h5 >>> 0) & 0xff,\n (h6 >>> 24) & 0xff, (h6 >>> 16) & 0xff, (h6 >>> 8) & 0xff, (h6 >>> 0) & 0xff,\n (h7 >>> 24) & 0xff, (h7 >>> 16) & 0xff, (h7 >>> 8) & 0xff, (h7 >>> 0) & 0xff\n ];\n }", "title": "" }, { "docid": "0eeebc7c54adcf504bd07e9d4e8c0501", "score": "0.60674745", "text": "function SHA256(m) {\n const K = new Uint32Array([\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b,\n 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01,\n 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7,\n 0xc19bf174, 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,\n 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x983e5152,\n 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147,\n 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc,\n 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819,\n 0xd6990624, 0xf40e3585, 0x106aa070, 0x19a4c116, 0x1e376c08,\n 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f,\n 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,\n 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n ]);\n\n let h0 = 0x6a09e667, h1 = 0xbb67ae85, h2 = 0x3c6ef372, h3 = 0xa54ff53a;\n let h4 = 0x510e527f, h5 = 0x9b05688c, h6 = 0x1f83d9ab, h7 = 0x5be0cd19;\n const w = new Uint32Array(64);\n\n function blocks(p) {\n let off = 0, len = p.length;\n while (len >= 64) {\n let a = h0, b = h1, c = h2, d = h3, e = h4, f = h5, g = h6, h = h7, u, i, j, t1, t2;\n\n for (i = 0; i < 16; i++) {\n j = off + i*4;\n w[i] = ((p[j] & 0xff)<<24) | ((p[j+1] & 0xff)<<16) |\n ((p[j+2] & 0xff)<<8) | (p[j+3] & 0xff);\n }\n\n for (i = 16; i < 64; i++) {\n u = w[i-2];\n t1 = ((u>>>17) | (u<<(32-17))) ^ ((u>>>19) | (u<<(32-19))) ^ (u>>>10);\n\n u = w[i-15];\n t2 = ((u>>>7) | (u<<(32-7))) ^ ((u>>>18) | (u<<(32-18))) ^ (u>>>3);\n\n w[i] = (((t1 + w[i-7]) | 0) + ((t2 + w[i-16]) | 0)) | 0;\n }\n\n for (i = 0; i < 64; i++) {\n t1 = ((((((e>>>6) | (e<<(32-6))) ^ ((e>>>11) | (e<<(32-11))) ^\n ((e>>>25) | (e<<(32-25)))) + ((e & f) ^ (~e & g))) | 0) +\n ((h + ((K[i] + w[i]) | 0)) | 0)) | 0;\n\n t2 = ((((a>>>2) | (a<<(32-2))) ^ ((a>>>13) | (a<<(32-13))) ^\n ((a>>>22) | (a<<(32-22)))) + ((a & b) ^ (a & c) ^ (b & c))) | 0;\n\n h = g;\n g = f;\n f = e;\n e = (d + t1) | 0;\n d = c;\n c = b;\n b = a;\n a = (t1 + t2) | 0;\n }\n\n h0 = (h0 + a) | 0;\n h1 = (h1 + b) | 0;\n h2 = (h2 + c) | 0;\n h3 = (h3 + d) | 0;\n h4 = (h4 + e) | 0;\n h5 = (h5 + f) | 0;\n h6 = (h6 + g) | 0;\n h7 = (h7 + h) | 0;\n\n off += 64;\n len -= 64;\n }\n }\n\n blocks(m);\n\n let i, bytesLeft = m.length % 64,\n bitLenHi = (m.length / 0x20000000) | 0,\n bitLenLo = m.length << 3,\n numZeros = (bytesLeft < 56) ? 56 : 120,\n p = m.slice(m.length - bytesLeft, m.length);\n\n p.push(0x80);\n for (i = bytesLeft + 1; i < numZeros; i++) { p.push(0); }\n p.push((bitLenHi >>> 24) & 0xff);\n p.push((bitLenHi >>> 16) & 0xff);\n p.push((bitLenHi >>> 8) & 0xff);\n p.push((bitLenHi >>> 0) & 0xff);\n p.push((bitLenLo >>> 24) & 0xff);\n p.push((bitLenLo >>> 16) & 0xff);\n p.push((bitLenLo >>> 8) & 0xff);\n p.push((bitLenLo >>> 0) & 0xff);\n\n blocks(p);\n\n return [\n (h0 >>> 24) & 0xff, (h0 >>> 16) & 0xff, (h0 >>> 8) & 0xff, (h0 >>> 0) & 0xff,\n (h1 >>> 24) & 0xff, (h1 >>> 16) & 0xff, (h1 >>> 8) & 0xff, (h1 >>> 0) & 0xff,\n (h2 >>> 24) & 0xff, (h2 >>> 16) & 0xff, (h2 >>> 8) & 0xff, (h2 >>> 0) & 0xff,\n (h3 >>> 24) & 0xff, (h3 >>> 16) & 0xff, (h3 >>> 8) & 0xff, (h3 >>> 0) & 0xff,\n (h4 >>> 24) & 0xff, (h4 >>> 16) & 0xff, (h4 >>> 8) & 0xff, (h4 >>> 0) & 0xff,\n (h5 >>> 24) & 0xff, (h5 >>> 16) & 0xff, (h5 >>> 8) & 0xff, (h5 >>> 0) & 0xff,\n (h6 >>> 24) & 0xff, (h6 >>> 16) & 0xff, (h6 >>> 8) & 0xff, (h6 >>> 0) & 0xff,\n (h7 >>> 24) & 0xff, (h7 >>> 16) & 0xff, (h7 >>> 8) & 0xff, (h7 >>> 0) & 0xff\n ];\n }", "title": "" }, { "docid": "0eeebc7c54adcf504bd07e9d4e8c0501", "score": "0.60674745", "text": "function SHA256(m) {\n const K = new Uint32Array([\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b,\n 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01,\n 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7,\n 0xc19bf174, 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,\n 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x983e5152,\n 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147,\n 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc,\n 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819,\n 0xd6990624, 0xf40e3585, 0x106aa070, 0x19a4c116, 0x1e376c08,\n 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f,\n 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,\n 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n ]);\n\n let h0 = 0x6a09e667, h1 = 0xbb67ae85, h2 = 0x3c6ef372, h3 = 0xa54ff53a;\n let h4 = 0x510e527f, h5 = 0x9b05688c, h6 = 0x1f83d9ab, h7 = 0x5be0cd19;\n const w = new Uint32Array(64);\n\n function blocks(p) {\n let off = 0, len = p.length;\n while (len >= 64) {\n let a = h0, b = h1, c = h2, d = h3, e = h4, f = h5, g = h6, h = h7, u, i, j, t1, t2;\n\n for (i = 0; i < 16; i++) {\n j = off + i*4;\n w[i] = ((p[j] & 0xff)<<24) | ((p[j+1] & 0xff)<<16) |\n ((p[j+2] & 0xff)<<8) | (p[j+3] & 0xff);\n }\n\n for (i = 16; i < 64; i++) {\n u = w[i-2];\n t1 = ((u>>>17) | (u<<(32-17))) ^ ((u>>>19) | (u<<(32-19))) ^ (u>>>10);\n\n u = w[i-15];\n t2 = ((u>>>7) | (u<<(32-7))) ^ ((u>>>18) | (u<<(32-18))) ^ (u>>>3);\n\n w[i] = (((t1 + w[i-7]) | 0) + ((t2 + w[i-16]) | 0)) | 0;\n }\n\n for (i = 0; i < 64; i++) {\n t1 = ((((((e>>>6) | (e<<(32-6))) ^ ((e>>>11) | (e<<(32-11))) ^\n ((e>>>25) | (e<<(32-25)))) + ((e & f) ^ (~e & g))) | 0) +\n ((h + ((K[i] + w[i]) | 0)) | 0)) | 0;\n\n t2 = ((((a>>>2) | (a<<(32-2))) ^ ((a>>>13) | (a<<(32-13))) ^\n ((a>>>22) | (a<<(32-22)))) + ((a & b) ^ (a & c) ^ (b & c))) | 0;\n\n h = g;\n g = f;\n f = e;\n e = (d + t1) | 0;\n d = c;\n c = b;\n b = a;\n a = (t1 + t2) | 0;\n }\n\n h0 = (h0 + a) | 0;\n h1 = (h1 + b) | 0;\n h2 = (h2 + c) | 0;\n h3 = (h3 + d) | 0;\n h4 = (h4 + e) | 0;\n h5 = (h5 + f) | 0;\n h6 = (h6 + g) | 0;\n h7 = (h7 + h) | 0;\n\n off += 64;\n len -= 64;\n }\n }\n\n blocks(m);\n\n let i, bytesLeft = m.length % 64,\n bitLenHi = (m.length / 0x20000000) | 0,\n bitLenLo = m.length << 3,\n numZeros = (bytesLeft < 56) ? 56 : 120,\n p = m.slice(m.length - bytesLeft, m.length);\n\n p.push(0x80);\n for (i = bytesLeft + 1; i < numZeros; i++) { p.push(0); }\n p.push((bitLenHi >>> 24) & 0xff);\n p.push((bitLenHi >>> 16) & 0xff);\n p.push((bitLenHi >>> 8) & 0xff);\n p.push((bitLenHi >>> 0) & 0xff);\n p.push((bitLenLo >>> 24) & 0xff);\n p.push((bitLenLo >>> 16) & 0xff);\n p.push((bitLenLo >>> 8) & 0xff);\n p.push((bitLenLo >>> 0) & 0xff);\n\n blocks(p);\n\n return [\n (h0 >>> 24) & 0xff, (h0 >>> 16) & 0xff, (h0 >>> 8) & 0xff, (h0 >>> 0) & 0xff,\n (h1 >>> 24) & 0xff, (h1 >>> 16) & 0xff, (h1 >>> 8) & 0xff, (h1 >>> 0) & 0xff,\n (h2 >>> 24) & 0xff, (h2 >>> 16) & 0xff, (h2 >>> 8) & 0xff, (h2 >>> 0) & 0xff,\n (h3 >>> 24) & 0xff, (h3 >>> 16) & 0xff, (h3 >>> 8) & 0xff, (h3 >>> 0) & 0xff,\n (h4 >>> 24) & 0xff, (h4 >>> 16) & 0xff, (h4 >>> 8) & 0xff, (h4 >>> 0) & 0xff,\n (h5 >>> 24) & 0xff, (h5 >>> 16) & 0xff, (h5 >>> 8) & 0xff, (h5 >>> 0) & 0xff,\n (h6 >>> 24) & 0xff, (h6 >>> 16) & 0xff, (h6 >>> 8) & 0xff, (h6 >>> 0) & 0xff,\n (h7 >>> 24) & 0xff, (h7 >>> 16) & 0xff, (h7 >>> 8) & 0xff, (h7 >>> 0) & 0xff\n ];\n }", "title": "" }, { "docid": "0eeebc7c54adcf504bd07e9d4e8c0501", "score": "0.60674745", "text": "function SHA256(m) {\n const K = new Uint32Array([\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b,\n 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01,\n 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7,\n 0xc19bf174, 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,\n 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x983e5152,\n 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147,\n 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc,\n 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819,\n 0xd6990624, 0xf40e3585, 0x106aa070, 0x19a4c116, 0x1e376c08,\n 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f,\n 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,\n 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n ]);\n\n let h0 = 0x6a09e667, h1 = 0xbb67ae85, h2 = 0x3c6ef372, h3 = 0xa54ff53a;\n let h4 = 0x510e527f, h5 = 0x9b05688c, h6 = 0x1f83d9ab, h7 = 0x5be0cd19;\n const w = new Uint32Array(64);\n\n function blocks(p) {\n let off = 0, len = p.length;\n while (len >= 64) {\n let a = h0, b = h1, c = h2, d = h3, e = h4, f = h5, g = h6, h = h7, u, i, j, t1, t2;\n\n for (i = 0; i < 16; i++) {\n j = off + i*4;\n w[i] = ((p[j] & 0xff)<<24) | ((p[j+1] & 0xff)<<16) |\n ((p[j+2] & 0xff)<<8) | (p[j+3] & 0xff);\n }\n\n for (i = 16; i < 64; i++) {\n u = w[i-2];\n t1 = ((u>>>17) | (u<<(32-17))) ^ ((u>>>19) | (u<<(32-19))) ^ (u>>>10);\n\n u = w[i-15];\n t2 = ((u>>>7) | (u<<(32-7))) ^ ((u>>>18) | (u<<(32-18))) ^ (u>>>3);\n\n w[i] = (((t1 + w[i-7]) | 0) + ((t2 + w[i-16]) | 0)) | 0;\n }\n\n for (i = 0; i < 64; i++) {\n t1 = ((((((e>>>6) | (e<<(32-6))) ^ ((e>>>11) | (e<<(32-11))) ^\n ((e>>>25) | (e<<(32-25)))) + ((e & f) ^ (~e & g))) | 0) +\n ((h + ((K[i] + w[i]) | 0)) | 0)) | 0;\n\n t2 = ((((a>>>2) | (a<<(32-2))) ^ ((a>>>13) | (a<<(32-13))) ^\n ((a>>>22) | (a<<(32-22)))) + ((a & b) ^ (a & c) ^ (b & c))) | 0;\n\n h = g;\n g = f;\n f = e;\n e = (d + t1) | 0;\n d = c;\n c = b;\n b = a;\n a = (t1 + t2) | 0;\n }\n\n h0 = (h0 + a) | 0;\n h1 = (h1 + b) | 0;\n h2 = (h2 + c) | 0;\n h3 = (h3 + d) | 0;\n h4 = (h4 + e) | 0;\n h5 = (h5 + f) | 0;\n h6 = (h6 + g) | 0;\n h7 = (h7 + h) | 0;\n\n off += 64;\n len -= 64;\n }\n }\n\n blocks(m);\n\n let i, bytesLeft = m.length % 64,\n bitLenHi = (m.length / 0x20000000) | 0,\n bitLenLo = m.length << 3,\n numZeros = (bytesLeft < 56) ? 56 : 120,\n p = m.slice(m.length - bytesLeft, m.length);\n\n p.push(0x80);\n for (i = bytesLeft + 1; i < numZeros; i++) { p.push(0); }\n p.push((bitLenHi >>> 24) & 0xff);\n p.push((bitLenHi >>> 16) & 0xff);\n p.push((bitLenHi >>> 8) & 0xff);\n p.push((bitLenHi >>> 0) & 0xff);\n p.push((bitLenLo >>> 24) & 0xff);\n p.push((bitLenLo >>> 16) & 0xff);\n p.push((bitLenLo >>> 8) & 0xff);\n p.push((bitLenLo >>> 0) & 0xff);\n\n blocks(p);\n\n return [\n (h0 >>> 24) & 0xff, (h0 >>> 16) & 0xff, (h0 >>> 8) & 0xff, (h0 >>> 0) & 0xff,\n (h1 >>> 24) & 0xff, (h1 >>> 16) & 0xff, (h1 >>> 8) & 0xff, (h1 >>> 0) & 0xff,\n (h2 >>> 24) & 0xff, (h2 >>> 16) & 0xff, (h2 >>> 8) & 0xff, (h2 >>> 0) & 0xff,\n (h3 >>> 24) & 0xff, (h3 >>> 16) & 0xff, (h3 >>> 8) & 0xff, (h3 >>> 0) & 0xff,\n (h4 >>> 24) & 0xff, (h4 >>> 16) & 0xff, (h4 >>> 8) & 0xff, (h4 >>> 0) & 0xff,\n (h5 >>> 24) & 0xff, (h5 >>> 16) & 0xff, (h5 >>> 8) & 0xff, (h5 >>> 0) & 0xff,\n (h6 >>> 24) & 0xff, (h6 >>> 16) & 0xff, (h6 >>> 8) & 0xff, (h6 >>> 0) & 0xff,\n (h7 >>> 24) & 0xff, (h7 >>> 16) & 0xff, (h7 >>> 8) & 0xff, (h7 >>> 0) & 0xff\n ];\n }", "title": "" }, { "docid": "efadc0b8f4233f30d6b1cb8ac7cf70c0", "score": "0.6046308", "text": "function sha256(plain) {\n const encoder = new TextEncoder();\n const data = encoder.encode(plain);\n return window.crypto.subtle.digest('SHA-256', data);\n}", "title": "" }, { "docid": "efadc0b8f4233f30d6b1cb8ac7cf70c0", "score": "0.6046308", "text": "function sha256(plain) {\n const encoder = new TextEncoder();\n const data = encoder.encode(plain);\n return window.crypto.subtle.digest('SHA-256', data);\n}", "title": "" }, { "docid": "b98117d039b1a5074d4573d62299eaa0", "score": "0.60437566", "text": "function doubleHachage(entree) {\n entreeBuffer = Buffer.from(entree)\n hash = crypto.createHash(\"sha256\").update(entreeBuffer).digest\n doubleHash = crypto.createHash(\"sha256\").update(hash).digest\n return doubleHash\n}", "title": "" }, { "docid": "1054bd50cf1e08b21d7462cc82ee885f", "score": "0.60289544", "text": "static hash(data) {\n return SHA256(JSON.stringify(data)).toString();\n }", "title": "" }, { "docid": "1054bd50cf1e08b21d7462cc82ee885f", "score": "0.60289544", "text": "static hash(data) {\n return SHA256(JSON.stringify(data)).toString();\n }", "title": "" }, { "docid": "e6a9392e6a65566d3a54275310941d37", "score": "0.6027691", "text": "async function sha256(saltedWord) {\n // encode as UTF-8\n const msgBuffer = new TextEncoder('utf-8').encode(saltedWord);\n // hash the message\n const hashBuffer = await crypto.subtle.digest('SHA-256', msgBuffer);\n // convert to base64\n let base64String = btoa(String.fromCharCode(...new Uint8Array(hashBuffer)));\n return base64String;\n }", "title": "" }, { "docid": "be55b52d9886b746c7844ac13b4deca2", "score": "0.60140824", "text": "function getUpdateHash(filename)\r\n{\r\n var stream = getStream(filename);\r\n if (stream)\r\n return getSHA256ForStream(stream);\r\n}", "title": "" }, { "docid": "0faf882da59308d205685979531f6c73", "score": "0.6012794", "text": "calculateHash() {\n\t\t// taking the transaction and creating a hash id that is a string\n\t\treturn SHA256(this.previousHash + this.timestamp + JSON.stringify(this.transactions) + this.nonce).toString();\n\t}", "title": "" }, { "docid": "2f390fe3c56fefb1c300c7393809a6ae", "score": "0.6009982", "text": "calcHashByPass(pass) {\n let str = \"\";\n str += pass.code || \"\";\n str += pass.givennames || \"\";\n str += pass.eyes || \"\";\n str += pass.height || \"\";\n str += pass.name || \"\";\n str += pass.nationality || \"\";\n str += pass.passnr || \"\";\n str += pass.pob || \"\";\n str += pass.residence || \"\";\n str += pass.sex || \"\";\n str += pass.type || \"\";\n str += pass.dob || \"\";\n str += pass.url || \"\";\n let hash = parity.api.util.sha3(str);\n console.log(str, str.length, hash);\n return hash;\n }", "title": "" }, { "docid": "8b5c3428f4c9114379f5e35470de7709", "score": "0.6009718", "text": "function HmacSHA256(buffer, secret) {\n return crypto.createHmac('sha256', secret).update(buffer).digest()\n}", "title": "" }, { "docid": "b61357701ab8986ff59a4415615b394e", "score": "0.60087717", "text": "function djb2(str){\n\tvar hash = 5381;\n\tfor (var i = 0; i < str.length; i++) {\n\t\thash = ((hash << 5) + hash) + str.charCodeAt(i); /* hash * 33 + c */\n\t}\n\treturn hash;\n}", "title": "" }, { "docid": "5a149b74cc16d55212653341d02f365b", "score": "0.6001485", "text": "function b64_sha1(s){return binb2b64(core_sha1(str2binb(s),s.length * 8));}", "title": "" }, { "docid": "e77b01ca91428f9161365e13d69a314e", "score": "0.5975509", "text": "function computeSha256(inputStr) {\n sha256.append(CryptographicBuffer.convertStringToBinary(inputStr, BinaryStringEncoding.utf8));\n return sha256.getValueAndReset();\n}", "title": "" }, { "docid": "591a03ac608989c5a784c0048d149eb1", "score": "0.59520423", "text": "hashCode(s) {\n let len = s.length;\n let hash = 0;\n for (let i = 0; i < len; ++i) {\n hash = ((hash << 5) - hash) + s.charCodeAt(i);\n }\n // Make hash unsigned\n hash = hash >>> 0;\n return hash;\n }", "title": "" }, { "docid": "6a33dc096c7485641f260d715ba44981", "score": "0.5946757", "text": "function hash(value) {\n var md = new KJUR.crypto.MessageDigest({\"alg\": \"sha256\", \"prov\": \"cryptojs\"});\n var utf8 = unescape(encodeURIComponent(value)); //convert from UTF16 -> UTF8\n md.updateString(utf8);\n var hash = md.digest();\n console.log('Hash : ' + hash);\n hash = btoa(hexToString(hash));\n console.log('Base64 : ' + hash);\n return hash;\n}", "title": "" }, { "docid": "aa62adb6d2f229d6962d67053220ba9b", "score": "0.59447426", "text": "calculateHash() {\n return SHA256(this.timestamp + JSON.stringify(this.transactions) + this.previousHash + this.nonce).toString();\n }", "title": "" }, { "docid": "b10dded00ca28178300c093c3ad1dcf3", "score": "0.59291047", "text": "passwordHash(pass, salt) {\n\t\t//sha256\n\n\t\treturn crypto.createHash('sha256').update(pass + salt).digest('hex')\n\n\t\t//return \"12\" + pass + salt + \"34\";\n\t}", "title": "" }, { "docid": "82a7190a92aff0948a41819b0fad5fc9", "score": "0.5926289", "text": "function djb2Hash(str) {\n\t var hash = 5381;\n\t for (var i = 0; i < str.length; i++) {\n\t hash = ((hash << 5) + hash) + str.charCodeAt(i);\n\t }\n\t return hash;\n\t}", "title": "" }, { "docid": "188a4bc1f3c82a083ade0b3f27ab2aeb", "score": "0.5923748", "text": "function generateHash(s){\n\treturn s.split(\"\").reduce(function(a,b){a=((a<<5)-a)+b.charCodeAt(0);return a&a},0); \n}", "title": "" }, { "docid": "e258495da3d39b420f3665a0d9914b2e", "score": "0.5922553", "text": "calculateHash() {\r\n return SHA256(this.fromAddress + this.toAddress + this.amount);\r\n }", "title": "" }, { "docid": "fac4edd05bdbd618a6d5ff5a1859a10d", "score": "0.59173864", "text": "computeHash() {\n return SHA256(this.index + this.precedingHash + this.timestamp + JSON.stringify(this.data)).toString()\n }", "title": "" }, { "docid": "2868a41a2bc3d73498961d32f0425257", "score": "0.5909831", "text": "function hashData(data)\n{\n var hashedData = CryptoJS.SHA512(data);\n return hashedData;\n}", "title": "" }, { "docid": "ae65754007173a7f8018a26fd364461c", "score": "0.589782", "text": "_calculateHash()\n {\n return SHA256(this.index+this.previousHash+this.timestamp+JSON.stringify(this.data)+this.nonce).toString();\n }", "title": "" }, { "docid": "7e3891f05e5a5be75fb4cf1b9d1af0f9", "score": "0.58803046", "text": "function hash(data) {\n return crypto.createHash('sha512').update(data).digest('hex');\n}", "title": "" }, { "docid": "22be9a3a36249d43185d6f7c61741564", "score": "0.58599854", "text": "function createHash(st) {\n return crypto.createHash('sha512').update(st).digest('hex').toLowerCase()\n}", "title": "" }, { "docid": "22be9a3a36249d43185d6f7c61741564", "score": "0.58599854", "text": "function createHash(st) {\n return crypto.createHash('sha512').update(st).digest('hex').toLowerCase()\n}", "title": "" }, { "docid": "5763aacde26d96a83865fd52e3406c7b", "score": "0.5859455", "text": "function core_sha1(x, len) {\n /* append padding */\n x[len >> 5] |= 0x80 << (24 - len % 32);\n x[((len + 64 >> 9) << 4) + 15] = len;\n\n var w = new Array(80);\n var a = 1732584193;\n var b = -271733879;\n var c = -1732584194;\n var d = 271733878;\n var e = -1009589776;\n\n for (var i = 0; i < x.length; i += 16) {\n var olda = a;\n var oldb = b;\n var oldc = c;\n var oldd = d;\n var olde = e;\n\n for (var j = 0; j < 80; j++) {\n if (j < 16) w[j] = x[i + j];\n else w[j] = rol(w[j - 3] ^ w[j - 8] ^ w[j - 14] ^ w[j - 16], 1);\n var t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)),\n safe_add(safe_add(e, w[j]), sha1_kt(j)));\n e = d;\n d = c;\n c = rol(b, 30);\n b = a;\n a = t;\n }\n\n a = safe_add(a, olda);\n b = safe_add(b, oldb);\n c = safe_add(c, oldc);\n d = safe_add(d, oldd);\n e = safe_add(e, olde);\n }\n return [a, b, c, d, e];\n\n }", "title": "" }, { "docid": "18826a13804b2b8a91c7981867ada464", "score": "0.58424675", "text": "function core_sha1(x, len)\r\n{\r\n /* append padding */\r\n x[len >> 5] |= 0x80 << (24 - len % 32);\r\n x[((len + 64 >> 9) << 4) + 15] = len;\r\n\r\n var w = Array(80);\r\n var a = 1732584193;\r\n var b = -271733879;\r\n var c = -1732584194;\r\n var d = 271733878;\r\n var e = -1009589776;\r\n\r\n for(var i = 0; i < x.length; i += 16)\r\n {\r\n var olda = a;\r\n var oldb = b;\r\n var oldc = c;\r\n var oldd = d;\r\n var olde = e;\r\n\r\n for(var j = 0; j < 80; j++)\r\n {\r\n if(j < 16) w[j] = x[i + j];\r\n else w[j] = rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1);\r\n var t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)),\r\n safe_add(safe_add(e, w[j]), sha1_kt(j)));\r\n e = d;\r\n d = c;\r\n c = rol(b, 30);\r\n b = a;\r\n a = t;\r\n }\r\n\r\n a = safe_add(a, olda);\r\n b = safe_add(b, oldb);\r\n c = safe_add(c, oldc);\r\n d = safe_add(d, oldd);\r\n e = safe_add(e, olde);\r\n }\r\n return Array(a, b, c, d, e);\r\n\r\n}", "title": "" }, { "docid": "06a5c432da7c0b82f6e48bca7b274583", "score": "0.58351344", "text": "function core_sha1(x, len)\n{\n /* append padding */\n x[len >> 5] |= 0x80 << (24 - len % 32);\n x[((len + 64 >> 9) << 4) + 15] = len;\n\n var w = Array(80);\n var a = 1732584193;\n var b = -271733879;\n var c = -1732584194;\n var d = 271733878;\n var e = -1009589776;\n\n for(var i = 0; i < x.length; i += 16)\n {\n var olda = a;\n var oldb = b;\n var oldc = c;\n var oldd = d;\n var olde = e;\n\n for(var j = 0; j < 80; j++)\n {\n if(j < 16) w[j] = x[i + j];\n else w[j] = rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1);\n var t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)),\n safe_add(safe_add(e, w[j]), sha1_kt(j)));\n e = d;\n d = c;\n c = rol(b, 30);\n b = a;\n a = t;\n }\n\n a = safe_add(a, olda);\n b = safe_add(b, oldb);\n c = safe_add(c, oldc);\n d = safe_add(d, oldd);\n e = safe_add(e, olde);\n }\n return Array(a, b, c, d, e);\n\n}", "title": "" }, { "docid": "07a60d437657c39e41f2ab0ff24ab8ce", "score": "0.5831826", "text": "function improvedHash() {\n let total = 0;\n let WEIRD_PRIME = 31;\n for (let i = 0; i < Math.min(key.length, 100); i++) {\n let char = key[i];\n let value = char.charCodeAt(0) - 96\n total = (total * WEIRD_PRIME + value) % arrayLen;\n }\n return total;\n}", "title": "" }, { "docid": "06ecc065236efa0fc226e4f8823c4978", "score": "0.5823959", "text": "function core_sha1(x, len) {\n /* append padding */\n x[len >> 5] |= 0x80 << (24 - len % 32);\n x[((len + 64 >> 9) << 4) + 15] = len;\n var w = Array(80);\n var a = 1732584193;\n var b = -271733879;\n var c = -1732584194;\n var d = 271733878;\n var e = -1009589776;\n for (var i = 0; i < x.length; i += 16) {\n var olda = a;\n var oldb = b;\n var oldc = c;\n var oldd = d;\n var olde = e;\n for (var j = 0; j < 80; j++) {\n if (j < 16) w[j] = x[i + j];\n else w[j] = rol(w[j - 3] ^ w[j - 8] ^ w[j - 14] ^ w[j - 16], 1);\n var t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)), safe_add(safe_add(e, w[j]), sha1_kt(j)));\n e = d;\n d = c;\n c = rol(b, 30);\n b = a;\n a = t;\n }\n a = safe_add(a, olda);\n b = safe_add(b, oldb);\n c = safe_add(c, oldc);\n d = safe_add(d, oldd);\n e = safe_add(e, olde);\n }\n return Array(a, b, c, d, e);\n }", "title": "" }, { "docid": "a842c7912193e2ad68783f331632085d", "score": "0.58225214", "text": "function stoh(str, callback) {\n var buffer = new TextEncoder(\"utf-8\").encode(str);\n return crypto.subtle.digest(\"SHA-256\", buffer).then(function (hash) {\n var ret_str = \"\";\n var view = new DataView(hash);\n for(var i = 0; i < view.byteLength; i += 4) {\n ret_str += view.getUint32(i).toString(16);\n }\n callback(ret_str);\n });\n}", "title": "" }, { "docid": "429432b35481910836aab46b06d5627d", "score": "0.58152336", "text": "function core_sha1(x, len) {\n /* append padding */\n x[len >> 5] |= 0x80 << 24 - len % 32;\n x[(len + 64 >> 9 << 4) + 15] = len;\n var w = Array(80);\n var a = 1732584193;\n var b = -271733879;\n var c = -1732584194;\n var d = 271733878;\n var e = -1009589776;\n\n for (var i = 0; i < x.length; i += 16) {\n var olda = a;\n var oldb = b;\n var oldc = c;\n var oldd = d;\n var olde = e;\n\n for (var j = 0; j < 80; j++) {\n if (j < 16) w[j] = x[i + j];else w[j] = rol(w[j - 3] ^ w[j - 8] ^ w[j - 14] ^ w[j - 16], 1);\n var t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)), safe_add(safe_add(e, w[j]), sha1_kt(j)));\n e = d;\n d = c;\n c = rol(b, 30);\n b = a;\n a = t;\n }\n\n a = safe_add(a, olda);\n b = safe_add(b, oldb);\n c = safe_add(c, oldc);\n d = safe_add(d, oldd);\n e = safe_add(e, olde);\n }\n\n return Array(a, b, c, d, e);\n}", "title": "" }, { "docid": "f0049cbc62b66a7fb7d00455c89a4cd0", "score": "0.5812042", "text": "function core_sha1(x, len)\n{\n /* append padding */\n x[len >> 5] |= 0x80 << (24 - len % 32);\n x[((len + 64 >> 9) << 4) + 15] = len;\n\n var w = new Array(80);\n var a = 1732584193;\n var b = -271733879;\n var c = -1732584194;\n var d = 271733878;\n var e = -1009589776;\n\n var i, j, t, olda, oldb, oldc, oldd, olde;\n for (i = 0; i < x.length; i += 16)\n {\n olda = a;\n oldb = b;\n oldc = c;\n oldd = d;\n olde = e;\n\n for (j = 0; j < 80; j++)\n {\n if (j < 16) { w[j] = x[i + j]; }\n else { w[j] = rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1); }\n t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)),\n safe_add(safe_add(e, w[j]), sha1_kt(j)));\n e = d;\n d = c;\n c = rol(b, 30);\n b = a;\n a = t;\n }\n\n a = safe_add(a, olda);\n b = safe_add(b, oldb);\n c = safe_add(c, oldc);\n d = safe_add(d, oldd);\n e = safe_add(e, olde);\n }\n return [a, b, c, d, e];\n}", "title": "" }, { "docid": "f0049cbc62b66a7fb7d00455c89a4cd0", "score": "0.5812042", "text": "function core_sha1(x, len)\n{\n /* append padding */\n x[len >> 5] |= 0x80 << (24 - len % 32);\n x[((len + 64 >> 9) << 4) + 15] = len;\n\n var w = new Array(80);\n var a = 1732584193;\n var b = -271733879;\n var c = -1732584194;\n var d = 271733878;\n var e = -1009589776;\n\n var i, j, t, olda, oldb, oldc, oldd, olde;\n for (i = 0; i < x.length; i += 16)\n {\n olda = a;\n oldb = b;\n oldc = c;\n oldd = d;\n olde = e;\n\n for (j = 0; j < 80; j++)\n {\n if (j < 16) { w[j] = x[i + j]; }\n else { w[j] = rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1); }\n t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)),\n safe_add(safe_add(e, w[j]), sha1_kt(j)));\n e = d;\n d = c;\n c = rol(b, 30);\n b = a;\n a = t;\n }\n\n a = safe_add(a, olda);\n b = safe_add(b, oldb);\n c = safe_add(c, oldc);\n d = safe_add(d, oldd);\n e = safe_add(e, olde);\n }\n return [a, b, c, d, e];\n}", "title": "" }, { "docid": "f0049cbc62b66a7fb7d00455c89a4cd0", "score": "0.5812042", "text": "function core_sha1(x, len)\n{\n /* append padding */\n x[len >> 5] |= 0x80 << (24 - len % 32);\n x[((len + 64 >> 9) << 4) + 15] = len;\n\n var w = new Array(80);\n var a = 1732584193;\n var b = -271733879;\n var c = -1732584194;\n var d = 271733878;\n var e = -1009589776;\n\n var i, j, t, olda, oldb, oldc, oldd, olde;\n for (i = 0; i < x.length; i += 16)\n {\n olda = a;\n oldb = b;\n oldc = c;\n oldd = d;\n olde = e;\n\n for (j = 0; j < 80; j++)\n {\n if (j < 16) { w[j] = x[i + j]; }\n else { w[j] = rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1); }\n t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)),\n safe_add(safe_add(e, w[j]), sha1_kt(j)));\n e = d;\n d = c;\n c = rol(b, 30);\n b = a;\n a = t;\n }\n\n a = safe_add(a, olda);\n b = safe_add(b, oldb);\n c = safe_add(c, oldc);\n d = safe_add(d, oldd);\n e = safe_add(e, olde);\n }\n return [a, b, c, d, e];\n}", "title": "" }, { "docid": "31807f0d66344a40588ff1a4ebbfe598", "score": "0.5810981", "text": "function core_sha1(x, len)\n\t\t\t{\n\t\t\t /* append padding */\n\t\t\t x[len >> 5] |= 0x80 << (24 - len % 32);\n\t\t\t x[((len + 64 >> 9) << 4) + 15] = len;\n\t\t\t\n\t\t\t var w = Array(80);\n\t\t\t var a = 1732584193;\n\t\t\t var b = -271733879;\n\t\t\t var c = -1732584194;\n\t\t\t var d = 271733878;\n\t\t\t var e = -1009589776;\n\t\t\t\n\t\t\t for(var i = 0; i < x.length; i += 16)\n\t\t\t {\n\t\t\t\tvar olda = a;\n\t\t\t\tvar oldb = b;\n\t\t\t\tvar oldc = c;\n\t\t\t\tvar oldd = d;\n\t\t\t\tvar olde = e;\n\t\t\t\n\t\t\t\tfor(var j = 0; j < 80; j++)\n\t\t\t\t{\n\t\t\t\t if(j < 16) w[j] = x[i + j];\n\t\t\t\t else w[j] = rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1);\n\t\t\t\t var t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)),\n\t\t\t\t\t\t\t\t safe_add(safe_add(e, w[j]), sha1_kt(j)));\n\t\t\t\t e = d;\n\t\t\t\t d = c;\n\t\t\t\t c = rol(b, 30);\n\t\t\t\t b = a;\n\t\t\t\t a = t;\n\t\t\t\t}\n\t\t\t\n\t\t\t\ta = safe_add(a, olda);\n\t\t\t\tb = safe_add(b, oldb);\n\t\t\t\tc = safe_add(c, oldc);\n\t\t\t\td = safe_add(d, oldd);\n\t\t\t\te = safe_add(e, olde);\n\t\t\t }\n\t\t\t return Array(a, b, c, d, e);\n\t\t\t\n\t\t\t}", "title": "" }, { "docid": "bc15fa0f5457652b8c4b9001e399ec05", "score": "0.58098805", "text": "hash(data) {\n\t\treturn crypto\n\t\t\t.createHash('sha512')\n\t\t\t.update(data)\n\t\t\t.digest('hex')\n\t}", "title": "" }, { "docid": "c33b7e3daebfbdab161d2c0e261ddbd1", "score": "0.5805817", "text": "function digest() {\n // Pad\n write(0x80);\n if (offset > 14 || (offset === 14 && shift < 24)) {\n processBlock();\n }\n offset = 14;\n shift = 24;\n \n // 64-bit length big-endian\n write(0x00); // numbers this big aren't accurate in javascript anyway\n write(0x00); // ..So just hard-code to zero.\n write(totalLength > 0xffffffffff ? totalLength / 0x10000000000 : 0x00);\n write(totalLength > 0xffffffff ? totalLength / 0x100000000 : 0x00);\n for (var s = 24; s >= 0; s -= 8) {\n write(totalLength >> s);\n }\n \n // At this point one last processBlock() should trigger and we can pull out the result.\n return toHex(h0)\n + toHex(h1)\n + toHex(h2)\n + toHex(h3)\n + toHex(h4);\n }", "title": "" }, { "docid": "d76333f9ef9364ca254fbd2fc30858ba", "score": "0.57999283", "text": "function core_sha1(x, len)\n{\n /* append padding */\n x[len >> 5] |= 0x80 << (24 - len % 32);\n x[((len + 64 >> 9) << 4) + 15] = len;\n\n var w = Array(80);\n var a = 1732584193;\n var b = -271733879;\n var c = -1732584194;\n var d = 271733878;\n var e = -1009589776;\n\n for(var i = 0; i < x.length; i += 16)\n {\n var olda = a;\n var oldb = b;\n var oldc = c;\n var oldd = d;\n var olde = e;\n\n for(var j = 0; j < 80; j++)\n {\n if(j < 16) w[j] = x[i + j];\n else w[j] = rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1);\n var t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)),\n safe_add(safe_add(e, w[j]), sha1_kt(j)));\n e = d;\n d = c;\n c = rol(b, 30);\n b = a;\n a = t;\n }\n\n a = safe_add(a, olda);\n b = safe_add(b, oldb);\n c = safe_add(c, oldc);\n d = safe_add(d, oldd);\n e = safe_add(e, olde);\n }\n return Array(a, b, c, d, e);\n\n}", "title": "" }, { "docid": "d76333f9ef9364ca254fbd2fc30858ba", "score": "0.57999283", "text": "function core_sha1(x, len)\n{\n /* append padding */\n x[len >> 5] |= 0x80 << (24 - len % 32);\n x[((len + 64 >> 9) << 4) + 15] = len;\n\n var w = Array(80);\n var a = 1732584193;\n var b = -271733879;\n var c = -1732584194;\n var d = 271733878;\n var e = -1009589776;\n\n for(var i = 0; i < x.length; i += 16)\n {\n var olda = a;\n var oldb = b;\n var oldc = c;\n var oldd = d;\n var olde = e;\n\n for(var j = 0; j < 80; j++)\n {\n if(j < 16) w[j] = x[i + j];\n else w[j] = rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1);\n var t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)),\n safe_add(safe_add(e, w[j]), sha1_kt(j)));\n e = d;\n d = c;\n c = rol(b, 30);\n b = a;\n a = t;\n }\n\n a = safe_add(a, olda);\n b = safe_add(b, oldb);\n c = safe_add(c, oldc);\n d = safe_add(d, oldd);\n e = safe_add(e, olde);\n }\n return Array(a, b, c, d, e);\n\n}", "title": "" }, { "docid": "d76333f9ef9364ca254fbd2fc30858ba", "score": "0.57999283", "text": "function core_sha1(x, len)\n{\n /* append padding */\n x[len >> 5] |= 0x80 << (24 - len % 32);\n x[((len + 64 >> 9) << 4) + 15] = len;\n\n var w = Array(80);\n var a = 1732584193;\n var b = -271733879;\n var c = -1732584194;\n var d = 271733878;\n var e = -1009589776;\n\n for(var i = 0; i < x.length; i += 16)\n {\n var olda = a;\n var oldb = b;\n var oldc = c;\n var oldd = d;\n var olde = e;\n\n for(var j = 0; j < 80; j++)\n {\n if(j < 16) w[j] = x[i + j];\n else w[j] = rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1);\n var t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)),\n safe_add(safe_add(e, w[j]), sha1_kt(j)));\n e = d;\n d = c;\n c = rol(b, 30);\n b = a;\n a = t;\n }\n\n a = safe_add(a, olda);\n b = safe_add(b, oldb);\n c = safe_add(c, oldc);\n d = safe_add(d, oldd);\n e = safe_add(e, olde);\n }\n return Array(a, b, c, d, e);\n\n}", "title": "" }, { "docid": "d76333f9ef9364ca254fbd2fc30858ba", "score": "0.57999283", "text": "function core_sha1(x, len)\n{\n /* append padding */\n x[len >> 5] |= 0x80 << (24 - len % 32);\n x[((len + 64 >> 9) << 4) + 15] = len;\n\n var w = Array(80);\n var a = 1732584193;\n var b = -271733879;\n var c = -1732584194;\n var d = 271733878;\n var e = -1009589776;\n\n for(var i = 0; i < x.length; i += 16)\n {\n var olda = a;\n var oldb = b;\n var oldc = c;\n var oldd = d;\n var olde = e;\n\n for(var j = 0; j < 80; j++)\n {\n if(j < 16) w[j] = x[i + j];\n else w[j] = rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1);\n var t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)),\n safe_add(safe_add(e, w[j]), sha1_kt(j)));\n e = d;\n d = c;\n c = rol(b, 30);\n b = a;\n a = t;\n }\n\n a = safe_add(a, olda);\n b = safe_add(b, oldb);\n c = safe_add(c, oldc);\n d = safe_add(d, oldd);\n e = safe_add(e, olde);\n }\n return Array(a, b, c, d, e);\n\n}", "title": "" }, { "docid": "d76333f9ef9364ca254fbd2fc30858ba", "score": "0.57999283", "text": "function core_sha1(x, len)\n{\n /* append padding */\n x[len >> 5] |= 0x80 << (24 - len % 32);\n x[((len + 64 >> 9) << 4) + 15] = len;\n\n var w = Array(80);\n var a = 1732584193;\n var b = -271733879;\n var c = -1732584194;\n var d = 271733878;\n var e = -1009589776;\n\n for(var i = 0; i < x.length; i += 16)\n {\n var olda = a;\n var oldb = b;\n var oldc = c;\n var oldd = d;\n var olde = e;\n\n for(var j = 0; j < 80; j++)\n {\n if(j < 16) w[j] = x[i + j];\n else w[j] = rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1);\n var t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)),\n safe_add(safe_add(e, w[j]), sha1_kt(j)));\n e = d;\n d = c;\n c = rol(b, 30);\n b = a;\n a = t;\n }\n\n a = safe_add(a, olda);\n b = safe_add(b, oldb);\n c = safe_add(c, oldc);\n d = safe_add(d, oldd);\n e = safe_add(e, olde);\n }\n return Array(a, b, c, d, e);\n\n}", "title": "" }, { "docid": "d76333f9ef9364ca254fbd2fc30858ba", "score": "0.57999283", "text": "function core_sha1(x, len)\n{\n /* append padding */\n x[len >> 5] |= 0x80 << (24 - len % 32);\n x[((len + 64 >> 9) << 4) + 15] = len;\n\n var w = Array(80);\n var a = 1732584193;\n var b = -271733879;\n var c = -1732584194;\n var d = 271733878;\n var e = -1009589776;\n\n for(var i = 0; i < x.length; i += 16)\n {\n var olda = a;\n var oldb = b;\n var oldc = c;\n var oldd = d;\n var olde = e;\n\n for(var j = 0; j < 80; j++)\n {\n if(j < 16) w[j] = x[i + j];\n else w[j] = rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1);\n var t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)),\n safe_add(safe_add(e, w[j]), sha1_kt(j)));\n e = d;\n d = c;\n c = rol(b, 30);\n b = a;\n a = t;\n }\n\n a = safe_add(a, olda);\n b = safe_add(b, oldb);\n c = safe_add(c, oldc);\n d = safe_add(d, oldd);\n e = safe_add(e, olde);\n }\n return Array(a, b, c, d, e);\n\n}", "title": "" }, { "docid": "d76333f9ef9364ca254fbd2fc30858ba", "score": "0.57999283", "text": "function core_sha1(x, len)\n{\n /* append padding */\n x[len >> 5] |= 0x80 << (24 - len % 32);\n x[((len + 64 >> 9) << 4) + 15] = len;\n\n var w = Array(80);\n var a = 1732584193;\n var b = -271733879;\n var c = -1732584194;\n var d = 271733878;\n var e = -1009589776;\n\n for(var i = 0; i < x.length; i += 16)\n {\n var olda = a;\n var oldb = b;\n var oldc = c;\n var oldd = d;\n var olde = e;\n\n for(var j = 0; j < 80; j++)\n {\n if(j < 16) w[j] = x[i + j];\n else w[j] = rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1);\n var t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)),\n safe_add(safe_add(e, w[j]), sha1_kt(j)));\n e = d;\n d = c;\n c = rol(b, 30);\n b = a;\n a = t;\n }\n\n a = safe_add(a, olda);\n b = safe_add(b, oldb);\n c = safe_add(c, oldc);\n d = safe_add(d, oldd);\n e = safe_add(e, olde);\n }\n return Array(a, b, c, d, e);\n\n}", "title": "" }, { "docid": "d76333f9ef9364ca254fbd2fc30858ba", "score": "0.57999283", "text": "function core_sha1(x, len)\n{\n /* append padding */\n x[len >> 5] |= 0x80 << (24 - len % 32);\n x[((len + 64 >> 9) << 4) + 15] = len;\n\n var w = Array(80);\n var a = 1732584193;\n var b = -271733879;\n var c = -1732584194;\n var d = 271733878;\n var e = -1009589776;\n\n for(var i = 0; i < x.length; i += 16)\n {\n var olda = a;\n var oldb = b;\n var oldc = c;\n var oldd = d;\n var olde = e;\n\n for(var j = 0; j < 80; j++)\n {\n if(j < 16) w[j] = x[i + j];\n else w[j] = rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1);\n var t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)),\n safe_add(safe_add(e, w[j]), sha1_kt(j)));\n e = d;\n d = c;\n c = rol(b, 30);\n b = a;\n a = t;\n }\n\n a = safe_add(a, olda);\n b = safe_add(b, oldb);\n c = safe_add(c, oldc);\n d = safe_add(d, oldd);\n e = safe_add(e, olde);\n }\n return Array(a, b, c, d, e);\n\n}", "title": "" }, { "docid": "d76333f9ef9364ca254fbd2fc30858ba", "score": "0.57999283", "text": "function core_sha1(x, len)\n{\n /* append padding */\n x[len >> 5] |= 0x80 << (24 - len % 32);\n x[((len + 64 >> 9) << 4) + 15] = len;\n\n var w = Array(80);\n var a = 1732584193;\n var b = -271733879;\n var c = -1732584194;\n var d = 271733878;\n var e = -1009589776;\n\n for(var i = 0; i < x.length; i += 16)\n {\n var olda = a;\n var oldb = b;\n var oldc = c;\n var oldd = d;\n var olde = e;\n\n for(var j = 0; j < 80; j++)\n {\n if(j < 16) w[j] = x[i + j];\n else w[j] = rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1);\n var t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)),\n safe_add(safe_add(e, w[j]), sha1_kt(j)));\n e = d;\n d = c;\n c = rol(b, 30);\n b = a;\n a = t;\n }\n\n a = safe_add(a, olda);\n b = safe_add(b, oldb);\n c = safe_add(c, oldc);\n d = safe_add(d, oldd);\n e = safe_add(e, olde);\n }\n return Array(a, b, c, d, e);\n\n}", "title": "" }, { "docid": "d76333f9ef9364ca254fbd2fc30858ba", "score": "0.57999283", "text": "function core_sha1(x, len)\n{\n /* append padding */\n x[len >> 5] |= 0x80 << (24 - len % 32);\n x[((len + 64 >> 9) << 4) + 15] = len;\n\n var w = Array(80);\n var a = 1732584193;\n var b = -271733879;\n var c = -1732584194;\n var d = 271733878;\n var e = -1009589776;\n\n for(var i = 0; i < x.length; i += 16)\n {\n var olda = a;\n var oldb = b;\n var oldc = c;\n var oldd = d;\n var olde = e;\n\n for(var j = 0; j < 80; j++)\n {\n if(j < 16) w[j] = x[i + j];\n else w[j] = rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1);\n var t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)),\n safe_add(safe_add(e, w[j]), sha1_kt(j)));\n e = d;\n d = c;\n c = rol(b, 30);\n b = a;\n a = t;\n }\n\n a = safe_add(a, olda);\n b = safe_add(b, oldb);\n c = safe_add(c, oldc);\n d = safe_add(d, oldd);\n e = safe_add(e, olde);\n }\n return Array(a, b, c, d, e);\n\n}", "title": "" } ]
f451051739742e007662c8b0e14191bc
Gets if the node is an AnyKeyword.
[ { "docid": "46253f632fbd77a8e2603d914db8fb6f", "score": "0.810285", "text": "static isAnyKeyword(node) {\r\n return node.getKind() === typescript_1.SyntaxKind.AnyKeyword;\r\n }", "title": "" } ]
[ { "docid": "447b0846870b6f02efadd2700c8d82f0", "score": "0.6248842", "text": "static isTrueKeyword(node) {\r\n return node.getKind() === typescript_1.SyntaxKind.TrueKeyword;\r\n }", "title": "" }, { "docid": "1f8bd10ff69acd242a0acadcb3c623d6", "score": "0.5995059", "text": "static isStringKeyword(node) {\r\n return node.getKind() === typescript_1.SyntaxKind.StringKeyword;\r\n }", "title": "" }, { "docid": "3d33215636f13c35d2987f2ee3fd9fb0", "score": "0.57119894", "text": "function _isKeyword(v) {\n if (!_isString(v)) {\n return false;\n }\n switch (v) {\n case '@base':\n case '@context':\n case '@container':\n case '@default':\n case '@embed':\n case '@explicit':\n case '@graph':\n case '@id':\n case '@index':\n case '@language':\n case '@list':\n case '@omitDefault':\n case '@preserve':\n case '@requireAll':\n case '@reverse':\n case '@set':\n case '@type':\n case '@value':\n case '@version':\n case '@vocab':\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "2084b3760796a04b2917f1bf4aba0a14", "score": "0.56700283", "text": "function _isKeyword(v) {\n if(!_isString(v)) {\n return false;\n }\n switch(v) {\n case '@base':\n case '@context':\n case '@container':\n case '@default':\n case '@embed':\n case '@explicit':\n case '@graph':\n case '@id':\n case '@index':\n case '@language':\n case '@list':\n case '@omitDefault':\n case '@preserve':\n case '@requireAll':\n case '@reverse':\n case '@set':\n case '@type':\n case '@value':\n case '@vocab':\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "2084b3760796a04b2917f1bf4aba0a14", "score": "0.56700283", "text": "function _isKeyword(v) {\n if(!_isString(v)) {\n return false;\n }\n switch(v) {\n case '@base':\n case '@context':\n case '@container':\n case '@default':\n case '@embed':\n case '@explicit':\n case '@graph':\n case '@id':\n case '@index':\n case '@language':\n case '@list':\n case '@omitDefault':\n case '@preserve':\n case '@requireAll':\n case '@reverse':\n case '@set':\n case '@type':\n case '@value':\n case '@vocab':\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "7a3ebe1a2e5a5b5d0c4ab91344e823ce", "score": "0.56305003", "text": "function isAny(symbol) {\n return typeof symbol === \"object\" && symbol.type === \"any\";\n}", "title": "" }, { "docid": "e0ea19a831d3083ef8c03f0e1660f556", "score": "0.5597557", "text": "static isObjectKeyword(node) {\r\n return node.getKind() === typescript_1.SyntaxKind.ObjectKeyword;\r\n }", "title": "" }, { "docid": "29b1bfdd3a8994a8537a788842136501", "score": "0.55805224", "text": "static isBooleanKeyword(node) {\r\n return node.getKind() === typescript_1.SyntaxKind.BooleanKeyword;\r\n }", "title": "" }, { "docid": "abb765c45357287c9df9ee8df764f593", "score": "0.5527283", "text": "static isInferKeyword(node) {\r\n return node.getKind() === typescript_1.SyntaxKind.InferKeyword;\r\n }", "title": "" }, { "docid": "1bfa7cbeb761d42fd54d731865f86e7a", "score": "0.54579496", "text": "static isSymbolKeyword(node) {\r\n return node.getKind() === typescript_1.SyntaxKind.SymbolKeyword;\r\n }", "title": "" }, { "docid": "9e6f4be098a6859f2a5a1e7018a647e1", "score": "0.5406018", "text": "static isAmbientableNode(node) {\r\n switch (node.getKind()) {\r\n case typescript_1.SyntaxKind.ClassDeclaration:\r\n case typescript_1.SyntaxKind.EnumDeclaration:\r\n case typescript_1.SyntaxKind.FunctionDeclaration:\r\n case typescript_1.SyntaxKind.InterfaceDeclaration:\r\n case typescript_1.SyntaxKind.ModuleDeclaration:\r\n case typescript_1.SyntaxKind.VariableStatement:\r\n case typescript_1.SyntaxKind.TypeAliasDeclaration:\r\n return true;\r\n default:\r\n return false;\r\n }\r\n }", "title": "" }, { "docid": "03fdab8c883f361f2b6957620ea4dfbf", "score": "0.5370982", "text": "static isUndefinedKeyword(node) {\r\n return node.getKind() === typescript_1.SyntaxKind.UndefinedKeyword;\r\n }", "title": "" }, { "docid": "432cc436d58693a5cf359748eee14b63", "score": "0.53236353", "text": "function ie(e){return dn.type===Ht.Keyword&&dn.value===e}", "title": "" }, { "docid": "9834079bbda134c8e08625bcb3cdee77", "score": "0.52215105", "text": "search(word) {\n let node = this.getLastNode(word);\n return node !== null && node.isWord;\n }", "title": "" }, { "docid": "274c4c8c655efbe68203f214a3a5dcc1", "score": "0.51694405", "text": "search(word, node = this.root) {\n for (const char of word) {\n const child = node.children[char] || null;\n\n if (!child) return false;\n\n node = child;\n }\n\n return node.isWord;\n }", "title": "" }, { "docid": "a31bfbf22249c5cce68dbaa61e96aa2c", "score": "0.5144359", "text": "static isExpression(node) {\r\n switch (node.getKind()) {\r\n case typescript_1.SyntaxKind.AnyKeyword:\r\n case typescript_1.SyntaxKind.BooleanKeyword:\r\n case typescript_1.SyntaxKind.NeverKeyword:\r\n case typescript_1.SyntaxKind.NumberKeyword:\r\n case typescript_1.SyntaxKind.ObjectKeyword:\r\n case typescript_1.SyntaxKind.StringKeyword:\r\n case typescript_1.SyntaxKind.SymbolKeyword:\r\n case typescript_1.SyntaxKind.UndefinedKeyword:\r\n case typescript_1.SyntaxKind.ClassExpression:\r\n case typescript_1.SyntaxKind.Identifier:\r\n case typescript_1.SyntaxKind.AsExpression:\r\n case typescript_1.SyntaxKind.AwaitExpression:\r\n case typescript_1.SyntaxKind.BinaryExpression:\r\n case typescript_1.SyntaxKind.CallExpression:\r\n case typescript_1.SyntaxKind.CommaListExpression:\r\n case typescript_1.SyntaxKind.ConditionalExpression:\r\n case typescript_1.SyntaxKind.DeleteExpression:\r\n case typescript_1.SyntaxKind.ElementAccessExpression:\r\n case typescript_1.SyntaxKind.ImportKeyword:\r\n case typescript_1.SyntaxKind.MetaProperty:\r\n case typescript_1.SyntaxKind.NewExpression:\r\n case typescript_1.SyntaxKind.NonNullExpression:\r\n case typescript_1.SyntaxKind.OmittedExpression:\r\n case typescript_1.SyntaxKind.ParenthesizedExpression:\r\n case typescript_1.SyntaxKind.PartiallyEmittedExpression:\r\n case typescript_1.SyntaxKind.PostfixUnaryExpression:\r\n case typescript_1.SyntaxKind.PrefixUnaryExpression:\r\n case typescript_1.SyntaxKind.PropertyAccessExpression:\r\n case typescript_1.SyntaxKind.SpreadElement:\r\n case typescript_1.SyntaxKind.SuperKeyword:\r\n case typescript_1.SyntaxKind.ThisKeyword:\r\n case typescript_1.SyntaxKind.TypeAssertionExpression:\r\n case typescript_1.SyntaxKind.TypeOfExpression:\r\n case typescript_1.SyntaxKind.VoidExpression:\r\n case typescript_1.SyntaxKind.YieldExpression:\r\n case typescript_1.SyntaxKind.ArrowFunction:\r\n case typescript_1.SyntaxKind.FunctionExpression:\r\n case typescript_1.SyntaxKind.JsxClosingFragment:\r\n case typescript_1.SyntaxKind.JsxElement:\r\n case typescript_1.SyntaxKind.JsxExpression:\r\n case typescript_1.SyntaxKind.JsxFragment:\r\n case typescript_1.SyntaxKind.JsxOpeningElement:\r\n case typescript_1.SyntaxKind.JsxOpeningFragment:\r\n case typescript_1.SyntaxKind.JsxSelfClosingElement:\r\n case typescript_1.SyntaxKind.FalseKeyword:\r\n case typescript_1.SyntaxKind.TrueKeyword:\r\n case typescript_1.SyntaxKind.NullKeyword:\r\n case typescript_1.SyntaxKind.NumericLiteral:\r\n case typescript_1.SyntaxKind.RegularExpressionLiteral:\r\n case typescript_1.SyntaxKind.StringLiteral:\r\n case typescript_1.SyntaxKind.ArrayLiteralExpression:\r\n case typescript_1.SyntaxKind.ObjectLiteralExpression:\r\n case typescript_1.SyntaxKind.NoSubstitutionTemplateLiteral:\r\n case typescript_1.SyntaxKind.TaggedTemplateExpression:\r\n case typescript_1.SyntaxKind.TemplateExpression:\r\n return true;\r\n default:\r\n return false;\r\n }\r\n }", "title": "" }, { "docid": "54be2912c222b62b5a43f82eb44544ca", "score": "0.5075052", "text": "parse_any (token) {\n let any = token.peek()\n if (any !== \"any\")\n throw new Error(`validate: parse error: invalid any type \"${any}\"`)\n token.skip()\n return { type: \"any\" }\n }", "title": "" }, { "docid": "f8df253650772d811f88de388dc3336c", "score": "0.50665283", "text": "static isFalseKeyword(node) {\r\n return node.getKind() === typescript_1.SyntaxKind.FalseKeyword;\r\n }", "title": "" }, { "docid": "9fd5e3f55c18eb3dd57975eaae12e64d", "score": "0.5015817", "text": "function isKeyword(id) {\n switch (id.length) {\n case 2:\n return 'do' === id || 'if' === id || 'in' === id || 'or' === id;\n case 3:\n return 'and' === id || 'end' === id || 'for' === id || 'not' === id;\n case 4:\n if ('else' === id || 'then' === id)\n return true;\n if (features.labels && !features.contextualGoto)\n return ('goto' === id);\n return false;\n case 5:\n return 'break' === id || 'local' === id || 'until' === id || 'while' === id;\n case 6:\n return 'elseif' === id || 'repeat' === id || 'return' === id;\n case 8:\n return 'function' === id;\n }\n return false;\n }", "title": "" }, { "docid": "e7cfdf018cc796c9a088e5cef23a24a0", "score": "0.501065", "text": "static isTypedNode(node) {\r\n switch (node.getKind()) {\r\n case typescript_1.SyntaxKind.PropertyDeclaration:\r\n case typescript_1.SyntaxKind.AsExpression:\r\n case typescript_1.SyntaxKind.TypeAssertionExpression:\r\n case typescript_1.SyntaxKind.Parameter:\r\n case typescript_1.SyntaxKind.PropertySignature:\r\n case typescript_1.SyntaxKind.TypeAliasDeclaration:\r\n case typescript_1.SyntaxKind.VariableDeclaration:\r\n return true;\r\n default:\r\n return false;\r\n }\r\n }", "title": "" }, { "docid": "1905e5474c6243921bef48708d0b6ced", "score": "0.4945093", "text": "static isNeverKeyword(node) {\r\n return node.getKind() === typescript_1.SyntaxKind.NeverKeyword;\r\n }", "title": "" }, { "docid": "8114bee0680a51c21f071d624a989e49", "score": "0.4883532", "text": "function isAudioNode(arg) {\n return Object(standardized_audio_context__WEBPACK_IMPORTED_MODULE_0__[\"isAnyAudioNode\"])(arg);\n}", "title": "" }, { "docid": "10d6d1eeb554454c6d00711f91dd891c", "score": "0.48778462", "text": "function matchContextualKeyword(keyword) {\n return matchKeyword(keyword, true);\n }", "title": "" }, { "docid": "10d6d1eeb554454c6d00711f91dd891c", "score": "0.48778462", "text": "function matchContextualKeyword(keyword) {\n return matchKeyword(keyword, true);\n }", "title": "" }, { "docid": "10d6d1eeb554454c6d00711f91dd891c", "score": "0.48778462", "text": "function matchContextualKeyword(keyword) {\n return matchKeyword(keyword, true);\n }", "title": "" }, { "docid": "eeb90e601fe9263f1fa2f8ad8bf6b097", "score": "0.4873417", "text": "getLiteralValue() {\r\n return this.getKind() === typescript_1.SyntaxKind.TrueKeyword;\r\n }", "title": "" }, { "docid": "43377d52075d0da70e818685f6890499", "score": "0.48722607", "text": "function matchKeyword(keyword, contextual) {\n var expectedType = contextual ? Token.Identifier : Token.Keyword;\n return lookahead.type === expectedType && lookahead.value === keyword;\n }", "title": "" }, { "docid": "43377d52075d0da70e818685f6890499", "score": "0.48722607", "text": "function matchKeyword(keyword, contextual) {\n var expectedType = contextual ? Token.Identifier : Token.Keyword;\n return lookahead.type === expectedType && lookahead.value === keyword;\n }", "title": "" }, { "docid": "43377d52075d0da70e818685f6890499", "score": "0.48722607", "text": "function matchKeyword(keyword, contextual) {\n var expectedType = contextual ? Token.Identifier : Token.Keyword;\n return lookahead.type === expectedType && lookahead.value === keyword;\n }", "title": "" }, { "docid": "e8d69bf2db3c4099e9164032ed624a93", "score": "0.4819074", "text": "static isTypeNode(node) {\r\n switch (node.getKind()) {\r\n case typescript_1.SyntaxKind.TypePredicate:\r\n case typescript_1.SyntaxKind.JSDocFunctionType:\r\n case typescript_1.SyntaxKind.JSDocSignature:\r\n case typescript_1.SyntaxKind.JSDocTypeExpression:\r\n case typescript_1.SyntaxKind.ArrayType:\r\n case typescript_1.SyntaxKind.ConditionalType:\r\n case typescript_1.SyntaxKind.ConstructorType:\r\n case typescript_1.SyntaxKind.ExpressionWithTypeArguments:\r\n case typescript_1.SyntaxKind.FunctionType:\r\n case typescript_1.SyntaxKind.ImportType:\r\n case typescript_1.SyntaxKind.IndexedAccessType:\r\n case typescript_1.SyntaxKind.InferType:\r\n case typescript_1.SyntaxKind.IntersectionType:\r\n case typescript_1.SyntaxKind.LiteralType:\r\n case typescript_1.SyntaxKind.ParenthesizedType:\r\n case typescript_1.SyntaxKind.ThisType:\r\n case typescript_1.SyntaxKind.TupleType:\r\n case typescript_1.SyntaxKind.TypeLiteral:\r\n case typescript_1.SyntaxKind.TypeReference:\r\n case typescript_1.SyntaxKind.UnionType:\r\n return true;\r\n default:\r\n return false;\r\n }\r\n }", "title": "" }, { "docid": "826cb50611d959270e3165485a60f601", "score": "0.47898638", "text": "function matchKeyword(keyword) {\n var token = lookahead();\n return token.type === Token.Keyword && token.value === keyword;\n }", "title": "" }, { "docid": "7b61083422bf90f99d731e4f81900337", "score": "0.47877303", "text": "function keywordFilter(element)\n {\n if (element['attributes'])\n {\n if (element['attributes']['Ambience'])\n {\n if (element['attributes']['Ambience'][x] === true)\n {\n return element\n }\n }\n }\n }", "title": "" }, { "docid": "cf452941a8cc4e311fb3bd1cac67bc6f", "score": "0.47874784", "text": "function matchKeyword(keyword) {\n var token = lookahead();\n return token.type === Token.Keyword && token.value === keyword;\n }", "title": "" }, { "docid": "cf452941a8cc4e311fb3bd1cac67bc6f", "score": "0.47874784", "text": "function matchKeyword(keyword) {\n var token = lookahead();\n return token.type === Token.Keyword && token.value === keyword;\n }", "title": "" }, { "docid": "cf452941a8cc4e311fb3bd1cac67bc6f", "score": "0.47874784", "text": "function matchKeyword(keyword) {\n var token = lookahead();\n return token.type === Token.Keyword && token.value === keyword;\n }", "title": "" }, { "docid": "cf452941a8cc4e311fb3bd1cac67bc6f", "score": "0.47874784", "text": "function matchKeyword(keyword) {\n var token = lookahead();\n return token.type === Token.Keyword && token.value === keyword;\n }", "title": "" }, { "docid": "a17189f271b9e82133088cef1092b726", "score": "0.47797477", "text": "static isNullLiteral(node) {\r\n return node.getKind() === typescript_1.SyntaxKind.NullKeyword;\r\n }", "title": "" }, { "docid": "d06af6dec34297850a7d8ef1244e1982", "score": "0.4778259", "text": "static isTypeElement(node) {\r\n switch (node.getKind()) {\r\n case typescript_1.SyntaxKind.CallSignature:\r\n case typescript_1.SyntaxKind.ConstructSignature:\r\n case typescript_1.SyntaxKind.IndexSignature:\r\n case typescript_1.SyntaxKind.MethodSignature:\r\n case typescript_1.SyntaxKind.PropertySignature:\r\n return true;\r\n default:\r\n return false;\r\n }\r\n }", "title": "" }, { "docid": "8d166f9471e2e4f77faa98cf5efbb8e6", "score": "0.47570613", "text": "static isNumberKeyword(node) {\r\n return node.getKind() === typescript_1.SyntaxKind.NumberKeyword;\r\n }", "title": "" }, { "docid": "2a4c4af86698fadf9c064801ff3cf3df", "score": "0.47511056", "text": "isWord() {\n \treturn (this.weightRefs != null);\n }", "title": "" }, { "docid": "4bcc1b663852bfe7fce04769d0b3648d", "score": "0.47373614", "text": "function nodeContainsSoakOperation(node) {\n return containsDescendant_1.default(node, function (child) {\n return child instanceof nodes_1.SoakedDynamicMemberAccessOp ||\n child instanceof nodes_1.SoakedFunctionApplication ||\n child instanceof nodes_1.SoakedMemberAccessOp;\n });\n}", "title": "" }, { "docid": "b927fced41bb503d918ade71acbe00ab", "score": "0.47286034", "text": "static isJsxAttributedNode(node) {\r\n switch (node.getKind()) {\r\n case typescript_1.SyntaxKind.JsxOpeningElement:\r\n case typescript_1.SyntaxKind.JsxSelfClosingElement:\r\n return true;\r\n default:\r\n return false;\r\n }\r\n }", "title": "" }, { "docid": "3c4bd41c7b735ebb90264f786ff4edff", "score": "0.47170246", "text": "function matchContextualKeyword(keyword) {\n return lookahead.type === Token.Identifier && lookahead.value === keyword;\n }", "title": "" }, { "docid": "79ea3c051b5ed889be9fb3bf3027229f", "score": "0.47055876", "text": "function matchContextualKeyword(keyword) {\n return lookahead.type === Token.Identifier && lookahead.value === keyword;\n }", "title": "" }, { "docid": "79ea3c051b5ed889be9fb3bf3027229f", "score": "0.47055876", "text": "function matchContextualKeyword(keyword) {\n return lookahead.type === Token.Identifier && lookahead.value === keyword;\n }", "title": "" }, { "docid": "79ea3c051b5ed889be9fb3bf3027229f", "score": "0.47055876", "text": "function matchContextualKeyword(keyword) {\n return lookahead.type === Token.Identifier && lookahead.value === keyword;\n }", "title": "" }, { "docid": "79ea3c051b5ed889be9fb3bf3027229f", "score": "0.47055876", "text": "function matchContextualKeyword(keyword) {\n return lookahead.type === Token.Identifier && lookahead.value === keyword;\n }", "title": "" }, { "docid": "79ea3c051b5ed889be9fb3bf3027229f", "score": "0.47055876", "text": "function matchContextualKeyword(keyword) {\n return lookahead.type === Token.Identifier && lookahead.value === keyword;\n }", "title": "" }, { "docid": "79ea3c051b5ed889be9fb3bf3027229f", "score": "0.47055876", "text": "function matchContextualKeyword(keyword) {\n return lookahead.type === Token.Identifier && lookahead.value === keyword;\n }", "title": "" }, { "docid": "79ea3c051b5ed889be9fb3bf3027229f", "score": "0.47055876", "text": "function matchContextualKeyword(keyword) {\n return lookahead.type === Token.Identifier && lookahead.value === keyword;\n }", "title": "" }, { "docid": "79ea3c051b5ed889be9fb3bf3027229f", "score": "0.47055876", "text": "function matchContextualKeyword(keyword) {\n return lookahead.type === Token.Identifier && lookahead.value === keyword;\n }", "title": "" }, { "docid": "79ea3c051b5ed889be9fb3bf3027229f", "score": "0.47055876", "text": "function matchContextualKeyword(keyword) {\n return lookahead.type === Token.Identifier && lookahead.value === keyword;\n }", "title": "" }, { "docid": "79ea3c051b5ed889be9fb3bf3027229f", "score": "0.47055876", "text": "function matchContextualKeyword(keyword) {\n return lookahead.type === Token.Identifier && lookahead.value === keyword;\n }", "title": "" }, { "docid": "79ea3c051b5ed889be9fb3bf3027229f", "score": "0.47055876", "text": "function matchContextualKeyword(keyword) {\n return lookahead.type === Token.Identifier && lookahead.value === keyword;\n }", "title": "" }, { "docid": "678bfe78b968f75dcc61c093746a48cd", "score": "0.4694988", "text": "function matchKeyword(keyword) {\n return lookahead.type === TokenKeyword && lookahead.value === keyword;\n }", "title": "" }, { "docid": "136ea63ad3e6de9a8c4809f8a7a010e1", "score": "0.46890053", "text": "function text(node) {\n return node && node.type === 'text'\n}", "title": "" }, { "docid": "136ea63ad3e6de9a8c4809f8a7a010e1", "score": "0.46890053", "text": "function text(node) {\n return node && node.type === 'text'\n}", "title": "" }, { "docid": "136ea63ad3e6de9a8c4809f8a7a010e1", "score": "0.46890053", "text": "function text(node) {\n return node && node.type === 'text'\n}", "title": "" }, { "docid": "26d7be7ed51e76c012fa8948b8b7d739", "score": "0.46808705", "text": "function matchKeyword(keyword) {\n return lookahead.type === TokenKeyword && lookahead.value === keyword;\n }", "title": "" }, { "docid": "f128940b09dcc2e0f11f2face088a65e", "score": "0.46720713", "text": "function matchKeyword(keyword) {\n return lookahead.type === Token.Keyword && lookahead.value === keyword;\n }", "title": "" }, { "docid": "3fd87b1984a38955d86944fe21592e00", "score": "0.46681458", "text": "function any() {\n var symbols = Array.prototype.slice.apply(arguments);\n var valid = symbols.length > 0;\n symbols.forEach(function(s) {\n valid = valid && isBasic(s);\n });\n if(valid) {\n return {type: \"any\", value: symbols};\n }\n return null;\n}", "title": "" }, { "docid": "57516272789e9248f3b5da7745d7106a", "score": "0.4657974", "text": "function matchKeyword(keyword) {\n return lookahead.type === Token.Keyword && lookahead.value === keyword;\n }", "title": "" }, { "docid": "57516272789e9248f3b5da7745d7106a", "score": "0.4657974", "text": "function matchKeyword(keyword) {\n return lookahead.type === Token.Keyword && lookahead.value === keyword;\n }", "title": "" }, { "docid": "57516272789e9248f3b5da7745d7106a", "score": "0.4657974", "text": "function matchKeyword(keyword) {\n return lookahead.type === Token.Keyword && lookahead.value === keyword;\n }", "title": "" }, { "docid": "57516272789e9248f3b5da7745d7106a", "score": "0.4657974", "text": "function matchKeyword(keyword) {\n return lookahead.type === Token.Keyword && lookahead.value === keyword;\n }", "title": "" }, { "docid": "57516272789e9248f3b5da7745d7106a", "score": "0.4657974", "text": "function matchKeyword(keyword) {\n return lookahead.type === Token.Keyword && lookahead.value === keyword;\n }", "title": "" }, { "docid": "57516272789e9248f3b5da7745d7106a", "score": "0.4657974", "text": "function matchKeyword(keyword) {\n return lookahead.type === Token.Keyword && lookahead.value === keyword;\n }", "title": "" }, { "docid": "57516272789e9248f3b5da7745d7106a", "score": "0.4657974", "text": "function matchKeyword(keyword) {\n return lookahead.type === Token.Keyword && lookahead.value === keyword;\n }", "title": "" }, { "docid": "57516272789e9248f3b5da7745d7106a", "score": "0.4657974", "text": "function matchKeyword(keyword) {\n return lookahead.type === Token.Keyword && lookahead.value === keyword;\n }", "title": "" }, { "docid": "57516272789e9248f3b5da7745d7106a", "score": "0.4657974", "text": "function matchKeyword(keyword) {\n return lookahead.type === Token.Keyword && lookahead.value === keyword;\n }", "title": "" }, { "docid": "57516272789e9248f3b5da7745d7106a", "score": "0.4657974", "text": "function matchKeyword(keyword) {\n return lookahead.type === Token.Keyword && lookahead.value === keyword;\n }", "title": "" }, { "docid": "57516272789e9248f3b5da7745d7106a", "score": "0.4657974", "text": "function matchKeyword(keyword) {\n return lookahead.type === Token.Keyword && lookahead.value === keyword;\n }", "title": "" }, { "docid": "57516272789e9248f3b5da7745d7106a", "score": "0.4657974", "text": "function matchKeyword(keyword) {\n return lookahead.type === Token.Keyword && lookahead.value === keyword;\n }", "title": "" }, { "docid": "57516272789e9248f3b5da7745d7106a", "score": "0.4657974", "text": "function matchKeyword(keyword) {\n return lookahead.type === Token.Keyword && lookahead.value === keyword;\n }", "title": "" }, { "docid": "57516272789e9248f3b5da7745d7106a", "score": "0.4657974", "text": "function matchKeyword(keyword) {\n return lookahead.type === Token.Keyword && lookahead.value === keyword;\n }", "title": "" }, { "docid": "57516272789e9248f3b5da7745d7106a", "score": "0.4657974", "text": "function matchKeyword(keyword) {\n return lookahead.type === Token.Keyword && lookahead.value === keyword;\n }", "title": "" }, { "docid": "57516272789e9248f3b5da7745d7106a", "score": "0.4657974", "text": "function matchKeyword(keyword) {\n return lookahead.type === Token.Keyword && lookahead.value === keyword;\n }", "title": "" }, { "docid": "57516272789e9248f3b5da7745d7106a", "score": "0.4657974", "text": "function matchKeyword(keyword) {\n return lookahead.type === Token.Keyword && lookahead.value === keyword;\n }", "title": "" }, { "docid": "57516272789e9248f3b5da7745d7106a", "score": "0.4657974", "text": "function matchKeyword(keyword) {\n return lookahead.type === Token.Keyword && lookahead.value === keyword;\n }", "title": "" }, { "docid": "1605a5bf6880962488755e614aa4e699", "score": "0.465063", "text": "static isPrimaryExpression(node) {\r\n switch (node.getKind()) {\r\n case typescript_1.SyntaxKind.ClassExpression:\r\n case typescript_1.SyntaxKind.Identifier:\r\n case typescript_1.SyntaxKind.ImportKeyword:\r\n case typescript_1.SyntaxKind.MetaProperty:\r\n case typescript_1.SyntaxKind.NewExpression:\r\n case typescript_1.SyntaxKind.SuperKeyword:\r\n case typescript_1.SyntaxKind.ThisKeyword:\r\n case typescript_1.SyntaxKind.FunctionExpression:\r\n case typescript_1.SyntaxKind.JsxElement:\r\n case typescript_1.SyntaxKind.JsxFragment:\r\n case typescript_1.SyntaxKind.JsxSelfClosingElement:\r\n case typescript_1.SyntaxKind.FalseKeyword:\r\n case typescript_1.SyntaxKind.TrueKeyword:\r\n case typescript_1.SyntaxKind.NullKeyword:\r\n case typescript_1.SyntaxKind.NumericLiteral:\r\n case typescript_1.SyntaxKind.RegularExpressionLiteral:\r\n case typescript_1.SyntaxKind.StringLiteral:\r\n case typescript_1.SyntaxKind.ArrayLiteralExpression:\r\n case typescript_1.SyntaxKind.ObjectLiteralExpression:\r\n case typescript_1.SyntaxKind.NoSubstitutionTemplateLiteral:\r\n case typescript_1.SyntaxKind.TemplateExpression:\r\n return true;\r\n default:\r\n return false;\r\n }\r\n }", "title": "" }, { "docid": "ab02976b7026f7807f123580d6305b1b", "score": "0.46446052", "text": "function expectContextualKeyword(keyword) {\n return expectKeyword(keyword, true);\n }", "title": "" }, { "docid": "ab02976b7026f7807f123580d6305b1b", "score": "0.46446052", "text": "function expectContextualKeyword(keyword) {\n return expectKeyword(keyword, true);\n }", "title": "" }, { "docid": "ab02976b7026f7807f123580d6305b1b", "score": "0.46446052", "text": "function expectContextualKeyword(keyword) {\n return expectKeyword(keyword, true);\n }", "title": "" }, { "docid": "b02ad55e60e69d9318ee6aaeab934638", "score": "0.4625578", "text": "function matchKeyword(keyword) {\n\t\t\t\t\treturn lookahead.type === Token.Keyword && lookahead.value === keyword;\n\t\t\t\t}", "title": "" }, { "docid": "70165ced91334f242cdb419f165cba7f", "score": "0.4623804", "text": "function matchKeyword(keyword) {\n return lookahead.type === TokenKeyword && lookahead.value === keyword;\n}", "title": "" }, { "docid": "70165ced91334f242cdb419f165cba7f", "score": "0.4623804", "text": "function matchKeyword(keyword) {\n return lookahead.type === TokenKeyword && lookahead.value === keyword;\n}", "title": "" }, { "docid": "70165ced91334f242cdb419f165cba7f", "score": "0.4623804", "text": "function matchKeyword(keyword) {\n return lookahead.type === TokenKeyword && lookahead.value === keyword;\n}", "title": "" }, { "docid": "6dec26db5dacfef2ed7ae5d880974a00", "score": "0.4623691", "text": "static isIntersectionTypeNode(node) {\r\n return node.getKind() === typescript_1.SyntaxKind.IntersectionType;\r\n }", "title": "" }, { "docid": "8351686e02c0ef657cfe167919fa36a8", "score": "0.46140823", "text": "function hasAny(ary) {\n return ary != null && ary.length > 0;\n }", "title": "" }, { "docid": "adac5c2dd279c2ad8693459b02b61239", "score": "0.46096873", "text": "static isBooleanLiteral(node) {\r\n switch (node.getKind()) {\r\n case typescript_1.SyntaxKind.FalseKeyword:\r\n case typescript_1.SyntaxKind.TrueKeyword:\r\n return true;\r\n default:\r\n return false;\r\n }\r\n }", "title": "" }, { "docid": "12b4933a0687af86811b54f6bc8297cd", "score": "0.46092838", "text": "function matchContextualKeyword(keyword) {\n\t return lookahead.type === Token.Identifier && lookahead.value === keyword;\n\t }", "title": "" }, { "docid": "12b4933a0687af86811b54f6bc8297cd", "score": "0.46092838", "text": "function matchContextualKeyword(keyword) {\n\t return lookahead.type === Token.Identifier && lookahead.value === keyword;\n\t }", "title": "" }, { "docid": "12b4933a0687af86811b54f6bc8297cd", "score": "0.46092838", "text": "function matchContextualKeyword(keyword) {\n\t return lookahead.type === Token.Identifier && lookahead.value === keyword;\n\t }", "title": "" }, { "docid": "12b4933a0687af86811b54f6bc8297cd", "score": "0.46092838", "text": "function matchContextualKeyword(keyword) {\n\t return lookahead.type === Token.Identifier && lookahead.value === keyword;\n\t }", "title": "" }, { "docid": "3ffdcd9ec7e8a616505a3bbb7f6f02e7", "score": "0.45985025", "text": "function matchKeyword(keyword) {\n\t return lookahead.type === Token.Keyword && lookahead.value === keyword;\n\t }", "title": "" }, { "docid": "3ffdcd9ec7e8a616505a3bbb7f6f02e7", "score": "0.45985025", "text": "function matchKeyword(keyword) {\n\t return lookahead.type === Token.Keyword && lookahead.value === keyword;\n\t }", "title": "" }, { "docid": "3ffdcd9ec7e8a616505a3bbb7f6f02e7", "score": "0.45985025", "text": "function matchKeyword(keyword) {\n\t return lookahead.type === Token.Keyword && lookahead.value === keyword;\n\t }", "title": "" }, { "docid": "3ffdcd9ec7e8a616505a3bbb7f6f02e7", "score": "0.45985025", "text": "function matchKeyword(keyword) {\n\t return lookahead.type === Token.Keyword && lookahead.value === keyword;\n\t }", "title": "" }, { "docid": "3ffdcd9ec7e8a616505a3bbb7f6f02e7", "score": "0.45985025", "text": "function matchKeyword(keyword) {\n\t return lookahead.type === Token.Keyword && lookahead.value === keyword;\n\t }", "title": "" }, { "docid": "74be5037bfc6bcf7c31259b0601edfa0", "score": "0.45936394", "text": "function keywordExists(keyword) {\n var kw = keyword;\n if (kw != null) {\n try{\n kwIter = AdWordsApp.keywords().withCondition(\"Text = \\'\"+kw+\"\\'\").withCondition(\"Status = ENABLED\").get();\n var exists = kwIter.totalNumEntities() > 0 ? true : false;\n if(!exists){\n kwIter = AdWordsApp.keywords().withCondition(\"Text CONTAINS_IGNORE_CASE \\'\"+kw+\"\\'\").withCondition(\"Status = ENABLED\").get();\n var existsBroad = kwIter.totalNumEntities() > 0 ? true : false;\n if(existsBroad){\n while (kwIter.hasNext()) {\n var keyword = kwIter.next();\n keyword = normalizeKeyword(keyword.getText());\n kw = normalizeKeyword(kw);\n if(keyword == kw){\n exists = true;\n if(exists){\n return exists;\n }\n }\n }\n }\n }\n return exists;\n }\n catch(err){\n Logger.log(err.message)\n }\n }\n}", "title": "" } ]
3b205fac695b4fa57d2b4ba3a5582b9c
Pull letters from display spans. Also accept optional argument for tab completion purposes. Returns array of characters.
[ { "docid": "c65cb0638db81ff931d6c55b8173f9a6", "score": "0.6552284", "text": "function extractLetters(spanList,last){\n\tvar strArr = new Array();\n\t\n\tif(spanList.length>1){\n\t\tif(!last){\n\t\t\tfor(var i=0;i<spanList.length;i++){\n\t\t\t\tstrArr.push(spanList[i].innerHTML);\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tvar lastIndex;\n\t\t\tvar i = spanList.length-2;\n\t\t\twhile(spanList[i].innerHTML!=\"&nbsp;\"){\n\t\t\t\tstrArr.unshift(spanList[i].innerHTML);\n\t\t\t\ti--;\n\t\t\t\tif(i<0){\n\t\t\t\t\tstrArr.unshift(\"cmd\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(strArr[0]!=\"cmd\"){\n\t\t\t\tlastIndex=i+1;\n\t\t\t\tvar i=0;\n\t\t\t\tvar cmd=\"\";\n\t\t\t\t\n\t\t\t\tstrArr.unshift(lastIndex);\n\t\t\t\twhile(spanList[i].innerHTML!=\"&nbsp;\"){\n\t\t\t\t\tcmd=cmd+spanList[i].innerHTML;\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\tstrArr.unshift(cmd);\n\t\t\t}\n\t\t}\n\t\treturn strArr;\n\t}\n\telse{\n\t\treturn [];\n\t}\n}", "title": "" } ]
[ { "docid": "3674c3dda08d80e4a1e0d67d5e76db63", "score": "0.6128563", "text": "function splitTextInSpans(elem) {\n var letters = elem.textContent.split('');\n elem.innerHTML = '';\n return letters.map(function (letter) {\n var span = document.createElement('span');\n span.textContent = letter;\n elem.appendChild(span);\n return span;\n });\n}", "title": "" }, { "docid": "dd1e8a0f2e989bcdd0b8685d88d3f9df", "score": "0.551044", "text": "function getActiveSpans(el) {\r\n\tlet wordSpans = [el];\r\n\r\n\t// Get the data from the selected character\r\n\tlet { word, special } = el.dataset;\r\n\tif (word) {\r\n\t\twordSpans = [...document.querySelectorAll(`[data-word=\"${word}\"`)];\r\n\t} else if (special) {\r\n\t\twordSpans = [\r\n\t\t\t...document.querySelectorAll(`[data-special=\"${special}\"`)\r\n\t\t];\r\n\t}\r\n\r\n\treturn wordSpans;\r\n}", "title": "" }, { "docid": "367951523f3383a7de945ca3a32a19d4", "score": "0.54368603", "text": "function showEachValue(characters) {\n for (var i = 0; i < characters.length; i++) {\n console.log(characters[i]);\n }\n}", "title": "" }, { "docid": "064a68a32bc6baaa3b6e6e3b088bb153", "score": "0.5373485", "text": "_getLetter(index){let place=Math.floor(index/26),multiplier=26*place,remainder=index-multiplier,letters=\"\";letters+=remainder+\"-\";if(0<place&&26>place){letters+=place-1+\"-\"}else if(26<=place){letters+=this._getLetter(place-1)}return letters}", "title": "" }, { "docid": "6964df32884158228ed875d9ac17e120", "score": "0.5351479", "text": "updateAnsDisplay(char) {\n console.log(\"char: =>\" + char + \"<- word: \" + this.answer);\n\n for (let i = 0; i < this.answer.length; i++) {\n if (this.answer.charAt(i).toLowerCase() === char) {\n this.ansDisplay[i] = this.answer[i];\n console.log(\"got \" + char + \" word: \" + this.ansDisplay);\n }\n }\n\n return this.ansDisplay;\n }", "title": "" }, { "docid": "3f98dc8f5a8e466b0268d5282bbb8e06", "score": "0.5333548", "text": "updateAnsDisplay(char) {\n console.log(\"char: =>\" + char + \"<- word: \" + this.answer);\n \n for (let i = 0; i < this.answer.length; i++) {\n if (this.answer.charAt(i).toLowerCase() === char) {\n this.ansDisplay[i] = this.answer[i];\n console.log(\"got \" + char + \" word: \" + this.ansDisplay);\n }\n }\n \n return this.ansDisplay;\n }", "title": "" }, { "docid": "0a3aa9f9f88c8ae9e1f5a72f72f059e6", "score": "0.53234553", "text": "showLetter() {\n //console.log(this.str, this.match);\n if (this.match) {\n return this.str;\n } else {\n return \" __ \";\n }\n }", "title": "" }, { "docid": "a531bf1fd9bd4c999f31dd621795b395", "score": "0.5320324", "text": "function separateAnswerByLetters(){\n for (var i = 0; i < answer.length; i++){\n answerCharacters.push(answer[i]);\n }\n}", "title": "" }, { "docid": "b7030a9afeef48f17bf61ee539c717f3", "score": "0.5301258", "text": "initAnswerDisplay(ansStr) {\n let ansDisplay = [];\n for (let i = 0; i < ansStr.length; i++) {\n let ansChar = ansStr[i];\n ansDisplay[i] = ansChar;\n if (/\\w/.test(ansChar)) {\n ansDisplay[i] = \"_\";\n }\n }\n \n return ansDisplay;\n }", "title": "" }, { "docid": "1b348d83839942c906de4e64be063998", "score": "0.52981347", "text": "function alphabetPosition(text) {\n let numVal=[];\n \n // converting text into lowercase and iterarting over each character\n let str = text.toLowerCase().split('').forEach((a) => {\n \n let value = a.toLowerCase().charCodeAt(0) - 96\n \n //filtering all alphabets\n if(value>0 && value<27)\n numVal.push(value);\n })\n\n console.log(numVal.join(' ')) ;\n}", "title": "" }, { "docid": "59c310b4c6615450f36351f65b05dfe2", "score": "0.5289801", "text": "function layout_letters() {\n console.log('\\n FUNCTION: layout_letters');\n\n var word = hangman.secret_word;\n\n for ( var i=0; i<word.length; i++ ) {\n\n if ( word[i] === ' ' ) {\n hangman_text.append(\n '<div class=\"letter_space\"></div>'\n );\n }\n else {\n hangman_text.append(\n '<div class=\"letter_underline\">' +\n '<div class=\"letter invisible\" data-letter=\"' + word[i] + '\">' + word[i] + '</div>' +\n '</div>'\n );\n }\n\n }\n\n resize_word_layout();\n guess_word_listeners_on();\n set_game_status('Guess a Letter');\n}", "title": "" }, { "docid": "ebe3d1e04b533c5c7490ecfe6f997001", "score": "0.527641", "text": "function genChars(groups) {\n\tvar a = [];\n\n\tif (typeof groups === undefined || !(groups instanceof Array)) {\n\t\tgroups = [];\n\t}\n\n\tgroups.forEach(function(d) {\n\t\tif (d && d.length && d.offset) {\n\t\t\tfor (var i = 0; i < d.length; i++) {\n\t\t\t\ta.push(String.fromCharCode(d.offset + i));\n\t\t\t}\n\t\t}\n\t});\n\treturn a;\n}", "title": "" }, { "docid": "4884e929ea4e83e10a3b37e07dd98071", "score": "0.52761537", "text": "drawChars() {\n\t\tthis._ctx.fillStyle = this._color;\n\t\tthis._ctx.fillText(this._chars, 20, 30);\n\t\t//cursorX = ctx.measureText(chars);\n\t\t//console.log(ctx.measureText(chars))\n\t}", "title": "" }, { "docid": "50f373aa7fdfdf5e1c394061cc3c6a30", "score": "0.52748144", "text": "function revealChar(curLetter){\n $(\".hiddenLetter\").filter(function(){\n // filter the letters by content and display\n // console.log($(this).text());\n return $(this).text() === curLetter;\n }).css(\"visibility\", \"visible\");\n }", "title": "" }, { "docid": "0b6830f6e4a84e66d621df0bb873b289", "score": "0.52671725", "text": "function showCharCode()\n{\n\tvar theText = \"\";\n\tvar oDisplay = document.getElementById('display');\n\n\t// get the selected text using various browser methods\n\tif(window.getSelection){\n\t\ttheText = window.getSelection().toString();\n\t}\n\telse if(document.getSelection){\n\t\ttheText = window.getSelection().toString();\n\t}\n\n\t// display the result if any\n\tif(theText){\n\t\toDisplay.value = theText.charCodeAt();\n\t}else{\n\t\toDisplay.value = \"\";\n\t}\n}", "title": "" }, { "docid": "f26c1d4e0399832a40836d19abba7b1d", "score": "0.5258794", "text": "initAnswerDisplay(ansStr) {\n let ansDisplay = [];\n for (let i = 0; i < ansStr.length; i++) {\n let ansChar = ansStr[i];\n ansDisplay[i] = ansChar;\n if (/\\w/.test(ansChar)) {\n ansDisplay[i] = \"_\";\n }\n }\n\n return ansDisplay;\n }", "title": "" }, { "docid": "c9a19f20f4e772dca8fa3453e0e6bd5a", "score": "0.52576244", "text": "function getLetters(name) {\n var letters = '';\n if (name.slice(0,1)==\"c\") {\n letters = name.slice(7,8);\n } else {\n if (name.length==12) {\n letters = name.slice(6,8);\n } else {\n letters = name.slice(6,7); \n } \n }\n return letters;\n}", "title": "" }, { "docid": "768c8e3f34f77d3853feba0c0462d0b5", "score": "0.525057", "text": "function start() {\n compWord = wordList[Math.floor(Math.random() * wordList.length)];\n alphabets = compWord.toUpperCase().split(\"\");\n console.log(\"compWord = \" + compWord + \" \" + \"alphabets = \" + alphabets);\n\n guessesLeft = 9;\n guesses = [];\n display = [];\n\n for (i = 0; i < alphabets.length; i++) {\n display.push(\"-\");\n console.log(display)\n }\n document.getElementById(\"display\").innerHTML = display.join(\"\");\n}", "title": "" }, { "docid": "6d5d7f0d1f5e6b457dae5f3063f1694e", "score": "0.5221478", "text": "function last_Letter() {\r\n\talert(display.innerHTML.slice(-1));\r\n}", "title": "" }, { "docid": "88adec1cee6ca3bcbfb7477a9e0adfe1", "score": "0.52070916", "text": "function getCharsArray(el) {\n let theChars = el.value.split('')\n return theChars\n}", "title": "" }, { "docid": "a31d850205e762fd7002aab0385f8207", "score": "0.5189483", "text": "function getLetter() {\r\n checkLetter(this.innerHTML);\r\n this.innerHTML = '&nbsp;';\r\n this.style.cursor = 'default';\r\n this.onclick = null;\r\n}", "title": "" }, { "docid": "2137bd7bd6fe803cd888ff599f108e82", "score": "0.51258284", "text": "function alphabetPosition(text) {\n \nreturn text\n .toUpperCase()\n .match(/[a-z]/gi)\n .map( (c) => c.charCodeAt() - 64)\n .join(' ');\n}", "title": "" }, { "docid": "2ac62a693a6597002a9ce86c6bf5f48b", "score": "0.5121868", "text": "showMatchedLetter(char) {\n const letter = document.querySelectorAll('.' + char.toLowerCase());\n for(let i = 0; i < letter.length; i++) {\n letter[i].classList.remove('hide');\n letter[i].classList.add('show');\n }\n }", "title": "" }, { "docid": "f7efc1f249050265eb57bd714811adda", "score": "0.5112737", "text": "getLetter(index) {\n switch (index) {\n case 0:\n return 'A. ';\n case 1:\n return 'B. ';\n case 2:\n return 'C. ';\n case 3:\n return 'D. ';\n default:\n return '';\n }\n }", "title": "" }, { "docid": "04171ff244c95e8a2f8f74cc76b5f1a0", "score": "0.5110822", "text": "function outputCardNames(){\r\n myCardNames.forEach((name) => {\r\n friendlyName = name.innerText.replace(\"#\",\"T\");\r\n friendlyName = friendlyName.substr(0,friendlyName.indexOf(\" \")) + \" - \" + friendlyName.substr(friendlyName.indexOf(\" \")+1,friendlyName.length);\r\n\r\n outputList = outputList + \"\\n\" + \r\n friendlyName;\r\n })\r\n console.log(outputList);\r\n}", "title": "" }, { "docid": "899504c9edb088b5954cf73cde5e409b", "score": "0.5106472", "text": "function alphabetPosition(text) {\n const letters = text.toLowerCase().match(/[a-z]/g);\n return letters && letters.map(letter => letter.charCodeAt(0) - 96).join(' ') || '';\n}", "title": "" }, { "docid": "bac828d49bdbebb6ebe0b92b08460765", "score": "0.50935376", "text": "_getCharacterMap() {\n const map = new Array(12);\n for (let i = 0; i < 12; i++) {\n map[i] = readline().split('').map(this._cleanupEntry);\n }\n\n return map;\n }", "title": "" }, { "docid": "9ec217b5d8f22c0c09e7166405a8c7cd", "score": "0.50911003", "text": "function determineLetter() {\n \tfor (var i = 0; i < word.length; i++) {\n \t\tif (word[i] === keyPress) {\n \t\t\tvar textDiv = document.getElementById(\"letter\" + i);\n \t\t\ttextDiv.innerHTML = word[i];\n \t\t\t\thiddenWord[i] = word[i];\n \t\t}\n \t}\n \tconsole.log(\"Hello!\");\n \tguesses--;\n\t\tupdateGuesses();\n \tvar letterDiv = document.createElement(\"text\");\n \tletterDiv.innerHTML = keyPress + \" \";\n \tvar lettersElement = document.getElementById(\"letters\");\n \tlettersElement.appendChild(letterDiv);\n \tdetermineIfFinished();\n }", "title": "" }, { "docid": "dd5543d5cb6607a6c84c48224751e914", "score": "0.5090704", "text": "function sLetters() {\n\n return `<div class=\"sbox\"><h3 class=\"spanish-letters\">Number of letters in alphabet</h3> <p class=\"spanish-letters\">${spanishData.funFacts.lettersInAlphabet}</p><br><br>`\n}", "title": "" }, { "docid": "d4d4362383d5e0b4974c35fde0eaf5bb", "score": "0.50896764", "text": "function span(){//called when the user types the required letter correctly\n lettersColor[currentLetter]=\"<span style='color:limegreen'>\"+lettersColor[currentLetter]+\"</span>\";//adds span tags with green color\n document.getElementById(\"race-content-word\").innerHTML = \"\";//resets what was currently stored in the elements innerHTML\n for(var i = 0;i<lettersColor.length;i++){//for loop that loops through the length of lettersColor\n document.getElementById(\"race-content-word\").innerHTML = document.getElementById(\"race-content-word\").innerHTML + lettersColor[i]//concatenates all letters from the lettersColor array to the text element\n }\n currentLetter = currentLetter + 1//increments the current letter count by one\n}", "title": "" }, { "docid": "54d98dc87d0a85b65183b0a42e64c321", "score": "0.5087011", "text": "function displayword() {\n var underscores = word.innerHTML;\n underscores = underscores.split('');\n for (i = 0; i < arraywordlength; i++) {\n if (underscores[i] == '_') {\n underscores[i] = '<span>' + arrayword.charAt(i).toUpperCase() + '</span>';\n }\n }\n word.innerHTML = underscores.join('');\n}", "title": "" }, { "docid": "7a1afe3982405b4a8d1b6783821f0d7c", "score": "0.50808483", "text": "GetGlyphRangesThai() { return this.native.GetGlyphRangesThai(); }", "title": "" }, { "docid": "983b6b6d9b64ecc81197dcd499818203", "score": "0.5044516", "text": "function caps(char) {\n\n}", "title": "" }, { "docid": "323c43b2df35c482a8b350f84f6f8be5", "score": "0.5043264", "text": "function atChar(chars) { return at(char(chars)); }", "title": "" }, { "docid": "6fbe620927cffa5254d06bf25fdc73f2", "score": "0.5018208", "text": "renderLetters () {\n for (var i = 1; i < alphabet.length; i++) {\n var $newRow = $('<div class=\"row\"></div>')\n\n while (i !== 27) {\n var $newDiv = $('<div class=\"letter\"></div>').addClass(alphabet[i]).text(alphabet[i])\n $newRow.append($newDiv)\n\n if (i % lettersPerRow === 0) { break } // five letters per row\n i++\n }\n\n this.displays.letters.append($newRow)\n }\n }", "title": "" }, { "docid": "cd31e563b5f71964c19f6157bca5b9f1", "score": "0.5016669", "text": "getAlphabet() {\n return this._nfa.getAlphabet();\n }", "title": "" }, { "docid": "47eabf6fb5ef24610e5d4b3fe39337a9", "score": "0.50141895", "text": "function alphabetPosition(text) {\n return text\n .toUpperCase()\n .replace(/[^A-Z]+/gi, '')\n .split('')\n .map(e => e.charCodeAt() - 64)\n .join(' ');\n}", "title": "" }, { "docid": "98c94c2334c1e9d7a9dda1e9f01fc4d7", "score": "0.5013756", "text": "function firstLettet() {\n $('.f-letter').html(function (i, html) {\n return html.replace(/^[^a-zA-Z]*([a-zA-Z])/g, '<span class=\"f-letter-wrap\">$1</span>');\n });\n}", "title": "" }, { "docid": "61633b2bbb6dd5e34e85aa9e87c8f828", "score": "0.50124997", "text": "function textDisplay() {\n var displayAnswer = hiddenWord;\n return displayAnswer.join(\" \");\n}", "title": "" }, { "docid": "261deca5cceaa4490a2cffd61a084e19", "score": "0.50058705", "text": "get GlyphRanges() { return this.internal.GlyphRanges; }", "title": "" }, { "docid": "917b3b7ae45f8d3525ba5c59f75a935b", "score": "0.49977654", "text": "showMatchedLetter(letter) {\n const letters = document.querySelectorAll('.letter');\n for (const char of letters) {\n\n if (char.innerText === letter) {\n char.classList.remove('hide');\n char.classList.add('show');\n }\n }\n }", "title": "" }, { "docid": "cec71151a028f258cf232df7cfc2d347", "score": "0.49915507", "text": "function updateDisplay(letter){\n\tfor(i=0;i<currentWordArray.length;i++){\n\t\tif(currentWordArray[i] === letter){\n\t\t\tarrayOfDashes.splice(i, 1, letter);\n\t\t}\n\t}\n\tupdatedDisplay = arrayOfDashes.join('');\n\t$('#word-to-guess').html(updatedDisplay);\n}", "title": "" }, { "docid": "59e9d0a62ddc9c137ab86dc658f5bd39", "score": "0.49800315", "text": "function letter(i) {\n return ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k'][i]\n}", "title": "" }, { "docid": "cf82f0a9ffe8c9b5ab224a68c1a45a5b", "score": "0.497451", "text": "function displayInf(...chars){\n console.log(...chars)\n }", "title": "" }, { "docid": "df3df26c47c1b15bc9e2711babdbcf13", "score": "0.49736753", "text": "function getWord() {\n\n pressPlay.textContent = \"\";\n \n // creates underscores in browser according to index of bands array \n // bands[random] is the current band name\n for (i=0;i<bands[random].length;i++) {\n if (bands[random][i]===\" \") {\n browArr.push(\"\\xa0\");\n } else {\n browArr.push(\"_\");\n }\n\n // takes browArr and converts to a string\n browChar = browArr.join(\"\");\n\n // assigns value of browChar to the textContent of currentBand \n // aka gets value of browChar into html and on the browser\n currentBand.textContent = browChar;\n\n // splits the current band name into an array\n wordArr=bands[random].split(\"\");\n }\n\n}", "title": "" }, { "docid": "96b3a2b9c2b2156418d459b933c266ef", "score": "0.49496537", "text": "function alphabetPosition(text) {\n\n //Empty string to store the alphabet numerical values\n var result = \"\";\n //For loop that will change each alphabet character to its numerical value 1-26 of the alphabet.\n for (var i = 0; i < text.length; i++) {\n var code = text.toUpperCase().charCodeAt(i);\n if (code > 64 && code < 91) {\n result += (code - 64) + \" \";\n }\n }\n return result.slice(0, result.length - 1);\n}", "title": "" }, { "docid": "7aa3cc8bd948648f5dc89885cb92f550", "score": "0.49368364", "text": "function splitAccesskey(val) {\n var t = val.split(/\\s+/),\n keys = [];\n \n for (var i=0, k; k = t[i]; i++) {\n k = k[0].toUpperCase(); // first character only\n // theoretically non-accessible characters should be ignored, but different systems, different keyboard layouts, ... screw it.\n // a map to look up already used access keys would be nice\n keys.push(k);\n }\n \n return keys;\n}", "title": "" }, { "docid": "3ba613bac94a81910c7ce04b62adae7b", "score": "0.49356267", "text": "function getLetter (letter) {\n that.checkGuess(this.innerHTML.toLowerCase());\n this.innerHTML = '&nbsp;';\n this.style.cursor = 'default';\n this.style.dispaly = 'none';\n this.onclick = null;\n }", "title": "" }, { "docid": "439447e258d8569155baa8a082de6c41", "score": "0.49315006", "text": "function characters(letters) {\n\tthis.letters = letters;\n\tthis.placeHolder = '_';\n\tthis.letterGuessed = false;\n\n\tthis.getLetter = function() {\n\t\tvar guess = '';\n\n\t\tif (this.letterGuessed) {\n\t\t\tguess = this.letters;\n\t\t}else {\n\t\t\tguess = this.placeHolder;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ac0d9d7070738bce5c6e560618b12e10", "score": "0.49307823", "text": "function letterArr(arr) {\n\n var array = [];\n\n for (var i = 0; i < arr.length; i ++) {\n\n array.push( arr[i].split('') );\n }\n\n return array;\n}", "title": "" }, { "docid": "590fa78121050a6cc71f8b50a2b62461", "score": "0.49219602", "text": "function showAllLetters() {\n\n // push puzzleCurrent into sqDiv\n let puzzleLength = puzzleCurrent.splitText.length;\n \n for (let i = 0; i < puzzleLength; i++) {\n\n let tempSqText = puzzleDiv.children[i].innerHTML;\n let puzzleText = puzzleCurrent.splitText[i];\n\n // * double-check on animation timing later\n if (tempSqText !== puzzleText && tempSqText !== '*' && tempSqText !== \"'\" && tempSqText !== '-' && tempSqText !== '.') {\n\n // stagger light effect of each guessed letter\n puzzleDiv.children[i].classList.add('square-display', 'square-light');\n puzzleDiv.children[i].innerHTML = puzzleCurrent.splitText[i];\n\n }\n\n }\n\n audioSolve();\n\n}", "title": "" }, { "docid": "d2b7c4f78d863d05418184c5708520ba", "score": "0.49210736", "text": "function displayUpperCase(letterguess) {\n var upper = letterguess.toUpperCase();\n if (displayLettersArray.indexOf(upper) ===-1) {\n displayLettersArray.push(upper);\n displayLetters.textContent = ( displayLettersArray);\n console.log(displayLettersArray);\n \n \n \n } else {\n alert(\"you already guessed this letter\");\n }\n \n}", "title": "" }, { "docid": "d86d41d80ee6627e21276148081e058e", "score": "0.491399", "text": "function showTest(){\n const quote = getTest(selectedTest)\n quoteDisplayElement.innerText = ''\n quote.split('').forEach(character =>{\n const characterSpan = document.createElement('span')\n characterSpan.innerText = character\n quoteDisplayElement.appendChild(characterSpan)\n })\n\n quoteInputElement.value = null\n \n}", "title": "" }, { "docid": "9e407ff858a693f6e2f7aa981e0c22e6", "score": "0.49092612", "text": "function doSearchChar() { doSearch('characterdesc'); }", "title": "" }, { "docid": "9df6202e927f19f13adee0f2634f6b68", "score": "0.49000227", "text": "charPrint (c) {\n if (typeof c === 'undefined') {\n c = 'X';\n }\n for (let h = 0; h < this.height; h++) {\n let array = [];\n for (let w = 0; w < this.width; w++) {\n array.push(c);\n }\n console.log(array.join(''));\n }\n }", "title": "" }, { "docid": "fff54a20bccd609660abafc31f0a4851", "score": "0.48982415", "text": "showMatchedLetter(letter) \n {\n // select list items which contains the letter in their text content\n const letterClass = `${letter}`;\n const matchedLis = document.getElementsByClassName(letterClass);\n\n // turn off \"hide\" class and turn on \"show\" class for every list item in that list.\n for(let i=0; i<matchedLis.length; i++)\n {\n matchedLis[i].classList.toggle(\"hide\");\n matchedLis[i].classList.toggle(\"show\");\n } \n }", "title": "" }, { "docid": "d8c1a200cf974cc117c007d1194e6d09", "score": "0.4891235", "text": "function getLetters(sir) {\n let litere = \"\";\n for (let i = 0; i < sir.length; i++) {\n if (/[a-zA-Z]/.test(sir[i])) {\n litere += sir[i];\n }\n }\n return litere;\n}", "title": "" }, { "docid": "d300182cc5ce88763dc6a95d3f39d0cd", "score": "0.4890637", "text": "function printChars( str ) {\n for ( var i = 0; i < str.length; i++ ) {\n console.log( str[ i ] );\n }\n}", "title": "" }, { "docid": "4f7c9f4ff8c8a9286086c91197c7e5f3", "score": "0.48904383", "text": "function displayWord(array) {\n for (var i = 0; i < array.length; i++) {\n currentWord.push(\"-\");\n spanCurrentWord.textContent = currentWord;\n }\n}", "title": "" }, { "docid": "8f563ba546b6ed4a4bd28bf4dc30bded", "score": "0.48903275", "text": "function splitAccesskey(val) {\n var t = val.split(/\\s+/);\n var keys = [];\n\n for (var i = 0, k; k = t[i]; i++) {\n k = k.charAt(0).toUpperCase(); // first character only\n // theoretically non-accessible characters should be ignored, but different systems, different keyboard layouts, ... screw it.\n // a map to look up already used access keys would be nice\n keys.push(k);\n }\n\n return keys;\n }", "title": "" }, { "docid": "8f563ba546b6ed4a4bd28bf4dc30bded", "score": "0.48903275", "text": "function splitAccesskey(val) {\n var t = val.split(/\\s+/);\n var keys = [];\n\n for (var i = 0, k; k = t[i]; i++) {\n k = k.charAt(0).toUpperCase(); // first character only\n // theoretically non-accessible characters should be ignored, but different systems, different keyboard layouts, ... screw it.\n // a map to look up already used access keys would be nice\n keys.push(k);\n }\n\n return keys;\n }", "title": "" }, { "docid": "c0f3913afa6c185da217e4e2b7ab7600", "score": "0.48864502", "text": "function alphabetPosition(text) {\n let code = [];\n let num = text.toLowerCase().replace(/[.,\\/#!$%\\^&\\*;:{}=\\-_`<|>^\\d+$?@'~()]/g, \"\")\n .replace(/ +/g, \"\").split(\"\")\n num.forEach(function (el) {\n if (el.charCodeAt() - 96 > 0) {\n code.push(el.charCodeAt() - 96)\n }\n })\n return code.join(\" \")\n}", "title": "" }, { "docid": "9c4d1925fad95b833c7cbbe05f3339f3", "score": "0.48835394", "text": "function letter(x, y, i) {\n text(word[i % word.length], x, y);\n}", "title": "" }, { "docid": "7671acbab0b39a814cd1902f31208871", "score": "0.48816913", "text": "showMatchedLetter(letter) {\n Array.from(document.getElementsByClassName(letter)).map(element => {\n element.classList.add(\"show\"); \n element.classList.remove(\"hide\");\n })\n }", "title": "" }, { "docid": "63abaed4c01c50177f808f97a52bb88a", "score": "0.48786226", "text": "function showChar() {\n for (var i = 0; i < charArray.length; i++) {\n $(\"#char\" + charArray[i] + \"_text\").text(characters[charArray[i]].name);\n $(\"#char\" + charArray[i] + \"_img\").attr(\"src\", \"images/\" + characters[charArray[i]].imageName);\n $(\"#char\" + charArray[i] + \"_img\").attr(\"alt\", characters[charArray[i]].name);\n $(\"#char\" + charArray[i] + \"_h6\").text(\"Health: \" + characters[charArray[i]].Health);\n $(\"#select_char\").slideDown(500);\n }\n prepGame();\n return;\n }", "title": "" }, { "docid": "f6ed98faa0190c2a28d5cc7309037ba0", "score": "0.4877602", "text": "function getAllLetters(str) {\r\n // your code here\r\n return str.split(\"\");\r\n}", "title": "" }, { "docid": "8cfd61e8bcbd16d4b8d8813c55afb4b8", "score": "0.4873809", "text": "function displayWord() {\n //nothing at first (empty string)\n var wordDisplay = \"\";\n \n //loop through wordLetters array\n for (var i = 0; i < wordLetters.length; i++) {\n \n // if (wordLetters.indexOf(\" \") !== -1) {}\n \n //if the wordLetter has been guessed, display it...\n if (matchedLetters.indexOf(wordLetters[i]) !== -1) {\n wordDisplay += wordLetters[i]; \n \n }\n //...otherwise, display an underscore\n else {\n wordDisplay += \"&nbsp;_&nbsp;\";\n \n }\n }\n //update page with the new wordDisplay string\n \n guessWordText.innerHTML = wordDisplay;\n \n console.log(wordLetters);\n console.log(wordDisplay);\n \n \n}", "title": "" }, { "docid": "3251bc4b71664c17326b7eaed4787b66", "score": "0.4865985", "text": "function displayWord() {\n var str = \"\";\n for (var i = 0; i < wordSoFar.length; i++) {\n str += wordSoFar[i] + \"&nbsp;\";\n }\n wordDisplay.innerHTML = str;\n}", "title": "" }, { "docid": "3ee453d72c267baeb6436f1f18ae6898", "score": "0.4865176", "text": "function showWord(array) {\n // if that was the last word of the array, reset\n if (factIndex === array.length) {\n time = 0;\n factIndex = 0;\n currentIndex = 0;\n gameState = false;\n wordsArr = [];\n } else {\n word = array[factIndex];\n for (let i = 0; i < word.length; i++) {\n const span = document.createElement(\"span\");\n span.className = `letter `;\n span.appendChild(document.createTextNode(word.charAt(i).toUpperCase()));\n\n wordDisplay.insertBefore(span, wordDisplay.lastChild);\n }\n\n letters = document.querySelectorAll(\".letter\");\n currentIndex = 0;\n factIndex++;\n }\n}", "title": "" }, { "docid": "7a62dd7cb9fe9f6c381b39df5236f492", "score": "0.48548228", "text": "function getSelectionCharOffsetsWithin( element ){\n\t\t\t\t var start = 0, end = 0;\n\t\t\t\t var sel, range, priorRange;\n\t\t\t\t var div = {};\n\t\t\t\t var div2 = {};\n\t\t\t\t var first = '';\n\t\t\t\t var second = '';\n\t\t\t\t var elemSel = null;\n\t\t\t\t var pos = -1;\n\t\t\t\t if( typeof window.getSelection !== 'undefined' ) {\n\t\t\t\t range = window.getSelection().getRangeAt(0);\n\t\t\t\t priorRange = range.cloneRange();\n\t\t\t\t priorRange.selectNodeContents(element);\n\t\t\t\t priorRange.setEnd(range.startContainer, range.startOffset);\n\t\t\t\t div = document.createElement( 'div' );\n\t\t\t\t div.appendChild( priorRange.cloneContents() );\n\t\t\t\t first = div.innerHTML;\n\n\t\t\t\t\t\tif( first.indexOf( 'editcontprop' ) !== -1 || ( first.indexOf( '<span' ) !== -1 && first.indexOf( 'sp_' ) !== -1 ) ){\n\t\t\t\t\t\t\telemSel = $( '<div>' + first + '</div>' );\n\t\t\t\t\t\t\telemSel.find( 'span' ).each( function( index ){\n\t\t\t\t\t\t\t\tvar text = '';\n\t\t\t\t\t\t\t\tif( this.id && this.id !== null && this.id.indexOf( 'sp_' ) !== -1 ){\n\t\t\t\t\t\t\t\t\ttext = $( this ).html();\n\t\t\t\t\t\t\t\t\t$(this).replaceWith( text );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\tfirst = elemSel.html();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//необходимо убирать последний закрывающий тег,\n\t\t\t\t\t\t//чтобы правильно вычислять смещение\n\n\t\t\t\t\t\tpos = first.lastIndexOf( '>' );\n\t\t\t\t\t\tif( pos !== -1 && pos === first.length - 1 ){\n\t\t\t\t\t\t\tpos = first.lastIndexOf( '</' );\n\t\t\t\t\t\t\tif( pos !== -1 ){\n\t\t\t\t\t\t\t\tfirst = first.substring( 0, pos );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t div2 = document.createElement( 'div' );\n\t\t\t\t div2.appendChild( range.cloneContents() );\n\t\t\t\t second = div2.innerHTML;\n\n\t\t\t\t\t\tif( second.indexOf( 'editcontprop' ) !== -1 || ( second.indexOf( '<span' ) !== -1 && second.indexOf( 'sp_' ) !== -1 ) ){\n\t\t\t\t\t\t\telemSel = $( '<div>' + second + '</div>' );\n\t\t\t\t\t\t\telemSel.find( 'span' ).each( function( index ){\n\t\t\t\t\t\t\t\tvar text = '';\n\t\t\t\t\t\t\t\tif( this.id && this.id !== null && this.id.indexOf( 'sp_' ) !== -1 ){\n\t\t\t\t\t\t\t\t\ttext = $( this ).html();\n\t\t\t\t\t\t\t\t\t$(this).replaceWith( text );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\tsecond = elemSel.html();\n\t\t\t\t\t\t}\n\t\t\t\t /*start = priorRange.toString().length;\n\t\t\t\t end = start + range.toString().length;*/\n\t\t\t\t start = first.length;\n\t\t\t\t end = start + second.length;\n\t\t\t\t } else if (typeof document.selection !== 'undefined' &&\n\t\t\t\t (sel = document.selection).type !== 'Control') {\n\t\t\t\t range = sel.createRange();\n\t\t\t\t priorRange = document.body.createTextRange();\n\t\t\t\t priorRange.moveToElementText(element);\n\t\t\t\t priorRange.setEndPoint('EndToStart', range);\n\t\t\t\t start = priorRange.text.length;\n\t\t\t\t end = start + range.text.length;\n\t\t\t\t }\n\t\t\t\t return {\n\t\t\t\t startOffset: start,\n\t\t\t\t endOffset: end\n\t\t\t\t };\n\t\t\t\t}", "title": "" }, { "docid": "9b2e78c81b12fa04c800a47825ab5a02", "score": "0.48525867", "text": "function render_word() {\n\tdocument.getElementById('word').innerHTML = letters.join('');\n}", "title": "" }, { "docid": "ce2b51ebaa389fefbb146e6cba875711", "score": "0.4848204", "text": "renderGuess ( {letter, type} ) {\n var $newSpan = $('<span></span>')\n .attr('class', letter.toUpperCase() + ' ' + type)\n .html(letter + ' ')\n\n this.displays.underscore.append($newSpan)\n }", "title": "" }, { "docid": "561c1338dc7cdb5bce76aa0d41d37c04", "score": "0.4839018", "text": "function getBlock(letter, blocks) {\r\n let b = [];\r\n blocks.forEach(block => {\r\n if (block.textContent === letter.value) {\r\n b.push(block);\r\n }\r\n });\r\n return b;\r\n }", "title": "" }, { "docid": "791bf0e55de6a26c595aa62e485b5168", "score": "0.48334184", "text": "function userGuessedLetters() {\n var displayletter = lettersGuessed.join(\" \");\n document.getElementById(\"playerGuess\").innerHTML = displayletter;\n}", "title": "" }, { "docid": "b63d92b2cfa032a836ac1b489019739d", "score": "0.48259565", "text": "get Glyphs() {\n const glyphs = new ImVector();\n this.native.IterateGlyphs((glyph) => {\n glyphs.push(new ImFontGlyph(glyph)); // TODO: wrap native\n });\n return glyphs;\n }", "title": "" }, { "docid": "18931ee655d0c41252ad744cfcf82d4a", "score": "0.48242852", "text": "function breakIntoSpans($el){\n console.log('$el',$el);\n const innerText = $el.text();\n console.log('innerText',innerText);\n\n return innerText\n .split('')\n .map(char => `<span>${char}</span>`)\n .join('');\n\n // console.log('result',result);\n\n}", "title": "" }, { "docid": "fd99d39e054449dc0d8f417f65a9ef20", "score": "0.48207998", "text": "function cutter(expr) {\n var encodedLetterArray = [];\n for (var i = 0; i < expr.length; i = i + 10) {\n encodedLetterArray.push(expr.slice(i, i + 10));\n }\n return encodedLetterArray;\n }", "title": "" }, { "docid": "429d3a6e983238f1c9522ea9d2a41acb", "score": "0.48191947", "text": "function displayInf2(...chars){\n console.log(chars)\n }", "title": "" }, { "docid": "ca33ec90813121a04bf1cd995fdf29d3", "score": "0.48186296", "text": "showMatchedLetter(keys) {\n // regex used to check if something is a word\n var isLetter = (/[\\w]/);\n // variable that holds the hidden elements\n var hiddenChars = document.getElementsByClassName(\"hide\");\n\n // loop that will go through each hidden element\n for (let i = 0; i< hiddenChars.length; i++){\n // variable that holds the hidden letters\n var hiddenLetter = hiddenChars[i].innerHTML;\n // conditional that makes sure that the letter is an actual letter\n if(isLetter.test(hiddenLetter) == true){\n var hiddenElement = hiddenChars[i];\n\n // conditional that checks if the hidden element is the same as the letter clicked\n if(hiddenLetter.toLowerCase() == keys){\n // add the class show and remove the class hide\n hiddenElement.classList.add('show');\n hiddenElement.classList.remove('hide');\n }\n }\n }\n }", "title": "" }, { "docid": "aa0fcecb1c971c85fb85130a2acb5437", "score": "0.48171124", "text": "function createLetterArray (word){\n letterArr = word.toLowerCase().split('');\n return letterArr;\n}", "title": "" }, { "docid": "03f31955582ce23b5f220aceca59451b", "score": "0.48163354", "text": "function splitAccesskey(val) {\n\t var t = val.split(/\\s+/),\n\t keys = [];\n\t\n\t for (var i = 0, k; k = t[i]; i++) {\n\t k = k.charAt(0).toUpperCase(); // first character only\n\t // theoretically non-accessible characters should be ignored, but different systems, different keyboard layouts, ... screw it.\n\t // a map to look up already used access keys would be nice\n\t keys.push(k);\n\t }\n\t\n\t return keys;\n\t }", "title": "" }, { "docid": "e96b9ba2d9230700066046d850acb7d8", "score": "0.4815849", "text": "function toCharRange(representation) {\n const CHAR_RANGE_MARK = \"-\";\n const ESCAPE_SEQUENCE_MARK = \"\\\\\";\n const ESCAPE_SEQUENCE_UNICODE_MARK = \"u\";\n let outCharArr = [];\n function readUnicodeEscapeSequence(branch) {\n const UNICODE_CODE_LENGTH = 4;\n let codeIsRightLength = s => s.length >= UNICODE_CODE_LENGTH;\n let codeFromHex = s => Number.parseInt(s, 16);\n let charFromCode = n => String.fromCharCode(n);\n if (branch.currentChar === ESCAPE_SEQUENCE_UNICODE_MARK) {\n branch.advance();\n let unicodeEscapeSequenceBranch = branch.derive();\n unicodeEscapeSequenceBranch.advance(4);\n let unicodeCodeHex = unicodeEscapeSequenceBranch.partialString;\n if (codeIsRightLength(unicodeCodeHex))\n throw new Core.Exceptions.FormatException(`Expected a code point length of ${UNICODE_CODE_LENGTH}, but found ${unicodeCodeHex.length} instead.`);\n let unicodeCode = codeFromHex(unicodeCodeHex);\n if (isNaN(unicodeCode))\n throw new Core.Exceptions.FormatException(`Unexpected token \"${unicodeCodeHex}\". An hexadecimal code was expected.`);\n unicodeEscapeSequenceBranch.update();\n return charFromCode(unicodeCode);\n }\n return null;\n }\n function readEscapeSequence(branch) {\n if (branch.currentChar === ESCAPE_SEQUENCE_MARK) {\n let escapeSequenceBranch = branch.derive();\n escapeSequenceBranch.advance();\n let unicodeChar = null;\n if ((unicodeChar = readUnicodeEscapeSequence(escapeSequenceBranch)) !== null) {\n escapeSequenceBranch.update();\n return unicodeChar;\n }\n else {\n escapeSequenceBranch.advance(1);\n let escapedChar = escapeSequenceBranch.currentChar;\n escapeSequenceBranch.update();\n return escapedChar;\n }\n }\n return null;\n }\n function readChar(branch) {\n let char = null;\n if ((char = readEscapeSequence(branch)) !== null)\n return char;\n else {\n char = branch.currentChar;\n branch.advance();\n return char;\n }\n }\n function readCharRange(branch) {\n let charRangeBranch = branch.derive();\n let startChar = readChar(charRangeBranch);\n if (charRangeBranch.currentChar === CHAR_RANGE_MARK) {\n charRangeBranch.advance();\n let endChar = readChar(charRangeBranch);\n if (endChar === null)\n throw new Core.Exceptions.FormatException(\"Unexpected end of the string.\");\n charRangeBranch.update();\n return { start: startChar, end: endChar };\n }\n return null;\n }\n function readAll() {\n let scanner = new StringScanner(representation);\n let charRange = null, char = null;\n while (true) {\n if ((charRange = readCharRange(scanner)) !== null)\n outCharArr = [...outCharArr, ...getCharRange(charRange.start, charRange.end)];\n else if ((char = readChar(scanner)) !== null)\n outCharArr.push(char);\n else\n break;\n }\n }\n readAll();\n return outCharArr;\n }", "title": "" }, { "docid": "4051fad93d73ed4da6fbd707f70d7610", "score": "0.48157674", "text": "function getCharRange(startChar, endChar) {\n let result = [];\n for (let code = startChar.charCodeAt(0); code <= endChar.charCodeAt(0); code++)\n result.push(String.fromCharCode(code));\n return result;\n }", "title": "" }, { "docid": "0ec640452791924fef8fb82148c93952", "score": "0.4814552", "text": "function revealLetter(index,letter){\n // playerTurn++;\n wordArray[index]=letter;\n console.log(wordArray)\n document.getElementById(\"underscores\").innerHTML = wordArray;\n //only add points for first instance of letter found,\n revealPoints(helper); \n}", "title": "" }, { "docid": "e12217be3ca613884e594d74d208f866", "score": "0.48124477", "text": "function showLetter(data) {\n for (var i = 0; i < word.length; i++) {\n if (word[i] === data) {\n obfWord[i] = word[i];\n wordl--;\n }\n }\n}", "title": "" }, { "docid": "9eefc0fc42d871ee8e890d3ca33f5f1f", "score": "0.48072267", "text": "function getTextfromList(el) {\n const children = Array.from(el.childNodes)\n const result = []\n children.map(child => {\n if (TEXT_TAGS[child.nodeName] || child.nodeName === '#text') {\n result.push(child)\n } else if (child.nodeName === 'SPAN') {\n child.textContent = child.textContent.replace(\n /(^(\\W)(?=\\s)*)|(o\\s)(?!\\w)/gm,\n ''\n )\n result.push(child)\n }\n })\n return result\n}", "title": "" }, { "docid": "b8cdce29bd3286af3eba06ddb2f6f23b", "score": "0.48045105", "text": "function spellGuess() {\n // Create a temporary string\n var letters = \"\"\n\n // Add each letter from the user's current guess to letters, with spaces added between letters\n for (var k=0; k < currentGuess.length; k++) {\n letters += currentGuess[k].toUpperCase();\n if (k < currentGuess.length - 1) {\n letters += \" \";\n }\n }\n\n // Assign the value of letters to the \"blanks\" element on the page.\n document.getElementById(\"blanks\").textContent = letters\n}", "title": "" }, { "docid": "9ab8c4887b2f74414f5948fe1124505c", "score": "0.48005727", "text": "function makeNewGame() {\n lives = 10;\n lettersGuessed = \"\";\n var randomCharacter = officeCharacters[Math.floor(Math.random() * officeCharacters.length)];\n var randomWordDiv = document.getElementById(\"randomWord\");\n var lettersGuessedDiv = document.getElementById(\"lettersGuessed\");\n lettersGuessedDiv.textContent = \"\";\n randomWordDiv.innerHTML = \"\";\n\n livesLeft.textContent = lives;\n\n var randomCharacterArray = randomCharacter.split(\"\"); // .split creates an array of the individual characters of the randomCharacter var\n for (var x = 0; x < randomCharacterArray.length; x++) {\n // console.log(randomCharacterArray[x]);\n randomWordDiv.innerHTML += \"<span id='letter_\" + x +\"'> _ </span>\";\n }\n return randomCharacterArray;\n }", "title": "" }, { "docid": "0976e4ec9f226ba7db0c6a79f421a096", "score": "0.47998413", "text": "function get_suggestions(e){\n\t\t\n\t\tif (e.keyCode != 38 && e.keyCode != 40)\n\t\t{\n\t\t\tvar input_value = $(this).val();\n\t\t\tif (input_value)\n\t\t\t{\n\t\t\t\tresults = new Array();\n\t\t\t\tvar length = input_value.length;\n\t\t\t\t\n\t\t\t\t$.each(abbrs, function(key, value) {\n\t\t\t\t\tif(value.substr(0, length) == input_value && results.length < 15) {\n\t\t\t\t\t\tresults[results.length] = value;\n\t\t\t\t\t}\t\n\t\t\t\t});\t \n\t\t\t\t\n\t\t\t\tif (results[0]){\n\t\t\t\t\tprint_suggestions(results);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\thide_suggestions();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\thide_suggestions();\n\t\t\t}\t\t\t\t\t \n\t\t}\n\t\t\n\t}", "title": "" }, { "docid": "aabf309b184304cd1f55e63c82b0b576", "score": "0.4796022", "text": "showMatchedLetter(letter){\n\t\tlet classLetter = `.hide.letter.${letter}`;\n\t\tlet matchedLetter = document.querySelectorAll(classLetter);\n\t\tfor(let each of matchedLetter){\n\t\t\teach.classList.remove('hide');\n\t\t\teach.classList.add('show');\n\t\t}\n\t}", "title": "" }, { "docid": "39b5c07946a63d08c8b95f8f2312c577", "score": "0.4795656", "text": "showMatchedLetter (key) {\n\t\tconst list = document.querySelectorAll('li.letter');\n\t\tlet letter = game.activePhrase.checkLetter(key);\n\n\t\tfor (let i = 0; i < list.length; i += 1) {\n\t\t\tif (letter && list[i].textContent === key) {\n\t\t\t\tlist[i].classList.remove('hide');\n\t\t\t\tlist[i].classList.add('show');\t\n\t\t\t} \n\t\t}\n\n\t}", "title": "" }, { "docid": "baef8668ba9a4c302a15a50c9fb62f28", "score": "0.47938207", "text": "function getChar(char) {\r\n\tlet result;\r\n\tif (typeof char === \"string\") {\r\n\t\tif (char === \"\\n\") {\r\n\t\t\tresult = document.createElement(\"br\");\r\n\t\t} else if (char === \"\\t\") {\r\n\t\t\tlet tab = document.createElement(\"span\");\r\n\t\t\ttab.innerHTML = \"&nbsp;&nbsp;&nbsp;\";\r\n\t\t\tresult = tab;\r\n\t\t} else if (char === \" \") {\r\n\t\t\tlet space = document.createElement(\"span\");\r\n\t\t\tspace.innerHTML = \"&nbsp;\";\r\n\t\t\tspace.classList.add(\"char\");\r\n\t\t\tresult = space;\r\n\t\t} else {\r\n\t\t\tlet span = document.createElement(\"span\");\r\n\t\t\tspan.classList.add(\"char\");\r\n\t\t\tspan.textContent = char;\r\n\t\t\tresult = span;\r\n\t\t}\r\n\t}\r\n\treturn result;\r\n}", "title": "" }, { "docid": "4559ff52df343ef18f4f96475da938e2", "score": "0.4793018", "text": "function delete_character(screen) {\n return screen.textContent.slice(0, -1);\n}", "title": "" }, { "docid": "221c5984a64cf5b2bec9705df2896f53", "score": "0.47927532", "text": "function getGroupsLetter(lettre) {\n group = getGroups();\n groups = group.groups[lettre];\n return groups;\n}", "title": "" }, { "docid": "d701ea6b4848c0b677d715885d439618", "score": "0.47771528", "text": "showMatchedLetter(letter) {\r\n document.querySelectorAll(`.${letter}`).forEach(element => {\r\n element.className = `show letter ${letter}` \r\n element.textContent = letter;\r\n });\r\n }", "title": "" }, { "docid": "4dc133983b1e79995f6eb10944fe38e4", "score": "0.47728556", "text": "function getAlphaSuggestions(seed)\n{\n // The var to be returned\n var ret = [],\n \n // A var to modify for each letter iteration\n thisRet,\n\n // The entirety of the alphabet\n alpha = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'];\n if (!seed) {\n return [''];\n }\n // Iterate the alpha array of characters\n alpha.map(function (char) {\n // Add a suggestion for each character\n thisRet = getSuggestions(seed + ' ' + char);\n \n // Add each of the results for each letter to the result set\n thisRet.map(function (res) {\n ret.push(res);\n });\n \n // A sleep function to keep the api from timing out\n Utilities.sleep(1000);\n\n });\n if (ret.length) {\n return ret;\n }\n return [''];\n}", "title": "" }, { "docid": "4c14f6bb7e82433d00e6c93e5dc9602b", "score": "0.4769389", "text": "function usedLetters () {\n var lettersNotinUse = currentWordLetters.join('')\n $('#guesses').text(guesses)\n }", "title": "" }, { "docid": "887d8545a55e2d483344fcc8540ce1f6", "score": "0.4763678", "text": "function displayLettersPressed(letter, list) {\n // Push letter pressed into the array\n lettersGuessed.push(letter);\n\n // Put only new letters into an object\n var i; \n var result = [];\n var obj = {};\n for (i = 0; i < list.length; i++) {\n obj[list[i]] = 0;\n };\n for (i in obj) {\n result.push(i);\n };\n console.log(result);\n // Replace innerHTML with string of object contents\n document.getElementById(\"letters-guessed\").innerText = result.join(\" \").toUpperCase();\n}", "title": "" }, { "docid": "e006ff3520661181632a3b7d9a8f97fd", "score": "0.47550303", "text": "function characters(msg, cols) {\n\treturn msg.slice(0, cols).padRight(cols).toUpperCase().split(\"\");\n}", "title": "" }, { "docid": "c48e463139476faf384701f18941ad2e", "score": "0.47541013", "text": "function cifrado (text){\n for (let i = 0;i<text.length;i++ ){\n console.log(text.charCodeAt(i));\n\n }\n\n}", "title": "" } ]
db60035b247f03de8dc73fc906331a0a
format a parsed object into a url string
[ { "docid": "e64db141e0d32566c44c162029664f09", "score": "0.0", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (util.isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}", "title": "" } ]
[ { "docid": "74ed7fbd973e1194a5d6b8dbc5ffd50f", "score": "0.7649171", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (isString(obj)) obj = parse$2({}, obj);\n return format$2(obj);\n }", "title": "" }, { "docid": "102fa3a8afb5c8ba980e78c88290f55c", "score": "0.7632403", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (isString(obj)) obj = parse({}, obj);\n return format(obj);\n}", "title": "" }, { "docid": "279eeb7d563736d4ea065febb7994941", "score": "0.76198053", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (isString(obj)) obj = parse$$1({}, obj);\n return format$$1(obj);\n}", "title": "" }, { "docid": "bf9a2b534bbba80b116ae44e0cd3d701", "score": "0.7592496", "text": "function urlFormat(obj){/*\n * ensure it's an object, and not a string url.\n * If it's an obj, this is a no-op.\n * this way, you can call url_format() on strings\n * to clean up potentially wonky urls.\n */if(typeof obj==='string'){obj=urlParse(obj);}if(!(obj instanceof Url)){return Url.prototype.format.call(obj);}return obj.format();}", "title": "" }, { "docid": "9cc5af77ca419c9cdd2ff894879d57d5", "score": "0.75246567", "text": "function urlFormat(obj){// ensure it's an object, and not a string url.\n// If it's an obj, this is a no-op.\n// this way, you can call url_format() on strings\n// to clean up potentially wonky urls.\nif(isString(obj))obj=urlParse(obj);if(!(obj instanceof Url))return Url.prototype.format.call(obj);return obj.format();}", "title": "" }, { "docid": "ccc77cf73fbf661b9293c42960d637d1", "score": "0.75202495", "text": "function urlFormat(obj){// ensure it's an object, and not a string url.\n// If it's an obj, this is a no-op.\n// this way, you can call url_format() on strings\n// to clean up potentially wonky urls.\nif(util.isString(obj))obj=urlParse(obj);if(!(obj instanceof Url))return Url.prototype.format.call(obj);return obj.format();}", "title": "" }, { "docid": "ccc77cf73fbf661b9293c42960d637d1", "score": "0.75202495", "text": "function urlFormat(obj){// ensure it's an object, and not a string url.\n// If it's an obj, this is a no-op.\n// this way, you can call url_format() on strings\n// to clean up potentially wonky urls.\nif(util.isString(obj))obj=urlParse(obj);if(!(obj instanceof Url))return Url.prototype.format.call(obj);return obj.format();}", "title": "" }, { "docid": "ccc77cf73fbf661b9293c42960d637d1", "score": "0.75202495", "text": "function urlFormat(obj){// ensure it's an object, and not a string url.\n// If it's an obj, this is a no-op.\n// this way, you can call url_format() on strings\n// to clean up potentially wonky urls.\nif(util.isString(obj))obj=urlParse(obj);if(!(obj instanceof Url))return Url.prototype.format.call(obj);return obj.format();}", "title": "" }, { "docid": "ac613267ac489d3b33663fc8b3c50d9d", "score": "0.75149155", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n }", "title": "" }, { "docid": "4ba553d5f9090139c044e8d91cff6968", "score": "0.749985", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (util.isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n }", "title": "" }, { "docid": "45019f6f071254d26b3f056a84450072", "score": "0.7486208", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (util.isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n }", "title": "" }, { "docid": "45019f6f071254d26b3f056a84450072", "score": "0.7486208", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (util.isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n }", "title": "" }, { "docid": "45019f6f071254d26b3f056a84450072", "score": "0.7486208", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (util.isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n }", "title": "" }, { "docid": "7a5aa0c87708b87f5f8c518db21fb299", "score": "0.7485597", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (util.isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n }", "title": "" }, { "docid": "0551a82dffdb27204f1a8189463214ec", "score": "0.7483678", "text": "function urlFormat(obj) {\n\t\t // ensure it's an object, and not a string url.\n\t\t // If it's an obj, this is a no-op.\n\t\t // this way, you can call url_format() on strings\n\t\t // to clean up potentially wonky urls.\n\t\t if (util.isString(obj)) obj = urlParse(obj);\n\t\t if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n\t\t return obj.format();\n\t\t}", "title": "" }, { "docid": "2547a0bebc35c077085368e2e06d03b0", "score": "0.7474662", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (util.isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n }", "title": "" }, { "docid": "2547a0bebc35c077085368e2e06d03b0", "score": "0.7474662", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (util.isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n }", "title": "" }, { "docid": "b9004e1e11c2705fb5a2b9df9a7be880", "score": "0.74740994", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (util.isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n }", "title": "" }, { "docid": "b9004e1e11c2705fb5a2b9df9a7be880", "score": "0.74740994", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (util.isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n }", "title": "" }, { "docid": "438d4cbbc817c06f8f25bc632a8eb399", "score": "0.7472738", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (util.isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n }", "title": "" }, { "docid": "52293afbaf7a259ea25876d321073af7", "score": "0.74644387", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (util.isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n }", "title": "" }, { "docid": "81a7982dc497e60c05aaa8a7ade04cf3", "score": "0.7461059", "text": "function urlFormat(obj) {\r\n\t // ensure it's an object, and not a string url.\r\n\t // If it's an obj, this is a no-op.\r\n\t // this way, you can call url_format() on strings\r\n\t // to clean up potentially wonky urls.\r\n\t if (isString(obj)) obj = urlParse(obj);\r\n\t if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\r\n\t return obj.format();\r\n\t}", "title": "" }, { "docid": "0416f336be352083c59792fe382dc5b5", "score": "0.7417844", "text": "function urlFormat(obj) {\n\t // ensure it's an object, and not a string url.\n\t // If it's an obj, this is a no-op.\n\t // this way, you can call url_format() on strings\n\t // to clean up potentially wonky urls.\n\t if (isString(obj)) obj = urlParse(obj);\n\t if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n\t return obj.format();\n\t}", "title": "" }, { "docid": "0416f336be352083c59792fe382dc5b5", "score": "0.7417844", "text": "function urlFormat(obj) {\n\t // ensure it's an object, and not a string url.\n\t // If it's an obj, this is a no-op.\n\t // this way, you can call url_format() on strings\n\t // to clean up potentially wonky urls.\n\t if (isString(obj)) obj = urlParse(obj);\n\t if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n\t return obj.format();\n\t}", "title": "" }, { "docid": "0416f336be352083c59792fe382dc5b5", "score": "0.7417844", "text": "function urlFormat(obj) {\n\t // ensure it's an object, and not a string url.\n\t // If it's an obj, this is a no-op.\n\t // this way, you can call url_format() on strings\n\t // to clean up potentially wonky urls.\n\t if (isString(obj)) obj = urlParse(obj);\n\t if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n\t return obj.format();\n\t}", "title": "" }, { "docid": "0416f336be352083c59792fe382dc5b5", "score": "0.7417844", "text": "function urlFormat(obj) {\n\t // ensure it's an object, and not a string url.\n\t // If it's an obj, this is a no-op.\n\t // this way, you can call url_format() on strings\n\t // to clean up potentially wonky urls.\n\t if (isString(obj)) obj = urlParse(obj);\n\t if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n\t return obj.format();\n\t}", "title": "" }, { "docid": "0416f336be352083c59792fe382dc5b5", "score": "0.7417844", "text": "function urlFormat(obj) {\n\t // ensure it's an object, and not a string url.\n\t // If it's an obj, this is a no-op.\n\t // this way, you can call url_format() on strings\n\t // to clean up potentially wonky urls.\n\t if (isString(obj)) obj = urlParse(obj);\n\t if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n\t return obj.format();\n\t}", "title": "" }, { "docid": "0416f336be352083c59792fe382dc5b5", "score": "0.7417844", "text": "function urlFormat(obj) {\n\t // ensure it's an object, and not a string url.\n\t // If it's an obj, this is a no-op.\n\t // this way, you can call url_format() on strings\n\t // to clean up potentially wonky urls.\n\t if (isString(obj)) obj = urlParse(obj);\n\t if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n\t return obj.format();\n\t}", "title": "" }, { "docid": "0416f336be352083c59792fe382dc5b5", "score": "0.7417844", "text": "function urlFormat(obj) {\n\t // ensure it's an object, and not a string url.\n\t // If it's an obj, this is a no-op.\n\t // this way, you can call url_format() on strings\n\t // to clean up potentially wonky urls.\n\t if (isString(obj)) obj = urlParse(obj);\n\t if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n\t return obj.format();\n\t}", "title": "" }, { "docid": "0416f336be352083c59792fe382dc5b5", "score": "0.7417844", "text": "function urlFormat(obj) {\n\t // ensure it's an object, and not a string url.\n\t // If it's an obj, this is a no-op.\n\t // this way, you can call url_format() on strings\n\t // to clean up potentially wonky urls.\n\t if (isString(obj)) obj = urlParse(obj);\n\t if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n\t return obj.format();\n\t}", "title": "" }, { "docid": "0416f336be352083c59792fe382dc5b5", "score": "0.7417844", "text": "function urlFormat(obj) {\n\t // ensure it's an object, and not a string url.\n\t // If it's an obj, this is a no-op.\n\t // this way, you can call url_format() on strings\n\t // to clean up potentially wonky urls.\n\t if (isString(obj)) obj = urlParse(obj);\n\t if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n\t return obj.format();\n\t}", "title": "" }, { "docid": "0416f336be352083c59792fe382dc5b5", "score": "0.7417844", "text": "function urlFormat(obj) {\n\t // ensure it's an object, and not a string url.\n\t // If it's an obj, this is a no-op.\n\t // this way, you can call url_format() on strings\n\t // to clean up potentially wonky urls.\n\t if (isString(obj)) obj = urlParse(obj);\n\t if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n\t return obj.format();\n\t}", "title": "" }, { "docid": "0416f336be352083c59792fe382dc5b5", "score": "0.7417844", "text": "function urlFormat(obj) {\n\t // ensure it's an object, and not a string url.\n\t // If it's an obj, this is a no-op.\n\t // this way, you can call url_format() on strings\n\t // to clean up potentially wonky urls.\n\t if (isString(obj)) obj = urlParse(obj);\n\t if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n\t return obj.format();\n\t}", "title": "" }, { "docid": "0416f336be352083c59792fe382dc5b5", "score": "0.7417844", "text": "function urlFormat(obj) {\n\t // ensure it's an object, and not a string url.\n\t // If it's an obj, this is a no-op.\n\t // this way, you can call url_format() on strings\n\t // to clean up potentially wonky urls.\n\t if (isString(obj)) obj = urlParse(obj);\n\t if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n\t return obj.format();\n\t}", "title": "" }, { "docid": "0416f336be352083c59792fe382dc5b5", "score": "0.7417844", "text": "function urlFormat(obj) {\n\t // ensure it's an object, and not a string url.\n\t // If it's an obj, this is a no-op.\n\t // this way, you can call url_format() on strings\n\t // to clean up potentially wonky urls.\n\t if (isString(obj)) obj = urlParse(obj);\n\t if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n\t return obj.format();\n\t}", "title": "" }, { "docid": "0416f336be352083c59792fe382dc5b5", "score": "0.7417844", "text": "function urlFormat(obj) {\n\t // ensure it's an object, and not a string url.\n\t // If it's an obj, this is a no-op.\n\t // this way, you can call url_format() on strings\n\t // to clean up potentially wonky urls.\n\t if (isString(obj)) obj = urlParse(obj);\n\t if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n\t return obj.format();\n\t}", "title": "" }, { "docid": "0416f336be352083c59792fe382dc5b5", "score": "0.7417844", "text": "function urlFormat(obj) {\n\t // ensure it's an object, and not a string url.\n\t // If it's an obj, this is a no-op.\n\t // this way, you can call url_format() on strings\n\t // to clean up potentially wonky urls.\n\t if (isString(obj)) obj = urlParse(obj);\n\t if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n\t return obj.format();\n\t}", "title": "" }, { "docid": "39393cf47d222bc854a0bd73eaa85b90", "score": "0.7411724", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}", "title": "" }, { "docid": "39393cf47d222bc854a0bd73eaa85b90", "score": "0.7411724", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}", "title": "" }, { "docid": "39393cf47d222bc854a0bd73eaa85b90", "score": "0.7411724", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}", "title": "" }, { "docid": "39393cf47d222bc854a0bd73eaa85b90", "score": "0.7411724", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}", "title": "" }, { "docid": "39393cf47d222bc854a0bd73eaa85b90", "score": "0.7411724", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}", "title": "" }, { "docid": "39393cf47d222bc854a0bd73eaa85b90", "score": "0.7411724", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}", "title": "" }, { "docid": "39393cf47d222bc854a0bd73eaa85b90", "score": "0.7411724", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}", "title": "" }, { "docid": "39393cf47d222bc854a0bd73eaa85b90", "score": "0.7411724", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}", "title": "" }, { "docid": "39393cf47d222bc854a0bd73eaa85b90", "score": "0.7411724", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}", "title": "" }, { "docid": "39393cf47d222bc854a0bd73eaa85b90", "score": "0.7411724", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}", "title": "" }, { "docid": "39393cf47d222bc854a0bd73eaa85b90", "score": "0.7411724", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}", "title": "" }, { "docid": "39393cf47d222bc854a0bd73eaa85b90", "score": "0.7411724", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}", "title": "" }, { "docid": "39393cf47d222bc854a0bd73eaa85b90", "score": "0.7411724", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}", "title": "" }, { "docid": "39393cf47d222bc854a0bd73eaa85b90", "score": "0.7411724", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}", "title": "" }, { "docid": "39393cf47d222bc854a0bd73eaa85b90", "score": "0.7411724", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}", "title": "" }, { "docid": "39393cf47d222bc854a0bd73eaa85b90", "score": "0.7411724", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}", "title": "" }, { "docid": "39393cf47d222bc854a0bd73eaa85b90", "score": "0.7411724", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}", "title": "" }, { "docid": "39393cf47d222bc854a0bd73eaa85b90", "score": "0.7411724", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}", "title": "" }, { "docid": "39393cf47d222bc854a0bd73eaa85b90", "score": "0.7411724", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}", "title": "" }, { "docid": "39393cf47d222bc854a0bd73eaa85b90", "score": "0.7411724", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}", "title": "" }, { "docid": "39393cf47d222bc854a0bd73eaa85b90", "score": "0.7411724", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}", "title": "" }, { "docid": "39393cf47d222bc854a0bd73eaa85b90", "score": "0.7411724", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}", "title": "" }, { "docid": "39393cf47d222bc854a0bd73eaa85b90", "score": "0.7411724", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}", "title": "" }, { "docid": "39393cf47d222bc854a0bd73eaa85b90", "score": "0.7411724", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}", "title": "" }, { "docid": "39393cf47d222bc854a0bd73eaa85b90", "score": "0.7411724", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}", "title": "" }, { "docid": "39393cf47d222bc854a0bd73eaa85b90", "score": "0.7411724", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}", "title": "" }, { "docid": "39393cf47d222bc854a0bd73eaa85b90", "score": "0.7411724", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}", "title": "" }, { "docid": "39393cf47d222bc854a0bd73eaa85b90", "score": "0.7411724", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}", "title": "" }, { "docid": "39393cf47d222bc854a0bd73eaa85b90", "score": "0.7411724", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}", "title": "" }, { "docid": "39393cf47d222bc854a0bd73eaa85b90", "score": "0.7411724", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}", "title": "" }, { "docid": "39393cf47d222bc854a0bd73eaa85b90", "score": "0.7411724", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}", "title": "" }, { "docid": "39393cf47d222bc854a0bd73eaa85b90", "score": "0.7411724", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}", "title": "" }, { "docid": "39393cf47d222bc854a0bd73eaa85b90", "score": "0.7411724", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}", "title": "" }, { "docid": "39393cf47d222bc854a0bd73eaa85b90", "score": "0.7411724", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}", "title": "" }, { "docid": "39393cf47d222bc854a0bd73eaa85b90", "score": "0.7411724", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}", "title": "" }, { "docid": "39393cf47d222bc854a0bd73eaa85b90", "score": "0.7411724", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}", "title": "" }, { "docid": "39393cf47d222bc854a0bd73eaa85b90", "score": "0.7411724", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}", "title": "" }, { "docid": "39393cf47d222bc854a0bd73eaa85b90", "score": "0.7411724", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}", "title": "" }, { "docid": "39393cf47d222bc854a0bd73eaa85b90", "score": "0.7411724", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}", "title": "" }, { "docid": "39393cf47d222bc854a0bd73eaa85b90", "score": "0.7411724", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}", "title": "" }, { "docid": "39393cf47d222bc854a0bd73eaa85b90", "score": "0.7411724", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}", "title": "" }, { "docid": "39393cf47d222bc854a0bd73eaa85b90", "score": "0.7411724", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}", "title": "" }, { "docid": "39393cf47d222bc854a0bd73eaa85b90", "score": "0.7411724", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}", "title": "" }, { "docid": "39393cf47d222bc854a0bd73eaa85b90", "score": "0.7411724", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}", "title": "" }, { "docid": "72d30767fc0764ad695caa2ec63ec54c", "score": "0.7400327", "text": "function urlFormat(obj) {\n\t // ensure it's an object, and not a string url.\n\t // If it's an obj, this is a no-op.\n\t // this way, you can call url_format() on strings\n\t // to clean up potentially wonky urls.\n\t if (util.isString(obj)) obj = urlParse(obj);\n\t if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n\t return obj.format();\n\t}", "title": "" }, { "docid": "72d30767fc0764ad695caa2ec63ec54c", "score": "0.7400327", "text": "function urlFormat(obj) {\n\t // ensure it's an object, and not a string url.\n\t // If it's an obj, this is a no-op.\n\t // this way, you can call url_format() on strings\n\t // to clean up potentially wonky urls.\n\t if (util.isString(obj)) obj = urlParse(obj);\n\t if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n\t return obj.format();\n\t}", "title": "" }, { "docid": "72d30767fc0764ad695caa2ec63ec54c", "score": "0.7400327", "text": "function urlFormat(obj) {\n\t // ensure it's an object, and not a string url.\n\t // If it's an obj, this is a no-op.\n\t // this way, you can call url_format() on strings\n\t // to clean up potentially wonky urls.\n\t if (util.isString(obj)) obj = urlParse(obj);\n\t if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n\t return obj.format();\n\t}", "title": "" }, { "docid": "72d30767fc0764ad695caa2ec63ec54c", "score": "0.7400327", "text": "function urlFormat(obj) {\n\t // ensure it's an object, and not a string url.\n\t // If it's an obj, this is a no-op.\n\t // this way, you can call url_format() on strings\n\t // to clean up potentially wonky urls.\n\t if (util.isString(obj)) obj = urlParse(obj);\n\t if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n\t return obj.format();\n\t}", "title": "" }, { "docid": "72d30767fc0764ad695caa2ec63ec54c", "score": "0.7400327", "text": "function urlFormat(obj) {\n\t // ensure it's an object, and not a string url.\n\t // If it's an obj, this is a no-op.\n\t // this way, you can call url_format() on strings\n\t // to clean up potentially wonky urls.\n\t if (util.isString(obj)) obj = urlParse(obj);\n\t if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n\t return obj.format();\n\t}", "title": "" }, { "docid": "72d30767fc0764ad695caa2ec63ec54c", "score": "0.7400327", "text": "function urlFormat(obj) {\n\t // ensure it's an object, and not a string url.\n\t // If it's an obj, this is a no-op.\n\t // this way, you can call url_format() on strings\n\t // to clean up potentially wonky urls.\n\t if (util.isString(obj)) obj = urlParse(obj);\n\t if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n\t return obj.format();\n\t}", "title": "" }, { "docid": "72d30767fc0764ad695caa2ec63ec54c", "score": "0.7400327", "text": "function urlFormat(obj) {\n\t // ensure it's an object, and not a string url.\n\t // If it's an obj, this is a no-op.\n\t // this way, you can call url_format() on strings\n\t // to clean up potentially wonky urls.\n\t if (util.isString(obj)) obj = urlParse(obj);\n\t if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n\t return obj.format();\n\t}", "title": "" }, { "docid": "72d30767fc0764ad695caa2ec63ec54c", "score": "0.7400327", "text": "function urlFormat(obj) {\n\t // ensure it's an object, and not a string url.\n\t // If it's an obj, this is a no-op.\n\t // this way, you can call url_format() on strings\n\t // to clean up potentially wonky urls.\n\t if (util.isString(obj)) obj = urlParse(obj);\n\t if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n\t return obj.format();\n\t}", "title": "" }, { "docid": "72d30767fc0764ad695caa2ec63ec54c", "score": "0.7400327", "text": "function urlFormat(obj) {\n\t // ensure it's an object, and not a string url.\n\t // If it's an obj, this is a no-op.\n\t // this way, you can call url_format() on strings\n\t // to clean up potentially wonky urls.\n\t if (util.isString(obj)) obj = urlParse(obj);\n\t if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n\t return obj.format();\n\t}", "title": "" }, { "docid": "72d30767fc0764ad695caa2ec63ec54c", "score": "0.7400327", "text": "function urlFormat(obj) {\n\t // ensure it's an object, and not a string url.\n\t // If it's an obj, this is a no-op.\n\t // this way, you can call url_format() on strings\n\t // to clean up potentially wonky urls.\n\t if (util.isString(obj)) obj = urlParse(obj);\n\t if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n\t return obj.format();\n\t}", "title": "" }, { "docid": "72d30767fc0764ad695caa2ec63ec54c", "score": "0.7400327", "text": "function urlFormat(obj) {\n\t // ensure it's an object, and not a string url.\n\t // If it's an obj, this is a no-op.\n\t // this way, you can call url_format() on strings\n\t // to clean up potentially wonky urls.\n\t if (util.isString(obj)) obj = urlParse(obj);\n\t if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n\t return obj.format();\n\t}", "title": "" }, { "docid": "72d30767fc0764ad695caa2ec63ec54c", "score": "0.7400327", "text": "function urlFormat(obj) {\n\t // ensure it's an object, and not a string url.\n\t // If it's an obj, this is a no-op.\n\t // this way, you can call url_format() on strings\n\t // to clean up potentially wonky urls.\n\t if (util.isString(obj)) obj = urlParse(obj);\n\t if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n\t return obj.format();\n\t}", "title": "" }, { "docid": "72d30767fc0764ad695caa2ec63ec54c", "score": "0.7400327", "text": "function urlFormat(obj) {\n\t // ensure it's an object, and not a string url.\n\t // If it's an obj, this is a no-op.\n\t // this way, you can call url_format() on strings\n\t // to clean up potentially wonky urls.\n\t if (util.isString(obj)) obj = urlParse(obj);\n\t if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n\t return obj.format();\n\t}", "title": "" }, { "docid": "b9e1adeff38f03e17906de3cbbb110b3", "score": "0.73999614", "text": "function urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (typeof obj === 'string') obj = urlParse(obj);\n\n else if (typeof obj !== 'object' || obj === null)\n throw new TypeError(\"Parameter 'urlObj' must be an object, not \" +\n obj === null ? 'null' : typeof obj);\n\n else if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n\n return obj.format();\n}", "title": "" } ]
8a2a81fb08521b3d21c886e18b2e3459
Focuses the list item.
[ { "docid": "fa6887bc9c9fddc7e49f558a556224e8", "score": "0.65629125", "text": "focus() {\n\t\tthis.children.first.focus();\n\t}", "title": "" } ]
[ { "docid": "7aa17574c2182c8913f5fcf9b4d13e3c", "score": "0.70693845", "text": "function changeListItemFocus(itemList) {\r\n\t//If there is an item to focus on\r\n\tif (itemList.length > 0) {\r\n\t\t//Focus on item and scroll to it (presumably there is one item to focus on)\r\n\t\t$('.ui-focus').removeClass('ui-focus');\r\n\t\titemList.addClass('ui-focus');\r\n\t\tscrollToSelectedItem();\r\n\t}\r\n}", "title": "" }, { "docid": "64df63f5cf79fcc92255ee06a3018f4d", "score": "0.7002125", "text": "focus () {\n // focus on first menu item\n if (this.refs[0]) {\n this.refs[0].focus();\n }\n }", "title": "" }, { "docid": "54f36fde8c8bf7fab18962038622cada", "score": "0.6929015", "text": "_handleFocusItem(e){let item=e.detail.moveUp?e.detail.item.previousElementSibling:e.detail.item.nextElementSibling;item.setSelection()}", "title": "" }, { "docid": "fc13dccc8060909e20fcf30461878e43", "score": "0.6884506", "text": "function __menu_focus()\n{\n\tthis.aMenuItems[0].focus();\n}", "title": "" }, { "docid": "2dd2aba7099cc5e3aaa985fb0b48e037", "score": "0.6850662", "text": "focusOnFirstItem () {\n this.openMenu()\n this.activeIndex = 0\n }", "title": "" }, { "docid": "53df67f2801d36b66af601696c1fa403", "score": "0.6760482", "text": "setFocusToItem(newItem) {}", "title": "" }, { "docid": "2c63531c05bc94eb2e5b371d82b6968b", "score": "0.6733922", "text": "focus() {\n // set the focus on the anchor element\n this.template.querySelector('a').focus(); // dispatch a focus event for the menu item component\n\n this.dispatchEvent(new CustomEvent('focus'));\n }", "title": "" }, { "docid": "123ef3e6fc25f42c2112e7e42f6c7163", "score": "0.670915", "text": "focusOnLastItem () {\n this.openMenu()\n this.activeIndex = this.focusableItems.length - 1\n }", "title": "" }, { "docid": "57b6b57869ad131ef5c1cf221f6b5d13", "score": "0.6636256", "text": "function scrollToSelectedItem() {\r\n\tvar selectedItem = $('li.ui-focus');\r\n\r\n\t//If there is an item selected (with ui-focus class)\r\n\tif (selectedItem.length > 0 && selectedItem.offset()) {\r\n\t\t//Scroll to the item\r\n\t\t$('html, body').animate({ scrollTop: selectedItem.offset().top - 100 }, 200);\r\n\t}\r\n}", "title": "" }, { "docid": "f76a9fa659776c0545e5c3b0c5ca10ca", "score": "0.6589912", "text": "static focusItem(el) {\n el.setAttribute(\"tabindex\", \"0\");\n el.focusable = true;\n el.focus();\n }", "title": "" }, { "docid": "dbc52106f820fde9bdec8d50fd3017dc", "score": "0.6586518", "text": "function focusOnInput() {\n listTitleInputElement.focus();\n listTitleInputElement.select();\n}", "title": "" }, { "docid": "8d225cb0e95c2f096348ce9824d2a69b", "score": "0.6565901", "text": "focus() {\n this.getFocusElement().focus();\n }", "title": "" }, { "docid": "88446315516df9e144482e93722e76ff", "score": "0.65328115", "text": "function focus(item)\n{\n if(item)\n {\n item.focus()\n return false;\n }\n else {return true;}\n}", "title": "" }, { "docid": "fa1693683028fd4a87cfbb4a25a4045a", "score": "0.64981186", "text": "function setCurrentLi(ele) {\n current_li = ele;\n current_li.style.backgroundColor = bgColor;\n current_li.focus();\n //current_li.scrollIntoView();\n scrollToMiddle(current_li);\n }", "title": "" }, { "docid": "fea9b9e000888c05d74dfddc591b0a03", "score": "0.6492797", "text": "focus() {\n if (this.isFocusable) {\n DomHelper.focusWithoutScrolling(this.focusElement);\n }\n }", "title": "" }, { "docid": "f047a32ef5fde6aeca544b4bdcdf62e2", "score": "0.6473799", "text": "async setFocus() {\n var _a;\n (_a = (this.selectedItem || this.getItems()[0])) === null || _a === void 0 ? void 0 : _a.focus();\n }", "title": "" }, { "docid": "ac4708396e5b9c4ba9e0fe1f7bd173dc", "score": "0.64486766", "text": "function scrollSelectedItemIntoView() {\n\t\t\t\t\t// Find the popup.\n\t\t\t\t\tvar popupListElement = element.find( \"ul\" );\n\t\t\t\t\t// Scroll it to the top, so that we can then get the correct relative offset for all list items.\n\t\t\t\t\t$( popupListElement ).scrollTop( 0 );\n\t\t\t\t\t// Find the selected list item.\n\t\t\t\t\tvar selectedListElement = $( \"li.active\", popupListElement );\n\t\t\t\t\t// Retrieve offset from the top and height of the list element.\n\t\t\t\t\tvar top = selectedListElement.length ? selectedListElement.position().top : 0;\n\t\t\t\t\tvar height = selectedListElement.length ? selectedListElement.outerHeight( true ) : 0;\n\t\t\t\t\t// Scroll the list to bring the selected list element into the view.\n\t\t\t\t\t$( popupListElement ).scrollTop( top - height );\n\t\t\t\t}", "title": "" }, { "docid": "310e74aab4f632b1632be1b36cd9d0aa", "score": "0.6373258", "text": "function focusNextItem () {\n let focusIndex = _(this).focusIndex + 1;\n if (focusIndex === _(this).items.length) {\n focusIndex = 0;\n }\n\n setFocusedItem.call(this, focusIndex);\n}", "title": "" }, { "docid": "00f57b80fcf3f21149600a80c4c17ef0", "score": "0.63590825", "text": "function focusList() {\n const hasResults = results && results.children;\n\n // focus the first link in the first list item if there are matches\n if (hasResults.length) {\n hasResults[0].firstElementChild.focus();\n }\n }", "title": "" }, { "docid": "3adef480c10f8701ec5ad29bd7b6e6c0", "score": "0.63551074", "text": "focus() {\n this.setFocus(0, 1);\n }", "title": "" }, { "docid": "c66eff5afc3274b275cf1e3f4282d581", "score": "0.63389695", "text": "_setFocusToElement() {\n if (this.type !== 'fit') {\n super._setFocusToElement && super._setFocusToElement();\n return;\n }\n setTimeout(() => {\n const el = this.renderRoot.querySelector(this.autoFocusSelector);\n el && el.focus && el.focus();\n setTimeout(() => {\n el && el.scrollIntoView(false);\n }, 400);\n }, 0);\n }", "title": "" }, { "docid": "14044302c4eeac1424f644f9be0dc3b8", "score": "0.63152456", "text": "setFocusToItem(newItem) {\n let openMenu = false;\n // Close any existing menus.\n this.menuItems.forEach(mbi => {\n if (mbi.domNode.tabIndex === 0) {\n openMenu = mbi.domNode.getAttribute('aria-expanded') === 'true';\n }\n\n mbi.domNode.tabIndex = -1;\n if (mbi.popupMenu) {\n mbi.popupMenu.close();\n }\n });\n\n newItem.domNode.focus();\n newItem.domNode.tabIndex = 0;\n\n if (openMenu && newItem.popupMenu) {\n newItem.popupMenu.open();\n }\n // Focus on the new menu, and open it if the previous menu was open.\n }", "title": "" }, { "docid": "0907524897fc5cd10a288857a425d2f0", "score": "0.6280722", "text": "function __menuitem_focus() \n{\nreturn;\n\n\tvar doc = this.menu.getDocument();\n\tvar table = doc.getElementById(this.id);\n\tdoc.parentWindow.onFocus(table,this.id,this.menu.design);\n\tthis.menu.__curMenuItem = this;\n}", "title": "" }, { "docid": "eaebcb1a33fcc89798bed4732ba02b94", "score": "0.62681746", "text": "_handleFocusItem(e){this.__focusedItem=e.srcElement}", "title": "" }, { "docid": "54114dd06bd2935cdef900f2eead6e48", "score": "0.62537116", "text": "function onItemClick (e) {\n e.stopPropagation();\n\n let index = parseInt(e.currentTarget.getAttribute('data-index'));\n setFocusedItem.call(this, index);\n triggerItemSelected.call(this);\n\n let focusable = getFocusableElement.call(this);\n if (focusable) {\n focusable.focus();\n }\n}", "title": "" }, { "docid": "721ea2549825a8ceb9f71a5ea012eb8a", "score": "0.6162475", "text": "function nextInMenu() {\n var context = currentItem,\n items;\n currentItem.tabIndex = -1;\n while (true) {\n if (visible(context.nextSibling)) {\n context.nextSibling.tabIndex = 0;\n context.nextSibling.focus();\n return\n }\n context = context.nextSibling;\n if (!context) {\n items = findImmediateChildren(currentItem.parentNode, \"li\");\n context = items[0];\n if (visible(context)) {\n context.tabIndex = 0;\n context.focus();\n return\n }\n }\n if (context === currentItem) {\n currentItem.tabIndex = 0;\n break;\n }\n }\n }", "title": "" }, { "docid": "ed09fd31b1bb181b84f46b285324df66", "score": "0.61280835", "text": "function setItemFocus(myItem, itemType)\n{\n if (itemType == \"text\" || \n itemType == \"password\"){ \n document.forms[0].elements[i].select();\n\n } else if(itemType == \"checkbox\" || \n itemType == \"button\" || \n itemType == \"select-one\" ||\n itemType == \"radio\"){\n document.forms[0].elements[i].focus();\n } \n}", "title": "" }, { "docid": "467d8418f2acdf11eb2afa9bd2649d07", "score": "0.61219627", "text": "focus() {\n\t\tthis.element.focus();\n\t}", "title": "" }, { "docid": "e69823fb276d8b589eaee683b4e4180f", "score": "0.61085814", "text": "function WIDGET_MODIFIER_FOCUS$static_(){WidgetWrapperBase.WIDGET_MODIFIER_FOCUS=( WidgetWrapperBase.WIDGET_BLOCK.createModifier(\"focus\"));}", "title": "" }, { "docid": "7909754efe00ec8f397df1fa157b77ae", "score": "0.6101912", "text": "focus() {\n /**\n * Check for the nodes having focus-target attribute inside the element\n * If found, focus the first node (eg, date widget)\n * else, focus the element (eg, text widget)\n */\n let $target = this.$element[0].querySelector('[focus-target]');\n if (!$target) {\n $target = this.$element[0];\n }\n $target.focus();\n }", "title": "" }, { "docid": "b9f6ac7d6c630c025c5a9b28015148c5", "score": "0.60857785", "text": "focusComponent(item, suppressEvent = false) {\n item.focus(suppressEvent);\n }", "title": "" }, { "docid": "83813ef028df8117035074cad138e779", "score": "0.60697895", "text": "function setFocus() {\n ctrl.inputFocused = true;\n\n if (angular.isFunction(ctrl.itemFocusCallback)) {\n ctrl.itemFocusCallback({inputName: ctrl.inputName});\n }\n }", "title": "" }, { "docid": "fca623da1b7b32ce828edcac8f8f8ecf", "score": "0.60654396", "text": "function focusPrevItem () {\n let focusIndex = _(this).focusIndex - 1;\n if (focusIndex < 0) {\n focusIndex = _(this).items.length - 1;\n }\n\n setFocusedItem.call(this, focusIndex);\n}", "title": "" }, { "docid": "8bc39cf9c99f6a84fe4b2f9d89c54918", "score": "0.6038864", "text": "function setFocus(){\n\t\t$('#newItem').val('');\n\t\tdocument.getElementById(\"newItem\").focus();\n\t}", "title": "" }, { "docid": "c99111b6c9dc7c55d6406075b716b8fa", "score": "0.5993879", "text": "focusElement(elem) {\r\n elem.focus();\r\n }", "title": "" }, { "docid": "a253d30b7c7cf5ca751d54a9c3a93d94", "score": "0.59879774", "text": "function Focus() {\n if (Tao.$FocEl) Tao.$FocEl.focus();\n}", "title": "" }, { "docid": "a0a894b47f4393a161f0b8b13a5324e0", "score": "0.5964187", "text": "_hoverViaKeyboard(item) {\n if (!item) {\n return;\n }\n\n const that = this;\n\n item.$.addClass('focus');\n item.setAttribute('focus', '');\n\n that._focusedViaKeyboard = item;\n that._ensureVisible(item);\n }", "title": "" }, { "docid": "0c5c8f696bebe2e5900c0a1e17264582", "score": "0.59577066", "text": "_focusFirstItem(origin) {\n const manager = this._keyManager;\n manager.setFocusOrigin(origin).setFirstItemActive();\n // If there's no active item at this point, it means that all the items are disabled.\n // Move focus to the menu panel so keyboard events like Escape still work. Also this will\n // give _some_ feedback to screen readers.\n if (!manager.activeItem && this._directDescendantItems.length) {\n let element = this._directDescendantItems.first._getHostElement().parentElement;\n // Because the `mat-menu` is at the DOM insertion point, not inside the overlay, we don't\n // have a nice way of getting a hold of the menu panel. We can't use a `ViewChild` either\n // because the panel is inside an `ng-template`. We work around it by starting from one of\n // the items and walking up the DOM.\n while (element) {\n if (element.getAttribute('role') === 'menu') {\n element.focus();\n break;\n }\n else {\n element = element.parentElement;\n }\n }\n }\n }", "title": "" }, { "docid": "b81d9963afbca7a4b081bf2205a8a49d", "score": "0.59415686", "text": "handleFocusIn(_, listItemIndex) {\n if (listItemIndex >= 0) {\n this.adapter.setTabIndexForElementIndex(listItemIndex, 0);\n }\n }", "title": "" }, { "docid": "2195ce939f58cfd3a2d30d652c5598eb", "score": "0.5940912", "text": "focus() {\n this._focusNextField(-1);\n }", "title": "" }, { "docid": "bae0c465b9668fbb852ca840028a39e7", "score": "0.59291416", "text": "function focus_item(id){\n if (focused_item_id) close_details()\n\n focused_item_id = id\n focused_item_history.push(id)\n var item = get_item_details(id)\n var before = get_prerequisites(id)\n var after = get_postrequisites(id)\n\n if (item.done_date) var template = \"item_completed_template\"\n else var template = \"item_details_template\"\n $('#details_panel').html(tmpl(template, {item:item, before:before, after:after}))\n $('#details_panel textarea').elastic()\n}", "title": "" }, { "docid": "13225f6514ffa23279f237baf41f6547", "score": "0.5918083", "text": "focus() {\n const scrollTop = this.scrollTop();\n\n this.editor.focus();\n\n // In webkit, if contenteditable element focus method have been invoked when another input element has focus,\n // contenteditable scroll to top automatically so we need scroll it back\n if (scrollTop !== this.scrollTop()) {\n this.scrollTop(scrollTop);\n }\n }", "title": "" }, { "docid": "a9ca3c23c8f04ebf95319ae6efec9fa7", "score": "0.5911022", "text": "focus() {\n if (!this.focusElement || this.disabled) {\n return;\n }\n\n this.focusElement.focus();\n\n this._setFocused(true);\n }", "title": "" }, { "docid": "34bb99e363480f1553f162e45f1aed09", "score": "0.5896199", "text": "focus() {\n if (!this.focusElement || this.disabled) {\n return;\n }\n\n this.focusElement.focus();\n this._setFocused(true);\n }", "title": "" }, { "docid": "13531c3ce75f78e22ff4f399ea6ef40a", "score": "0.5891507", "text": "focus () {\n this.element.focus()\n }", "title": "" }, { "docid": "2eb9669d9170576cfa064cd71570994a", "score": "0.58752054", "text": "focus() {\n if (!this.selectable) {\n return;\n }\n if (!this.hasFocus) {\n this.elementRef.nativeElement.focus();\n this.onFocus.next({ tag: this });\n Promise.resolve().then(() => {\n this.hasFocus = true;\n this.changeDetectorRef.markForCheck();\n });\n }\n }", "title": "" }, { "docid": "dca817fa1092dc02c0b9c7f597ab2c65", "score": "0.58722705", "text": "next() {\n\t\tthis.gotoItem(this.currentItem + this.slideToScroll);\n\t}", "title": "" }, { "docid": "7305f30e7cab6e1578502cf6e741322d", "score": "0.5870896", "text": "function doItem() {\n this.className = \"edit\";\n var input = this.querySelector(\"input\");\n input.focus();\n input.setSelectionRange(0, input.value.length);\n}", "title": "" }, { "docid": "5bb102f6a7017e093bfd32a16c927301", "score": "0.5870322", "text": "function lvItemInvoked(e) {\n containerDescriptionsHelp.scrollTop = 0;\n // window.scrollTo(0);\n var selectedItemProperties;\n var _currentIndex;\n e.detail.itemPromise.done(function (item) {\n _currentItemInvoked = item;\n _indexPreviousPage = _currentItemInvoked.index;\n _updatePageView();\n _showDetailsPages();\n })\n }", "title": "" }, { "docid": "78a9bfcfec032a563a107e8cd90ac481", "score": "0.5854101", "text": "focusNextItem(key) {\n const { focusIndex } = this.state;\n const { options } = this.props;\n\n let currIndex = focusIndex;\n\n if (key == 1) { // UP key was pressed\n currIndex--;\n if (currIndex < 0) {\n currIndex = options.length - 1;\n }\n } else { // DOWN key was pressed\n currIndex++;\n if (currIndex == options.length) {\n currIndex = 0;\n }\n }\n\n this.setState({ focusIndex: currIndex });\n this.dropdownRef.current.querySelector(`[data-index=\"${currIndex}\"]`).scrollIntoView(false); // makes sure focused item is visible\n }", "title": "" }, { "docid": "dd10815228ace5eba169f46af6147473", "score": "0.5847223", "text": "focusFirstElement() {\n this.trapFocus();\n }", "title": "" }, { "docid": "3ca43de881930275dc511119eb6a69b1", "score": "0.5816204", "text": "onKeyboardClick() {\n let liElementsArray = new Array();\n\n for (var i = 0; i < this.listEl.length; i++) {\n liElementsArray[i] = this.listEl[i].firstElementChild;\n }\n\n var focusedElement = document.activeElement,\n index = liElementsArray.indexOf(focusedElement);\n if (index >= 0) {\n //check if the clicked key is up arrown or down arrow\n if (e.keyCode == 40) {\n //check if it is not the last element in the list\n if (focusedElement.parentNode.nextElementSibling) {\n var nextNode = focusedElement.parentNode.nextElementSibling.firstElementChild;\n nextNode.focus();\n } else {\n this.listEl[0].firstElementChild.focus();\n }\n }\n if (e.keyCode == 38) {\n if (focusedElement.parentNode.previousElementSibling) {\n var previousNode = focusedElement.parentNode.previousElementSibling.firstElementChild;\n previousNode.focus();\n } else {\n locales.lastElementChild.firstElementChild.focus();\n }\n }\n }\n }", "title": "" }, { "docid": "bdb8ec6b140718b3d64da2f3056de7f5", "score": "0.5801643", "text": "_setFocusToFirstElement() {\n let focusableChildren = this._getFocusableElements();\n if (focusableChildren.length) {\n focusableChildren[0].focus();\n }\n }", "title": "" }, { "docid": "a20eceb20d9beee231b9f9d0f25fbe7b", "score": "0.5766719", "text": "focus() {\n this.getInputElement().focus();\n }", "title": "" }, { "docid": "70ed6a86a44d170d0da59d432669a115", "score": "0.5766657", "text": "function setFocusObject(index) {\n $('#object_list').val(index);\n setFocusBox(index);\n}", "title": "" }, { "docid": "358cb41f3fd96524507be2602d92cd00", "score": "0.57620436", "text": "_setTabFocus(tabIndex) {\n if (this._showPaginationControls) {\n this._scrollToLabel(tabIndex);\n }\n if (this._items && this._items.length) {\n this._items.toArray()[tabIndex].focus();\n // Do not let the browser manage scrolling to focus the element, this will be handled\n // by using translation. In LTR, the scroll left should be 0. In RTL, the scroll width\n // should be the full width minus the offset width.\n const containerEl = this._tabListContainer.nativeElement;\n const dir = this._getLayoutDirection();\n if (dir == 'ltr') {\n containerEl.scrollLeft = 0;\n }\n else {\n containerEl.scrollLeft = containerEl.scrollWidth - containerEl.offsetWidth;\n }\n }\n }", "title": "" }, { "docid": "358cb41f3fd96524507be2602d92cd00", "score": "0.57620436", "text": "_setTabFocus(tabIndex) {\n if (this._showPaginationControls) {\n this._scrollToLabel(tabIndex);\n }\n if (this._items && this._items.length) {\n this._items.toArray()[tabIndex].focus();\n // Do not let the browser manage scrolling to focus the element, this will be handled\n // by using translation. In LTR, the scroll left should be 0. In RTL, the scroll width\n // should be the full width minus the offset width.\n const containerEl = this._tabListContainer.nativeElement;\n const dir = this._getLayoutDirection();\n if (dir == 'ltr') {\n containerEl.scrollLeft = 0;\n }\n else {\n containerEl.scrollLeft = containerEl.scrollWidth - containerEl.offsetWidth;\n }\n }\n }", "title": "" }, { "docid": "7644ae4b70b009a79d3307fd53ebb956", "score": "0.57567483", "text": "focus() {\r\n if (this.hasFocus) {\r\n return;\r\n }\r\n\r\n const field = this.fields[0];\r\n if (!field) {\r\n return;\r\n }\r\n field.focus();\r\n }", "title": "" }, { "docid": "74d2232328f07cbcbd16a36c3e09d38e", "score": "0.5756388", "text": "function _focus5(elm) {\n if (isFunction(elm['setActive'])) {\n elm['setActive']();\n } else {\n elm.focus({\n preventScroll: true\n });\n }\n}", "title": "" }, { "docid": "045ba867442b9b05cffd79932c98ff73", "score": "0.5751251", "text": "focus () {\n this.trigger('focus:pre')\n\n this.performFocus()\n\n this.trigger('focus:post')\n }", "title": "" }, { "docid": "82acf358ebbc2401b2b7b9fef6bfcd25", "score": "0.574775", "text": "focusOnParentComponent(focusElement) {\n focusElement.focus();\n }", "title": "" }, { "docid": "df45935c467e794050f60c4bc0b022df", "score": "0.57459617", "text": "focus() {\n if (this.disabled) {\n return;\n }\n // TODO: ARIA says this should focus the first `selected` tag if any are selected.\n // Focus on first element if there's no tagInput inside tag-list\n if (this.tagInput && this.tagInput.focused) {\n // do nothing\n }\n else if (this.tags.length > 0) {\n this.keyManager.setFirstItemActive();\n this.stateChanges.next();\n }\n else {\n this.focusInput();\n this.stateChanges.next();\n }\n }", "title": "" }, { "docid": "9ad7fd74c51eed77cc1a7bcf4794abab", "score": "0.5742842", "text": "focus() {\n this.input.current.focus();\n this._handleFocus();\n }", "title": "" }, { "docid": "5db6ad068a4be5812cdba8e26bbd1449", "score": "0.5736767", "text": "function setFocusTimeout(item) {\n var focusTimeout = window.setTimeout(focusOnCloseBtn, 500);\n function focusOnCloseBtn() {\n $($(item).attr('data-target')).find('.modal-header').find('button').focus();\n clearTimeout(focusTimeout);\n }\n}", "title": "" }, { "docid": "e87fff0f4bc46341811e9ba4125614a1", "score": "0.5735289", "text": "_levelOneOpenDropDown(focusedItem) {\n if (focusedItem && focusedItem instanceof Smart.MenuItemsGroup) {\n this._selectionHandler({ target: focusedItem, isTrusted: true });\n }\n }", "title": "" }, { "docid": "bb3b9aab3bd8acfe8a0380e842c9dd52", "score": "0.57306564", "text": "@api\n focus() {\n if (this.input) this.input.focus();\n }", "title": "" }, { "docid": "182cfe2b5d739bbcd4772f09b4c4cbe5", "score": "0.5730128", "text": "function setFocus(){\n // var m=$('#menuItems a').on(\"click\",function(element){\n // console.log(\"mamas cacaroto\")\n // var as=$('#menuItems .selected').removeClass(\"focus\");\n // // if(as.length>0)\n // // {\n // // for (var r in as) {\n // // as[r].removeClass(\"focus\");\n // // }\n // // }\n // element.addClass(\"focus\");\n // });\n\n // for(var i in m){\n // m[i].click(focus);\n\n // }\n}", "title": "" }, { "docid": "b4a7d281a0a15c42439027ed578d3a72", "score": "0.5726524", "text": "focus() {\n this.observer.ignore(() => {\n focusPreventScroll(this.contentDOM);\n this.docView.updateSelection();\n });\n }", "title": "" }, { "docid": "5328eb4fe26b6a987c7725aae710be0a", "score": "0.57260567", "text": "function initFocuses() \n{\n\t$('input.get-focus').focus();\n}", "title": "" }, { "docid": "206f719883c8a396c598a992dea69eef", "score": "0.5725577", "text": "scrollItemIntoViewIfNeeded(prevProps) {\n const { selectingWithMouse } = this\n this.selectingWithMouse = null\n if (this.props.autocomplete.selectedIndex !== prevProps.autocomplete.selectedIndex) {\n if (selectingWithMouse === this.props.autocomplete.selectedIndex) {\n // Don't auto-scroll if user is mousing over list.\n // TODO: Less hacky solution\n return\n }\n\n const selectedItem = this.refs[this.props.autocomplete.selectedIndex],\n element = selectedItem && ReactDOM.findDOMNode(selectedItem)\n if (element)\n element.scrollIntoViewIfNeeded() \n\n }\n }", "title": "" }, { "docid": "c8d2d4f9bf8f09b8911f403c9371b1f3", "score": "0.57204837", "text": "function setTocFocus() {\n var tocWnd = this;\n var imgObj = null ;\n var aObj = null ;\n\n if (curSelection > 0) {\n imgObj = eval('tocWnd.document.IMG' + curSelection ) ;\n if (imgObj.src.indexOf(folderUnselected)!=-1) {\n imgObj.src = folderSelected ;\n }\n else {\n if (imgObj.src.indexOf(documentUnselected)!=-1) {\n imgObj.src = documentSelected ;\n }\n }\n if (navigator.appName.indexOf(\"Microsoft\") != -1) {\n // IE\n imgObj.scrollIntoView();\n }\n\telse if (document.getElementById)\n\t{\n\t\tvar maxLen = tocWnd.document.anchors.length ;\n for (var n=curSelection; n<maxLen; n++) {\n var aName = tocWnd.document.anchors[n].name ;\n\t\t\n if (aName == \"A\"+curSelection || aName == \"a\"+curSelection) {\n\t\t\t//alert(aName +\" \"+ n);\n\t\t\tvar y=0;\n aObj = tocWnd.document.anchors[n] ;\n\t\t //alert(aObj.y);\n //aObj.focus(+0,+200);\n\t\t //alert(aObj.style.left) ;\n\t\t //alert(imgObj.style.posTop) ;\n\t\t while(aObj){\n\t\t\ty+=aObj.offsetTop;\n\t\t\taObj=aObj.offsetParent;\n\t\t\t}\n\t\t\t//alert(y);\n\t\t\ttocWnd.scrollTo(0,y-50);\n\t}\n\t }\n\t}\n else {\n // Netscape: find corresponding anchor\n //var a = tocWnd.document.anchors[curSelection]; // WRONG if a Name not sequential !\n //if (a.name == \"A\"+curSelection) {\n // tocWnd.scrollTo(0, a.y-50) ;\n //}\n var maxLen = tocWnd.document.anchors.length ;\n for (var n=curSelection; n<maxLen; n++) {\n var aName = tocWnd.document.anchors[n].name ;\n if (aName == \"A\"+curSelection || aName == \"a\"+curSelection) {\n aObj = tocWnd.document.anchors[n] ;\n tocWnd.scrollTo(0, aObj.y-50) ;\n break ;\n }\n }\n }\n }\n else {\n tocWnd.scrollTo(0, 0) ;\n }\n}", "title": "" }, { "docid": "f0dcd34e47f7d17ee8e9a5cc32818929", "score": "0.57088935", "text": "focus(options) {\n this._elementRef.nativeElement.focus(options);\n }", "title": "" }, { "docid": "f0dcd34e47f7d17ee8e9a5cc32818929", "score": "0.57088935", "text": "focus(options) {\n this._elementRef.nativeElement.focus(options);\n }", "title": "" }, { "docid": "f0dcd34e47f7d17ee8e9a5cc32818929", "score": "0.57088935", "text": "focus(options) {\n this._elementRef.nativeElement.focus(options);\n }", "title": "" }, { "docid": "39a853ea535d42668efe022d22f90d75", "score": "0.5705642", "text": "focus() {\n this.focusOnButton();\n }", "title": "" }, { "docid": "102e0ca8186beb0c6a332b0e7282b58d", "score": "0.57050526", "text": "function focusInputElement() {\n elements.input.focus();\n }", "title": "" }, { "docid": "d88c33cbb7b2d5d19e5ec4cae6be60a6", "score": "0.5702167", "text": "focus(options) {\n this._element.nativeElement.focus(options);\n }", "title": "" }, { "docid": "d88c33cbb7b2d5d19e5ec4cae6be60a6", "score": "0.5702167", "text": "focus(options) {\n this._element.nativeElement.focus(options);\n }", "title": "" }, { "docid": "d88c33cbb7b2d5d19e5ec4cae6be60a6", "score": "0.5702167", "text": "focus(options) {\n this._element.nativeElement.focus(options);\n }", "title": "" }, { "docid": "10e44add7d2d9ed03af11863dfa10c1d", "score": "0.56990695", "text": "focus() {\n this.observer.ignore(() => {\n focusPreventScroll(this.contentDOM);\n this.docView.updateSelection();\n });\n }", "title": "" }, { "docid": "8695c7e0611bcdbee58d63ec9f817a4d", "score": "0.5694304", "text": "focus() {\n this.observer.ignore(() => {\n focusPreventScroll(this.contentDOM);\n this.docView.updateSelection();\n });\n }", "title": "" }, { "docid": "689ccf355034c16400260dea47892828", "score": "0.56939137", "text": "focus() {\n this._elementRef.nativeElement.focus();\n }", "title": "" }, { "docid": "db061a341b632044f154c3c94de8ea5c", "score": "0.5690414", "text": "function focusFirst( list, throughTab ) {\n\t\t\t\t\t\t\tfor ( i1 = 0; i1 < list.length; i1++ ) {\n\t\t\t\t\t\t\t\tvar item = list[ i1 ];\n\t\t\t\t\t\t\t\titem.parentNode.classList.remove( \"active\" );\n\n\t\t\t\t\t\t\t\t// DO NOT THAT THROUGH TAB COMMANDS\n\t\t\t\t\t\t\t\tif ( i1 == 0 && !throughTab ) {\n\t\t\t\t\t\t\t\t\titem.focus();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}", "title": "" }, { "docid": "db061a341b632044f154c3c94de8ea5c", "score": "0.5690414", "text": "function focusFirst( list, throughTab ) {\n\t\t\t\t\t\t\tfor ( i1 = 0; i1 < list.length; i1++ ) {\n\t\t\t\t\t\t\t\tvar item = list[ i1 ];\n\t\t\t\t\t\t\t\titem.parentNode.classList.remove( \"active\" );\n\n\t\t\t\t\t\t\t\t// DO NOT THAT THROUGH TAB COMMANDS\n\t\t\t\t\t\t\t\tif ( i1 == 0 && !throughTab ) {\n\t\t\t\t\t\t\t\t\titem.focus();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}", "title": "" }, { "docid": "ad09ae91b350f2feef055ebcb4290e26", "score": "0.5685855", "text": "function setFocus (idramo, idseccion) {\n $(\".section-simulator-\" + idramo + \"-\" + idseccion + ' > li').addClass(\"section-selected\")\n console.log(idramo)\n $(\".ramo-\" + idramo + ' > a').addClass(\"section-selected\")\n}", "title": "" }, { "docid": "d37066bcab55401f1de6e1a71d90a12c", "score": "0.5685002", "text": "focus() {\n this.content.querySelector('button').focus();\n }", "title": "" }, { "docid": "66540aa30d64e9a075f519838ea3f3e2", "score": "0.5677257", "text": "function focusInputElement () {\n elements.input.focus();\n }", "title": "" }, { "docid": "66540aa30d64e9a075f519838ea3f3e2", "score": "0.5677257", "text": "function focusInputElement () {\n elements.input.focus();\n }", "title": "" }, { "docid": "66540aa30d64e9a075f519838ea3f3e2", "score": "0.5677257", "text": "function focusInputElement () {\n elements.input.focus();\n }", "title": "" }, { "docid": "2800eb6b785bcf6f466d5a66ca2cd9a4", "score": "0.56744426", "text": "function setFocus(elem) {\n var childList = elem.childNodes,\n length = childList.length,\n child;\n for (var i = 0; i < length; i++) {\n child = childList[i];\n if (child.nodeType === 1 && child.tagName.toLowerCase() === 'a') {\n child.focus();\n break;\n }\n }\n }", "title": "" }, { "docid": "451277af3de489e7a245b64727c3f8b0", "score": "0.56714314", "text": "setFocusedElement(activeIndex = this.activeIndex) {\n var _a;\n\n this.activeIndex = activeIndex;\n this.setFocusableElements();\n (_a = this.focusableElements[this.activeIndex]) === null || _a === void 0 ? void 0 : _a.focus();\n }", "title": "" }, { "docid": "e00cf7be4ca9b602e19b4f64983bab65", "score": "0.566946", "text": "_setFocusedOption(option) {\n this._keyManager.updateActiveItem(option);\n }", "title": "" }, { "docid": "e00cf7be4ca9b602e19b4f64983bab65", "score": "0.566946", "text": "_setFocusedOption(option) {\n this._keyManager.updateActiveItem(option);\n }", "title": "" }, { "docid": "1a065426475637769fd1df1d0eeeea1f", "score": "0.56662846", "text": "function setFocus(elem) {\n var childList = elem.childNodes,\n length = childList.length,\n child;\n for(var i = 0; i < length; i++) {\n child = childList[i];\n if(child.nodeType === 1 && child.tagName.toLowerCase() === 'a') {\n child.focus();\n break;\n }\n }\n }", "title": "" }, { "docid": "de6d87526ac38b2cd3fd0743558da908", "score": "0.56622624", "text": "focus() {\n this.elementRef.nativeElement.focus();\n }", "title": "" }, { "docid": "de6d87526ac38b2cd3fd0743558da908", "score": "0.56622624", "text": "focus() {\n this.elementRef.nativeElement.focus();\n }", "title": "" }, { "docid": "de6d87526ac38b2cd3fd0743558da908", "score": "0.56622624", "text": "focus() {\n this.elementRef.nativeElement.focus();\n }", "title": "" }, { "docid": "de6d87526ac38b2cd3fd0743558da908", "score": "0.56622624", "text": "focus() {\n this.elementRef.nativeElement.focus();\n }", "title": "" }, { "docid": "de6d87526ac38b2cd3fd0743558da908", "score": "0.56622624", "text": "focus() {\n this.elementRef.nativeElement.focus();\n }", "title": "" }, { "docid": "3e19e29bb69f139bb4cf5dc546fb0a2d", "score": "0.564792", "text": "function focusInputElement () {\n\t elements.input.focus();\n\t }", "title": "" } ]
ef15d6826486f68b69dc56262eca7ab6
Function gets current time and invokes the view to reset the chatbox
[ { "docid": "0e2ff0daf2c13b512b176014a6f62669", "score": "0.72537154", "text": "clearChatMessages() {\n let currentTime = this.getTime(new Date());\n this.view.clearChatMessages(currentTime);\n }", "title": "" } ]
[ { "docid": "0a525abb7013f66027817f8c5068a5a6", "score": "0.69788855", "text": "function handleResetChat() {\n\t\t\t\tdocument.getElementById('div_chat').innerHTML = '';\n\t\t\t\tgetChatText();\n\t\t\t}", "title": "" }, { "docid": "b006ac24c519cf4673aefb578a0c51dc", "score": "0.6622595", "text": "function setChatTime(time) {\n if (typeof sWOTrackPage == 'function') {\n sWOTrackPage();\n setTimeout(\"ShowChatLink()\", 3000)\n }\n }", "title": "" }, { "docid": "7c734512b4db94165c41dd68c3488f6b", "score": "0.65524554", "text": "function resetChat() {\n\t\t\t$(\"#conversation\").empty();\n\t\t}", "title": "" }, { "docid": "531c144e4a5a52577b39c3d9a3324d87", "score": "0.63441855", "text": "async clearChat() {\n // TODO empty chat\n }", "title": "" }, { "docid": "f411c3a190f1a92c058a20ff310999d6", "score": "0.62753725", "text": "function updatechat(roomid) {\r\n //TODO: set a user variable \"current Room\" to the value specified.\r\n //reload page\r\n showLastMessages(10, 0, roomid);\r\n}", "title": "" }, { "docid": "e524a30694f87913322818ddab4300ad", "score": "0.6262012", "text": "function reset_chat() {\n // remove the chat room buttons\n chatrooms_added['team'].forEach(function(chat_room) {\n document.getElementById(\"chatroom_\" + chat_room).remove();\n })\n chatrooms_added['private'].forEach(function(chat_room) {\n document.getElementById(\"chatroom_\" + chat_room).remove();\n })\n\n // remove old messages\n var mssgs_container = document.getElementById(\"messages\");\n while (mssgs_container.firstChild) {\n mssgs_container.removeChild(mssgs_container.firstChild);\n }\n\n // reset the vars\n chatrooms_added = {\n \"global\": null,\n \"team\": [],\n \"private\": []\n };\n all_chatrooms = {};\n current_chatwindow = {\n 'name': 'global',\n 'type': 'global'\n };\n messages = {};\n}", "title": "" }, { "docid": "17274b06b0d8c8ffa8580f702d991431", "score": "0.6241747", "text": "function clearTime() {\n displayTime = 0;\n renderTime();\n}", "title": "" }, { "docid": "ccdc49c45a1fc973734c3923d8ecda74", "score": "0.6196022", "text": "function setTime(){\n\n\n\n }", "title": "" }, { "docid": "b855edf2bae5611481f187c7a8626d4d", "score": "0.6184549", "text": "function updateTime() {\n\tvar quantity = 0; // the quantity of units until the chatroom opens\n\tvar units = \"\"; // the units that the quantity is measured with\n\t\n\tvar now = (new Date().getTime()) / 1000; // get the current timestamp\n\tvar difference = (timestamp - now) / 60; // get the difference in minutes until the next game\n\t\n\tif (difference <= 0) { // if the chatroom has opened\n\t\twindow.location = \"http://chat.lyon-forums.com\"; // refresh the page so that the user is redirected into the chatroom\n\t} else if (difference <= 1) { // if a minute remains\n\t\tquantity = Math.ceil(difference); // copy the difference in minutes\n\t\tunits = \"minute\"; // the units is a minute\n\t} else if (difference <= 59) { // if less than an hour remains\n\t\tquantity = Math.ceil(difference); // copy the difference in minutes\n\t\tunits = \"minutes\"; // a number of minutes remain\n\t} else { // an hour or more remains until the chatroom is open\n\t\tdifference = Math.round(difference / 60); // deal with hours\n\t\tquantity = difference; // copy the difference in hours\n\t\tif (difference <= 1) { // if an hour remains\n\t\t\tunits = \"hour\"; // the unit is an hour\n\t\t} else {\n\t\t\tunits = \"hours\"; // the unit is in hours\n\t\t}\n\t}\n\t\n\t$(\"[name=time]\").text(quantity + \" \" + units); // update the remaining time\n}", "title": "" }, { "docid": "e730b33f464ac8e9dcc2bcc5ce60f6f2", "score": "0.6181886", "text": "function reset() {\n workTime = true;\n clockPaused = true;\n firstSession = true;\n wTime = 25;\n bTime = 5;\n t = wTime;\n minutes = t;\n seconds = 0;\n updateDisplay();\n}", "title": "" }, { "docid": "266c55d7ec9a4ba42af8d8daca111df0", "score": "0.6179598", "text": "function initChat() {\r\n\r\n\tchatInput.clear();\r\n\tchatInput.cycle();\r\n\tchat.join(\"#main\");\r\n}", "title": "" }, { "docid": "a4f00d6ef79789b2313f275aadb84a60", "score": "0.61570543", "text": "function reset() {\n resetTimer();\n refresh();\n }", "title": "" }, { "docid": "002f739434e7d7bca06f614428afea33", "score": "0.6154273", "text": "function resetTime(output){\n var currentDate = new Date();\n if(TimeTracker !==null){\n clearInterval( TimeTracker );\n }\n seconds = 0;\n $(output).html(\"<b>\" + seconds + \"</b>\" + \" <a>s</a>\" + \" : \" + \"<a> 00 </a>\" ); \n }", "title": "" }, { "docid": "e4cbf39a22550204e6a18dbb705b4736", "score": "0.6151075", "text": "function handleResetClick(){\n setTime({\n hours: 0,\n minutes: 0\n });\n setReset(0);\n }", "title": "" }, { "docid": "3edc3ad919124f758f05987a6e8106be", "score": "0.61016226", "text": "function resetChat() {\n\t\t\t\tif (sendReq.readyState == 4 || sendReq.readyState == 0) {\n\t\t\t\t\tsendReq.open(\"POST\", 'getChat.php?chat=1&last=' + lastMessage, true);\n\t\t\t\t\tsendReq.setRequestHeader('Content-Type','application/x-www-form-urlencoded');\n\t\t\t\t\tsendReq.onreadystatechange = handleResetChat; \n\t\t\t\t\tvar param = 'action=reset';\n\t\t\t\t\tsendReq.send(param);\n\t\t\t\t\tdocument.getElementById('txt_message').value = '';\n\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t}", "title": "" }, { "docid": "7e579274b25779e23b1f45e1004a47be", "score": "0.6062774", "text": "function scriviMessaggio() {\r\n // clono il codice html del mio modello per i messaggi della chat\r\n var template = $('.tonotshow .messaggio').clone();\r\n\r\n // prendo il valore del messaggio scritto dall utente\r\n var mioValore = $('.inviotesto input').val();\r\n\r\n // Creo delle variabili per il timestamp\r\n var orario = new Date();\r\n var ora = orario.getHours();\r\n var minuti = orario.getMinutes();\r\n var oraCorrente = aggiungiZero(ora) + ':' + aggiungiZero(minuti);\r\n\r\n // Se il messaggio è diverso da '' allora procedere al invio del messaggio\r\n if (mioValore != '') {\r\n template.children('p').prepend(mioValore);\r\n template.find('span').text(oraCorrente);\r\n template.addClass('greeny');\r\n $('.main-chat .single-chat.active').append(template);\r\n\r\n // funzione che permette di scrollare in giu automaticamente la finestra della chat\r\n $('.main-chat').scrollTop($('.main-chat').prop('scrollHeight'));\r\n // svuoto il valore dell input\r\n $('input').val('');\r\n\r\n // Ottengo 'Ok' come risposta ogni volta che scrivo qualcosa in chat dopo un intervallo di 1 secondo\r\n setTimeout(function() {\r\n template = $('.tonotshow .messaggio').clone();\r\n var valoreWhite = 'ok';\r\n template.children('p').prepend(valoreWhite);\r\n template.find('span').text(oraCorrente);\r\n template.addClass('white');\r\n $('.main-chat .single-chat.active').append(template);\r\n $('.main-chat').scrollTop($('.main-chat').prop('scrollHeight'));\r\n }, 1000);\r\n }\r\n}", "title": "" }, { "docid": "f0c7cd896c3be9b895c7c8e7c7f09c1e", "score": "0.6021583", "text": "function reset() {\n\n window.clearInterval(interval);\n seconds = 0;\n minutes = 0;\n document.getElementById(\"display\").innerHTML = \"00:00\";\n\n }", "title": "" }, { "docid": "49ad0029f86b5114bbece924264b8262", "score": "0.6009309", "text": "function reset() {\n time = 15;\n $(\"#timerDisplay\").text(\"00:15\");\n $(\"#question\").text(\"\");\n $(\"#firstAnswer\").text(\"\");\n $(\"#secondAnswer\").text(\"\");\n $(\"#thirdAnswer\").text(\"\");\n $(\"#fourthAnswer\").text(\"\");\n stop()\n}", "title": "" }, { "docid": "af78cd47c1beaddcecb24de80801b7a4", "score": "0.59993553", "text": "function Clearup(){\n //TO DO:\n EventLogout();\n App.Timer.ClearTime();\n }", "title": "" }, { "docid": "6ab8e9807a0120dd8e46cb27c2eb1c67", "score": "0.5997382", "text": "function sendMessage() {\n timeEl.textContent = \" Time Over!! \"; \n resultsBox.textContent = \"\";\n questionBox.textContent = \"\";\n choicesBox.textContent = \"\";\n feedback.textContent = \"\";\n}", "title": "" }, { "docid": "acdf12856b2740b84291cf052ebc9d8a", "score": "0.5996256", "text": "function sendmsg(){\n\n var time = new Date();\n var ora = time.getHours();\n var minuti = time.getMinutes();\n var lastmsg = ora + '.' + minuti;\n\n var messaggio = $('.msg input').val();\n var msgelementsend = $('.template .send').clone();\n var msgelementreceived = $('.template .received').clone();\n var newmsg = msgelementsend.children('p').text(messaggio);\n var newtime = msgelementsend.children('.time').text(lastmsg);\n var newtimerec = msgelementreceived.children('.time').text(lastmsg);\n\n $('.chat.active').append(msgelementsend);\n\n\n\n\n setTimeout(function (){\n var answ = msgelementreceived.children('p').text('non ora');\n var newansw = $('.chat.active').append(msgelementreceived);\n\n }, 1000);\n\n\n\n messaggio= $('.msg input').val('');\n\n\n\n\n\n\n}", "title": "" }, { "docid": "980e192891f1c9d60a87d5677e23a285", "score": "0.59961945", "text": "function refreshTime(){\n\ttimebox.innerHTML=getTime();\n}", "title": "" }, { "docid": "1e213898c8e0d4f86df54eb4c774e4e1", "score": "0.5987742", "text": "function reset(){\r\n if (confirm(\"Do you want to reset time?\") == true){\r\n window.clearInterval(interval);\r\n seconds = 0;\r\n minutes = 0;\r\n hours = 0;\r\n document.getElementById(\"display\").innerHTML = \"00:00:00\";\r\n status=\"stopped\"}\r\n}", "title": "" }, { "docid": "47f51baa1893fd475776d729b2615fa1", "score": "0.5972765", "text": "function updateClockHome() {\n\t\tclearInterval(window.interval);\n\t\tvar date = new Date(Date.now());\n\t\tvar timestr = date.toLocaleTimeString();\n\t\t$scope.$apply(function () {\n\t\t\t$scope.Time = timestr;\n\t\t});\n\t}", "title": "" }, { "docid": "a5c80da569745e9bd23c288cfc4ebe60", "score": "0.5962284", "text": "resetTime() {\n const { bookingView } = this.props;\n this.state.id = '';\n this.state.label = '';\n this.state.end = -1;\n bookingView.setEndTime(this.state.end);\n }", "title": "" }, { "docid": "d24dfe07eeca2192a3ada2b74717fee6", "score": "0.59409344", "text": "function reset() {\n setSeconds(60);\n setIsActive(false);\n }", "title": "" }, { "docid": "e8193e3007b99e0c8ce69c58564674f1", "score": "0.5936462", "text": "function refreshTime(){\n\n\n //get the now time and set milliseconds to 0\n var now = new Date();\n now.setMilliseconds(0);\n\n //refresh the clock model\n $scope.now = time.getHMS(now);\n $scope.now.date = now;\n\n\n if($scope.meeting.status === 'now'){\n if( $scope.startInit === false ){\n dom.panel.off();\n $scope.startInit = true;\n }\n\n //refresh meeting progress bar's percentage\n $scope.meeting.progressPercentage = time.percentage(\n time.duration( $scope.meeting.startDate, now ),\n time.duration( $scope.meeting.startDate, $scope.meeting.endDate )\n );\n\n //refresh the remaining time of current event\n $scope.nowEvent.remaining.h = time.duration( now, $scope.nowEvent.endDate)[0];\n $scope.nowEvent.remaining.m = time.duration( now, $scope.nowEvent.endDate)[1];\n $scope.nowEvent.remaining.s = time.duration( now, $scope.nowEvent.endDate)[2];\n }\n\n\n\n if($scope.meeting.status === 'uninitiated')\n\n //refresh panel message with how long later will the meeting begin\n $scope.panelMessage = app_data.panel.meeting_messages[0] + ' after ' +\n $filter('x2')(time.duration( now, $scope.meeting.startDate )[0]) + ':' +\n $filter('x2')(time.duration( now, $scope.meeting.startDate )[1]) + ':' +\n $filter('x2')(time.duration( now, $scope.meeting.startDate )[2]);\n\n if($scope.listeners.time) watcher.time();\n }", "title": "" }, { "docid": "f10d8ad49bdb3e327e5e658089106acb", "score": "0.59332305", "text": "function cal() {\n time -= 1;\n if (time === 0) {\n clearInterval(timer);\n $$(\".time\").html('还剩下:' + '0' + '分钟');\n\n myApp.alert('时间到,没能完成测试', '');\n mainView.router.loadPage('index.html');\n $(\".toolbar-inner\").fadeIn('500');\n } else {\n $$(\".time\").html('还剩下:' + parseInt(time) + '分钟');\n }\n }", "title": "" }, { "docid": "8c8d341108108efe67111b91931d5a97", "score": "0.59315866", "text": "function resetTime() {\n\tstopTimer();\n\ttimerOff = true;\n\ttime = 0;\n\tdisplayTime();\n}", "title": "" }, { "docid": "6c7b388c1613e79d5f5ff3ede844cc77", "score": "0.5925872", "text": "function resetClockAndTime() {\n stopClock();\n clockOff = true;\n time = 0;\n displayTime();\n}", "title": "" }, { "docid": "acd9fa0abb7901ef1c8069e142c180f1", "score": "0.5914945", "text": "function setTime() {\n displayTime = 75;\n renderTime();\n}", "title": "" }, { "docid": "19525ebe9a38feb9c092225dd247c667", "score": "0.59088427", "text": "function reset() {\n clearInterval($interval);\n $.countUpTimer.running = false;\n $.countUpTimer.passed = 0;\n updateDisplay([[0,0],[0,0],[0,0]]);\n }", "title": "" }, { "docid": "7e8a69a35a5bc36f5d359fa5c21b488f", "score": "0.5889043", "text": "winningMessage(){ \n document.querySelector(\".lightBox\").style.display = \"block\";\n if(minute === 0){\n document.getElementsByClassName(\"timerToMessage\")[0].innerHTML = ` ${second-1} sec`; //-1 sec because of the setTimeout\n }else{\n document.getElementsByClassName(\"timerToMessage\")[0].innerHTML = ` ${minute} min ${second-1} sec`;//-1 sec because of the setTimeout\n }\n }", "title": "" }, { "docid": "08749ff54a8627fdb00d33a7ad3d1876", "score": "0.58883405", "text": "function reset(){\n currentDigit = 0;\n currentCaptcha = generateNumberCaptcha(self.getState().numDigits);\n refreshDisplay();\n window.clearTimeout(timerIntervalId); // assuming it doesn't hurt should timerInvervalId not be init'ed.\n timerIntervalId = window.setInterval(timerCB, self.getState().displayTimerMs);\n }", "title": "" }, { "docid": "be70de1da0087d07f16b1798e3a9ab25", "score": "0.5881226", "text": "tick(){\r\n // grab the h1\r\n //var timeDisplay = document.getElementById(\"time\");\r\n\r\n\r\n // turn the seconds into mm:ss\r\n var min = Math.floor(this.secondsRemaining / 60);\r\n var sec = this.secondsRemaining - (min * 60);\r\n \r\n //add a leading zero (as a string value) if seconds less than 10\r\n if (sec < 10) {\r\n sec = \"0\" + sec;\r\n }\r\n \r\n // concatenate with colon\r\n var message = min.toString() + \":\" + sec;\r\n \r\n // now change the display\r\n this.timeDisplay.html(message);\r\n \r\n // stop is down to zero\r\n if (this.secondsRemaining === 0){\r\n // show pop-up when time reaches 0\r\n $('.overlay-lose').addClass('show');\r\n clearInterval(this.intervalHandle);\r\n //resetPage();\r\n }\r\n \r\n //subtract from seconds remaining\r\n this.secondsRemaining--;\r\n \r\n }", "title": "" }, { "docid": "55aacdc540f63b57d533bc92c1990260", "score": "0.5879047", "text": "function resetClockAndTime() {\n stopClock();\n clockOff = true;\n time = 0;\n displayTime();\n}", "title": "" }, { "docid": "3a751d8b5e25db6b90f11651ddd4f233", "score": "0.58758074", "text": "function reset() {\n\tclearInterval(interval);\n\tinterval = null;\n\ttimer = [0,0,0,0];\n\ttimerRunning = false;\n\n\ttypingArea.value = \"\";\n\tclock.innerHTML = \"00:00:00\";\n\ttypingArea.style.borderColor = \"gray\";\n\t\n\toriginText = randomWords();\n\t$(\"#text-provided p\").html(originText);\n}", "title": "" }, { "docid": "c17593925d7599ad22d02f9feb6a04ae", "score": "0.5840329", "text": "function z_engine_tweet_clear()\n{\n\t$(\"home-timeline\").update();\n}", "title": "" }, { "docid": "4cba87c31088f380ce4272060ec1be31", "score": "0.58400476", "text": "function Clearup() {\n //TO DO:\n EventLogout();\n App.Timer.ClearTime();\n }", "title": "" }, { "docid": "4cba87c31088f380ce4272060ec1be31", "score": "0.58400476", "text": "function Clearup() {\n //TO DO:\n EventLogout();\n App.Timer.ClearTime();\n }", "title": "" }, { "docid": "4cba87c31088f380ce4272060ec1be31", "score": "0.58400476", "text": "function Clearup() {\n //TO DO:\n EventLogout();\n App.Timer.ClearTime();\n }", "title": "" }, { "docid": "652cd168f3fd0dbc2fcc4e7c614141a7", "score": "0.5836156", "text": "function reset() {\r\n setQuestion();\r\n // setAnswers();\r\n setTimer();\r\n\r\n}", "title": "" }, { "docid": "65eb0d0b301868fe792eb82b153c5185", "score": "0.58353585", "text": "function reset() {\n $scope.currentTimes = {};\n $scope.previousTimes = {};\n $scope.clockedIn = false;\n $scope.currentStatus = \"\";\n $scope.currentUser = 0;\n }", "title": "" }, { "docid": "66d26f7ef5a47b73ec60d4ba6a73134d", "score": "0.583379", "text": "function reset(){\n\n\n // 1.delelte the user guess first\n\n // 2.restart the guess button\n document.getElementById(\"guessButton\").disabled = false\n guessRemain = 3;\n document.getElementById(\"guesses-remaining\").innerHTML = `Remaining Guess: ${guessRemain}`\n history = []\n document.getElementById(\"hisArea\").innerHTML = `History number: ${history}`\n let resultMessage = '';\n document.getElementById(\"resultArea\").innerHTML = `${resultMessage}`;\n timeOut()\n \n}", "title": "" }, { "docid": "759425afc4d250b1dd24a5431e6d76ea", "score": "0.5830192", "text": "function Clearup() {\n //EventLogout();\n App.Timer.ClearTime();\n App.Timer.ClearIntervalTime();\n //TO DO:\n }", "title": "" }, { "docid": "05508eca6f7bd9201f482c1ba07d551b", "score": "0.5826533", "text": "function timeClock() {\n timer = moment().format(\"hh:mm:ss A\")\n $(\"#time\").text(timer);\n }", "title": "" }, { "docid": "8f9bc1c64c4c51a798fc1aac4e8497c6", "score": "0.5824403", "text": "function setTime() {\n\t\t\tif (!paused) {\n\t\t\t\t++seconds;\n\t\t\t\t$(\"#seconds\").html(pad(seconds % 60));\n\t\t\t\t$(\"#minutes\").html(pad(Math.floor((seconds / 60) % 60)));\n\t\t\t\t$(\"#hours\").html(pad(Math.floor(seconds / 60 / 60)));\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "09c2b399cecc10b0c380f7b2be966786", "score": "0.581559", "text": "resetScreen() {\n this.timer = 0;\n this.finished = false;\n }", "title": "" }, { "docid": "bcad338a35553d5af23a1ecaf09d1ae4", "score": "0.58126163", "text": "function resetCountdown() {\n // set the clock state back to session\n inSession = true;\n\n // set the state to Session on the page\n $('#state').html('Session');\n\n // set the minutes to user selected session time\n $('#countdown-minutes').html($('#session-time').html());\n\n // reset the seconds\n $('#countdown-seconds').html('00');\n}", "title": "" }, { "docid": "9b43ffee3e68a51f7f6ee387e994d5b6", "score": "0.5811189", "text": "function resetTime() {\n var today = new Date();\n var current = today.toISOString().slice(0, 10);\n if (today.getHours() < 10) {\n var hours = \"0\" + today.getHours();\n } else {\n var hours = today.getHours();\n }\n if (today.getMinutes() < 10) {\n var mins = \"0\" + today.getMinutes();\n } else {\n var mins = today.getMinutes();\n }\n var time = hours + ':' + mins;\n document.getElementById(\"sysTime\").innerHTML = current + \" \" + time;\n}", "title": "" }, { "docid": "f297878ff727a05d0895ac5f94b49dc8", "score": "0.5810195", "text": "function resetGame() { \n questionType();\n $(\"#DateCountdown\").data('timer', 100).TimeCircles().restart();\n $(\"body\").removeClass(\"blur\");\n $(\".overlay\").fadeOut();\n score = 0;\n $(\"#score\").text(score);\n $(\"body\").removeClass();\n}", "title": "" }, { "docid": "4f8c0a6d2418889c0c13b48e009d2966", "score": "0.58080304", "text": "function setAnswer(){\n // ogni secondo mi aggiunge la risposta 'ok'\n setTimeout(function(){\n // quando deve inviare la risposta l'altro utente è online\n $('.container_single_chat.active').parent().siblings('header').find('.header_right').find('.last_login').text('online');\n // aggiungo alla chat attiva la risposta 'Ok'\n $('.container_single_chat.active').append('<div class=\"messages\"><div class=\"other_message white\"><p>Ok</p><small class=\"time\">' + date() +'</small><i class=\"fas fa-chevron-down\"></i><div class=\"menu\"><div class=\"important_message\">Messaggio importante</div><div class=\"delete_message\">Cancella messaggio</div></div></div></div>');\n // aggiungo 'Ok' anche alla chat dell'utente selezionato a sinistra\n $('.chat_container .chat_on .person_message').text('Ok');\n // scrollo per vedere sempre l'ultimo messaggio\n var pixelScroll = $(\".container_single_chat.active\")[0].scrollHeight;\n $(\".container_single_chat.active\").scrollTop(pixelScroll);\n }, 1000); // ogni secondo\n }", "title": "" }, { "docid": "9012da9b38ac6c65acc7e530e36db6d9", "score": "0.5805366", "text": "function setTime() {\n var date = getTime(diff);\n\t\t\t\t\n $this.find('.countdown-days').text(date[0]);\n $this.find('.countdown-hours').text(date[1]);\n $this.find('.countdown-minutes').text(date[2]);\n $this.find('.countdown-seconds').text(date[3]);\n\n diff -= 1000;\n }", "title": "" }, { "docid": "94919788c3a2d2a4556686fc13d3495f", "score": "0.58050394", "text": "function resetClock() {\n clock = [0,0,0];\n renderClock();\n}", "title": "" }, { "docid": "70d7d25fc3df274cf8b2a7d468cf8cd5", "score": "0.57871526", "text": "function clear()\r\n{\r\n timer.textContent = \"TIME: 00:00:00\";\r\n seconds = 0;\r\n minutes = 0;\r\n hours = 0;\r\n}", "title": "" }, { "docid": "4a3150805302336af24d35808a83910f", "score": "0.57833534", "text": "function reset() {\n time = 0;\n handleFrame();\n}", "title": "" }, { "docid": "75f73b828447b73ed17bde4512a3af5e", "score": "0.57722", "text": "function updateGameTime() {\n var time = new Date();\n var hours = time.getHours();\n var minutes = time.getMinutes();\n if (hours<10) hours = \"0\"+hours;\n if (minutes<10) minutes = \"0\"+minutes;\n ui.panel.gameTime.text = `${hours}:${minutes}`;\n mobile.setTime(`${hours}:${minutes}`);\n }", "title": "" }, { "docid": "5e453041c8a730955547a4b0c2b6c3fe", "score": "0.57607794", "text": "function chat_refresh() {\n\tchat_system_pos = 0;\n\tfor (userId in chat_system) {\n\t\tvar window = chat_system[userId];\n\n\t\tif(window != null && window.visible == true) {\n\t\t\twindow.setPosition(chat_system_pos);\n\t\t\tchat_system_pos = chat_system_pos + 1;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "da629ad113aa8a670c088a36c19c9e2f", "score": "0.5757882", "text": "reset() {\n\n var minutesLeft = this.state.sessionLength;\n if (minutesLeft < 10) {\n minutesLeft = \"0\" + minutesLeft\n }\n\n this.setState(state=>({\n minutesLeft: minutesLeft,\n secondsLeft: \"00\",\n clockType: \"Session\",\n countdown: false\n }))\n this.alarmSound.pause();\n this.alarmSound.currentTime = 0;\n }", "title": "" }, { "docid": "d3680d2cec58392ce9293edd4eaf1d4f", "score": "0.57557625", "text": "function updateTime(){\n $scope.time = Date.now();\n }", "title": "" }, { "docid": "d0f0a80a17a57541026f69c39d4df490", "score": "0.575124", "text": "function updateTime() {\n var datetime = tizen.time.getCurrentDateTime(),\n hour = datetime.getHours(),\n minute = datetime.getMinutes(),\n second = datetime.getSeconds();\n\n document.querySelector(\"#digital-text div\").innerHTML = moment().format('h:mm a');\n // Update the hour/minute/second hands\n rotateElements((hour + (minute / 60) + (second / 3600)) * 30, \"hands-hr\");\n rotateElements((minute + second / 60) * 6, \"hands-min\");\n rotateElements(second * 6, \"hands-sec\");\n }", "title": "" }, { "docid": "11977c04b591d19e3afb4a67313a68db", "score": "0.574571", "text": "function reset_game (){\n location.reload();\n timerStart = 30;\n startGame();\n}", "title": "" }, { "docid": "0d04eacfdae5cb6adcc188cb83c40b23", "score": "0.57430744", "text": "function reset(){\n randnums = [ ];\n for (i= 0; i < 30; i++){\n randnums.push(i)\n };\n $displayQuote.text(getRandomQuote());\n $timer.text(\"60\");\n $scoreboard.text(\"0\");\n game = {ellapsedTime: 60};\n currentPlayer = {score: 0}\n clearInterval(displayTimer);\n $timer.text(\"Score: \" + currentPlayer.score);\n $seconds.css(\"visibility\", \"visible\");\n $(\"#mustache\").css(\"visibility\",\"hidden\");\n $(\"#minniemouse\").css(\"visibility\",\"hidden\");\n $(\"#sunglasses\").css(\"visibility\",\"hidden\");\n $displayQuote.css(\"margin-top\", \"0px\")\n $timer.css(\"margin-top\", \"0px\");\n startTimer();\n}", "title": "" }, { "docid": "140b8f6abfc5b65cd516b410e45a263a", "score": "0.57427305", "text": "function handleSendChat() {\n\t\t\t\t//Clear out the existing timer so we don't have \n\t\t\t\t//multiple timer instances running.\n\t\t\t\tclearInterval(mTimer);\n\t\t\t\tgetChatText();\n\t\t\t}", "title": "" }, { "docid": "7f40dc7d13d6e474526cbafa150a7e59", "score": "0.5742238", "text": "function sendMessage() {\n timerButton.textContent = \"Time Expired\";\n prompt(\"Write in Initials\");\n }", "title": "" }, { "docid": "68588273b405014fa143aca1a4b8d19c", "score": "0.57421577", "text": "function reset(){\n\tchangeView(title_screen);\n\tload_game();\n}", "title": "" }, { "docid": "8eca8fb78bc96f084609317a355b69c5", "score": "0.5737466", "text": "function time1() {\n \t\n\t$(\"#time\").html(\"<br>Time Now: \" + moment().format('LTS'));\n\t\n\t}", "title": "" }, { "docid": "440bcd22d3ff2d297a55477c0c884510", "score": "0.5736696", "text": "function resetTimer(){\n\t\t\tgameTimer = 30;\n\t\t\t$(\".timer\").html(\"Time Remaining \" + gameTimer + \" Seconds\");\n\t\t}", "title": "" }, { "docid": "c3d009cf43813df6ded881234d3e4f71", "score": "0.5732653", "text": "function chessGameStarted()\n{\n\tdocument.getElementById(\"timer\").innerHTML = \"\";\n}", "title": "" }, { "docid": "e0bfac948b051105113376e91f8d1e4a", "score": "0.57311374", "text": "function reset()\n{\n //changing the displays of buttons for better view\n Stop.style.display=\"none\";\n Reset.style.display=\"none\";\n Start.style.display=\"block\";\n document.getElementById(\"flag\").style.display=\"none\";\n\n //timer varaible set to stop state\n timer=false;\n\n //hour min sec and milisec and count set back to zero\n hour=0;\n sec=0;\n min=0;\n milisec=0;\n count=0;\n\n //setting the content in the frontend\n document.getElementById(\"hour\").innerHTML=\"00\";\n document.getElementById(\"min\").innerHTML=\"00\";\n document.getElementById(\"sec\").innerHTML=\"00\";\n document.getElementById(\"milisec\").innerHTML=\"00\";\n document.getElementById(\"flagged\").innerHTML=\"\";\n}", "title": "" }, { "docid": "f9092c3fb1530e86a368be90b9390037", "score": "0.5730696", "text": "reset(){\n if ( this.y <= 0){\n setTimeout (() => {\n this.y = 406;\n this.x = 200;\n this.winningMessage();\n }, 500)\n clearInterval(interval);\n }\n\n }", "title": "" }, { "docid": "5b49a19cc56eb6cd1e2dff87af341aa5", "score": "0.5729886", "text": "function reset() {\n window.clearInterval(timerInterval);\n seconds = 0;\n minutes = 0;\n hours = 0;\n document.getElementById(\"timer\").innerHTML = \"00 : 00 : 00\";\n}", "title": "" }, { "docid": "472201313aeef3cbd2f48eae96a57d84", "score": "0.572414", "text": "function resetThings(){\n onWorkSession = true;\n startStop = false;\n switchColor(onWorkSession);\n if(holdInterval!==undefined){\n clearInterval(holdInterval);\n }\n $('#mins').text(addZero($('#sessionValue').text()));\n $('#secs').text(addZero(0));\n}", "title": "" }, { "docid": "efe2fbf620b78873695b0b737c303315", "score": "0.57183033", "text": "settime(that) {\n if (this.data.countdown == 0) {\n that.setData({\n is_show: true\n })\n this.data.countdown = 60;\n return;\n } else {\n that.setData({\n is_show: false,\n last_time: this.data.countdown\n })\n\n this.data.countdown--;\n }\n setTimeout(function () {\n that.settime(that)\n }, 1000)\n }", "title": "" }, { "docid": "62b9b92029f0eec1793566cec7f20fe7", "score": "0.57174873", "text": "function sendMessage() {\r\n var userInput = $('#user-msg').val();\r\n var tem = $('.template #my-answer').clone();\r\n tem.find('#my-msg').append(userInput);\r\n tem.find('.hours').append(getActualHours());\r\n $('.main-chat-user.active #chat').append(tem);\r\n setTimeout(function(){\r\n var risp = $('.template #com-answer').clone();\r\n risp.find('.hours').append(getActualHours());\r\n $('.main-chat-user.active #chat').append(risp);\r\n },1000)\r\n $('#user-msg').val(\"\");\r\n}", "title": "" }, { "docid": "d6fc0f93d8ddf2c355f9bd7ec42d2b34", "score": "0.57149905", "text": "function hideChat(){\n chat = document.getElementById(\"chatbox\");\n chat.style.display = \"none\";\n clearInterval(myTimer);\n }", "title": "" }, { "docid": "a38c003282d30b18cd1e24576ee93412", "score": "0.5709139", "text": "function restartConversation() {\n $(\"#userInput\").prop('disabled', true);\n //destroy the existing chart\n $('.collapsible').remove();\n\n if (typeof chatChart !== 'undefined') { chatChart.destroy(); }\n\n $(\".chart-container\").remove();\n if (typeof modalChart !== 'undefined') { modalChart.destroy(); }\n $(\".chats\").html(\"\");\n $(\".usrInput\").val(\"\");\n // to restart\n send(\"/greetings.welcome\");\n}", "title": "" }, { "docid": "2954e684364e5d91da92da52551dc2ba", "score": "0.57075644", "text": "function resetQuiz(){\n $(\"#finish-screen\").css(\"display\", \"none\");\n $(\"#out-of-time\").css(\"display\", \"none\");\n $(\"#start-screen\").css(\"display\", \"block\");\n currentQuestionNumber = 1; \n remainingSeconds = 75; \n $(\"#timer\").text(remainingSeconds);\n}", "title": "" }, { "docid": "f53e5b4b823eaf48e2941e2daea4d4a2", "score": "0.5702614", "text": "function clock() {\n //Setting variable for present time clock fromat\n var local = moment().format(\"hh:mm:ss\");\n //Setting variable for unix time format\n var xTime = moment().format(\"X\");\n //Inserting variable \"local\" - clock display into the HTML <span> tag id \"localTime\"\n $(\"#localTime\").html(local);\n }", "title": "" }, { "docid": "ca831b26cf80f84bab5c65b8baad86b2", "score": "0.56997854", "text": "function hide_chat() {\n chatout=false\n chatShowAnimator.stop()\n chatShowAnimatorv.stop()\n chatHideAnimator.start()\n chatHideAnimatorv.start()\n chat.innerHTML = ''\n}", "title": "" }, { "docid": "06db04f387d0456dea4da329c26191b0", "score": "0.5691975", "text": "function clearTimeLine() {\n tl.clear(); \n tl.eventCallback(\"onComplete\", null);\n }", "title": "" }, { "docid": "de22142458ac8737c04696e7cd7a2266", "score": "0.56912786", "text": "function updateTime() {\n\n}", "title": "" }, { "docid": "d2f91ad13c4e2397bec34799199df101", "score": "0.56911576", "text": "function openChat() {\n //check if the user has logged in today by checking the cookie\n //checkCookie();\n //alert(currentclient);\n\n if (currentclient == \"none\" || currentclient == null) {\n chatmodal.style.display = \"block\";\n } else {\n chat = document.getElementById(\"chatbox\");\n chat.style.display = \"block\";\n myTimer = setInterval(updateChat, 1000); //run timer to update chat\n }\n }", "title": "" }, { "docid": "53bc4ed0a8dc9d06e8dccd4af282ffa7", "score": "0.5688185", "text": "_resetTimer(second) {\n this._stopTimer()\n\n this.state.startSecond = second\n this.state.nowSecond = this.state.startSecond\n this._updateView()\n }", "title": "" }, { "docid": "76d0811a2a39cb2984398761ebb14f84", "score": "0.56825334", "text": "function updateClock() {\n\n var clock = moment().format(\"HH:mm:ss\");\n var c = $(\"<h4>\");\n var c2 = c.append(clock);\n $(\"#clock\").html(c2);\n \n //reload the whole page every 60 seconds\n //setTimeout(function () { location.reload(1); }, 60000);\n //or\n // Get current time in seconds\n var currentTimeSec = moment();\n // console.log(\"Current Time in seconds:\" + moment(currentTimeSec).format(\"ss\"));\n if(moment(currentTimeSec).format(\"ss\")==00)\n {\n // When current seconds=00\n location.reload();\n }\n }", "title": "" }, { "docid": "628adecfc04c3a1e59a73e1e0d2bcd92", "score": "0.56705016", "text": "changeChat(chatType) {\n const { typeId, clearRenderChat, changeChatType } = this.props;\n //clearRenderChat()\n changeChatType(chatType);\n this.renderChat(chatType);\n }", "title": "" }, { "docid": "49588ab5045c6bfe0a3c3029eebcebe5", "score": "0.565904", "text": "_resetAllStatesAndGoback() {\n this._resetAllStates();\n gStorage.currentChatUser = this.state.is_caller ? this.state.callee : this.state.caller;\n\n setTimeout(() => {\n\n const resetAction = StackActions.reset({\n index: 0,\n actions: [NavigationActions.navigate({ routeName: 'Chat' })],\n });\n this.props.navigation.dispatch(resetAction);\n\n }, 1000);\n }", "title": "" }, { "docid": "e96491b5221be2b7b0347bbebfdcc136", "score": "0.56530297", "text": "function firstBotMessage() {\n let firstMessage =\n \"Bienvenido, soy la asistente virtual <b> Wendy </b> <br>A continuacion puede seleccionar una respuesta o escribirla \";\n document.getElementById(\"botStarterMessage\").innerHTML =\n '<p class=\"botText\" id = \"initialMessage\"><span>' +\n firstMessage +\n \"</span></p>\";\n\n let time = getTime();\n $(\"#chat-timestamp\").append(time);\n document.getElementById(\"userInput\").scrollIntoView(false);\n}", "title": "" }, { "docid": "3ee1750824fbc987756bafcdc0088572", "score": "0.5652159", "text": "function resetCountdown() {\n countdown.innerText = timeToAnswer;\n}", "title": "" }, { "docid": "4dda1d5ff58f98e9eac914b520e1f3ea", "score": "0.56521285", "text": "_onTimeupdate () {\n this.emit('timeupdate', this.getCurrentTime())\n }", "title": "" }, { "docid": "d4d7c948eb4fb02d3667ae23eb9fa7c5", "score": "0.564783", "text": "function resetQuiz() {\n currentQuestion = 0;\n correctAnswers = 0;\n quizOver = false;\n correctAnswer = 0;\n wrongAnswer = 0;\n usersChoice;\n timeLeft = 30;\n elem = document.getElementById('timer');\n timerId = setInterval(countdown, 1000);\n $(\".choiceList\").show();\n $(\".question\").show();\n $(\".wrong\").hide();\n $(\".correct\").hide();\n }", "title": "" }, { "docid": "343bcee85c2ad9aecfbb757cdb0363ff", "score": "0.5646891", "text": "function scriviEInviaMessaggio() {\n // Creo una variabile con il valore dell'input(messaggio)\n var valoreText = $('.write-chat input').val();\n\n if(valoreText != ''){\n // Clono il template del messaggio\n var cloneText = $('.template .single-text').clone();\n\n // Creo la variabile con le ore e minuti correnti\n var d = new Date();\n var minutes = d.getMinutes();\n var hours = d.getHours();\n var currentTime = aggiungiZero(hours) + ':' + aggiungiZero(minutes);\n\n // Scrivo all'interno del clone\n cloneText.children('p:first-child').text(valoreText);\n cloneText.children('p.time').text(currentTime);\n\n // Aggiungo la classe css per dare gli stili\n cloneText.addClass('green-text');\n\n // Appendo nell'html il clone del messaggio\n $('.read-chat ul.texts.active').append(cloneText);\n\n // La pagina fa lo scroll fino al nuovo scriviEInviaMessaggio\n $('.read-chat').scrollTop($('.read-chat').prop('scrollHeight'));\n\n // Rimuovo il contenuto dall'input iniziale\n $('.write-chat input').val('');\n\n // // Scrivo il valore dell'input anche nel sottotitolo del contatto\n var attributChat = $('.read-chat ul.texts.active').attr('data-texts');\n var selettoreContatto = '.single-contact[data-contact=\"' + attributChat + '\"]';\n\n $(selettoreContatto).find('.subtitle').text(valoreText);\n\n window.setTimeout(riceviMessaggio, 1000);\n }\n\n}", "title": "" }, { "docid": "db4e191513a52afaaa982a9b0fb52672", "score": "0.56444246", "text": "function runningClock() {\n time = moment().format(\"hh:mm:ss A\");\n $(\"#time-display\").text(time);\n }", "title": "" }, { "docid": "f4c0884d4c3d1e9a468337114eed4027", "score": "0.5642565", "text": "function setDate(){\r\n d = new Date()\r\n if (m != d.getMinutes()) {\r\n m = d.getMinutes();\r\n $('<div class=\"timestamp\">' + d.getHours() + ':' + m + '</div>').appendTo($('.message:last'));\r\n }\r\n}", "title": "" }, { "docid": "ee21597c975655eb642d9abb60a9f850", "score": "0.56396425", "text": "function updateTime() {\n element.text(getMoment().format(format) + ' (' + getMoment().fromNow() + ')');\n }", "title": "" }, { "docid": "f49067697044082ed859daaf70c35cac", "score": "0.56366724", "text": "function currentTime() {\n\t\tvar sec = 1;\t\n\t\ttime = moment().format('HH:mm:ss');\n\t\tsearchTime = moment().format('HH:mm');\n\t\t\t$('#currentTime').html(time);\n\n\t\t\tt = setTimeout(function() {\n\t\t\t\tcurrentTime();\n\t\t\t}, sec * 1000);\t\n\t}", "title": "" }, { "docid": "735dec271845ce5e75e3d4b5c471f3ab", "score": "0.56274635", "text": "function kz_chat_mess(kz_chat){ //CHAT FUNCTION TO SEND/RECEIVE MESSAGES\n\n\tvar person = kz_chat.person || '';\n\tvar name = kz_chat.name || '';\n\tvar smb = kz_chat.smb || 0;\n\tvar message = kz_chat.message || '';\n\tvar time = kz_chat.time || 0;\n\t\t\n\tvar last_p = $('#kzchat_view .chat_block_text').last().attr('person') || \"\";\n\tvar last_t = parseInt($('#kzchat_view .chat_block_text').last().attr('time')) || 0;\n\tvar now = parseInt(time);\n\tvar nameb = name.split(\" \");\n\t\n\tif(smb==1){smb=\" smiley_big_text\";}\n\telse{smb=\"\";}\n //-------------Fode Toure---------------------- \n\tvar theDate = new Date(now * 1000); \n var options = { year: \"2-digit\",month: \"2-digit\",day: \"2-digit\"};\n var options2 = { hour: \"2-digit\", minute: \"2-digit\"};\n var dateString = theDate.toLocaleDateString(\"en-GB\",options) + ' ' + theDate.toLocaleTimeString(\"en-US\",options2);\n //---------------------------------------------\n\tvar check;\n\tif(last_t==0){check = \"none\";}\n\telse{check = now-last_t;}\n\t\n\tif('kzchat'==chat_position && chat_status==1){}\n\telse{chat_ping('kzchat');}\n\t\n\tif(person==userself){\n\t\tif(person==last_p){\n\t\t\tif(check<=60000){\n\t\t\t\t$('#kzchat_view .chat_conv').last().append(\n\t\t\t\t'<p class=\"chat_block_text'+smb+'\" person=\"'+person+'\" time=\"'+dateString+'\">'+message+'</p>'\n\t\t\t\t);\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$('#kzchat_view .nano-content').last().append(\n\t\t\t\t'<div class=\"chat_conv user_conv kz_userself_brd\"><span class=\"chat_block_time user_block_time\">'+dateString+'</span><p class=\"chat_block_title\">You</p><p class=\"chat_block_text'+smb+'\" person=\"'+person+'\" time=\"'+dateString+'\">'+message+'</p></div>'\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t$('#kzchat_view .nano-content').last().append(\n\t\t\t'<div class=\"chat_conv user_conv kz_userself_brd\"><span class=\"chat_block_time user_block_time\">'+dateString+'</span><p class=\"chat_block_title\">You</p><p class=\"chat_block_text'+smb+'\" person=\"'+person+'\" time=\"'+dateString+'\">'+message+'</p></div>'\n\t\t\t);\n\t\t}\n\t}\n\telse{\n\t\tif(person==last_p){\n\t\t\tif(check<=60000 && person==last_p){\n\t\t\t\t$('#kzchat_view .chat_conv').last().append(\n\t\t\t\t'<p class=\"chat_block_text'+smb+'\" person=\"'+person+'\" time=\"'+dateString+'\">'+message+'</p>'\n\t\t\t\t);\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$('#kzchat_view .nano-content').last().append(\n\t\t\t\t'<div class=\"chat_conv kz_user'+person+'_brd\"><span class=\"chat_block_time\">'+dateString+'</span><p class=\"chat_block_title\">'+nameb[0]+'</p><p class=\"chat_block_text'+smb+'\" person=\"'+person+'\" time=\"'+dateString+'\">'+message+'</p></div>'\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t$('#kzchat_view .nano-content').last().append(\n\t\t\t'<div class=\"chat_conv kz_user'+person+'_brd\"><span class=\"chat_block_time\">'+dateString+'</span><p class=\"chat_block_title\">'+nameb[0]+'</p><p class=\"chat_block_text'+smb+'\" person=\"'+person+'\" time=\"'+dateString+'\">'+message+'</p></div>'\n\t\t\t);\n\t\t}\n\t}\n\t\n\t$('#kzchat_view .chat_block_write').insertAfter('.chat_conv:last-child');\n\t$('#kzchat_view .chat_block_text').last().fadeTo(0,0.01).fadeTo(200,1);\n\tif(chat.pre!==1){chat_nanodown();}\n\t\n}", "title": "" }, { "docid": "f144e56ff0988176932fcb28e192f470", "score": "0.5625661", "text": "function restartConversation() {\n // $(\"#userInput\").prop('disabled', true);\n //destroy the existing chart\n $('.collapsible').remove();\n $('#userInput').focus();\n\n if (typeof chatChart !== 'undefined') { chatChart.destroy(); }\n\n $(\".chart-container\").remove();\n if (typeof modalChart !== 'undefined') { modalChart.destroy(); }\n $(\".chats\").html(\"\");\n $(\".usrInput\").val(\"\");\n send(\"/restart\");\n}", "title": "" }, { "docid": "640165a4221da07d583080c8065c1960", "score": "0.56229985", "text": "function displayTime() {\r\n time--;\r\n $(\"#time-holder\").html(\"Time remaining: \" + time);\r\n \r\n if (time <= 0) {\r\n hideHolders();\r\n stopTime();\r\n $(\"#answer-holder\").show();\r\n $(\"#answer-holder\").html(\"Time is up! The answer is: \" + answer[count]);\r\n displayImage();\r\n unanswered++;\r\n count++;\r\n checkGameEnd();\r\n }\r\n }", "title": "" }, { "docid": "cb0cf1c8d299236f719f1b0e00ffd748", "score": "0.56196517", "text": "function updateTimer() {\n time.subtract(1, 'seconds');\n $('#time').html(time.format('mm:ss'));\n document.title = time.format('mm:ss') + \" - Pomodorock\";\n if (time.minute() === 0 && time.seconds() === 0) {\n notify();\n resetTimer();\n document.title = \"DONE - Pomodorock\";\n }\n}", "title": "" } ]
8216e1b99a30d8481f2e15641e65762e
The "insertData(offset,arg)" method will insert a string at the specified character offset. Insert the data at the beginning of the character data. Retrieve the character data from the second child of the first employee. The "insertData(offset,arg)" method is then called with offset=0 and arg="Mss.". The method should insert the string "Mss." at position 0. The new value of the character data should be "Mss. Margaret Martin".
[ { "docid": "fd9b7f3b1e2e4290bc4e07b6ab4775c0", "score": "0.6804069", "text": "function hc_characterdatainsertdatabeginning() {\n var success;\n if(checkInitialization(builder, \"hc_characterdatainsertdatabeginning\") != null) return;\n var doc;\n var elementList;\n var nameNode;\n var child;\n var childData;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"hc_staff\");\n elementList = doc.getElementsByTagName(\"strong\");\n nameNode = elementList.item(0);\n child = nameNode.firstChild;\n\n child.insertData(0,\"Mss. \");\n childData = child.data;\n\n assertEquals(\"characterdataInsertDataBeginningAssert\",\"Mss. Margaret Martin\",childData);\n \n}", "title": "" } ]
[ { "docid": "a2fcde3e176ad3e00dc0c370b02c974a", "score": "0.74118805", "text": "function hc_characterdatainsertdatamiddle() {\n var success;\n var doc;\n var elementList;\n var nameNode;\n var child;\n var childData;\n doc = load(\"hc_staff\");\n elementList = doc.getElementsByTagName(\"strong\");\n nameNode = elementList.item(0);\n child = nameNode.firstChild;\n\n child.insertData(9,\"Ann \");\n childData = child.data;\n\n assertEquals(\"characterdataInsertDataMiddleAssert\",\"Margaret Ann Martin\",childData);\n \n}", "title": "" }, { "docid": "2cac1b7a8b806253062364f74e5e26ee", "score": "0.72202337", "text": "function characterdatainsertdatamiddle() {\n var success;\n if(checkInitialization(builder, \"characterdatainsertdatamiddle\") != null) return;\n var doc;\n var elementList;\n var nameNode;\n var child;\n var childData;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"staff\");\n elementList = doc.getElementsByTagName(\"name\");\n nameNode = elementList.item(0);\n child = nameNode.firstChild;\n\n child.insertData(9,\"Ann \");\n childData = child.data;\n\n assertEquals(\"characterdataInsertDataMiddleAssert\",\"Margaret Ann Martin\",childData);\n \n}", "title": "" }, { "docid": "c6e17f71a86a7c386c43d43c7443ae60", "score": "0.71488404", "text": "function hc_characterdatainsertdatamiddle() {\n var success;\n if(checkInitialization(builder, \"hc_characterdatainsertdatamiddle\") != null) return;\n var doc;\n var elementList;\n var nameNode;\n var child;\n var childData;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"hc_staff\");\n elementList = doc.getElementsByTagName(\"strong\");\n nameNode = elementList.item(0);\n child = nameNode.firstChild;\n\n child.insertData(9,\"Ann \");\n childData = child.data;\n\n assertEquals(\"characterdataInsertDataMiddleAssert\",\"Margaret Ann Martin\",childData);\n \n}", "title": "" }, { "docid": "01f32bf975b7f76386de03053aa59f63", "score": "0.67537004", "text": "function characterdatainsertdatabeginning() {\n var success;\n if(checkInitialization(builder, \"characterdatainsertdatabeginning\") != null) return;\n var doc;\n var elementList;\n var nameNode;\n var child;\n var childData;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"staff\");\n elementList = doc.getElementsByTagName(\"name\");\n nameNode = elementList.item(0);\n child = nameNode.firstChild;\n\n child.insertData(0,\"Mss. \");\n childData = child.data;\n\n assertEquals(\"characterdataInsertDataBeginningAssert\",\"Mss. Margaret Martin\",childData);\n \n}", "title": "" }, { "docid": "72f3e142a0a2603c711c66cc705b2028", "score": "0.5997162", "text": "function characterdatainsertdataend() {\n var success;\n if(checkInitialization(builder, \"characterdatainsertdataend\") != null) return;\n var doc;\n var elementList;\n var nameNode;\n var child;\n var childData;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"staff\");\n elementList = doc.getElementsByTagName(\"name\");\n nameNode = elementList.item(0);\n child = nameNode.firstChild;\n\n child.insertData(15,\", Esquire\");\n childData = child.data;\n\n assertEquals(\"characterdataInsertDataEndAssert\",\"Margaret Martin, Esquire\",childData);\n \n}", "title": "" }, { "docid": "9e4b1e881a7c8ce4df8b225432b9514a", "score": "0.59637344", "text": "function characterdatareplacedatamiddle() {\n var success;\n if(checkInitialization(builder, \"characterdatareplacedatamiddle\") != null) return;\n var doc;\n var elementList;\n var nameNode;\n var child;\n var childData;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"staff\");\n elementList = doc.getElementsByTagName(\"address\");\n nameNode = elementList.item(0);\n child = nameNode.firstChild;\n\n child.replaceData(5,5,\"South\");\n childData = child.data;\n\n assertEquals(\"characterdataReplaceDataMiddleAssert\",\"1230 South Ave. Dallas, Texas 98551\",childData);\n \n}", "title": "" }, { "docid": "5967e3ede6c364adcd5d06393340f8a3", "score": "0.59325194", "text": "function hc_characterdatainsertdataend() {\n var success;\n if(checkInitialization(builder, \"hc_characterdatainsertdataend\") != null) return;\n var doc;\n var elementList;\n var nameNode;\n var child;\n var childData;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"hc_staff\");\n elementList = doc.getElementsByTagName(\"strong\");\n nameNode = elementList.item(0);\n child = nameNode.firstChild;\n\n child.insertData(15,\", Esquire\");\n childData = child.data;\n\n assertEquals(\"characterdataInsertDataEndAssert\",\"Margaret Martin, Esquire\",childData);\n \n}", "title": "" }, { "docid": "f750f8ccc8588b34c59ac8b910fcd3e0", "score": "0.5928989", "text": "function nodeinsertbefore() {\n var success;\n if(checkInitialization(builder, \"nodeinsertbefore\") != null) return;\n var doc;\n var elementList;\n var employeeNode;\n var childList;\n var refChild;\n var newChild;\n var child;\n var childName;\n var length;\n var insertedNode;\n var actual = new Array();\n\n expectedWithWhitespace = new Array();\n expectedWithWhitespace[0] = \"#text\";\n expectedWithWhitespace[1] = \"employeeId\";\n expectedWithWhitespace[2] = \"#text\";\n expectedWithWhitespace[3] = \"name\";\n expectedWithWhitespace[4] = \"#text\";\n expectedWithWhitespace[5] = \"position\";\n expectedWithWhitespace[6] = \"#text\";\n expectedWithWhitespace[7] = \"newChild\";\n expectedWithWhitespace[8] = \"salary\";\n expectedWithWhitespace[9] = \"#text\";\n expectedWithWhitespace[10] = \"gender\";\n expectedWithWhitespace[11] = \"#text\";\n expectedWithWhitespace[12] = \"address\";\n expectedWithWhitespace[13] = \"#text\";\n\n expectedWithoutWhitespace = new Array();\n expectedWithoutWhitespace[0] = \"employeeId\";\n expectedWithoutWhitespace[1] = \"name\";\n expectedWithoutWhitespace[2] = \"position\";\n expectedWithoutWhitespace[3] = \"newChild\";\n expectedWithoutWhitespace[4] = \"salary\";\n expectedWithoutWhitespace[5] = \"gender\";\n expectedWithoutWhitespace[6] = \"address\";\n\n var expected = new Array();\n\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"staff\");\n elementList = doc.getElementsByTagName(\"employee\");\n employeeNode = elementList.item(1);\n childList = employeeNode.childNodes;\n\n length = childList.length;\n\n \n\tif(\n\t(6 == length)\n\t) {\n\trefChild = childList.item(3);\n expected = expectedWithoutWhitespace;\n\n\t}\n\t\n\t\telse {\n\t\t\trefChild = childList.item(7);\n expected = expectedWithWhitespace;\n\n\t\t}\n\tnewChild = doc.createElement(\"newChild\");\n insertedNode = employeeNode.insertBefore(newChild,refChild);\n for(var indexN100DC = 0;indexN100DC < childList.length; indexN100DC++) {\n child = childList.item(indexN100DC);\n childName = child.nodeName;\n\n actual[actual.length] = childName;\n\n\t}\n assertEqualsList(\"nodeNames\",expected,actual);\n \n}", "title": "" }, { "docid": "7db073e8902fc54b21642f019d6051fb", "score": "0.5887649", "text": "function characterdataindexsizeerrinsertdataoffsetgreater() {\n var success;\n if(checkInitialization(builder, \"characterdataindexsizeerrinsertdataoffsetgreater\") != null) return;\n var doc;\n var elementList;\n var nameNode;\n var child;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"staff\");\n elementList = doc.getElementsByTagName(\"address\");\n nameNode = elementList.item(0);\n child = nameNode.firstChild;\n\n \n\t{\n\t\tsuccess = false;\n\t\ttry {\n child.insertData(40,\"ABC\");\n }\n\t\tcatch(ex) {\n success = (typeof(ex.code) != 'undefined' && ex.code == 1);\n\t\t}\n\t\tassertTrue(\"throw_INDEX_SIZE_ERR\",success);\n\t}\n\n}", "title": "" }, { "docid": "d4e0b64cdadd47bc47e29147f60be5d4", "score": "0.5828747", "text": "function characterdatareplacedatabegining() {\n var success;\n if(checkInitialization(builder, \"characterdatareplacedatabegining\") != null) return;\n var doc;\n var elementList;\n var nameNode;\n var child;\n var childData;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"staff\");\n elementList = doc.getElementsByTagName(\"address\");\n nameNode = elementList.item(0);\n child = nameNode.firstChild;\n\n child.replaceData(0,4,\"2500\");\n childData = child.data;\n\n assertEquals(\"characterdataReplaceDataBeginingAssert\",\"2500 North Ave. Dallas, Texas 98551\",childData);\n \n}", "title": "" }, { "docid": "b2ea97d59afcf77b70ea1aa9b215bd32", "score": "0.58249104", "text": "function characterdataappenddatagetdata() {\n var success;\n if(checkInitialization(builder, \"characterdataappenddatagetdata\") != null) return;\n var doc;\n var elementList;\n var nameNode;\n var child;\n var childData;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"staff\");\n elementList = doc.getElementsByTagName(\"name\");\n nameNode = elementList.item(0);\n child = nameNode.firstChild;\n\n child.appendData(\", Esquire\");\n childData = child.data;\n\n assertEquals(\"characterdataAppendDataGetDataAssert\",\"Margaret Martin, Esquire\",childData);\n \n}", "title": "" }, { "docid": "84184d40d486f483b0f11d324819cf2b", "score": "0.5802715", "text": "function nodeinsertbeforenewchildexists() {\n var success;\n if(checkInitialization(builder, \"nodeinsertbeforenewchildexists\") != null) return;\n var doc;\n var elementList;\n var employeeNode;\n var childList;\n var refChild;\n var newChild;\n var child;\n var length;\n var childName;\n var insertedNode;\n expectedWhitespace = new Array();\n expectedWhitespace[0] = \"#text\";\n expectedWhitespace[1] = \"#text\";\n expectedWhitespace[2] = \"name\";\n expectedWhitespace[3] = \"#text\";\n expectedWhitespace[4] = \"position\";\n expectedWhitespace[5] = \"#text\";\n expectedWhitespace[6] = \"salary\";\n expectedWhitespace[7] = \"#text\";\n expectedWhitespace[8] = \"gender\";\n expectedWhitespace[9] = \"#text\";\n expectedWhitespace[10] = \"employeeId\";\n expectedWhitespace[11] = \"address\";\n expectedWhitespace[12] = \"#text\";\n\n expectedNoWhitespace = new Array();\n expectedNoWhitespace[0] = \"name\";\n expectedNoWhitespace[1] = \"position\";\n expectedNoWhitespace[2] = \"salary\";\n expectedNoWhitespace[3] = \"gender\";\n expectedNoWhitespace[4] = \"employeeId\";\n expectedNoWhitespace[5] = \"address\";\n\n var expected = new Array();\n\n var result = new Array();\n\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"staff\");\n elementList = doc.getElementsByTagName(\"employee\");\n employeeNode = elementList.item(1);\n childList = employeeNode.childNodes;\n\n length = childList.length;\n\n \n\tif(\n\t(6 == length)\n\t) {\n\texpected = expectedNoWhitespace;\nrefChild = childList.item(5);\n newChild = childList.item(0);\n \n\t}\n\t\n\t\telse {\n\t\t\texpected = expectedWhitespace;\nrefChild = childList.item(11);\n newChild = childList.item(1);\n \n\t\t}\n\tinsertedNode = employeeNode.insertBefore(newChild,refChild);\n for(var indexN100DD = 0;indexN100DD < childList.length; indexN100DD++) {\n child = childList.item(indexN100DD);\n childName = child.nodeName;\n\n result[result.length] = childName;\n\n\t}\n assertEqualsList(\"childNames\",expected,result);\n \n}", "title": "" }, { "docid": "0c8c1f250838b4e2d90174d07ec706fc", "score": "0.5802196", "text": "function nodeinsertbeforenodename() {\n var success;\n if(checkInitialization(builder, \"nodeinsertbeforenodename\") != null) return;\n var doc;\n var elementList;\n var employeeNode;\n var childList;\n var refChild;\n var newChild;\n var insertedNode;\n var childName;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"staff\");\n elementList = doc.getElementsByTagName(\"employee\");\n employeeNode = elementList.item(1);\n childList = employeeNode.childNodes;\n\n refChild = childList.item(3);\n newChild = doc.createElement(\"newChild\");\n insertedNode = employeeNode.insertBefore(newChild,refChild);\n childName = insertedNode.nodeName;\n\n assertEquals(\"nodeInsertBeforeNodeNameAssert1\",\"newChild\",childName);\n \n}", "title": "" }, { "docid": "074412162bdbedfda5e855a525853549", "score": "0.5795973", "text": "function characterdataappenddata() {\n var success;\n if(checkInitialization(builder, \"characterdataappenddata\") != null) return;\n var doc;\n var elementList;\n var nameNode;\n var child;\n var childValue;\n var childLength;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"staff\");\n elementList = doc.getElementsByTagName(\"name\");\n nameNode = elementList.item(0);\n child = nameNode.firstChild;\n\n child.appendData(\", Esquire\");\n childValue = child.data;\n\n childLength = childValue.length;\n assertEquals(\"characterdataAppendDataAssert\",24,childLength);\n \n}", "title": "" }, { "docid": "e122a95d703c320b86c8d4c51ac5c9e0", "score": "0.5761565", "text": "function characterdataindexsizeerrinsertdataoffsetnegative() {\n var success;\n if(checkInitialization(builder, \"characterdataindexsizeerrinsertdataoffsetnegative\") != null) return;\n var doc;\n var elementList;\n var nameNode;\n var child;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"staff\");\n elementList = doc.getElementsByTagName(\"address\");\n nameNode = elementList.item(0);\n child = nameNode.firstChild;\n\n \n\t{\n\t\tsuccess = false;\n\t\ttry {\n child.insertData(-5,\"ABC\");\n }\n\t\tcatch(ex) {\n success = (typeof(ex.code) != 'undefined' && ex.code == 1);\n\t\t}\n\t\tassertTrue(\"throws_INDEX_SIZE_ERR\",success);\n\t}\n\n}", "title": "" }, { "docid": "1fa789632b69e0eae3cc158bd87685ed", "score": "0.573954", "text": "function hc_characterdatareplacedatamiddle() {\n var success;\n if(checkInitialization(builder, \"hc_characterdatareplacedatamiddle\") != null) return;\n var doc;\n var elementList;\n var nameNode;\n var child;\n var childData;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"hc_staff\");\n elementList = doc.getElementsByTagName(\"acronym\");\n nameNode = elementList.item(0);\n child = nameNode.firstChild;\n\n child.replaceData(5,5,\"South\");\n childData = child.data;\n\n assertEquals(\"characterdataReplaceDataMiddleAssert\",\"1230 South Ave. Dallas, Texas 98551\",childData);\n \n}", "title": "" }, { "docid": "e413fe384b0fcff01e3a1c2bae4abcd1", "score": "0.57376325", "text": "function hc_characterdataappenddatagetdata() {\n var success;\n if(checkInitialization(builder, \"hc_characterdataappenddatagetdata\") != null) return;\n var doc;\n var elementList;\n var nameNode;\n var child;\n var childData;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"hc_staff\");\n elementList = doc.getElementsByTagName(\"strong\");\n nameNode = elementList.item(0);\n child = nameNode.firstChild;\n\n child.appendData(\", Esquire\");\n childData = child.data;\n\n assertEquals(\"characterdataAppendDataGetDataAssert\",\"Margaret Martin, Esquire\",childData);\n \n}", "title": "" }, { "docid": "5a9d33717e00a5ec54531bb21a2a403f", "score": "0.5729015", "text": "function injectTextNode(parentElement, first, index, data) {\n\t\t\ttry {\n\t\t\t\tinsertNode(parentElement, first, index);\n\t\t\t\tfirst.nodeValue = data;\n\t\t\t} catch (e) {} //IE erroneously throws error when appending an empty text node after a null\n\t\t}", "title": "" }, { "docid": "5a9d33717e00a5ec54531bb21a2a403f", "score": "0.5729015", "text": "function injectTextNode(parentElement, first, index, data) {\n\t\t\ttry {\n\t\t\t\tinsertNode(parentElement, first, index);\n\t\t\t\tfirst.nodeValue = data;\n\t\t\t} catch (e) {} //IE erroneously throws error when appending an empty text node after a null\n\t\t}", "title": "" }, { "docid": "1f788361d04b91ddc31672289e24ea5b", "score": "0.57218164", "text": "function injectTextNode(parentElement, first, index, data) {\r\n\t\ttry {\r\n\t\t\tinsertNode(parentElement, first, index);\r\n\t\t\tfirst.nodeValue = data;\r\n\t\t} catch (e) {} //IE erroneously throws error when appending an empty text node after a null\r\n\t}", "title": "" }, { "docid": "8af2d4f1760daa6fd3e6cdf83c75fdb5", "score": "0.5706144", "text": "function hc_characterdatareplacedatabegining() {\n var success;\n if(checkInitialization(builder, \"hc_characterdatareplacedatabegining\") != null) return;\n var doc;\n var elementList;\n var nameNode;\n var child;\n var childData;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"hc_staff\");\n elementList = doc.getElementsByTagName(\"acronym\");\n nameNode = elementList.item(0);\n child = nameNode.firstChild;\n\n child.replaceData(0,4,\"2500\");\n childData = child.data;\n\n assertEquals(\"characterdataReplaceDataBeginingAssert\",\"2500 North Ave. Dallas, Texas 98551\",childData);\n \n}", "title": "" }, { "docid": "f9bc0fd95e3615c561cd208ab7d6576b", "score": "0.5660598", "text": "insert(text) {\n this.getAce().insert(text);\n }", "title": "" }, { "docid": "1a21b16b13d929dc5e66742285640ba4", "score": "0.563561", "text": "function hc_nodeinsertbeforenewchildexists() {\n var success;\n if(checkInitialization(builder, \"hc_nodeinsertbeforenewchildexists\") != null) return;\n var doc;\n var elementList;\n var employeeNode;\n var childList;\n var refChild;\n var newChild;\n var child;\n var childName;\n var insertedNode;\n expected = new Array();\n expected[0] = \"strong\";\n expected[1] = \"code\";\n expected[2] = \"sup\";\n expected[3] = \"var\";\n expected[4] = \"em\";\n expected[5] = \"acronym\";\n\n var result = new Array();\n\n var nodeType;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"hc_staff\");\n elementList = doc.getElementsByTagName(\"p\");\n employeeNode = elementList.item(1);\n childList = employeeNode.getElementsByTagName(\"*\");\n refChild = childList.item(5);\n newChild = childList.item(0);\n insertedNode = employeeNode.insertBefore(newChild,refChild);\n for(var indexN1008C = 0;indexN1008C < childList.length; indexN1008C++) {\n child = childList.item(indexN1008C);\n nodeType = child.nodeType;\n\n \n\tif(\n\t(1 == nodeType)\n\t) {\n\tchildName = child.nodeName;\n\n result[result.length] = childName;\n\n\t}\n\t\n\t}\n assertEqualsListAutoCase(\"element\", \"childNames\",expected,result);\n \n}", "title": "" }, { "docid": "4429c8474145d48e1ffae4892bc2a09d", "score": "0.5626651", "text": "function hc_nodeinsertbeforenodename() {\n var success;\n if(checkInitialization(builder, \"hc_nodeinsertbeforenodename\") != null) return;\n var doc;\n var elementList;\n var employeeNode;\n var childList;\n var refChild;\n var newChild;\n var insertedNode;\n var childName;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"hc_staff\");\n elementList = doc.getElementsByTagName(\"p\");\n employeeNode = elementList.item(1);\n childList = employeeNode.childNodes;\n\n refChild = childList.item(3);\n newChild = doc.createElement(\"br\");\n insertedNode = employeeNode.insertBefore(newChild,refChild);\n childName = insertedNode.nodeName;\n\n assertEqualsAutoCase(\"element\", \"nodeName\",\"br\",childName);\n \n}", "title": "" }, { "docid": "33959c03ee67a726d16ab9bf8570ae71", "score": "0.5595312", "text": "function hc_characterdataappenddata() {\n var success;\n if(checkInitialization(builder, \"hc_characterdataappenddata\") != null) return;\n var doc;\n var elementList;\n var nameNode;\n var child;\n var childValue;\n var childLength;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"hc_staff\");\n elementList = doc.getElementsByTagName(\"strong\");\n nameNode = elementList.item(0);\n child = nameNode.firstChild;\n\n child.appendData(\", Esquire\");\n childValue = child.data;\n\n childLength = childValue.length;\n assertEquals(\"characterdataAppendDataAssert\",24,childLength);\n \n}", "title": "" }, { "docid": "dc67bfe6a4e8b1d95b7ad05e31a916e9", "score": "0.55817026", "text": "insertData(editor, data) {\n editor.insertData(data);\n }", "title": "" }, { "docid": "348c9cfd7db78f9756adaac21ab36630", "score": "0.5564389", "text": "function characterdatainsertdatanomodificationallowederrEE() {\n var success;\n if(checkInitialization(builder, \"characterdatainsertdatanomodificationallowederrEE\") != null) return;\n var doc;\n var genderList;\n var genderNode;\n var entText;\n var entReference;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"staff\");\n genderList = doc.getElementsByTagName(\"gender\");\n genderNode = genderList.item(2);\n entReference = doc.createEntityReference(\"ent3\");\n assertNotNull(\"createdEntRefNotNull\",entReference);\nentText = entReference.firstChild;\n\n assertNotNull(\"entTextNotNull\",entText);\n\n\t{\n\t\tsuccess = false;\n\t\ttry {\n entText.insertData(1,\"newArg\");\n }\n\t\tcatch(ex) {\n success = (typeof(ex.code) != 'undefined' && ex.code == 7);\n\t\t}\n\t\tassertTrue(\"throw_NO_MODIFICATION_ALLOWED_ERR\",success);\n\t}\n\n}", "title": "" }, { "docid": "987573914145a9fa6a0ffa7791f09e56", "score": "0.5538753", "text": "function hc_characterdataindexsizeerrinsertdataoffsetnegative() {\n var success;\n if(checkInitialization(builder, \"hc_characterdataindexsizeerrinsertdataoffsetnegative\") != null) return;\n var doc;\n var elementList;\n var nameNode;\n var child;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"hc_staff\");\n elementList = doc.getElementsByTagName(\"acronym\");\n nameNode = elementList.item(0);\n child = nameNode.firstChild;\n\n \n\t{\n\t\tsuccess = false;\n\t\ttry {\n child.replaceData(-5,3,\"ABC\");\n }\n\t\tcatch(ex) {\n success = (typeof(ex.code) != 'undefined' && ex.code == 1);\n\t\t}\n\t\tassertTrue(\"throws_INDEX_SIZE_ERR\",success);\n\t}\n\n}", "title": "" }, { "docid": "4abbfcc4fe5064e2b8baac51653fc396", "score": "0.5503495", "text": "function processNewDataInsert(D,name,data){\nfor(var key in data)D[name][key]=data[key];\n}", "title": "" }, { "docid": "e5d7a60e2ac6f341abc89db941756938", "score": "0.5498811", "text": "function hc_nodeinsertbefore() {\n var success;\n if(checkInitialization(builder, \"hc_nodeinsertbefore\") != null) return;\n var doc;\n var elementList;\n var employeeNode;\n var childList;\n var refChild;\n var newChild;\n var child;\n var childName;\n var insertedNode;\n var actual = new Array();\n\n expected = new Array();\n expected[0] = \"em\";\n expected[1] = \"strong\";\n expected[2] = \"code\";\n expected[3] = \"br\";\n expected[4] = \"sup\";\n expected[5] = \"var\";\n expected[6] = \"acronym\";\n\n var nodeType;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"hc_staff\");\n elementList = doc.getElementsByTagName(\"sup\");\n refChild = elementList.item(2);\n employeeNode = refChild.parentNode;\n\n childList = employeeNode.childNodes;\n\n newChild = doc.createElement(\"br\");\n insertedNode = employeeNode.insertBefore(newChild,refChild);\n for(var indexN10091 = 0;indexN10091 < childList.length; indexN10091++) {\n child = childList.item(indexN10091);\n nodeType = child.nodeType;\n\n \n\tif(\n\t(1 == nodeType)\n\t) {\n\tchildName = child.nodeName;\n\n actual[actual.length] = childName;\n\n\t}\n\t\n\t}\n assertEqualsListAutoCase(\"element\", \"nodeNames\",expected,actual);\n \n}", "title": "" }, { "docid": "b593fff882c939d2a153491715cd44f9", "score": "0.548297", "text": "function hc_nodeinsertbeforenodename() {\n var success;\n var doc;\n var elementList;\n var employeeNode;\n var childList;\n var refChild;\n var newChild;\n var insertedNode;\n var childName;\n doc = load(\"hc_staff\");\n elementList = doc.getElementsByTagName(\"p\");\n employeeNode = elementList.item(1);\n childList = employeeNode.childNodes;\n\n refChild = childList.item(3);\n newChild = doc.createElement(\"br\");\n insertedNode = employeeNode.insertBefore(newChild,refChild);\n childName = insertedNode.nodeName;\n\n assertEqualsAutoCase(\"element\", \"nodeName\",\"br\",childName);\n \n}", "title": "" }, { "docid": "a16bf61068e40438d79d68e2bdf53da8", "score": "0.54635775", "text": "function addData(data) {\n console.log(` Adding: ${data.firstName} ${data.lastName}`);\n Mentors.insert(data);\n}", "title": "" }, { "docid": "13b4ef75dce9b5b4a53ef239a3d9c2c1", "score": "0.5454121", "text": "function insertStr(parentStr, index, childString) {\n if (index > 0)\n return parentStr.substring(0, index) + childString + parentStr.substring(index, parentStr.length);\n else\n return childString + parentStr;\n}", "title": "" }, { "docid": "b9ec43aa400fba7dd0da48058a6653d5", "score": "0.54234564", "text": "function insert(node, data) {\n\tvar comparator = function(other) {\n\t\treturn data.compareTo(other);\n\t};\n\treturn insert_sub(node,data,comparator,false).node;\n}", "title": "" }, { "docid": "cdb5d2d34b0921ba6f191d678a22bc3b", "score": "0.5416089", "text": "function characterdatareplacedataexceedslengthofarg() {\n var success;\n if(checkInitialization(builder, \"characterdatareplacedataexceedslengthofarg\") != null) return;\n var doc;\n var elementList;\n var nameNode;\n var child;\n var childData;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"staff\");\n elementList = doc.getElementsByTagName(\"address\");\n nameNode = elementList.item(0);\n child = nameNode.firstChild;\n\n child.replaceData(0,4,\"260030\");\n childData = child.data;\n\n assertEquals(\"characterdataReplaceDataExceedsLengthOfArgAssert\",\"260030 North Ave. Dallas, Texas 98551\",childData);\n \n}", "title": "" }, { "docid": "2c7e6ae8a34ea881e854d46cf830aad4", "score": "0.54122823", "text": "function hc_nodeinsertbeforenodeancestor() {\n var success;\n if(checkInitialization(builder, \"hc_nodeinsertbeforenodeancestor\") != null) return;\n var doc;\n var newChild;\n var elementList;\n var employeeNode;\n var childList;\n var refChild;\n var insertedNode;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"hc_staff\");\n newChild = doc.documentElement;\n\n elementList = doc.getElementsByTagName(\"p\");\n employeeNode = elementList.item(1);\n childList = employeeNode.childNodes;\n\n refChild = childList.item(0);\n \n\t{\n\t\tsuccess = false;\n\t\ttry {\n insertedNode = employeeNode.insertBefore(newChild,refChild);\n }\n\t\tcatch(ex) {\n success = (typeof(ex.code) != 'undefined' && ex.code == 3);\n\t\t}\n\t\tassertTrue(\"throw_HIERARCHY_REQUEST_ERR\",success);\n\t}\n\n}", "title": "" }, { "docid": "684166c015ebc7cb4d9ef10c7e9888d9", "score": "0.53927594", "text": "function nodeinsertbeforenewchilddiffdocument() {\n var success;\n if(checkInitialization(builder, \"nodeinsertbeforenewchilddiffdocument\") != null) return;\n var doc1;\n var doc2;\n var refChild;\n var newChild;\n var elementList;\n var elementNode;\n var insertedNode;\n \n var doc1Ref = null;\n if (typeof(this.doc1) != 'undefined') {\n doc1Ref = this.doc1;\n }\n doc1 = load(doc1Ref, \"doc1\", \"staff\");\n \n var doc2Ref = null;\n if (typeof(this.doc2) != 'undefined') {\n doc2Ref = this.doc2;\n }\n doc2 = load(doc2Ref, \"doc2\", \"staff\");\n newChild = doc1.createElement(\"newChild\");\n elementList = doc2.getElementsByTagName(\"employee\");\n elementNode = elementList.item(1);\n refChild = elementNode.firstChild;\n\n \n\t{\n\t\tsuccess = false;\n\t\ttry {\n insertedNode = elementNode.insertBefore(newChild,refChild);\n }\n\t\tcatch(ex) {\n success = (typeof(ex.code) != 'undefined' && ex.code == 4);\n\t\t}\n\t\tassertTrue(\"throw_WRONG_DOCUMENT_ERR\",success);\n\t}\n\n}", "title": "" }, { "docid": "4a7413e0ebaf485228c8464dd0b47d11", "score": "0.5376846", "text": "function hc_characterdatareplacedataexceedslengthofarg() {\n var success;\n if(checkInitialization(builder, \"hc_characterdatareplacedataexceedslengthofarg\") != null) return;\n var doc;\n var elementList;\n var nameNode;\n var child;\n var childData;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"hc_staff\");\n elementList = doc.getElementsByTagName(\"acronym\");\n nameNode = elementList.item(0);\n child = nameNode.firstChild;\n\n child.replaceData(0,4,\"260030\");\n childData = child.data;\n\n assertEquals(\"characterdataReplaceDataExceedsLengthOfArgAssert\",\"260030 North Ave. Dallas, Texas 98551\",childData);\n \n}", "title": "" }, { "docid": "a49eeb5f7dfa6b418dec13daa1dfbd94", "score": "0.5354297", "text": "function characterdatareplacedataend() {\n var success;\n if(checkInitialization(builder, \"characterdatareplacedataend\") != null) return;\n var doc;\n var elementList;\n var nameNode;\n var child;\n var childData;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"staff\");\n elementList = doc.getElementsByTagName(\"address\");\n nameNode = elementList.item(0);\n child = nameNode.firstChild;\n\n child.replaceData(30,5,\"98665\");\n childData = child.data;\n\n assertEquals(\"characterdataReplaceDataEndAssert\",\"1230 North Ave. Dallas, Texas 98665\",childData);\n \n}", "title": "" }, { "docid": "5c1c584e05f7b27d2a13832e2b10838c", "score": "0.5348183", "text": "insertAt(index, data) {\n if (!this.isValidIndex(index)) {\n console.log('error insertAt');\n return;\n }\n\n let node = this.at(index, true);\n\n node.data = data;\n\n return node.data;\n }", "title": "" }, { "docid": "5b083543fa780f44d7ceab0dffd533be", "score": "0.5335386", "text": "function hc_characterdatareplacedataend() {\n var success;\n if(checkInitialization(builder, \"hc_characterdatareplacedataend\") != null) return;\n var doc;\n var elementList;\n var nameNode;\n var child;\n var childData;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"hc_staff\");\n elementList = doc.getElementsByTagName(\"acronym\");\n nameNode = elementList.item(0);\n child = nameNode.firstChild;\n\n child.replaceData(30,5,\"98665\");\n childData = child.data;\n\n assertEquals(\"characterdataReplaceDataEndAssert\",\"1230 North Ave. Dallas, Texas 98665\",childData);\n \n}", "title": "" }, { "docid": "ddbe1ead492def22b4e714333ad592d1", "score": "0.5319283", "text": "function nodeinsertbeforedocfragment() {\n var success;\n if(checkInitialization(builder, \"nodeinsertbeforedocfragment\") != null) return;\n var doc;\n var elementList;\n var employeeNode;\n var childList;\n var refChild;\n var newdocFragment;\n var newChild1;\n var newChild2;\n var child;\n var childName;\n var appendedChild;\n var insertedNode;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"staff\");\n elementList = doc.getElementsByTagName(\"employee\");\n employeeNode = elementList.item(1);\n childList = employeeNode.childNodes;\n\n refChild = childList.item(3);\n newdocFragment = doc.createDocumentFragment();\n newChild1 = doc.createElement(\"newChild1\");\n newChild2 = doc.createElement(\"newChild2\");\n appendedChild = newdocFragment.appendChild(newChild1);\n appendedChild = newdocFragment.appendChild(newChild2);\n insertedNode = employeeNode.insertBefore(newdocFragment,refChild);\n child = childList.item(3);\n childName = child.nodeName;\n\n assertEquals(\"childName3\",\"newChild1\",childName);\n child = childList.item(4);\n childName = child.nodeName;\n\n assertEquals(\"childName4\",\"newChild2\",childName);\n \n}", "title": "" }, { "docid": "be15358c4ac85c924870efb7063145c2", "score": "0.5318385", "text": "function hc_nodeinsertbeforedocfragment() {\n var success;\n if(checkInitialization(builder, \"hc_nodeinsertbeforedocfragment\") != null) return;\n var doc;\n var elementList;\n var employeeNode;\n var childList;\n var refChild;\n var newdocFragment;\n var newChild1;\n var newChild2;\n var child;\n var childName;\n var appendedChild;\n var insertedNode;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"hc_staff\");\n elementList = doc.getElementsByTagName(\"p\");\n employeeNode = elementList.item(1);\n childList = employeeNode.childNodes;\n\n refChild = childList.item(3);\n newdocFragment = doc.createDocumentFragment();\n newChild1 = doc.createElement(\"br\");\n newChild2 = doc.createElement(\"b\");\n appendedChild = newdocFragment.appendChild(newChild1);\n appendedChild = newdocFragment.appendChild(newChild2);\n insertedNode = employeeNode.insertBefore(newdocFragment,refChild);\n child = childList.item(3);\n childName = child.nodeName;\n\n assertEqualsAutoCase(\"element\", \"childName3\",\"br\",childName);\n child = childList.item(4);\n childName = child.nodeName;\n\n assertEqualsAutoCase(\"element\", \"childName4\",\"b\",childName);\n \n}", "title": "" }, { "docid": "a61e7c341f8ca2fe42ae8f46e96366b6", "score": "0.5246556", "text": "insert(content, x) {}", "title": "" }, { "docid": "74c33f9350e0a9ffbe942080dff82ec6", "score": "0.5236369", "text": "function characterdataappenddatanomodificationallowederrEE() {\n var success;\n if(checkInitialization(builder, \"characterdataappenddatanomodificationallowederrEE\") != null) return;\n var doc;\n var genderList;\n var genderNode;\n var entText;\n var entReference;\n var appendedChild;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"staff\");\n genderList = doc.getElementsByTagName(\"gender\");\n genderNode = genderList.item(2);\n entReference = doc.createEntityReference(\"ent3\");\n assertNotNull(\"createdEntRefNotNull\",entReference);\nappendedChild = genderNode.appendChild(entReference);\n entText = entReference.firstChild;\n\n assertNotNull(\"entTextNotNull\",entText);\n\n\t{\n\t\tsuccess = false;\n\t\ttry {\n entText.appendData(\"newString\");\n }\n\t\tcatch(ex) {\n success = (typeof(ex.code) != 'undefined' && ex.code == 7);\n\t\t}\n\t\tassertTrue(\"throw_NO_MODIFICATION_ALLOWED_ERR\",success);\n\t}\n\n}", "title": "" }, { "docid": "6c22e2e9c9864f8968e0d37bcf79a28a", "score": "0.5236285", "text": "function hc_attrinsertbefore6() {\n var success;\n if(checkInitialization(builder, \"hc_attrinsertbefore6\") != null) return;\n var doc;\n var acronymList;\n var testNode;\n var attributes;\n var titleAttr;\n var value;\n var textNode;\n var retval;\n var refChild = null;\n\n var otherDoc;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"hc_staff\");\n \n var otherDocRef = null;\n if (typeof(this.otherDoc) != 'undefined') {\n otherDocRef = this.otherDoc;\n }\n otherDoc = load(otherDocRef, \"otherDoc\", \"hc_staff\");\n acronymList = doc.getElementsByTagName(\"acronym\");\n testNode = acronymList.item(3);\n attributes = testNode.attributes;\n\n titleAttr = attributes.getNamedItem(\"title\");\n textNode = otherDoc.createTextNode(\"terday\");\n \n\t{\n\t\tsuccess = false;\n\t\ttry {\n retval = titleAttr.insertBefore(textNode,refChild);\n }\n\t\tcatch(ex) {\n success = (typeof(ex.code) != 'undefined' && ex.code == 4);\n\t\t}\n\t\tassertTrue(\"throw_WRONG_DOCUMENT_ERR\",success);\n\t}\n\n}", "title": "" }, { "docid": "2558897f0571afe41d30102292169a1d", "score": "0.5230771", "text": "function insert( a, b, pos ) {\r\n return [a.slice(0, pos), b, a.slice(pos)].join('');\r\n }", "title": "" }, { "docid": "248cf7160e70cc133711caac2d38fef1", "score": "0.5211849", "text": "function insert(string1,string2,index) {\n \n if(string1.length > index) { var result1 = string1.slice(0,index);\n var result2 = string1.slice(index);\n return result1.concat(string2) + \" \" + result2;\n }\n else return string2.concat(\" \", string1);\n }", "title": "" }, { "docid": "fa1acff9bfc60f1889ef1bfe2243327f", "score": "0.51992446", "text": "insertWord(word) {\n const firstLetter = word.slice(0, 1); //can be '' if word is empty\n let child = this.children.get(firstLetter);\n if (!child) {\n child = new TextTree;\n this.children.set(firstLetter, child);\n }\n if (word)\n child.insertWord(word.substring(1));\n }", "title": "" }, { "docid": "1a5d023548c66dca487291f62449748c", "score": "0.5196844", "text": "function characterdatareplacedataexceedslengthofdata() {\n var success;\n if(checkInitialization(builder, \"characterdatareplacedataexceedslengthofdata\") != null) return;\n var doc;\n var elementList;\n var nameNode;\n var child;\n var childData;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"staff\");\n elementList = doc.getElementsByTagName(\"address\");\n nameNode = elementList.item(0);\n child = nameNode.firstChild;\n\n child.replaceData(0,50,\"2600\");\n childData = child.data;\n\n assertEquals(\"characterdataReplaceDataExceedsLengthOfDataAssert\",\"2600\",childData);\n \n}", "title": "" }, { "docid": "88c97de7940d4dc99fbcf8c5ae002be8", "score": "0.51939166", "text": "function insert(str, index, value) {\n return str.substr(0, index) + value + str.substr(index);\n }", "title": "" }, { "docid": "32258cef1a6c9bfc8eef6e5e16bd86e8", "score": "0.51804346", "text": "insert(data) {\n\t\t// Creating a node and initializing with data\n\t\tlet newNode = new Node(data)\n\t\t// If the root is null, the we point the root to the newNode\n\t\tif (this.root === null) {\n\t\t\tthis.root = newNode\n\t\t} else {\n\t\t\t// We find the correct position in the tree and add the node\n\t\t\tthis.insertNode(this.root, newNode)\n\t\t}\n\t}", "title": "" }, { "docid": "ff1281b3d18ad28b69f67ab7409de660", "score": "0.5171289", "text": "function generateInsertString(groupName,insert)\n{\n\treturn groupName+\":insert(\"+insert+\")\\n\\t\";\n}", "title": "" }, { "docid": "07e7203256d6dab5147e41eceea14a20", "score": "0.51402515", "text": "function hc_characterdataindexsizeerrinsertdataoffsetgreater() {\n var success;\n if(checkInitialization(builder, \"hc_characterdataindexsizeerrinsertdataoffsetgreater\") != null) return;\n var doc;\n var elementList;\n var nameNode;\n var child;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"hc_staff\");\n elementList = doc.getElementsByTagName(\"acronym\");\n nameNode = elementList.item(0);\n child = nameNode.firstChild;\n\n \n\t{\n\t\tsuccess = false;\n\t\ttry {\n child.deleteData(40,3);\n }\n\t\tcatch(ex) {\n success = (typeof(ex.code) != 'undefined' && ex.code == 1);\n\t\t}\n\t\tassertTrue(\"throw_INDEX_SIZE_ERR\",success);\n\t}\n\n}", "title": "" }, { "docid": "fcf2955164f5aa3621fda530ecaaef3e", "score": "0.51322967", "text": "function hc_nodeinsertbeforerefchildnull() {\n var success;\n if(checkInitialization(builder, \"hc_nodeinsertbeforerefchildnull\") != null) return;\n var doc;\n var elementList;\n var employeeNode;\n var childList;\n var refChild = null;\n\n var newChild;\n var child;\n var childName;\n var insertedNode;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"hc_staff\");\n elementList = doc.getElementsByTagName(\"p\");\n employeeNode = elementList.item(1);\n childList = employeeNode.childNodes;\n\n newChild = doc.createElement(\"br\");\n insertedNode = employeeNode.insertBefore(newChild,refChild);\n child = employeeNode.lastChild;\n\n childName = child.nodeName;\n\n assertEqualsAutoCase(\"element\", \"nodeName\",\"br\",childName);\n \n}", "title": "" }, { "docid": "96166db5f569ed5afab32c3ea28d8039", "score": "0.5126191", "text": "function nodeinsertbeforenodeancestor() {\n var success;\n if(checkInitialization(builder, \"nodeinsertbeforenodeancestor\") != null) return;\n var doc;\n var newChild;\n var elementList;\n var employeeNode;\n var childList;\n var refChild;\n var insertedNode;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"staff\");\n newChild = doc.documentElement;\n\n elementList = doc.getElementsByTagName(\"employee\");\n employeeNode = elementList.item(1);\n childList = employeeNode.childNodes;\n\n refChild = childList.item(0);\n \n\t{\n\t\tsuccess = false;\n\t\ttry {\n insertedNode = employeeNode.insertBefore(newChild,refChild);\n }\n\t\tcatch(ex) {\n success = (typeof(ex.code) != 'undefined' && ex.code == 3);\n\t\t}\n\t\tassertTrue(\"throw_HIERARCHY_REQUEST_ERR\",success);\n\t}\n\n}", "title": "" }, { "docid": "c0a5b02446e4fff42d50d6d549b2f824", "score": "0.5093309", "text": "insert(pos, text, callback) {\n const uniPos = unicount_1.strPosToUni(getSnapshot(), pos);\n return submitOp([uniPos, text], callback);\n }", "title": "" }, { "docid": "8a088054f543f129cb91ac981488bf65", "score": "0.50921154", "text": "function hc_nodeinsertbeforenewchilddiffdocument() {\n var success;\n if(checkInitialization(builder, \"hc_nodeinsertbeforenewchilddiffdocument\") != null) return;\n var doc1;\n var doc2;\n var refChild;\n var newChild;\n var elementList;\n var elementNode;\n var insertedNode;\n \n var doc1Ref = null;\n if (typeof(this.doc1) != 'undefined') {\n doc1Ref = this.doc1;\n }\n doc1 = load(doc1Ref, \"doc1\", \"hc_staff\");\n \n var doc2Ref = null;\n if (typeof(this.doc2) != 'undefined') {\n doc2Ref = this.doc2;\n }\n doc2 = load(doc2Ref, \"doc2\", \"hc_staff\");\n newChild = doc1.createElement(\"br\");\n elementList = doc2.getElementsByTagName(\"p\");\n elementNode = elementList.item(1);\n refChild = elementNode.firstChild;\n\n \n\t{\n\t\tsuccess = false;\n\t\ttry {\n insertedNode = elementNode.insertBefore(newChild,refChild);\n }\n\t\tcatch(ex) {\n success = (typeof(ex.code) != 'undefined' && ex.code == 4);\n\t\t}\n\t\tassertTrue(\"throw_WRONG_DOCUMENT_ERR\",success);\n\t}\n\n}", "title": "" }, { "docid": "86a976ad5653af2eae9a5a08d0437dfe", "score": "0.5088713", "text": "function characterdataindexsizeerrreplacedataoffsetgreater() {\n var success;\n if(checkInitialization(builder, \"characterdataindexsizeerrreplacedataoffsetgreater\") != null) return;\n var doc;\n var elementList;\n var nameNode;\n var child;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"staff\");\n elementList = doc.getElementsByTagName(\"address\");\n nameNode = elementList.item(0);\n child = nameNode.firstChild;\n\n \n\t{\n\t\tsuccess = false;\n\t\ttry {\n child.replaceData(40,3,\"ABC\");\n }\n\t\tcatch(ex) {\n success = (typeof(ex.code) != 'undefined' && ex.code == 1);\n\t\t}\n\t\tassertTrue(\"throw_INDEX_SIZE_ERR\",success);\n\t}\n\n}", "title": "" }, { "docid": "00aec6ce11204c77906b1b20b2eca3e5", "score": "0.5082959", "text": "function hc_characterdatareplacedataexceedslengthofdata() {\n var success;\n if(checkInitialization(builder, \"hc_characterdatareplacedataexceedslengthofdata\") != null) return;\n var doc;\n var elementList;\n var nameNode;\n var child;\n var childData;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"hc_staff\");\n elementList = doc.getElementsByTagName(\"acronym\");\n nameNode = elementList.item(0);\n child = nameNode.firstChild;\n\n child.replaceData(0,50,\"2600\");\n childData = child.data;\n\n assertEquals(\"characterdataReplaceDataExceedsLengthOfDataAssert\",\"2600\",childData);\n \n}", "title": "" }, { "docid": "a60ee7d19c30837cd31bb754436e5225", "score": "0.5079211", "text": "function insert(str, index, add, del=0) {\n\t\treturn str.slice(0, index) + add + str.slice(index + del);\n\t}", "title": "" }, { "docid": "1f4061554596b51a7e6a02b2d848b5d3", "score": "0.50763935", "text": "function insertString(maskCharData, selectionStart, newString) {\n var stringIndex = 0;\n var nextIndex = 0;\n var isStringInserted = false;\n // Iterate through _maskCharData finding values with a displayIndex after the specified range start\n for (var i = 0; i < maskCharData.length && stringIndex < newString.length; i++) {\n if (maskCharData[i].displayIndex >= selectionStart) {\n isStringInserted = true;\n nextIndex = maskCharData[i].displayIndex;\n // Find the next character in the newString that matches the format\n while (stringIndex < newString.length) {\n // If the character matches the format regexp, set the maskCharData to the new character\n if (maskCharData[i].format.test(newString.charAt(stringIndex))) {\n maskCharData[i].value = newString.charAt(stringIndex++);\n // Set the nextIndex to the display index of the next mask format character.\n if (i + 1 < maskCharData.length) {\n nextIndex = maskCharData[i + 1].displayIndex;\n }\n else {\n nextIndex++;\n }\n break;\n }\n stringIndex++;\n }\n }\n }\n return isStringInserted ? nextIndex : selectionStart;\n}", "title": "" }, { "docid": "1f4061554596b51a7e6a02b2d848b5d3", "score": "0.50763935", "text": "function insertString(maskCharData, selectionStart, newString) {\n var stringIndex = 0;\n var nextIndex = 0;\n var isStringInserted = false;\n // Iterate through _maskCharData finding values with a displayIndex after the specified range start\n for (var i = 0; i < maskCharData.length && stringIndex < newString.length; i++) {\n if (maskCharData[i].displayIndex >= selectionStart) {\n isStringInserted = true;\n nextIndex = maskCharData[i].displayIndex;\n // Find the next character in the newString that matches the format\n while (stringIndex < newString.length) {\n // If the character matches the format regexp, set the maskCharData to the new character\n if (maskCharData[i].format.test(newString.charAt(stringIndex))) {\n maskCharData[i].value = newString.charAt(stringIndex++);\n // Set the nextIndex to the display index of the next mask format character.\n if (i + 1 < maskCharData.length) {\n nextIndex = maskCharData[i + 1].displayIndex;\n }\n else {\n nextIndex++;\n }\n break;\n }\n stringIndex++;\n }\n }\n }\n return isStringInserted ? nextIndex : selectionStart;\n}", "title": "" }, { "docid": "1f4061554596b51a7e6a02b2d848b5d3", "score": "0.50763935", "text": "function insertString(maskCharData, selectionStart, newString) {\n var stringIndex = 0;\n var nextIndex = 0;\n var isStringInserted = false;\n // Iterate through _maskCharData finding values with a displayIndex after the specified range start\n for (var i = 0; i < maskCharData.length && stringIndex < newString.length; i++) {\n if (maskCharData[i].displayIndex >= selectionStart) {\n isStringInserted = true;\n nextIndex = maskCharData[i].displayIndex;\n // Find the next character in the newString that matches the format\n while (stringIndex < newString.length) {\n // If the character matches the format regexp, set the maskCharData to the new character\n if (maskCharData[i].format.test(newString.charAt(stringIndex))) {\n maskCharData[i].value = newString.charAt(stringIndex++);\n // Set the nextIndex to the display index of the next mask format character.\n if (i + 1 < maskCharData.length) {\n nextIndex = maskCharData[i + 1].displayIndex;\n }\n else {\n nextIndex++;\n }\n break;\n }\n stringIndex++;\n }\n }\n }\n return isStringInserted ? nextIndex : selectionStart;\n}", "title": "" }, { "docid": "a90bffe0144fa6d7b7f149704b1352ad", "score": "0.5073005", "text": "function addData(data) {\n //console.log(` Adding: ${data.name} (${data.owner})`);\n PassesInfo.insert(data);\n}", "title": "" }, { "docid": "4989f22140aab51764026963d1ed9394", "score": "0.5051744", "text": "function characterdatareplacedatanomodificationallowederrEE() {\n var success;\n if(checkInitialization(builder, \"characterdatareplacedatanomodificationallowederrEE\") != null) return;\n var doc;\n var genderList;\n var genderNode;\n var entText;\n var entReference;\n var appendedNode;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"staff\");\n genderList = doc.getElementsByTagName(\"gender\");\n genderNode = genderList.item(2);\n entReference = doc.createEntityReference(\"ent3\");\n assertNotNull(\"createdEntRefNotNull\",entReference);\nappendedNode = genderNode.appendChild(entReference);\n entText = entReference.firstChild;\n\n assertNotNull(\"entTextNotNull\",entText);\n\n\t{\n\t\tsuccess = false;\n\t\ttry {\n entText.replaceData(1,3,\"newArg\");\n }\n\t\tcatch(ex) {\n success = (typeof(ex.code) != 'undefined' && ex.code == 7);\n\t\t}\n\t\tassertTrue(\"throw_NO_MODIFICATION_ALLOWED_ERR\",success);\n\t}\n\n}", "title": "" }, { "docid": "20d238098111091387a33a14a58fb1ce", "score": "0.50511783", "text": "function oldInsertCharacter(character)\n{\n var selectionRange = Selection_get();\n if (selectionRange == null)\n return;\n\n if (!Range_isEmpty(selectionRange))\n Selection_deleteContents();\n var pos = selectionRange.start;\n var node = pos.node;\n var offset = pos.offset;\n\n if (node.nodeType == Node.ELEMENT_NODE) {\n var prev = node.childNodes[offset-1];\n var next = node.childNodes[offset];\n var emptyTextNode = DOM_createTextNode(document,\"\");\n if (offset >= node.childNodes.length)\n DOM_appendChild(node,emptyTextNode);\n else\n DOM_insertBefore(node,emptyTextNode,node.childNodes[offset]);\n node = emptyTextNode;\n offset = 0;\n }\n\n DOM_insertCharacters(node,offset,character);\n Selection_set(node,offset+1,node,offset+1);\n}", "title": "" }, { "docid": "5709f2d6c1e4ff5e1146edb054fceab8", "score": "0.50362444", "text": "function CharacterData () //extend Node\r\n{\r\n\tNode.call(this); // constructor de la superclase\r\n\t/**\r\n\t\tAtributo publico readonly: nativeObj\r\n\t\t@datatype: Object\r\n\t\t@nodomattribute\r\n\t*/\r\n\tthis.nativeObj = null; // instancia del elemento nativo en el Node\r\n\r\n\t/**\r\n\t\tAtributo publico readonly: data\r\n\t\t@datatype: String\r\n\t*/\r\n\tthis.data = new String();\r\n\t\r\n\t/**\r\n\t\tAtributo publico readonly: length\r\n\t\t@datatype: Integer\r\n\t*/\r\n\tthis.length = this.data.length;\r\n\r\n\t/**\r\n\t\tMetodo publico: appendData\r\n\t\t@params \r\n\t\t\targ - String\r\n\t\t@returns: None\r\n\t\t@exceptions: \r\n\t\t\tNO_MODIFICATION_ALLOWED_ERR\r\n\t*/\r\n\tthis.appendData = function (arg){\r\n\t\tthis.data += arg;\r\n\t\tthis.nodeValue += arg;\r\n\t\tthis.length = this.data.length;\r\n\t\tthis.nativeObj.appendData(arg); // realizo la operacion en el nodo nativo\r\n\t}\r\n\r\n\t/**\r\n\t\tMetodo publico: deleteData\r\n\t\t@params \r\n\t\t\toffset - Integer\r\n\t\t\tcount - Integer\r\n\t\t@returns: None\r\n\t\t@exceptions: \r\n\t\t\tINDEX_SIZE_ERR\r\n\t\t\tNO_MODIFICATION_ALLOWED_ERR\r\n\t*/\r\n\tthis.deleteData = function (offset,count){\r\n\t\tif(offset<0 || count<0 || offset>this.length) \r\n\t\t\tthrow new DOMException(sWebGl.INDEX_SIZE_ERR);\r\n\r\n\t\tvar arr = this.data.split(\"\");\r\n\t\tarr.splice(offset,count);\r\n\r\n\t\tvar str = new String();\r\n\t\tfor(var i=0; i<arr.length; i++)\r\n\t\t\tstr += arr[i];\r\n\r\n\t\tthis.data = str\r\n\t\tthis.nodeValue = str\r\n\t\tthis.length = str.length;\r\n\r\n\t\tthis.nativeObj.deleteData(offset,count); // realizo la operacion en el nodo nativo\r\n\t}\r\n\r\n\t/**\r\n\t\tMetodo publico: insertData\r\n\t\t@params \r\n\t\t\toffset - Integer\r\n\t\t\targ - String\r\n\t\t@returns: None\r\n\t\t@exceptions: \r\n\t\t\tINDEX_SIZE_ERR\r\n\t\t\tNO_MODIFICATION_ALLOWED_ERR\r\n\t*/\r\n\tthis.insertData = function (offset,arg){\r\n\t\tif(offset<0 || offset>this.length) \r\n\t\t\tthrow new DOMException(sWebGl.INDEX_SIZE_ERR);\r\n\r\n\t\tvar arr = this.data.split(\"\");\r\n\t\tarr.splice(offset,0,arg);\r\n\r\n\t\tvar str = new String();\r\n\t\tfor(var i=0; i<arr.length; i++)\r\n\t\t\tstr += arr[i];\r\n\r\n\t\tthis.data = str\r\n\t\tthis.nodeValue = str\r\n\t\tthis.length = str.length;\r\n\r\n\t\tthis.nativeObj.insertData(offset,arg); // realizo la operacion en el nodo nativo\r\n\t}\r\n\r\n\t/**\r\n\t\tMetodo publico: replaceData\r\n\t\t@params \r\n\t\t\toffset - Integer\r\n\t\t\tcount - Integer\r\n\t\t\targ - String\r\n\t\t@returns: String\r\n\t\t@exceptions: \r\n\t\t\tINDEX_SIZE_ERR\r\n\t\t\tDOMSTRING_SIZE_ERR\r\n\t*/\r\n\tthis.replaceData = function (offset,count,arg){\r\n\t\tif(offset<0 || count<0 || offset>this.length) \r\n\t\t\tthrow new DOMException(sWebGl.INDEX_SIZE_ERR);\r\n\r\n\t\tvar arr = this.data.split(\"\");\r\n\t\tarr.splice(offset,count,arg);\r\n\r\n\t\tvar str = new String();\r\n\t\tfor(var i=0; i<arr.length; i++)\r\n\t\t\tstr += arr[i];\r\n\r\n\t\tthis.data = str\r\n\t\tthis.nodeValue = str\r\n\t\tthis.length = str.length;\r\n\r\n\t\tthis.nativeObj.replaceData(offset,count,arg); // realizo la operacion en el nodo nativo\r\n\t}\r\n\r\n\t/**\r\n\t\tMetodo publico: substringData\r\n\t\t@params \r\n\t\t\toffset - Integer\r\n\t\t\tcount - Integer\r\n\t\t@returns: String\r\n\t\t@exceptions: \r\n\t\t\tINDEX_SIZE_ERR\r\n\t\t\tDOMSTRING_SIZE_ERR\r\n\t*/\r\n\tthis.substringData = function (offset,count){\r\n\t\tif(offset<0 || count<0 || offset>this.length) \r\n\t\t\tthrow new DOMException(sWebGl.INDEX_SIZE_ERR);\r\n\r\n\t\treturn this.data.substr(offset,count);\r\n\t}\r\n}", "title": "" }, { "docid": "58c318bb54dd01c3cb99bc6fd183fd5c", "score": "0.5018164", "text": "function insertBeforeEachLine(text, insertion, selection) {\n var substring = text.slice(selection[0], selection[1]);\n var lines = substring.split(/\\n/);\n\n var insertionLength = 0;\n var modifiedText = lines.map(function (item, index) {\n if (typeof insertion === 'string') {\n insertionLength += insertion.length;\n return insertion + item;\n } else if (typeof insertion === 'function') {\n var insertionResult = insertion(item, index);\n insertionLength += insertionResult.length;\n return insertion(item, index) + item;\n }\n throw Error('insertion is expected to be either a string or a function');\n }).join('\\n');\n\n var newText = text.slice(0, selection[0]) + modifiedText + text.slice(selection[1]);\n return { newText: newText, newSelection: [selection[0], selection[1] + insertionLength] };\n}", "title": "" }, { "docid": "a7bbe21917b83a606d9732fcb37d6390", "score": "0.5010979", "text": "function characterdatainsertdatanomodificationallowederr() {\n var success;\n if(checkInitialization(builder, \"characterdatainsertdatanomodificationallowederr\") != null) return;\n var doc;\n var genderList;\n var genderNode;\n var entElement;\n var nodeType;\n var entElementContent;\n var entReference;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"staff\");\n genderList = doc.getElementsByTagName(\"gender\");\n genderNode = genderList.item(2);\n entReference = genderNode.firstChild;\n\n assertNotNull(\"entReferenceNotNull\",entReference);\nnodeType = entReference.nodeType;\n\n \n\tif(\n\t(1 == nodeType)\n\t) {\n\tentReference = doc.createEntityReference(\"ent4\");\n assertNotNull(\"createdEntRefNotNull\",entReference);\n\n\t}\n\tentElement = entReference.firstChild;\n\n assertNotNull(\"entElementNotNull\",entElement);\nentElementContent = entElement.firstChild;\n\n assertNotNull(\"entElementContentNotNull\",entElementContent);\n\n\t{\n\t\tsuccess = false;\n\t\ttry {\n entElementContent.insertData(1,\"newArg\");\n }\n\t\tcatch(ex) {\n success = (typeof(ex.code) != 'undefined' && ex.code == 7);\n\t\t}\n\t\tassertTrue(\"throw_NO_MODIFICATION_ALLOWED_ERR\",success);\n\t}\n\n}", "title": "" }, { "docid": "10e5593b8ede0afacd5fe4480385921d", "score": "0.50081307", "text": "function insertString(maskCharData, selectionStart, newString) {\r\n var stringIndex = 0, nextIndex = 0;\r\n // Iterate through _maskCharData finding values with a displayIndex after the specified range start\r\n for (var i = 0; i < maskCharData.length && stringIndex < newString.length; i++) {\r\n if (maskCharData[i].displayIndex >= selectionStart) {\r\n nextIndex = maskCharData[i].displayIndex;\r\n // Find the next character in the newString that matches the format\r\n while (stringIndex < newString.length) {\r\n // If the character matches the format regexp, set the maskCharData to the new character\r\n if (maskCharData[i].format.test(newString.charAt(stringIndex))) {\r\n maskCharData[i].value = newString.charAt(stringIndex++);\r\n // Set the nextIndex to the display index of the next mask format character.\r\n if (i + 1 < maskCharData.length) {\r\n nextIndex = maskCharData[i + 1].displayIndex;\r\n }\r\n else {\r\n nextIndex++;\r\n }\r\n break;\r\n }\r\n stringIndex++;\r\n }\r\n }\r\n }\r\n return nextIndex;\r\n}", "title": "" }, { "docid": "e0c53632265927f1fdf680b766c29ca5", "score": "0.4999366", "text": "insert(data) {\n var newNode = new Node(data);\n\n if (this.root === null) {\n node.left = newNode;\n } else {\n tree.insertNode(this.root, newNode);\n }\n }", "title": "" }, { "docid": "aa334bc11aa447264a85d37c02cf0fc1", "score": "0.499361", "text": "function hc_attrinsertbefore5() {\n var success;\n if(checkInitialization(builder, \"hc_attrinsertbefore5\") != null) return;\n var doc;\n var acronymList;\n var testNode;\n var attributes;\n var titleAttr;\n var value;\n var textNode;\n var retval;\n var refChild = null;\n\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"hc_staff\");\n acronymList = doc.getElementsByTagName(\"acronym\");\n testNode = acronymList.item(3);\n attributes = testNode.attributes;\n\n titleAttr = attributes.getNamedItem(\"title\");\n \n\tif(\n\t\n\t(builder.contentType == \"text/html\")\n\n\t) {\n\t\n\t{\n\t\tsuccess = false;\n\t\ttry {\n textNode = doc.createCDATASection(\"terday\");\n }\n\t\tcatch(ex) {\n success = (typeof(ex.code) != 'undefined' && ex.code == 9);\n\t\t}\n\t\tassertTrue(\"throw_NOT_SUPPORTED_ERR\",success);\n\t}\n\n\t}\n\t\n\t\telse {\n\t\t\ttextNode = doc.createCDATASection(\"terday\");\n \n\t{\n\t\tsuccess = false;\n\t\ttry {\n retval = titleAttr.insertBefore(textNode,refChild);\n }\n\t\tcatch(ex) {\n success = (typeof(ex.code) != 'undefined' && ex.code == 3);\n\t\t}\n\t\tassertTrue(\"throw_HIERARCHY_REQUEST_ERR\",success);\n\t}\n\n\t\t}\n\t\n}", "title": "" }, { "docid": "8c069b758ac46ea882870843391a747d", "score": "0.49905673", "text": "function insertDataStructures(tree, dataStructures) {\n if (!dataStructures || dataStructures.length === 0)\n return tree\n\n const headingMarkdown = {\n \"type\": \"heading\",\n \"depth\": 1,\n \"children\": [ { \"type\": \"text\", \"value\": \"Data Structures\" } ],\n }\n\n const dataStructureAST = flatten(dataStructures.map(({ id, children }) => {\n return [\n {\n \"type\": \"heading\",\n \"depth\": 2,\n \"children\": [ { \"type\": \"text\", \"value\": id } ],\n },\n ...children\n ]\n }))\n\n tree.children = [ ...tree.children, headingMarkdown, ...dataStructureAST ]\n\n return tree\n}", "title": "" }, { "docid": "23c9fdf42db8e65fe3289b0f72811dd2", "score": "0.49887553", "text": "function insertString(maskCharData, selectionStart, newString) {\n var stringIndex = 0;\n var nextIndex = 0;\n var isStringInserted = false; // Iterate through _maskCharData finding values with a displayIndex after the specified range start\n\n for (var i = 0; i < maskCharData.length && stringIndex < newString.length; i++) {\n if (maskCharData[i].displayIndex >= selectionStart) {\n isStringInserted = true;\n nextIndex = maskCharData[i].displayIndex; // Find the next character in the newString that matches the format\n\n while (stringIndex < newString.length) {\n // If the character matches the format regexp, set the maskCharData to the new character\n if (maskCharData[i].format.test(newString.charAt(stringIndex))) {\n maskCharData[i].value = newString.charAt(stringIndex++); // Set the nextIndex to the display index of the next mask format character.\n\n if (i + 1 < maskCharData.length) {\n nextIndex = maskCharData[i + 1].displayIndex;\n } else {\n nextIndex++;\n }\n\n break;\n }\n\n stringIndex++;\n }\n }\n }\n\n return isStringInserted ? nextIndex : selectionStart;\n}", "title": "" }, { "docid": "da6302ae9fa97152dc6706b388fe3481", "score": "0.498109", "text": "function addData(data) {\n console.log(` Adding: ${data.teamName} (${data.owner})`);\n Teams.insert(data);\n}", "title": "" }, { "docid": "a8efeec4b18689cfba48d1251e887388", "score": "0.4969157", "text": "function nodereplacechildnodename() {\n var success;\n if(checkInitialization(builder, \"nodereplacechildnodename\") != null) return;\n var doc;\n var elementList;\n var employeeNode;\n var childList;\n var oldChild;\n var newChild;\n var replacedNode;\n var length;\n var childName;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"staff\");\n elementList = doc.getElementsByTagName(\"employee\");\n employeeNode = elementList.item(1);\n childList = employeeNode.childNodes;\n\n length = childList.length;\n\n oldChild = childList.item(1);\n newChild = doc.createElement(\"newChild\");\n replacedNode = employeeNode.replaceChild(newChild,oldChild);\n childName = replacedNode.nodeName;\n\n \n\tif(\n\t(6 == length)\n\t) {\n\tassertEquals(\"nowhitespace\",\"name\",childName);\n \n\t}\n\t\n\t\telse {\n\t\t\tassertEquals(\"whitespace\",\"employeeId\",childName);\n \n\t\t}\n\t\n}", "title": "" }, { "docid": "3cc2be0f574943e4eb36bb4fda480d27", "score": "0.49675584", "text": "insert(data) {\n let newNode = new Node(data);\n if (!this.root) {\n this.root = newNode;\n } else {\n this.insertNode(this.root, newNode);\n }\n }", "title": "" }, { "docid": "3b41f88d0c55ba4e722dcdc012bce4fd", "score": "0.49294323", "text": "function insertString(string1, string2, position) {\n if (position === undefined) {\n position = 0;\n }\n var result = '';\n for (var i = 0; i < string1.length; i++) {\n if (i === position) {\n result += string2;\n }\n result += string1[i];\n }\n return result;\n}", "title": "" }, { "docid": "05e270e4696f6228a1fa3e24228c931d", "score": "0.49183175", "text": "function insertBeforeEachLine(text, insertion, selection) {\n var substring = text.slice(selection.start, selection.end);\n var lines = substring.split(/\\n/);\n var insertionLength = 0;\n var modifiedText = lines.map(function (item, index) {\n if (typeof insertion === \"string\") {\n insertionLength += insertion.length;\n return insertion + item;\n }\n else if (typeof insertion === \"function\") {\n var insertionResult = insertion(item, index);\n insertionLength += insertionResult.length;\n return insertion(item, index) + item;\n }\n throw Error(\"insertion is expected to be either a string or a function\");\n }).join(\"\\n\");\n var newText = text.slice(0, selection.start) + modifiedText + text.slice(selection.end);\n return {\n newText: newText,\n insertionLength: insertionLength,\n newSelection: {\n start: lines.length > 1 ? selection.start : selection.start + insertionLength,\n end: selection.end + insertionLength,\n },\n };\n}", "title": "" }, { "docid": "a6ce63d2391dce708e5ab8be78a2d8d8", "score": "0.49167955", "text": "insertAt(data, position) {\n // if position is greater than the size of the list, add to the end of the list\n if (position >= this.size) {\n this.append(data)\n // if position is index 0, preppend the data\n } else if (position === 0) {\n this.preppend(data)\n } else {\n const node = new Node(data);\n // start a counter\n let start = 0;\n // keep track of previous and current node\n let previous = null,\n current = this.getFirst();\n // iterate over the list until the given position is reached\n while (start < position) {\n previous = current;\n current = current.next;\n start++\n };\n // attach the current node to the pointer of the insert element\n node.next = current;\n // set the previous node to point to the insert element\n previous.next = node;\n\n }\n // increase the size\n this.size += 1;\n }", "title": "" }, { "docid": "f5c81cb0df867b4051923125a5eb89a7", "score": "0.4905993", "text": "function insert(position, newText) {\n return { range: { start: position, end: position }, newText: newText };\n }", "title": "" }, { "docid": "20216b3a7f222bd75bc03365809fcd3b", "score": "0.49011827", "text": "function nodeinsertbeforerefchildnull() {\n var success;\n if(checkInitialization(builder, \"nodeinsertbeforerefchildnull\") != null) return;\n var doc;\n var elementList;\n var employeeNode;\n var childList;\n var refChild = null;\n\n var newChild;\n var child;\n var childName;\n var insertedNode;\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"staff\");\n elementList = doc.getElementsByTagName(\"employee\");\n employeeNode = elementList.item(1);\n childList = employeeNode.childNodes;\n\n newChild = doc.createElement(\"newChild\");\n insertedNode = employeeNode.insertBefore(newChild,refChild);\n child = employeeNode.lastChild;\n\n childName = child.nodeName;\n\n assertEquals(\"nodeInsertBeforeRefChildNullAssert1\",\"newChild\",childName);\n \n}", "title": "" }, { "docid": "3637e8c6893b47739962775de52a0348", "score": "0.49011433", "text": "function insertAtCaret(element, text) {\r\n if (element.length >= caretPos)\r\n element.val(element.val().substring(0, caretPos) + text + element.val().substring(caretPos));\r\n}", "title": "" }, { "docid": "79bb66eb2dde1bc9a006d7cdf8d7e61b", "score": "0.48980942", "text": "function hc_attrinsertbefore7() {\n var success;\n if(checkInitialization(builder, \"hc_attrinsertbefore7\") != null) return;\n var doc;\n var acronymList;\n var testNode;\n var attributes;\n var titleAttr;\n var value;\n var terNode;\n var dayNode;\n var docFrag;\n var retval;\n var firstChild;\n var lastChild;\n var refChild = null;\n\n \n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"hc_staff\");\n acronymList = doc.getElementsByTagName(\"acronym\");\n testNode = acronymList.item(3);\n attributes = testNode.attributes;\n\n titleAttr = attributes.getNamedItem(\"title\");\n terNode = doc.createTextNode(\"ter\");\n \n\tif(\n\t\n\t(builder.contentType == \"text/html\")\n\n\t) {\n\t\n\t{\n\t\tsuccess = false;\n\t\ttry {\n dayNode = doc.createCDATASection(\"day\");\n }\n\t\tcatch(ex) {\n success = (typeof(ex.code) != 'undefined' && ex.code == 9);\n\t\t}\n\t\tassertTrue(\"throw_NOT_SUPPORTED_ERR\",success);\n\t}\n\n\t}\n\t\n\t\telse {\n\t\t\tdayNode = doc.createCDATASection(\"day\");\n docFrag = doc.createDocumentFragment();\n retval = docFrag.appendChild(terNode);\n retval = docFrag.appendChild(dayNode);\n \n\t{\n\t\tsuccess = false;\n\t\ttry {\n retval = titleAttr.insertBefore(docFrag,refChild);\n }\n\t\tcatch(ex) {\n success = (typeof(ex.code) != 'undefined' && ex.code == 3);\n\t\t}\n\t\tassertTrue(\"throw_HIERARCHY_REQUEST_ERR\",success);\n\t}\n\n\t\t}\n\t\n}", "title": "" }, { "docid": "cfb700d6ac04c3100e046c5f0411ae59", "score": "0.4894301", "text": "function insert(data) {\n if (action == null) {\n num1 = num1 + data;\n right.innerHTML = num1;\n } else {\n num2 = num2 + data;\n right.innerHTML = num2;\n }\n}", "title": "" }, { "docid": "43c83862eb2531d5d6b2dbe6938c922f", "score": "0.48908305", "text": "function addData(data) {\n console.log(` Adding: ${data.name} (${data.owner})`);\n Stuffs.insert(data);\n}", "title": "" }, { "docid": "43c83862eb2531d5d6b2dbe6938c922f", "score": "0.48908305", "text": "function addData(data) {\n console.log(` Adding: ${data.name} (${data.owner})`);\n Stuffs.insert(data);\n}", "title": "" }, { "docid": "2f083d3230dd8a5b42cf9d00d721b4d8", "score": "0.4884665", "text": "function insert(position, newText) {\r\n return { range: { start: position, end: position }, newText: newText };\r\n }", "title": "" }, { "docid": "2f083d3230dd8a5b42cf9d00d721b4d8", "score": "0.4884665", "text": "function insert(position, newText) {\r\n return { range: { start: position, end: position }, newText: newText };\r\n }", "title": "" }, { "docid": "02a1a06a3a3e185981d53820535e66c4", "score": "0.4884629", "text": "function insert(character, input){\n var formatted = \"\";\n var pos = input.indexOf(character);\n for(var i =0;i<input.length;i++){\n if(pos===i){\n formatted+=character;\n }else{\n formatted+=input.substring(i,i+1);\n }\n pos = input.indexOf(character,i);\n }\n return formatted;\n}", "title": "" }, { "docid": "ccbb3d24b68d99b94337c802469c2b28", "score": "0.487741", "text": "function insertMark(string, pos, len) {\n // hello world\n // hello <mark>wo</mark>rld\n // hello+<mark>+wo+</mark>+rld\n return string.slice(0, pos) + '<mark>' + string.slice(pos, pos + len) + '</mark>' + string.slice(pos + len);\n}", "title": "" }, { "docid": "a0b3cc7a489e82bf04aae345c1fb4db4", "score": "0.48723638", "text": "add(addr, data) {\n (function recurse(currNode, currAddr) {\n if (currAddr.length) {\n // pluck a member off the beginning of address\n const currLevel = parseInt(currAddr.shift(), 10);\n // if we've reached the leaf, use data\n const nextNode = !currAddr.length ? new Node(data) : new Node({});\n // add in and next\n return recurse(currNode.addChild(nextNode, currLevel), currAddr);\n } else {\n // get back\n return currNode;\n }\n })(this.rootNode, addr.slice());\n }", "title": "" }, { "docid": "0df2c48ef6a3d98b18cdbb5c1f2e12f5", "score": "0.48570234", "text": "insert(key, value) {\n // if (typeof data === 'undefined') {\n // throw new Error('Data cannot be undefined');\n // }\n\n const newTreeNode = new TreeNode(key, value);\n\n if (this.root === null) {\n this.root = newTreeNode;\n } else {\n this.insertNode(this.root, newTreeNode)\n }\n }", "title": "" }, { "docid": "c22beaa3ef4639b5c250346c12bc1db8", "score": "0.48483795", "text": "function insertText(node, // @param DocumentFragment/TextString:\r\n context, // @param Node(= document.body): parent node\r\n pos) { // @param Number(= uuMeta.LASTC): insert position\r\n // @return Node: first text node\r\n return insertNode(typeof node === \"string\" ? _doc.createTextNode(node)\r\n : node, context, pos);\r\n}", "title": "" }, { "docid": "c4bd288766cfe6cb75ec39b1ae262343", "score": "0.48394918", "text": "function characterData_substringData(node, offset, count) {\n /**\n * 1. Let length be node’s length.\n * 2. If offset is greater than length, then throw an \"IndexSizeError\"\n * DOMException.\n * 3. If offset plus count is greater than length, return a string whose\n * value is the code units from the offsetth code unit to the end of node’s\n * data, and then return.\n * 4. Return a string whose value is the code units from the offsetth code\n * unit to the offset+countth code unit in node’s data.\n */\n var length = TreeAlgorithm_1.tree_nodeLength(node);\n if (offset > length) {\n throw new DOMException_1.IndexSizeError(\"Offset exceeds character data length. Offset: \" + offset + \", Length: \" + length + \", Node is \" + node.nodeName + \".\");\n }\n if (offset + count > length) {\n return node._data.substr(offset);\n }\n else {\n return node._data.substr(offset, count);\n }\n}", "title": "" }, { "docid": "8ae8703c81355eff6c458a882a59c283", "score": "0.48393437", "text": "function insert(position, newText) {\n return { range: { start: position, end: position }, newText: newText };\n }", "title": "" }, { "docid": "8ae8703c81355eff6c458a882a59c283", "score": "0.48393437", "text": "function insert(position, newText) {\n return { range: { start: position, end: position }, newText: newText };\n }", "title": "" }, { "docid": "8ae8703c81355eff6c458a882a59c283", "score": "0.48393437", "text": "function insert(position, newText) {\n return { range: { start: position, end: position }, newText: newText };\n }", "title": "" }, { "docid": "8ae8703c81355eff6c458a882a59c283", "score": "0.48393437", "text": "function insert(position, newText) {\n return { range: { start: position, end: position }, newText: newText };\n }", "title": "" } ]
03231c23e6a2ca4f3991fc8430ecb936
circle1 = new Bubble(300,300); circle2 = new Bubble(250,250);
[ { "docid": "fb59e7a6ced40bee378b5904cf26649a", "score": "0.7039615", "text": "function Bubble (x,y,rad,col) {\n\tthis.posX = x;\n\tthis.posY = y;\n\tthis.radius = rad;\n\tthis.color = col;\n\n\tthis.display = function() {\n\t\tstroke('white');\n\t\tstrokeWeight(2);\n\t\tfill(this.color);\n\t\tellipse(this.posX, this.posY, this.radius * 2, this.radius * 2);\n\n\t}\n\n\tthis.update = function(other) {\n\t\tthis.posX = this.posX + random(-1, 1);\n\t\tthis.posY = this.posY + random(-1, 1);\n\t}\n\n this.changeColor = function(other) {\n d = dist(this.posX, this.posY, other.posX, other.posY);\n if (d <= this.radius){\n this.color = color(random(200), random(200), random(200));\n }\n }\n\t// if (d < circle1.radius + circle2.radius) {\n\t// \tcircle1.changeColor();\n\t// \tcircle2.changeColor();\n\t// }\n\n}", "title": "" } ]
[ { "docid": "3639a50bcf82b4e46b683b573573dcca", "score": "0.75721323", "text": "function Bubble() {\n this.x = 0;\n this.y = 0;\n this.radius = 100.0;\n this.radiusScaling = 12;\n this.radiusRate = 18;\n this.drawRadius = this.radius;\n}", "title": "" }, { "docid": "9d31a9dd1c0426c7146d0d65422c17c1", "score": "0.6817673", "text": "function setup() {\n createCanvas(600, 400);\n noStroke();\n\n ellipseMode(RADIUS)\n\n for(let i = 0; i <= 10; i++){\n bubbles[i] = new Bubble(random(0, width),random(0, height),random(2,50));\n }\n // bubbles[0] = (new Bubble(200, 50, 60))\n // bubbles[1] = (new Bubble(30, 40, 50))\n}", "title": "" }, { "docid": "a49b05021fcf498db9f501d4bb5d0330", "score": "0.6726698", "text": "function Bubble() {\n //object literals are like lists, they are lists of what we call name-value pairs.\n //they can contain data using this syntax:\n this.x = random(0,width);\n this.y = random(0,height);\n\n //they can also contain functions declared with a similar syntax...\n this.display = function(){\n stroke(255);\n strokeWeight(2);\n ellipse(this.x,this.y,20,20); //this.variable name is used...\n\n }, // also notice that each thing in the list is separated with a comma\n //here is another function\n this.move = function(){\n this.x=this.x + random(-1,1);\n this.y=this.y + random(-1,1);\n\n }\n\n}", "title": "" }, { "docid": "d847e3e24310058bb91296f6b1df3213", "score": "0.66701424", "text": "function createBubble(x, y) {\n var ret = {\n number: null,\n x: x || Math.random() * cRect.width,\n y: y || Math.random() * cRect.height,\n radius: Math.random() *\n (MAX_BUBBLE_RADIUS - MIN_BUBBLE_RADIUS) + MIN_BUBBLE_RADIUS,\n speedX: SPEED * Math.random(),\n speedY: SPEED * Math.random(),\n image: arrayRandom(Bubbles, -1),\n };\n\n d_circles.push(ret);\n\n return ret;\n }", "title": "" }, { "docid": "02a90f872dc74c8f80eb2d1d0676498a", "score": "0.66456586", "text": "function shapeCreateBubble(){\r\n\tvar bubble\t= new Kinetic.Circle({\r\n\t\tx:DEFAULT_BUBBLE_X,\r\n\t\ty:DEFAULT_BUBBLE_Y,\r\n\t\tradius:DEFAULT_BUBBLE_RADIUS,\r\n\t\tfill:\"yellow\",\r\n\t\tstroke:\"black\",\r\n\t\tstrokeWidth:4\r\n\t});\r\n\treturn bubble;\r\n}", "title": "" }, { "docid": "025e96c88daa261ff451a951bb69261d", "score": "0.6629543", "text": "function Bubble(x) {\n // Values used to calculate bubble line\n var lineStart = 3 / rand(0, 9);\n var lineLength = 1 / rand(2, 4);\n\n // Used to position and size bubble\n this.x = x;\n this.y = rand(c.height, c.height + 75);\n this.xStart = x;\n this.radius = rand(10, 30);\n // Used to Pop Bubble\n this.popped = false;\n this.popLine = this.radius / 1.5;\n this.popBars = rand(6, 9);\n // Used to draw bubble line\n this.lineStartAngle = lineStart * Math.PI;\n this.lineEndAngle = (lineStart + lineLength) * Math.PI;\n // Used to rotate oscillate bubble line\n this.lineRotation = 0;\n this.lineRotateInc = 1 / rand(40, 100);\n this.rotateRigth = true;\n // Control the bubble movement\n this.speed = 30 / rand(10, 20);\n this.jiggleAmplitude = rand(15, 50);\n // Methods\n this.draw = drawBubble;\n this.pressed = pressed;\n this.move = move;\n this.explode = explode;\n this.remove = remove;\n}", "title": "" }, { "docid": "d33032a78914ca7cbc3401d9f31cb3f1", "score": "0.65297395", "text": "function Bubble()\r\n{\r\n}", "title": "" }, { "docid": "a197ac780f332b854e1683b1950d7833", "score": "0.6516405", "text": "function setup()\n{\n createCanvas(400, 400);\n iArray.push(new interface(50, 299, 100, \"start\")); //first box\n iArray.push(new interface(150, 299, 100, \"stop\")); //middle box\n iArray.push(new interface(250, 299, 100, \"reset\")); //last box\n\n bubble0 = new bubble(0, 200, 100); //making the ball\n}", "title": "" }, { "docid": "488b719118e23e9cdfb5ad7ce32f8b31", "score": "0.6315973", "text": "constructor(circleX, circleY, circleW) {\n this.circleX = circleX;\n this.circleY = circleY;\n this.circleW = circleW;\n }", "title": "" }, { "docid": "d4a57f2e1b43420737be751951fda139", "score": "0.6301172", "text": "function setup() {\n createCanvas(windowWidth, windowHeight);\n fill(255, 55);\n stroke (255, 85);\n // Create objects\n for (var i=0; i<50; i++) {\n bubbles.push(new Bubble());\n }\n}", "title": "" }, { "docid": "199da5ca0c12c8b33b14a4dbe659bdfe", "score": "0.6264623", "text": "function main() {\r\n var h1 = Raphael(\"holder\", 500, 500);\r\n var h2 = Raphael(\"holder\", 500, 500);\r\n var s = new CCC(h2, h1);\r\n}", "title": "" }, { "docid": "7574634f0eda8ce5ede833a70062cdb5", "score": "0.6185535", "text": "function drawBubbles(_x, _y, _radius) {\n ctx.beginPath();\n crc2.fillStyle = \"rgb(0,0,255)\";\n ctx.arc(_x, _y, _radius, 0, 2 * Math.PI);\n crc2.closePath();\n ctx.stroke();\n crc2.fill();\n }", "title": "" }, { "docid": "cf85416bd279f0def6b4102267c18874", "score": "0.6184776", "text": "function Circle1(){\n// I WANT 5 CIRCLES FOR 5 DIFFERENT BOROS\n// CIRCLE 1 \n// QUEENS\nfill(255);\ntext(\"QUEENS\", 150, height/2 + 300);\nfill(160, 20, 60);\nnoStroke();\nellipse(200, height/2, b1, b1); // GRADE B\nellipse(200, height/2 - 200, a1, a1); // GRADE A\nellipse(200, height/2 + 200, c1_, c1_); // GRADE C\n// c1++;\n// if(c1 >= 50){\n//\tc1 = c1 - 1;\n//}\n}", "title": "" }, { "docid": "8463841b9a83207204a6f61487065d37", "score": "0.6152866", "text": "function setup() {\n createCanvas(windowWidth, windowHeight-70);\n fill(255, 55);\n stroke(255, 85);\n\n //create i bubbles\n for (var i = 0; i < 50; i++) {\n bubbles.push(new Bubble());\n }\n}", "title": "" }, { "docid": "78e1b7de0fa244ef231f7ab7e302c650", "score": "0.61459893", "text": "function makeCircleObject(){\r\n circleObj.x = 750;\r\n circleObj.y = 250;\r\n}", "title": "" }, { "docid": "b375446b9e2933b4cde4a323d8e9fe09", "score": "0.6133707", "text": "function Circle() {}", "title": "" }, { "docid": "0b1825312c15152690e1029455a8c376", "score": "0.60917914", "text": "function setup() {\n createCanvas(windowWidth, windowHeight);\n\n // produce any amount of bubbles with a loop.\n for (let i = 0; i < 50; i++) {\n let x = random(width);\n let y = random(height);\n let r = random(10, 50);\n bubbles[i] = new Bubble(x, y, r);\n }\n}", "title": "" }, { "docid": "64357fd86fd9e50cc825176703ce9703", "score": "0.6087942", "text": "function Bubble(x,y,dx,dy,rad,colS,colF) {\n this.x = x;\n this.y = y;\n this.dx = dx; // velocity x\n this.dy = dy; // velocity y\n this.initialRadius = rad;\n this.colStroke = colS; // color to use when stroking bubble\n this.colFill = colF; // color to use when filling bubble\n this.colAlpha = null; // color to use when filling and alpha is desired\n this.radius = rad;\n this.caught = false; // when bubble is close to cursor\n this.useAlpha = false; // should colAlpha be used for fill rendering?\n this.useStrokeAlways = colS !== colF; // should a stroke be used for rendering\n this.clicked = false; // flag: when caught by cursor AND clicked\n }", "title": "" }, { "docid": "5b95783bcaf429a7e78d30420bfbf855", "score": "0.60781235", "text": "function setup() {\r\n createCanvas(710, 400);\r\n noCursor();\r\n \r\n bat = new rectangle(25, 25, 20, 80);\r\n bat2 = new rectangle(665, 25, 20, 80);\r\n ball = new circle(20);\r\n}", "title": "" }, { "docid": "b78532f96549e2668b5e7a4c55ea894e", "score": "0.6074682", "text": "function addNewBubble(){\n console.log(\"TEST\");\n var tempDisc = {};\n\n\t\tvar newCircle = $(\"<div class=\\\"circle\\\"></div>\");\n newCircle.attr('id', (tempDisc.id = returnRandomID(8)));\n $(\"#GENERAL_OVERLAY\").append(newCircle);\n newCircle.show();\n\n\t\tvar adjust = newCircle.height()/2;\n\n tempDisc.x = hub.mousePos.left - adjust;\n tempDisc.y = hub.mousePos.top - adjust;\n\n\t\tnewCircle.css('left', tempDisc.x + 'px');\n\t\tnewCircle.css('top', tempDisc.y + 'px');\n\n\t\tshowNewDiscussionForm(tempDisc);\n}", "title": "" }, { "docid": "824b4961f8f84dcb7f270fd09723c601", "score": "0.60450083", "text": "function addCircles() {\n let aCircle;\n for (let i = 0; i < numberOfCircles; i++) {\n aCircle = $(\"<div />\",\n {\n class: \"circle\",\n css: {\n position: 'absolute',\n left: randomPositionX() + 'px',\n top: randomPositionY() + 'px',\n width: width + 'px',\n height: width + 'px',\n backgroundColor: getRandomColor,\n }\n });\n $('#holder').append(aCircle);\n\n }\n\n }", "title": "" }, { "docid": "a8251805fde6bcd86923c3b011aacb32", "score": "0.6036102", "text": "function circleSwap(i, j) {\n circles[i].circle = circles[j].circle;\n circles[i].color = circles[j].color;\n\n circles[j].circle = null;\n circles[j].color = \"\";\n\n circles[i].circle.x = 80 * (i % 6) + 40;\n circles[i].circle.y = 80 * Math.trunc(i / 6) + 40;\n\n app.stage.addChild(circles[i].circle);\n}", "title": "" }, { "docid": "1535958e8c48e1c59af20f05cc6dc892", "score": "0.6022087", "text": "function Circle(){\n}", "title": "" }, { "docid": "ff710f2aa29ce4dc9fc1702a8db0ed11", "score": "0.60022676", "text": "constructor(x, y, r=5){\n //Drawing variables\n this.x = x\n this.y = y\n this.r = r\n //Dragging variables\n this.xTrans = 0\n this.yTrans = 0\n this.X = x\n this.Y = y\n //Adding to the circles array\n circles.push(this)\n }", "title": "" }, { "docid": "920be62a36e2ae0dc9e04b371b985d9b", "score": "0.6001876", "text": "function createBubble() {\n var _key = iBubble;\n var _tag = document.getElementById('new-tag').value;\n var _group = document.getElementById('new-group').value;\n var _unit = parseUnit(document.getElementById('new-unit').value);\n var _value = Number(document.getElementById('new-value').value);\n var _absUn = Number(document.getElementById('new-abs-un').value);\n bubbleArray.push(new Bubble(_key, _tag, _group, _unit, _value, _absUn));\n iBubble++;\n }", "title": "" }, { "docid": "505e67db99bb068444490a4c23ea7aa4", "score": "0.5980997", "text": "function createNewBubble() {\n var _key = iBubble;\n var _tag = '[ ]';\n var _group = '[ ]';\n var _unit = '[ ]';\n var _value = 0;\n var _absUn = 0;\n bubbleArray.push(new Bubble(_key, _tag, _group, _unit, _value, _absUn));\n bubbleArray[getBubbleIndex(_key)].relUn = 0;\n iBubble++;\n }", "title": "" }, { "docid": "3d48030b58377db93356cace924f976f", "score": "0.5971037", "text": "function setup() { //setting up the canvas size for my project\n var canvas = createCanvas(594, 841);\n canvas.parent(\"myContainer\"); //setting a container to then include it in the html code\n\n for (var i = 0; i < 7; i++) { //new loop to create the 7 bubbles at random locations in the canvas\n bubbles[i] = new Bubble(random(width-48), random(height-48));\n }\n}", "title": "" }, { "docid": "8fc601bd120c702e0ea1dab6a65b04c7", "score": "0.595408", "text": "function draw() {\n background('rgb(116, 164, 5)');\n for (var i=2; i<bubbles.length; i++) {\n bubbles[i].move();\n bubbles[i].display();\n }\n}", "title": "" }, { "docid": "7f05cc6dd96fa35d7b1cd48ed5547d0d", "score": "0.595236", "text": "function circle(radius) {\r\n \r\n this.x = x;\r\n this.y = y;\r\n this.radius = radius;\r\n \r\n this.move = function() {\r\n x = x + xspeed;\r\n y = y + yspeed;\r\n \r\n //Detect if player 1 or 2 wins\r\n if(x > width) {\r\n fill(255);\r\n textSize(64);\r\n stroke(0);\r\n strokeWeight(2);\r\n text(\"Player 1 Wins!\", 160,height/2);\r\n setTimeout(function(){\r\n clear();\r\n },3000);\r\n setTimeout(function(){\r\n x = 350;\r\n y = 200;\r\n },500);\r\n setTimeout(function(){\r\n player1 = player1 + 0.0325;\r\n },1);\r\n }else if(x < 1) {\r\n fill(255);\r\n textSize(64);\r\n stroke(0);\r\n strokeWeight(2);\r\n text(\"Player 2 Wins!\", 160,height/2);\r\n setTimeout(function(){\r\n clear();\r\n },3000);\r\n setTimeout(function(){\r\n x = 350;\r\n y = 200;\r\n },500);\r\n setTimeout(function(){\r\n player2 = player2 + 0.0325;\r\n },1);\r\n }\r\n \r\n \r\n //Bounce of the walls at top and bottom\r\n if(y > height) {\r\n yspeed = -6;\r\n }else if(y < 1) {\r\n yspeed = 6;\r\n }\r\n }\r\n \r\n this.collide = function() {\r\n if(this.x === bat.x + bat.w && this.y > bat.y && this.y < bat.y+bat.h) {\r\n xspeed = 5;\r\n console.log(\"hit\");\r\n }\r\n }\r\n \r\n this.collide2 = function() {\r\n if(this.x === bat2.x - bat2.w && this.y > bat2.y && this.y < bat2.y+bat2.h) {\r\n xspeed = -5;\r\n console.log(\"hit\");\r\n }\r\n }\r\n \r\n this.display = function() {\r\n this.x = x;\r\n this.y = y;\r\n \r\n noStroke();\r\n ellipse(this.x,this.y,radius,radius);\r\n }\r\n \r\n}", "title": "" }, { "docid": "540afc3b51616ffca8c93a12d1690429", "score": "0.5912729", "text": "createBubbles() {\n\t\tlet scale = 500;\n\t\tlet colors = [ 'red', 'aqua', 'yellow', 'green', 'blue' ];\n\t\tlet bubbles = [];\n\n\t\t// Creates CircleMarker with PopUp and adds to bubbles array\n\t\tfor (let j = 0; j < this.props.locations.length; j++) {\n\t\t\tbubbles.push(\n\t\t\t\t<div key={j}>\n\t\t\t\t\t{/* Creates bubbles with size scaled to offence totals */}\n\t\t\t\t\t<CircleMarker\n\t\t\t\t\t\tcenter={this.props.locations[j].value}\n\t\t\t\t\t\tradius={20 * Math.log(this.props.locations[j].total / scale)}\n\t\t\t\t\t\tfillOpacity={0.3}\n\t\t\t\t\t\tstroke={true}\n\t\t\t\t\t\tcolor={colors[j]}\n\t\t\t\t\t\tfillColor={colors[j]}\n\t\t\t\t\t>\n\t\t\t\t\t\t<CircleMarker\n\t\t\t\t\t\t\tcenter={this.props.locations[j].value}\n\t\t\t\t\t\t\tradius={4}\n\t\t\t\t\t\t\tfillOpacity={1}\n\t\t\t\t\t\t\tstroke={false}\n\t\t\t\t\t\t\tfillColor={colors[j]}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{/* Organises Popup information */}\n\t\t\t\t\t\t<Popup>\n\t\t\t\t\t\t\tOffence:{this.props.title}\n\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\tTotal:{this.props.locations[j].total}\n\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\tArea:{this.props.areaArray[j]}\n\t\t\t\t\t\t</Popup>\n\t\t\t\t\t</CircleMarker>\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\n\t\treturn bubbles;\n\t}", "title": "" }, { "docid": "15529b086baf605968c21c15f3702ccd", "score": "0.59061974", "text": "function Circle (r) { \n this.r = r; \n}", "title": "" }, { "docid": "7c1c3dc44c19a9f8e2d056bd2e95854c", "score": "0.589938", "text": "addEllipses() {\n circle1 = this.addCircle(1130, 88, 8, 8);\n circle2 = this.addCircle(1155, 88, 8, 8);\n circle3 = this.addCircle(1180, 88, 8, 8);\n }", "title": "" }, { "docid": "e97eb4354be4cb6a0ce0f77ebc1ec340", "score": "0.5898412", "text": "displayBubble() {\n push();\n noStroke();\n fill(100, 100, 200, 150);\n ellipse(this.x, this.y, this.size);\n pop();\n }", "title": "" }, { "docid": "3c29d2b6ecd7fb3113a71724f9f7bfe3", "score": "0.5895667", "text": "function Circle (radius) {\n // instant memebers\n this.radius = radius;\n \n}", "title": "" }, { "docid": "7df99e608be03a067a563dfc02bd5a71", "score": "0.58899987", "text": "function drawBubbles() {\n // for (let i = 0; i < 8; i++){\n // ctx.strokeStyle = colors[Math.floor(Math.random() * colors.length)]\n // } \n for (let i = 0; i < 6; i++) {\n for (let j = 0; j < 12; j++) {\n ctx.strokeStyle = colors[Math.floor(Math.random() * colors.length)]\n ctx.fillStyle = ctx.strokeStyle\n ctx.beginPath();\n ctx.arc(20 + j * 42, 20 + i * 42, 20, 0, Math.PI * 2, true);\n //ctx.arc(15 + j * 37, 15 + i * 37, 20, 0, Math.PI * 2, true)\n ctx.stroke();\n ctx.fill();\n }\n }\n }", "title": "" }, { "docid": "e08c5168d9aac212e02853690332c3c1", "score": "0.5884551", "text": "function createBubbles(){\n\n players.forEach(function(element){\n var newBubble = {\n id: element.id,\n positionX: getRandomInt(-10,10),\n positionY: getRandomInt(-5,5),\n color: element.color\n };\n bubbles.push(newBubble);\n });\n\n}", "title": "" }, { "docid": "e5b226a160c213a7e69a0d71187714ac", "score": "0.5866609", "text": "function speechBubble1(x, y) {\n CallOutShape.apply(this, arguments);\n this.shape.shadow = new createjs.Shadow('rgba(0,0,0,.5)', 2, 2, 4);\n }", "title": "" }, { "docid": "56734e118d6f40a0b81d555a755c4fd1", "score": "0.58665264", "text": "function createBubbles() {\n stops.forEach(function(s) {\n s['active'] = false; \n s['bubble'] = new google.maps.Circle({\n center: new google.maps.LatLng(s.lat, s.lng),\n //clickable: false,\n map: map,\n });\n bubble_set_default(s.bubble, zoom);\n\n // add listener for hovering. we then need to draw the shortest path from the active stop\n s.bubble.addListener('mouseover', function(){\n if(s.id in id_to_reachable_stops) {\n var edge = id_to_reachable_stops[s.id];\n var time_arrival = edge.time_arrival;\n\n setPathInfo(active_stop.name, s.name, time_arrival);\n draw_path(edge);\n }\n });\n\n // when the user finishes hovering, we delete the path\n s.bubble.addListener('mouseout', function() {\n flightPath.setMap(null);\n if(s.id in id_to_reachable_stops) {\n setStopsInfo(active_stop.name);\n }\n })\n });\n \n }", "title": "" }, { "docid": "ef3b76a723e062d350af34a0f3c6e916", "score": "0.5866392", "text": "function Jitter() {\n this.x = random(width);\n this.y = random(height);\n this.diameter = random(40, 25);\n this.speed = 5;\n//design the movement of the bubbles\n this.move = function() {\n this.x += random(-this.speed, this.speed);\n this.y += random(-this.speed, this.speed);\n };\n//design the appearance of the bubbles\n this.display = function() {\n ellipse(this.x, this.y, this.diameter, this.diameter);\n };\n}", "title": "" }, { "docid": "b6608b706326bd55d5067c5b61019597", "score": "0.5858673", "text": "function createGameElement()\r\n{\r\n playerOne = {};\r\n playerTwo = {};\r\n ball = {};\r\n playerOne = new playerPaddle(10, canvas.height /2, 4, 10, 120);\r\n playerTwo = new playerPaddle(canvas.width - 20, canvas.height /2, 4, 10, 120);\r\n ball = new Ball(canvas.width /2, canvas.height /2, 15, 4);\r\n \r\n}", "title": "" }, { "docid": "19b3f3f8b3b56dd4504d93da13149562", "score": "0.5857477", "text": "constructor(x, y, diameter, name) \n {\n this.x = x;\n this.y = y;\n this.diameter = diameter;\n this.name = name;\n\n this.over = false;\n }", "title": "" }, { "docid": "9175ef023c50ba1b500614376b902554", "score": "0.58395565", "text": "function player1()\n {\n fill(24, 200, 29);\n circle(x, y, diameter);\n }", "title": "" }, { "docid": "2a597d7ad2c10176b4466c40de947399", "score": "0.5833458", "text": "function initiateBouncing() {\n\tvar myName = \"Muataz Aziz\";\n\n\tvar red = [0, 100, 63];\n\tvar orange = [40, 100, 60];\n\tvar green = [75, 100, 40];\n\tvar blue = [196, 77, 55];\n\tvar purple = [280, 50, 60];\n\tvar letterColors = [red, orange, green, blue, purple];\n\n\tdrawName(myName, letterColors);\n\n\tif (10 < 3) {\n\t\tbubbleShape = 'square';\n\t} else {\n\t\tbubbleShape = 'circle';\n\t}\n\n\tbounceBubbles();\n}", "title": "" }, { "docid": "c500823f5dc91be26782ef5e6fb47fab", "score": "0.58315843", "text": "constructor(x1, y1, x2, y2) {\n this.walls = new Group();\n this.walls.add(createSprite(x1, y1, 1, y2 * 2));\n this.walls.add(createSprite(x1, y1, x2 * 2, 1));\n this.walls.add(createSprite(x2, y2, 1, y2 * 2));\n this.walls.add(createSprite(x2, y2, x2 * 2, 1));\n this.setProp();\n }", "title": "" }, { "docid": "12f0ba4303d4cb0185c1359a5adba5e2", "score": "0.58246833", "text": "function setup() {\n var canvas = createCanvas(594, 841); //canvas size = 594x841px\n canvas.parent(\"CanvasContainer\");\n //this makes the canvas in the middle based on the code used in html and css file\n for (let i=0; i<arraySize; i++){\n //loop for the top circles, it starts with 0, then adds another until there's 100 of them\n circleArray[i] = new Circle(width/2, height/2, random(-4, 2), random(-5, -1), 3);\n //declare an array and assign it to a new class then place the circles in the middle,\n // and make them move up. the final number is the size of the circles which is 3px\n }\n for (let e=0; e<arraySize; e++) {\n //loop for the bottom circles\n circleArray2[e] = new Circle(width/2, height/2, random(-2, 4), random(1, 6), 3);\n //same as above, except these circles move down\n }\n}", "title": "" }, { "docid": "f023a05979d182e8c6b7647c3ca57e6a", "score": "0.5817914", "text": "function draw() {\n compCircle.update();\n\n compOppCircle.update();\n \n}", "title": "" }, { "docid": "567a36db03591613c937c1e80db8290f", "score": "0.58159137", "text": "function circleButton (){\n for(var i=0;i<buttonX.length;i++){\n var circleButton = new Konva.Circle({\n x: buttonX[i],\n y: buttonY[i],\n radius: 20,\n fill: 'grey',\n stroke: 'white',\n strokeWidth: 2,\n id:i\n });\n layer.add(circleButton);\n }\n \n }", "title": "" }, { "docid": "011e4ec2593518a4e105f410c720738b", "score": "0.5814878", "text": "function getBubbles(){\n if( xAxis || yAxis ){\n x = xAxis;\n y = yAxis;\n\n bubbles.style.left = `${ x }px`;\n bubbles.style.top = `${ y }px`;\n }\n\n bubbles.style.width = size / bubble_size + 'rem';\n bubbles.style.height = size / bubble_size + 'rem';\n\n setTimeout( () => {\n bubbles.remove();\n if( bubbles.remove ){\n eye.style.transform = `rotate( -${ rotation }deg )`;\n }\n }, 1800 );\n\n container.appendChild( bubbles );\n }", "title": "" }, { "docid": "02c75e495f10465f4ad8894cdbf984c7", "score": "0.58112437", "text": "function Circle2(radius) {\n this.radius = radius;\n this.draw = function () {\n console.log('draw');\n }\n}", "title": "" }, { "docid": "a0758623c8c39e5c63c8ab306d4afa98", "score": "0.5802719", "text": "function swapBubblePosition(bubble1, bubble2) {\n\n var tempPosX = bubble1.posX;\n var tempPosY = bubble1.posY;\n setBubblePos(bubble1, bubble2.posX, bubble2.posY);\n setBubblePos(bubble2, tempPosX, tempPosY);\n\n}", "title": "" }, { "docid": "0f5413f12c484d1ffd5d3e5855497502", "score": "0.57911533", "text": "function Circle(radius){\n this.radius = radius; //instance members\n}", "title": "" }, { "docid": "8056a577a9c8ba3be4b0e0e4fdd66aa8", "score": "0.5760784", "text": "function Circle(spindulys) {\n this.r = spindulys;\n this.diametras = spindulys * 2;\n}", "title": "" }, { "docid": "eb2c03762d76ffb9ac0991a92e279bec", "score": "0.57598877", "text": "function MyCircle(radius){\n //instance members\n this.radius= radius;\n}", "title": "" }, { "docid": "368d8d5592d30c29a31b9b5ce65feb10", "score": "0.5759813", "text": "constructor(diameter, color) {\n this.diameter = diameter;\n this.lineWidth = getRandomInt(1, 10);\n\n this.position = new Vector(\n getRandomInt(\n 0 + this.diameter + this.lineWidth / 2,\n canvas.width - this.diameter - this.lineWidth / 2\n ),\n canvas.height - this.diameter - this.lineWidth / 2\n );\n\n this.speed = new Vector();\n this.color = color;\n // Increase y position of the bubble every frame.\n this.speed.y = (getRandomInt(1, 28) / 4) * -1;\n }", "title": "" }, { "docid": "3dfba4da2e224c54f6bb36626cff7dec", "score": "0.5759118", "text": "function drawCircles2(){\r\n noStroke();\r\n push();\r\n translate(width/2,height/2);\r\n fill(random(255),random(255),random(255),50);\r\n stroke(0);\r\n rotate(angle5);\r\n ellipse(50,50,50,50);\r\n rotate(-angle5*2);\r\n ellipse(50,50,50,50);\r\n angle5 = angle5 + 2;\r\n pop();\r\n\r\n push();\r\n stroke(0);\r\n fill(random(255),random(255),random(255),50);\r\n translate(width/2,height/2);\r\n rotate(angle6);\r\n ellipse(85,85,50,50);\r\n rotate(-angle6*2);\r\n ellipse(85,85,50,50);\r\n angle6 = angle6 + 4;\r\n pop();\r\n\r\n push();\r\n fill(random(255),random(255),random(255),50);\r\n stroke(0);\r\n translate(width/2,height/2);\r\n rotate(angle7);\r\n ellipse(120,120,50,50);\r\n rotate(-angle7*2);\r\n ellipse(120,120,50,50);\r\n angle7 = angle7 + 6;\r\n pop();\r\n\r\n push();\r\n fill(random(255),random(255),random(255),50);\r\n stroke(0);\r\n translate(width/2,height/2);\r\n rotate(angle8);\r\n ellipse(155,155,50,50);\r\n rotate(-angle8*2);\r\n ellipse(155,155,50,50);\r\n angle8 = angle8 + 8;\r\n pop();\r\n}", "title": "" }, { "docid": "4da00ed00f3eed27db5c78ad15dbaaca", "score": "0.5753785", "text": "function splitBubbles() {\n showTypeTitles();\n\n // @v4 Reset the 'x' force to draw the bubbles to their year centers\n simulation.force('x', d3.forceX().strength(forceStrength).x(nodeTypePos));\n\n // @v4 We can reset the alpha value and restart the simulation\n simulation.alpha(1).restart();\n }", "title": "" }, { "docid": "8a0c84327d81a7cade87f03ad206c1c5", "score": "0.57522357", "text": "function createCircle() {\n new Circle(circleRadius.value);\n }", "title": "" }, { "docid": "5049ebc8d1cffd2c19077d005c02c0b0", "score": "0.57362336", "text": "function players() {\n \n fill(230,230,230);\n stroke(random(1,255),random(1,255),random(1,255));\n ellipse(player1x,player1y,10,10);\n ellipse(player2x,player2y,10,10);\n \n}", "title": "" }, { "docid": "1d278afd9310885b70038adc1731a0c6", "score": "0.57359064", "text": "function draw(width_var, radius_2, margin_var){\n\n\n//tier two\n\nvar balls_needed= 41 ;\n\nvar capacity = width_var/(radius_2*2);\n\nvar rows = Math.ceil(balls_needed / capacity);\nvar row_last = balls_needed - (rows-1)*capacity\n\n\nif (rows===1){\n var i;\n for (i = 0; i < balls_needed; i++) {\n svg\n .append('circle')\n .attr('class', 'bubble')\n .attr('cy', height/5)\n .attr('cx', margin_var+radius_2*2*i)\n .attr('r', radius_2)\n .attr('opacity', '0.5')\n .attr('fill', '#c24e00')\n }\n } else {\n\n var counter;\n for (counter = 0; counter < rows-1; counter++) {\n\n var i;\n for (i = 0; i < capacity; i++) {\n svg\n .append('circle')\n .attr('class', 'bubble')\n .attr('cy', height/5+(10*(counter)))\n .attr('cx', margin_var+radius_2*2*i)\n .attr('r', radius_2)\n .attr('opacity', '0.5')\n .attr('fill', '#c24e00')\n }\n }\n\n var i;\n for (i = 0; i < row_last; i++) {\n svg\n .append('circle')\n .attr('class', 'bubble')\n .attr('cy', height/5+(10*(counter)))\n .attr('cx', margin_var+radius_2*2*i)\n .attr('r', radius_2)\n .attr('opacity', '0.5')\n .attr('fill', '#c24e00')\n }\n \n }\n//tier three\n\nvar balls_needed= 100 ;\n\nvar capacity = width_var/(radius_2*2);\n\nvar rows = Math.ceil(balls_needed / capacity);\nvar row_last = balls_needed - (rows-1)*capacity\n\n\nconsole.log(rows, capacity, balls_needed, row_last)\n// console.log(width_var/(radius_2*2))\nvar rows = balls_needed/(width_var/(radius_2*2));\n\nif (rows===1){\n var i;\n for (i = 0; i < balls_needed; i++) {\n svg\n .append('circle')\n .attr('class', 'bubble')\n .attr('cy', 2*height/5)\n .attr('cx', margin_var+radius_2*2*i)\n .attr('r', radius_2)\n .attr('opacity', '0.5')\n .attr('fill', '#c24e00')\n }\n } else {\n\n var counter;\n for (counter = 0; counter < rows-1; counter++) {\n\n var i;\n for (i = 0; i < capacity; i++) {\n svg\n .append('circle')\n .attr('class', 'bubble')\n .attr('cy', 2*height/5+(10*(counter)))\n .attr('cx', margin_var+radius_2*2*i)\n .attr('r', radius_2)\n .attr('opacity', '0.5')\n .attr('fill', '#c24e00')\n }\n }\n\n var i;\n for (i = 0; i < row_last; i++) {\n svg\n .append('circle')\n .attr('class', 'bubble')\n .attr('cy', 2*height/5+(10*(counter)))\n .attr('cx', margin_var+radius_2*2*i)\n .attr('r', radius_2)\n .attr('opacity', '0.5')\n .attr('fill', '#c24e00')\n }\n \n }\n\n//tier four\nvar i;\nfor (i = 0; i < 22; i++) {\n svg\n .append('circle')\n .attr('class', 'bubble')\n .attr('cy', 3*height/5)\n .attr('cx', margin_var+radius_2*2*i)\n .attr('r', radius_2)\n .attr('opacity', '0.5')\n .attr('fill', '#072F5F')\n .attr('fill', '#c24e00')\n\n}\n\n//tier five\nvar i;\nfor (i = 0; i < 2; i++) {\n svg\n .append('circle')\n .attr('class', 'bubble')\n .attr('cy', 4*height/5)\n .attr('cx', margin_var+radius_2*2*i)\n .attr('r', radius_2)\n .attr('opacity', '0.5')\n .attr('fill', '#c24e00')\n\n}\n\n//tier 6\n// var i;\n// for (i = 0; i < 2; i++) {\n// svg\n// .append('circle')\n// .attr('class', 'bubble')\n// .attr('cy', height)\n// .attr('cx', margin_var+radius_2*2*i)\n// .attr('r', radius_2)\n// .attr('opacity', '0.5')\n// .attr('fill', '#c24e00')\n\n\n// }\n\n}", "title": "" }, { "docid": "ef2601412ac634ca628f1cc600536e57", "score": "0.57307297", "text": "function Bubble(title) {\n this.movieId = 0;\n this.title = title;\n this.year = 0;\n this.tomato = 0;\n this.popularity = 0;\n this.plot = \"\";\n this.color = colorBrown;\n this.ring = 0;\n this.position = 0;\n this.mx = 0.0;\n this.my = 0.0;\n\n this.mSize = function () {\n return popularityToMapSize(this.popularity)\n };\n this.fullTitle = function () {\n return (this.title + ' (' + this.year + ')');\n };\n\n this.cx = function () {\n return toCX(this.mx);\n }\n this.cy = function () {\n return toCY(this.my);\n }\n this.cSize = function () {\n return toCDistance(this.mSize());\n }\n}", "title": "" }, { "docid": "44061f53e3936a2d83a8a45a99620d2b", "score": "0.5726771", "text": "function setup(){\n createCanvas(1000,500);\n // Class for the apples\n apple = new Ball(random(0, 1000), 250, 0, 255, 0, appleSpeed);\n ballArray.push(apple);\n // Class for the character\n character = new Ball(characterXpos, characterYpos, 0, 255, 0, speedCharacter);\n ballArray2.push(character);\n rectMode(CENTER);\n imageMode(CENTER);\n textAlign(CENTER);\n}", "title": "" }, { "docid": "75c30a019675056f84718a377019bea6", "score": "0.5718922", "text": "function Ball1() {\n\tthis.radius = 20;\n\tthis.speedX = 3;//increase 3 (ox).\n\tthis.SpeedY = 3;//increase 3 (oy).\n\tthis.show = true;//show ball1.\n\tthis.cx = 20;//mind.O(cx,cy).\n\tthis.cy = 20;//mind.O(cx,cy).\n}", "title": "" }, { "docid": "e20240ea74d6994d35138c12773146d0", "score": "0.5718808", "text": "_createAttachments() {\n super._createAttachments();\n\n this.minRangeCircle = new Circle(this.pos, {\n draggable: \"false\",\n radius: MIN_DISTANCE,\n color: this.color,\n fillOpacity: 0,\n dashArray: \"5, 5\",\n interactive: false,\n clickable: false, // legacy support\n });\n\n this.maxRangeCircle = new Circle(this.pos, {\n draggable: \"false\",\n radius: this.maxDistance,\n color: this.color,\n fillOpacity: 0.1,\n fillColor: this.color,\n dashArray: \"5, 5\",\n interactive: false,\n clickable: false, // legacy support\n });\n\n this._attachments = [this.minRangeCircle, this.maxRangeCircle];\n }", "title": "" }, { "docid": "5cf31d6fe4c691cd7a002b4402161022", "score": "0.5716181", "text": "function Bubble(index, id, left, top, question) {\r\n\tdocument.getElementById(id).innerHTML = question.answer();\r\n\tthis.question = question;\r\n\tthis.id = id;\r\n\tthis.index = index;\r\n\tthis.left = left;\r\n\tthis.top = top;\r\n\tthis.increment = Math.random() >= 0.5 ? 2 : -2;\r\n\tthis.climbRate = Game.difficulty + Math.ceil(Math.random() * 2);\r\n\tthis.changeDirectionInterval = 3\r\n\tthis.countdown = 10;\r\n\tthis.timer = null;\r\n}", "title": "" }, { "docid": "2c3a6328edff84bd277e7e0e8679c31e", "score": "0.57050073", "text": "function Ball2() {\n\tthis.radius = 20;\n\tthis.SpeedY = 3;//increase 3 (oy).\n\tthis.show = true;//show ball2.\n\tthis.cx = 300;//mind.O(cx,cy).\n\tthis.cy = 20;//mind.O(cx,cy).\n}", "title": "" }, { "docid": "0d4cb8e5abb1e5d3fe98149f342845b3", "score": "0.5700368", "text": "_animate() {\n this._timeline = gsap.timeline();\n this._timeline.to([this._outerCircle, this._innerCircle], {\n alpha: 1,\n duration: 1,\n ease: \"none\",\n });\n\n for (const name of [\"three\", \"two\", \"one\"]) {\n const numberSprite = this._createNumber(name);\n this._timeline\n .set(numberSprite, {\n alpha: 1,\n })\n .call(() => Assets.sounds.beep.play())\n .from(numberSprite.scale, {\n x: 0,\n y: 0,\n ease: \"bounce\",\n duration: 1,\n })\n .to(numberSprite, {\n alpha: 0,\n duration: 0.5,\n });\n }\n this._timeline.to([this._outerCircle.scale, this._innerCircle.scale], {\n x: 0,\n y: 0,\n });\n }", "title": "" }, { "docid": "c518c075de16c70adec4f9f9e0c5b23d", "score": "0.56999063", "text": "function handle_circle_rectangle(a, b)\n\t\t{\n\t\t}", "title": "" }, { "docid": "59cf41f65e2afd22d49e0999e42812d9", "score": "0.56927943", "text": "function drawRandomCircles(){\n\n}", "title": "" }, { "docid": "472b6526b0c5d4af5f69bdf20f3214ce", "score": "0.56918633", "text": "function createComponents() {\n\tpaddleLeft = new Paddle(sizePaddleLeftX, sizePaddleLeftY, colorPaddleLeft, distancePaddle, canvas.height/2-sizePaddleLeftY/2, canvas);\n\tpaddleRight = new Paddle(sizePaddleRightX, sizePaddleRightY, colorPaddleRight, canvas.width-sizePaddleRightX-distancePaddle, (canvas.height-sizePaddleRightY)/2, canvas); \n\tball = new Ball(sizeBall, sizeBall, colorBall, (canvas.width-sizeBall)/2, (canvas.height-sizeBall)/2, canvas); \n }", "title": "" }, { "docid": "f42c9202e4c0dd55e0fb67e6659a8c49", "score": "0.56899744", "text": "constructor(game, events) {\n const balls = [];\n\n this.game = game;\n this.players = [new PoolPlayer(this, PLAYER_ONE), new PoolPlayer(this, PLAYER_TWO)];\n this.currentPlayerIndex = 0;\n this.events = events;\n this.shotsLeft = 1;\n\n for (let player of this.players) {\n game.addChild(player);\n }\n //creates ball objects\n for (let i = 0; i < 14; i++) {\n const ball = new GameBall(BALL_COLORS[i % 2], 0, 0, 14, 0, 0, 0);\n balls.push(ball);\n game.addChild(ball);\n }\n //randomise array for random layout\n balls.sort(() => Math.random() - 0.5);\n //creates black ball\n this.blackBall = new GameBall('#000000', 0, 0, 14, 0, 0, 0); //black\n game.addChild(this.blackBall);\n\n game.addChild(new ActivePlayer(this, game));\n\n //defines starting positions of balls\n const CentrePosition = {x: game.width * 0.75, y: game.height * 0.5};\n const ballDiameter = 14 * 2;\n const buffer = ballDiameter + 1;\n\n balls[0].setLocation(CentrePosition.x - buffer * 2, CentrePosition.y);\n\n balls[1].setLocation(CentrePosition.x - buffer, CentrePosition.y + buffer * 0.5);\n balls[2].setLocation(CentrePosition.x - buffer, CentrePosition.y - buffer * 0.5);\n\n balls[3].setLocation(CentrePosition.x, CentrePosition.y + buffer);\n this.blackBall.setLocation(CentrePosition.x, CentrePosition.y);\n balls[4].setLocation(CentrePosition.x, CentrePosition.y - buffer);\n\n balls[5].setLocation(CentrePosition.x + buffer, CentrePosition.y + buffer * 1.5);\n balls[6].setLocation(CentrePosition.x + buffer, CentrePosition.y + buffer * 0.5);\n balls[7].setLocation(CentrePosition.x + buffer, CentrePosition.y - buffer * 0.5);\n balls[8].setLocation(CentrePosition.x + buffer, CentrePosition.y - buffer * 1.5);\n\n balls[9].setLocation(CentrePosition.x + buffer * 2, CentrePosition.y + buffer * 2);\n balls[10].setLocation(CentrePosition.x + buffer * 2, CentrePosition.y + buffer);\n balls[11].setLocation(CentrePosition.x + buffer * 2, CentrePosition.y);\n balls[12].setLocation(CentrePosition.x + buffer * 2, CentrePosition.y - buffer);\n balls[13].setLocation(CentrePosition.x + buffer * 2, CentrePosition.y - buffer * 2);\n\n //event subscriptions\n events.subscribe('breakStart', () => {\n console.log('breakStart');\n });\n events.subscribe('breakEnd', () => {\n console.log('breakEnd');\n });\n events.subscribe('foul', () => {\n this.hasFouled = true;\n console.log('foul');\n });\n events.subscribe('shotFouled', () => {\n console.log('shotFouled');\n\n this.changePlayer();\n this.shotsLeft = 2;\n\n events.trigger('shotEnded');\n });\n\n events.subscribe('score', () => {\n this.shotsLeft = 1;\n });\n\n events.subscribe('pocket', this.onPocket.bind(this));\n\n events.subscribe('collide', this.onCollision.bind(this));\n\n events.subscribe('shotStarted', () => {\n console.log('shotStarted');\n\n this.hasHitBall = false;\n this.shotsLeft -= 1;\n\n game.cue.setInactive();\n });\n events.subscribe('shotLegal', () => {\n console.log('shotLegal');\n\n if (!this.hasHitBall) {\n events.trigger('foul');\n } else if (this.shotsLeft <= 0) {\n this.changePlayer();\n }\n\n events.trigger('shotEnded');\n });\n\n events.subscribe('shotEnded', () => {\n console.log('shotEnded');\n game.cue.setActive();\n });\n\n events.subscribe('gameWon', this.gameOver.bind(this));\n\n this.balls = [...balls, this.blackBall, game.cueBall];\n }", "title": "" }, { "docid": "a94bec1da39f792d41eedd6172b0ccea", "score": "0.5678355", "text": "function backCircle(x, y, xspeed, yspeed, side,color)\n{\n var div;\n this.x = x;\n this.y = y;\n this.xspeed = xspeed;\n this.yspeed = yspeed;\n this.side = side;\n this.color = color;\n this.make = function()\n {\n div = document.createElement('div');\n div.style.height = side;\n div.style.width = side;\n div.style.borderRadius = \"50%\";\n div.style.backgroundColor = this.color;\n div.style.position = \"absolute\";\n div.style.opacity=0.8;\n div.style.zIndex = 1;\n div.style.left = this.x;\n div.style.top = this.y;\n document.body.appendChild(div);\n }\n \n this.updatePosition = function()\n {\n div.style.left = div.offsetLeft+xspeed;\n if(div.offsetLeft+side+1 >= window.innerWidth || div.offsetLeft-5 <=0)\n xspeed = -xspeed;\n\n div.style.top = div.offsetTop+yspeed;\n if(div.offsetTop+side+5 >= window.innerHeight || div.offsetTop-5 <=0) //+3 because scroll bar appears when ball touches the ground\n yspeed = -yspeed;\n \n //console.log(div.offsetLeft+\" \"+xspeed+\" \"+window.innerWidth);\n \n }\n \n this.update = function()\n {\n setInterval(this.updatePosition,20);\n }\n\n\n}", "title": "" }, { "docid": "594066b9071e12f607f4acb9a9cefd4d", "score": "0.5675297", "text": "function draw_circle(circles) {\n circles\n .attr('r', 5)\n .attr('fill', 'rgba(0,0,0,.5)')\n }", "title": "" }, { "docid": "3dfff5175a1a04d7c00d1353d13c7913", "score": "0.5674483", "text": "function bubbles() {\n $.each($(\".particletext.bubbles\"), function(){\n var bubblecount = ($(this).width()/50)*10;\n for(var i = 0; i <= bubblecount; i++) {\n var size = ($.rnd(40,80)/10);\n $(this).append('<span class=\"particle\" style=\"top:' + $.rnd(20,80) + '%; left:' + $.rnd(0,95) + '%;width:' + size + 'px; height:' + size + 'px;animation-delay: ' + ($.rnd(0,30)/10) + 's;\"></span>');\n }\n });\n}", "title": "" }, { "docid": "fd93b6079e30592d7c5f836d2c166c50", "score": "0.5669761", "text": "function Circle(radius){\n this.radius = radius\n}", "title": "" }, { "docid": "f9274bc4ebb7e24bf1332188af7055a2", "score": "0.5664657", "text": "function createBubble(){\n var numberOfBubble= categories.length;\n for (var i = 0; i <numberOfBubble ; i++) {\n var mybubble = $('<div/>');\n var mybubblewrapper = $('<div/>');\n mybubble.text(categories[i]);\n mybubble.addClass('bubble x1');\n mybubble.attr(\"id\", categories[i]);\n mybubblewrapper.addClass(\"bubblewrapper col-md-2\");\n k=getRandomsize();\n mybubble.css({\n width: k,\n height: k,\n verticalAlign: top,\n paddingTop: \"50px\",\n backgroundColor: \"pink\"\n });\n mybubblewrapper.append(mybubble);\n $('#bubble-container').append(mybubblewrapper);\n\n }\n function getRandomsize() {\n var size=Math.floor(Math.random()*300+250);\n size=size+\"px\";\n return size;\n }\n }", "title": "" }, { "docid": "46ed540b0b04d8d38bc70941f4dfb6df", "score": "0.56573564", "text": "function initCircles() {\n\t\t// get the context from the canvas to draw on\n\t canv.setAttribute(\"width\", 500);\n\t canv.setAttribute(\"height\", 500);\n\t canv.setAttribute(\"style\", \"background:black\");\n\n}", "title": "" }, { "docid": "d6c9211d702ff102be9bcebc850803bc", "score": "0.56446826", "text": "function setup() {\n createCanvas(windowWidth, 800);\n // Create objects (bubbles)\n for (var i=2; i<50; i++) {\n bubbles.push(new Jitter());\n }\n}", "title": "" }, { "docid": "3f4850afab7b50bbdab468e676fcc27c", "score": "0.5640602", "text": "function newGame() {\n bricks = [];\n bonuses = [];\n createBricks();\n ball.x = (Width / 2) - 3;\n ball.y = (Height / 2) - 3;\n ball.speedX = 0;\n ballOn = false;\n ball = {\n x: (Width / 2) - 3,\n y: (Height / 2) - 3,\n radius: 6,\n speedX: 0,\n speedY: 6\n };\n paddle1 = {\n w: 100,\n h: 10,\n x: Width / 2 - (100 / 2),// 100 is paddle.w\n y: Height - 10,\n speed: 10\n };\n }", "title": "" }, { "docid": "0b0e38bcb98c284f80a939c29ac02e86", "score": "0.5640324", "text": "function drawConstructBubble() {\n bb = cr.bubbleSets(); //console.log(\"BB \", bb.getPaths())\n\n path = bb.addPath(cr.nodes('.construct'), cr.edges(), null, {\n style: {\n stroke: \"red\"\n }\n }); //console.log(\"BB after \", bb.getPaths())\n}", "title": "" }, { "docid": "59fc7b373cc025114a9058c9b30b8da9", "score": "0.5638861", "text": "circle() {\n const context = GameState.current;\n const pool = GroupPool.circle();\n context.addChild(pool);\n\n let i;\n for (i = 0; i < GameConfig.setting.NUMBER_OF_CIRCLE; i++) {\n pool.addChild(CircleGenerator.create(i));\n }\n }", "title": "" }, { "docid": "7b268cc125c091485b6a40e396a6b931", "score": "0.56377923", "text": "function Circle(radius)\n{\n this.radius=radius,\n this.draw= function()\n {\n console.log('draw circle')\n }\n\n}", "title": "" }, { "docid": "f4206f908ea66307c550d4ea00e2ef5a", "score": "0.56340367", "text": "constructor(x, y, radius, color){\n //called each time we create a new player class.\n this.x = x;\n this.y = y;\n\n this.radius = radius;\n this.color = color;\n }", "title": "" }, { "docid": "222a5e4b132a79c41412d3ba4cc7f421", "score": "0.5621658", "text": "function setup() {\n createCanvas(600, 400);\n for (var i = 0; i < num; i++) {\n balls.push(new bouncingC(random(-3, 3), random(-3, 3)))\n }\n}", "title": "" }, { "docid": "5e3d164fa6f7f661a13aed130e2a8092", "score": "0.5612897", "text": "function mouseDragged() {\n let r = random(10, 50);\n let b = new Bubble(mouseX, mouseY, r);\n\n bubbles.push(b);\n\n if (bubbles.length > 100) {\n bubbles.splice(0, 1);\n }\n}", "title": "" }, { "docid": "295148cda20555952591a55748bead7f", "score": "0.5610792", "text": "function Circle(radius){\n this.radius = radius; //this. refereces an empty object, radius is a property so we are adding a new property called radius with an empty object\n this.draw = function (){ \n console.log(\"draw\");\n }\n}", "title": "" }, { "docid": "9b9e839c9c91f947807fb177bc75ed34", "score": "0.5596574", "text": "function bounceBubbles() {\n\tdraw();\n\tupdate();\n\tsetTimeout(bounceBubbles, 30);\n}", "title": "" }, { "docid": "7576f855d2715daa8ccd0c62c643d553", "score": "0.55959344", "text": "function setup() {\n noStroke(); // Defines that there will be no stroke around the circles\n createCanvas(594, 841); // Defines that the canvas will be 594 pixels wide and 841 pixels tall\n x1 = random(0, 594); // Defines that the variable \"x1\" will be a random number between 0 and 594\n y1 = random(0, 841); // Defines that the variable \"y1\" will be a random number between 0 and 841\n x3 = random(0, 594); // Defines that the variable \"x3\" will be a random number between 0 and 594\n y3 = random(0, 841); // Defines that the variable \"y3\" will be a random number between 0 and 841\n x5 = random(0, 594); // Defines that the variable \"x5\" will be a random number between 0 and 594\n y5 = random(0, 841); // Defines that the variable \"y5\" will be a random number between 0 and 841\n x7 = random(0, 594); // Defines that the variable \"x7\" will be a random number between 0 and 594\n y7 = random(0, 841); // Defines that the variable \"y7\" will be a random number between 0 and 841\n x9 = random(0, 594); // Defines that the variable \"x9\" will be a random number between 0 and 594\n y9 = random(0, 841); // Defines that the variable \"y9\" will be a random number between 0 and 841\n x11 = random(0, 594); // Defines that the variable \"x11\" will be a random number between 0 and 594\n y11 = random(0, 841); // Defines that the variable \"y11\" will be a random number between 0 and 841\n diameter = 30; // Defines that the variable \"diameter\" will have a value of 30\n d2 = 30; // Defines that the variable \"d2\" will have a value of 30\n d3 = 30; // Defines that the variable \"d3\" will have a value of 30\n d4 = 30; // Defines that the variable \"d4\" will have a value of 30\n d5 = 30; // Defines that the variable \"d5\" will have a value of 30\n d6 = 30; // Defines that the variable \"d6\" will have a value of 30\n background(200); // Defines that the background of the canvas will have an alpha value of 200\n}", "title": "" }, { "docid": "3f7a6f3f4767b0cb231d45553ac0b2af", "score": "0.5593498", "text": "function mousePressed() {\n circle.size += sizeIncrease;\n mosquitoSize += sizeIncrease;\n bg.g = bg.g - 20;\n bg.b = bg.b -10;\n circle.maxSpeed += 1;\n circle2.maxSpeed += .5;\n circle3.maxSpeed += .5;\n}", "title": "" }, { "docid": "9101a81101c829e9fa8fc504a8727932", "score": "0.55919933", "text": "constructor() {\n this.pointsOuter = [];\n this.pointsInner = [];\n }", "title": "" }, { "docid": "8c6236a086f8988f900baa9c880ffede", "score": "0.5588755", "text": "function createCircle(x, y, radius) {\r\n\t\t circles.push({\r\n\t\t x: x,\r\n\t\t y: y,\r\n\t\t radius: radius\r\n\t\t });\r\n\t\t}", "title": "" }, { "docid": "69e5a0baaa0bca8fc33e35e03c581674", "score": "0.55853325", "text": "function draw_existing_bubbles() {\n var center_x, center_y;\n var outerMat;\n var pm = ortho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0);\n\n for (var i = 0; i < existing_bubbles.length; i++) {\n center_x = existing_bubbles[i][0];\n center_y = existing_bubbles[i][1];\n outerMat = mult(translate(center_x, center_y, 0.0), scalem(1.0, 1.0, 1.0));\n outerMat = mult(pm, outerMat);\n\n gl.uniformMatrix4fv(u_ctMatrixLoc, false, flatten(outerMat));\n\n draw_bubble(bubble_colors[i]);\n }\n}", "title": "" }, { "docid": "9e9063fcd4bce20a70a0a6b27f35a0fc", "score": "0.5585118", "text": "constructor(x_,y_){\n this.xBrush = x_;\n this.yBrush = y_;\n}", "title": "" }, { "docid": "fb90020c6f43e7338876da71f1528e8c", "score": "0.55822045", "text": "function createcircles() {\n\t\t\t\t\tsvg.selectAll(\"circle\")\n\t\t\t\t\t.data(data)\n\t\t\t\t\t.enter()\n\t\t\t\t\t.append(\"circle\")\n\t\t\t\t\t.attr(\"r\", +diameter)\n\t\t\t\t\t.attr(\"fill-opacity\", 0.9)\n\t \t\t\t.attr(\"class\", function(d){\n\t\t\t\t\t\t\t\treturn d.Borough;});\n\t\t\t\t\t}", "title": "" }, { "docid": "909e46adbdf37c84bcd072d5ed1b3493", "score": "0.55803156", "text": "function createShapes() {\n myTeapot = new Teapot();\n myTeapot.VAO = bindVAO (myTeapot);\n\n pedestalTop = new Cube(3);\n pedestalTop.VAO = bindVAO(pedestalTop);\n\n pedestalMiddle = new Cylinder(10, 5);\n pedestalMiddle.VAO = bindVAO(pedestalMiddle);\n\n pedestalBottom = new Cube(3);\n pedestalBottom.VAO = bindVAO(pedestalBottom);\n}", "title": "" }, { "docid": "91f714487fd072fcfa089051e2e42df0", "score": "0.55747414", "text": "function onFrame(event){\n for (var i=0; i<numCircles; i++){\n var item = bubbles[i];\n var vector = destinations[i] - item.position;\n\n item.position += vector / speed;\n\n if (vector.length < 5) {\n destinations[i] = Point.random() * view.size;\n }\n }\n}", "title": "" }, { "docid": "37105052b02e21d84dc5d626df9ba9e3", "score": "0.55735695", "text": "function addBalls(x, y)\n{\n for(var i = 0; i < 10; i++)\n {\n //arguments for random are (max, min)\n var x = x||G.random.float(stage.width),\n y = y||G.random.float(stage.height),\n radius = 10,\n color = G.random.color(),\n vx = G.random.float(5,-5),\n vy = G.random.float(5,-5);\n\n new G.Circle(x,y,radius,color,vx,vy);\n }\n}", "title": "" }, { "docid": "1e2f617f67b01fbb1372339ccfb6f8fb", "score": "0.5573485", "text": "function speechBubble2(x, y) {\n CallOutShape.apply(this, arguments);\n }", "title": "" }, { "docid": "e7a6109e8e89537fe9e18ffa0f6142a2", "score": "0.55727094", "text": "function Circle(radius){\n\n this.radius = radius;\n}", "title": "" }, { "docid": "c86329a272a8a650fbf749e703076733", "score": "0.55721295", "text": "function newCircle () {\r\n\ts = int(random (spots.length));\r\n\tx = spots[s].x;\r\n\ty = spots[s].y;\r\n\tlet valid = true;\r\n\t\r\n\tfor (b in buble) {\r\n\t\tlet dx = dist (x, y, buble[b].x, buble[b].y);\r\n\t\tif (dx < buble[b].r+5) {\r\n\t\t\tvalid = false;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tif (valid) {\r\n\t\r\n\t\tcr = 68;\r\n\t\tcg = 85;\r\n\t\tcb = 17;\r\n\t\t\r\n\t\tif (y > 400 && y <= 800) {\t\r\n\t\t\r\n\t\t\tcr = 68;\r\n\t\t\tcg = 86;\r\n\t\t\tcb = 89;\r\n\t\t} else if (y > 800) {\r\n\t\t113,38,34\r\n\t\t\t\tcr = 113;\r\n\t\t\t\tcg = 38;\r\n\t\t\t\tcb = 34;\r\n\t\t\t\t}\r\n\t\tbuble.push (new Circle (x, y, 5, cr, cg, cb));\r\n\t\t}\r\n}", "title": "" }, { "docid": "dcfb4df075a9dfe84b684df01b72af97", "score": "0.5568599", "text": "function bubbleChart(data) {\n var max_amount = d3.max(data, function(d) { return parseInt(d.moneyall, 10); } );\n radius_scale = d3.scale.pow().exponent(0.5).domain([0, max_amount]).range([0, 70]);\n\n //create node objects from original data\n //that will serve as the data behind each\n //bubble in the vis, then add each node\n //to nodes to be used later\n data.forEach(function(d){\n var node = {\n id: d.id,\n radius: radius_scale(parseInt(d.moneyall, 10)),\n comp: d.tier,\n name: d.name,\n subsector: d.subsector,\n value: d.moneyall,\n org: d.company,\n sector: d.sector,\n gender: d.gender,\n x: Math.random() * 3900,\n y: Math.random() * 3800\n };\n nodes.push(node);\n });\n\n\n nodes.sort(function(a, b) {return b.value- a.value; });\n\n svg = d3.select(\"#chartOne\").append(\"svg\")\n .attr(\"width\", width)\n .attr(\"height\", height)\n .attr(\"id\", \"svg_vis\");\n\n circles = svg.selectAll(\"circle\")\n .data(nodes, function(d) { return d.id ;});\n\n circles.enter().append(\"circle\")\n .attr(\"r\", 5)\n .attr(\"fill\", function(d) { return fill_color(d.gender); }) //return fill_color(d.sector);\n .attr(\"stroke-width\", 1)\n .attr(\"stroke\", \"white\")\n .attr(\"data-slug\", function(d) { return \"bubble_\" + d.id; })\n .on(\"mouseover\", function(d, i) {showTip(d, i, this);} )\n .on(\"mouseout\", function(d, i) {hideTip(d, i, this);} );\n\n circles.transition().duration(2000).attr(\"r\", function(d) { return d.radius; });\n\n }", "title": "" } ]
3ab212d67275632838c26facaff8cace
Removes all keyvalue entries from the map.
[ { "docid": "a1c16153d9285b507b13d1c4bf2b381b", "score": "0.0", "text": "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}", "title": "" } ]
[ { "docid": "633172b04674f7d1a88db79a9adb1021", "score": "0.6949329", "text": "function flushMap(map) {\n var values = map.v;\n var keys = map.k;\n\n for (var ndx = values.length; --ndx >= 0; ) {\n if (flushMap(values[ndx])) {\n // remove map\n var v = values.pop();\n var k = keys.pop();\n if (ndx < values.length) {\n values[ndx] = v;\n keys[ndx] = k;\n }\n }\n }\n\n if (map.fresh) {\n map.fresh = false;\n return false;\n }\n if ('value' in map) {\n // remove entry\n if (map.onflush) {\n map.onflush();\n map.onflush = null;\n }\n delete map.value;\n }\n return !values.length;\n }", "title": "" }, { "docid": "e71b42c04935573c2b61630766d569e8", "score": "0.6652174", "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": "a77e4b9f1adb726c9d5e9feec6bd73c6", "score": "0.6538058", "text": "clear()\n {\n this._map.clear();\n }", "title": "" }, { "docid": "d10b06c05170bd5106461b87ccee01b7", "score": "0.64991426", "text": "clear() {\n this._map.values().forEach((item) => {\n item.dispose();\n });\n this._map.clear();\n }", "title": "" }, { "docid": "85e47774260af2454ea9819ac7f8740f", "score": "0.64677405", "text": "clear() {\n this.hashMap.clear();\n }", "title": "" }, { "docid": "fbf52c87dedd403d11cd58b2eea2ed94", "score": "0.6409948", "text": "clearKeys(){\n this.keyList.clearKeys();\n }", "title": "" }, { "docid": "a3440e18022018657bd95d6e71e2a40e", "score": "0.6407228", "text": "remove(key, value) {\r\n let list = this.map_[key];\r\n if (list) {\r\n for (let i = 0; i < list.length; ++i) {\r\n if (list[i] == value) {\r\n list.splice(i, 1);\r\n --i;\r\n }\r\n }\r\n }\r\n }", "title": "" }, { "docid": "a3440e18022018657bd95d6e71e2a40e", "score": "0.6407228", "text": "remove(key, value) {\r\n let list = this.map_[key];\r\n if (list) {\r\n for (let i = 0; i < list.length; ++i) {\r\n if (list[i] == value) {\r\n list.splice(i, 1);\r\n --i;\r\n }\r\n }\r\n }\r\n }", "title": "" }, { "docid": "54dcd4a97cad7661066cada716c0c579", "score": "0.64032316", "text": "clear() {\n this._map.clear();\n }", "title": "" }, { "docid": "4d924e97d3212a8c4209608af2765a55", "score": "0.62924784", "text": "deleteMap() {\n\t\tfor(var i in this.map.items) {\n\t\t\tthis.map.getItem(i).remove();\n\t\t}\n\t\tthis.map = null;\n\t}", "title": "" }, { "docid": "0823da5f5447d731c6d3f7c013ae5822", "score": "0.62922126", "text": "clear() {\n this._map.clear();\n }", "title": "" }, { "docid": "973bd300857fd4cb111eff1b0547b6af", "score": "0.6284955", "text": "clear() {\n this.map = {};\n }", "title": "" }, { "docid": "9886d34fa0cf1d5cf22ca824ed637a60", "score": "0.6225579", "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": "7679f75ed5acd17f219de3416e0a02b6", "score": "0.6203594", "text": "function mapClear() {\n this.__data__ = {\n 'hash': new Hash(),\n 'map': Map ? new Map() : [],\n 'string': new Hash()\n };\n }", "title": "" }, { "docid": "83d39db8a96ccdd291ed589e111ad336", "score": "0.6193841", "text": "clearMap(){\n\t\tvar map = this[_mapArr];\n\t\tfor (var i = 0; i < map.length; i++) {\n\t\t\tfor (var j = 0; j < map.length; j++) {\n\t\t\t\tmap[i][j] = null;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "5009edd161fca6726caf92268f708f31", "score": "0.617115", "text": "function mapClear() {\n this.__data__ = { 'hash': new Hash, 'map': Map ? new Map : [], 'string': new Hash };\n }", "title": "" }, { "docid": "5009edd161fca6726caf92268f708f31", "score": "0.617115", "text": "function mapClear() {\n this.__data__ = { 'hash': new Hash, 'map': Map ? new Map : [], 'string': new Hash };\n }", "title": "" }, { "docid": "3608b575d5617142faefd31f6f9fa1bc", "score": "0.6166302", "text": "function mapClear() {\n\t this.__data__ = {\n\t 'hash': new Hash,\n\t 'map': Map ? new Map : [],\n\t 'string': new Hash\n\t };\n\t }", "title": "" }, { "docid": "3608b575d5617142faefd31f6f9fa1bc", "score": "0.6166302", "text": "function mapClear() {\n\t this.__data__ = {\n\t 'hash': new Hash,\n\t 'map': Map ? new Map : [],\n\t 'string': new Hash\n\t };\n\t }", "title": "" }, { "docid": "3608b575d5617142faefd31f6f9fa1bc", "score": "0.6166302", "text": "function mapClear() {\n\t this.__data__ = {\n\t 'hash': new Hash,\n\t 'map': Map ? new Map : [],\n\t 'string': new Hash\n\t };\n\t }", "title": "" }, { "docid": "0fb2e4272ed8fd4a92b30e0915e9da18", "score": "0.6163354", "text": "function removeAt(map, key, value) {\n // if (!map.has(key)) return\n var set = map.get(key);\n\n var index = set.indexOf(value);\n /*if (index > -1) */\n set.splice(index, 1);\n\n // if the set is empty, remove it from the WeakMap\n if (!set.length) map.delete(key)\n\n }", "title": "" }, { "docid": "5c616e8538914701f6970daaf8de8021", "score": "0.6161068", "text": "function mapClear() {\n\t this.__data__ = { 'hash': new Hash, 'map': Map ? new Map : [], 'string': new Hash };\n\t }", "title": "" }, { "docid": "4d5c2a4635390609e98faafdc516474d", "score": "0.614778", "text": "function mapClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': Map ? new Map : [],\n 'string': new Hash\n };\n }", "title": "" }, { "docid": "4d5c2a4635390609e98faafdc516474d", "score": "0.614778", "text": "function mapClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': Map ? new Map : [],\n 'string': new Hash\n };\n }", "title": "" }, { "docid": "4d5c2a4635390609e98faafdc516474d", "score": "0.614778", "text": "function mapClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': Map ? new Map : [],\n 'string': new Hash\n };\n }", "title": "" }, { "docid": "4d5c2a4635390609e98faafdc516474d", "score": "0.614778", "text": "function mapClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': Map ? new Map : [],\n 'string': new Hash\n };\n }", "title": "" }, { "docid": "4d5c2a4635390609e98faafdc516474d", "score": "0.614778", "text": "function mapClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': Map ? new Map : [],\n 'string': new Hash\n };\n }", "title": "" }, { "docid": "4d5c2a4635390609e98faafdc516474d", "score": "0.614778", "text": "function mapClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': Map ? new Map : [],\n 'string': new Hash\n };\n }", "title": "" }, { "docid": "4d5c2a4635390609e98faafdc516474d", "score": "0.614778", "text": "function mapClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': Map ? new Map : [],\n 'string': new Hash\n };\n }", "title": "" }, { "docid": "4d5c2a4635390609e98faafdc516474d", "score": "0.614778", "text": "function mapClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': Map ? new Map : [],\n 'string': new Hash\n };\n }", "title": "" }, { "docid": "4d5c2a4635390609e98faafdc516474d", "score": "0.614778", "text": "function mapClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': Map ? new Map : [],\n 'string': new Hash\n };\n }", "title": "" }, { "docid": "dedd85306df649255cff3a048c5af09b", "score": "0.61187667", "text": "function removeAll() {\n for (var prop in kml) {\n if (kml[prop].obj) {\n kml[prop].obj.setMap(null);\n delete kml[prop].obj;\n }\n\n }\n}", "title": "" }, { "docid": "8e8912e831d066b3c1ca1d6b56135467", "score": "0.61087006", "text": "remove(value) {\n if (!this.valueExists(value)) return;\n\n delete this.map[value];\n\n this.set = this.set.filter((setVal) => setVal !== value);\n }", "title": "" }, { "docid": "3eea86690b18488117e6437f5f4a53e3", "score": "0.6107819", "text": "function mapClear() {\n\t this.__data__ = { 'hash': new Hash, 'map': Map ? new Map : [], 'string': new Hash };\n\t}", "title": "" }, { "docid": "3eea86690b18488117e6437f5f4a53e3", "score": "0.6107819", "text": "function mapClear() {\n\t this.__data__ = { 'hash': new Hash, 'map': Map ? new Map : [], 'string': new Hash };\n\t}", "title": "" }, { "docid": "2ffb2927052dfe95c334271bdac0fec2", "score": "0.61020905", "text": "function mapClear() {\n\t this.__data__ = {\n\t 'hash': new Hash,\n\t 'map': Map ? new Map : [],\n\t 'string': new Hash\n\t };\n\t}", "title": "" }, { "docid": "2ffb2927052dfe95c334271bdac0fec2", "score": "0.61020905", "text": "function mapClear() {\n\t this.__data__ = {\n\t 'hash': new Hash,\n\t 'map': Map ? new Map : [],\n\t 'string': new Hash\n\t };\n\t}", "title": "" }, { "docid": "2ffb2927052dfe95c334271bdac0fec2", "score": "0.61020905", "text": "function mapClear() {\n\t this.__data__ = {\n\t 'hash': new Hash,\n\t 'map': Map ? new Map : [],\n\t 'string': new Hash\n\t };\n\t}", "title": "" }, { "docid": "f166acc9545874497b6d88a90150597d", "score": "0.6082073", "text": "function mapClear() {\n\t\t this.__data__ = {\n\t\t 'hash': new Hash,\n\t\t 'map': Map ? new Map : [],\n\t\t 'string': new Hash\n\t\t };\n\t\t }", "title": "" }, { "docid": "83c7e7b35b6f37e30252cf7260393933", "score": "0.60264283", "text": "function mapClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': Map ? new Map : [],\n 'string': new Hash\n };\n}", "title": "" }, { "docid": "83c7e7b35b6f37e30252cf7260393933", "score": "0.60264283", "text": "function mapClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': Map ? new Map : [],\n 'string': new Hash\n };\n}", "title": "" }, { "docid": "83c7e7b35b6f37e30252cf7260393933", "score": "0.60264283", "text": "function mapClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': Map ? new Map : [],\n 'string': new Hash\n };\n}", "title": "" }, { "docid": "9a6b4c86e3db5c4bc931cc8ed7169794", "score": "0.6007952", "text": "removeAllMarkers(){\r\n\r\n for(var value of this.markers.entries()){\r\n this.removeMarkerFromMap(value[1]);\r\n }\r\n this.markers.clear();\r\n }", "title": "" }, { "docid": "3eff9a0d4bf1274e24df7401aec110d0", "score": "0.599794", "text": "clear() {\r\n this.map_ = {};\r\n }", "title": "" }, { "docid": "3eff9a0d4bf1274e24df7401aec110d0", "score": "0.599794", "text": "clear() {\r\n this.map_ = {};\r\n }", "title": "" }, { "docid": "40430abd85993462fffd930206349266", "score": "0.5965358", "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": "45df8cc5edf704a8bf6d89db8b458d19", "score": "0.59289485", "text": "async clear() {\n this.keys = {};\n }", "title": "" }, { "docid": "7eeac64787edf12ccc04a09e5fda8c43", "score": "0.5908003", "text": "function clearAllData( exclusions=[] )\n{\n $.each( GM_listValues(),\n function( ndx, key )\n {\n if( !exclusions.includes( key ) )\n {\n GM_deleteValue( key );\n }\n });\n\n}", "title": "" }, { "docid": "6155297a8028864ea28e786f8025b4f1", "score": "0.59073925", "text": "function mapCacheClear(){this.__data__ = {'hash':new Hash(),'map':new (Map || ListCache)(),'string':new Hash()};}", "title": "" }, { "docid": "88bee1500a6206babdc16d094c057186", "score": "0.5903689", "text": "remove(key) {\n var item = this.map[key];\n if (!item) return;\n this._removeItem(item);\n }", "title": "" }, { "docid": "676caf4729828e7ec2aacb0ecd70d147", "score": "0.5847903", "text": "function mapCacheClear(){this.__data__={'hash':new Hash(),'map':new(Map||ListCache)(),'string':new Hash()};}", "title": "" }, { "docid": "676caf4729828e7ec2aacb0ecd70d147", "score": "0.5847903", "text": "function mapCacheClear(){this.__data__={'hash':new Hash(),'map':new(Map||ListCache)(),'string':new Hash()};}", "title": "" }, { "docid": "676caf4729828e7ec2aacb0ecd70d147", "score": "0.5847903", "text": "function mapCacheClear(){this.__data__={'hash':new Hash(),'map':new(Map||ListCache)(),'string':new Hash()};}", "title": "" }, { "docid": "676caf4729828e7ec2aacb0ecd70d147", "score": "0.5847903", "text": "function mapCacheClear(){this.__data__={'hash':new Hash(),'map':new(Map||ListCache)(),'string':new Hash()};}", "title": "" }, { "docid": "676caf4729828e7ec2aacb0ecd70d147", "score": "0.5847903", "text": "function mapCacheClear(){this.__data__={'hash':new Hash(),'map':new(Map||ListCache)(),'string':new Hash()};}", "title": "" }, { "docid": "b016fa4a9fee2b48be436a493b6df26c", "score": "0.5796948", "text": "ensureCapacity() {\n if (this.cacheMap.size > this.maxEntries) {\n // delete first item\n for (const [key, value] of this.cacheMap) {\n this.cacheMap.delete(key);\n break;\n }\n }\n }", "title": "" }, { "docid": "dc729dd40ad34a1f975e7e4cdf44e19b", "score": "0.5784642", "text": "function remove(key) {\n if(data[key]) {\n delete data[key];\n } else {\n console.log('HashMap.remove invoked with invalid key: '+\n key);\n }\n }", "title": "" }, { "docid": "9172e0fd50e44021efb2a1c14d62da16", "score": "0.5756484", "text": "function eraseMap() {\n document.body.removeChild(map);\n }", "title": "" }, { "docid": "bb16313b79244a8b484682d966fca5a5", "score": "0.5723219", "text": "function mapCacheClear(){this.size=0;this.__data__={'hash':new Hash(),'map':new(Map||ListCache)(),'string':new Hash()};}", "title": "" }, { "docid": "bb16313b79244a8b484682d966fca5a5", "score": "0.5723219", "text": "function mapCacheClear(){this.size=0;this.__data__={'hash':new Hash(),'map':new(Map||ListCache)(),'string':new Hash()};}", "title": "" }, { "docid": "bb16313b79244a8b484682d966fca5a5", "score": "0.5723219", "text": "function mapCacheClear(){this.size=0;this.__data__={'hash':new Hash(),'map':new(Map||ListCache)(),'string':new Hash()};}", "title": "" }, { "docid": "bb16313b79244a8b484682d966fca5a5", "score": "0.5723219", "text": "function mapCacheClear(){this.size=0;this.__data__={'hash':new Hash(),'map':new(Map||ListCache)(),'string':new Hash()};}", "title": "" }, { "docid": "bb16313b79244a8b484682d966fca5a5", "score": "0.5723219", "text": "function mapCacheClear(){this.size=0;this.__data__={'hash':new Hash(),'map':new(Map||ListCache)(),'string':new Hash()};}", "title": "" }, { "docid": "bb16313b79244a8b484682d966fca5a5", "score": "0.5723219", "text": "function mapCacheClear(){this.size=0;this.__data__={'hash':new Hash(),'map':new(Map||ListCache)(),'string':new Hash()};}", "title": "" }, { "docid": "bb16313b79244a8b484682d966fca5a5", "score": "0.5723219", "text": "function mapCacheClear(){this.size=0;this.__data__={'hash':new Hash(),'map':new(Map||ListCache)(),'string':new Hash()};}", "title": "" }, { "docid": "bb16313b79244a8b484682d966fca5a5", "score": "0.5723219", "text": "function mapCacheClear(){this.size=0;this.__data__={'hash':new Hash(),'map':new(Map||ListCache)(),'string':new Hash()};}", "title": "" }, { "docid": "bb16313b79244a8b484682d966fca5a5", "score": "0.5723219", "text": "function mapCacheClear(){this.size=0;this.__data__={'hash':new Hash(),'map':new(Map||ListCache)(),'string':new Hash()};}", "title": "" }, { "docid": "bb16313b79244a8b484682d966fca5a5", "score": "0.5723219", "text": "function mapCacheClear(){this.size=0;this.__data__={'hash':new Hash(),'map':new(Map||ListCache)(),'string':new Hash()};}", "title": "" }, { "docid": "bb16313b79244a8b484682d966fca5a5", "score": "0.5723219", "text": "function mapCacheClear(){this.size=0;this.__data__={'hash':new Hash(),'map':new(Map||ListCache)(),'string':new Hash()};}", "title": "" }, { "docid": "bb16313b79244a8b484682d966fca5a5", "score": "0.5723219", "text": "function mapCacheClear(){this.size=0;this.__data__={'hash':new Hash(),'map':new(Map||ListCache)(),'string':new Hash()};}", "title": "" }, { "docid": "bb16313b79244a8b484682d966fca5a5", "score": "0.5723219", "text": "function mapCacheClear(){this.size=0;this.__data__={'hash':new Hash(),'map':new(Map||ListCache)(),'string':new Hash()};}", "title": "" }, { "docid": "bb16313b79244a8b484682d966fca5a5", "score": "0.5723219", "text": "function mapCacheClear(){this.size=0;this.__data__={'hash':new Hash(),'map':new(Map||ListCache)(),'string':new Hash()};}", "title": "" }, { "docid": "bb16313b79244a8b484682d966fca5a5", "score": "0.5723219", "text": "function mapCacheClear(){this.size=0;this.__data__={'hash':new Hash(),'map':new(Map||ListCache)(),'string':new Hash()};}", "title": "" }, { "docid": "bb16313b79244a8b484682d966fca5a5", "score": "0.5723219", "text": "function mapCacheClear(){this.size=0;this.__data__={'hash':new Hash(),'map':new(Map||ListCache)(),'string':new Hash()};}", "title": "" }, { "docid": "dbec72fe79d124437cafa02f3bb2b5fc", "score": "0.57225937", "text": "clear () {\n if (this.objectMap.size <= 0) {\n // There is nothing to clear, exit early\n return\n }\n\n this.objectMap.forEach((key, value) => {\n // Remove the model from the grid\n this.grid.remove(key)\n // Remove the object from the scene\n this.scene.remove(value)\n })\n }", "title": "" }, { "docid": "5b61ba704f48bc95ce96c80c24ed89de", "score": "0.5708831", "text": "unwatch () {\n if (this.watchSubscription != null) {\n this.watchSubscription.close()\n this.watchSubscription = null\n }\n\n for (let [key, entry] of this.entries) {\n entry.destroy()\n this.entries.delete(key)\n }\n }", "title": "" }, { "docid": "9315d4b174dcbeffb03e5bf67e56b213", "score": "0.57040244", "text": "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new _Hash,\n 'map': new (_Map || _ListCache),\n 'string': new _Hash\n };\n }", "title": "" }, { "docid": "dc3eaffc8c22cccb66c39f7f3096955b", "score": "0.5700771", "text": "erase(key) {\n if (this.currentProcess) {\n if (key != null && this.currentProcess.dict.has(key)) {\n this.currentProcess.dict.delete(key);\n }\n else {\n this.currentProcess.dict = new Map();\n }\n }\n }", "title": "" }, { "docid": "96dbd6871f2d1622b7b01ba8f7ac8d1c", "score": "0.56992704", "text": "function mapCacheClear() {\n this.__data__ = {\n 'hash': new Hash(),\n 'map': new (Map$1 || ListCache)(),\n 'string': new Hash()\n };\n }", "title": "" }, { "docid": "6fe2edc38d5224eea162762f8a4fb657", "score": "0.5694321", "text": "function clearMap() {\n for (var i = map.entities.getLength() - 1; i >= 0; i--) {\n var pushpin = map.entities.get(i);\n if (pushpin instanceof Microsoft.Maps.Pushpin)\n map.entities.removeAt(i);\n }\n}", "title": "" }, { "docid": "32a9961e480604db2a24b675d2b38471", "score": "0.5689804", "text": "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new _Hash(),\n 'map': new (_Map || _ListCache)(),\n 'string': new _Hash()\n };\n }", "title": "" }, { "docid": "6bba6076e91982e5e733e9402516cf91", "score": "0.5679663", "text": "function removeAll() {\n _children.forEach(function (map) {\n map.setParentCollection(null);\n });\n\n _children = [];\n dispatchChange(_id, 'remove_map');\n }", "title": "" }, { "docid": "25c6ffd5e6575053d4fbf43bf70a0561", "score": "0.5677067", "text": "_clearMap() {\n for (let i = 0; i < this._traceroutesMarkers.length; i++) {\n this._removeMarkersList(this._traceroutesMarkers[i]);\n }\n\n this._usersMarkers = [];\n this._endpointsMarkers = [];\n this._traceroutesMarkers = [];\n this._colors = {};\n }", "title": "" }, { "docid": "f0ea66cfd6cb02bfe37b2060af46aea8", "score": "0.56711197", "text": "function mapCacheClear() {\n\tthis.size = 0;\n\tthis.__data__ = {\n\t\thash: new _Hash(),\n\t\tmap: new (_Map || _ListCache)(),\n\t\tstring: new _Hash()\n\t};\n}", "title": "" }, { "docid": "da321de0dc2aeb798eadb5a96500f307", "score": "0.56701773", "text": "function mapCacheClear() {\n\t this.__data__ = {\n\t 'hash': new Hash,\n\t 'map': new (Map$2 || ListCache),\n\t 'string': new Hash\n\t };\n\t}", "title": "" }, { "docid": "883dfc49ba819592f39405f0898a1847", "score": "0.56691486", "text": "clearKeys() {\n this.keys = {};\n }", "title": "" }, { "docid": "883dfc49ba819592f39405f0898a1847", "score": "0.56691486", "text": "clearKeys() {\n this.keys = {};\n }", "title": "" }, { "docid": "0891d9a206ea4f917628649e1cf29bcb", "score": "0.5669008", "text": "function mapCacheClear() {\n\t this.__data__ = {\n\t 'hash': new Hash,\n\t 'map': new (Map$1 || ListCache),\n\t 'string': new Hash\n\t };\n\t}", "title": "" }, { "docid": "0891d9a206ea4f917628649e1cf29bcb", "score": "0.5669008", "text": "function mapCacheClear() {\n\t this.__data__ = {\n\t 'hash': new Hash,\n\t 'map': new (Map$1 || ListCache),\n\t 'string': new Hash\n\t };\n\t}", "title": "" }, { "docid": "0891d9a206ea4f917628649e1cf29bcb", "score": "0.5669008", "text": "function mapCacheClear() {\n\t this.__data__ = {\n\t 'hash': new Hash,\n\t 'map': new (Map$1 || ListCache),\n\t 'string': new Hash\n\t };\n\t}", "title": "" }, { "docid": "7390261772898beaf5df2586321c0709", "score": "0.5659265", "text": "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash(),\n 'map': new (Map || ListCache)(),\n 'string': new Hash()\n };\n }", "title": "" }, { "docid": "7e88e6fbd71cb40d63d32e7f17090f77", "score": "0.5656721", "text": "function removeAll() {\n _children.forEach(function(map) {\n map.setParentCollection(null);\n });\n\n _children = [];\n dispatchChange(_id, 'remove_map');\n }", "title": "" }, { "docid": "52c87104e35da88f2b20fc9ed344feae", "score": "0.5655427", "text": "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new _Hash,\n 'map': new (_Map || _ListCache),\n 'string': new _Hash\n };\n }", "title": "" }, { "docid": "c28a90dfad83ee7095f008fb9c8a2bed", "score": "0.5646518", "text": "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map$1 || ListCache),\n 'string': new Hash\n };\n }", "title": "" }, { "docid": "83fd0a87e4f60f22ec46107e4f3704e8", "score": "0.5641935", "text": "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n }", "title": "" }, { "docid": "23bb0c39f46ee3c5dab955a95fb9ffc4", "score": "0.5633904", "text": "function clear() {\n var items = registry.getAll();\n for (var i = items.length - 1; i >= 0; i--) {\n removeItem(items[i]);\n };\n}", "title": "" }, { "docid": "931a8c4bc72a2ee7e0021e8dd2a102c5", "score": "0.5630361", "text": "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash(),\n 'map': new (Map || ListCache)(),\n 'string': new Hash()\n };\n }", "title": "" }, { "docid": "8fe83ae5e4200c98d60099bf3bfb1638", "score": "0.5630148", "text": "async clear() {\n for (const keyStore of this.keyStores) {\n await keyStore.clear();\n }\n }", "title": "" }, { "docid": "8fe83ae5e4200c98d60099bf3bfb1638", "score": "0.5630148", "text": "async clear() {\n for (const keyStore of this.keyStores) {\n await keyStore.clear();\n }\n }", "title": "" }, { "docid": "f3e079301bcb3bed73adeb6c8d5bb2e4", "score": "0.5623075", "text": "function mapCacheClear() {\n\t this.size = 0;\n\t this.__data__ = {\n\t 'hash': new Hash,\n\t 'map': new (Map$1 || ListCache),\n\t 'string': new Hash\n\t };\n\t}", "title": "" }, { "docid": "d0e0ccdabc5187c6d8ae224251ecf71e", "score": "0.5622434", "text": "function mapCacheClear() {\n\t this.size = 0;\n\t this.__data__ = {\n\t 'hash': new Hash,\n\t 'map': new (Map$2 || ListCache),\n\t 'string': new Hash\n\t };\n\t}", "title": "" } ]
11cc61ff02d8bd176297417fd1431ccc
Converts the possible Proto types for numbers into a JavaScript number. Returns 0 if the value is not numeric.
[ { "docid": "540d948e777da758fbced3b89c935390", "score": "0.0", "text": "function yt(t) {\n // TODO(bjornick): Handle int64 greater than 53 bits.\n return \"number\" == typeof t ? t : \"string\" == typeof t ? Number(t) : 0;\n }", "title": "" } ]
[ { "docid": "dcf5c5acf37eeaf669e9c4349784753a", "score": "0.7374579", "text": "asNumber() {\n switch (this.type) {\n case types.NUMBER:\n return this.value;\n case types.STRING:\n if (this.value.indexOf('.') !== -1) {\n return parseFloat(this.value, 10);\n }\n return parseInt(this.value, 10);\n case types.BOOLEAN:\n return this.value ? 1 : 0;\n default:\n return 0;\n }\n }", "title": "" }, { "docid": "c7c7efbe2cda98406601a11458bd5865", "score": "0.68357486", "text": "function typeNumber(data) {\n\t if (data === null) {\n\t return 1;\n\t }\n\t if (data === void 666) {\n\t return 0;\n\t }\n\t var a = numberMap[__type.call(data)];\n\t return a || 8;\n\t}", "title": "" }, { "docid": "3684b1b4e2ed0a6660480c561f49dd1c", "score": "0.67561597", "text": "function number(value) {\n return pgp.as.number(Number(value));\n}", "title": "" }, { "docid": "080d59bc2acd15b1e2729481a4ac96b2", "score": "0.6505757", "text": "function num(val)\r\n{\r\n\r\n return Number(val);\r\n\r\n}", "title": "" }, { "docid": "3c50519c5b1aba7f3bd58011f0336235", "score": "0.6394974", "text": "function num (v) { return parseInt((v||\"0\").replace(/[^0-9]+/g, ''), 10) }", "title": "" }, { "docid": "ff5fc12ed82f9d02d048ab107ee5fcb0", "score": "0.6387838", "text": "function toNumber(num) { return Number(num); }", "title": "" }, { "docid": "9a1fd3d26b58703a0bb6f1f7dfb5fda7", "score": "0.63771826", "text": "parseValue(value) {\n switch (typeof value) {\n case 'string': return Number(value);\n default: return value;\n }\n }", "title": "" }, { "docid": "16f793e6a52c1685ec784f49e2848162", "score": "0.6350886", "text": "toNumber() {\n return 1\n }", "title": "" }, { "docid": "27dbd592857427610ad81e2792c8d67b", "score": "0.63177323", "text": "function anyToNumber(value) {\n if (_utils_Type__WEBPACK_IMPORTED_MODULE_3__[\"isDate\"](value)) {\n return value.getTime();\n } else if (_utils_Type__WEBPACK_IMPORTED_MODULE_3__[\"isNumber\"](value)) {\n return value;\n } else if (_utils_Type__WEBPACK_IMPORTED_MODULE_3__[\"isString\"](value)) {\n // Try converting to number (assuming timestamp)\n var num = Number(value);\n\n if (!_utils_Type__WEBPACK_IMPORTED_MODULE_3__[\"isNumber\"](num)) {\n // Failing\n return undefined;\n } else {\n return num;\n }\n }\n }", "title": "" }, { "docid": "5f0f0455201d3ff8dd6d41d97f7c9912", "score": "0.6268962", "text": "static coerce(name, value) {\n let match = name.match(\"^u?int([0-9]+)$\");\n if (match && parseInt(match[1]) <= 48) {\n value = value.toNumber();\n }\n return value;\n }", "title": "" }, { "docid": "5f0f0455201d3ff8dd6d41d97f7c9912", "score": "0.6268962", "text": "static coerce(name, value) {\n let match = name.match(\"^u?int([0-9]+)$\");\n if (match && parseInt(match[1]) <= 48) {\n value = value.toNumber();\n }\n return value;\n }", "title": "" }, { "docid": "5f0f0455201d3ff8dd6d41d97f7c9912", "score": "0.6268962", "text": "static coerce(name, value) {\n let match = name.match(\"^u?int([0-9]+)$\");\n if (match && parseInt(match[1]) <= 48) {\n value = value.toNumber();\n }\n return value;\n }", "title": "" }, { "docid": "5f0f0455201d3ff8dd6d41d97f7c9912", "score": "0.6268962", "text": "static coerce(name, value) {\n let match = name.match(\"^u?int([0-9]+)$\");\n if (match && parseInt(match[1]) <= 48) {\n value = value.toNumber();\n }\n return value;\n }", "title": "" }, { "docid": "2f07f91d70c7378f4263d586e82dd019", "score": "0.6265045", "text": "function toNumber(){\n\t\tif(this.isNumber) return 1 * this;\n\t\treturn false;\n\t}", "title": "" }, { "docid": "b6d4ce6a0cade3eb9d629f2176f347b4", "score": "0.6227834", "text": "number(number) {\n if (number === \"0x\") {\n return 0;\n }\n return BigNumber.from(number).toNumber();\n }", "title": "" }, { "docid": "b6d4ce6a0cade3eb9d629f2176f347b4", "score": "0.6227834", "text": "number(number) {\n if (number === \"0x\") {\n return 0;\n }\n return BigNumber.from(number).toNumber();\n }", "title": "" }, { "docid": "f806d7950d976d3f21e9f3b51f46d847", "score": "0.619926", "text": "function anyToNumber(value) {\r\n if (_utils_Type__WEBPACK_IMPORTED_MODULE_3__.isDate(value)) {\r\n return value.getTime();\r\n }\r\n else if (_utils_Type__WEBPACK_IMPORTED_MODULE_3__.isNumber(value)) {\r\n return value;\r\n }\r\n else if (_utils_Type__WEBPACK_IMPORTED_MODULE_3__.isString(value)) {\r\n // Try converting to number (assuming timestamp)\r\n var num = Number(value);\r\n if (!_utils_Type__WEBPACK_IMPORTED_MODULE_3__.isNumber(num)) {\r\n // Failing\r\n return undefined;\r\n }\r\n else {\r\n return num;\r\n }\r\n }\r\n}", "title": "" }, { "docid": "a2bbf09786a3f3a76eea552e5c2b5251", "score": "0.6188737", "text": "function _numberCoerce(obj) {\n return obj.toString();\n}", "title": "" }, { "docid": "8c2d8e25e825e472d3d552b57fe7a6ab", "score": "0.6176138", "text": "function toNumber(value) {\n if (hasValue(value) && !isNumber(value)) {\n var converted = Number(value);\n\n if (isNaN(converted) && isString(value) && value != \"\") {\n return toNumber(value.replace(/[^0-9.\\-]+/g, ''));\n }\n\n return converted;\n }\n\n return value;\n }", "title": "" }, { "docid": "6c9ab695d18f5dd7e16702ba9ae71773", "score": "0.6174128", "text": "function coerceToNumber(value) {\n\t return typeof value === 'string' ? parseInt(value, 10) : value;\n\t}", "title": "" }, { "docid": "a6818b169ddf3d04f19a2b915e5494b7", "score": "0.6132446", "text": "function getBSONTypeNumber(val) {\n var map = {\n double: 1,\n string: 2,\n object: 3,\n array: 4,\n binData: 5,\n undefined: 6,\n objectId: 7,\n bool: 8,\n date: 9,\n null: 10,\n regex: 11,\n dbPointer: 12,\n javascript: 13,\n symbol: 14,\n javascriptWithScope: 15,\n int: 16,\n timestamp: 17,\n long: 18,\n decimal: 19,\n minKey: -1,\n maxKey: 127\n };\n return map[getBSONTypeString(val)];\n}", "title": "" }, { "docid": "1d4fab1d6dcc6efe3a3f2642f442143c", "score": "0.6108928", "text": "function num (v) {\n\t return v === undefined ? -1 : parseInt((v||\"0\").replace(/[^0-9]+/g, ''), 10)\n\t}", "title": "" }, { "docid": "11a71aa2c98b189011dccc22f1089a5d", "score": "0.6070545", "text": "function toNumber(value) {\r\n if (hasValue(value) && !isNumber(value)) {\r\n var converted = Number(value);\r\n if (isNaN(converted) && isString(value) && value != \"\") {\r\n return toNumber(value.replace(/[^0-9.\\-]+/g, ''));\r\n }\r\n return converted;\r\n }\r\n return value;\r\n}", "title": "" }, { "docid": "f355f2552ffb4e9053ae4fb59b65faeb", "score": "0.60695434", "text": "function onlyNumbers(value) {\n if (typeof value === 'number') {\n return value\n } else return 0\n}", "title": "" }, { "docid": "4ac9e714921a51b85d28b7ce490125d7", "score": "0.6064286", "text": "function coerceNumber(num) {\n\t\tif(!isNaN(num)) { num = +num; }\n\t\treturn num;\n\t}", "title": "" }, { "docid": "c401c14637f015ccb2e9cfb62b3a59f1", "score": "0.6048632", "text": "function toNumber(val){var n=parseFloat(val,10);return n||n===0?n:val;}", "title": "" }, { "docid": "cf2e781d7f56ebfa8b74ecb1e4139c01", "score": "0.6036989", "text": "to_num(val, int=false)\r\n\t{\r\n\t\treturn isNaN(val) ? val : (int ? parseInt(val) : parseFloat(val));\r\n\t}", "title": "" }, { "docid": "c41c7f19ce0f045bd1dc29d5c655d7ac", "score": "0.6029741", "text": "function number(value: string): number {\n return parseInt(value, 10);\n}", "title": "" }, { "docid": "aab164214a123e95f148d3b1720c092c", "score": "0.6025438", "text": "function number() {\n\t return define('number', value => {\n\t return typeof value === 'number' && !isNaN(value) || \"Expected a number, but received: \" + print(value);\n\t });\n\t}", "title": "" }, { "docid": "414eed3caa0c2b3ffc68679ba2e68d03", "score": "0.6007542", "text": "function toNumber(aValue) {return parseInt(aValue.replace(/\\W/g, \"\").replace(/\\s/g, \"\"));}", "title": "" }, { "docid": "127587ff6cc3d9bfb526aace8d1874fb", "score": "0.5995386", "text": "function toNumber(value) {\n return getNumber(toBigInt(value));\n}", "title": "" }, { "docid": "a8c4d394b3e01ee623a298a554442259", "score": "0.59886014", "text": "function toNumber(x) {\r\n switch (typeof x) {\r\n case 'object':\r\n case 'symbol':\r\n case 'function':\r\n return NaN;\r\n default:\r\n return Number(x);\r\n }\r\n}", "title": "" }, { "docid": "a7a470c3d00d52e4b976e7de45008f7e", "score": "0.5960085", "text": "function makeNumber(s) {\n\t//if (typeof(s)=='string' && s.indexOf('e')>=0) {\n\t//\treturn {type:'float',val:parseFloat(s)};\n\t//}\n\tvar v=parseInt(s);\n\t//var maxSafeInt=9007199254740991; // Number.MAX_SAFE_INTEGER, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER\n\tvar maxSafeInt=1000000000000; // use floats for numbers that are too large\n\tif (v<=maxSafeInt) {\n\t\treturn {type:'int',val:v};\n\t} else {\n\t\treturn {type:'float',val:v};\n\t}\n}", "title": "" }, { "docid": "0bf135554465399e14074dda73618bc0", "score": "0.59337956", "text": "function isNum ( val ){\n return typeof val === 'number';\n}", "title": "" }, { "docid": "5d721fbbcbfe2c31995cdc5258d852c6", "score": "0.59005386", "text": "function isNum (n) { return typeof n === 'number' }", "title": "" }, { "docid": "5d721fbbcbfe2c31995cdc5258d852c6", "score": "0.59005386", "text": "function isNum (n) { return typeof n === 'number' }", "title": "" }, { "docid": "c3adf63ecafad916731abdf5045611ca", "score": "0.5880017", "text": "function handleNumber(value) {\n\tif (buffer === '0') {\n\t\tbuffer = value;\n\t} else {\n\t\tbuffer += value;\n\t}\n}", "title": "" }, { "docid": "fa0168505d5a7e323f70d1612f48b6da", "score": "0.5874687", "text": "getNumber(type) {\n switch (type) {\n case 0: //convert decimal to decimal\n return this.number.toString();\n case 1: //convert decimal to binary\n return this.number.toString(2);\n case 2: //convert decimal to 2's Complement\n if (this.number >= 0) {\n return \"0\" + this.number.toString(2);\n } else {\n //get the binary representation for the positive number\n var ansStr = Math.abs(this.number).toString(2);\n //hold the original length for the string\n var originalLength = ansStr.length;\n //invert every digit\n for (var i = 0; i < ansStr.length; i++) {\n if (ansStr.charAt(i) == \"0\") {\n ansStr = ansStr.replaceAt(i, \"1\");\n } else {\n ansStr = ansStr.replaceAt(i, \"0\");\n }\n }\n //increment 1\n var ansVal = parseInt(ansStr, 2) + 1;\n //convert back to binary\n ansStr = ansVal.toString(2);\n //making sure the string is original size with zero extended\n var l = ansStr.length;\n for (var i = 0; i < originalLength - l; i++) {\n ansStr = \"0\" + ansStr;\n }\n //return the answer with sign extended\n return \"1\" + ansStr;\n }\n case 3: //convert decimal to octal\n return this.number.toString(8);\n case 4: //convert decimal to hex\n return this.number.toString(16);\n }\n }", "title": "" }, { "docid": "bdb2092ff8a84dc797e1c7ae8fc5748e", "score": "0.5840479", "text": "function numberParser(params) {\n return Number(params.newValue);\n }", "title": "" }, { "docid": "76bf77184ed14645305e3ebbd4b1183a", "score": "0.5834652", "text": "function toNumber(value, def) {\n if (parseInt(value)) {\n var intValue = parseInt(value);\n return intValue;\n }\n return def;\n}", "title": "" }, { "docid": "d8001130642d69da7ca606c914f55106", "score": "0.5829031", "text": "function getNumberType() {\n var _normalizeArguments = normalizeArguments(arguments),\n input = _normalizeArguments.input,\n options = _normalizeArguments.options,\n metadata = _normalizeArguments.metadata;\n\n return Object(_getNumberType___WEBPACK_IMPORTED_MODULE_1__[\"default\"])(input, options, metadata);\n} // Sort out arguments", "title": "" }, { "docid": "be0b0736e96f40736c4babc70110e07e", "score": "0.5818104", "text": "function asNum (n) { return isNum(n) ? n : tonalMidi.toMidi(n) }", "title": "" }, { "docid": "75a6ba4461e141fab61de59d4313d27b", "score": "0.58134526", "text": "function number(what)\n{\n return parseInt(what.replace(/,/g,''),10) || 0\n}", "title": "" }, { "docid": "69a4f4ac4c4df4272a44c131fd7e60e1", "score": "0.580818", "text": "function _isNumber(v){return typeof v==='number'||Object.prototype.toString.call(v)==='[object Number]';}", "title": "" }, { "docid": "5bbbe749220e4d798b88e989fd0bce70", "score": "0.5807829", "text": "setNumber(numberStr, type) {\n switch (type) {\n case 0:\n this.number = eval(numberStr);\n break;\n case 1: //convert binary to decimal\n //check for invalid number\n for (var i = 0; i < numberStr.length; i++) {\n if (!(\"-01\").includes(numberStr.charAt(i))) {\n throw \"Please enter a valid number!\";\n }\n }\n this.number = parseInt(numberStr, 2);\n break;\n case 2: //convert 2's complement to decimal\n this.number = 0;\n for (var i = 0; i < numberStr.length; i++) {\n if (!(\"01\").includes(numberStr.charAt(i))) { //check for invalid number\n throw \"Please enter a valid number!\";\n }\n this.number += (eval(numberStr.charAt(i)) * 2) ** (numberStr.length - 1 - i);\n if (i == 0) {\n this.number = -this.number;\n }\n }\n break;\n case 3: //convert octal to decimal\n //check for invalid number\n for (var i = 0; i < numberStr.length; i++) {\n if (!(\"-01234567\").includes(numberStr.charAt(i))) {\n throw \"Please enter a valid number!\";\n }\n }\n this.number = parseInt(numberStr, 8);\n break;\n case 4: //convert hex to decimal\n //check for invalid number\n for (var i = 0; i < numberStr.length; i++) {\n if (!(\"-0123456789abcdef\").includes(numberStr.charAt(i))) {\n throw \"Please enter a valid number!\";\n }\n }\n this.number = parseInt(numberStr, 16);\n break;\n }\n }", "title": "" }, { "docid": "d790f49f8860f9b7be6e155b791f3c9a", "score": "0.5799115", "text": "numberToken() {\r\n\t\t\t\tvar base, lexedLength, match, number, numberValue, tag;\r\n\t\t\t\tif (!(match = NUMBER.exec(this.chunk))) {\r\n\t\t\t\t\treturn 0;\r\n\t\t\t\t}\r\n\t\t\t\tnumber = match[0];\r\n\t\t\t\tlexedLength = number.length;\r\n\t\t\t\tswitch (false) {\r\n\t\t\t\t\tcase !/^0[BOX]/.test(number):\r\n\t\t\t\t\t\tthis.error(`radix prefix in '${number}' must be lowercase`, {\r\n\t\t\t\t\t\t\toffset: 1\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase !/^(?!0x).*E/.test(number):\r\n\t\t\t\t\t\tthis.error(`exponential notation in '${number}' must be indicated with a lowercase 'e'`, {\r\n\t\t\t\t\t\t\toffset: number.indexOf('E')\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase !/^0\\d*[89]/.test(number):\r\n\t\t\t\t\t\tthis.error(`decimal literal '${number}' must not be prefixed with '0'`, {\r\n\t\t\t\t\t\t\tlength: lexedLength\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase !/^0\\d+/.test(number):\r\n\t\t\t\t\t\tthis.error(`octal literal '${number}' must be prefixed with '0o'`, {\r\n\t\t\t\t\t\t\tlength: lexedLength\r\n\t\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\tbase = (function() {\r\n\t\t\t\t\tswitch (number.charAt(1)) {\r\n\t\t\t\t\t\tcase 'b':\r\n\t\t\t\t\t\t\treturn 2;\r\n\t\t\t\t\t\tcase 'o':\r\n\t\t\t\t\t\t\treturn 8;\r\n\t\t\t\t\t\tcase 'x':\r\n\t\t\t\t\t\t\treturn 16;\r\n\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\treturn null;\r\n\t\t\t\t\t}\r\n\t\t\t\t})();\r\n\t\t\t\tnumberValue = base != null ? parseInt(number.slice(2), base) : parseFloat(number);\r\n\t\t\t\ttag = numberValue === 2e308 ? 'INFINITY' : 'NUMBER';\r\n\t\t\t\tthis.token(tag, number, 0, lexedLength);\r\n\t\t\t\treturn lexedLength;\r\n\t\t\t}", "title": "" }, { "docid": "d3179829a8e20d77b9dc1cef7f6e6075", "score": "0.579354", "text": "function asNum(n) {\n return isNum(n) ? n : tonalMidi.toMidi(n);\n}", "title": "" }, { "docid": "3600b47a78a02372d4025b072f272f2e", "score": "0.5783386", "text": "numberToken() {\n var base, lexedLength, match, number, numberValue, tag;\n if (!(match = NUMBER.exec(this.chunk))) {\n return 0;\n }\n number = match[0];\n lexedLength = number.length;\n switch (false) {\n case !/^0[BOX]/.test(number):\n this.error(`radix prefix in '${number}' must be lowercase`, {\n offset: 1\n });\n break;\n case !/^(?!0x).*E/.test(number):\n this.error(`exponential notation in '${number}' must be indicated with a lowercase 'e'`, {\n offset: number.indexOf('E')\n });\n break;\n case !/^0\\d*[89]/.test(number):\n this.error(`decimal literal '${number}' must not be prefixed with '0'`, {\n length: lexedLength\n });\n break;\n case !/^0\\d+/.test(number):\n this.error(`octal literal '${number}' must be prefixed with '0o'`, {\n length: lexedLength\n });\n }\n base = (function() {\n switch (number.charAt(1)) {\n case 'b':\n return 2;\n case 'o':\n return 8;\n case 'x':\n return 16;\n default:\n return null;\n }\n })();\n numberValue = base != null ? parseInt(number.slice(2), base) : parseFloat(number);\n tag = numberValue === 2e308 ? 'INFINITY' : 'NUMBER';\n this.token(tag, number, 0, lexedLength);\n return lexedLength;\n }", "title": "" }, { "docid": "d577c2684b48828a5f7a373152517821", "score": "0.57703525", "text": "function toNumber(val){var n=parseFloat(val);return isNaN(n)?val:n;}", "title": "" }, { "docid": "0d3776f4cbabc3208e89c039fe7e1932", "score": "0.5768197", "text": "function toNumberIfNumber(x) { if ((typeof x == 'string') && (+parseInt(x) === x)) { x = parseInt(x); } return x; }", "title": "" }, { "docid": "2fd562d2970fe793c9e996e9a8bc67c0", "score": "0.5751281", "text": "function parseValue(value) {\n return Number(value.replace(/[^-?\\d.]/g, ''));\n}", "title": "" }, { "docid": "753a69c1964d34f037674e9f4deb151d", "score": "0.57409555", "text": "get numberData() {\n if (this.type !== 'string') {\n return this.data;\n }\n throw new TypeError('type cannot be non-number (string)');\n }", "title": "" }, { "docid": "6bf34ecba7e716c0f6a55e83841f857f", "score": "0.5725834", "text": "function number(val) {\n return +val;\n}", "title": "" }, { "docid": "73ab41e3ae1f13bc7a7014b0d71af6ae", "score": "0.5717618", "text": "enterOC_NumberLiteral(ctx) {}", "title": "" }, { "docid": "5719645bfc25e0b8683fa2f59364f7a1", "score": "0.5712484", "text": "function toUnsafeNumber() {\n return operator_1.cast(operator_1.or(string_1.floatingPointFormatString(), operator_1.pipe(bigint_1.bigInt(), function (_name, b) {\n return b.toString();\n })), parseFloat, number_1.unsafeNumber());\n}", "title": "" }, { "docid": "575de0b570cf9720b672c600b47f94a5", "score": "0.57098913", "text": "function integerType(value) {\n return numberType(Object.assign({\n multipleOf: 1\n }, value));\n }", "title": "" }, { "docid": "c669216825fc3071db5afdeb3d802022", "score": "0.57050335", "text": "getNumber() {\n return this.host.parseNumericLiteral(this.expression);\n }", "title": "" }, { "docid": "92f3e0bc9ea45c671003f969a4394853", "score": "0.57036316", "text": "function handleNumber(value) {\n if (buffer === '0') {\n buffer = value;\n } else {\n buffer += value;\n }\n \n}", "title": "" }, { "docid": "241172b1d495a8a00aa0d138566ab469", "score": "0.5699534", "text": "function NumberTypes() {\n this.numbers = {};\n}", "title": "" }, { "docid": "ba5fe6a81c177ad6118f92cd6b717754", "score": "0.5694013", "text": "function isNumber(value) {\n return Object.prototype.toString.call(value) === const_object_number;\n }", "title": "" }, { "docid": "a9215824c3948bbe450ef3d222134c0e", "score": "0.5684759", "text": "function numberOrString(value: string): number | string {\n return NUMBER_REGEX.test(value) ? number(value) : value;\n}", "title": "" }, { "docid": "7945e8462692067840af54ffff377693", "score": "0.56825936", "text": "function toNumber(s) {\r\nreturn Number(s.replace(/[^0-9\\.]/g, \"\"));\r\n}", "title": "" }, { "docid": "2251d0add5c95bd41b2dc8cbc24c6f49", "score": "0.56757444", "text": "static number() {\n return new NodeProp({\n deserialize: Number\n });\n }", "title": "" }, { "docid": "32b220815b7ab54505678e8c21ced99c", "score": "0.5664206", "text": "function coerceType(value, schema, options) {\n if (options.doNotCoerce) return value\n if (!tipe.string(value)) return value\n switch(schema.type) {\n case 'number':\n var f = parseFloat(value)\n var i = parseInt(value)\n if (Math.abs(f) > Math.abs(i)) value = f\n else if (i) value = i\n if (value === '0') value = 0\n break\n case 'boolean':\n value = tipe.truthy(value)\n break\n }\n return value\n }", "title": "" }, { "docid": "11c7cab3a9112a020b04e368964b939e", "score": "0.56636494", "text": "function isNumber(num) {\n if (typeof num != 'number') {\n return undefined;\n } else {\n return num;\n }\n}", "title": "" }, { "docid": "b79d3953e37434fa66795bfc61dc80a8", "score": "0.5646352", "text": "number() {\n const { value } = this.fields[this.scope][this.key];\n if (value === undefined || !isNaN(parseInt(value))) {\n return this;\n }\n this.reportInvalid(\"vNumber\");\n return this;\n }", "title": "" }, { "docid": "2a8801fabeafc6cb101b529988a859cf", "score": "0.56445086", "text": "function mt(t) {\n // TODO(bjornick): Handle int64 greater than 53 bits.\n return \"number\" == typeof t ? t : \"string\" == typeof t ? Number(t) : 0;\n }", "title": "" }, { "docid": "3c2767a7602a32b13e1e3cc7a0984939", "score": "0.5637982", "text": "function asNumeric(x) {\n if (typeof x === 'boolean')\n return x ? 1 : 0;\n \n return parseFloat(x);\n}", "title": "" }, { "docid": "43c20785756235d816b281add07319ee", "score": "0.56353116", "text": "function toNumber(number) {\n return number.toString()\n}", "title": "" }, { "docid": "3835777108c5dc9fdf4cea581de8eba2", "score": "0.5634665", "text": "function CH(t,e){if(Tt(t)!==\"object\"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||\"default\");if(Tt(r)!==\"object\")return r;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return(e===\"string\"?String:Number)(t)}", "title": "" }, { "docid": "2a6f7c5018ec75f0147057c80626a817", "score": "0.5633785", "text": "function type(d) {\n d.value = +d.value; // coerce to number\n return d;\n }", "title": "" }, { "docid": "bbb9da6c4ea19893eaef21840ac025ac", "score": "0.56283593", "text": "function ToNumber(x) {\n return 311;\n}", "title": "" }, { "docid": "6dfbaa6f9f3669a92f8d1ff1f0b38d9f", "score": "0.56101614", "text": "function convertNum(str){\n return parseInt(str);\n}", "title": "" }, { "docid": "843b2fedbad6e11a57b9b19fb7535224", "score": "0.55980766", "text": "function J(t) {\n // TODO(bjornick): Handle int64 greater than 53 bits.\n return \"number\" == typeof t ? t : \"string\" == typeof t ? Number(t) : 0;\n}", "title": "" }, { "docid": "8944270f55663ec98e8b376eeb13e977", "score": "0.5595854", "text": "function parseNumber(num) {\n var numStr = Math.abs(num) + '';\n var exponent = 0, digits, integerLen;\n var i, j, zeros;\n // Decimal point?\n if ((integerLen = numStr.indexOf(DECIMAL_SEP)) > -1) {\n numStr = numStr.replace(DECIMAL_SEP, '');\n }\n // Exponential form?\n if ((i = numStr.search(/e/i)) > 0) {\n // Work out the exponent.\n if (integerLen < 0)\n integerLen = i;\n integerLen += +numStr.slice(i + 1);\n numStr = numStr.substring(0, i);\n }\n else if (integerLen < 0) {\n // There was no decimal point or exponent so it is an integer.\n integerLen = numStr.length;\n }\n // Count the number of leading zeros.\n for (i = 0; numStr.charAt(i) === ZERO_CHAR; i++) { /* empty */\n }\n if (i === (zeros = numStr.length)) {\n // The digits are all zero.\n digits = [0];\n integerLen = 1;\n }\n else {\n // Count the number of trailing zeros\n zeros--;\n while (numStr.charAt(zeros) === ZERO_CHAR)\n zeros--;\n // Trailing zeros are insignificant so ignore them\n integerLen -= i;\n digits = [];\n // Convert string to array of digits without leading/trailing zeros.\n for (j = 0; i <= zeros; i++, j++) {\n digits[j] = Number(numStr.charAt(i));\n }\n }\n // If the number overflows the maximum allowed digits then use an exponent.\n if (integerLen > MAX_DIGITS) {\n digits = digits.splice(0, MAX_DIGITS - 1);\n exponent = integerLen - 1;\n integerLen = 1;\n }\n return { digits: digits, exponent: exponent, integerLen: integerLen };\n }", "title": "" }, { "docid": "57cb67d86c3e9f91b0f04702201ce6cd", "score": "0.55934864", "text": "valueOf() { // return an object\n return this.num;\n }", "title": "" }, { "docid": "2f5af7c4483844a8eee7f3e724518929", "score": "0.55920506", "text": "function toNumber(value) {\n if (typeof value === \"string\") {\n value = value.replace(/\\s+|,|^\\$|\\$$|%$|^%/g, \"\"); //accept $ or % in valid positions, as well as commas or spaces (both treated as delimiters).\n //strip these valid characters from input to make the regex checker easier to write.\n value = value.match(\"^(-?\\\\d*\\\\.?\\\\d*)$\"); //after removing valid non numeric characters, does the string represent a valid number?\n }\n var asNumber = Number.parseFloat(value);\n return Number.isFinite(asNumber) ? asNumber : null;\n}", "title": "" }, { "docid": "6140b20e22ad735a75ab9e5b5fc98f39", "score": "0.55907875", "text": "function mapNum(){\n\t var numStr=decantedObj.num;\n\t\t var result=0;\n\t\t for(var i=0; i<numStr.length; i++){\n\t\t result+=numStr[i]*_MULTIPLIER;\n\t\t }\n\t\t if(decantedObj.num!=\"\"){\n\t\t decantedObj.num=base16(result);\n\t\t } \n\t }", "title": "" }, { "docid": "bf123eb0f698e0cba5c64765063137c6", "score": "0.5590764", "text": "function strNum() {\n return {\n type: [String, Number],\n default: null\n };\n}", "title": "" }, { "docid": "bf123eb0f698e0cba5c64765063137c6", "score": "0.5590764", "text": "function strNum() {\n return {\n type: [String, Number],\n default: null\n };\n}", "title": "" }, { "docid": "bf123eb0f698e0cba5c64765063137c6", "score": "0.5590764", "text": "function strNum() {\n return {\n type: [String, Number],\n default: null\n };\n}", "title": "" }, { "docid": "bf123eb0f698e0cba5c64765063137c6", "score": "0.5590764", "text": "function strNum() {\n return {\n type: [String, Number],\n default: null\n };\n}", "title": "" }, { "docid": "bf123eb0f698e0cba5c64765063137c6", "score": "0.5590764", "text": "function strNum() {\n return {\n type: [String, Number],\n default: null\n };\n}", "title": "" }, { "docid": "99fbf816e8079a8f1ee67c80282580c9", "score": "0.5589744", "text": "function parseTypeN (type) {\n return parseInt(/^\\D+(\\d+)$/.exec(type)[1], 10)\n}", "title": "" }, { "docid": "99fbf816e8079a8f1ee67c80282580c9", "score": "0.5589744", "text": "function parseTypeN (type) {\n return parseInt(/^\\D+(\\d+)$/.exec(type)[1], 10)\n}", "title": "" }, { "docid": "99fbf816e8079a8f1ee67c80282580c9", "score": "0.5589744", "text": "function parseTypeN (type) {\n return parseInt(/^\\D+(\\d+)$/.exec(type)[1], 10)\n}", "title": "" }, { "docid": "99fbf816e8079a8f1ee67c80282580c9", "score": "0.5589744", "text": "function parseTypeN (type) {\n return parseInt(/^\\D+(\\d+)$/.exec(type)[1], 10)\n}", "title": "" }, { "docid": "99fbf816e8079a8f1ee67c80282580c9", "score": "0.5589744", "text": "function parseTypeN (type) {\n return parseInt(/^\\D+(\\d+)$/.exec(type)[1], 10)\n}", "title": "" }, { "docid": "3c532a25f7e4236ead46810123a90a0c", "score": "0.55848646", "text": "function translateToNumber(type, string) {\n if (type == \"clarity\") {\n return dictForClarity[string];\n } else if (type == \"color\") {\n return dictForColor[string];\n } else if (type == \"cut\") {\n return dictForCut[string];\n } else {\n console.log(\"failed to process\");\n }\n}", "title": "" }, { "docid": "72be40348df7edcf90026849acdbeb2a", "score": "0.55819815", "text": "function to_numeric(st)\n{\n\tst = st+'';\n\tif(st)\n\t{\n\t\treturn (typeof(st)=='number' || (typeof(st.match)!='undefined' && !st.match(/[^0-9.,-]/)))?parseFloat(st.replace(/\\,/g,'')):st;\n\t}\n\telse\n\t{\n\t\tif(st==''){\n\t\t\treturn 0;\n\t\t}else return st;\n\t}\n}", "title": "" }, { "docid": "e12f2c1c3afd16a77ab41ba44d00df57", "score": "0.55655444", "text": "function getOrDefaultNumber(val) {\n if (val === null || val === undefined) {\n return 0;\n }\n else if (typeof val === \"number\") {\n return val;\n }\n else {\n return val.toNumber();\n }\n}", "title": "" }, { "docid": "dd1eaa86ce7dd7110bd2c03b7dfc9fa2", "score": "0.55618304", "text": "get numeric() {\n return this.addValidator({\n message: (value, label) => `Expected ${label} to be numeric, got \\`${value}\\``,\n validator: value => /^[+-]?\\d+$/i.test(value)\n });\n }", "title": "" }, { "docid": "6b78efa2101e84e6ca29b70ce4b55315", "score": "0.55578136", "text": "function getAsNumber (value) {\n var result = \"\" + value;\n result = result.replace(\",\", \".\");\n\n if ($.isNumeric(result) == false) {\n return 0;\n }\n\n return parseFloat(result.replace(\",\", \".\"));\n}", "title": "" }, { "docid": "99f31aa65a25e762a588d1ec9c2dfae6", "score": "0.5554477", "text": "function Numeric() {}", "title": "" }, { "docid": "dbbfdaf37adf7ab3701f2630e8209f53", "score": "0.5550398", "text": "function toNumber(value) {\n var def = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n if (isNumber(value)) return value;\n if (isString(value)) value = parseFloat(value);\n if (!isNaN(value)) return value;\n return def;\n}", "title": "" }, { "docid": "4221c0bda84d1905ab8d5acd3051292d", "score": "0.55497944", "text": "async transform(value, metadata) {\n const isNumeric = ['string', 'number'].includes(typeof value) &&\n !isNaN(parseFloat(value)) &&\n isFinite(value);\n if (!isNumeric) {\n throw this.exceptionFactory('Validation failed (numeric string is expected)');\n }\n return parseInt(value, 10);\n }", "title": "" }, { "docid": "3bf816bca5f5dbd07899d4bb83303a29", "score": "0.55478406", "text": "valueStringToNumber() {\n this.state.data.forEach( (entry) => {\n entry.value = +entry.value;\n })\n }", "title": "" }, { "docid": "c0179bd25410b1ea345b0f0c1aaea732", "score": "0.5539924", "text": "function human2js(humanNumber) {\n var jsNumber = parseFloat(_commaFix(humanNumber,',','.'));\n return jsNumber>0 || jsNumber<0 ? jsNumber : 0;\n}", "title": "" }, { "docid": "aa4ed631904ff62b50bbff2e44feb349", "score": "0.553567", "text": "num(value) {\n return parseInt(value, 16)\n }", "title": "" }, { "docid": "eb781322971112957f8415f18cf6f59f", "score": "0.552655", "text": "function toNumber(v) {\n return toFloat(v);\n}", "title": "" }, { "docid": "c4ec7126dc01a14d79f0856072ac897c", "score": "0.55263376", "text": "number(val) {\n if (notRequired(val) || parseFloat(val) == val) { // eslint-disable-line eqeqeq\n return '';\n }\n return 'VALIDATION_ERROR_NUMBER';\n }", "title": "" } ]
2d52bca69a876ebe1989ca476b4bbb2c
computes center of mass of digit, for centering note 1 stands for black (0 white) so we have to invert.
[ { "docid": "c3c8ade090d438bc44ff1be8afd414c4", "score": "0.5224272", "text": "function centerImage(img) {\n var meanX = 0;\n var meanY = 0;\n var rows = img.length;\n var columns = img[0].length;\n var sumPixels = 0;\n for (var y = 0; y < rows; y++) {\n for (var x = 0; x < columns; x++) {\n var pixel = (1 - img[y][x]);\n sumPixels += pixel;\n meanY += y * pixel;\n meanX += x * pixel;\n }\n }\n meanX /= sumPixels;\n meanY /= sumPixels;\n \n var dY = Math.round(rows/2 - meanY);\n var dX = Math.round(columns/2 - meanX);\n return {transX: dX, transY: dY};\n }", "title": "" } ]
[ { "docid": "347345bd300274f82a4b780ea52ec5ca", "score": "0.62586963", "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": "0bf40b0f942532717aa4554299a593ae", "score": "0.6199803", "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": "2dd3c92f1983570654ff507de0ad8daf", "score": "0.60979295", "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": "8695b31909a60c4ae78ad371ab49438a", "score": "0.59361964", "text": "function ruleUtil_Moore_centers_0(state) {\n var centers =\n state.c0 |\n (state.c1 << 1);\n return centers;\n }", "title": "" }, { "docid": "47709fd690568343d424df4dfa8c1b6c", "score": "0.5912252", "text": "function centerOf(str) {\n return str.slice(Math.ceil(str.length / 2) - 1, str.length / 2 + 1);\n}", "title": "" }, { "docid": "9600aa9a685b2b58e361e30d740c4f15", "score": "0.590437", "text": "get_centerx() {\n\t\treturn this.x + this.width / 2;\n\t}", "title": "" }, { "docid": "100ed428e5c7bb09179febe23cb56668", "score": "0.5811515", "text": "function calculateCenter() {\r\n center = map.getCenter();\r\n }", "title": "" }, { "docid": "155bc2b07f95631265041b6838cc4dd8", "score": "0.5809183", "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": "c011c65bb1d7d548dd18ec62b5c6210a", "score": "0.57903177", "text": "function calculateCenter() {\r\n center = map.getCenter();\r\n }", "title": "" }, { "docid": "79623c64bc9d318b36dfa7ee0f352a46", "score": "0.57774615", "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": "e5c9e08e7779fe7c9e3a41fb9f42ce66", "score": "0.57721037", "text": "function calculateCenter(){\n center = map.getCenter();\n }", "title": "" }, { "docid": "966beb0b43c21493baaf723076d664eb", "score": "0.5761908", "text": "function nodeCenter(node) {\n return (node.y0 + node.y1) / 2;\n}", "title": "" }, { "docid": "8ec6bc343c1c3af7523689fd74ca4e13", "score": "0.56606334", "text": "centerLetter() {\n this.g.position.x = calligraphyContainerEl.offsetWidth / 2;\n }", "title": "" }, { "docid": "7c40fd22500424f55f4c45799cbc458d", "score": "0.5645689", "text": "function _getBoxCenter(box) {\n // eslint-disable-next-line\n switch(box) {\n case 0: return [1,1];\n case 1: return [1,4];\n case 2: return [1,7];\n case 3: return [4,1];\n case 4: return [4,4];\n case 5: return [4,7];\n case 6: return [7,1];\n case 7: return [7,4];\n case 8: return [7,7];\n }\n }", "title": "" }, { "docid": "95e6f054bd34eeaeb6adcea8fe4e6078", "score": "0.5642038", "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": "a375e6e87019e5cdfdb236218fb93db8", "score": "0.56299025", "text": "function centerOf(string) {\n let lengthHalf = string.length / 2;\n if (string.length % 2 === 0) {\n return string.substring(lengthHalf - 1, lengthHalf + 1);\n } else return string[Math.floor(lengthHalf)];\n}", "title": "" }, { "docid": "01909f210dfff2e563990dc10d3bff1b", "score": "0.5619015", "text": "function centerRadialStripes(x,y){\n\tvar wc = canvas.width/2;\n var hc = canvas.height/2;\n return Math.floor(distance(x,wc,y,hc) % 255);\n}", "title": "" }, { "docid": "d4925d730c788947cdab03adcbc6dfd1", "score": "0.55945665", "text": "set center(value) {}", "title": "" }, { "docid": "3635fcb2484340b3e93bd64c46cf43f5", "score": "0.5585424", "text": "convertCentimeterIntoMeter() {\n this.height = this.height / 100;\n this.length = this.length / 100\n this.width = this.width / 100\n }", "title": "" }, { "docid": "d335218a142118f5df39e65f4945397d", "score": "0.5580137", "text": "function centerCoordOfGroup () {\n \n }", "title": "" }, { "docid": "68233bd71299985b0a3028c614f65d50", "score": "0.55699766", "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": "e89e0878c9446ef6b1bd85314bee9fbc", "score": "0.55574507", "text": "function calcHexCenter(node,s,xOffset,yOffset) {\n const x = xOffset + (node.j + 1 - ((node.i+1)%2)/2)*s*Math.sqrt(3);\n const y = yOffset + (1.5*node.i + 1)*s\n return {x:x, y:y};\n}", "title": "" }, { "docid": "efd95891ff251c26027978ba42fdd50e", "score": "0.5552432", "text": "function centerline01( h ) { \r\n \r\n return { x: 0.4 * Math.sin( h * p2i ), z: 2 * h }; \r\n \r\n}", "title": "" }, { "docid": "5e740133b633879be69018b5820b9a8f", "score": "0.54788256", "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": "d35308638033fdb2189d26c654149f7d", "score": "0.5474577", "text": "function getSizeForCenter(intSize){\n\tvar ret = 0.02; \n\tswitch(intSize){\n\t\tcase 1 : ret = 0.03;break;\n\t\tcase 2 : ret = 0.04;break;\n\t\tcase 3 : ret = 0.05;break;\n\t\tcase 4 : ret = 0.06;break;\n\t\tcase 5 : ret = 0.07;break;\n\t\tcase 6 : ret = 0.08;break;\n\t\tcase 7 : ret = 0.09;break;\n\t\tcase 8 : ret = 0.10;break;\n\t\tcase 9 : ret = 0.11;break;\n\t\tcase 10 : ret = 0.12;break;\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "bfd60d94a806b853c3dd991ef4379aa1", "score": "0.5473996", "text": "getMatrixCenter() {\n let pointA;\n let pointB;\n let pointC;\n let pointD;\n // Get a white rectangle that can be the border of the matrix in center bull's eye or\n try {\n let cornerPoints = new WhiteRectangleDetector(this.image).detect();\n pointA = cornerPoints[0];\n pointB = cornerPoints[1];\n pointC = cornerPoints[2];\n pointD = cornerPoints[3];\n }\n catch (e) {\n // This exception can be in case the initial rectangle is white\n // In that case, surely in the bull's eye, we try to expand the rectangle.\n let cx = this.image.getWidth() / 2;\n let cy = this.image.getHeight() / 2;\n pointA = this.getFirstDifferent(new Point(cx + 7, cy - 7), false, 1, -1).toResultPoint();\n pointB = this.getFirstDifferent(new Point(cx + 7, cy + 7), false, 1, 1).toResultPoint();\n pointC = this.getFirstDifferent(new Point(cx - 7, cy + 7), false, -1, 1).toResultPoint();\n pointD = this.getFirstDifferent(new Point(cx - 7, cy - 7), false, -1, -1).toResultPoint();\n }\n // Compute the center of the rectangle\n let cx = MathUtils.round((pointA.getX() + pointD.getX() + pointB.getX() + pointC.getX()) / 4.0);\n let cy = MathUtils.round((pointA.getY() + pointD.getY() + pointB.getY() + pointC.getY()) / 4.0);\n // Redetermine the white rectangle starting from previously computed center.\n // This will ensure that we end up with a white rectangle in center bull's eye\n // in order to compute a more accurate center.\n try {\n let cornerPoints = new WhiteRectangleDetector(this.image, 15, cx, cy).detect();\n pointA = cornerPoints[0];\n pointB = cornerPoints[1];\n pointC = cornerPoints[2];\n pointD = cornerPoints[3];\n }\n catch (e) {\n // This exception can be in case the initial rectangle is white\n // In that case we try to expand the rectangle.\n pointA = this.getFirstDifferent(new Point(cx + 7, cy - 7), false, 1, -1).toResultPoint();\n pointB = this.getFirstDifferent(new Point(cx + 7, cy + 7), false, 1, 1).toResultPoint();\n pointC = this.getFirstDifferent(new Point(cx - 7, cy + 7), false, -1, 1).toResultPoint();\n pointD = this.getFirstDifferent(new Point(cx - 7, cy - 7), false, -1, -1).toResultPoint();\n }\n // Recompute the center of the rectangle\n cx = MathUtils.round((pointA.getX() + pointD.getX() + pointB.getX() + pointC.getX()) / 4.0);\n cy = MathUtils.round((pointA.getY() + pointD.getY() + pointB.getY() + pointC.getY()) / 4.0);\n return new Point(cx, cy);\n }", "title": "" }, { "docid": "98e484e3c558fee5a3e6d5bcf1b26112", "score": "0.5471211", "text": "function getScotusCenter() {\n return {x:width/2, y:height/2};\n }", "title": "" }, { "docid": "309523a8f971d8b94a548134eeac9757", "score": "0.5464176", "text": "function centerOf(string) {\n var length = string.length;\n var subStrLength = 1;\n var halfway = Math.floor((length - 1) / 2);\n\n if (length % 2 === 0) {\n halfway--;\n }\n\n return string.substr(halfway, subStrLength);\n}", "title": "" }, { "docid": "8b0fc5a7bf0bbf8d0beebff78b4edee5", "score": "0.54517454", "text": "function center(x) { \n currentAlignment = alignCenter \n}", "title": "" }, { "docid": "a406e01079327cf01aa2ac5c33c8053d", "score": "0.5448345", "text": "function center(rect) {\n return XY.init(rect.x1 + (rect.width >> 1), rect.y1 + (rect.height >> 1));\n }", "title": "" }, { "docid": "a02c33e6208906d357fdd09f01b1983f", "score": "0.5427593", "text": "get center()\n {\n return new Point(this.x / 2, this.y / 2);\n }", "title": "" }, { "docid": "fa415383596c597b5022eabafe1d850e", "score": "0.5406582", "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": "b4eb1a0777af9da8a01a4a669e14295b", "score": "0.5396066", "text": "GetLocalCenter() {\n return this.m_sweep.localCenter;\n }", "title": "" }, { "docid": "d9e869a0dd0683243fa2cdd136754969", "score": "0.53857636", "text": "distanceToCenter() {\n return this.midpoint().distanceTo(this.polyhedron.centroid());\n }", "title": "" }, { "docid": "fbf2db09b0bf2c4e7a362e2af711c05f", "score": "0.5339298", "text": "get CENTER_OPACITY() {\n return 127;// -> 255 / 2;\n }", "title": "" }, { "docid": "f44f1d5bb11e4e8c24b67d553efceec7", "score": "0.5333884", "text": "function center(cluster) {\n let lat = 0;\n let lon = 0;\n for (let m of cluster) {\n lat += m.latitude;\n lon += m.longitude;\n }\n return {\n latitude: lat / cluster.length,\n longitude: lon / cluster.length,\n };\n}", "title": "" }, { "docid": "de53eca23131a4fe6ba5721bdd1ac7a4", "score": "0.5326095", "text": "function getIsobarycenter(){\n\t\t\t\tvar sum_x = 0, sum_y = 0;\n\t\t\t\tfor(var i=0; i < points_abs.length; i++){\n\t\t\t\t\tsum_x += points_abs[i].x;\n\t\t\t\t\tsum_y += points_abs[i].y;\n\t\t\t\t}\n\t\t\t\tif(points_abs.length === 0)\n\t\t\t\t\treturn isobarycenter_default;\n\t\t\t\telse\t\n\t\t\t\t\treturn {\n\t\t\t\t\t\t'x': sum_x / points_abs.length,\n\t\t\t\t\t\t'y': sum_y / points_abs.length\n\t\t\t\t\t};\n\t\t\t}", "title": "" }, { "docid": "447ef0ae0dc34c0a157b5c8a0e0446e2", "score": "0.5311005", "text": "function calcDistance(m,n){\n\treturn ((xCenter - m)**2+(yCenter - n)**2)**0.5;\n} //distance from the center", "title": "" }, { "docid": "715572bcf6de5f214ce43bdb0cf82235", "score": "0.53094244", "text": "computeCentroid(cluster) {\n let newCentroid = Array.apply(null, Array(4)).map(() => 0);\n\n cluster.forEach((labColor, i) => {\n newCentroid[0] += labColor.l;\n newCentroid[1] += labColor.a;\n newCentroid[2] += labColor.b;\n newCentroid[3] += labColor.opacity;\n });\n\n newCentroid = newCentroid.map(colorValue => colorValue / cluster.length);\n return __WEBPACK_IMPORTED_MODULE_0_d3_color__[\"e\" /* lab */](...newCentroid);\n }", "title": "" }, { "docid": "8fcf5b2cbdf6cd69ddd5381728ce0226", "score": "0.52871764", "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": "18b6b386db9b18d772ce67f54ddbe59c", "score": "0.528237", "text": "function centerColors() {\n\t\tvar colorWidth = $('.pat-hex-color').outerWidth(true) * 4;\n\t\tvar containerWidth = $('.country-text').width();\n\t\tvar padding = (containerWidth - colorWidth) / 2;\n\t\t$('.pat-hex-container').css({'width':containerWidth + 'px', 'padding-left': padding + 'px', 'padding-right':padding + 'px'});\n\t}", "title": "" }, { "docid": "65bb610020de1eac8f18d6012562c14f", "score": "0.52784926", "text": "centroid() {\n let Cx, Cy;\n if (this.points.length < 1) { return undefined; }\n let A = (Cx = (Cy = 0));\n for (let i = 0; i < this.points.length; i++) {\n let v0 = this.points[i];\n let v1 = this.points[(i + 1) % this.points.length];\n let t = (v0.x * v1.y) - (v1.x * v0.y);\n A += t;\n Cx += (v0.x + v1.x) * t;\n Cy += (v0.y + v1.y) * t;\n }\n if (Math.abs(A) < 0.001) { return this.midpoint(); }\n return {x: Cx / (3 * A), y: Cy / (3 * A)};\n }", "title": "" }, { "docid": "2353046e91d30bcbda17809ccb969253", "score": "0.5277892", "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": "aa83599f8f87d37fc7cc8101ed8966f2", "score": "0.52653235", "text": "function ruleUtil_Moore_centers_2(state) {\n var centers =\n state.c2 |\n (state.c3 << 1);\n return centers;\n }", "title": "" }, { "docid": "086eaf1c1f22cc262eee100cc9ff1579", "score": "0.52521354", "text": "get center() { return [this.width/2, this.height/2, this.depth/2] }", "title": "" }, { "docid": "c578e68cea71a4dcdc71d814141a750f", "score": "0.52491444", "text": "set Center(value) {}", "title": "" }, { "docid": "d0a8e5bbc7de13e30a22a4d671fad682", "score": "0.5235911", "text": "function getMiddle() {\n\t\t\t\t\tvar middle = parseInt(_Width/2);\n\t\t\t\t\treturn middle;\n\t\t\t\t}", "title": "" }, { "docid": "c58d2390306407231b0aa0521d012d3a", "score": "0.52286184", "text": "centerLetter() {\n // Position parent `g` object at center of window\n this.g.position.set( window.innerWidth / 2, window.innerHeight / 2 );\n // Center each letter object horizontally\n this.letters.forEach( letter => letter.centerLetter() );\n // If window's innerHeight hasn't change from last scale, return\n if ( window.innerHeight / 1000 == this.scaleFactor ) return;\n // Calculate new factor of how much to scale by dividing the window height by the original\n // font size: 1000 pixels\n var newScaleFactor = window.innerHeight / 1000;\n // Change scaling by dividing new factor with previous `scaleFactor`\n this.g.scaling.set( newScaleFactor / this.scaleFactor, newScaleFactor / this.scaleFactor );\n // Update `scaleFactor` property with new value\n this.scaleFactor = newScaleFactor;\n // Recalculate path lengths\n this.letters.forEach( letter => letter.calculateLength() );\n }", "title": "" }, { "docid": "d5dfe7069446306bcc0cf5733e0a669b", "score": "0.52148044", "text": "_hexagonCenterPoint(inputPath) {\n function hexagonDimensionCenter(path, subIndex) {\n return path.slice(0, 6).reduce(\n (sum, p) => sum + p[subIndex],\n 0\n ) / 6.0\n }\n return {\n x: hexagonDimensionCenter(inputPath, 0),\n y: hexagonDimensionCenter(inputPath, 1),\n }\n }", "title": "" }, { "docid": "97bdce640fc795639891ff086e9eaa77", "score": "0.5202126", "text": "xToScreenBasis(x, z) {\n //return x + this.canvas.centre[0]\n return (x + this.canvas.centre[0]) / this.smallestScreenEdge() * z\n }", "title": "" }, { "docid": "fb009970810214abb1fa6906967cb9e7", "score": "0.5196386", "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": "9238add33814648e6051279ff625788e", "score": "0.51938784", "text": "Mm() {\r\n return 0.5*this.Fb()*this.k()*this.j()*this.b*Math.pow(this.d(),2)/12\r\n }", "title": "" }, { "docid": "3d29c1e982e2aea349ad2b22ad27cb3b", "score": "0.51916933", "text": "function center() {\n return {\n left: '50%',\n top: '50%',\n transform: 'translate(-50%, -50%)'\n }\n}", "title": "" }, { "docid": "55fc09725fec80160c657a92704d6fa0", "score": "0.51706815", "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": "68693df791d27eee43a58c0bc7d24d7f", "score": "0.5163084", "text": "function setup(canvas, atoms) {\n //K = C * Math.sqrt((canvas.width*canvas.height)/atoms.length);\n //C = K/(Math.sqrt((canvas.width*canvas.height)/atoms.length));\n //console.log(C);\n}", "title": "" }, { "docid": "b53864549f0a4098fefe34fc0d07c645", "score": "0.5158194", "text": "function nodeCentrePosX(d) {\n return catCenters[d.cat].x+shiftXPos;\n }", "title": "" }, { "docid": "ea62890c04987e189eacf1418e93a3ee", "score": "0.5157792", "text": "function calcPinchZoomCenter() {\n var center = T5.D.getCenter(dimensions),\n endDist = T5.V.distance([endCenter, center]),\n endTheta = T5.V.theta(endCenter, center, endDist),\n shiftDelta = T5.V.diff(startCenter, endCenter);\n \n center = T5.V.pointOnEdge(endCenter, center, endTheta, endDist / scaleFactor);\n\n center.x = center.x + shiftDelta.x;\n center.y = center.y + shiftDelta.y; \n \n return center;\n } // calcPinchZoomCenter", "title": "" }, { "docid": "682019c0f5484f8bbde0f6676ceee7ab", "score": "0.5151646", "text": "function center(str) {\n var padding = 0;\n\n padding = Math.floor((totCols - stringDisplayLength(str)) / 2);\n if (padding > 0) {\n colOffset = padding;\n }\n return str;\n }", "title": "" }, { "docid": "8646dd9703e3170bbaa9a11b7bc93cc1", "score": "0.5151351", "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": "73e06a2d68d298825071e1218f3733a3", "score": "0.5140666", "text": "function figureTrackPieceCenters() {\n\t// We take the center of each piece - straight or curve - to be the midpoint between the track path start and\n\t//\ttrack path finish points dropped vertically by half the track thickness\n\tfor( currentPieceIndex = 0; currentPieceIndex < rrTrackPieces.length; currentPieceIndex++ ) {\n\t\t// Make a vector running from the piece's path start point to the piece's path end point\n\t\tvar trackPiecePath = new THREE.Vector3();\n\t\ttrackPiecePath.subVectors( rrTrackPieces[ currentPieceIndex ].piecePathFinishPoint, rrTrackPieces[ currentPieceIndex ].piecePathStartPoint );\n\t\t// Cut the length of that vector in half\n\t\ttrackPiecePath.multiplyScalar( 0.5 );\n\t\t// Make a vector by adding this new vector to the piece's path start point.\n\t\tvar trackPieceCenterPoint = new THREE.Vector3();\n\t\ttrackPieceCenterPoint.addVectors( rrTrackPieces[ currentPieceIndex ].piecePathStartPoint, trackPiecePath );\n\t\t// Now drop that vector vertically by half the thickness of the track piece\n\t\ttrackPieceCenterPoint.y -= ( rrTrackLayout[ 0 ].trackThickness / 2 );\n\t\t// The result is the global location of the center of the piece\n\t\trrTrackPieces[ currentPieceIndex ].center = trackPieceCenterPoint;\n\t}\n}", "title": "" }, { "docid": "35cc790e60f5d74683f91b53eea31190", "score": "0.51401603", "text": "function toCm(n, unit) {\n // as defined in http://www.w3.org/TR/css3-values/#absolute-lengths\n if (unit === 'cm') return n;\n else if (unit === 'mm') return n*0.1;\n else if (unit === 'in') return n*2.54;\n else if (unit === 'px') return n*toCm(1/96, 'in');\n else if (unit === 'pt') return n*toCm(1/72, 'in');\n else if (unit === 'pc') return n*toCm(12, 'pt');\n }", "title": "" }, { "docid": "fa78a53afae36df02043ae0e384b7560", "score": "0.51265883", "text": "function centerMove() {\n if (board[4] === '') {\n move = 4\n } else if (board[4] === playerOne) {\n if (board[0] === '') {\n move = 0\n } else if (board[2] === '') {\n move = 2\n }\n }\n }", "title": "" }, { "docid": "7706f32a148a25d1d880a84f0b40434f", "score": "0.512425", "text": "function generateCentWord(num) {\n var word = \"\";\n var hundredth;\n var tenth;\n var one;\n var extractArr;\n\n extractArr = extract(str(num));\n hundredth = extractArr[0];\n tenth = extractArr[1];\n one = extractArr[2];\n word += getCent(tenth, one);\n return word;\n}", "title": "" }, { "docid": "1c215943520ad767ed1d7fc2a278a668", "score": "0.51218516", "text": "function calculateProjectionCenter(_ref) {\n var coordinateOrigin = _ref.coordinateOrigin,\n coordinateZoom = _ref.coordinateZoom,\n viewProjectionMatrix = _ref.viewProjectionMatrix;\n\n var positionPixels = (0, _viewportMercatorProject.projectFlat)(coordinateOrigin, Math.pow(2, coordinateZoom));\n // projectionCenter = new Matrix4(viewProjectionMatrix)\n // .transformVector([positionPixels[0], positionPixels[1], 0.0, 1.0]);\n return (0, _transformMat2.default)([], [positionPixels[0], positionPixels[1], 0.0, 1.0], viewProjectionMatrix);\n}", "title": "" }, { "docid": "449a69e4aa26e433523cbd2dd7825ef8", "score": "0.5121431", "text": "function _mapCenterFunction( id ) {\n\t// Get the mapstraction element and return a center point {lat:x, lng:x} object\n\tif ( id in ECP1_MXNS ) {\n\t\tvar emxn = ECP1_MXNS[id];\n\t\tvar cp = emxn.getCenter();\n\t\treturn { lat: cp.lat, lng: cp.lon }; // getCenter needs .lon for some reason\n\t}\n\t// Failsafe if not a valid id\n\treturn { lat: 0, lng: 0 };\n}", "title": "" }, { "docid": "25ad47a5e48f184488d2726e48d1990e", "score": "0.51185995", "text": "get_abs_center() {\n var aabb = this.get_aabb();\n return aabb.position.add(aabb.size.multiply_scalar(0.5));\n }", "title": "" }, { "docid": "4b8a937a229cbcaa396a165dc390a5d7", "score": "0.51148283", "text": "function recognize() {\n var t1 = new Date();\n \n // convert RGBA image to a grayscale array, then compute bounding rectangle and center of mass \n var imgData = ctx.getImageData(0, 0, 280, 280);\n grayscaleImg = imageDataToGrayscale(imgData);\n var boundingRectangle = getBoundingRectangle(grayscaleImg, 0.01);\n var trans = centerImage(grayscaleImg); // [dX, dY] to center of mass\n \n // copy image to hidden canvas, translate to center-of-mass, then\n // scale to fit into a 200x200 box (see MNIST calibration notes on\n // Yann LeCun's website)\n var canvasCopy = document.createElement(\"canvas\");\n canvasCopy.width = imgData.width;\n canvasCopy.height = imgData.height;\n var copyCtx = canvasCopy.getContext(\"2d\");\n var brW = boundingRectangle.maxX+1-boundingRectangle.minX;\n var brH = boundingRectangle.maxY+1-boundingRectangle.minY;\n var scaling = 190 / (brW>brH?brW:brH);\n // scale\n copyCtx.translate(canvas.width/2, canvas.height/2);\n copyCtx.scale(scaling, scaling);\n copyCtx.translate(-canvas.width/2, -canvas.height/2);\n // translate to center of mass\n copyCtx.translate(trans.transX, trans.transY);\n \n if (true) {\n // redraw the image with a scaled lineWidth first.\n // not this is a bit buggy; the bounding box we computed above (which contributed to \"scaling\") is not valid anymore because\n // the line width has changed. This is mostly a problem for extreme cases (very small digits) where the rescaled digit will\n // be smaller than the bounding box. I could change this but it'd screw up the code.\n for (var p = 0; p < paths.length; p++) {\n for (var i = 0; i < paths[p][0].length - 1; i++) {\n var x1 = paths[p][0][i];\n var y1 = paths[p][1][i];\n var x2 = paths[p][0][i+1];\n var y2 = paths[p][1][i+1];\n draw(copyCtx, color, lineWidth / scaling, x1, y1, x2, y2);\n }\n }\n } else {\n // default take image from original canvas\n copyCtx.drawImage(ctx.canvas, 0, 0);\n }\n \n \n // now bin image into 10x10 blocks (giving a 28x28 image)\n imgData = copyCtx.getImageData(0, 0, 280, 280);\n grayscaleImg = imageDataToGrayscale(imgData);\n var nnInput = new Array(784);\n for (var y = 0; y < 28; y++) {\n for (var x = 0; x < 28; x++) {\n var mean = 0;\n for (var v = 0; v < 10; v++) {\n for (var h = 0; h < 10; h++) {\n mean += grayscaleImg[y*10 + v][x*10 + h];\n }\n }\n mean = (1 - mean / 100); // average and invert\n nnInput[x*28+y] = (mean - .5) / .5;\n }\n }\n \n // for visualization/debugging: paint the input to the neural net.\n //for copy & pasting the digit into matlab\n //document.getElementById('nnInput').innerHTML=JSON.stringify(nnInput)+';<br><br><br><br>';\n var maxIndex = 0;\n var nnOutput = nn(nnInput, w12, bias2, w23, bias3);\n console.log(nnOutput);\n nnOutput.reduce(function(p,c,i){if(p<c) {maxIndex=i; return c;} else return p;});\n console.log('maxIndex: '+maxIndex);\n document.getElementById('nnOut').innerHTML=maxIndex;\n clearBeforeDraw = true;\n var dt = new Date() - t1;\n console.log('recognize time: '+dt+'ms');\n }", "title": "" }, { "docid": "8e7f9b458b65d1872f0edb7d55f0c0c1", "score": "0.51146424", "text": "get circumcenter() {\n if (!this._circumcenter) {\n // Algorithm in use is defining a circle from three noncolinear planar points\n // http://www.ambrsoft.com/TrigoCalc/Circle3D.htm\n let [x1, y1] = this._A;\n let [x2, y2] = this._B;\n let [x3, y3] = this._C;\n let x1y1_sq = x1 * x1 + y1 * y1;\n let x2y2_sq = x2 * x2 + y2 * y2;\n let x3y3_sq = x3 * x3 + y3 * y3;\n\n let A = x1 * (y2 - y3) - y1 * (x2 - x3) + x2 * y3 - x3 * y2;\n let B = x1y1_sq * (y3 - y2) + x2y2_sq * (y1 - y3) + x3y3_sq * (y2 - y1);\n let C = x1y1_sq * (x2 - x3) + x2y2_sq * (x3 - x1) + x3y3_sq * (x1 - x2);\n // let D = x1y1_sq*(x3*y2 - x2*y3) + x2y2_sq*(x1*y3 - x3*y1) + x3y3_sq*(x2*y1 - x1*y2);\n let a2 = 2 * A;\n let x = -(B / a2);\n let y = -(C / a2);\n let r = new Line(x, y, x1, y1);\n this._circumcenter = { point: new Point(x, y), radius: r.length };\n }\n return this._circumcenter;\n }", "title": "" }, { "docid": "a8f738dfbc37694c568f771e7523e2b9", "score": "0.50995123", "text": "function center_and_scale(graph){\n\tvar minx = graph.pos[0][0];\n\tvar maxx = graph.pos[0][0];\n\tvar miny = graph.pos[0][1];\n\tvar maxy = graph.pos[0][1];\n\n\tgraph.nodes.forEach(function(d, i) {\n\t maxx = Math.max(maxx, graph.pos[i][0]);\n\t minx = Math.min(minx, graph.pos[i][0]);\n\t maxy = Math.max(maxy, graph.pos[i][1]);\n\t miny = Math.min(miny, graph.pos[i][1]);\n\n\t var border = 60\n\t var xspan = maxx - minx;\n\t var yspan = maxy - miny;\n\n\t var scale = Math.min((height-border)/yspan, (width-border)/xspan);\n\t var xshift = (width-scale*xspan)/2\n\t var yshift = (height-scale*yspan)/2\n\n\t force.nodes().forEach(function(d, i) {\n\t\td.x = scale*(graph.pos[i][0] - minx) + xshift;\n\t\td.y = scale*(graph.pos[i][1] - miny) + yshift;\n\t });\n\t});\n }", "title": "" }, { "docid": "e9d49573fd298f2142f382753cab0c11", "score": "0.5091842", "text": "function centerOfWeight(points) {\n\tvar xc = 0.0, yc = 0.0, l = points.length;\n\tmap(points, function(p) {\n\t\txc += p[0]; yc += p[1];\n\t});\n\treturn [xc/l, yc/l];\n}", "title": "" }, { "docid": "064c6532d7899381fdb103db3a5bb633", "score": "0.5081851", "text": "function getCenter(dimensions) {\n return XY.init(dimensions.width >> 1, dimensions.height >> 1);\n }", "title": "" }, { "docid": "42b624fb178796ad9913aa949fae2e68", "score": "0.5075066", "text": "function Start() {\n\n\ttransform.rigidbody.centerOfMass = Vector3 (0, -2, 0);\n}", "title": "" }, { "docid": "875fd4c11878e2dfaf9828416a6b6a82", "score": "0.50665915", "text": "get center() { return this._center; }", "title": "" }, { "docid": "d91281533fe11683e6c08d83dae8348d", "score": "0.5063614", "text": "function changeCenterLetterColor(word) {\n if (word) {\n var splitWord = word.split('');\n // var splitWord = word.split(new RegExp('[\\S+\\.,-\\/#!$%\\^&\\*;:{}=\\-_`~()]', 'g'));​​​​​​​​​​​​​​​​​\n var wordLength = splitWord.length - 1;\n if (splitWord[wordLength].match(/[\\.,-\\/#!$%\\^&\\*;:{}=\\-_`~()]/g)) {\n wordLength -= 1;\n }\n var centerLetter;\n if (wordLength > 0) {\n // if ((wordLength % 2 || wordLength % 3 === 0) && wordLength > 2) {\n // centerLetter = Math.floor(wordLength / 2);\n // } else {\n // centerLetter = Math.floor(wordLength / 2);\n // }\n centerLetter = 1;\n }\n else {\n centerLetter = 0;\n }\n splitWord[centerLetter] = '<font class=\"centerLetter\" color=\"blue\">' + splitWord[centerLetter] + '</font>';\n var c = document.getElementsByClassName('centerLetter')[0];\n if (c) {\n // console.log(c.offsetLeft);\n }\n var newWord = splitWord.join('');\n if (newWord.length === 1) {\n newWord = '<font class=\"readWords\">' + '&nbsp;' + newWord + '</font>';\n }\n else {\n newWord = '<font class=\"readWords\">' + newWord + '</font>';\n }\n // console.log(newWord);\n return newWord;\n } else {\n return '';\n }\n}", "title": "" }, { "docid": "3f5daf22547cc0dba891a303529afa1a", "score": "0.50606227", "text": "get center() {}", "title": "" }, { "docid": "a028ac07fa471df68de8a007367c871f", "score": "0.50566626", "text": "function getSubjectBarycenter(subject){\n\n\tvar weighted_number_of_edges = 0;\n\tvar number_of_edges = 0;\n\tfor( var o = 1; o <= object_vector.length; o++ ){\n\t if( relation_matrix[object_vector[o -1].id()] &&\n\t\trelation_matrix[object_vector[o -1].id()][subject.id()]){\n\t\tweighted_number_of_edges += o;\n\t\tnumber_of_edges++;\n\t }\n\t}\n\t// The '-1' is to offset the indexing.\n\treturn ( weighted_number_of_edges / number_of_edges ) -1;\n }", "title": "" }, { "docid": "5ab6051971c1612d64aae0f31b79e14e", "score": "0.505652", "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": "ca6fcc5e99ae5eff23e701f208acd0e2", "score": "0.5043599", "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": "c31384d21ed4212feb49faa9d1f7a958", "score": "0.5035926", "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.5035926", "text": "function centerCanvas() {\n var x = (windowWidth - width) / 2;\n var y = (windowHeight - height) / 2;\n cnv.position(x, y);\n}", "title": "" }, { "docid": "4a776bf1895f44f390345f507abb5294", "score": "0.502586", "text": "function calcSunEqOfCenter(t){\n var m = calcGeomMeanAnomalySun(t);\n\n var mrad = degToRad(m);\n var sinm = Math.sin(mrad);\n var sin2m = Math.sin(mrad+mrad);\n var sin3m = Math.sin(mrad+mrad+mrad);\n\n var C = sinm * (1.914602 - t * (0.004817 + 0.000014 * t)) + sin2m * (0.019993 - 0.000101 * t) + sin3m * 0.000289;\n return C; // in degrees\n }", "title": "" }, { "docid": "492c26b463fdf054d670bbf9802c9b8d", "score": "0.5022274", "text": "get Center() {}", "title": "" }, { "docid": "e71bb25bbf568e9e8ef3a4bdb010fff8", "score": "0.501853", "text": "function toggleCenter(bP)\n{ \n if (bP) {\n $('#demoboxmodel5').css('margin-left','auto');\n $('#demoboxmodel5').css('margin-right','auto');\n } else {\n $('#demoboxmodel5').css('margin-left','');\n $('#demoboxmodel5').css('margin-right',''); \n }\n}", "title": "" }, { "docid": "9c98dacc6665a16cb440055bd3467f85", "score": "0.5018307", "text": "static hexagonalCentered(n) {\n if (typeof n !== 'number' || n < 1) {\n return [];\n }\n const sequence = Array(n);\n sequence[0] = 1;\n for (let i = 1; i < n; i++) {\n sequence[i] = 6 * i + sequence[i - 1];\n }\n return sequence;\n }", "title": "" }, { "docid": "5313b5a5506cdb1518910801df300961", "score": "0.5008569", "text": "function hexToCMYK(hex) {\n var computedC = 0;\n var computedM = 0;\n var computedY = 0;\n var computedK = 0;\n\n hex = hex.charAt(0) == '#' ? hex.substring(1, 7) : hex;\n\n if (hex.length != 6) {\n return;\n }\n if (/[0-9a-f]{6}/i.test(hex) != true) {\n return;\n }\n\n var r = parseInt(hex.substring(0, 2), 16);\n var g = parseInt(hex.substring(2, 4), 16);\n var b = parseInt(hex.substring(4, 6), 16);\n\n // BLACK\n if (r == 0 && g == 0 && b == 0) {\n computedK = 1;\n return [0, 0, 0, 1];\n }\n\n computedC = 1 - r / 255;\n computedM = 1 - g / 255;\n computedY = 1 - b / 255;\n\n var minCMY = Math.min(computedC, Math.min(computedM, computedY));\n\n computedC = (computedC - minCMY) / (1 - minCMY);\n computedM = (computedM - minCMY) / (1 - minCMY);\n computedY = (computedY - minCMY) / (1 - minCMY);\n computedK = minCMY;\n\n // format to required output\n return `\n ${(computedC * 100).toFixed(0)},\n ${(computedM * 100).toFixed(0)},\n ${(computedY * 100).toFixed(0)},\n ${(computedK * 100).toFixed(0)}\n `;\n}", "title": "" }, { "docid": "687790b06c261eba6ef12a70e4dec1d0", "score": "0.5000048", "text": "centerText() {\n const width = this.text.width / 2; // get the half width\n const height = this.text.height / 2; // get the half height\n\n this.text.setPosition(this.x - width, this.y - height); // set the position from the center of the image minus the half width & height\n }", "title": "" }, { "docid": "7a957bc8beade4f9a91300921872e3d4", "score": "0.49978033", "text": "function calcTileCenter(level, row, column) {\n\tvar tilelat = 90 - row * calcTileHeight(level);\n\tvar tilelon = column * calcTileWidth(level, row);\n\treturn { lat: tilelat, lon: tilelon };\n }", "title": "" }, { "docid": "4d4d0f77815332a66d90110e2a40cb43", "score": "0.49951902", "text": "function getMass(val) {\n return (Math.floor(val / 3) - 2);\n}", "title": "" }, { "docid": "0d9c0bb7701af6c1a36eff32cd13e638", "score": "0.4993813", "text": "GetWorldCenter() {\n return this.m_sweep.c;\n }", "title": "" }, { "docid": "dfd94f1396804b5be6aaea7fe4c58c13", "score": "0.49932677", "text": "xFromScreenBasis(x, z) {\n return x / z * this.smallestScreenEdge() - this.canvas.centre[0]\n }", "title": "" }, { "docid": "773d050203ea0bd8905934c18bbfd3ab", "score": "0.4991069", "text": "function ptCentered(S,I) {\r\n\t\tvar p = pattern(S,I);\r\n\t\t\r\n\t\tp.f = \"steelblue\";\r\n\t\tp.hx = true;\r\n\t\tp.sp = 2;\r\n\t\t\r\n\t\tp.fill = function(_) \t{ if(!arguments.length) return p.f; p.f = _; return p; };\r\n\t\tp.hex = function(_) \t{ if(!arguments.length) return p.hx; p.hx = _; return p; };\r\n\t\tp.spacing = function(_) { if(!arguments.length) return p.sp; p.sp = _; return p; };\r\n\t\t\r\n\t\treturn p;\r\n\t}", "title": "" }, { "docid": "4b6f5644accba2d0a1ab6dfeac5f265a", "score": "0.49884167", "text": "center() {\n const centroid = this.centroid();\n return this.withVertices(this.vertices.map(v => v.vec.sub(centroid)));\n }", "title": "" }, { "docid": "c298a4e4ce80f0d77efa0ca1b0e1c1e0", "score": "0.4987323", "text": "getCenterPoint()\n {\n const midpoint = this.getMidPoint();\n if (this.quad != null)\n {\n midpoint[0] += this.quad.x;\n midpoint[1] += this.quad.y;\n }\n return midpoint;\n }", "title": "" }, { "docid": "6d90e9d468dc9b80a01db708a0480e74", "score": "0.4985894", "text": "set layersAffectMassCenter(value) {}", "title": "" }, { "docid": "df9bcf546b2017d8e5b57f3e6a283c34", "score": "0.49779472", "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": "1ad8b38569efc5aa78abd00185b789a1", "score": "0.497592", "text": "centerX() {\n return this.center().x\n }", "title": "" }, { "docid": "a33325569ec1bbcfc9285c7f2fb85f1e", "score": "0.49758342", "text": "function mmol( bg ) {\n let mmolBG = Math.round( (0.0556 * bg) * 10 ) / 10;\n return mmolBG;\n}", "title": "" }, { "docid": "810be9dea24ece2054a68afc55b3c3ef", "score": "0.4965599", "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": "04bf6ae8b1b80e17bf22ea6314f637e2", "score": "0.49604964", "text": "function pathCenter(path) {\n var x=0, y=0;\n for(var i=0; i<path.length; i++){\n x += path[i][0];\n y += path[i][1];\n }\n return {x: x/path.length, y: y/path.length, width: Math.abs(path[1][0]-path[0][0]), height: Math.abs(path[1][1]-path[2][1])};\n }", "title": "" } ]
2735a354ce45b732cc3a58821002c226
function that places the navigation in the center of the window
[ { "docid": "67e305f9c01a5da01d19ea1c6b6576ce", "score": "0.62396955", "text": "function RepositionNav(){\n\n\t\tvar windowHeight = $window.height(); //get the height of the window\n\n\t\tvar navHeight = $('#nav').height() / 2;\n\n\t\tvar windowCenter = (windowHeight / 2); \n\n\t\tvar newtop = windowCenter - navHeight;\n\n\t\t$('#nav').css({\"top\": newtop}); //set the new top position of the navigation list\n\n\t}", "title": "" } ]
[ { "docid": "3da4cafd68943505ebf46470cf730246", "score": "0.69623005", "text": "function resizeAndCenterWindow() {\n\tresizeWindow();\n\tcenterWindow();\n}", "title": "" }, { "docid": "abf7599091da632567b1cd3201f57997", "score": "0.6727748", "text": "function center_pg(){\r\n $(\"#pg\").css( \"left\", $(window).width()/2 - $(\"#pg\").width()/2 );\r\n $(\"#pg\").css( \"top\", $(window).height()/2 - $(\"#pg\").height()/2 );\r\n }", "title": "" }, { "docid": "b0909fb45d4ecf78225e5b4c1a2325ae", "score": "0.6664595", "text": "function hcenter(target, tomove){\n\t\tvar state = $.data(target, 'window');\n\t\tvar opts = state.options;\n\t\tvar width = opts.width;\n\t\tif (isNaN(width)){\n\t\t\twidth = state.window._outerWidth();\n\t\t}\n\t\tif (opts.inline){\n\t\t\tvar parent = state.window.parent();\n\t\t\topts.left = (parent.width() - width) / 2 + parent.scrollLeft();\n\t\t} else {\n\t\t\topts.left = ($(window)._outerWidth() - width) / 2 + $(document).scrollLeft();\n\t\t}\n\t\tif (tomove){moveWindow(target);}\n\t}", "title": "" }, { "docid": "f49bd76f626f0ee54172a26e3c6b5da0", "score": "0.66605633", "text": "function centerScreen(param){\n\t\tparam.css(\"position\", \"absolute\");\n\t\tparam.css(\"top\", (($(window).height()-param.height())/2));\n\t\tparam.css(\"left\", (($(window).width()-param.width())/2));\n\t}", "title": "" }, { "docid": "3a1cc8dcfbd2e81536065943d928f438", "score": "0.66219187", "text": "function CentreWindow(mypage, myname, w, h, scroll) {\nvar winl = (screen.width - w) / 2;\nvar wint = (screen.height - h) / 2;\nwinprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',toolbar=no,resizable=no,status=no'\nwin = window.open(mypage, myname, winprops)\nif (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }\n}", "title": "" }, { "docid": "6e08734693bfa4c40e1f676b32ce44ae", "score": "0.66078556", "text": "function centerDialogue() {\n var w = $(window);\n dialogue.css({\n \"top\": 7, //0.5 * (w.height() - dialogue.height()),\n left: 0.5 * (w.width() - dialogue.width())\n });\n }", "title": "" }, { "docid": "dfe2da920fcea582c2016a5f2c480cc8", "score": "0.65461683", "text": "function center(){\r\n\tvar windowWidth = window.innerWidth;\r\n\tvar windowHeight = window.innerHeight;\r\n\tvar popupHeight = $(\".usp_ews_popupContainer\").height();\r\n\tvar popupWidth = $(\".usp_ews_popupContainer\").width();\r\n\t$(\".usp_ews_popupContainer\").css({\r\n\t\t\"position\": \"fixed\",\r\n\t\t\"top\": windowHeight/2-popupHeight/2,\r\n\t\t\"left\": windowWidth/2-popupWidth/2\r\n\t});\r\n}", "title": "" }, { "docid": "4a0025f35847eff611f0d23b53f9ca46", "score": "0.6482099", "text": "function center() {\n var scrollTop = $(window).scrollTop();\n wrapper.css('top', scrollTop + ($(window).height() / 2));\n bg &&\n bg.css('top', scrollTop),\n bgiframe.css('top', scrollTop);\n\n return false;\n }", "title": "" }, { "docid": "ccf6b954bc0c25fbd36ff6cf95d81ba0", "score": "0.6459928", "text": "function PopupCenter(a,d,b,c){var e=void 0!=window.screenLeft?window.screenLeft:screen.left,f=void 0!=window.screenTop?window.screenTop:screen.top;width=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width;height=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height;a=window.open(a,d,\"scrollbars=yes, width=\"+b+\", height=\"+c+\", top=\"+(height/2-c/2+f)+\", left=\"+\n(width/2-b/2+e) + ', resizable=yes');window.focus&&a.focus()}", "title": "" }, { "docid": "7708175111c18e3d3be434e54df48807", "score": "0.6456174", "text": "function center() {\n\t$('#content').css('top', Math.max(20, parseInt(($(document).height() - $('#content').height())/2)));\n}", "title": "" }, { "docid": "bf0804b61fa8c4dbb847447d0dbc6687", "score": "0.64126045", "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": "0f6a9b885b37c869ead4e751a651304a", "score": "0.6370792", "text": "function centerNavigation() {\n\n\t//get all items\n\tvar navigationItems = divNavigation.getElementsByTagName(\"li\");\n\t\n\t//find out space they take up\n\tvar width = 0;\n\t\n\tfor ( i = 0; i < navigationItems.length; i++ ) {\n\t\t\n\t\tnavigationItems[i].style.paddingLeft = 0;\n\t\tnavigationItems[i].style.paddingRight = 0;\n\t\t\n\t\twidth += navigationItems[i].offsetWidth;\n\n\t}\n\t\n\tpaddingAmount = Math.round( ( ( divNavigation.offsetWidth - width - 40 ) / navigationItems.length ) / 2 ) - 1;\n\t\n\tfor ( i = 0; i < navigationItems.length; i++ ) {\n\t\t\n\t\tnavigationItems[i].style.paddingLeft = paddingAmount;\n\t\tnavigationItems[i].style.paddingRight = paddingAmount;\n\t\n\t}\n\t\n}", "title": "" }, { "docid": "def2e4f33a65b744858bc3de8a3f38f7", "score": "0.63559705", "text": "function CenterScreen(){\r\r\n var Left = ($(window).width() - $(\"body\").width()) / 2; // Calculate half of the white space\r\r\n var Top = ($(window).height() - $(\"body\").height()) / 2; // Calculate half of the white space\r\r\n $(\"body\").css({left: Left, top: Top});//Set it to the body\r\r\n}", "title": "" }, { "docid": "8e5df1531e538e62a4e70f9e53ff5f67", "score": "0.6328727", "text": "function RepositionNav(){\r\n\t\tvar windowHeight = $window.height(); //get the height of the window\r\n\t\tvar navHeight = $('#nav').height() / 2;\r\n\t\tvar windowCenter = (windowHeight / 2); \r\n\t\tvar newtop = windowCenter - navHeight;\r\n\t\t$('#nav').css({\"top\": newtop}); //set the new top position of the navigation list\r\n\t}", "title": "" }, { "docid": "d2e20193ab50f12a4abb6c7ddaa4101a", "score": "0.6306929", "text": "function centerPopup()\n {\n var $popup = $el.popups.filter(\":visible\").first();\n var offset = {};\n offset.left = ($window.width() / 2) - ($popup.width() / 2);\n offset.top = ($window.height() / 2) - ($popup.height() / 2);\n $popup.offset(offset);\n }", "title": "" }, { "docid": "3705f31a48f36428a1f7f35d5284cf9c", "score": "0.6253073", "text": "function popupCenter(url, title, w, h) {\r\n // Fixes dual-screen position Most browsers Firefox\r\n var dualScreenLeft = window.screenLeft != undefined ? window.screenLeft : screen.left;\r\n var dualScreenTop = window.screenTop != undefined ? window.screenTop : screen.top;\r\n\r\n var width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width;\r\n var height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height;\r\n\r\n var left = ((width / 2) - (w / 2)) + dualScreenLeft;\r\n var top = ((height / 2) - (h / 2)) + dualScreenTop;\r\n var newWindow = window.open(url, title, 'scrollbars=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);\r\n\r\n // Puts focus on the newWindow\r\n if (window.focus) {\r\n newWindow.focus();\r\n }\r\n}", "title": "" }, { "docid": "80ed3f26b216f27863fa70059b76af3f", "score": "0.62363386", "text": "function RepositionNav(){\n\tvar windowHeight = $(window).height(); //get the height of the window\n\tvar navHeight = $('#nav').height() / 2;\n\tvar windowCenter = (windowHeight / 2); \n\tvar newtop = windowCenter - navHeight;\n\t$('#nav').css({\"top\": newtop}); //set the new top position of the navigation list\n}", "title": "" }, { "docid": "d6f78fc0251cdb899e51d9455a41edde", "score": "0.6212692", "text": "function moveNavigation(){\n\t\tvar desktop = checkWindowWidth();\n \n //we are on the AU main site\n if ( desktop ) {\n //we are on a larger device\n $mainNavContainer.detach();\n $mainNavContainer.insertAfter('#nav-anchor');\n } else {\n //we are on a smaller device\n $mainNavContainer.detach();\n $mainNavContainer.appendTo('#au-site-nav-panel');\n }\n\t}", "title": "" }, { "docid": "38c210631766467a15797ab655106606", "score": "0.62009674", "text": "function vcenter(target, tomove){\n\t\tvar state = $.data(target, 'window');\n\t\tvar opts = state.options;\n\t\tvar height = opts.height;\n\t\tif (isNaN(height)){\n\t\t\theight = state.window._outerHeight();\n\t\t}\n\t\tif (opts.inline){\n\t\t\tvar parent = state.window.parent();\n\t\t\topts.top = (parent.height() - height) / 2 + parent.scrollTop();\n\t\t} else {\n\t\t\topts.top = ($(window)._outerHeight() - height) / 2 + $(document).scrollTop();\n\t\t}\n\t\tif (tomove){moveWindow(target);}\n\t}", "title": "" }, { "docid": "689c5fc79febf605c43e2db8844a36a9", "score": "0.6195814", "text": "function centerPopup() {\r\n // get viewport dimensions\r\n var cWidth = document.documentElement.clientWidth;\r\n var cHeight = document.documentElement.clientHeight;\r\n var popupHeight = jQuery('#'+settings.main_id).height();\r\n var popupWidth = jQuery('#'+settings.main_id).width();\r\n // positionning\r\n jQuery('#'+settings.main_id).css({\r\n \"top\": cHeight/2-popupHeight/2, \r\n \"left\": cWidth/2-popupWidth/2\r\n });\r\n // IE6 \r\n jQuery(settings.bg_id).css({\"height\": cHeight});\r\n }", "title": "" }, { "docid": "3ee544707725199621711ce46fafa973", "score": "0.61753696", "text": "function onCenterButtonClick()\n\t\t{\n\t\t\tscale_about_center = true;\n\t\t}", "title": "" }, { "docid": "62cb5d0183332e4e0e58d6cdab8c0075", "score": "0.61671346", "text": "function centerConfig()\r\n{\r\n myJquery('#myConfig').css(\"top\", ((myJquery(window).height() - myJquery('#myConfig').outerHeight()) / 2) + myJquery(window).scrollTop() + \"px\");\r\n myJquery('#myConfig').css(\"left\", ((myJquery(window).width() - myJquery('#myConfig').outerWidth()) / 2) + myJquery(window).scrollLeft() + \"px\");\r\n}", "title": "" }, { "docid": "0563619ef255aba81da4dbe817d6512c", "score": "0.61420125", "text": "function center(window) {\n window = window || Window.focused();\n if (!window) {\n return;\n }\n\n const screenFrame = getScreenFrame(window);\n const isLargeScreen = screenFrame.width > 2000;\n const widthScale = isLargeScreen ? 0.6 : 0.8;\n const heightScale = isLargeScreen ? 0.8 : 0.9;\n\n window.setSize({\n width: Math.round(screenFrame.width * widthScale),\n height: Math.round(screenFrame.height * heightScale),\n });\n\n moveTo(CENTER);\n}", "title": "" }, { "docid": "e68235e80d6c5d74d1f296ed338c2ae2", "score": "0.6087143", "text": "function setMousePositionCenterForWindow(window) {\n var pos = {\n x: window.topLeft().x + window.frame().width / 2,\n y: window.topLeft().y + window.frame().height / 2\n }\n \n // Phoenix.log(String.format('move mouse to pos for {0} x: {1}, y: {2}', window.app().name(), pos.x, pos.y));\n Mouse.move(pos);\n heartbeatWindow(window);\n }", "title": "" }, { "docid": "0b08596e203efd31f91a1891950edadf", "score": "0.6048095", "text": "function setToCenterWindow() {\n\t\tvar container = document.getElementById(\"recordContainer\");\n\t\tvar set = false;\n\n\t\tif(document.body.scrollHeight > document.body.clientHeight) {\n\t\t\tcontainer.style.top = '50%';\n\t\t\tcontainer.style.left= '50%';\n\t\t\tcontainer.style.margin= \"-\" + container.offsetHeight/2 \n\t\t\t\t\t\t\t\t\t+ \"px 0px 0px -\"\n\t\t\t\t\t\t\t\t\t+ container.offsetWidth/2 + \"px\";\t\n\t\t\tset = true;\n\t\t} \n\t\treturn set;\n\t}", "title": "" }, { "docid": "f99177db60c23356c9bbefd5e6b7cb39", "score": "0.60306764", "text": "function PopupCenter(url, title, w, h) {\n // Fixes dual-screen position Most browsers Firefox\n var dualScreenLeft = window.screenLeft != undefined ? window.screenLeft : screen.left;\n var dualScreenTop = window.screenTop != undefined ? window.screenTop : screen.top;\n\n var width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width;\n var height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height;\n\n var left = ((width / 2) - (w / 2)) + dualScreenLeft;\n var top = ((height / 2) - (h / 2)) + dualScreenTop;\n var newWindow = window.open(url, title, 'scrollbars=yes, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);\n\n // Puts focus on the newWindow\n if (window.focus) {\n newWindow.focus();\n }\n}", "title": "" }, { "docid": "2040321b0b2ee16a24025166b8aae17e", "score": "0.60040724", "text": "function alignCenter(e) {\r\n\t\tvar node = (typeof e=='string') ? document.getElementById(e) : ((typeof e=='object') ? e : false);\r\n\t\tif(!window || !node || !node.style) {return;}\r\n\t\tvar style = node.style, beforeDisplay = style.display, beforeOpacity = style.opacity;\r\n\t\tif(style.display=='none') style.opacity='0';\r\n\t\tif(style.display!='') style.display = '';\r\n\t\tstyle.top = Math.floor((window.innerHeight/2)-(node.offsetHeight/2)) + 'px';\r\n\t\tstyle.left = Math.floor((window.innerWidth/2)-(node.offsetWidth/2)) + 'px';\r\n\t\tstyle.display = beforeDisplay;\r\n\t\tstyle.opacity = beforeOpacity;\r\n\t}", "title": "" }, { "docid": "c578e68cea71a4dcdc71d814141a750f", "score": "0.5996114", "text": "set Center(value) {}", "title": "" }, { "docid": "090021ad4d7191ed876671452d098db5", "score": "0.59939605", "text": "function centerOnWindow(elemID) {\n // 'obj' is the positionable object\n var obj = getRawObject(elemID);\n // window scroll factors\n var scrollX = 0, scrollY = 0;\n if (document.body && typeof document.body.scrollTop != \"undefined\") {\n scrollX += document.body.scrollLeft;\n scrollY += document.body.scrollTop;\n if (document.body.parentNode && \n typeof document.body.parentNode.scrollTop != \"undefined\") {\n scrollX += document.body.parentNode.scrollLeft;\n scrollY += document.body.parentNode.scrollTop\n }\n } else if (typeof window.pageXOffset != \"undefined\") {\n scrollX += window.pageXOffset;\n scrollY += window.pageYOffset;\n }\n var x = Math.round((getInsideWindowWidth()/2) - (getObjectWidth(obj)/2)) + scrollX;\n var y = Math.round((getInsideWindowHeight()/2) - (getObjectHeight(obj)/2)) + scrollY;\n shiftTo(obj, x, y);\n show(obj);\n}", "title": "" }, { "docid": "bccc27e795f0b39276dac9a59a4cf75f", "score": "0.5987969", "text": "function alignCenter(e) {\r\n\t\t\tvar node = (typeof e == 'string') ? document.getElementById(e) : ((typeof e == 'object') ? e : false);\r\n\t\t\tif (!window || !node || !node.style) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar style = node.style,\r\n\t\t\tbeforeDisplay = style.display,\r\n\t\t\tbeforeOpacity = style.opacity;\r\n\t\t\tif (style.display == 'none')\r\n\t\t\t\tstyle.opacity = '0';\r\n\t\t\tif (style.display != '')\r\n\t\t\t\tstyle.display = '';\r\n\t\t\tstyle.top = Math.floor((window.innerHeight / 2) - (node.offsetHeight / 2)) + 'px';\r\n\t\t\tstyle.left = Math.floor((window.innerWidth / 2) - (node.offsetWidth / 2)) + 'px';\r\n\t\t\tstyle.display = beforeDisplay;\r\n\t\t\tstyle.opacity = beforeOpacity;\r\n\t\t}", "title": "" }, { "docid": "25030a5e55c03ba65b926cb430b63e17", "score": "0.5984327", "text": "function positionMenu(e) {\n clickCoords = getPosition(e);\n clickCoordsX = clickCoords.x;\n\n clickCoordsY = clickCoords.y;\n\n\n menuWidth = cm.offsetWidth + 4;\n menuHeight = cm.offsetHeight + 4;\n\n windowWidth = window.innerWidth;\n windowHeight = window.innerHeight;\n\n if ((windowWidth - clickCoordsX) < menuWidth) {\n cm.style.left = `${windowWidth - menuWidth}px`;\n } else {\n cm.style.left = `${clickCoordsX}px`;\n }\n\n if ((windowHeight - clickCoordsY) < menuHeight) {\n cm.style.top = `${windowHeight - menuHeight}px`;\n } else {\n cm.style.top = `${clickCoordsY}px`;\n }\n}", "title": "" }, { "docid": "e88303f55abfce53d9eeb63e100b1305", "score": "0.5984288", "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": "615e5d42302020709df2d791a5b58eaa", "score": "0.5978946", "text": "function center($window, $obj){\n var top, left;\n var win_height = $window.height();\n var win_width = $window.width();\n var obj_height = $obj.height();\n var obj_width = $obj.width();\n \n //keep obj on screen\n if(win_height > obj_height)\n top = win_height/2 - obj_height/2;\n else\n top = 0;\n if(win_width > obj_width)\n left = win_width/2 - obj_width/2;\n else\n left = 0;\n \n //set to center\n $obj.css('top', top);\n $obj.css('left', left);\n}", "title": "" }, { "docid": "9ff4cbb05039f199e4549c01eafa2212", "score": "0.59320486", "text": "function openhomiesNav() {\r\n document.getElementById(\"myHomiesnav\").style.width = \"25%\";\r\n document.getElementById(\"push-content\").style.marginLeft = \"25%\";\r\n}", "title": "" }, { "docid": "a0e33c2cd616bf0f66049ecbfe6e3e61", "score": "0.5893224", "text": "function navShow(){document.getElementById(\"instructions\").style.left = \"30px\";}", "title": "" }, { "docid": "c13460960e3a9d7d157f21c46dbac263", "score": "0.58903027", "text": "function xmWinOnResize()\r\n{\r\n xMoveTo(xMnuMgr.activeMenu.ele, xPageX('menuMarker'), xPageY('menuMarker'));\r\n xMnuMgr.paint();\r\n}", "title": "" }, { "docid": "be4e617320b9974111ee83bcd14d715b", "score": "0.5876737", "text": "function positionMenu(e) {\n clickCoords = getPosition(e);\n clickCoordsX = clickCoords.x;\n clickCoordsY = clickCoords.y;\n\n menuWidth = menu.offsetWidth + 4;\n menuHeight = menu.offsetHeight + 4;\n\n windowWidth = window.innerWidth;\n windowHeight = window.innerHeight;\n\n if ( (windowWidth - clickCoordsX) < menuWidth ) {\n menu.style.left = windowWidth - menuWidth + \"px\";\n } else {\n menu.style.left = clickCoordsX + \"px\";\n }\n\n if ( (windowHeight - clickCoordsY) < menuHeight ) {\n menu.style.top = windowHeight - menuHeight + \"px\";\n } else {\n menu.style.top = clickCoordsY + \"px\";\n }\n }", "title": "" }, { "docid": "5ab6051971c1612d64aae0f31b79e14e", "score": "0.5857393", "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": "f77620557bca7d720ff3fb6a76af9db0", "score": "0.5830546", "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": "3f7fbbf073d99d7641c62d817b53794a", "score": "0.5825322", "text": "function centeredNavBottomBarReposition() {\r\n \r\n var $headerSpan9 = $('#header-outer[data-format=\"centered-menu-bottom-bar\"] header#top .span_9');\r\n var $headerSpan3 = $('#header-outer[data-format=\"centered-menu-bottom-bar\"] header#top .span_3');\r\n var $secondaryHeader = $('#header-secondary-outer');\r\n \r\n var $logoLinkClone = $headerSpan3.find('#logo').clone();\r\n if($logoLinkClone.is('[data-supplied-ml=\"true\"]')) {\r\n $logoLinkClone.find('img:not(.mobile-only-logo)').remove();\r\n }\r\n //trans\r\n $logoLinkClone.find('img.starting-logo').remove();\r\n \r\n \r\n if($secondaryHeader.length > 0) {\r\n $secondaryHeader.addClass('centered-menu-bottom-bar');\r\n } \r\n \r\n \r\n if($('#header-outer[data-condense=\"true\"]').length > 0) {\r\n $headerSpan9.prepend($logoLinkClone);\r\n } \r\n }", "title": "" }, { "docid": "a0b6157ad3b1b4f35d22468c4d23531a", "score": "0.5804313", "text": "function centerCanvas() {\n\tvar x = (windowWidth - width) / 2;\n\tvar y = (windowHeight - height) / 2;\n\tcanvas.position(x, y);\n}", "title": "" }, { "docid": "c31384d21ed4212feb49faa9d1f7a958", "score": "0.5801858", "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.5801858", "text": "function centerCanvas() {\n var x = (windowWidth - width) / 2;\n var y = (windowHeight - height) / 2;\n cnv.position(x, y);\n}", "title": "" }, { "docid": "5b2eec13500f079d0b9e34c10ade2c57", "score": "0.57986945", "text": "function center() {\n\t$('.two').css({\n\t\t'left' : '96px',\n\t\t'top' : '79px'\n\t});\n\t$('.three').css({\n\t\t'left' : '65px',\n\t\t'top' : '44px'\n\t});\n\t$('.four').css({\n\t\t'left' : '43px',\n\t\t'top' : '22px'\n\t});\n\t$('.five').css({\n\t\t'left' : '27px',\n\t\t'top' : '6px'\n\t});\n\t$('.six').css({\n\t\t'left' : '21px',\n\t\t'top' : '-3px'\n\t});\n}", "title": "" }, { "docid": "b002cefd4c1862d395ce2a5397663849", "score": "0.57945114", "text": "function makeItCenter(el)\n {\n if($(\"#Stage\").width() < 1200){\n el.css(\"marginLehiddenpx\");\n el.css(\"left\",\"76px\");\n }else{\n el.css(\"marginLeft\",(el.width()/2)*-1);\n el.css(\"left\",\"50%\");\n }\n\n }", "title": "" }, { "docid": "cd2de7b4eb46cae2ff2f6b21c0aaa6c3", "score": "0.5794273", "text": "function openNav() {\n document.getElementById('sidenav').style.width = '300px';\n document.getElementById('corner-infowindow').style.left = '330px';\n}", "title": "" }, { "docid": "242a60c9a83842113d73886741cb4a8a", "score": "0.5792619", "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": "1fe556e5000e1daf35ce49264b3ca9c4", "score": "0.5792173", "text": "function PopupCenter(a, d, b, c) {\n var e = void 0 != window.screenLeft ? window.screenLeft : screen.left,\n f = void 0 != window.screenTop ? window.screenTop : screen.top;\n width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width;\n height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height;\n a = window.open(a, d, \"scrollbars=yes, width=\" + b + \", height=\" + c + \", top=\" + (height / 2 - c / 2 + f) + \", left=\" + (width / 2 - b / 2 + e) + ', resizable=yes');\n window.focus && a.focus()\n return a;\n}", "title": "" }, { "docid": "f9bbd926753e6d79b9fec870e35aae6c", "score": "0.57917345", "text": "recenter() {\n if (!this.scrolled) {\n this.center();\n }\n }", "title": "" }, { "docid": "97bc1b7634f6ac49d47aad1906b5f926", "score": "0.57866406", "text": "function positionCenter(appletElem) {\n var windowWidth = Math.min(window.innerWidth, document.documentElement.clientWidth);\n var windowHeight = Math.min(window.innerHeight, document.documentElement.clientHeight);\n var appletRect = appletElem.getBoundingClientRect();\n\n var calcHorizontalBorder = (windowWidth - appletRect.width) / 2;\n var calcVerticalBorder = (windowHeight - appletRect.height) / 2;\n\n if(calcVerticalBorder < 0) {\n calcVerticalBorder = 0;\n }\n\n appletElem.style.position = \"relative\";\n\n if(window.GGBT_wsf_view.getCloseBtnPosition() === 'closePositionRight') {\n // X is positioned to the right/left\n\n if(calcHorizontalBorder < 40) {\n // if there is not enough space left for the X, don't position it in the center\n appletElem.style.left = '40px';\n } else {\n appletElem.style.left = calcHorizontalBorder + 'px';\n }\n appletElem.style.top = calcVerticalBorder + 'px';\n\n } else if(window.GGBT_wsf_view.getCloseBtnPosition() === 'closePositionTop') {\n // X is positioned on top\n\n if(calcVerticalBorder < 40) {\n // if there is not enough space left for the X, don't position it in the center\n appletElem.style.top = '40px';\n } else {\n appletElem.style.top = calcVerticalBorder + 'px';\n }\n\n appletElem.style.left = calcHorizontalBorder + 'px';\n }\n }", "title": "" }, { "docid": "4aa1c14effbd93174e6af978b0da5eec", "score": "0.5784347", "text": "function toCenter(){\n var mainH=$(\"#main\").outerHeight();\n var accountH=$(\".account-wall\").outerHeight();\n var marginT=(mainH-accountH)/2;\n if(marginT>30){\n $(\".account-wall\").css(\"margin-top\",marginT-15);\n }else{\n $(\".account-wall\").css(\"margin-top\",30);\n }\n }", "title": "" }, { "docid": "a32a097fe56654533884adc7d60c456a", "score": "0.57636964", "text": "function centerPortal(e) {\n\t\t\tconst row = this.parentNode.parentNode;\n\t\t\tconst guid = row.getAttribute('data-guid');\n\t\t\tconst portal = row.dataPortal || window.portals[guid];\n\t\t\tif (!portal)\n\t\t\t\treturn;\n\t\t\tconst center = portal._latlng || new L.LatLng(portal.lat, portal.lng);\n\t\t\tif (settings.centerMapOnClick)\n\t\t\t\tmap.panTo(center);\n\t\t\tdrawClickAnimation(center);\n\t\t\t// Open in sidebar\n\t\t\tif (!window.isSmartphone())\n\t\t\t\trenderPortalDetails(guid);\n\t\t}", "title": "" }, { "docid": "6e1102c0f232218f9cf4629cd4edd893", "score": "0.5744995", "text": "function centerMain(){\n var mainW = $('.main-wrapper').width();\n var windowW = $(window).width();\n var mainH = $('.main-wrapper').height();\n var mainML = parseInt($('.main-wrapper').css('margin-left'));\n var mainMT = parseInt($('.main-wrapper').css('margin-top'));\n if (mainML > 0 && mainMT == 0){\n $('.main-wrapper').css({\n 'width': (windowW - mainML)+'px',\n });\n }else{\n $('.main-wrapper').css({\n 'width': '100%',\n });\n }\n}", "title": "" }, { "docid": "debed45919399f7d312f3093f9926cd1", "score": "0.5739856", "text": "function windowResized() {\n centerCanvas();\n}", "title": "" }, { "docid": "d4925d730c788947cdab03adcbc6dfd1", "score": "0.5736898", "text": "set center(value) {}", "title": "" }, { "docid": "fcced1ed3df0795f545f6d038dd079f3", "score": "0.57363814", "text": "function menu() {\n rectMode(CENTER);\n fill(255);\n rect(width/2, height/2 - 100, 400, 150);\n textAlign(CENTER, CENTER);\n textSize(50);\n fill(0);\n text(\"Start\",width/2,height/2 -100);\n}", "title": "" }, { "docid": "c5589fc698c4125f896326cb9742763b", "score": "0.57281834", "text": "function setUpNav() {\r\n // Set windowWidth\r\n windowWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;\r\n // If window width is larger than minimum window width\r\n if (windowWidth > minWindowWidth) {\r\n // Variables: main and header element size and its position relative to the viewport; used to set topOffset\r\n var mainRect = document.querySelector(\"body > .row > main\").getBoundingClientRect(),\r\n headerRect = document.querySelector(\"body > header\").getBoundingClientRect();\r\n // Set variable for topOffset used to position sticky sideNav and leftAside\r\n topOffset = mainRect.top - headerRect.bottom;\r\n // Add sticky class to topNav, sideNav, and leftAside\r\n topNav.classList.add(\"topnav-sticky\");\r\n sideNav.classList.add(\"side-sticky\");\r\n leftAside.classList.add(\"side-sticky\");\r\n // Add top position value to sideNav and leftAside\r\n sideNav.style.top = topOffset + \"px\";\r\n leftAside.style.top = topOffset + \"px\";\r\n } else { // Else window width is smaller or equal to minimum window width\r\n // Remove sticky classes\r\n topNav.classList.remove(\"topnav-sticky\");\r\n sideNav.classList.remove(\"side-sticky\");\r\n leftAside.classList.remove(\"side-sticky\");\r\n // Reset top position value of sideNav and leftAside\r\n sideNav.style.top = \"0\";\r\n leftAside.style.top = \"0\";\r\n }\r\n }", "title": "" }, { "docid": "fc2d5450f9bc68d109f80b4094baf658", "score": "0.57281667", "text": "function adjustWindow(){\n console.log('adjusting...');\n /*var dropdown = document.getElementById('dropDownMenu');\n console.log(dropdown);\n var temp = $('#navbuttonPORTFOLIO').offset()//document.getElementById('navbuttonPORTFOLIO');\n console.log(temp);*/\n //var rect = temp.getBoundingClientRect();\n //dropdown.style.left = rect.left + \"px\";\n //dropdown.style.left = temp;\n}", "title": "" }, { "docid": "ffd117523de635b3b5a02ebbc223e22d", "score": "0.5717118", "text": "function initPopup(){\n\tvar wrapper = document.getElementById('popup-wrapper');\n\t\n\tif( !wrapper )\n\t\treturn;\n\t\n\tvar width = wrapper.offsetWidth + 90;\n\tvar height = wrapper.offsetHeight + 80;\n\t\n\tresizeTo(width, height);\n\t\n\t//Center screen\n\tvar left = Math.abs(screen.width - width) / 2;\n\tvar top = Math.abs(screen.height - height) / 2;\n\t\n\tmoveTo(left,0);\n}", "title": "" }, { "docid": "e549a98786bd661eb32faa7fe6dd19a3", "score": "0.57120746", "text": "function centerMap() {\n\tvar point = map.getCenter();\n\n\t$('#aside__detail').hide();\n\teasingAnimator.easeProp({\n\t\tlat: point.lat(),\n\t\tlng: point.lng()\n\t}, center);\n\tmap.setZoom(NORMAL_ZOOM_DISTANCE);\n}", "title": "" }, { "docid": "84d09eef6547d1a4cb8a305d0923fa22", "score": "0.5711452", "text": "function setMidPoint() {\n\t\tconfig.vanishingPoint.x = Math.round($(document).width() / 2);\n\t\tconfig.vanishingPoint.y = Math.round($(document).height() / 2);\n\t}", "title": "" }, { "docid": "c96b44e76dff5b7ce2eecc91779c6b0c", "score": "0.5707756", "text": "function positionWindow(x, y) {\r\n let [width, height] = getSize();\r\n let docHeight = document.body.clientHeight;\r\n let docWidth = document.body.clientWidth;\r\n if (y !== null) {\r\n if (y < 0) {y = 0;}\r\n else if (docHeight < y + height) {y = docHeight - height;}\r\n }\r\n else {y = (docHeight - height) / 2;}\r\n if (x !== null) {\r\n if (x < 0) {x = 0;}\r\n else if (docWidth < x + width) {x = docWidth - width;}\r\n }\r\n else {x = (docWidth - width) / 2;}\r\n wContainer.style.top = `${wTop = y}px`;\r\n wContainer.style.left = `${wLeft = x}px`;\r\n }", "title": "" }, { "docid": "549d61a1beb5e230bd58d64312c4846f", "score": "0.56875485", "text": "function windowResized() {\n centerCanvas();\n}", "title": "" }, { "docid": "2c9f1b2b99b8dd4662357927b8ff74a4", "score": "0.5685924", "text": "function newWindowPrintNav(the_win){\n\topener_win = window.open(the_win,\"Layout\",\"menubar=1, location=no,scrollbars=yes,resizable=1,width=650,height=440\");\n\topener_win.focus();\n\topener_win.moveTo(50,50);\n}", "title": "" }, { "docid": "b2fb2977886f34a96dce761ccc38658c", "score": "0.5684373", "text": "function resizeAndCenterWindowByHeight(height) {\n \twindow.resizeTo(325, height+160);\n\ttry {\n\t\t$(\"#deploy_output\").height(height);\n\t} catch(e) { }\t\n\twindow.moveTo((screen.width-325)/2,(screen.height-document.getElementById('wrapper').offsetHeight-400)/2);\n}", "title": "" }, { "docid": "2efc1daccb2987cfb2512f90ba1c1bb8", "score": "0.56827915", "text": "function mainNavigation() {\r\n\r\n\r\n}", "title": "" }, { "docid": "c46e78c8d6e486a20c64d42bcbba8c48", "score": "0.5681537", "text": "function $Center(elem)\n{\n\telem = $O(elem);\n\n\tvar elemDimensions = size(elem);\n\tvar elemWidth = parseInt(elemDimensions.width) || parseInt(getStyleValue(elem, 'width')); \n\tvar elemHeight = parseInt(elemDimensions.height) || parseInt(getStyleValue(elem, 'height'));\n\tvar bDimensions = Browser.Window.size();\n\tvar bWidth = parseInt(bDimensions.width);\n\tvar bHeight = parseInt(bDimensions.height);\n\tvar xPos = (bWidth - elemWidth) * 0.5;\n\tvar yPos = (bHeight - elemHeight) * 0.5;\n\n\tvar parent = elem.parentNode ? elem.parentNode : document.body;\n\tvar removed = parent.removeChild(elem); //remove the child, so that when we later position it absolutely, it won't be in reference to the parent element which may have a relative positioning\n \n\t$Style(removed).position = 'fixed';\n\t$Style(removed).left = xPos + 'px';\n\t$Style(removed).top = yPos + 'px';\n\n\tdocument.body.appendChild(removed);\n}", "title": "" }, { "docid": "e71bb25bbf568e9e8ef3a4bdb010fff8", "score": "0.5680277", "text": "function toggleCenter(bP)\n{ \n if (bP) {\n $('#demoboxmodel5').css('margin-left','auto');\n $('#demoboxmodel5').css('margin-right','auto');\n } else {\n $('#demoboxmodel5').css('margin-left','');\n $('#demoboxmodel5').css('margin-right',''); \n }\n}", "title": "" }, { "docid": "99441b8a9685d84b3b30f5e954e36f42", "score": "0.56749755", "text": "function centerCanvas() {\n let x = (windowWidth - width) / 2;\n let y = (windowHeight - height) / 2;\n cnv.position(x, y);\n}", "title": "" }, { "docid": "711c07dbb2f23735cc746ee0cd34a316", "score": "0.5669325", "text": "function centerSlider() {\n\t\tvar\tmainSlider = jQuery(\"#main-slider\"),\n\t\t\timageSlider = jQuery(\"#image-slider\"),\n\t\t\timageHeight = imageSlider.height(),\n\t\t\timageWidth = imageSlider.width(),\n\t\t\tsliderHeight = mainSlider.height(),\n\t\t\tsliderWidth = mainSlider.width();\n\n\t\tmainSlider.css({\n\t\t\t\"left\": imageWidth/2 - sliderWidth/2,\n\t\t\t\"top\": imageHeight/2 - sliderHeight/2\n\t\t});\n\t}", "title": "" }, { "docid": "8b0fc5a7bf0bbf8d0beebff78b4edee5", "score": "0.5668254", "text": "function center(x) { \n currentAlignment = alignCenter \n}", "title": "" }, { "docid": "6c17c3ba7cfa228b4d7e2e794269f680", "score": "0.56522816", "text": "function centerModal() {\n\t\t$(this).css('display', 'block');\n\t\tvar $dialog = $(this).find(\".modal-dialog\");\n\t\tvar offset = ($(window).height() - $dialog.height()) / 2;\n\t\t// Center modal vertically in window\n\t\t$dialog.css(\"margin-top\", offset);\n\t}", "title": "" }, { "docid": "c41c45b7c1367ec3a0a2c1089fca4d10", "score": "0.5649119", "text": "function openNav() {\n\n map.invalidateSize();\n var x = document.getElementById(\"content\");\n //if sidebar is open\n if (x.style.marginLeft == \"300px\") {\n //change left margin of content\n x.style.marginLeft= \"0\";\n } else {\n //change left margin of content\n x.style.marginLeft= \"300px\";\n }\n}", "title": "" }, { "docid": "7c00597b2d1f9198e7bf6dc84df926aa", "score": "0.56429", "text": "function navClickHandler(event) {\n for (navButton of navButtons) {\n navButton.classList.remove(\"active\");\n }\n this.classList.add(\"active\");\n\n var container = document.querySelector(\"main\");\n container.scrollTo({\n left: window.innerWidth * navButtons.indexOf(this),\n top: 0,\n behavior: \"smooth\" \n })\n }", "title": "" }, { "docid": "8de947b5917c8ec36901c18eaee96d37", "score": "0.5642707", "text": "function centerCanvas() {\n let x = (windowWidth - width) / 2;\n let y = (windowHeight - height) / 2;\n cnv.position(x, y);\n}", "title": "" }, { "docid": "63c1bdfbf5991286c88d9979ea4eafe5", "score": "0.56398124", "text": "recentreMenu()\n\t\t\t{\n\t\t\t\tif(AFFICHE_MENU)\n\t\t\t\t{\n\t\t\t\t\tthis.menu.x = this.groupeBulle.x+this.groupeBulle.getBounds().x-0.5*this.menu.getBounds().width+this.groupeBulle.getBounds().width;//this.Gcontour.x;\n\t\t\t\t\tthis.menu.y = this.groupeBulle.y+this.groupeBulle.getBounds().y+0.5*this.menu.getBounds().height;//this.Gcontour.y;\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "01142765f90c0090449b3a4b18887623", "score": "0.5636727", "text": "function navPos(mediaTarg){\n\t\tvar navTop = (propertyValue(mediaTarg, 'null', 'height') - propertyValue(document.getElementsByClassName('slide-nav')[0], 'null', 'height'))/2,\n\t\t\t\tnavRight = halfOuterWidth(carousel, 'null', 'right') - Math.round(propertyValue(mediaTarg, 'null', 'width')/2),\n\t\t\t\tnavLeft = halfOuterWidth(carousel, 'null', 'left') - Math.round(propertyValue(mediaTarg, 'null', 'width')/2);\n\t\t/*nav position prefs*/\n\t\tif(navInside === true){\n\t\t\tnavRight += 5;\n\t\t\tnavLeft +=5;\n\t\t} else{\n\t\t\tnavRight -= propertyValue(document.getElementsByClassName('forward')[0], 'null', 'width')+5;\n\t\t\tnavLeft -= propertyValue(document.getElementsByClassName('back')[0], 'null', 'width')+5;\n\t\t}\n\t\teachClass('slide-nav', function(a){a.style.top = navTop+'px';});\n\t\teachClass('forward', function(a){a.style.right = navRight+'px';});\n\t\teachClass('back', function(a){a.style.left = navLeft+'px';});\n\t}", "title": "" }, { "docid": "2fed5ccc1c2d886870a2bce56d44d939", "score": "0.5633389", "text": "function activeNav() {\r\n\t\txMove = $(\".nav-active\").offset().left;\r\n\t\tbarWidth = $(\".nav-active\").outerWidth() + 'px';\r\n\t\t$('#active-bar').css({ left: xMove, width: barWidth }); \r\n\t}", "title": "" }, { "docid": "01c6f8c54de5bb366435efca97675f1f", "score": "0.56301886", "text": "function closeNav() {\n document.getElementById(\"navigation\").style.left = \"100%\";\n}", "title": "" }, { "docid": "1d5c41f3f863358ab125aa106da8cff9", "score": "0.56244427", "text": "function doOnWindowResize() {\r\n\t\t\tsetSizes();\r\n\t\t\t$root.css({\r\n\t\t\t\tmarginLeft: getPageMarginPosition(currentPage)\r\n\t\t\t});\r\n\t\t}", "title": "" }, { "docid": "cc1a05ba9cacf3d3a68c984ef694ab3f", "score": "0.56153786", "text": "function closeNav() {\r\n mapCentering();\r\n document.getElementById(\"mySidenav\").style.width = \"0\";\r\n }", "title": "" }, { "docid": "b0c7d20f1352082f28b5fda7c46a57dd", "score": "0.5614422", "text": "function closeNav() \n{\n document.getElementById(\"mySidenav\").style.left = \"100vw\";\n \n}", "title": "" }, { "docid": "b047045fc39d25fc4d4e5055da50dd5f", "score": "0.5610847", "text": "_keepInsideBrowserWindow () {\r\n if (this._window.offsetLeft <= 0) {\r\n this._window.style.left = '1px'\r\n } else if (this._window.offsetLeft + this._window.offsetWidth >= document.documentElement.clientWidth) {\r\n this._window.style.left = `${document.documentElement.clientWidth - this._window.offsetWidth - 3}px`\r\n } else if (this._window.offsetTop <= 0) {\r\n this._window.style.top = '1px'\r\n } else if (this._window.offsetTop + this._window.offsetHeight >= document.documentElement.clientHeight) {\r\n this._window.style.top = `${document.documentElement.clientHeight - this._window.offsetHeight - 1}px`\r\n }\r\n }", "title": "" }, { "docid": "1ee6a70e331f5a90d2fa7dca6f81fb83", "score": "0.5603223", "text": "function centreMap() {\n\tvar latLng = new google.maps.LatLng(userlat, userlng);\n\tmap.panTo(latLng);\n}", "title": "" }, { "docid": "fe92bd18bd64c93868613738c08a1963", "score": "0.5600053", "text": "function panHome() {\n view.animate({\n center: ourLoc,\n duration: 2000\n });\n}", "title": "" }, { "docid": "3d29c1e982e2aea349ad2b22ad27cb3b", "score": "0.55980074", "text": "function center() {\n return {\n left: '50%',\n top: '50%',\n transform: 'translate(-50%, -50%)'\n }\n}", "title": "" }, { "docid": "d398b2877ffd27aa826e81bef9a3c3a2", "score": "0.55948395", "text": "function adjust(){\n $('body').css({'min-height':$(window).height()});\n HOME.animate({\n 'top':HEAD.height()-12,\n 'left':'0px',\n 'width':'100%'\n }, 'slow');\n}", "title": "" }, { "docid": "dd3a9c0cfddc01f56ccb155549da473a", "score": "0.55889034", "text": "function setupNavigationBar() {\n mcButton_1.setupMCButtonEvents(backButton);\n backButton.textContent = \"Group A Connect\";\n backButton.addEventListener('click', handleBackButton);\n mcButton_1.setupMCButtonEvents(minButton);\n minButton.addEventListener('click', (event) => {\n win.minimize();\n });\n win.on('unmaximize', onUnmaximized);\n mcButton_1.setupMCButtonEvents(maxButton);\n maxButton.addEventListener('click', (event) => {\n if (win.isMaximized()) {\n if (process.platform === \"darwin\") {\n win.setResizable(true);\n win.setMovable(true);\n }\n win.unmaximize();\n }\n else {\n maxButton.classList.add('isMaximized');\n // HACK: We can remove these 2 lines when we update to the electron version\n // that supports fullscreen that doesn't cover taskbar\n win.setMinimumSize(0, 0);\n win.setResizable(true);\n win.maximize();\n // Mac os doesn't support unmaximize through mouse drag\n // so lock the movement of window\n if (process.platform === \"darwin\") {\n win.setResizable(false);\n win.setMovable(false);\n }\n }\n });\n mcButton_1.setupMCButtonEvents(closeButton);\n closeButton.onclick = (ev) => { exitDialog.ShowDialog(); };\n}", "title": "" }, { "docid": "4b6e4000ad01444d994b499043379253", "score": "0.5582188", "text": "function positionBox(){\n\t\tcontainer.css('left', window_width/2 - container_width/2);\n\t\tcontainer.css('top', window_height/2 - container_height/2);\n\t\tcontainer_reset.css('left', window_width/2 - container_reset_width/2);\n\t\tcontainer_reset.css('top', window_height/2 - container_reset_height/2);\t\t\n\t\twindowS.resize(function(){\n\t\t\tvar window_width = parseInt(windowS.width());\n \t\tvar window_height = parseInt(windowS.height());\n \t\tcontainer_reset.css('left', window_width/2 - container_reset_width/2);\n\t\t\tcontainer_reset.css('top', window_height/2 - container_reset_height/2);\t\n\t\t});\n\t}", "title": "" }, { "docid": "f5ffc198490de91312ecd7daccfa39ae", "score": "0.55606025", "text": "function replaceCenter(stuff)\n{\n $('body').css(\"overflow\",\"scroll\");\n $('#main-content').css(\"top\",\"0px\");\n $(\"#main-content\").html(stuff);\n $('#main-content').show();\n rebindFunction();\n}", "title": "" }, { "docid": "caaf285174bd2238343bb296e91810c6", "score": "0.5545989", "text": "function navigation(){\r\n var window_top = $(window).scrollTop();\r\n var div_top = $('.navigation-anchor').offset().top;\r\n if (window_top > div_top) {\r\n $('.navigation').css('top', window_top - div_top);\r\n $('.content').addClass(\"padding\");\r\n } else {\r\n $('.navigation').css('top', '0px');\r\n $('.content').removeClass(\"padding\");\r\n }\r\n\r\n}", "title": "" }, { "docid": "c02e7f47e3b12c285f17a8d2728c4a07", "score": "0.5541698", "text": "function setSelfPosition() {\n var s = $self[0].style;\n\n // reset CSS so width is re-calculated for margin-left CSS\n $self.css({left: '50%', marginLeft: ($self.outerWidth() / 2) * -1, zIndex: (opts.zIndex + 3) });\n\n\n /* we have to get a little fancy when dealing with height, because lightbox_me\n is just so fancy.\n */\n\n // if the height of $self is bigger than the window and self isn't already position absolute\n if (($self.height() + 80 >= $(window).height()) && ($self.css('position') != 'absolute')) {\n\n // we are going to make it positioned where the user can see it, but they can still scroll\n // so the top offset is based on the user's scroll position.\n var topOffset = $(document).scrollTop() + 40;\n $self.css({position: 'absolute', top: topOffset + 'px', marginTop: 0})\n } else if ($self.height()+ 80 < $(window).height()) {\n //if the height is less than the window height, then we're gonna make this thing position: fixed.\n if (opts.centered) {\n $self.css({ position: 'fixed', top: '50%', marginTop: ($self.outerHeight() / 2) * -1})\n } else {\n $self.css({ position: 'fixed'}).css(opts.modalCSS);\n }\n if (opts.preventScroll) {\n $('body').css('overflow', 'hidden');\n }\n }\n }", "title": "" }, { "docid": "ea539312fa6472d715dd099ba21531bd", "score": "0.5538115", "text": "function positionLogoImage(){\n\tvar html5X = 16;\n\tvar byFWDRLX = (windowW - byFWDRLImageWidth);\n\tvar logoImageX = parseInt((windowW - logoImageWidth)/2) - 3;\n\t\n\tif(byFWDRLX > mainWidth - byFWDRLImageWidth){\n\t\tbyFWDRLX = parseInt(logoImageX + logoImageWidth - byFWDRLImageWidth);\n\t}\n\t\n\tif(windowW < mainWidth){\n\t\thtml5X = 2;\n\t}else{\n\t\thtml5X = logoImageX + 14;\n\t}\n\t\n\tif(windowW < 300){\n\t\tbyFWDRL_img.style.top = \"-50px\";\n\t}else{\n\t\tbyFWDRL_img.style.top = \"120px\";\n\t}\n\t\n\tlogoImage_img.style.left = logoImageX + \"px\";\n\tbyFWDRL_img.style.left = byFWDRLX + \"px\";\n}", "title": "" }, { "docid": "50c1f5213eb720de7a797f7f4253959c", "score": "0.5536722", "text": "function fix_position() {\r\n var uwidth = $('#user-nav > ul').width();\r\n $('#user-nav > ul').css({ width: uwidth, 'margin-left': '-' + uwidth / 2 + 'px' });\r\n\r\n var cwidth = $('#content-header .btn-group').width();\r\n $('#content-header .btn-group').css({ width: cwidth, 'margin-left': '-' + uwidth / 2 + 'px' });\r\n }", "title": "" }, { "docid": "a659301a1744659efcd77b02da914d46", "score": "0.5526149", "text": "function fm_createCenterWindow(_wid, _title, _width, _height, icon) {\n\tvar _newwin = fm_createWindow(_wid, _title, _width, _height, icon);\n\t_newwin.center();\n\treturn _newwin;\n}", "title": "" }, { "docid": "4b337ddc89404e83d7e6b2196d3e5397", "score": "0.55250204", "text": "function fix_position()\n {\n var uwidth = $('#user-nav > ul').width();\n $('#user-nav > ul').css({width:uwidth,'margin-left':'-' + uwidth / 2 + 'px'});\n var cwidth = $('#content-header .btn-group').width();\n $('#content-header .btn-group').css({width:cwidth,'margin-left':'-' + uwidth / 2 + 'px'});\n }", "title": "" }, { "docid": "670ed712d03322d5cfdb18dd94dec966", "score": "0.55245376", "text": "function opencaterersNav() {\r\n document.getElementById(\"myCaterersnav\").style.width = \"25%\";\r\n document.getElementById(\"push-content\").style.marginLeft = \"25%\";\r\n}", "title": "" }, { "docid": "bd0fb7b9901494457ccf76b973ac1587", "score": "0.5524109", "text": "function moveStatMenuToCenter()\n{\n $(\"#div_statMenu\").animate({\n //top: setPositionElementInCenter(div_StatisticMenu).y\n top: \"-200px\"\n }, 2000, function() {\n // Animation complete.\n $(\"#div_statMenu\").animate({\n opacity: 0\n }, 1000);\n });\n \n //div_StatisticMenu.style.opacity = 0;\n}", "title": "" }, { "docid": "9b2e6695fbdc81d860101884c5cbbc9c", "score": "0.5517248", "text": "function centerView() {\n var gameBox = document.getElementById(\"gameBox\");\n gameBox.scrollTop = (size/2-300+7); //300 = height / 2\n gameBox.scrollLeft = (size/2-gameBox.offsetWidth/2+7); //7 makes it better\n}", "title": "" }, { "docid": "a1239f2894adf361417a1758ce28a885", "score": "0.55163425", "text": "function positionDatasetAddMenu(){\n\t$('#dataSetAdd').css('position', 'absolute')\n\t\t\t\t\t\t\t\t\t\t .css('top', parseInt(window.innerHeight/2 - $('#dataSetAdd').height()/2)+\"px\")\n\t\t\t\t\t\t\t\t\t\t .css('left',parseInt(window.innerWidth/2 - $('#dataSetAdd').width()/2)+\"px\");\n}", "title": "" } ]
bada4f9741769cb02be5f752f75b9d8f
Store Customer Data in localStorage
[ { "docid": "7b033964a3d8bf0560869bd01eb39d43", "score": "0.71793616", "text": "function storeCustomerData(customerOrders, currentCustomersCount, index){\r\n localStorage.setItem(\"customerOrders\", JSON.stringify(customerOrders));\r\n localStorage.setItem(index, \"inTheQueue\");\r\n index++;\r\n currentCustomersCount++;\r\n localStorage.setItem(\"index\", index);\r\n localStorage.setItem(\"currentCustomersCount\", currentCustomersCount);\r\n }", "title": "" } ]
[ { "docid": "240f731e8ac8b77ebbe125dd4d95800a", "score": "0.8721325", "text": "function setCustomerData(data) {\n localStorage.setItem(\"customerData\", JSON.stringify(data));\n}", "title": "" }, { "docid": "8844ec64aaf5bca67d6d14eddfd4bd3d", "score": "0.7712512", "text": "function _sync() {\n var toJson = $filter('json');\n localStorage.setItem('customers', toJson(_customers));\n }", "title": "" }, { "docid": "766c5d6ce1424f08a2e9f0060c654375", "score": "0.7434981", "text": "function loadCustomer(data) {\n customerObj = data; //assign json object to customerObj\n customerPage(); //create the page for customer\n\n for (x = 0; x < customerObj.Customer.length; x++) {\n //each customer will be stored to local storage using its ID \n localStorage.setItem(customerObj.Customer[x].compId, JSON.stringify(customerObj.Customer[x]));\n\n }\n}", "title": "" }, { "docid": "1baf07d1ed71ca9e411456bed4b9b7f2", "score": "0.73934656", "text": "function storeData() {\n var userDataJSON = JSON.stringify(allUsers);\n localStorage.setItem('userData', userDataJSON);\n}", "title": "" }, { "docid": "4dde3b3b69a2e1983ea390144f36a711", "score": "0.719882", "text": "function saveData(){\n localStorage.setItem('catalog', JSON.stringify(catalog));\n}", "title": "" }, { "docid": "2a2f7c653c2e357f36a3b6c1c47151d7", "score": "0.7177644", "text": "function getCustomerData() {\n\n // check if customer data in local storage\n if (localStorage.hasOwnProperty(\"customerData\")){\n // return the customer object and exit the function in case customerData is found.\n return JSON.parse(localStorage.getItem(\"customerData\"));\n }\n\n // if there isn't return empty customer object\n return { firstName: \"\", lastName: \"\", eMail: \"\", BIC: \"\", IBAN: \"\"}\n}", "title": "" }, { "docid": "269b7b68d1791db4a8836fa120a1338a", "score": "0.71751314", "text": "function setLocalStorage(storeData){\n\n localStorage.setItem('hotelList', JSON.stringify(storeData)); //localStorage.setItem stores string key value pair, threfore convert the data in to string first.\n }", "title": "" }, { "docid": "505ecd21689815e46e2cb7dbfce7cae5", "score": "0.71546113", "text": "function save_data() {\n var json_company_details = JSON.stringify(company_details);\n localStorage.setItem('company_details', json_company_details);\n}", "title": "" }, { "docid": "55a4354617e9fd849001b62d58b5b029", "score": "0.71440685", "text": "save(){\n localStorage.setItem(CYCLING_LS, JSON.stringify(this.allUserData))\n }", "title": "" }, { "docid": "524016d7ac1792eaf480e94cfa2380e5", "score": "0.7077359", "text": "function addDataToLocalStorage(data){\n localStorage.setItem('restaurant', JSON.stringify(data))\n}", "title": "" }, { "docid": "312a66083f12fddcba0aa258cab358fc", "score": "0.7068977", "text": "function localStore() {\n window.localStorage.setItem('dataStore', JSON.stringify(inventory));\n}", "title": "" }, { "docid": "0240bac5f91cf47323ba86ae4984fc55", "score": "0.70686734", "text": "function storeCities() {\n\tlocalStorage.setItem(\"cities\", JSON.stringify(cities));\n}", "title": "" }, { "docid": "f025ff2a3c90f7442fa9f3ee0ab024c4", "score": "0.70659286", "text": "function storeCities() {\n localStorage.setItem(\"cities\", JSON.stringify(cities));\n}", "title": "" }, { "docid": "ec89d2f5971cdd260d3bfbf5baff41b3", "score": "0.70541084", "text": "function addDataToLocalStorage(data){\n\n localStorage.setItem('restaurant', JSON.stringify(data))\n\n}", "title": "" }, { "docid": "8f4a96e8d911a35edbc291fafb64401a", "score": "0.70516163", "text": "function storeData() {\n var stringifiedProducts = JSON.stringify(listOfProductObjects);\n localStorage.setItem('stringifiedProducts', stringifiedProducts);\n console.log(storeData);\n}", "title": "" }, { "docid": "0f397d4e1f3ad24634865617c6b64ce2", "score": "0.70006686", "text": "function storeCities() {\n // Stringify and send cities in localStorage \n localStorage.setItem(\"cities\", JSON.stringify(cities));\n}", "title": "" }, { "docid": "56b6638afac6f8555344772668ba3bec", "score": "0.6974353", "text": "function storeDataUp(){\n // have to be stringifyed\n var data= JSON.stringify(product.all);\n localStorage.setItem('products',data);\n }", "title": "" }, { "docid": "7dccd5379f1bda6424577777159046f3", "score": "0.6972513", "text": "function saveData() {\n localStorage.userData= JSON.stringify(userData);\n }", "title": "" }, { "docid": "f61b16945f09c92fa33b85962bd4edc3", "score": "0.69725084", "text": "function myLocalStorage() {\n localStorage.setItem('myData', JSON.stringify(productsArray));\n}", "title": "" }, { "docid": "13e3fe3babefecc976129d121c263bc4", "score": "0.69705796", "text": "function storeProducts (){\n var myProducts = JSON.stringify(Products.prototype.allProducts );\n localStorage.setItem('myProducts', myProducts);\n }", "title": "" }, { "docid": "882e9f2152536a3ee025696f41d48093", "score": "0.6943824", "text": "function clearCustomerData() {\n localStorage.removeItem(\"customerData\");\n}", "title": "" }, { "docid": "a1013de2e05fd1ceddd8176f484379d2", "score": "0.6931054", "text": "function saveToLocalStorage(){\n let data = JSON.stringify(orders);\n localStorage.setItem('Orders',data);\n}", "title": "" }, { "docid": "4351654a904b5588546b6073b13a9479", "score": "0.69065356", "text": "saveToLocalStorage() {\n localStorage.setItem('products', JSON.stringify(this.productsDetails))\n }", "title": "" }, { "docid": "92cd4d7dedc45c97878393dd101cb3f1", "score": "0.6867243", "text": "function store() {\n localStorage.setItem('fname', fname.value);\n localStorage.setItem('lname', lname.value);\n localStorage.setItem('emailid', emailid.value);\n localStorage.setItem('pw', pw.value);\n localStorage.setItem('number', number.value);\n localStorage.setItem('age', age.value);\n}", "title": "" }, { "docid": "745ce6c3e8440383f67ee1f1e0eba3d9", "score": "0.68667257", "text": "function saveCities() {\n localStorage.setItem(\"cities\", JSON.stringify(cities));\n }", "title": "" }, { "docid": "4bb63f6cf2b4c47dc40cede991277ff7", "score": "0.68154174", "text": "function storeData () {\r\n localStorage.setItem('allTodos', JSON.stringify(allTodos))\r\n}", "title": "" }, { "docid": "12ba12ac36b6c53195b3aca2e9ab181c", "score": "0.68040127", "text": "function store() {\n\tvar inputEmail = document.getElementById('email');\n\tvar inputPhone = document.getElementById('phone');\n\tvar inputFName = document.getElementById('fname');\n\tvar inputLName = document.getElementById('lname');\t\n\tvar inputMessage = document.getElementById('message');\n\n\tvar contact = {\t'email': inputEmail,\n\t\t\t\t\t'phone': inputPhone,\n\t\t\t\t\t'fname': inputFName,\n\t\t\t\t\t'lname': inputLName,\n\t\t\t\t\t'message': inputMessage }\n\n\tvar contacts = [];\n\tcontacts.push(contact);\n\t\n\t// store contacts array to local storage\n\tlocalStorage.setItem('contacts', JSON.stringify(contacts));\t\t\t\t\n\t\n}", "title": "" }, { "docid": "3ae544887972649557ff5560e222d29e", "score": "0.6800121", "text": "function caj_saveInLocalStore(key, data) {\n localStorage.setItem(key, data);\n}", "title": "" }, { "docid": "d4ec1d6d58990dc438a44ac2e330990f", "score": "0.6784335", "text": "function saveFlights(){\n localStorage.setItem(\"flights\", JSON.stringify(flights));\n}", "title": "" }, { "docid": "842285fd6ed89fd80ac281cbdf9c9a38", "score": "0.6783496", "text": "function storeData() { \n\n localStorage.setItem('Result', JSON.stringify(arrayOfProducts));\n\n}", "title": "" }, { "docid": "0a1a6c7965f7bf3397908f7f180381ef", "score": "0.67815435", "text": "static saveProductsData(products) {\n localStorage.setItem(\"products\", JSON.stringify(products));\n }", "title": "" }, { "docid": "8a37946100f4885438ca64b4a498a9d3", "score": "0.67442906", "text": "function saveLocalstorageData(){\n console.log('Salvataggio dei dati utente');\n //utilizza l'oggetto localStorage per salvare i dati all'interno del browser\n localStorage.setItem('userData', JSON.stringify(codemotion2014.model.contact.getData()))\n alert('i dati sono stati salvati nel localstorage');\n return true;\n }", "title": "" }, { "docid": "184e7f28c865207d6218bb23ca7d6d09", "score": "0.673936", "text": "function renderCustomerData(){\n if (localStorage.getItem(\"customerInfoStored\")) {\nvar customerDataList = JSON.parse(localStorage.getItem(\"customerInfoStored\"));\n// console.log(\"Customer info:\" + customerDataList._contactFName + \" \" + customerDataList._contactLName);\ndocument.getElementById(\"quoteFName\").innerText = customerDataList._contactFName + \" \"; \ndocument.getElementById(\"quoteLName\").innerText = customerDataList._contactLName;\ndocument.getElementById(\"quoteEmail\").innerText = customerDataList._contactEmail;\ndocument.getElementById(\"quotePhone\").innerText = customerDataList._contactPhone;\ndocument.getElementById(\"quoteStreet\").innerText = customerDataList._contactStreet;\ndocument.getElementById(\"quoteCity\").innerText = customerDataList._contactCity;\ndocument.getElementById(\"quoteZip\").innerText = customerDataList._contactZip;\nif (customerDataList._contactQuoteComment != null ){\ndocument.getElementById(\"quoteComment\").innerText = customerDataList._contactQuoteComment;\n} else {\n document.getElementById(\"quoteComment\").innerText = \"\";\n}}\n}", "title": "" }, { "docid": "00ab140712375529787fae3712f68cc7", "score": "0.6735202", "text": "function recordCityData() {\n localStorage.setItem('cityNameStore', inputEl.value);\n}", "title": "" }, { "docid": "11ed93381cff046c7a2a26202ba83310", "score": "0.67334104", "text": "function store() {\n\tlocalStorage.setItem('name', name.value);\n\tlocalStorage.setItem(\"email\",email.value)\n localStorage.setItem('pws', pw.value);\n}", "title": "" }, { "docid": "0b64f9645f65cf30c788c42e1324233b", "score": "0.67308503", "text": "function saveDataToLocalstorage() {\n var todoString = JSON.stringify(todos);\n window.localStorage.setItem('todos', todoString);\n}", "title": "" }, { "docid": "5d5a51651111769873fccc0393147c8a", "score": "0.67266774", "text": "storeId(id){\n let customer = [];\n customer.push({id:id});\n sessionStorage.setItem(\"customer\",JSON.stringify(customer))\n let res = JSON.parse(sessionStorage.getItem(\"customer\"))\n console.log(res)\n }", "title": "" }, { "docid": "5ba8ffb86b00979334e1ff3f52d0bb54", "score": "0.67225456", "text": "function saveTransactions() {\n localStorage.setItem('transactions', JSON.stringify(transactions));\n}", "title": "" }, { "docid": "688785e0ddd8d167364a57b4cb26b9a7", "score": "0.6714009", "text": "function tripInfoInLocalStorage(){\n \n localStorage.setItem('Pays',Emplacement.name)\n localStorage.setItem('Prix',Emplacement.prix)\n\n}", "title": "" }, { "docid": "4a3e1180fa1b47359fa28c56e041f588", "score": "0.6712991", "text": "function storeData(obj) {\n\t\tlocalStorage.setItem(\"sunrise\", dateConv(obj.sys.sunrise));\n\t\tlocalStorage.setItem(\"sunset\", dateConv(obj.sys.sunset));\n\t\tlocalStorage.setItem(\"city\", obj.name);\n\t\tlocalStorage.setItem(\"lon\", obj.coord.lon);\n\t\tlocalStorage.setItem(\"lat\", obj.coord.lat);\n\t\tlocalStorage.setItem(\"temp\", obj.main.temp);\n\t\tlocalStorage.setItem(\"press\", obj.main.pressure);\n\t\tlocalStorage.setItem(\"low\", obj.main.temp_min);\n\t\tlocalStorage.setItem(\"high\", obj.main.temp_max);\n\t\tlocalStorage.setItem(\"windSpd\", obj.wind.speed);\n\t\tlocalStorage.setItem(\"windDir\", obj.wind.deg);\n\t\tlocalStorage.setItem(\"dt\", obj.dt);\n\t\tlocalStorage.setItem(\"icon\", obj.weather[0].icon);\n\t\tlocalStorage.setItem(\"weath\",obj.weather[0].main);\n}", "title": "" }, { "docid": "81ea260cf416a96f913915db0f4ce7aa", "score": "0.67103016", "text": "function store() {\n localStorage.setItem('email', emailRegOpen);\n localStorage.setItem('senha', senhaRegOpen);\n // localStorage.setItem('name', nameRegOpen);\n }", "title": "" }, { "docid": "f67dac86976ca68d23ab7e770afa67a9", "score": "0.6707847", "text": "function store() {\n\n //get the values in the html fields\n var name = document.getElementById('account_number');\n var pw = document.getElementById('password');\n var firstName = document.getElementById('first_name');\n var middleName = document.getElementById('middle_name');\n var lastName = document.getElementById('last_name');\n var dateofBirth = document.getElementById('dob');\n var email = document.getElementById('email');\n var phoneNumb = document.getElementById('mobile');\n\n //store them into a JSON Dictionary\n var newEntry = {\n \"account_number\": name.value,\n \"password\": pw.value,\n \"first_name\": firstName.value,\n \"middle_name\": middleName.value,\n \"last_name\": lastName.value,\n \"dob\": dateofBirth.value,\n \"email\": email.value,\n \"mobile\": phoneNumb.value \n }\n\n //get the current values in Local Storage\n var dataList=JSON.parse(localStorage.getItem(\"Users\"));\n \n //declare a new Array to store all the values\n var arrList=[];\n \n //check if the local storage is not empty\n if(dataList!=null)\n {\n //first add the existing data\n arrList=dataList;\n //then add the new data\n arrList.push(newEntry);\n }\n else{\n //just add the new data\n arrList.push(newEntry);\n }\n //store it back to local storage\n localStorage.setItem(\"Users\",JSON.stringify(arrList));\n}", "title": "" }, { "docid": "dde5039a6b5c3af8b3112d875c11f806", "score": "0.67071164", "text": "storeTravelTransactions()\n {\n localStorage.setItem('travelTransactions', JSON.stringify(this.state.transactionsForTravel));\n localStorage.setItem('travelTransactionsLastDate', JSON.stringify(this.state.travelTransactionsLastDate));\n }", "title": "" }, { "docid": "dde5039a6b5c3af8b3112d875c11f806", "score": "0.67071164", "text": "storeTravelTransactions()\n {\n localStorage.setItem('travelTransactions', JSON.stringify(this.state.transactionsForTravel));\n localStorage.setItem('travelTransactionsLastDate', JSON.stringify(this.state.travelTransactionsLastDate));\n }", "title": "" }, { "docid": "37312e32377d3b1fb56ac9696c6e5f33", "score": "0.66955566", "text": "function memorizar(dato) {\n localStorage.setItem('carrito', JSON.stringify(dato));\n} //________________FUNCION PARA RECUPERAR STORAGE___________________", "title": "" }, { "docid": "8fc1411fbdc35dc1f1ac7a82946e23de", "score": "0.6691886", "text": "storeUser(user){\n localStorage.setItem('user',user);\n }", "title": "" }, { "docid": "7673ed1367f346e3eb16663f51970a5b", "score": "0.66893375", "text": "function storeData() {\n localStorage.setItem('order', JSON.stringify(arrayOfProduct));\n console.log(arrayOfProduct);\n}", "title": "" }, { "docid": "a5319f2d46e6bd1bf1969af19c2c9477", "score": "0.6680286", "text": "function store() {\n var inputFirstLastName= document.getElementById(\"firstLastName\");\n localStorage.setItem(\"firstLastName\", inputFirstLastName.value);\n\n var inputEmail= document.getElementById(\"email\");\n localStorage.setItem(\"email\", inputEmail.value);\n\n var inputPetPicture = document.getElementById(\"petPicture\");\n localStorage.setItem(\"petPicture\", inputPetPicture.value);\n}", "title": "" }, { "docid": "a5cc7f4e0022bcb95f48e36d28c01ad8", "score": "0.66772974", "text": "function setLocalStorage(key, obj){\n var objStr = JSON.stringify(obj)\n localStorage.setItem(\"cities\", JSON.stringify(cities));\n localStorage.setItem(key, objStr);\n}", "title": "" }, { "docid": "20a7c0fe15367e69f1b4aa0c74c33c73", "score": "0.667656", "text": "function saveData(){\n localStorage.saveServer\n }", "title": "" }, { "docid": "a8702f2d732edbf9f643bd2e6f6f6a10", "score": "0.66755736", "text": "function storageUser(data) {\n localStorage.setItem(\"SistemUser\", JSON.stringify(data));\n }", "title": "" }, { "docid": "ba0df07fe39cbe5112ea2ee8b3817a07", "score": "0.6668049", "text": "function setData(name, age) {\n localStorage.setItem(\"name\", name);\n localStorage.setItem(\"age\", age + \"\");\n}", "title": "" }, { "docid": "6f646ae28b0cac1b31778970b1676c77", "score": "0.66630125", "text": "function forSaveLocalStorage()\n{\n let data1 = JSON.stringify(product);\n localStorage.setItem('product',data1);\n}", "title": "" }, { "docid": "f5788ff59732356050f685a858669f4d", "score": "0.66576135", "text": "saveToLocalStorage(){\n window.localStorage.setItem( `cart-${this.uid}`, this.stringify())\n }", "title": "" }, { "docid": "999b1ee5e8fab9a2fc681e4e8b671cdd", "score": "0.66456175", "text": "setCityAndState(city,state){\n localStorage.setItem('city',city);\n localStorage.setItem('state',state);\n }", "title": "" }, { "docid": "b418d3a1c2388ab1b800adcaec72049a", "score": "0.6634562", "text": "function saveToLocalStorage() {\n localStorage.setItem('RequestData', JSON.stringify(MaintenanceRequest.array));\n }", "title": "" }, { "docid": "21cd9ce75f87a056bbd43f48553b8d25", "score": "0.6632682", "text": "function saveCitiesStorage() {\n localStorage.setItem(\"cities\", JSON.stringify(cityHistory));\n localStorage.setItem(\"currentCity\", JSON.stringify(currentCity));\n }", "title": "" }, { "docid": "e8f5c164bd6c04c9767f1cc6e3b6a1b6", "score": "0.66320574", "text": "storeUser(user){\n localStorage.setItem('user', user);\n }", "title": "" }, { "docid": "4adac7a4860df27ac224a5f4ae0e4f4a", "score": "0.66212976", "text": "function memorizar(dato){\n localStorage.setItem('carrito', JSON.stringify(dato));\n }", "title": "" }, { "docid": "bc498d213074e0e4d7128ae713eb42bd", "score": "0.66065294", "text": "function setLocal() {\r\n localStorage.setItem(\"name\", \"Bruce Wyane\");\r\n localStorage.setItem(\"fName\", \"Peter\");\r\n localStorage.setItem(\"lName\", \"Parker\");\r\n // localStorage.setItem(\"name\", [\"Bruce Wyane\", \"Peter Parker\"]);\r\n}", "title": "" }, { "docid": "2243bf4fde7babd574fa8c5b10227016", "score": "0.6602978", "text": "function storeData(key,value) {\n var data = JSON.stringify(value);\n localStorage.setItem(key,data);\n}", "title": "" }, { "docid": "c1dd74056f849dfea74c446c0ca5138e", "score": "0.65964764", "text": "function storeData(array) {\n localStorage.setItem(\"cities\", JSON.stringify(array));\n}", "title": "" }, { "docid": "49b0800d83c9bb129a52759c5a3c5fc8", "score": "0.65941346", "text": "function setLocalStore() {\n localStorage.setItem(\"dayPlan\", JSON.stringify(dayPlan));\n}", "title": "" }, { "docid": "4d15090e8337ead892e4478d1fffe632", "score": "0.65906924", "text": "save() {\n try {\n localStorage.setItem(this.storageKey, JSON.stringify(this.data));\n } catch (err) {}\n }", "title": "" }, { "docid": "7411052fe6731881af8c2bb6c5969015", "score": "0.6585673", "text": "function setData() {\n localStorage.setItem('wishName', JSON.stringify(Wish.all));\n}", "title": "" }, { "docid": "557c2f55b9b67ef4a72e4b2d27d486c1", "score": "0.65657765", "text": "function populateStorage(item, value) {\n myObj = value; // myCities\n myJSON = JSON.stringify(myObj); // storing data\n localStorage.setItem(item, myJSON);\n}", "title": "" }, { "docid": "30d5fa475594c570408b2eb59537cf3e", "score": "0.6546396", "text": "function storageGuardeito(){\n localStorage.setItem('minhas transações', JSON.stringify(transactions))\n}", "title": "" }, { "docid": "35c49334d3483187d1a2a5a0526a13d1", "score": "0.6546307", "text": "function saveData() {\n localStorage.data = JSON.stringify(_response);\n}", "title": "" }, { "docid": "260c5dd6a799a31b6d48b78c700d28be", "score": "0.6543077", "text": "function storeSearches() {\n localStorage.setItem(\"cities\", JSON.stringify(cities));\n}", "title": "" }, { "docid": "c6f55bb8a7d1f99349e1f046c654eab1", "score": "0.6539799", "text": "function storeDiaryElements() {\n localStorage.setItem('list', $ol.html());\n localStorage.setItem('personal-email', $personal_gmail.val());\n localStorage.setItem('mentor-email', $mentor_gmail.val());\n }", "title": "" }, { "docid": "687b83bfc6d664d9bc6010fbe81465c4", "score": "0.65386784", "text": "persistData(){\n const taskListJSON=JSON.stringify(this._taskList);\n localStorage.setItem('tasks', taskListJSON);\n }", "title": "" }, { "docid": "a23478d2f813a6fdb557ae6738ad91aa", "score": "0.65319854", "text": "function updateLocalStorage() {\n localStorage.setItem('transactions', JSON.stringify(transactions));\n}", "title": "" }, { "docid": "fa8b01dfb62f1db895397c8ea80dfec9", "score": "0.653048", "text": "function getLocalStore() {\n var dayPlanRetrieveData = localStorage.getItem(\"dayPlan\");\n var dayPlanRetrievePlan = JSON.parse(dayPlanRetrieveData);\n dayPlan = dayPlanRetrievePlan;\n localStorage.setItem(\"dayPlan\", JSON.stringify(dayPlan));\n}", "title": "" }, { "docid": "161c0ec4092bae91b0c4467402025c92", "score": "0.65239906", "text": "setLocationData(city) {\n localStorage.setItem(\"city\", city);\n }", "title": "" }, { "docid": "e66050595382638ab744ec5992746349", "score": "0.6517388", "text": "function saveToLS() {\n var savedUserLogin = JSON.stringify(loginInfo);\n localStorage.setItem('userLogin', savedUserLogin);\n}", "title": "" }, { "docid": "3c78faee7479a37307376890abaaa1ac", "score": "0.6509823", "text": "function storeInfo() {\n localStorage.setItem(`Search Items`, JSON.stringify(searchItems));\n localStorage.setItem(`Current City Info`, JSON.stringify(currentCityInfo));\n localStorage.setItem(`Five Day Info`, JSON.stringify(fiveDayInfo));\n}", "title": "" }, { "docid": "09f7da79dc55b3bb54f72c77d9b405bf", "score": "0.6508392", "text": "function updateLocalStorage(){\r\n localStorage.setItem('transactions',JSON.stringify(transactions));\r\n}", "title": "" }, { "docid": "40109567ae0e99d172fd909425f6e76e", "score": "0.6499185", "text": "function saveTPTData(){\r\n if(typeof(Storage) !== \"undefined\")\r\n localStorage.setItem(\"TPTsaveData\", JSON.stringify(data));\r\n }", "title": "" }, { "docid": "44d72cccef17d03a4f2e14766b91a76a", "score": "0.6492452", "text": "function store() {\n localStorage.setItem('signUpUser', signUpUser.value);\n localStorage.setItem('signUpPassword', signUpPassword.value);\n}", "title": "" }, { "docid": "2a18382d6b3eff20410bac8948ec63fd", "score": "0.6487412", "text": "store() {\n\t\t\tthis.storage?.setItem(this.name, JSON.stringify(this.data));\n\t\t}", "title": "" }, { "docid": "774366d3aa55c494b1e8813024c1b7cb", "score": "0.6485643", "text": "function saveData(key, data){\n localStorage.setItem(key, JSON.stringify(data));\n}", "title": "" }, { "docid": "d7b296cfd88d405b99a8a76fd59a9dfc", "score": "0.6482594", "text": "function createLocalStorage(){\n var stringifiedallProductsArray = JSON.stringify(allProductsArray);\n //passing stringified data into storage and giving it the key to access to my storage\n localStorage.setItem('productsArrayStorage', stringifiedallProductsArray);\n}", "title": "" }, { "docid": "c9bc9f81b1e71849c0717369e1d097c8", "score": "0.64751333", "text": "function getData(shelf) {\n localStorage.clear();\n localStorage.setItem('savedShelf', JSON.stringify(shelf));\n}", "title": "" }, { "docid": "6bfcdb6e796df92bcd92aeb72826e78c", "score": "0.64745826", "text": "function saveToLS() {\n var userJSON = JSON.stringify(user[0]);\n localStorage.setItem(\"userLogin\", userJSON);\n}", "title": "" }, { "docid": "16f80152d5230577602bdfb3c30ac488", "score": "0.6472926", "text": "saveInLocalStorage() {\n try {\n localStorage.setItem('user', JSON.stringify(this));\n } catch (exception) {\n console.log('Error while write to storage!!!\\n' + exception);\n }\n }", "title": "" }, { "docid": "95924c02d5610ce4d6893aeca91e7bbe", "score": "0.64677143", "text": "function adminToStorage() {\n\tlocalStorage.setItem('adminUser', JSON.stringify(adminUser));\n}", "title": "" }, { "docid": "f90bfce1618acd90f40cdea58f2c22de", "score": "0.646614", "text": "function storeDonors() {\n\n localStorage.setItem('arrayDonors', JSON.stringify(Donation.array));\n\n}", "title": "" }, { "docid": "b03a918df37177f350f9f94463794bdf", "score": "0.6461431", "text": "function setStorage() {\n console.log(clientes)\n localStorage.setItem('clientes', JSON.stringify(clientes));\n return;\n}", "title": "" }, { "docid": "fe685ec0b75b9439f8dc524c50089e51", "score": "0.645741", "text": "_write() {\n localStorage.setItem('cxl-paywall-count', String(this._count));\n localStorage.setItem('cxl-paywall-month', String(this._month));\n }", "title": "" }, { "docid": "3e46f5be42cd30499968e48cf8e77684", "score": "0.6445266", "text": "static saveProducts(obj) {\n localStorage.setItem('products', JSON.stringify(obj));\n }", "title": "" }, { "docid": "01796639900ad6b999fae4ed8de3c5a7", "score": "0.644445", "text": "function initalizeAccounts(){\n localStorage.setItem('accounts', JSON.stringify({}))\n}", "title": "" }, { "docid": "3ad6d0810acb1064ec21f26705721464", "score": "0.6442301", "text": "function saveToStorage() {\n localStorage.setItem(\"cities\", JSON.stringify(cities).toUpperCase());\n}", "title": "" }, { "docid": "8d642ebfbf02759f9aecbc79b8bcc176", "score": "0.64418054", "text": "function saveMovieData(movieIndex, moviePrice) {\n localStorage.setItem('movieIndex', movieIndex);\n localStorage.setItem('moviePrice', moviePrice);\n}", "title": "" }, { "docid": "cd23767726460465637ef398679d5f27", "score": "0.64345425", "text": "function saveData(data) {\n localStorage.setItem(\"todoList\", JSON.stringify(data));\n }", "title": "" }, { "docid": "d5dfe536d64b708270a7896b32d5f89c", "score": "0.6425152", "text": "save(data){\n localStorage.setItem(\"data\", JSON.stringify(data));\n return data;\n }", "title": "" }, { "docid": "5af39e6dd306ae0e4d7163d8d1a65c58", "score": "0.64234644", "text": "function storeCurrentTicker(){\n localStorage.setItem(\"currentTicker\", JSON.stringify(companyName));\n}", "title": "" }, { "docid": "935bf65bf7283e32c226de965b789f3e", "score": "0.6409093", "text": "function saveData(data) {\n // console.log(\"Saving the data to local storage\");\n // Saving data\n window.localStorage.setItem('items', JSON.stringify(data));\n // Initialize cart\n var cartData = {};\n data.forEach(element => {\n cartData[element[\"id\"]] = 0;\n });\n window.localStorage.setItem('cart', JSON.stringify(cartData));\n}", "title": "" }, { "docid": "b55844cec3eb7e51de8eb1578202664a", "score": "0.640181", "text": "function addLocalStorage(){\n localStorage.setItem('carrito', JSON.stringify(carrito))\n}", "title": "" }, { "docid": "62fc8ca04bceafc925e99b20cf1384e1", "score": "0.6401068", "text": "function store(prodcts)\n{\n\t\tsessionStorage.currentuser = JSON.stringify(prodcts);\n}", "title": "" }, { "docid": "156fc8379297a088347dcc0d0f30ea41", "score": "0.6399508", "text": "function storeDataGet(){\n var data= localStorage.getItem('products');\n if(data){\n // better to be prased\n product.JSON.prase(data);\n result();\n chartFunc();\n \n }\n}", "title": "" } ]
76ff4d54dfd48acbd6e47caa50a3375a
get location from user
[ { "docid": "6ab1db1077a55a9b04617e7b54effa8f", "score": "0.0", "text": "function fetchWeather () {\n const input = document.querySelector('input[type=\"text\"]');\n const userLocation = input.value;\n getWeatherData(userLocation);\n }", "title": "" } ]
[ { "docid": "c35e8ad47999852c54d9f279bfa45733", "score": "0.78977704", "text": "function getLocationFromUser() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n }\n else {\n pinStringContainer.append(\"Geolocation is not supported by this browser.\");\n }\n}", "title": "" }, { "docid": "db9b27bce79fb5719344e3d413c99d97", "score": "0.7859445", "text": "function getUserLocation(userObj) {\n var location = userObj.get(\"location\");\n if (location == undefined) location = \"\";\n return location;\n}", "title": "" }, { "docid": "f9e3eb8ca8de7fbca4eb827f0dd8ffb5", "score": "0.765036", "text": "function getUserLocation(){\n navigator.geolocation.getCurrentPosition( function (position) {\n user.lat = position.coords.latitude;\n user.lng = position.coords.longitude;\n calcRoute(user.lat, user.lng);\n var queryString = generateMapsQuery(user.lat, user.lng, store.lat, store.lng);\n generateMapsUi(queryString);\n }, function (error) {\n console.log(error);\n }); \n }", "title": "" }, { "docid": "6a77ac0dbf6b3eb013c6b6853b3eedd5", "score": "0.75964105", "text": "function UserLocation(position) {\n ClosestLocation(position.coords.latitude, position.coords.longitude, \"This is my Location\");\n }", "title": "" }, { "docid": "afacb9a32a632279073685eb7865014e", "score": "0.7504366", "text": "getLocation() {\n\t\tif (navigator.geolocation) {\n\t\t\tnavigator.geolocation.getCurrentPosition(this.setUserCoord);\n\t\t} else {\n\t\t\tconsole.log('Geolocation is not supported by this browser.');\n\t\t}\n\t}", "title": "" }, { "docid": "b8c2312c9729b7c06f797ad0a4fe2c3d", "score": "0.74621236", "text": "function getUserLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(success, reject);\n }\n }", "title": "" }, { "docid": "b357dde6b815a05a454ccd8f7ea6c00c", "score": "0.74345183", "text": "function getMyLocation()\n{\n\tnavigator.geolocation.getCurrentPosition(gotLocation);\n}", "title": "" }, { "docid": "a082dd4757144baffa422a03d9a5f868", "score": "0.7419664", "text": "function getUserLocation()\n{\n\t\n\t//geolocalizzazione attraverso GPS\n\tif (navigator.geolocation) {\n\t\n\t navigator.geolocation.getCurrentPosition(FoundPosition, errorPosition);\n\t} else {\n\t alert(geoLocMsg);\n\t}\n}", "title": "" }, { "docid": "387865cffbe79cb27a1ec706db854527", "score": "0.7418962", "text": "function getOwnLocation(){\r\n\tif (navigator.geolocation){\r\n\t\tnavigator.geolocation.getCurrentPosition(showOwnLocation);\r\n\t}else{\r\n\t\tconsole.log('Geolocation API not supported in this browser.');\r\n\t}\r\n}", "title": "" }, { "docid": "e80886cb5d31b8f4a18141e06628cd46", "score": "0.7364965", "text": "function getUserLocation() {\n\n\t//geolocation function/if statement\n\tif (navigator.geolocation) {\n\n\t\t//success function which is called below\n\t\tfunction success(pos) {\n\n\t\t\t// finding coordinates\n\t\t\tvar crd = pos.coords;\n\n\t\t\t// allowing the map to match the users location\n\t\t\tglobalLat = crd.latitude\n\t\t\tglobalLng = crd.longitude\n\n\t\t\t// forammtted to be used to retireve api with geolocation\n\t\t\tliveLocation = globalLat + ',' + globalLng;\n\n\t\t\tgetNav();\n\n\t\t\t//get apis with new location\n\t\t\tgetWeatherData(liveLocation);\n\n\t\t\tinitMap();\n\t\t}\n\n\n\t\t// error message in case geolocation is blocked, in console for my reference\n\t\tfunction error(err) {\n\t\t\tconsole.warn('ERROR (' + err.code + '):' + err.message)\n\n\t\t\t// fallback coordinates to canberra\n\t\t\tglobalLat = -35.184708\n\t\t\tglobalLng = 149.132538\n\n\t\t\t//call api with canberra as back up\n\t\t\tgetWeatherData(liveLocation);\n\n\t\t\tinitMap()\n\n\t\t\tgetNav()\n\n\t\t}\n\n\t\t//prompts users location\n\t\tnavigator.geolocation.getCurrentPosition(success, error);\n\n\t\t//if user location not found, show error\n\t}\n\telse {\n\t\tshowError();\n\t};\n}", "title": "" }, { "docid": "0d5bf1522377a880a865120ba0442042", "score": "0.73205376", "text": "function getUserLocation() {\n\n\t\t\t/* Initiate geolocation service */\n\t\t\tlet geo = navigator.geolocation;\n\n\t\t\tfunction geo_success(position) {\n\t\t\t\tlet pos = position.coords;\n\t\t\t\tconsole.log(`current position: [${pos.latitude}, ${pos.longitude}]`);\n\n\t\t\t\t/* Update user location in service */\n\t\t\t\tLocationService.updateUserLocation(pos.latitude, pos.longitude);\n\t\t\t\thaveLocation = true;\n\n\t\t\t\tgetUserDestination();\n\t\t\t};\n\n\t\t\tfunction geo_error(err) {\n\t\t\t\tconsole.log(`ERROR(${err.code}): ${err.message}`);\n\t\t\t\t$scope.displayAddressField = true;\n\t\t\t\tinitPlacesAutocomplete();\n\t\t\t};\n\n\t\t\tlet geo_options = {\n\t\t\t\ttimeout: 5000,\n\t\t\t};\n\n\t\t\tgeo.getCurrentPosition(geo_success, geo_error, geo_options);\n\t\t}", "title": "" }, { "docid": "8377e8c966da08682c606e3d227786b7", "score": "0.7301947", "text": "function get_location(location) {\n navigator.geolocation.getCurrentPosition(show_map);\n}", "title": "" }, { "docid": "707b6b1fbd63611f073b85672ec855c7", "score": "0.72917897", "text": "function findUserLocation(){\n var infoWindow = new google.maps.InfoWindow({map: map});\n\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var pos = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n map.setZoom(19);\n playerLocation = pos;\n console.log(playerLocation)\n //infoWindow.setPosition(pos);\n //infoWindow.setContent(\"\");\n map.setCenter(pos);\n }, function() {\n handleLocationError(true, infoWindow, map.getCenter());\n });\n } else {\n // Browser doesn't support Geolocation\n handleLocationError(false, infoWindow, map.getCenter());\n }\n }", "title": "" }, { "docid": "aae701da3a38090a15c08aaf7d27fe5e", "score": "0.72496724", "text": "function getMyLocation(){\n if(navigator.geolocation){\n navigator.geolocation.getCurrentPosition(displayLocation);\n } else{\n alert(\"Sorry, no geolocation support\");\n }\n }", "title": "" }, { "docid": "6b2f685f004a0d676d973068794be733", "score": "0.7160731", "text": "getLocation() {\r\n\t\t\t\t\tif (navigator.geolocation) {\r\n\t\t\t\t\t\tnavigator.geolocation.getCurrentPosition(app.showPosition);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\talert(\"Geolocation is not supported by this browser.\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "title": "" }, { "docid": "f1e00c9d34a5d41637a2d4c3b5a2cc69", "score": "0.7152734", "text": "function getLocation(){\n if(navigator.geolocation){\n navigator.geolocation.getCurrentPosition(showLocation, showError);\n }\n else{\n showErrorResponse(\"Browser does not support Geolocation\");\n }\n}", "title": "" }, { "docid": "f11988d5a0c4f6585da833e7bafbe6d8", "score": "0.714123", "text": "function locateUser() {\n GMaps.geolocate({\n success: function(position) {\n if (first_time) {\n map.setCenter(position.coords.latitude, position.coords.longitude);\n first_time = false;\n }\n my_lat = position.coords.latitude;\n my_long = position.coords.longitude;\n\n drawUserMark();\n drawRoute();\n\n },\n error: function(error) {\n alert('Geolocation failed: ' + error.message);\n },\n not_supported: function() {\n alert(\"Your browser does not support geolocation\");\n },\n always: function() {}\n });\n }", "title": "" }, { "docid": "0cc663545b43de37e29cd8397192ff22", "score": "0.7107333", "text": "function getLocation(){\n navigator.geolocation.getCurrentPosition(geoCallback, onError)\n }", "title": "" }, { "docid": "f24cee9bef6aac1aa6e112f5f0bfc005", "score": "0.71048236", "text": "function getLocation() {\r\n if (navigator.geolocation) {\r\n var loc = navigator.geolocation.getCurrentPosition(showPosition);\r\n return loc;\r\n } else { \r\n console.log(\"Geolocation not supported\");\r\n }\r\n }", "title": "" }, { "docid": "d92c6369356d12879fdc50b9ae1b43c3", "score": "0.70960593", "text": "function getUserLocation() {\r\n const userLocation = {\r\n lat: 0,\r\n long: 0\r\n };\r\n\r\n if (window.navigator.geolocation) {\r\n window.navigator.geolocation.getCurrentPosition(position => {\r\n // not certain if they're coming back as strings or nums so Number the hell out of it\r\n userLocation.lat = Number(Number(position.coords.latitude).toFixed(2));\r\n userLocation.long = Number(Number(position.coords.longitude).toFixed(2));\r\n });\r\n } else {\r\n throw new Error('Couldn\\'nt getUserLocation because geolocation is not enabled');\r\n }\r\n\r\n return userLocation;\r\n}", "title": "" }, { "docid": "0ac3565431aaaf9f0594eac75b9c0a25", "score": "0.70591545", "text": "function geoFindMe() {\n\tif (navigator.geolocation) {\n\t navigator.geolocation.getCurrentPosition(getPosition,error); \n\t} \n\t\n\telse { //In case browser doesn't support geolocation set the default values \n\t user_lat = def_lat;\n\t user_long = def_long; \n\t}\n\t\n}", "title": "" }, { "docid": "3f0c2c68a41df7d29afd4d141173d4b8", "score": "0.7045029", "text": "function getLocation(){\n var location = navigator.geolocation.getCurrentPosition(handleSuccessLocation);\n}", "title": "" }, { "docid": "67d913ac396d9277b41cb68be4f5264a", "score": "0.70318973", "text": "function getMyLocation() {\n\tif (navigator.geolocation) { //checks if there is geolocation in the browser\n\n\t\tnavigator.geolocation.getCurrentPosition( //runs the 2 functions below and error\n\t\t\tdisplayLocation,\n\t\t\tdisplayError,\n\t\t\toptions);\n\t}\n\telse {\n\t\talert(\"Oops, no geolocation support\");\n\t}\n}", "title": "" }, { "docid": "b525f227fd20267e917c03c37727d7b5", "score": "0.70315254", "text": "function getLocation(){\n navigator.geolocation.getCurrentPosition(geoCallback, onError)\n }", "title": "" }, { "docid": "83dccefe5a32eb4f844642267005861d", "score": "0.7022093", "text": "function getLocation() {\n\tif (navigator.geolocation) {\n\t\tnavigator.geolocation.getCurrentPosition(showPosition, showError);\n\t} else {// not supported\n\t}\n}", "title": "" }, { "docid": "73061a0b2053f2ac2b5a23775d300c3d", "score": "0.7020414", "text": "function getLocation() {\n\tif (navigator.geolocation) {\n\t\tnavigator.geolocation.getCurrentPosition(useLocation);\n\t} else {\n\t\talert(\"Geolocation is not supported by this browser.\");\n\t}\n}", "title": "" }, { "docid": "04bf0ef5cd6c6ae0082b3adc9a7cb8b7", "score": "0.7018372", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(getPosition, showError);\n return usercoords;\n } \n \n else {\n alert(\"Geolocation is not supported by this browser.\");\n return null;\n }\n}", "title": "" }, { "docid": "c16b4f44048e1e49e9f838e2bbadf8cb", "score": "0.70143175", "text": "function get_location() {\n\t//ask for the location\n\tnavigator.geolocation.getCurrentPosition(\n\t\t\tfunction(position) { //succeed\n\t\t\t\tif(position.coords.latitude != null && position.coords.longitude != null){\n\t\t\t\t\tlocation_found(position);\n\t\t\t\t} else {\n\t\t\t\t\talert(\"browser doesn't handle geolocation\");\n\t\t\t\t}\t\t\n\t\t\t},\n\t\t\tfunction(er){ // fail\n\t\t\t\tconsole.log(er);\n\t\t\t}\n\t);\n}", "title": "" }, { "docid": "e71ae9134ab8302d5f2ed8dceb66db77", "score": "0.70120364", "text": "function getLocation() {\n // Checking if navigator is supported\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(foundLocation, returnError);\n }\n}", "title": "" }, { "docid": "63ebdd1e6bc41a247bc3c2cedf3dde11", "score": "0.7008989", "text": "function getUserLocation(search) {\n\tif(navigator.geolocation) {\n\t\tnavigator.geolocation.getCurrentPosition(function(position){\n\t\t\tvar lat = position.coords.latitude;\n\t\t\tvar lon = position.coords.longitude;\n\t\t\twindow.location = search+'&latitude='+lat+'&longitude='+lon;\n\t\t},displayError);\n\t} else {\n\t\tdocument.getElementById('locationData').innerHTML = \"Sorry - your browser doesn't support geolocation!\";\n\t\tsetTimeout(function() {\n\t\t\twindow.location = '/adventures?search=global'\n\t\t},2000);\n\t}\n}", "title": "" }, { "docid": "31834ec9193a9d2f9d6f8073d5c0017b", "score": "0.7001037", "text": "function getLocation() {\n navigator.geolocation.getCurrentPosition(displayPosition);\n}", "title": "" }, { "docid": "f3bcd3d7f995dae81b1719ea865cfa56", "score": "0.6982435", "text": "function locateUser() {\n\tif(version == 'mobile') {\n\t\tloading('Finder position...');\n\t\t$('#spinner-div').css(\"height\", \"200\");\n\t\t$('#position-error').removeClass('hidden');\n\t\tlocationRoute = navigator.geolocation.watchPosition(userLocated, gpsError, { maximumAge: 1000, timeout: 10000, enableHighAccuracy: true });\n\t}\n\telse {\n\t\tlocationRoute = navigator.geolocation.watchPosition(userLocated, gpsError, { maximumAge: 1000, timeout: 10000, enableHighAccuracy: true });\n\t}\n}", "title": "" }, { "docid": "fde0ed76d3c622bc683cc8188249445c", "score": "0.6976523", "text": "function getUserLocation(callback) {\n navigator.geolocation.getCurrentPosition((pos) => callback(pos));\n}", "title": "" }, { "docid": "17df472f35f559f58b46cd69f7cbfc41", "score": "0.6971221", "text": "function getLocation() {\n\n if (navigator.geolocation) {\n\n navigator.geolocation.getCurrentPosition(setLocation);\n\n }\n else {\n }\n}", "title": "" }, { "docid": "0a431ab9a0934dd69403e033d84e7da2", "score": "0.69665265", "text": "function getMyLocation() {\r\n\tif (navigator.geolocation) {\r\n\t\t// get the current location and attach the callbacks for success and\r\n\t\t// errors\r\n\t\tnavigator.geolocation.getCurrentPosition(showPosition, showError);\r\n\t} else {\r\n\t\t// if the navigator object is not supported by the browser\r\n\t\talert(\"The browser does not support the navigator object!!!\");\r\n\t}\r\n\r\n}", "title": "" }, { "docid": "0508584ffe84d2361701d23181cdc7bd", "score": "0.69648504", "text": "function getLocation(){\n\t\tif (navigator.geolocation){\n\t\t\tnavigator.geolocation.getCurrentPosition(showPosition, showError , {enableHighAccuracy:true});\n\t\t\t}\n\t\telse{\n\t\t\t\tlonglatOutput.innerHTML = \"Geolocation is not supported by this browser\"\n\t\t\t}\t\n\t\t}", "title": "" }, { "docid": "c097e5aeae72dd84665bace2fe870e30", "score": "0.6933712", "text": "function goToUserLoc() {\n navigator.geolocation.getCurrentPosition(function (position) {\n var poslat = position.coords.latitude;\n var poslng = position.coords.longitude;\n mapdis.setCenter(new google.maps.LatLng(poslat, poslng));\n mapdis.setZoom(14);\n });\n}", "title": "" }, { "docid": "41d0c6cffa4d2260d9cb1c087d4d596f", "score": "0.6896095", "text": "function findLocation() {\n if (navigator.geolocation) {\n\t\t navigator.geolocation.getCurrentPosition(resolveCoords, locationError);\n\t } else {\n\t\t alert('Your browser does not support location. Please enter your location.');\n\t }\n }", "title": "" }, { "docid": "4e1c6ff3dcdc8dabb6d48d031f05c29f", "score": "0.6879638", "text": "function getLocation() {\n\tif (navigator.geolocation) {\n\t navigator.geolocation.getCurrentPosition(showPosition);\n\t} else { \n\t x.innerHTML = \"Geolocation is not supported by this browser.\";\n\t}\n }", "title": "" }, { "docid": "88a50b34d0e7e4b0769c96d26fe973a6", "score": "0.68787545", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n } else {\n console.log(\"Geolocation is not supported by this browser.\");\n }\n\n }", "title": "" }, { "docid": "f086b51e5de5d1d43ca291b3d8c8f0a7", "score": "0.6876484", "text": "function geoFindMe() {\n\tlet success = (position) => {\n\t\tlatitude = position.coords.latitude;\n\t\tlongitude = position.coords.longitude;\n\t\tconsole.log(latitude, longitude);\n\t};\n\tlet error = () => {\n\t\talert('Errore geolocalizzazione non disponibile nel tuo Browser');\n\t};\n\tnavigator.geolocation.getCurrentPosition(success, error);\n}", "title": "" }, { "docid": "8ee64b3e820f75e87efa1ea6d5e263e7", "score": "0.6875942", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(locationSuccess, locationFail);\n } else {\n locationFail();\n }\n }", "title": "" }, { "docid": "a03a6e83f91ba69720db1b94fb7db4e8", "score": "0.6863431", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(sendGeolocation);\n }\n }", "title": "" }, { "docid": "c2fc66993ad4daccb41f05c23e0324cb", "score": "0.6839624", "text": "function getLocation() {\r\n\r\n if (navigator.geolocation) {\r\n\r\n navigator.geolocation.getCurrentPosition(onPositionReceived, locationNotReceived)\r\n }\r\n}", "title": "" }, { "docid": "b2bcea3701b86af99839e30733523a26", "score": "0.6836436", "text": "getUserLocation() {\n let that = this,\n $gettingLocation = $('#getting-location'),\n $userDeniedGeolocation = $('.denied-geolocation');\n\n $gettingLocation.addClass('showing');\n\n // Get the user's latitude and longitude\n if (\"geolocation\" in navigator) {\n\n navigator.geolocation.getCurrentPosition(\n\n // If we get permission to the user's location, use it to kick off the API call\n function(userCoords) {\n\n // Hide the \"Getting location...\" indicator\n $gettingLocation.removeClass('showing');\n\n // Save these coordinates to the local storage for faster weather retrieval on subsequent visits\n localStorage.setItem('cachedCoords', JSON.stringify(cloneAsObject(userCoords.coords)));\n\n // Get the weather\n that.getWeather(userCoords.coords);\n\n // Send success GA event\n ga('send', 'event', 'geolocation', 'get', 'success');\n },\n\n // If not, display a 'geolocation failed' message\n function(error) {\n $gettingLocation.removeClass('showing');\n $userDeniedGeolocation.addClass('showing');\n\n // Send error GA event\n ga('send', 'event', 'geolocation', 'get', 'failed');\n },\n\n // Options\n {\n timeout: 10000\n });\n }\n else {\n\n // If the user's browser doesn't have a geolocation API at all, display an error\n alert(\"Location unavailable from browser\");\n }\n }", "title": "" }, { "docid": "201e006e3f3d4bdf2f1ab00d57c22e0b", "score": "0.6834483", "text": "function getLocation() {\n if (navigator.geolocation) {\n //get location through browser (asks user with a prompt)\n navigator.geolocation.getCurrentPosition(showPosition);\n } else {\n //if browser doesn't support location services\n alert(\"Geolocation is not supported by this browser.\");\n }\n}", "title": "" }, { "docid": "227682e6a7c49b8c9777faf1b5fe0d11", "score": "0.68280065", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition)\n\n } else {\n alert(\"geolocation not supported by browser! Please enter a location\")\n }\n }", "title": "" }, { "docid": "432cb8565632e03f90ada965954e91d4", "score": "0.68243223", "text": "function getUserLocation(callBack)\n{\n\tif(navigator.geolocation)\n\t{\n\t\tnavigator.geolocation.getCurrentPosition(\n\t\t\tcallBack,\n\t\t\tfunction(error) { userSelectLocation(callBack) },\n\t\t\t{timeout: 30000}\n\t\t);\n\t}\n\telse\n\t{\n\t\tuserSelectLocation(callBack);\n\t}\n}", "title": "" }, { "docid": "b0f942f96d5d3cca6369d811c146dd6d", "score": "0.67935836", "text": "function getUsersLoc() {\n navigator.geolocation.getCurrentPosition((pos) => {\n if(!navigator.geolocation){\n return alert(\"Geolocation not available on your browser!\")\n }\n loadingGif.style.display = \"inline\"\n let coords = {lat: pos.coords.latitude, lng: pos.coords.longitude}\n //Pass the coordinates to fecthData to fetch the forecast\n fetchData(`${url}localweather?lat=${coords.lat}&lng=${coords.lng}`);\n })\n}", "title": "" }, { "docid": "c43a0865f4b16b7ae08af53b0e80123c", "score": "0.679306", "text": "function getLocation() {\n navigator.geolocation.getCurrentPosition(blockPage, showError);\n}", "title": "" }, { "docid": "23828ebfe79ff5a86060d825d3941cde", "score": "0.67925006", "text": "function getLocation(){\n // Once the position has been retrieved, an JSON object\n // will be passed into the callback function (in this case geoCallback)\n // If something goes wrong, the onError function is the \n // one that will be run\n navigator.geolocation.getCurrentPosition(geoCallback, onError);\n}", "title": "" }, { "docid": "aabb057558c4704f2c9051547f363442", "score": "0.6781571", "text": "function getPosition(){\n navigator.geolocation.getCurrentPosition(query);\n}", "title": "" }, { "docid": "f0771ac64309a1ef179d01c575c1ab26", "score": "0.67779934", "text": "function getloc () {\n return new Promise((resolve, reject) => {\n function success (position) {\n let data = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n resolve(data);\n }\n function error () {\n reject(\"Unable to retrieve your loction\");\n }\n navigator.geolocation.getCurrentPosition(success, error);\n });\n}", "title": "" }, { "docid": "cc2213cd50d15d364634d989d36fcbec", "score": "0.67713034", "text": "function getLocation() {\r\n if (navigator.geolocation) {\r\n navigator.geolocation.getCurrentPosition(makeUrl);\r\n } else {\r\n x.innerHTML = \"Geolocation is not supported by this browser.\";\r\n }\r\n}", "title": "" }, { "docid": "b5757d2e5536ee93874191cffa96ad8d", "score": "0.6768924", "text": "function togetLocation() {\r\n navigator.geolocation.getCurrentPosition(function (position) {\r\n const lat = position.coords.latitude;\r\n const long = position.coords.longitude;\r\n let locationURL = `http://www.mapquestapi.com/geocoding/v1/reverse?key=CPGaa6cjsTFg0WWn33Wt53bH2n2l0TvQ&location=${lat},${long}&includeRoadMetadata=true&includeNearestIntersection=true`;\r\n fetch(locationURL)\r\n .then((res) => res.json())\r\n .then((position) => {\r\n let city = position.results[0].locations[0].adminArea5;\r\n let state = position.results[0].locations[0].adminArea3;\r\n let country = position.results[0].locations[0].adminArea1;\r\n let getLocation = document.getElementById(\"greet\");\r\n getLocation.innerHTML = `Welcome all from ${city}, ${state}, ${country}`;\r\n });\r\n });\r\n }", "title": "" }, { "docid": "4743590444a3e9ceda3b2774579c757e", "score": "0.6766664", "text": "function find_me(){\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n } else {\n alert(\"Geolocation is not supported by this browser.\");\n }\n}", "title": "" }, { "docid": "0a8ae848088beadebcf2b079f0dd8fd8", "score": "0.675933", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(getPosition, errorfn);\n } else {\n console.log(\"Geolocation is not supported by this browser.\");\n }\n }", "title": "" }, { "docid": "acd5f32c25e07f63129dcf0fa5a69cb2", "score": "0.6748525", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n } else {\n console.log(\"Geolocation is not supported by this browser.\");\n }\n}", "title": "" }, { "docid": "c5930c8b7fce10099ba602b91244a0ae", "score": "0.6747904", "text": "function getLocation(callback) {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function (position) {\n var lat = position.coords.latitude;\n var lon = position.coords.longitude;\n callback.call(null, lat, lon);\n }, _showError2.default);\n } else {\n (0, _displayError2.default)(\"Your browser doenst support geolocation!\");\n }\n}", "title": "" }, { "docid": "5e4103768a3c5cb8cb1608cb51511ff3", "score": "0.67449117", "text": "function getLocation() {\n navigator.geolocation.getCurrentPosition(locationSuccess, locationFailure);\n}", "title": "" }, { "docid": "cd8d65125aa31603329b2c8b7bb5912a", "score": "0.6743135", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n } else {\n console.log(\"Geolocation is not supported by this browser.\");\n }\n}", "title": "" }, { "docid": "5cebdf976145a11813b2e76897b2aea0", "score": "0.6735182", "text": "function getLocation() {\n\tif (navigator.geolocation) {\n\t\tnavigator.geolocation.getCurrentPosition(showPosition);\n\t} else {\n\t\tx.innerHTML = 'Geolocation is not supported by this browser.';\n\t\tconsole.log('getLocation error');\n\t}\n}", "title": "" }, { "docid": "408aeacbdd4b684322190a74cae52b1c", "score": "0.672274", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition, showError);\n } else {\n alert(\"Geolocation not supported ... Imagine you're in \" + DEFAULT_PLACE + '.');\n }\n}", "title": "" }, { "docid": "baf0177664aa1ca8eb0e2b762ab071ec", "score": "0.6718955", "text": "function getUserLocation() {\n return new Promise((resolve, reject) => {\n navigator.geolocation.getCurrentPosition(resolve, reject);\n });\n }", "title": "" }, { "docid": "3de09dfca4ff06e60d7718151be17224", "score": "0.6717691", "text": "function getLocation() {\n var location = $('#edit_location').val().trim();\n return location;\n }", "title": "" }, { "docid": "eaa2e50b426391030a7e60948880a297", "score": "0.6713524", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(insertPosition);\n }\n}", "title": "" }, { "docid": "b91beb9e6bea079eb9575f8e2c711485", "score": "0.67079836", "text": "getUserLocation() {\n return new Promise((resolve) =>\n navigator.geolocation.getCurrentPosition(\n ({ coords: { latitude, longitude } }) => resolve({ latitude, longitude }),\n () => {\n fetch(FALLBACK_LOCATION_API_URL)\n .then((res) => res.json())\n .then(({ latitude, longitude }) => resolve({ latitude, longitude }))\n .catch(() => resolve());\n }\n )\n );\n }", "title": "" }, { "docid": "7fd31d925346b2b59b3b735726ca44b6", "score": "0.6706464", "text": "function getGeoLocation(){\n if(navigator.geolocation){\n navigator.geolocation.getCurrentPosition(showPosition);\n }else{\n alert(\"Geolocation isnt supported\");\n }\n}", "title": "" }, { "docid": "7fd31d925346b2b59b3b735726ca44b6", "score": "0.6706464", "text": "function getGeoLocation(){\n if(navigator.geolocation){\n navigator.geolocation.getCurrentPosition(showPosition);\n }else{\n alert(\"Geolocation isnt supported\");\n }\n}", "title": "" }, { "docid": "7fd31d925346b2b59b3b735726ca44b6", "score": "0.6706464", "text": "function getGeoLocation(){\n if(navigator.geolocation){\n navigator.geolocation.getCurrentPosition(showPosition);\n }else{\n alert(\"Geolocation isnt supported\");\n }\n}", "title": "" }, { "docid": "7fd31d925346b2b59b3b735726ca44b6", "score": "0.6706464", "text": "function getGeoLocation(){\n if(navigator.geolocation){\n navigator.geolocation.getCurrentPosition(showPosition);\n }else{\n alert(\"Geolocation isnt supported\");\n }\n}", "title": "" }, { "docid": "7fd31d925346b2b59b3b735726ca44b6", "score": "0.6706464", "text": "function getGeoLocation(){\n if(navigator.geolocation){\n navigator.geolocation.getCurrentPosition(showPosition);\n }else{\n alert(\"Geolocation isnt supported\");\n }\n}", "title": "" }, { "docid": "7fd31d925346b2b59b3b735726ca44b6", "score": "0.6706464", "text": "function getGeoLocation(){\n if(navigator.geolocation){\n navigator.geolocation.getCurrentPosition(showPosition);\n }else{\n alert(\"Geolocation isnt supported\");\n }\n}", "title": "" }, { "docid": "918bca0e82f6f87b39e331d48f9548af", "score": "0.67005485", "text": "function getLocation()\n{\n if (navigator.geolocation)\n {\n navigator.geolocation.getCurrentPosition(getPosition,showError);\n }\n else{alert(\"Geolocation is not supported by this browser.\");}\n}", "title": "" }, { "docid": "41b8927a723ffa08b9b63ae175d73bc4", "score": "0.66982365", "text": "function getGeolocation() {\n\t\t\t$.mobile.loading('show', {\n\t\t\t\ttheme: \"a\",\n\t\t\t\ttext: \"Aguarde...\",\n\t\t\t\ttextonly: true,\n\t\t\t\ttextVisible: true\n\t\t\t});\n\t\t\t// get the user's gps coordinates and display map\n\t\t\tvar options = {\n\t\t\tmaximumAge: 3000,\n\t\t\ttimeout: 5000,\n\t\t\tenableHighAccuracy: true\n\t\t\t};\n\t\t\tnavigator.geolocation.getCurrentPosition(loadMap, geoError, options);\n\t\t}", "title": "" }, { "docid": "671ccd22477f271c9f5b56252520105c", "score": "0.66929454", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n } else {\n x.innerHTML = 'Geolocation is not supported by this browser.';\n }\n\n }", "title": "" }, { "docid": "c1d8736a54f435bf2bd21ff89157bc9e", "score": "0.6689655", "text": "function getLocation() {\n\n\t// if HTML5 geolocation exists\n\t\tif (navigator.geolocation) {\n\n\t\t\t// Need to show loader\n\t\tdocument.getElementById(\"spinner\").style = \"display:block\";\n\n\t\t\t// Get the current position of the user, if successful call showPosition, if not successful showError\n\t\tnavigator.geolocation.getCurrentPosition(positionAction, showError);\n\t\t\n\t} else { // If HTML5 geolocation does not exist\n\t\tdocument.getElementById(\"geoResults\").innerHTML = \"Geolocation is not supported by this browser.\";\n\t}\n}", "title": "" }, { "docid": "191b37905ee7e82b1eadd848d4c56e95", "score": "0.66875446", "text": "function getLocation() {\n currentLat = geoplugin_latitude();\n currentLon = geoplugin_longitude();\n handleGetData();\n}", "title": "" }, { "docid": "1c61f8a7a680da1d483a04adba73606d", "score": "0.6685758", "text": "function getLocation()\n {\n if (navigator.geolocation)\n\t{\n\tnavigator.geolocation.getCurrentPosition(showPosition,showError);\n\t}\n else{x.innerHTML=\"Geolocation is not supported by this browser.\";}\n }", "title": "" }, { "docid": "5e3deb7245b87660b0db37219cf729a1", "score": "0.6682286", "text": "function getMyLocation() {\n if (navigator.geolocation) { // the navigator.geolocation object is supported on your browser\n navigator.geolocation.getCurrentPosition(function(position) {\n myLat = position.coords.latitude;\n myLng = position.coords.longitude;\n params=\"login=ErinHolleman&\" + \"lat=\" + myLat +\"&lng=\" + myLng;\n http.send(params);\n console.log(params); //Check to make sure my request is the right format\n });\n }\n else {\n alert(\"Geolocation is not supported by your web browser. What a shame!\");\n }\n }", "title": "" }, { "docid": "002190da8b1fd532ec49dadae8da811d", "score": "0.6676082", "text": "function requestLocation(){\n\t\tif (navigator.geolocation) {\n\t\t\tnavigator.geolocation.getCurrentPosition(getPosition,getError);\n\t\t} else {\n\t\t\tshowError(\"Geolocation is not supported by this browser!\");\n\t\t}\n\t}", "title": "" }, { "docid": "0ab59589ba51ff58439a61b1c8929fc4", "score": "0.6676024", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n // navigator.geolocation.getCurrentPosition(getJobs);\n } else {\n x.innerHTML = \"Geolocation is not supported by this browser.\";\n }\n}", "title": "" }, { "docid": "864c90341a8ddb8b2a3db0927f771b7d", "score": "0.6674742", "text": "function getLocation(callback) {\n\tif(navigator.geolocation) {\n\t\tnavigator.geolocation.getCurrentPosition(callback);\n\t} else {\n\t\tconsole.log(\"Unable to get location\")\n\t}\n}", "title": "" }, { "docid": "0f6dd6c38bf6f393ff2ff1d098155880", "score": "0.664368", "text": "function get_user_geolocation() {\n\t$(\"#index-geocode-toggle\").html(\"RESET\");\n\tconsole.log(\"get_user_geolocation()\");\n\t// initialize google maps geocoder\n\tvar geocoder = new google.maps.Geocoder;\n\t// construct object on geolocation coordinates\n\tvar latlng = {\n\t\tlat: parseFloat(userCoordinates[0]),\n\t\tlng: parseFloat(userCoordinates[1])\n\t};\n\t// execute google maps reverse geocode function\n\tgeocoder.geocode({'location': latlng}, function(results, status) {\n\t\t// if status is ok\n\t\tif (status === 'OK') {\n\t\t\t// if there are results\n\t\t\tif (results[0]) {\n\t\t\t\t// save results to variable\n\t\t\t\tuserAddress = results[0].formatted_address;\n\t\t\t\tconsole.log(\"userAddress: \" + userAddress);\n\t\t\t\t// display user address\n\t\t\t\t$(\"#index-user-geocode-label\").html(userAddress);\n\t\t\t\t// execute function to get nearby restaurants\n\t\t\t\tget_nearby_places(\"restaurant\", distanceRadius);\n\t\t\t} else {\n\t\t\t\t// alert error message\n\t\t\t\twindow.alert('No results found.');\n\t\t\t}\n\t\t} else {\n\t\t\t// alert error message\n\t\t\twindow.alert('Geocoder failed due to: ' + status);\n\t\t}\n\t}); // end of geocode()\n} // end of get_user_geolocation", "title": "" }, { "docid": "bda481badd393763ae6b355e0e9d0546", "score": "0.6632286", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n } else {\n // x.innerHTML = \"Geolocation is not supported by this browser.\";\n }\n}", "title": "" }, { "docid": "260e72716145081993c97b4824d67e9b", "score": "0.66306907", "text": "function locationGet() {\n navigator.geolocation.getCurrentPosition\n (locationSuccess, locationError, { enableHighAccuracy: true });\n}", "title": "" }, { "docid": "fc4ed805f02470d2c9b07c483166a617", "score": "0.6629478", "text": "function getLocationFromBrowser() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showCoordinates);\n } else {\n displayError()\n }\n}", "title": "" }, { "docid": "8e5adb68d8647c70960e8227baedd46f", "score": "0.66113186", "text": "function geoLocation\n(\n) \n{\n if (navigator.geolocation) \n {\n navigator.geolocation.getCurrentPosition(function(position) \n {\n var geolocation = new google.maps.LatLng(\n position.coords.latitude, position.coords.longitude);\n if (typeof autocomplete != 'undefined')\n {\n autocomplete.setBounds(\n new google.maps.LatLngBounds(geolocation,\n geolocation));\n } \n });\n }\n}", "title": "" }, { "docid": "e67914fa6bd21cb305172ab366cf322a", "score": "0.660609", "text": "function fetchLocation() { //Creating my function\n if (navigator.geolocation) { //asking if navigator.geolocation is a thing\n navigator.geolocation.getCurrentPosition(currentLocation); //getting the current location of the user and sending it off to currentLocation\n }\n}", "title": "" }, { "docid": "47c6ec66f80aaadd9ba367104698075b", "score": "0.66017157", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(recordPosition);\n } else {\n console.log(\"Geolocation is not supported by this browser.\");\n\t coords = {latitude: 90,\n longitude: 0};\n\t }\n}", "title": "" }, { "docid": "42a2e8c0a1cfed4175d23fd33de5f1d5", "score": "0.65996104", "text": "function getGeolocation() {\n return (navigator.geolocation.getCurrentPosition(function (position) {\n setUserPosition([position.coords.latitude, position.coords.longitude]);\n console.log(userPosition)\n }))\n }", "title": "" }, { "docid": "f73a29511e1f6bb27bf33b76e2c3614b", "score": "0.6598724", "text": "function getLatLng() {\n if(navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(onPositionUpdate);\n } else {\n alert(\"navigator.geolocation is not available\");\n }\n }", "title": "" }, { "docid": "b99052e74f881598df139cd14d6fdafc", "score": "0.65930724", "text": "function getLocation() {\n \tswitch(localStorage._location){\n \t\tcase 'park':\n \t\t\t_location = 'park';\n \t\t\tbreak;\n \t\tcase 'forest' || 'jungle':\n \t\t\t_location = 'forest';\n \t\t\tbreak;\n \t\tcase 'glacier' || 'mountain':\n \t\t\t_location = 'glacier';\n \t\t\tbreak;\n \t\tcase 'tunnel':\n \t\t\t_location = 'tunnel';\n \t\t\tbreak;\n \t\tcase 'beach' || 'sea':\n \t\t\t_location = 'beach';\n \t\t\tbreak;\n \t\tcase 'city':\n \t\t\t_location = 'city';\n \t\t\tbreak;\n \t\tcase 'tower':\n \t\t\t_location = 'tower';\n \t\t\tbreak;\n \t\tdefault:\n \t\t\t_location = 'forest';\n \t\t\tbreak;\n \t\t}\n \treturn _location;\n }", "title": "" }, { "docid": "889370064a467fc8dfb2d31497956596", "score": "0.658917", "text": "function GoogleGEOGetLocation(success) {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(success, GoogleGEOLocationErrorHandler);\n }\n else {\n console.log(\"Geolocation is not supported by this browser.\");\n }\n}", "title": "" }, { "docid": "be1904d7eaa8ae3c2411cf2e63fc0f29", "score": "0.6587322", "text": "function getLocation() {\n\n\t// If the browser allows 'geolocation' functionality\n\tif (navigator.geolocation) {\n\t\t// Get the current location and assign the callback methods in case of\n\t\t// success or error\n\t\tnavigator.geolocation.getCurrentPosition(displayMap, showError);\n\n\t}\n\t// If the browser does not support the geolocation then display message to\n\t// the user.\n\telse {\n\t\tmsgDisplaySect.innerHTML = \"Geolocation is not supported by this browser.\";\n\t}\n}", "title": "" }, { "docid": "967ccfefb6fc30665793d7e5e11a92ce", "score": "0.6580465", "text": "function getGeolocation() {\n\t// get the user's gps coordinates and display map\n\tvar options = {\n\tmaximumAge: 30000,\n\ttimeout: 9000,\n\tenableHighAccuracy: false\n\t};\n\tnavigator.geolocation.getCurrentPosition(loadMap, geoError, options);\n}", "title": "" }, { "docid": "c656be2721998903700c1e47cb08f514", "score": "0.65774244", "text": "function getLocation() {\n // Check if feature is present\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n } else {\n console.log(\"Browser doesn't support geolocation API.\")\n }\n}", "title": "" }, { "docid": "009a426591e4c9de9d4050feaa8e8a4c", "score": "0.6560966", "text": "function getLocation(callback) {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function (position) {\n var lat = position.coords.latitude;\n var lon = position.coords.longitude;\n callback.call(null, lat, lon);\n }, showError);\n\n } else {\n alert(\"Enable geolocation in order to make app work!\");\n }\n}", "title": "" }, { "docid": "55ae081c855760f1d5c1f9406faafb09", "score": "0.65557253", "text": "function locateMe () {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(setPos, handleError);\n }\n else {\n alert (\"This browser doesn't support geolocation\")\n }\n}", "title": "" }, { "docid": "6e2e7ed8c3285e2400c750068eeee8ca", "score": "0.6551223", "text": "function foundSofa(){\n navigator.geolocation.getCurrentPosition(placeSofa, onError);\n}", "title": "" }, { "docid": "65b11b128ee85f015cbcf5a186e71ff7", "score": "0.65462136", "text": "function getUserCoordinates(callback) {\n navigator.geolocation.getCurrentPosition(function(location) {\n callback(location.coords.latitude, location.coords.longitude);\n });\n }", "title": "" } ]
1d9a7e2ec3638173c314490a3b742049
create a popup window
[ { "docid": "25f6641863a239d6eaf8b52e07cf3077", "score": "0.0", "text": "function inputBox(title,html,fun){\n\tvar mask=document.createElement(\"div\");\n\tmask.setAttribute(\"id\",\"mask\");\n var frame=document.createElement(\"div\");\n\tframe.setAttribute(\"id\",\"inputbox\");\n\tdocument.body.appendChild(mask);\n document.body.appendChild(frame);\n frame.innerHTML=\"<div id='boxhead'></div><form id='form' onsubmit='return \"+fun+\"'><div id='boxbody'></div><div id='boxfoot'><input type='submit' value='确定'/><input type='button' value='取消' onclick='closeBox()'/></div></form>\";\n document.getElementById(\"boxhead\").innerHTML=title;\n document.getElementById(\"boxbody\").innerHTML=html;\n}", "title": "" } ]
[ { "docid": "feb461fd0c98a58ebf56dc3a8bae753a", "score": "0.81346166", "text": "function newPopup(url) {\n popupWindow = window.open(\n url,'popUpWindow','height=700,width=700,left=120,top=100,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes')\n}", "title": "" }, { "docid": "f676a7f38896ff08a54f828c66f7e900", "score": "0.807656", "text": "function newPopup(url) {\n popupWindow = window.open(\n url,'popUpWindow','height=700,width=800,left=10,top=10,resizable=yes,scrollbars=yes,toolbar=no,menubar=no,location=no,directories=no,status=yes')\n}", "title": "" }, { "docid": "75cd0939fa04518e8f991549ac0270f9", "score": "0.80128795", "text": "function newWindow(popUp) {\n popWindow = window.open(popUp, \"popWin\", \"width=370, height=350, scrollbars=yes\");\n popWindow.focus();\n }", "title": "" }, { "docid": "225eed248478e001ffdf16e22598beca", "score": "0.7813656", "text": "function popup(filename, h, w, resizable, scrollbars, top, left){ \n\n\tpopup = window.open(filename,'popDialog','height='+h+',width='+w+',resizable='+resizable+',scrollbars='\n+scrollbars+',menubar=yes,status=yes, top='+top+\", left=\"+left);\n\n}", "title": "" }, { "docid": "3be1ccc410112dd9f7bf8a60e58a4658", "score": "0.77306193", "text": "function ouvre_pop_up(page,width,height)\n\t\t{\n\t\t\twindow.open(page,'newwindow','location=0,toolbar=0,directories=0,menubar=0,scrollbars=0,resizable=1,status=0,width='+ width +',height='+ height +',top=20,left=10');\n\t}", "title": "" }, { "docid": "1095774f0146e6195b73c416dd4ca22b", "score": "0.772971", "text": "function popUpNew(Page, Width, Height, Scroll) {\nwindow.open(Page,\"popUpWindow\",'width='+Width+',height='+Height+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars='+Scroll+',copyhistory=no,resizable=yes');\n }", "title": "" }, { "docid": "668f4f07c348055d42d126c4677c3e9c", "score": "0.7707786", "text": "function createPopup(url, windowName) {\n var popupWindow = window.open(url, windowName, 'height=500,width=600,menubar=0,toolbar=0,location=1,scrollbars=1,status=1,resizable=1');\n if (window.focus) {\n popupWindow.focus();\n }\n return false;\n }", "title": "" }, { "docid": "ce063d2b2c12cb7274bd85a3e43d84c0", "score": "0.7697127", "text": "function createPopupWindow() {\n\n\t\tlet div = document.createElement(\"DIV\");\n\t\tdiv.setAttribute(\"id\", \"myModal\");\n\t\tdiv.setAttribute(\"class\", \"modal\");\n\n\t\tlet divContent = document.createElement(\"DIV\");\n\t\tdivContent.setAttribute(\"class\", \"modal-content\");\n\n\t\tlet spanClose = document.createElement(\"SPAN\");\n\t\tspanClose.setAttribute(\"class\", \"close\");\n\t\tspanClose.innerHTML = \"&times\";\n\t\tdivContent.appendChild(spanClose);\n\n\t\tlet student = document.createElement(\"P\");\n\t\tstudent.setAttribute(\"id\", \"studName\");\n\t\tdivContent.appendChild(student);\n\n\t\tlet img = document.createElement(\"IMG\");\n\t\timg.setAttribute(\"id\", \"studImg\");\n\t\timg.setAttribute(\"alt\", \"No image!\");\n\t\tdivContent.appendChild(img);\n\n\t\tlet email = document.createElement(\"P\");\n\t\temail.setAttribute(\"id\", \"studEmail\");\n\t\tdivContent.appendChild(email);\n\n\t\tlet skills = document.createElement(\"P\");\n\t\tskills.setAttribute(\"id\", \"studSkills\");\n\t\tdivContent.appendChild(skills);\n\n\t\t//add content to parent div\n\t\tdiv.appendChild(divContent);\n\t\t//add popup to container\n\t\tlet parent = el(\"container\");\n \tparent.appendChild(div);\n\n\t}", "title": "" }, { "docid": "40c45940ef7f603b40296a1289b68a19", "score": "0.76927334", "text": "function popup(file, title, menubar, toolbar, status, sb, width, height)\n{\n\tvar mywindow;\n\tmywindow = window.open(file, title, '\"menubar = ' + menubar + ', toolbar = ' + toolbar + ', status = ' + status + ', scrollbars = ' + sb + ', width = ' + width + ', height = ' + height + '\"');\n}", "title": "" }, { "docid": "182c8484a5da01ead640995eb91ad28d", "score": "0.7649477", "text": "function create_new_popup() {\n var id = find_empty_id();\n build_annotation_window(null, \"uniqueID\" + id);\n }", "title": "" }, { "docid": "d794d768d1a932e7daeeb0627b33d62b", "score": "0.76192915", "text": "function popup(content) {\n var winTop = screen.height / 2 - 250;\n var winLeft = screen.width / 2 - 250;\n window.open(\n content,\n \"_blank\",\n \"width=500,height=500,top=\" + winTop + \",left=\" + winLeft\n );\n}", "title": "" }, { "docid": "ce8cef8bf61d61e7e576a5edfd6b64dc", "score": "0.7584626", "text": "function popupWindow(addr,popname,w,h,features) {\n var winl = (screen.width-w)/2;\n var wint = (screen.height-h)/2;\n if (winl < 0) winl = 0;\n if (wint < 0) wint = 0;\n var settings = 'height=' + h + ',';\n settings += 'width=' + w + ',';\n settings += 'top=' + wint + ',';\n settings += 'left=' + winl + ',';\n settings += features;\n win = window.open(addr,popname,settings);\n win.window.focus();\n }", "title": "" }, { "docid": "fe2a24db711379508c3d43bf92591d66", "score": "0.75487465", "text": "function makePopUpNamedWin(pic,high,wide,text,features,name) {\n var tall = high + 0 // adjust for spacing to border above and below picture\n var side = wide + 0 // adjust for spacing to border on sides of picture\n describeIt = text\n picture = pic\n winFeatures = features\nif (popUpWin && !popUpWin.closed) {\n popUpWin.close();\n }\n popUpWin = eval(\"window.open('\"+picture+\"','\"+name+\"','\"+chrome[winFeatures]+\",height=\"+tall+\",width=\"+side+\",screenX=\"+(screen.availWidth/2-side/2)+\",screenY=\"+(screen.availHeight/2-tall/2)+\"')\");\n if (!popUpWin.opener) popUpWin.opener = self;\n}", "title": "" }, { "docid": "07651bd862c52c3c6427417db8be0e06", "score": "0.7545407", "text": "function popupWindow ( uri ) {\n winref = window.open ( uri,\"\",toolbar=0,directories=0,status=0,menubar=0,resizable=1 );\n}", "title": "" }, { "docid": "0e6ec76d269b67a65ac9bc9b9a05e25f", "score": "0.74500877", "text": "function popup(url,x,y)\r\n{\r\n\tnewWindow = window.open(url,\"\",\"width=\"+x+\",height=\"+y+\",left=20,top=20,bgcolor=white,resizable,scrollbars,menubar\");\r\n\tif ( newWindow != null )\r\n\t{\r\n\t\tnewWindow.focus();\r\n\t}\r\n}", "title": "" }, { "docid": "f335aabe62f3adc011b9ee41e43479c0", "score": "0.742416", "text": "function popitupObj(url)\n\t{\n\t\tnewwindow=window.open(url, \"object_creator/ObjectCreation.html\", \"status = 1, scrollbars =1, height = 600, width = 900\");\n\t\tif(window.focus){\n\t\t\tnewwindow.focus()\n\t\t}\n\t\treturn false;\n\t}", "title": "" }, { "docid": "b1afeeb5d8568bab76a551bde1213fd0", "score": "0.7422178", "text": "static popupWindow(url, opts) {\n const defaults = {\n center: 'screen', // true, screen || parent || undefined, null, \"\", false\n createNew: true,\n height: 500,\n left: 0,\n location: false,\n menubar: false,\n name: null,\n onUnload: null,\n resizable: false,\n scrollbars: false, // os x always adds scrollbars\n status: false,\n toolbar: false,\n top: 0,\n width: 500,\n };\n\n const options = $.extend({}, defaults, opts);\n\n // center the window\n if (options.center === 'parent') {\n options.top = window.screenY + Math.round(($(window).height() - options.height) / 2);\n options.left = window.screenX + Math.round(($(window).width() - options.width) / 2);\n } else if (options.center === true || options.center === 'screen') {\n const screenLeft = (typeof window.screenLeft !== 'undefined') ? window.screenLeft : screen.left;\n\n options.top = ((screen.height - options.height) / 2) - 50;\n options.left = screenLeft + ((screen.width - options.width) / 2);\n }\n\n // params\n const params = [];\n params.push(`location=${options.location ? 'yes' : 'no'}`);\n params.push(`menubar=${options.menubar ? 'yes' : 'no'}`);\n params.push(`toolbar=${options.toolbar ? 'yes' : 'no'}`);\n params.push(`scrollbars=${options.scrollbars ? 'yes' : 'no'}`);\n params.push(`status=${options.status ? 'yes' : 'no'}`);\n params.push(`resizable=${options.resizable ? 'yes' : 'no'}`);\n params.push(`height=${options.height}`);\n params.push(`width=${options.width}`);\n params.push(`left=${options.left}`);\n params.push(`top=${options.top}`);\n\n // open window\n const random = new Date().getTime();\n const name = options.name || (options.createNew ? `popup_window_${random}` : 'popup_window');\n const win = window.open(url, name, params.join(','));\n\n // unload handler\n if (options.onUnload && typeof options.onUnload === 'function') {\n const unloadInterval = setInterval(function () {\n if (!win || win.closed) {\n clearInterval(unloadInterval);\n options.onUnload();\n }\n }, 50);\n }\n\n // focus window\n if (win && win.focus) {\n win.focus();\n }\n\n // return handle to window\n return win;\n }", "title": "" }, { "docid": "ff9d82e51e7f1bac8f98069b76957d60", "score": "0.73366195", "text": "openwindow(href) {\n this.popup=window.open(href, 'newwindow', 'width=720, height=480');\n return false;\n }", "title": "" }, { "docid": "6d356ee4e5e00ab2ca27b0cc5d207c86", "score": "0.73187065", "text": "function popupWindow(sys_host, sys_dir, page){\r\n\twindow.open('http://'+sys_host+'/'+sys_dir+'/'+page,\r\n\t\t'popup',\r\n\t\t'width=400, height=300, scrollbars=yes, resizable=no, toolbar=no, directories=no, location=no, menubar=no, status=no, left=400, top=300');\r\n}", "title": "" }, { "docid": "6fe9beefb66cc5698b89b7bb7247f127", "score": "0.7294235", "text": "function popWin(url) {\n closePopup();\n curPopupWindow = window.open(url,\"win\",\"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=550,height=300\",false);\n}", "title": "" }, { "docid": "d9bd3eeb1830af858b028a4d5d87685a", "score": "0.7291545", "text": "function openPopupWindow (location) {\n window.open (location, \"_blank\",\n \"status=1,toolbar=0, location=0, menubar=0,directories=0,resizeable=0, width=700, height=350\");\n }", "title": "" }, { "docid": "3c0adc5d1f50b57a4f14028f6803fba0", "score": "0.7288079", "text": "openwindow(href) {\n this.popup=window.open(href, 'newwindow', 'width=640, height=480');\n return false;\n }", "title": "" }, { "docid": "8f1c342c8c5795ce0c7ac4e22697d21f", "score": "0.72690624", "text": "function windowPopup(url, width, height) {\n // Calculate the position of the popup\n // so it's centered\n var left = screen.left / 2 - width / 2,\n top = screen.top / 2 - height / 2;\n\n window.open(\n url,\n '',\n 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,width=' +\n width +\n ',height=' +\n height +\n ',top=' +\n top +\n ',left=' +\n left\n );\n }", "title": "" }, { "docid": "700b72430ba8c92ccf7d567a6236c897", "score": "0.72575945", "text": "function popup(clases, innerText) {\n clases = (clases === undefined || typeof clases === 'undefined') ? \"\" : clases;\n innerText = (innerText === undefined || typeof innerText === 'undefined') ? \"\" : innerText;\n var popup = $('<div />', {\n \"class\": 'popup ' + clases.popup,\n }); \n \n var content = $('<div />', {\n \"class\": 'popoupContent ' + clases.content,\n }); \n \n var text = $('<div />', {\n \"class\": 'contentText ' ,\n text: innerText.content\n }); \n \n var topWidow = $('<div />', {\n \"class\": 'topWidow ' + clases.topWidow,\n text: innerText.title\n });\n \n var closeWindow = $('<img />', {\n \"class\": 'colseWindow',\n \"src\" : \"./images/closeWhite.png\",\n click: function(e){\n e.preventDefault();\n darkenUndarkeWindow();\n popup.remove();\n }\n });\n topWidow.append(closeWindow);\n content.append(text);\n popup.append(content);\n popup.append(topWidow);\n return popup;\n \n}", "title": "" }, { "docid": "fea471b07b05e9b7156581bc05b06d58", "score": "0.7224564", "text": "function pop_tpSixPHP()\n { \n\t\t window.open(\"PHP/cours6php/index.html\", 'Popup', 'scrollbars=1, Menubar=1, resizable=1, height=510, width= 808 , top=125, left=227, toolbar=1 '); return false; \n\t\t}", "title": "" }, { "docid": "eacc0c175939d962e6a01bcd6a60eb25", "score": "0.7218886", "text": "function openPopup(url, name, details)\n{\n\tnewWin=window.open(url, name, details);\n\tnewWin.focus();\n}", "title": "" }, { "docid": "aa2031d4362bc91f0d6a5e3344b15613", "score": "0.7203413", "text": "function popUpWindow(link){\n\twindow.open(link,'1458831327973',\n\t'width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0');\n\treturn false;\n}", "title": "" }, { "docid": "78e3469dbe9dc3273a24d0b84b1a7e1b", "score": "0.7185775", "text": "function popup_window(){\n var w = window.open('', '', 'width=400,height=400,resizeable,scrollbars');\n //w.document.write(content);\n w.window.location.href = \"/static/blank.html\"\n w.document.close(); // needed for chrome and safari\n return w\n}", "title": "" }, { "docid": "ad3de2e65792c281d0fa2db038ed8679", "score": "0.7168152", "text": "function popup(url) {\n\n\tLeftWindowPosition = ((document.all)?window.screenLeft:window.screenX)+50;\n\n\tTopWindowPosition = ((document.all)?window.screenTop:window.screenY)+5;\n\n\tnewwindow=window.open(url,'','width='+ w + ', height=' + h + ',left=' + LeftWindowPosition + ',top=' + TopWindowPosition + ',scrollbars=yes,resizable=yes,toolbar=no,menubar=no');\n\n\tif (window.focus) {newwindow.focus()}\n\n\treturn false;\n\n}", "title": "" }, { "docid": "eebfd94fe52cb79c9c2fafbed2e4e580", "score": "0.71612865", "text": "function createPopup() {\n $('#filePopup').dialog({\n\tminWidth: 350,\n\tminHeight: 150,\n height: 200,\n modal: true,\n\tbuttons: { \n\t Ok: function() {\n\t $(this).dialog(\"destroy\");\n\t }\n\t},\n });\n}", "title": "" }, { "docid": "3e85e98a1db2b5b54b8338d310e56586", "score": "0.71573156", "text": "function statuspopup() {\n window.newwindow = openWindow('/activities/select','status', 600, 400)\n}", "title": "" }, { "docid": "452869cfb958a4ceb68402580dec7e44", "score": "0.71323866", "text": "function openPopWindow(url, width, height) {\n var newWin = \"\";\n var popFeatures = \"width=\" + width + \",height=\" + height + \",toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=1,resizable=1\";\n newWin = window.open(url,'newWin',popFeatures);\n newWin.focus();\n}", "title": "" }, { "docid": "bb08dfe4e130690dc1e3dcf38e51f3a1", "score": "0.7126088", "text": "function fcCreateWindow(height, width, opts, footerYn, size, callback) {\r\n \t$('#popup').append(\"<div style='border-radius:10px;border: 2px solid red;' id='window\"+popIndex+\"'><div style='overflow:hidden;' id='windowTitle\"+popIndex+\"'></div><div id='windowContent\"+popIndex+\"'></div></div>\");\r\n\t$(\"#window\"+popIndex).jqxWindow({\r\n\t maxHeight: height,\r\n\t\tmaxWidth: width,\r\n\t height: height,\r\n\t width: width,\r\n draggable: false, /* drag 안됨 */\r\n resizable: false, /* resize 안됨 */\r\n isModal: true, /* modal 팝업 여부 */\r\n modalOpacity: 0.3, /* modal 팝업 배경색 투명도 */\r\n\t initContent: function () {\t\r\n\t \tif(popTitle){\r\n\t \t\t$(\"#window\"+popIndex).jqxWindow(\"setTitle\", popTitle);\r\n\t \t}else{\r\n\t \t\t$(\"#windowTitle\"+popIndex).remove();\r\n\t \t\t$(\"#windowContent\"+popIndex).css('height', '');\r\n\t \t}\r\n\t \t \t\r\n $(\"#window\"+popIndex).jqxWindow().on('close', function (event) {\t \r\n $(\"#\" + event.target.id).remove();\r\n }); \r\n \tinitPopupContent(popIndex, opts, footerYn, size, callback); \r\n\t }\r\n\t});\t\t\r\n}", "title": "" }, { "docid": "2bc84ba68fd2e22f013968c56d12a98d", "score": "0.7124056", "text": "function popup(obj){\n\tvar _tempDiv = xdom.createElement(\"div\");\n\tobj.actions = null;\n\tobj.el = _tempDiv;\n\tmodal(obj, \"popup\", function(){\n\t\tobj._c._id_modal = xutil.generateId();\n\t\tmsg(obj);\n\t\tX$._update();\n\t\tthisX.closeLoading();\n\t}, false);\n}", "title": "" }, { "docid": "d1fa298bb2543ffd92d2a1042d2f28ca", "score": "0.71210945", "text": "function showPopup() {\r\n var popup = window.open(this.href, \"popup\", \"status=1,toolbar=1,location=1,menubar=1,scrollbars=1,resizable=1\");\r\n return false;\r\n}", "title": "" }, { "docid": "bdc574e13e9b01cbb7987120895bdac7", "score": "0.7118565", "text": "function mostrarPopup(url, nombre) {\n if(ventanaReporte){\n ventanaReporte.close();\n }\n ventanaReporte=window.open(url,\"_bank\", \"height=550,width=800,location=0,toolbar=0,menubar=0,directories=0,resizable=yes\");\n if (window.focus) {\n ventanaReporte.focus();\n }\n return false;\n}", "title": "" }, { "docid": "6980d5d63f6c1ab25ec9dc36d3b8e2ab", "score": "0.71093106", "text": "function showPop(url, nameAssoc, awidth, aheight) { \n var d = nameAssoc || \"Helper Window\";\n var height = aheight || 450;\n var width = awidth || 550;\n\n var h = window.open(url, d, \"height=\" + height + \", width=\" + width);\n if (window.focus) {\n h.focus();\t\n }\n}", "title": "" }, { "docid": "c17331f5f9583ea7c7601e5b02e10501", "score": "0.7085648", "text": "function windowPopup(url, width, height) {\n // Calculate the position of the popup so\n // itís centered on the screen.\n var left = (screen.width / 2) - (width / 2),\n top = (screen.height / 2) - (height / 2);\n\n window.open(\n url,\n \"\",\n \"menubar=no,toolbar=no,resizable=yes,scrollbars=yes,width=\" + width + \",height=\" + height + \",top=\" + top + \",left=\" + left\n );\n}", "title": "" }, { "docid": "b28b4615e76650f37d86d41d581b63df", "score": "0.7084184", "text": "open() {\n var popup = this.getChildControl(\"popup\");\n\n popup.placeToWidget(this, true);\n popup.show();\n }", "title": "" }, { "docid": "51e6e75bacdfc74f9748c18bb823b384", "score": "0.7083221", "text": "function generatePopup() {\n $('<div data-role=\"popup\" id=\"mobilePopup\"><p>This is a completely basic popup, no options set.</p></div>').appendTo('body');\n }", "title": "" }, { "docid": "61f9195ee98051974ad4a738d3b2fa69", "score": "0.70724547", "text": "function showPopup(msg)\r\n\t\t{\r\n\t\t\t// create a layer on top of the panoSphere..\r\n\t\t\tvar dom = document.createElement('div');\r\n\t\t\tdom.id=\"temp_popup\";\r\n\r\n\t\t\tvar defaultHTML=`\r\n\t // <!-- popup for instructions. Button removes it. -->d\r\n\t <div class=\"panoPopUp\" >\r\n\t <p>\r\n\t How to use the program: yadda yadda yadda\r\n\t </p>\r\n\t <button type=\"button\"\r\n\t style=\"z-index: 4; height: 30px; width: 250px; float: bottom;\" id=\"i\"\r\n\t onclick=\"document.body.removeChild(this.parentNode);\"> I get it.\r\n\t </button>\r\n\t </div>`;\r\n\r\n\t\t\tdom.innerHTML=msg+defaultHTML;\r\n\t\t\tdom.style.cssText = `\r\n\t\t\tposition: fixed;\r\n\t\t\twidth: 300px;\r\n\t\t\theight: 400px;\r\n\t\t\tpadding: 20px;\r\n\t\t\ttop: 50%;\r\n\t\t\tleft: 50%;\r\n\t\t\tmargin-top: -210px; /* Negative half of height. */\r\n\t\t\tmargin-left: -160px; /* Negative half of width. */\r\n\t\t\topacity: 0.3;\r\n\t\t\ttext-align: center;\r\n\t\t\tz-index:100;background:#fff;\r\n\t\t\t`;\r\n\t\t\tdocument.body.appendChild(dom);\r\n\t\t\tsetTimeout(removePopup.bind(this),1000);\r\n\t\t}", "title": "" }, { "docid": "9fe27c71187e426ea4f231465ed1087b", "score": "0.7068288", "text": "function new_window(url) \n{\n\n\tlink = window.open(url,\n\t'_new', 'toolbar=0,menubar=0,scrollbars=1,status=0,resizable=1,top=80,left=400px,fullscreen=0,Height=650px,Width=710px', '');\n}", "title": "" }, { "docid": "9fe27c71187e426ea4f231465ed1087b", "score": "0.7068288", "text": "function new_window(url) \n{\n\n\tlink = window.open(url,\n\t'_new', 'toolbar=0,menubar=0,scrollbars=1,status=0,resizable=1,top=80,left=400px,fullscreen=0,Height=650px,Width=710px', '');\n}", "title": "" }, { "docid": "bec67800c161a08ebed7763aaf0eb20d", "score": "0.70664746", "text": "function loadPopup(URL, type, w, h)\r\n{\r\n w = w ? w : 600;\r\n h = h ? h : 500;\r\n LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;\r\n TopPosition = (screen.height) ? (screen.height-h)/2 : 0;\r\n \r\n if (type == \"window\")\r\n {\r\n //var win = new Window({className: \"spread\", title: \"\", width:w, height:h, url: URL, showEffectOptions: {duration:1.5}});\r\n var win = new Window({width:w, height:h, url: URL});\r\n win.setDestroyOnClose();\r\n win.showCenter();\r\n }\r\n else if (type == \"dialog\")\r\n {\r\n Dialog.info({url: URL, options: {method: 'post'}}, {className: \"dialog\", width:w, height:h, closable:true, resizable:true, draggable:true});\r\n }\r\n else\r\n {\r\n settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=0,resizable=1,status=0';\r\n // open a window with name as form_popup and submit form to this new popup as target\r\n window.open (URL, \"\", settings);\r\n }\r\n}", "title": "" }, { "docid": "302670d1c168d8c7497d0b440571e8b0", "score": "0.70570195", "text": "createWindow() {\n const url = this.createUrl();\n /**\n * Bogus title to prevent re-usage of existing window with the\n * same title. The actual title will be set by the new window's\n * GoldenLayout instance if it detects that it is in subWindowMode\n */\n const target = Math.floor(Math.random() * 1000000).toString(36);\n /**\n * The options as used in the window.open string\n */\n const features = this.serializeWindowFeatures({\n width: this._initialWindowSize.width,\n height: this._initialWindowSize.height,\n innerWidth: this._initialWindowSize.width,\n innerHeight: this._initialWindowSize.height,\n menubar: 'no',\n toolbar: 'no',\n location: 'no',\n personalbar: 'no',\n resizable: 'yes',\n scrollbars: 'no',\n status: 'no'\n });\n this._popoutWindow = globalThis.open(url, target, features);\n if (!this._popoutWindow) {\n if (this._layoutManager.layoutConfig.settings.blockedPopoutsThrowError === true) {\n const error = new external_error_1.PopoutBlockedError('Popout blocked');\n throw error;\n }\n else {\n return;\n }\n }\n this._popoutWindow.addEventListener('load', () => this.positionWindow(), { passive: true });\n this._popoutWindow.addEventListener('beforeunload', () => {\n if (this._layoutManager.layoutConfig.settings.popInOnClose) {\n this.popIn();\n }\n else {\n this._onClose();\n }\n }, { passive: true });\n /**\n * Polling the childwindow to find out if GoldenLayout has been initialised\n * doesn't seem optimal, but the alternatives - adding a callback to the parent\n * window or raising an event on the window object - both would introduce knowledge\n * about the parent to the child window which we'd rather avoid\n */\n this._checkReadyInterval = setInterval(() => this.checkReady(), 10);\n }", "title": "" }, { "docid": "578137240f83b4b5c8ca4292d5ba91a5", "score": "0.7046445", "text": "function popupwin(url, name, width, height, options){\r\n\tif(isIE){\r\n\t var win = window.showModelessDialog(url, window ,\"status:false;dialogWidth:\"+(width)+\"px;dialogHeight:\"+(height+30)+\"px;edge:Raised; help: 0; resizable: 0; status: 0;scroll:0;\");\r\n\t}\r\n\telse{\r\n\t\txposition=0; yposition=0;\r\n\t\tif ((parseInt(navigator.appVersion) >= 4 )){\r\n\t\t\txposition = (screen.width - width) / 2;\r\n\t\t\typosition = (screen.height - height) / 2;\r\n\t\t}\r\n\t\ttheproperty= \"width=\" + width + \",\" \r\n\t\t + \"height=\" + height + \",\" \r\n\t\t + \"screenx=\" + xposition + \",\"\r\n\t + \"screeny=\" + yposition + \",\"\r\n\t + \"left=\" + xposition + \",\"\r\n\t + \"top=\" + yposition + \",\" + options \t\r\n\t\tvar win = window.open(url,name,theproperty);\r\n\t\twin.focus();\r\n\t}\r\n\treturn false;\r\n}", "title": "" }, { "docid": "23c4c58d3d6fdc74893ee6fc57e20866", "score": "0.70380765", "text": "function popitup(url) {\r\n // Opens a new browser window called newwindow. url specifies the URL of the page to open.\r\n newwindow=window.open(url,'name','height=300,width=350',\"_parent\");\r\n // Sets focus to the new window if the focus is on the previous page.\r\n if (window.focus) {\r\n newwindow.focus()\r\n }\r\n return false;\r\n}", "title": "" }, { "docid": "f15302cc4020fa3ae851c5d5eb2f63e1", "score": "0.70272726", "text": "function createNewWindow(wndw,url,width,height)\n{\n\tvar attrib = \"scrollbars=yes,resizable=yes,width=\" + width + \",height=\" + height;\n\tvar viewWindow = window.open(url,wndw,attrib);\n\tviewWindow.focus();\n\treturn viewWindow;\n}", "title": "" }, { "docid": "05be902de381854b301c71c9958d6420", "score": "0.7026098", "text": "function popup(URL)\n{\n\tday = new Date();\n\tid = day.getTime();\n\teval(\"page\" + id + \" = window.open(URL, '\" + id + \"', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=580,height=600,left=20,top=20');\");\n}", "title": "" }, { "docid": "dc7f1f6ce45e743b492fd75bd1d2e0d0", "score": "0.7025181", "text": "function popUpPage(popupPage,wName,vars) {\n \n // Set the window name and remove all dashes\n winName=(((wName!=null) && (wName!='')) ? wName : \"newWindow\");\n winName=winName.replace(\"-\",\"\");\n \n // If the page is a full url address then just use it.\n if (popupPage.match('^http') || popupPage.match('^ftp:') || popupPage.match('^file:')) theURL=popupPage;\n else if (popupPage==\"glossary\") theURL=workDir + \"/\" + courseDir + \"/\" + glossaryFile;\n else if (popupPage==\"partfile\") theURL=workDir + \"/\" + courseDir + \"/\" + partsFile;\n else if (popupPage==\"index\") theURL=workDir + \"/\" + indexFile;\n else theURL=workDir + \"/\" + popupPage;\n\n // Add the topicSet dir into the path if needed. \n if (theURL.indexOf(\"{$topicSetDir}\")) theURL=theURL.replace(\"{$topicSetDir}\",courseDir);\n \n // Open the pupup window\n newWin=open(theURL,winName,vars);\n \n // Make sure the new window has focus.\n newWin.focus();\n\n // If this is an assessment windows being popped up then return the window. \n if (wName==\"assessWin_\" + courseId) return newWin;\n \n }", "title": "" }, { "docid": "f77bf786cc171a8c88ff666132ff0a5d", "score": "0.7023427", "text": "function popUp(url, target, width, height, pos_x, pos_y) {\n if (typeof pos_x ==\"undefined\") { pos_x = \"center\"; }\n if (typeof pos_y ==\"undefined\") { pos_y = \"middle\"; }\n\n var x;\n var y;\n\n // get x pos\n switch (pos_x) {\n case \"left\":\n x = 0;\n break;\n case \"right\":\n x = screen.width - width;\n break;\n default: //center\n x = screen.width/2 - width/2;\n break;\n }\n\n // get y pos\n switch (pos_y) {\n case \"top\":\n y = 0;\n break;\n case \"bottom\":\n y = screen.height - height;\n break;\n default: //middle\n y = screen.height/2 - height/2;\n break;\n }\n\n window.open(url, target, 'width='+width+',height='+height+',left='+x+',top='+y+',screenX='+x+',screenY='+y+',scrollbars=YES,location=YES,status=YES');\n}", "title": "" }, { "docid": "7a96b70bd4bfe8b09d9d2b771156f7a0", "score": "0.70233065", "text": "function displayPopup() {\n\n // Create popup\n var popup = document.createElement('div');\n popup.setAttribute('id', 'CCPAPopup');\n\n // Create popup body\n var popupBody = document.createElement('div');\n popupBody.setAttribute('id', 'CCPABody');\n popupBody.innerHTML = '<b>This website sells your personal information. Opt out below.</b></br>';\n popup.appendChild(popupBody);\n\n // Create 'X' button\n var close = document.createElement('span');\n close.innerHTML = 'x';\n close.setAttribute('id', 'CCPAClose');\n popup.appendChild(close);\n\n // Create more info link\n var moreInfo = document.createElement('a');\n moreInfo.setAttribute('id', 'CCPAMoreInfo');\n moreInfo.setAttribute('href', browser.runtime.getManifest().homepage_url);\n moreInfo.setAttribute('target', '_blank');\n moreInfo.innerHTML = 'More Info';\n popupBody.appendChild(moreInfo);\n\n // Create button\n var button = document.createElement('button');\n button.setAttribute('id', 'CCPAButton');\n button.innerHTML = \"Don't Sell My Personal Information\";\n popup.appendChild(button);\n\n // Add popup to document\n document.getElementsByTagName('BODY')[0].appendChild(popup);\n}", "title": "" }, { "docid": "2ebe0f7ad4ed33d18613003337924ed2", "score": "0.7013686", "text": "function OpenPopupWindow() { \n var url = \"../add_daily_task.php\"; \n let myRef = window.open(url, 'mywin', 'left=20, top=20, width=770, height=700, toolbar=1, resizable=0');\n myRef.focus();\n}", "title": "" }, { "docid": "efbc1828ca6a783cd77bbcd93ad358b5", "score": "0.70085025", "text": "function popWin2(url) {\n win = window.open(url,\"win\",\"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=720,height=500\",false);\n}", "title": "" }, { "docid": "0da27859ea9501c80596c9d47edfc793", "score": "0.7007503", "text": "function GlossaryPopUp(url){\r\n\r\nvar winWidth\r\nvar winHeight\r\n\r\nwinHeight = parseInt(450);\r\nwinWidth = parseInt(680);\r\n\r\nwindow.open(url, null,' menu=0,menubar=0,toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=1,copyhistory=0,top=120,left=115,width=' + winWidth + ',height=' + winHeight);\r\n \r\n}", "title": "" }, { "docid": "00a412c2dedb4c5fb5ba23ade166a2b2", "score": "0.7004208", "text": "function nouvelleFenetre(url) { \n propriete = \"top=0,left=0,resizable=yes, status=no, directories=no, addressbar=no, toolbar=no, scrollbars=yes, menubar=no, location=no, statusbar=no\"; \n propriete += \",width=\" + screen.availWidth*0.75 + \",height=\" + screen.availHeight*0.75; \n win = window.open(\"index.php/\"+url,'popup', propriete);\n}", "title": "" }, { "docid": "6db575382e43fabec482651144126dee", "score": "0.69899595", "text": "function openPopupWindow(id, img, title, content, additionalClass)\n{\n if ($(\"#popupBox\").length === 0)\n {\n $(\"body\").append($(\"<div>\", { id: \"popupBox\" }));\n }\n\n //do not open a popup if one already exists\n if ($(\".popupContainer\").length === 0)\n {\n $(\"body\").append($(\"<div>\", { class: \"dimScreen\", id: \"dim_\" + id }).click(function ()\n {\n removePopupWindow(id);\n }));\n\n var popup =\n $(\"<div>\", { class: \"popupContainer\", id: id }).append(\n $(\"<div>\", { class: \"popupTop\" }).append(\n $(\"<div>\", { class: \"popupImg\" }).append(\n $(\"<img>\", { src: img })\n )\n ).append(\n $(\"<div>\", { class: \"popupTitle\" }).append(title)\n )\n ).append(\n $(\"<div>\", { class: \"popupBottom\" }).append(content)\n );\n\n if (additionalClass)\n popup.addClass(additionalClass);\n\n $(\"#popupBox\").append(popup);\n\n $(\"#dim_\" + id).fadeIn(300, function ()\n {\n $(\"#\" + id).show();\n });\n }\n}", "title": "" }, { "docid": "b7a4cbe764b18139c025b8e2fe9604a5", "score": "0.6984642", "text": "function popupPasta(url) {\r\n window.open(url,'pasta','width=282,height=204,scrollbars=no');\r\n}", "title": "" }, { "docid": "a4b6a3e24f6956bbfac85adea48e0faf", "score": "0.6981435", "text": "function OpenPopupManageSingleMail()\n{// the following instruction opens a child browser-window.\n\t// window.open(); new Browser\n\twindow.open( // Popup\n\t\t'ManageSingleMail.aspx', //path,\n\t\t'ManageSingleMailPopup',\t//idpopup,\n\t\t'width=550, height=550,scrollbars=yes,left=50,top=50'\n\t);\n}//", "title": "" }, { "docid": "81d306a7bf6fe18fbf639a7de9fee75e", "score": "0.69687146", "text": "function startPopUp(desktopURL, w, h) {\n mb_utils.launch_sized_popup_window(desktopURL, w, h, \"none\");\n}", "title": "" }, { "docid": "67267de3ee8d11b0a3b21538facbabb9", "score": "0.69634855", "text": "function createDialog(args) {\r\n el.wrap('<div class=\"' + el_classBody + '\"></div>');\r\n var window = '<p class=\"' + el_classTitle + '\">' + el.attr('title') + '<span class=\"' + el_classClose + '\" onclick=\"$(document).bsdialog({close: true})\">x</span></p>';\r\n window += '<div class=\"' + el_classContent + '\">';\r\n window += args;\r\n window += '</div>';\r\n window += '<div class=\"'+el_classFooter+'\">';\r\n window += defineButtons();\r\n window += '</div>';\r\n el.html(window);\r\n $(\".bs-dialog-body\").height($(document).height());\r\n positionDialog();\r\n el.draggable();\r\n\r\n console.log(window);\r\n }", "title": "" }, { "docid": "1eb50eaffa80f9166f4fc5833934463f", "score": "0.6951122", "text": "function setup_window()\r\n{\r\n\t\tsetupWindow = window.open(\"ParaTrackerDynamic.php\", \"ParaTrackerSetupWindow\" ,\"width=1100,height=800\");\r\n}", "title": "" }, { "docid": "c453f7144bdf0893639725f09b07875c", "score": "0.6948334", "text": "function EkTbWebMenuPopUpWindow (url, hWind, nWidth, nHeight, nScroll, nResize) {\n url = url.replace(/&amp;amp;/g,\"&\").replace(/&amp;/g,\"&\");\n\tif (nWidth > screen.width) {\n\t\tnWidth = screen.width;\n\t}\n\tif (nHeight > screen.height) {\n\t\tnHeight = screen.height;\n\t}\n\tvar cToolBar = 'toolbar=0,location=0,directories=0,status=' + nResize + ',menubar=0,scrollbars=' + nScroll + ',resizable=' + nResize + ',width=' + nWidth + ',height=' + nHeight;\n\tvar popupwin = window.open(url, hWind, cToolBar);\n\treturn popupwin;\n}", "title": "" }, { "docid": "7181298fa45e82d87b0d7427b9dac65f", "score": "0.6947073", "text": "function showPopUp(){\n\tapp.getView().render('test/popup');\n}", "title": "" }, { "docid": "782af0721f37088ea64d7e6a8e420828", "score": "0.69320685", "text": "function submitPopup(url,w,h){\n var left = (screen.width/2)-(w/2);\n var top = (screen.height/4)-(h/4);\n newwindow = window.open (url, 'title', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);\n if (window.focus) {newwindow.focus()}\n return false;\n }", "title": "" }, { "docid": "2aff9f1f21384b66fa09cd7dac1cd12c", "score": "0.69136393", "text": "function openWin() {\r\n myWindow = window.open( myWindow, width=400, height=200);\r\n\r\n}", "title": "" }, { "docid": "264b35fefe4afc6a27d449a1818e538c", "score": "0.69113684", "text": "function popUpInfo() {\n // creating a div element for the pop up box\n var popUp = document.createElement('div');\n\n // creating a class for the div element\n popup.className = 'popUp';\n\n // creating a id for the div element\n popUp.id = 'test';\n\n var cancel = document.createElement('div');\n cancel.className = 'cancel';\n\n // this makes the popup dissapear on click\n cancel.onclick = function (e) { popup.parentNode.removeChild(popup) };\n\n var message = document.createElement('span');\n message.innerHTML = \"This is a test message\";\n popup.appendChild(message); \n popup.appendChild(cancel);\n document.body.appendChild(popup);\n\n }", "title": "" }, { "docid": "f0255565bb9e2f3ea6733f0ab361c994", "score": "0.6897793", "text": "function openwindow(id,url)\n{\n var left = (screen.width/2)-(700/2);\n var top = (screen.height/2)-(490/2);\n var width=(screen.width/2)*1.2;\n var height=(screen.height/2);\n var str=\"height=\"+height+\",scrollbars=yes,width=\"+width+\",status=yes,\";\n str+=\"toolbar=no,menubar=no,location=no,resizable=false,left=\"+left+\",top=\"+top+\"\";\n window.open(url,\"popup\",str);\n \n}", "title": "" }, { "docid": "8d8a3d86602ea4b88bf2a0dbdea1df52", "score": "0.68962926", "text": "function CreateWindow() {\n h = createDomElement({name: \"div\"});\n h.innerHTML = projectObject;\n new Compressed_layout(\"window_body_left_bottom\", \"container\", h).init();\n}", "title": "" }, { "docid": "dcd97019b5328c080b7ee97490e1e4e0", "score": "0.6883889", "text": "function CApopupbox(url, name, w, h, scroll, no, yes) {\n \n\tif(arguments.length == 7) {\n var z = window.open(url, name, 'width='+ w + ',' + 'height='+ h + ',' + 'location='+ no + ',' + 'scrollbars=' + scroll + ',' + 'status='+ no + ',' + 'directories='+ no + ',' + 'menubar='+ no + ',' + 'resizable='+ yes + ',' + 'screenX=Window.screenX' + ',' + 'left=screenX' + ',' + 'screenY=Window.screenY' + ',' + 'top=Window.screenY');\n \tz.focus();\n\t} else if(arguments.length == 8) {\n\t\t if(arguments[7] == 'center') {\n var a = \"toolbar=\" + no + \",location=0,directories=0,status=0,menubar=\" + no + \",scrollbars=\" + scroll;\n var b = \",resizable=\"+yes;\n var c = \",width=\"+w+\",height=\"+h;\n var windowW = w;\n var windowH = h;\n var windowX = (screen.width) ? (screen.width-w)/2 : 0;\n var windowY = (screen.height) ? (screen.height-h)/2 : 0;\n var d = ',screenX='+windowX+',' + 'left='+windowX+',' + 'screenY='+windowY+ ',' + 'top='+windowY;\n\t\t\t\tvar ops = a+b+c+d;\n var splashWin = window.open(url, name, \"\"+ops+\"\");\n splashWin.focus();\n }\n\t\n\t\n\t}\t\t \n\n\n\t \n}", "title": "" }, { "docid": "1e3cfc4028e8277f5a90b86e9cd24315", "score": "0.68783635", "text": "function inform() {\n $(\"#popupBasic\").popup(\"open\");\n}", "title": "" }, { "docid": "ca9f198cf0413427468a68a64d08f741", "score": "0.68752044", "text": "function make_popup_dialog(title){\n const dialog = document.createElement('div');\n dialog.classList.add('popup', 'popup-dialog');\n\n // add a close button\n const close_container = document.createElement('div');\n close_container.classList.add('popup-close');\n\n const close_button = document.createElement('a');\n close_button.textContent = '×';\n close_button.addEventListener('click', () => dialog.remove());\n\n close_container.appendChild(close_button);\n dialog.appendChild(close_container);\n\n // add a title\n if (title !== undefined){\n const header = document.createElement('h1');\n header.classList.add('dialog-title');\n header.textContent = title;\n\n dialog.appendChild(header);\n }\n\n return dialog;\n }", "title": "" }, { "docid": "4b745710c5c87de404aecf610df863e9", "score": "0.6873043", "text": "function popUpPic(sPicURL) { \n\t\t\twindow.open( \"popup.htm?\"+sPicURL, \"\", \"resizable=1,HEIGHT=200,WIDTH=200\"); \n\t\t}", "title": "" }, { "docid": "263b952966f6eb83388e4540379826d1", "score": "0.68599844", "text": "function popitupHelp(url)\n\t{\n\t\tnewwindow = window.open(url, \"height = 500, width = 500\");\n\t\tif(window.focus){\n\t\t\tnewwindow.focus()\n\t\t}\n\t\treturn false;\n\t}", "title": "" }, { "docid": "4e73ba194baf1bae16b510ec116ad7e5", "score": "0.6854101", "text": "function OpenPopupCMSPopup(FullUrl, SectionNameWithoutSpace) {\r\n \r\n //width, height, top, left, directories, location, resizable, menubar, toolbar, scrollbars, status\r\n var newwindow = window.open(FullUrl, SectionNameWithoutSpace, 'height=600,width=700,status=no,toolbar=no,location=no,menubar=no,titlebar=no,scrollbars=yes');\r\n if (window.focus) { newwindow.focus() }\r\n return false;\r\n}", "title": "" }, { "docid": "528c91c476a890f2a8298a36189292f5", "score": "0.68464124", "text": "function createWindow(cUrl,cName,cFeatures) {\r\n\tvar xWin = window.open(cUrl,cName,cFeatures);\r\n\txWin.focus();\r\n}", "title": "" }, { "docid": "ea7e591824c6afb851e87cf08cec2026", "score": "0.68414164", "text": "function showPopup(options) {\n let dialog = new Popup(options);\n dialog.launch();\n return dialog;\n}", "title": "" }, { "docid": "e34db7c9bb1aceea14ee12eaf7400f7c", "score": "0.6834626", "text": "function popupWindow(url)\r\n{\r\n\t//alert('inside js');\r\n\tsomewin = window.open(url,'myWindow','status=no,maximize=no,width=700,height=500,resizable=yes,scrollbars=yes');\r\n\tsomewin.focus();\r\n\tsomewin.setActive();\r\n}", "title": "" }, { "docid": "7110b99d996c1109f9007cd01f2445d8", "score": "0.68337953", "text": "function createPopup(){\n\t\t\tvar popup = $(document.createElement('div'));\n\t\t\tvar closingSpan = $(document.createElement('span'));\n\t\t\tvar container = $(document.createElement('div'));\n\t\t\tvar content = _content;\n\t\t\tif (!settingsObj) {\n\t\t\t\tsettings = defSettings;\n\t\t\t\tpopup.attr('data-animfrom', 'center');\n\t\t\t} else {\n\t\t\t\tif (settingsObj.hasOwnProperty('width')) {\n\t\t\t\t\tsettings.width = settingsObj.width\n\t\t\t\t} else {\n\t\t\t\t\tsettings.width = defSettings.width\n\t\t\t\t}\n\t\t\t\tif (settingsObj.hasOwnProperty('height')) {\n\t\t\t\t\tsettings.height = settingsObj.height\n\t\t\t\t} else {\n\t\t\t\t\tsettings.height = defSettings.height\n\t\t\t\t}\n\t\t\t\tif (settingsObj.hasOwnProperty('animationFrom') && (settingsObj.animationFrom === 'center' || settingsObj.animationFrom === 'click')) {\n\t\t\t\t\tpopup.attr('data-animfrom', settingsObj.animationFrom);\n\t\t\t\t} \n\t\t\t}\n\t\t\tpopup.addClass('ak-popup'+$(\"*[class*='ak-popup']\").length);\n\t\t\tpopup.css({\n\t\t\t\t'z-index':99,\n\t\t\t\t'width':settings.width,\n\t\t\t\t'height':settings.height+10,\n\t\t\t\t'backgroundColor' : 'gray',\n\t\t\t\t'position' : 'absolute',\n\t\t\t\t'display':'none'\n\t\t\t});\n\t\t\tif (content.width()>settings.width){\n\t\t\t\tpopup.css('width',content.width());\n\t\t\t}\n\t\t\tif (content.height()>settings.height){\t\t\t\t\n\t\t\t\tpopup.css('height',content.height()+30);\n\t\t\t}\n\t\t\tclosingSpan.css({\n\t\t\t\t'color': 'white',\n\t\t\t\t'cursor': 'pointer',\n\t\t\t\t'height': 10\n\t\t\t});\n\t\t\tcontainer.css({\n\t\t\t\t'height':popup.height()-20,\n\t\t\t\t'backgroundColor':'#EBEBE0',\n\t\t\t\t'overflow':'hidden',\n\t\t\t\t'padding-left':((popup.width()-content.width())/2),\n\t\t\t\t'padding-top':((popup.height()-content.height())/2)-10\n\t\t\t});\n\n\t\t\tclosingSpan.addClass('popup-close');\n\t\t\tclosingSpan.text('Click to close [x]');\n\t\t\tclosingSpan.appendTo(popup);\n\t\t\tcontent.appendTo(container);\n\t\t\tcontainer.appendTo(popup);\n\t\t\tpopup.appendTo($(document.body));\n\t\t\treturn popup;\n\t\t}", "title": "" }, { "docid": "1e3b47e1855702604d80da21bbba61e8", "score": "0.6832285", "text": "function popup(mylink, windowname)\n{\nif (! window.focus)return true;\nvar href;\nif (typeof(mylink) == 'string')\n href=mylink;\nelse\n href=mylink.href;\nwindow.open(href, windowname, 'width=500,height=400,scrollbars=yes');\nreturn false;\n}", "title": "" }, { "docid": "832c2d195fc04b3f081b03299a43ee74", "score": "0.68310034", "text": "function createAddWindow(){\n\naddWindow=new BrowserWindow({\n\nwidth:500,\nheight:200,\n\n\ntitle:'Add Shopping List Item'\n\n\n});\n\n\naddWindow.loadURL(url.format({\n\npathname:path.join(__dirname ,'addWindow.html'),\n\nprotocol:'file:',\n\nslashes:true\n\n\n})); \n\n// Garbage collection handle\n\n\naddWindow.on('close' , function(){\n \naddWindow = null;\n\n});\n}", "title": "" }, { "docid": "9ad280b110b0f78e343aa060eaf396e6", "score": "0.6817319", "text": "openfilewindow() {\n this.popup=window.open(this.href, 'newwindow', 'width=640, height=480');\n }", "title": "" }, { "docid": "fa51d2c9220382d6a92b7e263bc9f360", "score": "0.6810027", "text": "function _dialogPopup(url, win, width, height, options)\n{\n\tif (typeof(options) == 'undefined') options = 'location=0,status=0,scrollbars=no,';\n\n\tvar left = (screen.availWidth - width) / 2;\n\tvar top = (screen.availHeight - height) / 2;\n\n\toptions += 'width=' + width + ',height=' + height + ',left=' + left + ',top=' + top;\n\n\treturn window.open(url, win, options);\n}", "title": "" }, { "docid": "59f7f052eb22f6336001ee7107cd89bd", "score": "0.68081117", "text": "function create_html_popup( feature ){\n \n}", "title": "" }, { "docid": "a0ba79d392fae581a9f28c198fa0a66f", "score": "0.6807343", "text": "function popupModal(window, func, message, isclose, myParent, myParentTop) {\r\n\t\tthis.window = window;\r\n\t \tthis.func = func;\r\n\t \tthis.message = message;\r\n\t \tthis.isclose = isclose;\r\n\t \tthis.myParent = myParent;\r\n\t \tthis.myParentTop = myParentTop;\r\n\t}", "title": "" }, { "docid": "cc0782456cd59b7bfdeb5b947b48a8cc", "score": "0.6804071", "text": "function NewWindow(mypage, myname, w, h, scroll, pos) {\n if (pos == \"random\") {\n LeftPosition = (screen.width) ? Math.floor(Math.random() * (screen.width - w)) : 100;\n TopPosition = (screen.height) ? Math.floor(Math.random() * ((screen.height - h) - 75)) : 100;\n }\n if (pos == \"center\") {\n LeftPosition = (screen.width) ? (screen.width - w) / 2 : 100;\n TopPosition = (screen.height) ? (screen.height - h) / 2 : 100;\n }\n else if ((pos != \"center\" && pos != \"random\") || pos == null) {\n LeftPosition = 0;\n TopPosition = 20\n }\n settings = 'width=' + w + ',height=' + h + ',top=' + TopPosition + ',left=' + LeftPosition + ',scrollbars=' + scroll + ',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes';\n win = window.open(mypage, myname, settings);\n}", "title": "" }, { "docid": "06d84462c4a21633fb74029d8793d7d9", "score": "0.67991865", "text": "function fnOpenDownloadPopup() {\r\n\tvar newWin = window.open('download_popup.htm','myWindow','status=no,maximize=no,width=700,height=540,top=125,left=150,resizable=no,scrollbars=yes');\r\n\tnewWin.focus();\r\n}", "title": "" }, { "docid": "2b5ff1af9ef0b39ec95a688f0ee82d02", "score": "0.67976916", "text": "function popup( mylink , windowname ){\n\tvar preferencias = '', href;\n\tpreferencias += 'width='+(window.screen.width*90/100)+',';\n\tpreferencias += 'height='+(window.screen.height*80/100)+',';\n\tpreferencias += 'scrollbars=yes,';\n\tpreferencias += 'screenX='+(window.screen.width*5/100)+',';\n\tpreferencias += 'screenY='+(window.screen.height*5/100);\n\tif( !window.focus ) return true;\n\tif( typeof(mylink) == 'string' ) href = mylink;\n\telse href = mylink.href;\n\twindow.open( href , (windowname||null) , preferencias );\n\treturn false;\n}", "title": "" }, { "docid": "b38da32c33b5e3f8496e540bff5dc21b", "score": "0.67958593", "text": "function wppaFullPopUp(mocc, id, url, xwidth, xheight, ajaxurl) {\r\n\tvar height = xheight+50;\r\n\tvar width = xwidth+14;\r\n\tvar name = '';\r\n\tvar desc = '';\r\n\t\r\n\tvar elm = document.getElementById('i-'+id+'-'+mocc);\r\n\tif (elm) {\r\n\t\tname = elm.alt;\r\n\t\tdesc = elm.title;\r\n\t}\t\r\n\t\r\n\tvar wnd = window.open('', 'Print', 'width='+width+', height='+height+', location=no, resizable=no, menubar=yes ');\r\n\twnd.document.write('<html>');\r\n\t\twnd.document.write('<head>');\t\r\n\t\t\twnd.document.write('<style type=\"text/css\">body{margin:0; padding:6px; background-color:'+wppaBackgroundColorImage+'; text-align:center;}</style>');\r\n\t\t\twnd.document.write('<title>'+name+'</title>');\r\n\t\t\twnd.document.write(\r\n\t\t\t'<script type=\"text/javascript\">function wppa_downl(id){'+\r\n\t\t\t\t'var xmlhttp = new XMLHttpRequest();'+\r\n\t\t\t\t'var url = \"'+ajaxurl+'?action=wppa&wppa-action=makeorigname&photo-id='+id+'&from=popup\";'+\r\n\t\t\t\t'xmlhttp.open(\"GET\",url,false);'+\r\n\t\t\t\t'xmlhttp.send();'+\r\n\t\t\t\t'if (xmlhttp.readyState==4 && xmlhttp.status==200) {'+\r\n\t\t\t\t\t'var result = xmlhttp.responseText.split(\"||\");'+\r\n\t\t\t\t\t'if (result[1] == \"0\") {'+\r\n\t\t\t\t\t\t'window.open(result[2]);'+\r\n\t\t\t\t\t\t'return true;'+\r\n\t\t\t\t\t'}'+\r\n\t\t\t\t\t'else {'+\r\n\t\t\t\t\t\t'alert(\"Error: \"+result[1]+\" \"+result[2]);'+\r\n\t\t\t\t\t\t'return false;'+\r\n\t\t\t\t\t'}'+\r\n\t\t\t\t'}'+\r\n\t\t\t\t'else {'+\r\n\t\t\t\t\t'alert(\"Comm error encountered\");'+\r\n\t\t\t\t\t'return false;'+\r\n\t\t\t\t'}'+\r\n\t\t\t'}</script>');\r\n\t\t\twnd.document.write(\r\n\t\t\t'<script type=\"text/javascript\">function wppa_print(){'+\r\n\t\t\t\t'document.getElementById(\"wppa_printer\").style.visibility=\"hidden\"; '+\r\n\t\t\t\t'document.getElementById(\"wppa_download\").style.visibility=\"hidden\"; '+\r\n\t\t\t\t'window.print();'+\r\n\t\t\t'}</script>');\r\n\t\twnd.document.write('</head>');\r\n\t\twnd.document.write('<body>');\r\n\t\t\twnd.document.write('<div style=\"width:'+xwidth+'px;\">');\r\n\t\t\t\twnd.document.write('<img src=\"'+url+'\" style=\"padding-bottom:6px;\" /><br/>');\r\n\t\t\t\twnd.document.write('<div style=\"text-align:center\">'+desc+'</div>');\r\n\t\t\t\tvar left = xwidth-66;\r\n\t\t\t\twnd.document.write('<img src=\"'+wppaImageDirectory+'download.png\" id=\"wppa_download\" title=\"Download\" style=\"position:absolute; top:6px; left:'+left+'px; background-color:'+wppaBackgroundColorImage+'; padding: 2px; cursor:pointer;\" onclick=\"wppa_downl();\" />');\r\n\t\t\t\tleft = xwidth-30;\r\n\t\t\t\twnd.document.write('<img src=\"'+wppaImageDirectory+'printer.png\" id=\"wppa_printer\" title=\"Print\" style=\"position:absolute; top:6px; left:'+left+'px; background-color:'+wppaBackgroundColorImage+'; padding: 2px; cursor:pointer;\" onclick=\"wppa_print();\" />');\r\n\t\t\twnd.document.write('</div>');\r\n\t\twnd.document.write('</body>');\r\n\twnd.document.write('</html>');\r\n}", "title": "" }, { "docid": "9c2d31b95ed2439ab6b61afa0b7e8116", "score": "0.679484", "text": "function popupWithOk()\r\n{\r\n\t j.popup();\r\n}", "title": "" }, { "docid": "da14668bc988ba19a8d3587052b54c06", "score": "0.67926705", "text": "function OpenPopup(FullUrl, SectionNameWithoutSpace, PopupHeight, PopupWidth) {\r\n\r\n //width, height, top, left, directories, location, resizable, menubar, toolbar, scrollbars, status\r\n var newwindow = window.open(FullUrl, SectionNameWithoutSpace, 'height=' + PopupHeight + ',width=' + PopupWidth + ',status=no,toolbar=no,location=no,menubar=no,titlebar=no,scrollbars=yes');\r\n if (window.focus) { newwindow.focus() }\r\n return false;\r\n}", "title": "" }, { "docid": "70e7404205e8e905b778eef5f64bb60a", "score": "0.67785615", "text": "function openPopup(windowUri,windowHeight, windowWidth, windowName)\n{\n var centerWidth = (window.screen.width - windowWidth) / 2;\n var centerHeight = (window.screen.height - windowHeight) / 2;\n\n newWindow = window.open(windowUri, windowName, 'resizable=0,width=' + windowWidth + \n ',height=' + windowHeight + \n ',left=' + centerWidth + \n ',top=' + centerHeight);\n\n newWindow.focus();\n return newWindow.name;\n}", "title": "" }, { "docid": "4e2d445b5a490446934f529f42aa4874", "score": "0.67715096", "text": "function update() {\n popUpWin.document.open();\n // content for the popup window is defined here\n //popUpWin.document.write(\"<html><head><title>Cut and Paste JavaScript!</title></head>\");\n //popUpWin.document.write(\"<body><center><strong>\" + describeIt + \"</strong><p>\");\n //popUpWin.document.write(\"<img src=\" + picture + \"><br>\");\n //popUpWin.document.write(\"<font size=-1>&copy;1997 Dave Gibson</font><p>\");\n //popUpWin.document.write(\"<a href='#' onClick='self.close()'>\");\n //popUpWin.document.write(\"Return To Cut and Paste!</a></center></body></html>\");\n popUpWin.document.close();\n}", "title": "" }, { "docid": "cc86deeb6598538bb9e94f9fe15ab656", "score": "0.6768424", "text": "function popupWindow(mypage, myname, w, h, scroll) {\n\tvar winl = (screen.width - w) / 2;\n\tvar wint = (screen.height - h) / 2;\n\twinprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'\n\twin = window.open(mypage, myname, winprops)\n\tif (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }\n}", "title": "" }, { "docid": "a9c8ced8d8a4050960dcf9d16f7703e9", "score": "0.67659336", "text": "function openMotivationWindow() {\r\n var windowName = 'motivation';\r\n var group = 'work';\r\n\r\n MoCheck.sortArbeiten();\r\n $ES('.mousepopup').each(function(el){el.setStyle('visibility','hidden')});\r\n\r\n var window_div = $('window_' + windowName);\r\n if(!window_div) {\r\n /* Neu erstellen */\r\n window_div = new Element('div',{'id':'window_' + windowName,'class':'window'});\r\n AjaxWindow.windows[windowName] = window_div;\r\n window_div.injectInside('windows');\r\n window_div.centerLeft();\r\n } else {\r\n window_div.empty();\r\n }\r\n AjaxWindow.bringToTop(window_div);\r\n \r\n /* Fuellen */\r\n var xhtml = '<div class=\"window_borders\">';\r\n xhtml += ' <h2 id=\"window_' + windowName + '_title\" class=\"window_title\" style=\"background-image:url(img.php?type=window_title&value=work);\"><span>' + windowName + '</span></h2>';\r\n xhtml += ' <a href=\"javascript:AjaxWindow.closeAll();\" class=\"window_closeall\"></a>';\r\n xhtml += ' <a href=\"javascript:AjaxWindow.toggleSize(\\'' + windowName + '\\', \\'' + group + '\\');\" class=\"window_minimize\"></a>';\r\n xhtml += ' <a href=\"javascript:AjaxWindow.close(\\'' + windowName + '\\');\" class=\"window_close\"></a>';\r\n xhtml += ' <div id=\"window_' + windowName + '_content\" class=\"window_content\">';\r\n xhtml += ' <div class=\"tab_container\" style=\"margin-left:7px; width:100%; height:275px\">';\r\n xhtml += ' <ul class=\"tabs\">' +\r\n ' <li class=\"active\" id=\"mojob.tab.1\" onclick=\"MoCheck.showTab(this);\">'+ MoCheck.getString(\"dialog.tab.work.titel\") + '</li>' +\r\n ' <li id=\"mojob.tab.2\" onclick=\"MoCheck.showTab(this);\">' + MoCheck.getString(\"dialog.tab.about.titel\") + '</li>' +\r\n ' </ul>';\r\n xhtml += ' <table class=\"shadow_table\">';\r\n xhtml += ' <tr>';\r\n xhtml += ' <td class=\"edge_shadow_top_left\"></td>';\r\n xhtml += ' <td class=\"border_shadow_top\"></td>';\r\n xhtml += ' <td class=\"edge_shadow_top_right\"></td>';\r\n xhtml += ' </tr>';\r\n xhtml += ' <tr>';\r\n xhtml += ' <td class=\"border_shadow_left\"></td>';\r\n xhtml += ' <td class=\"shadow_content\">';\r\n xhtml += ' <div style=\"overflow:auto;width: 675px; height:300px; position: relative;\">';\r\n xhtml += ' <div id=\"mojob.tab.1.div\">';\r\n if(MoCheck.aktJobs.length <= 0) {\r\n xhtml += '<div style=\"text-align:center;\"><br />' +\r\n ' <h2>' + MoCheck.getString(\"dialog.tab.work.nothingSelected.1\") + '</h2><br />' +\r\n MoCheck.getString(\"dialog.tab.work.nothingSelected.2\") +\r\n '</div>';\r\n } else {\r\n xhtml += '<div id=\"moCheck.sortBar\" style=\"text-align:right;padding-right:2px;\">&nbsp;</div>';\r\n $each(MoCheck.aktJobs, function(job, index) {\r\n xhtml += MoCheck.addJobRow(job, index);\r\n });\r\n }\r\n xhtml += ' </div>';\r\n xhtml += ' <div style=\"display:none;padding:5px;\" id=\"mojob.tab.2.div\">';\r\n xhtml += ' <div style=\"text-align:center;height:230px;\">';\r\n xhtml += ' <h2>The West - Lista Lavori</h2>';\r\n xhtml += ' <ul style=\"margin-top:10px;text-align:left;\">' +\r\n ' <li>Questo script è stato tradotto da Tw81</li>' +\r\n\r\n ' <li>Possibilità di creare delle liste dei lavori più utilizzati</li>' +\r\n\r\n\r\n \r\n\r\n ' </ul>';\r\n xhtml += ' </div>';\r\n xhtml += ' <div style=\"float:left;\">';\r\n xhtml += ' Visita: <br />';\r\n xhtml += ' <a href=\"http://forum.the-west.it/\" target=\"_blank\">Forum The West Italia</a>';\r\n xhtml += ' </div>';\r\n \r\n \r\n xhtml += ' </a>'; \r\n xhtml += ' </div>'; \r\n xhtml += ' </div>';\r\n xhtml += ' </div>';\r\n xhtml += ' </td>';\r\n xhtml += ' <td class=\"border_shadow_right\"></td>';\r\n xhtml += ' </tr>';\r\n xhtml += ' <tr>';\r\n xhtml += ' <td class=\"edge_shadow_bottom_left\"></td>';\r\n xhtml += ' <td class=\"border_shadow_bottom\"></td>';\r\n xhtml += ' <td class=\"edge_shadow_bottom_right\"></td>';\r\n xhtml += ' </tr>';\r\n xhtml += ' </table>';\r\n xhtml += ' <span style=\"position:absolute; right:22px; top:19px;\">' + MoCheck.getString('author') + '&nbsp;' + MoCheck.getAuthor() + '</span>';\r\n xhtml += ' <span id=\"moCheck.listen\" style=\"position:absolute; right:22px;\">&nbsp;</span>';\r\n xhtml += ' <div id=\"moCheck.visibleBar\" style=\"text-align:left;padding-left:2px;\">&nbsp;</div>';\r\n xhtml += ' </div>';\r\n xhtml += ' </div>';\r\n xhtml += '</div>';\r\n xhtml += '</div>';\r\n window_div.setHTML(xhtml);\r\n \r\n\r\n $ES('.window_closeall').each(function(el){el.addMousePopup(new MousePopup('<b>'+MoCheck.getString(\"dialog.closeAll.popup\")+'<\\/b>'));});\r\n $ES('.window_minimize').each(function(el){el.addMousePopup(new MousePopup('<b>'+MoCheck.getString(\"dialog.minimize.popup\")+'<\\/b>'));});\r\n $ES('.window_close').each(function(el){el.addMousePopup(new MousePopup('<b>'+MoCheck.getString(\"dialog.close.popup\")+'<\\/b>'));});\r\n var window_title_div = $('window_' + windowName + '_title');\r\n window_div.makeDraggable({handle:window_title_div});\r\n window_title_div.addEvent('dblclick',function(){\r\n window_div.centerLeft();\r\n window_div.setStyle('top',133);\r\n });\r\n window_div.addEvent('mousedown',AjaxWindow.bringToTop.bind(AjaxWindow,[window_div]));\r\n window_title_div.addEvent('mousedown',AjaxWindow.bringToTop.bind(AjaxWindow,[window_div]));\r\n \r\n\r\n var listDiv = $('moCheck.listen');\r\n\r\n /* Job-Select anzeigen */\r\n var onChangeTxt = 'onChange=\"MoCheck.doConfiguration(\\'loadListe\\')\"';\r\n var moListen = '<select id=\"moWorkListen\" size=\"1\" style=\"width:200px\" ' + onChangeTxt + '>';\r\n $each(MoCheck.listen, function(liste, index) {\r\n var isSelected = (liste == MoCheck.aktListe ? 'selected' : '');\r\n var isActual = liste + (liste == MoCheck.aktListe ? ' (' + MoCheck.getString(\"dialog.tab.configuration.actual\") + ')' : '');\r\n moListen += ' <option value=\"' + liste + '\" ' + isSelected + '>' + isActual + '</option>';\r\n });\r\n moListen += '</select>';\r\n listDiv.innerHTML = moListen;\r\n \r\n /* Conf-Buttons */\r\n var btnDelete = new Element('div',{styles:{'margin':'2px', 'float':'left', width:'25px', height:'25px', 'background':'url(images/forum/icons.png) 50px 0', cursor:'pointer'}});\r\n btnDelete.innerHTML = \"&nbsp;\";\r\n btnDelete.addMousePopup(new MousePopup(MoCheck.getString('dialog.tab.configuration.btnDelete.popup'),100,{opacity:0.9}));\r\n btnDelete.addEvent('click',function(){\r\n MoCheck.doConfiguration('deleteListe');\r\n });\r\n btnDelete.injectInside(listDiv);\r\n \r\n var btnRename = new Element('div',{styles:{'margin':'2px', 'float':'left', width:'25px', height:'25px', 'background':'url(images/forum/icons.png) 0 0', cursor:'pointer'}});\r\n btnRename.innerHTML = \"&nbsp;\";\r\n btnRename.addMousePopup(new MousePopup(MoCheck.getString('dialog.tab.configuration.btnRename.popup'),100,{opacity:0.9}));\r\n btnRename.addEvent('click',function(){\r\n MoCheck.doConfiguration('renameListe');\r\n });\r\n btnRename.injectInside(listDiv);\r\n \r\n \r\n var btnAdd = new Element('a',{'title':'', 'class':'button_wrap button', styles:{'float':'left'}, href:'#'});\r\n btnAdd.innerHTML = '<span class=\"button_left\"></span><span class=\"button_middle\">+</span>' +\r\n '<span class=\"button_right\"></span>' +\r\n '<span style=\"clear: both;\"></span>';\r\n btnAdd.addMousePopup(new MousePopup(MoCheck.getString('dialog.tab.configuration.btnNew.popup'),100,{opacity:0.9}));\r\n btnAdd.addEvent('click',function(){\r\n MoCheck.doConfiguration('newListe');\r\n });\r\n btnAdd.injectInside(listDiv);\r\n \r\n if(MoCheck.aktJobs.length > 0) {\r\n $each(MoCheck.aktJobs, function(job, index) {\r\n var aktJobId = job.pos.x + '_' + job.pos.y;\r\n \r\n /* Kleine Anpassung, damit der Job auf das richtige DIV verweist */\r\n job.window = $('moJob_' + aktJobId);\r\n \r\n /* Images einfuegen */\r\n MoCheck.getJobImageDiv(job).injectInside($('moCheck.jobImage_' + aktJobId));\r\n \r\n /* Duration-Select fuellen */\r\n var selectElement = $ES('.jobTime', job.window)[0];\r\n for (dur in job.jobCalc.calculations) {\r\n var o = new Element('option', {'value':dur, 'selected':(dur == job.aktDuration ? true : false)});\r\n \r\n var h = Math.floor(dur / 3600);\r\n var txt;\r\n if(h > 0) {\r\n txt = h + \" \" + MoCheck.getString(\"select.option.hours\");\r\n } else {\r\n txt = (dur / 60) + \" \" + MoCheck.getString(\"select.option.minutes\");\r\n }\r\n \r\n o.innerHTML = txt;\r\n o.injectInside(selectElement);\r\n }\r\n \r\n /* Button aktivieren */\r\n job.button = new Button('ok', 'normal', 'button_start_task_job_' + aktJobId, job.start.bind(job));\r\n\r\n });\r\n \r\n /* Automatisches Aktualisieren aktivieren */\r\n MoCheck.setTrigger();\r\n \r\n /* Sortbar fuellen */\r\n MoCheck.addSortIcon('experience');\r\n MoCheck.addSortIcon('money');\r\n MoCheck.addSortIcon('luck');\r\n MoCheck.addSortIcon('motivation');\r\n \r\n /* Visiblebar fuellen */\r\n MoCheck.addVisibleIcon('experience');\r\n MoCheck.addVisibleIcon('money');\r\n MoCheck.addVisibleIcon('luck');\r\n MoCheck.addVisibleIcon('motivation');\r\n }\r\n}", "title": "" }, { "docid": "fcb1b8bb5e98c5e1f1911ae901f087d6", "score": "0.6754354", "text": "function createPopup(contentScriptOptions) {\n // Should only be called by createBadge\n var popup = Panel({\n width: POPUP_MIN_WIDTH,\n height: POPUP_MIN_HEIGHT,\n contentScriptFile: [messageContentScriptFile],\n contentScript: selfData.load('popup.js'), // Always run after contentScriptFile\n contentScriptWhen: 'start',\n contentScriptOptions: contentScriptOptions\n });\n popup.port.on('hide', function() popup.hide());\n popup.port.on('dimensions', function(dimensions) {\n // Auto-resize pop-up.\n if (dimensions.width || dimensions.height) {\n let width = Math.max(POPUP_MIN_WIDTH, dimensions.width);\n let height = Math.max(POPUP_MIN_HEIGHT, dimensions.height);\n popup.resize(width, height);\n }\n });\n return popup;\n}", "title": "" }, { "docid": "04c9e20892b73af07dff7ef4797cafe6", "score": "0.6752429", "text": "function fancyPop( url, parameters ) {\n\t\n\tparameters = parameters || {};\n\tpopTitle = parameters.title || '';\n\tpopWidth = parameters.width || 700;\n\tpopHeight = parameters.height || 600;\n\tpopModal = parameters.modal || false;\n\t\n\twindow_id = new Window('window_id', {className: \"mac_os_x\", \n\t\t\t\t\t\t\t\t\t\ttitle: popTitle,\n\t\t\t\t\t\t\t\t\t\tshowEffect: Element.show,\n\t\t\t\t\t\t\t\t\t\thideEffect: Element.hide,\n\t\t\t\t\t\t\t\t\t\twidth: popWidth, height: popHeight}); \n\twindow_id.setAjaxContent( url, {evalScripts:true}, true, popModal );\n\twindow_id.setCookie('window_size');\n\twindow_id.setDestroyOnClose();\n}", "title": "" }, { "docid": "d5b60a917aef25c8eebe582a8634072b", "score": "0.6739362", "text": "function NewWindow(mypage,myname,w,h,scroll,pos){\n\t\tif (pos==\"random\") {\n\t\t\tLeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;\n\t\t\tTopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;\n\t\t}\n\t\tif(pos==\"center\"){\n\t\t\tLeftPosition=(screen.width)?(screen.width-w)/2:100;\n\t\t\tTopPosition=(screen.height)?(screen.height-h)/2:100;\n\t\t}\n\t\telse if((pos!=\"center\" && pos!=\"random\") || pos==null) {\n\t\t\tLeftPosition=0;TopPosition=20\n\t\t}\n\t\tsettings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=yes,menubar=no,toolbar=no,resizable=no';\n\t\twindow.open(mypage,myname,settings);\n\t}", "title": "" }, { "docid": "3a8237779a22eb158c350ec766b4846e", "score": "0.67364496", "text": "function openPopUp(url, windowName, w, h, scrollbar) {\n var winl = (screen.width - w) / 2;\n var wint = (screen.height - h) / 2;\n winprops = 'height=' + h + ',width=' + w + ',top=' + wint + ',left=' + winl + ',scrollbars=' + scrollbar;\n win = window.open(url, windowName, winprops);\n if (parseInt(navigator.appVersion) >= 4) {\n win.window.focus();\n }\n}", "title": "" }, { "docid": "65965fd06b1fc98e9aeb398b051ff368", "score": "0.6734177", "text": "function PopupCenter(url, width, height) {\n window.open(url,'_blank');\n}", "title": "" }, { "docid": "2527b4a0d6704ecffab9808afd029148", "score": "0.6734116", "text": "function OpenPopupWindow(theURL,winName,features, myWidth, myHeight, isCentered) {\n if(window.screen)if(isCentered)if(isCentered==\"true\"){\n var myLeft = (screen.width-myWidth)/2;\n var myTop = (screen.height-myHeight)/2;\n features+=(features!='')?',':'';\n features+=',left='+myLeft+',top='+myTop;\n }\n\n\nwindow.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight)\n\n;\n}", "title": "" } ]
9bf7479c4e47fdb222e270dd0fc47ff3
After user rates a post, jQuery updates the rating background on the current page to show the user the new rating
[ { "docid": "b8c7ea8419a724bf67a0d79e379664bb", "score": "0.68375933", "text": "function changeRatingBackground(e){\n\tvar mX = e.pageX;\n\tvar post_id = e.target.id;\n var distance;\n\t\n\tjQuery(document).ready(function($) {\n\t\tvar id_name = '#' + String(post_id);\n\t\tvar element = $(id_name);\n\t\tdistance = mX - element.offset().left;\n\t});\n\t\n\tif(distance < 100 && distance > 0){\n\t\t//window.alert('starting if statement');\n\t\tif(post_id.substring(0,1) != \"-\"){ //if the rating is not read-only, then update the rating\n\t\t\t//window.alert('inside if statement');\n\t\t\tct_update_stars(distance/10, post_id);\n\t\t\t//window.alert('inside if statement finished');\n\t\t}\n\t}\n}", "title": "" } ]
[ { "docid": "6a77d4cc656d402c4172fb0f7540aada", "score": "0.7842683", "text": "function rate_post_success(data) {\n\tjQuery('#post-ratings-' + post_id).html(data);\n\tif(ratingsL10n.show_loading) {\n\t\tjQuery('#post-ratings-' + post_id + '-loading').hide();\n\t}\n\tif(ratingsL10n.show_fading) {\n\t\tjQuery('#post-ratings-' + post_id).fadeTo('def', 1, function () {\n\t\t\tset_is_being_rated(false);\n\t\t});\n\t} else {\n\t\tset_is_being_rated(false);\n\t}\n}", "title": "" }, { "docid": "34f925df040045f31b79d8e1e35f0ca7", "score": "0.7501451", "text": "function rate(el, rating) {\n // Save old score for later use and set \"loading\" animation.\n var elScore = el.siblings(\".Rating\");\n var oldScore = elScore.text();\n // Delay animation: only show if loading takes longer than 0.5 seconds.\n var timer = setTimeout(function() {\n elScore.text(\"\");\n elScore.addClass(\"TinyProgress\");\n },\n 500\n );\n\n // Finally, make AJAX call.\n $.get(\n gdn.url(\"/plugin/rating\"),\n {\n id: $(el).parent().attr('data-postid'),\n type: $(el).parent().attr('data-posttype'),\n rate: rating,\n tk: gdn.definition(\"TransientKey\")\n }\n )\n .done(function(data) {\n // Update with current local count.\n if (data) {\n elScore.text(parseInt(data));\n }\n })\n .fail(function(data) {\n // Restore old value.\n elScore.text(oldScore);\n })\n .always(function() {\n // Remove timer and spinner.\n clearTimeout(timer);\n elScore.removeClass(\"TinyProgress\");\n });\n }", "title": "" }, { "docid": "2bd2ad3221a2fa63b2cb5e8e0e67aa9a", "score": "0.69206315", "text": "function rating() {\n\t\t\t$( \"select[id^='rating']\" ).barrating('show', {\n\t\t\t theme: 'fontawesome-stars',\n\t\t\t onSelect: function(value, text, event) {\n\t\t\t\tif (typeof(event) !== 'undefined') {\n\t\t\t\t\t$.post( '', {\n\t\t\t\t\t\t\t\tid_status: text,\n\t\t\t\t\t\t\t\trating: value,\n\t\t\t\t\t\t\t\taction:'store_rating'\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t.done(function( data ) {\t\n\t\t\t\t\t\t\t\tvar content = $( data ).find(\"#rating_result\"+text);\n\t\t\t\t\t\t\t\t$(\"#rating_result\"+text).html( content );\n\t\t\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t }\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "49c223ae39d1146af0afc41e398071c2", "score": "0.68511564", "text": "function rate_value(rval,url)\n{\n //var pid = $('#frmProductId').val();\n $('.rating .error_msg_rate').hide();\n $('#frmProductRateVal').val(rval);\n $('#ajax_rating a img').attr('src',url+'star0.png');\n for(var i=1;i<=rval;i++)\n {\n $('#ajax_rating a img#star0_'+i).attr('src',url+'star1.png');\n }\n\n// $.post(SITE_ROOT_URL+'common/ajax/ajax_compare.php',{\n// action:'AddRating',\n// pid:pid,\n// val:rval\n// },function(data){\n// $('#ajax_rating').html(data);\n// $('#ajaxRatingMessage').html(\"&nbsp; \"+THANK_FOR_RATING);\n// setTimeout(function(){\n// $('#ajaxRatingMessage').html('&nbsp')\n// },4000);\n\n// });\n\n}", "title": "" }, { "docid": "87f6f20b961a83d90cc8be77dbe1321d", "score": "0.6790366", "text": "function act_rate() {\n\t\tvar url = url_wp.replace( /\\/plugins\\//, \"/support/view/plugin-reviews/\" ) + \"?rate=5#postform\",\n\t\t\tlink = jQuery( '<a href=\"' + url + '\" target=\"_blank\">Rate</a>' );\n\n\t\tlink.appendTo( \"body\" );\n\t\tlink[0].click();\n\t\tlink.remove();\n\t}", "title": "" }, { "docid": "50babf2bbfec5e6b3d0b5ccdfa1afc74", "score": "0.6785407", "text": "function ct_update_stars(num_half_stars, post_id){\n\t//round num_half_stars to the nearest int\n\tnum_half_stars = Math.round(num_half_stars);\n\t\n\t//prevent rating from being below 1 star(2 half stars)\n\tif(num_half_stars < 2){\n\t\tnum_half_stars = 2;\n\t}\n\t\n\tvar element, width = num_half_stars*10;\n\tvar post_id_fore = String(post_id) + \"fore\";\n\t\n\tjQuery(document).ready(function($) {\n\t\n\t\t$.ajax({\n\t\t\t\ttype : 'POST',\n\t\t\t\turl : ajax_object.ajax_url, //admin_url('admin-ajax.php') ,\n\t\t\t\t//dataType: 'json',\n\t\t\t\tdata: {\n\t\t\t\t\t\taction : 'update_post_rating_meta',\n\t\t\t\t\t\tnum_half_stars_post : num_half_stars,\n\t\t\t\t\t\tpost_id_post: post_id\n\t\t\t\t\t\t},\n\t\t\t\tsuccess : function(response){\n\n\t\t\t\t},\n\t\t\t});\n\t\t$('#' + post_id_fore).css(\"width\", width);\n\t\tjQuery( '#' . post_id_fore).val( width ).trigger( 'change' );\n\t});\n\t\n}", "title": "" }, { "docid": "03cd593623ec97cf8fd01124e1684fd0", "score": "0.6738061", "text": "saveRating(rating) {\r\n\t\t\tjQuery.ajax({\r\n\t\t\t\tdata: {\r\n\t\t\t\t\taction: 'save_rating',\r\n\t\t\t\t\tnonce: postratings.nonce,\r\n\t\t\t\t\tpost_id: postratings.post_id,\r\n\t\t\t\t\trating: rating\r\n\t\t\t\t},\r\n\t\t\t\ttype: 'POST',\r\n\t\t\t\turl: postratings.url,\r\n\t\t\t\tsuccess: function(data) {\r\n\t\t\t\t\t//console.log(data);\r\n\t\t\t\t},\r\n\t\t\t\terror: function(data) {\r\n\t\t\t\t\tconsole.log(data);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}", "title": "" }, { "docid": "408077f3c2dcaf8b035abcb4dc38e33e", "score": "0.6736343", "text": "function changeRatingForeground(e){\n\tvar mX = e.pageX;\n\tvar post_id = e.target.id;\n\t//window.alert('changeRating id: ' + post_id + ' ' + mX);\n var distance;\n\t\n\tjQuery(document).ready(function($) {\n\t\tvar id_name = '#' + String(post_id);\n\t\tvar element = $(id_name);\n\t\tdistance = mX - element.offset().left;\n\t});\n\t\n\tif(distance < 100 && distance > 0){\n\t\tif(post_id.substring(0,1) != \"-\"){ //if the rating is not read-only, then update the rating\n\t\t\tct_update_stars(distance/10, post_id.substring(0,post_id.length-4));\n\t\t}\n\t}\n}", "title": "" }, { "docid": "8c2fbcc437f4e482799efae4a881fbe6", "score": "0.6732971", "text": "function current_rating(id, rating, rating_text) {\n\tif(!is_being_rated) {\n\t\tpost_id = id;\n\t\tpost_rating = rating;\n\t\tif(ratingsL10n.custom && ratingsL10n.max == 2) {\n\t\t\tjQuery('#rating_' + post_id + '_' + rating).attr('src', eval('ratings_' + rating + '_mouseover_image.src'));\n\t\t} else {\n\t\t\tfor(i = 1; i <= rating; i++) {\n\t\t\t\tif(ratingsL10n.custom) {\n\t\t\t\t\tjQuery('#rating_' + post_id + '_' + i).attr('src', eval('ratings_' + i + '_mouseover_image.src'));\n\t\t\t\t} else {\n\t\t\t\t\tjQuery('#rating_' + post_id + '_' + i).attr('src', ratings_mouseover_image.src);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(jQuery('#ratings_' + post_id + '_text').length) {\n\t\t\tjQuery('#ratings_' + post_id + '_text').show();\n\t\t\tjQuery('#ratings_' + post_id + '_text').html(rating_text);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a4b3d82987bb7a24bd0e3e0d5067175f", "score": "0.66649675", "text": "function rateIt(me){\n\tif(!rated){\n\t\tdocument.getElementById(\"rateStatus\").innerHTML = document.getElementById(\"ratingSaved\").innerHTML + \"\"+me.title;\n\t\tpreSet = me;\n\t\trated=1;\n\t\tsendRate(me);\n\t\trating(me);\n\t}\n}", "title": "" }, { "docid": "53893b444f06c2ea7283076e96fb9c19", "score": "0.663112", "text": "function rateQuestion2() {\r\n $('.ques2').starrr({\r\n change: function (e, value) {\r\n //alert('new rating is ' + value);\r\n document.getElementById(\"para2\").innerHTML = \"<br> <i> You rated \" + value + \" </i>!\";\r\n q2Rating = value;\r\n }\r\n });\r\n }", "title": "" }, { "docid": "96b7cc2603a15104928fd55cf00786f1", "score": "0.6625535", "text": "function updateRatingInfoWindow(data) {\n\tdocument.getElementById('IW_rating').innerHTML = data;\n\t//$('#IW_rating').val(data);\n\t//$(\"input:submit, input:button\").effect('fade',100);\n\n}", "title": "" }, { "docid": "e6735c4f6bb7e19fa880cf93db73cf30", "score": "0.66122484", "text": "function avgRate() {\n $(\"#average-rate\").raty({readOnly: true,\n score: (averageRating),\n hints: ['crap', 'awful', 'ok', 'nice', 'awesome']});\n }", "title": "" }, { "docid": "46a89a62a206aed78afa6ea140ec96d5", "score": "0.6603341", "text": "function rateQuestion1() {\r\n $('.ques1').starrr({\r\n change: function (e, value) {\r\n //alert('new rating is ' + value);\r\n document.getElementById(\"para\").innerHTML = \" <br> <i> You rated \" + value + \" </i>!\";\r\n q1Rating = value;\r\n }\r\n });\r\n }", "title": "" }, { "docid": "f0f5b8cd2c5aba40111432d03162fefc", "score": "0.6539695", "text": "function rateIt(me){\n\tvar mySplitResult = me.split(\"_\");\n var numRows = mySplitResult[1]; // This is the vote value\n var the_id = mySplitResult[2]; // This is the rating ID\n var rate_status = \"rateStatus_\" + the_id;\n var hidden_id = 'hidden_state_' + the_id;\n var rated = document.getElementById(hidden_id).value;\n\n document.getElementById(hidden_id).value = 1;\n\n if(rated == 0){\n document.getElementById(rate_status).innerHTML = document.getElementById(me).title;\n\n for(var i=1;i<=numRows;i++){\n var create_id = 'id_' + i +'_' + the_id;\n document.getElementById(create_id).className = 'on';\n }\n\n // send an ajax request here to update the database\n\n var arguments = 'vote_value=' + numRows + '&user_hairstyle_id=' + the_id;\n\n sendRequest('rating.php', arguments);\n }\n}", "title": "" }, { "docid": "d5e55e1631f586ac5a5d35b99ad25d4e", "score": "0.6527236", "text": "function rateIt(e){\n\tnode = $(e.target);\n\n\tnode.siblings('.rateStatus').html(node.attr('title'));\n\tsendRate(node);\n\trating(e);\n}", "title": "" }, { "docid": "6ff9f54919268e5c356cfe5ee24c3612", "score": "0.6392261", "text": "function $fc_demo_star_rating_click()\n\t{\n\t\t$.scrap_note_time('Your rating has been subitted', 2000);\n\t}", "title": "" }, { "docid": "f62944f832fc20587d92d323d1fbee0d", "score": "0.634552", "text": "function rateIt(selector){\n\t\tvar selectorRating=selector.split('\\'')[1];\n\t\tvar selectorRatingText='\\''+selectorRating+' .ratingText'+'\\'';\n\t\tselectorRating='\\''+selectorRating+' .rating'+'\\'';\n\n\t\t$(eval(selectorRating)).rating({\n\t\t\tshowCancel:false\n\t\t});\n\t\t$(eval(selectorRating)).bind(\"change\",function(){\n\t\t\t$(eval(selectorRatingText)).text(level[$(eval(selectorRating)).val()]);\n\t\t});\n\n\t\t$(eval(selectorRating)).val(1).change();\n\t}", "title": "" }, { "docid": "4632c8264e296c07170db29cb2c6c8f8", "score": "0.63429534", "text": "function setRating() {\n rating = $(this).attr('value');\n }", "title": "" }, { "docid": "41c16b00bb762004a9f04965831f976f", "score": "0.6307925", "text": "function rate_kontje(rating) {\n\n jQuery.ajax({\n // we get my_plugin.ajax_url from php, ajax_url was the key the url the value\n url : atob(kontje.ajax_url),\n type : 'post',\n data : {\n // remember_setting should match the last part of the hook (2) in the php file (4)\n action : 'rate_kontje',\n filter_nonce : atob(kontje.nonce),\n rating : rating,\n attachment : atob(kontje.id)\n },\n error: function(){\n $('.pech-pechhulp-info').html( \"<p>Helaas is iets mis gegaan.</p>\" );\n // Here Loader animation\n },\n beforeSend: function(){\n // Here Loader animation\n },\n success : function( response ) {\n if (response.response !== '') {\n console.table(response.data);\n console.log(response.response);\n $('div[class^=attachment-star-]').removeClass('rated-red');\n var i;\n var stars = '';\n for (i = 1; i <= rating; i++) {\n $('.attachment-star-' + i).addClass('rated-red');\n }\n if (response.response === 'failure') {\n stars = 'je mag 1x stemmen';\n } else {\n var number = parseInt($('td#rate-' + rating).html()) + 1;\n $('td#rate-' + rating).html(number + '&check;');\n }\n\n // console.log(response.data[0][1]);\n\n $('#attachment-rating').addClass('rating-red');\n\n }\n\n }\n });\n\n }", "title": "" }, { "docid": "2a6c42b0a1b4fc9c8a6d781028441a85", "score": "0.625034", "text": "function clickRating(){\n var newRating = $(this).data('pos')+1;\n\n //TODO: assemble data properly\n var data = {};\n data.rating = newRating;\n //TODO: fix ajax request\n $.ajax({\n url:'/lesson/'+lesson_id+'/updaterating/'+newRating,\n method:'POST',\n contentType:'application/json',\n success: function(){\n rating = newRating;\n }\n });\n}", "title": "" }, { "docid": "c3b38304e4509fd88a25bbcc53fdc1be", "score": "0.6220485", "text": "updateRating(dogId, rating) {\n this.props.postDogRating(dogId, rating);\n this.props.postReview(dogId, rating);\n this.toggleModal();\n }", "title": "" }, { "docid": "7365e0f5e34f12751da732b533da6828", "score": "0.6212478", "text": "function handleEditRating() {\n $('.bookmark-list').on('click', '.star', function (event) {\n const id = getItemIdFromElement(event.currentTarget);\n const newData = $(event.currentTarget).find('.star').val();\n\n api.findAndUpdate(id, newData)\n .then((bookmark1) => {\n store.findAndUpdate(id, bookmark1);\n render();\n })\n .catch(err => {\n\n store.setError(err.message);\n render();\n });\n });\n }", "title": "" }, { "docid": "30809fe1adedf4fa7ecbccd7ba283d4f", "score": "0.61629844", "text": "function $fc_star_rating_click()\n\t{\n\t\t$('.starHoverBlock').live('click', function()\n\t\t{\t\n\t\t\t// Demo example\n\t\t\t$.scrap_note_loader('Submitting your rating');\n\t\t\tsetTimeout($fc_demo_star_rating_click, 1000);\n\t\t});\n\t}", "title": "" }, { "docid": "68df05b5ffcf654438e6c19621d9ef45", "score": "0.6098345", "text": "function setupRating() {\n contentId = $('.js-todoContainer').attr('data-primary-key');\n if (contentId) {\n rating = new Interactions.Interaction({ ContentID: contentId });\n SiteMember.done(function (member) {\n if (member.MembershipId) {\n rating.set('MemberID', parseInt(member.MembershipId, 10));\n rating.set('FromEmailAddress', member.Emails[0].EmailAddress);\n rating.fetch({url: rating.urlRoot + '/' + rating.get('MemberID') + '/' + rating.get('ContentID') + '/1', success: generateRatingUI });\n } else {\n //Not logged in, generate widget with 0 stars filled and bind a click event to open the login overlay\n $('#UserRating').ratings(5, 0, false).on('click', function () {\n SALT.trigger('open:customOverlay', 'loginOverlay');\n });\n }\n });\n bindEventsForFeedBack();\n }\n }", "title": "" }, { "docid": "48a49cc805ba8909af0eba6c622d3d5c", "score": "0.6082367", "text": "function yasrPrintMetaBoxOverall(postid, overallRating) {\n\n //Convert string to number\n overallRating = parseFloat(overallRating);\n\n raterJs({\n starSize: 32,\n step: 0.1,\n showToolTip: false,\n rating: overallRating,\n readOnly: false,\n element: document.getElementById(\"yasr-rater-overall\"),\n rateCallback: function rateCallback(rating, done) {\n\n rating = rating.toFixed(1);\n rating = parseFloat(rating);\n\n //update hidden field\n document.getElementById('yasr-overall-rating-value').value = rating;\n\n this.setRating(rating);\n\n yasrOverallString = 'You\\'ve rated';\n\n document.getElementById('yasr_rateit_overall_value').textContent = yasrOverallString + ' ' + rating;\n\n done();\n }\n });\n\n}", "title": "" }, { "docid": "4149fb01de205958b229cf528582acac", "score": "0.6019626", "text": "function rateMovie(rating, movieID) {\n const settings = {\n method: 'POST', // from API docs\n url: `https://api.themoviedb.org/3/movie/${movieID}/rating?api_key=${apiKey}&session_id=${sessionID}`,\n headers: {\n \"content-type\": \"application/json;charset=utf-8\"\n },\n data: JSON.stringify({ \"value\": rating })\n };\n\n $.ajax(settings).then((response) => {\n // give user a message confirming their rating\n $('<p>').text('Movie rated successfully').css({\n position: 'absolute',\n background: 'rgba(0,200,0,.75)',\n width: '100%',\n padding: '1rem',\n color: '#fff',\n top: 0,\n left: 0,\n textAlign: 'center'\n }).appendTo('body').fadeOut(3000, function() {\n this.remove();\n });\n console.log(response);\n }).catch((error) => {\n console.log(error);\n });\n }", "title": "" }, { "docid": "aac74a0e24c2a8a4d44830f91205bdec", "score": "0.6014477", "text": "function submitUserFeedback() {\n userFeedbackRating = 0.0;\n var enabled = $('[data-ratings]').ratings('get', 'enabled');\n if (enabled === true) {\n isUserRating = true;\n userFeedbackRating = $('[data-ratings]').ratings('get', 'value');\n $(\"#userInputText\").attr(\"placeholder\", \"Please provide your feedback here\");\n } else {\n $(\"#userInputText\").attr(\"placeholder\", \"\");\n }\n }", "title": "" }, { "docid": "0c2590b32dfa1d51a1e85d6a0b311a9b", "score": "0.595682", "text": "function rating() {\n const btnRating = document.querySelectorAll('.slider-btn');\n btnRating.forEach(function (rate) {\n rate.addEventListener('click', function () {\n const popup = document.querySelector('.header__rating');\n popup.classList.toggle('rating_animation');\n });\n });\n}", "title": "" }, { "docid": "8be62e1001018f5063c0d380e3559026", "score": "0.59506816", "text": "function setRating(frm,rate_id){\n var begin_with= /^add_rating_/;\n var rpl_off_str= \"emptystar\";\n var rpl_on_str = \"fullstar\";\n\n //count the selected products, so I know if I need to execute the delete action or not\n for(i=1;i<=5;i++){\n var idname = \"add_rating_\"+i;\n var myimg = document.getElementById(idname);\n var old_src = myimg.src;\n var new_src = old_src.replace(rpl_off_str,rpl_on_str);\n\n //from this start up above put it off\n if(i>rate_id){\n new_src = old_src.replace(rpl_on_str,rpl_off_str);\n }\n document.getElementById(\"add_rating_\"+i).src = new_src;\n }\n\n //set the commnet rating\n frm.add_cmtrating.value = rate_id;\n }", "title": "" }, { "docid": "796491523cdc9ca50c883a01da9833e2", "score": "0.5939881", "text": "function setRate(star, title){\r\n var x = document.getElementsByTagName('a');\r\n // set cookie\r\n writeStar('rateUGO2', star + ' -> ' + title,1440 ,'');\r\n for (i = 0; i < x.length; i++) {\r\n if (x[i].className.match('show_star')) { \r\n x[i].className = \"\";\r\n } \r\n }\r\n document.getElementById('rate_comment').className = 'show';\r\n document.getElementById(star).className = 'show_star';\r\n}", "title": "" }, { "docid": "c9930eb97fc4b84f6ec1eac0b59701c5", "score": "0.5925484", "text": "function ratingDisplay(review, rating) {\n if (review <= 1.24) {\n rating.setAttribute(\"data-class\", \"one-bomb\")\n }\n if (review > 1.24 && review <= 1.75) {\n rating.setAttribute(\"data-class\", \"one-five-bomb\")\n }\n if (review > 1.75 && review <= 2.25) {\n rating.setAttribute(\"data-class\", \"two-bomb\")\n }\n if (review > 2.25 && review <= 2.75) {\n rating.setAttribute(\"data-class\", \"two-five-bomb\")\n }\n if (review > 2.75 && review <= 3.25) {\n rating.setAttribute(\"data-class\", \"three-bomb\")\n }\n if (review > 3.25 && review <= 3.75) {\n rating.setAttribute(\"data-class\", \"three-five-bomb\")\n }\n if (review > 3.75 && review <= 4.25) {\n rating.setAttribute(\"data-class\", \"four-bomb\")\n }\n if (review > 4.25 && review <= 4.75) {\n rating.setAttribute(\"data-class\", \"four-five-bomb\")\n }\n if (review > 4.75) {\n rating.setAttribute(\"data-class\", \"five-bomb\")\n }\n}", "title": "" }, { "docid": "83f7542afc26acd4bcc2281daebab2b6", "score": "0.58861", "text": "function pushRating() {\n //haal het filmnummer op\n var ttnummer = window.location.href;\n var url = new URL(ttnummer);\n var paramValue = url.searchParams.get(\"tt\");\n\n //haal de ingevoerde waarde op.\n var a = $( \"#inputRating\" ).val();\n //rond de rating af.\n var rounded = roundHalf(a);\n //todo push to server.\n sendRatingToServer(paramValue ,rounded);\n}", "title": "" }, { "docid": "1259f321ac597fbbdaeaaaa22dd1f318", "score": "0.58811957", "text": "function r8_4_review(r8,item_id){\r\n var item_id = document.getElementsByName('item_id')[0].value;\r\n \r\n $('.review_rate_section button i').attr('class','fa fa-star-o');\r\n \r\n $.post('/fixitquick/incl/ajax_process.php',{\r\n item_id:item_id,\r\n r8_num:r8\r\n },function(r){\r\n \r\n if($.trim(r) == 'ok'){\r\n for(var r8Num = r8;r8Num > 0;r8Num--){\r\n \r\n $(\"button[r8='\"+r8Num+\"'] > i\").removeClass('fa-star-o');\r\n $(\"button[r8='\"+r8Num+\"'] > i\").addClass('fa-star');\r\n\r\n }//END 4loop\r\n }////END if\r\n })///END $post\r\n}///END fn", "title": "" }, { "docid": "5c061f0b9128a86dc4a4cb9534913c85", "score": "0.587567", "text": "function adjustRating(rating) {\n document.getElementById(\"ratingvalue\").innerHTML = rating;\n}", "title": "" }, { "docid": "a1f5b4cf905575fcc830a9bf7711be1b", "score": "0.58672297", "text": "function addRating()\n{\n var divToHoldRating = document.getElementById(\"ratingPlace\");\n (\n function()\n {\n (function init()\n {\n addRatingWidget(buildShopItem(), suggestion[8]);\n })();\n\n function buildShopItem()\n {\n var divForRating = document.createElement('div');\n divForRating.id = \"ratingDiv\";\n\n var html = '<ul class=\"c-rating\"></ul>';\n divForRating.innerHTML = html;\n divToHoldRating.appendChild(divForRating);\n return divForRating; \n }\n\n function addRatingWidget(divForRating, test1) // test1 = holds \t\tcurrent rating from the database\n {\n var ratingElement = divForRating.querySelector('.c-rating');\n var currentRating = test1;\n var maxRating = 5;\n var callback = function(rating, id)\n {\n saveRating(rating,id,sessionStorage.getItem(\"userID\"));\n };\n var r = rating(ratingElement, currentRating, maxRating, suggestion[9], callback);\n }\n })();\n}", "title": "" }, { "docid": "7b77fd1dd88fead9be0a58ea05f32596", "score": "0.5853546", "text": "function userRatingsManagement() {\n\n\tvar $viewport = jQuery('#viewport');\n\t$viewport.on('out', function (e, target, direction) {\n\n\t\tvar data = {};\n\t\tdata.rating = direction;\n\t\tdata.userId = userId;\n\t\tdata.eventId = jQuery(target).data('event');\n\n\t\t// If the card is an event\n\t\tif (data.eventId) {\n\n\t\t\t// We save the like / dislike in DB\n\t\t\tvar url = '/api/rate';\n\t\t\t$.post(url, data, function(response) {\n\t\t\t\t//console.log(response);\n\t\t\t});\n\n\t\t\t// We save the like / dislike in cookies\n\t\t\taddRatingToCookies(data.eventId, direction);\n\t\t}\n\n\t});\n\n}", "title": "" }, { "docid": "0ed595b623b3f7cede17f36bab6e103c", "score": "0.5849711", "text": "function observeRating () {\n if (!checkGameDesc(/соревнование/)) {\n return false;\n }\n\n var old = 0;\n window.setInterval(function () {\n var container = document.querySelector('.player.you .rating .rating_gained');\n if (!container) {\n return false;\n }\n\n var gained = parseInt(container.textContent) - old;\n old += gained;\n dailyScores.update({ rating: gained });\n }, 1000);\n }", "title": "" }, { "docid": "f3e7ecb8845d28fcd7d620bb9fa859c5", "score": "0.58408946", "text": "function adjustRating(rating) {\n document.getElementById(\"ratingvalue\").innerHTML = rating;\n}", "title": "" }, { "docid": "f3e7ecb8845d28fcd7d620bb9fa859c5", "score": "0.58408946", "text": "function adjustRating(rating) {\n document.getElementById(\"ratingvalue\").innerHTML = rating;\n}", "title": "" }, { "docid": "0c5de844adfc62752e1c862608b8f983", "score": "0.5828106", "text": "function handleRatings(apiurl, _data) {\n\tif (DEBUG) {\n\t\tconsole.log (\"Triggered handleRatings\")\n\t}\n\tvar rating_value = $('input[name=\"newRating\"]:checked').val();\n\t\n\t//process the new rating value and increment number of votes\n\tvar new_rating = {};\n\tnew_rating.average_score = parseInt(_data.average_rating)*parseInt(_data.number_of_ratings)+parseInt(rating_value);\n\tnew_rating.total_number = parseInt(_data.number_of_ratings+1);\n\tnew_rating.average_score = new_rating.average_score/new_rating.total_number;\n\tvar envelope={\"template\":{\n\t\t\t\t\t\t\t\t\"data\":[]\n\t}};\n\tenvelope.template.data.push({\"name\" : \"title\", \t \"value\" : _data.title });\n\tenvelope.template.data.push({\"name\" : \"imdb_id\", \t \"value\" : _data.imdb_id });\n\tenvelope.template.data.push({\"name\" : \"description\", \"value\" : _data.description });\n\tenvelope.template.data.push({\"name\" : \"year\",\t\t \"value\" : _data.year });\n\tenvelope.template.data.push({\"name\" : \"rating\", \t \"value\" : new_rating });\n\teditRating(apiurl, envelope);\n\treturn false;\n}", "title": "" }, { "docid": "894f89f117c2f56166cbe4767c96701b", "score": "0.5826806", "text": "function enable_vote(){\n $('#reply').append(\"<div class='starrr'></div>\");\n\n setTimeout(function(){\n $(\".starrr\").starrr();\n $('.starrr').append('<div class=\"vote-result\"></div>');\n\n $('.starrr').on('starrr:change', function(e, value){\n add_vote(value);\n });\n\n }, 50);\n}", "title": "" }, { "docid": "1629cdcf668497f69ffd1645ef9fc467", "score": "0.58222365", "text": "function saveRating(ratingObject) {\n if (currentUserID) {\n // get var\n var recipeObject = ratingObject.parent().closest(\".card__body__controls__rating\");\n var recipe = recipeObject.attr(\"value\");\n var path = currentUserID + \"/recipes/\" + recipe;\n\n // save new rating\n loadData(path).then((snapshot) => {\n var stars = Number(ratingObject.attr(\"value\"));\n\n if (snapshot.val() !== null && snapshot.val().rating == stars) {\n var stars = 0;\n recipeObject.removeClass(\"active\").find(\".rating__icons\").removeClass(\"active\");\n } else {\n recipeObject.addClass(\"active\").find(\".rating__icons\").removeClass(\"active\");\n ratingObject.addClass(\"active\");\n }\n firebase.database().ref(path).update({\n rating: stars,\n });\n $(\".r_\" + recipe).attr(\"data-rating\", stars);\n\n // update sort datas\n isotopeSortUpdate();\n });\n } else {\n modalON();\n }\n }", "title": "" }, { "docid": "e6e47100aa27fbe068d0c5d80198027a", "score": "0.5817867", "text": "function upVote(post) {\n $.post(\"/api/shows/recommendations\", post, function() {\n console.log(\"it works\");\n });\n }", "title": "" }, { "docid": "fc664149db0d8f8a9cce2342afcdb9cf", "score": "0.5809234", "text": "function adjustRating(rating){\n document.getElementById(\"ratingvalue\").innerHTML = rating;\n}", "title": "" }, { "docid": "32f059059d5b0035633e7fad9cc5fbd4", "score": "0.58080125", "text": "function fetchReviews(waterfall_id) {\n $(\"#stars\").html(\"\");\n $(\"#review_text\").html(\"\");\n $.ajax({\n type: \"POST\",\n url: \"./php/fetch_reviews.php\",\n data: \"waterfall_id=\" + waterfall_id,\n success: function (data) {\n\n var average_rating;\n let count;\n let rating_visual;\n for (i = 0; i < data.length; i++) {\n\n let tempRating = parseInt(data[i].review_rating);\n for (j = 0; j < 5; j++) {\n if (tempRating == 0 || !tempRating || tempRating == null) {\n rating_visual = (rating_visual || \"\") + \"<span class='fa fa-star'></span>\";\n } else {\n rating_visual = (rating_visual || \"\") + \"<span class='fa fa-star star_checked'></span>\";\n tempRating--;\n }\n }\n $(\"#review_text\").prepend(\"<div class='list-group-item'><div class='d-flex w-100 justify-content-between'><h5 class='mb-1'>\" + data[i].review_name + \"</h5><small>\" + data[i].review_date + \"</small></div><p class='mb-1'>\" + data[i].review_text + \"</p><small>\" + rating_visual + \" \" + data[i].review_rating + \"/5</small></div>\")\n rating_visual = \"\";\n average_rating = (average_rating || 0) + parseFloat(data[i].review_rating);\n count = (count || 0) + 1;\n }\n average_rating = average_rating / count;\n\n $(\"#rating\").text(average_rating.toFixed(2));\n\n average_rating = parseInt(average_rating);\n if (average_rating) {\n $(\"#no_ratings_span\").hide();\n $(\"#rating_div\").show();\n $(\"#review_heading\").text(\"Recent Reviews\");\n count = 5;\n while (count !== 0) {\n if (average_rating == 0 || !average_rating) {\n $(\"#stars\").append(\"<span class='fa fa-star'></span>\");\n } else {\n $(\"#stars\").append(\"<span class='fa fa-star star_checked'></span>\");\n average_rating--;\n }\n count--;\n }\n } else {\n $(\"#rating_div\").hide();\n $(\"#no_ratings_span\").show();\n $(\"#review_heading\").text(\"There's no reviews on this waterfall :(\");\n }\n },\n dataType: \"json\"\n });\n}", "title": "" }, { "docid": "cedb3dab17346a8836fe8ad9180a2d9b", "score": "0.57924217", "text": "function submitUserReview() {\n let datavalue = {} ;\n datavalue.sticky_id = sticky_id_modal ;\n datavalue.previous_rating = previous_rating ;\n datavalue.new_rating = user_rating ;\n\n console.log(\"data sent to the server is \"+JSON.stringify(datavalue));\n // the email_id of current_user is stored in the server for the current session.\n // the email_id of the uploader must be found out by the server for updating the uploader's profile about the no. of smiles he has received.\n showMainLoader() ;\n $.ajax({\n url: \"data/submit_user_review_for_sticky\",\n method: \"POST\",\n contentType: \"application/json\",\n data: JSON.stringify(datavalue),\n\n success: function() {\n // the rating was successfull\n // increment the no. of smiles|meh|frowns for the stickys\n hideStickyModal() ;\n hideMainLoader() ;\n\n let item = $(\".grid-item #\"+sticky_id_modal+\" #\"+user_rating+\"value\") ;\n let value = parseInt(item.text()) ;\n item.text(value+1) ;\n\n let $smilerating = $(\"#show_sticky .ratings .fa-smile-o\") ;\n let $mehrating = $(\"#show_sticky .ratings .fa-meh-o\") ;\n let $frownrating = $(\"#show_sticky .ratings .fa-frown-o\") ;\n\n $smilerating.css('color', 'black') ;\n $mehrating.css('color', 'black') ;\n $frownrating.css('color', 'black') ;\n\n location.reload() ;\n },\n error : function() {\n hideMainLoader() ;\n showNotification(\"Please try again. \", \"red\") ;\n }\n })\n}", "title": "" }, { "docid": "a4e43d0032d2932105c23b94b4c90b62", "score": "0.57904387", "text": "function initRatings(){\n\t/************************** REVIEW LIST **************************/\n\n\t// If .review-list exists, continue\n\tif ($('.review-list-item, .review-index-item').length > 0){\n\t\t// Get the # of stars for each review-list item and use it for the raty function\n\t\t$('.review-list-item, .review-index-item').each(function(){\n\t\t\tvar ratyHTML \t= $(this).find('.raty');\n\t\t\tvar stars \t\t= ratyHTML.data().stars;\n\n\t\t\tratyHTML.raty({\n\t\t\t\tstarHalf \t: '/images/raty/images/star-half.png',\n\t\t\t\tstarOff \t: '/images/raty/images/star-off.png',\n\t\t\t\tstarOn \t: '/images/raty/images/star-on.png',\n\t\t\t\thints \t\t: ['Horrible', \"Mediocre\", \"Okay\", \"Great\", \"Awesome!\"],\n\t\t\t\treadOnly\t: true, \n\t\t\t\tscore\t\t: stars\n\t\t\t});\t\n\t\t});\n\t}\n}", "title": "" }, { "docid": "bd55bf9fbe0c36f6c16c79a1275e49bc", "score": "0.5786824", "text": "function ratedGood() {\n // Reset\n if ($(this).hasClass(\"good-selected\")) {\n $(this).removeClass(\"good-selected\");\n\n if ($(this).hasClass(\"temp\")) {\n rating[\"temp\"] = 0;\n } else if ($(this).hasClass(\"humid\")) {\n rating[\"humid\"] = 0;\n } else if ($(this).hasClass(\"co2\")) {\n rating[\"co2\"] = 0;\n } else if ($(this).hasClass(\"noise\")) {\n rating[\"noise\"] = 0;\n }\n } else {\n $(this).addClass(\"good-selected\");\n\n if ($(this).hasClass(\"temp\")) {\n if (rating[\"temp\"] < 0) {\n $(\"#btn-bad-temp\").removeClass(\"bad-selected\");\n }\n rating[\"temp\"] = 1;\n } else if ($(this).hasClass(\"humid\")) {\n if (rating[\"humid\"] < 0) {\n $(\"#btn-bad-humid\").removeClass(\"bad-selected\");\n }\n rating[\"humid\"] = 1;\n } else if ($(this).hasClass(\"co2\")) {\n if (rating[\"co2\"] < 0) {\n $(\"#btn-bad-co2\").removeClass(\"bad-selected\");\n }\n rating[\"co2\"] = 1;\n } else if ($(this).hasClass(\"noise\")) {\n if (rating[\"noise\"] < 0) {\n $(\"#btn-bad-noise\").removeClass(\"bad-selected\");\n }\n rating[\"noise\"] = 1;\n }\n }\n}", "title": "" }, { "docid": "d2a0238d120a784cca7ea38fb322ce40", "score": "0.57818985", "text": "function ratedBad() {\n // Reset\n if ($(this).hasClass(\"bad-selected\")) {\n $(this).removeClass(\"bad-selected\");\n\n if ($(this).hasClass(\"temp\")) {\n rating[\"temp\"] = 0;\n } else if ($(this).hasClass(\"humid\")) {\n rating[\"humid\"] = 0;\n } else if ($(this).hasClass(\"co2\")) {\n rating[\"co2\"] = 0;\n } else if ($(this).hasClass(\"noise\")) {\n rating[\"noise\"] = 0;\n }\n } else {\n $(this).addClass(\"bad-selected\");\n\n if ($(this).hasClass(\"temp\")) {\n showDialog(\"temp\");\n if (rating[\"temp\"] == 1) {\n $(\"#btn-good-temp\").removeClass(\"good-selected\");\n }\n } else if ($(this).hasClass(\"humid\")) {\n showDialog(\"humid\");\n if (rating[\"humid\"] == 1) {\n $(\"#btn-good-humid\").removeClass(\"good-selected\");\n }\n } else if ($(this).hasClass(\"co2\")) {\n if (rating[\"co2\"] == 1) {\n $(\"#btn-good-co2\").removeClass(\"good-selected\");\n }\n rating[\"co2\"] = -1;\n } else if ($(this).hasClass(\"noise\")) {\n if (rating[\"noise\"] == 1) {\n $(\"#btn-good-noise\").removeClass(\"good-selected\");\n }\n rating[\"noise\"] = -1;\n }\n }\n}", "title": "" }, { "docid": "e36425c6d526c63b35671d46d287a6b9", "score": "0.5779476", "text": "function rating(e){\n\tnode = $(e.target);\n\n\tnode.removeClass('icon-star-empty');\n\tnode.addClass('icon-star');\n\n\tnode.siblings('a').each(function(i, element) {\n\t\telement = $(element);\n\t\tif (element.data('rating') <= node.data('rating')) {\n\t\t\telement.removeClass('icon-star-empty');\n\t\t\telement.addClass('icon-star');\n\t\t\tnode.siblings('.rateStatus').html(node.attr('title'));\n\t\t} else {\n\t\t\telement.removeClass('icon-star');\n\t\t\telement.addClass('icon-star-empty');\n\t\t}\n\t});\n}", "title": "" }, { "docid": "e533c1f0380c441d277bf23de7c90a02", "score": "0.5774214", "text": "function sendUpdate(){\n\t\t\tif (Chart.helpers.currentUser) {\n\t\t\t\tvar params = 'site_id='+Chart.helpers.siteId+'&item_id='+me.bcItemId+'&user_id='+Chart.helpers.currentUser;\n\t\t\t\tChart.helpers.each(me.labels, function(value){\n\t\t\t\t\tparams += '&rating[]='+value.metricValue;\n\t\t\t\t});\n\t\t\t\tvar postUrl = '//www.bettercontext.com/api/user_ratings';\n\t\t\t\tvar request = new XMLHttpRequest();\n\t\t\t\trequest.open('POST', postUrl, true);\n\t\t\t\trequest.onreadystatechange = function() {\n\t\t\t\t\tif (request.readyState==4) {\n\t\t\t\t\t\tme.renderSaveImg();\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\trequest.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n\t\t\t\trequest.send(params);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "c6f112b9b646f2c5b8e5c2d52ddcec83", "score": "0.5770328", "text": "function rateIt(me, provider_id){\n\tif(!rated){\n\t\tdocument.getElementById(\"rateStatus\").innerHTML = document.getElementById(\"ratingSaved\").innerHTML + \" :: \"+me.title;\n\t\tpreSet = me;\n\t\trated=1;\n\t\tprev_id.push(provider_id);\n\t\tsendRate(me, provider_id);\n\t\trating(me, provider_id);\n\t}\n\t\n\telse {\n\t\tids = prev_id.indexOf(provider_id);\n\t\tif(ids == -1){\n\t\t\tdocument.getElementById(\"rateStatus\").innerHTML = document.getElementById(\"ratingSaved\").innerHTML + \" :: \"+me.title;\n\t\t\tpreSet = me;\n\t\t\tprev_id.push(provider_id);\n\t\t\tsendRate(me, provider_id);\n\t\t\trating(me, provider_id);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "de906dbd9209266290922701d116adf2", "score": "0.57567275", "text": "function rating(num){\n\tsMax = 0;\t// Isthe maximum number of stars\n\tfor(n=0; n<num.parentNode.childNodes.length; n++){\n\t\tif(num.parentNode.childNodes[n].nodeName == \"A\"){\n\t\t\tsMax++;\n\t\t}\n\t}\n\n\tif(!rated){\n\t\ts = num.id.replace(\"_\", ''); // Get the selected star\n\t\ta = 0;\n\t\tfor(i=1; i<=sMax; i++){\n\t\t\tif(i<=s){\n\t\t\t\tdocument.getElementById(\"_\"+i).className = \"on\";\n\t\t\t\tdocument.getElementById(\"rateStatus\").innerHTML = num.title;\n\t\t\t\tholder = a+1;\n\t\t\t\ta++;\n\t\t\t}else{\n\t\t\t\tdocument.getElementById(\"_\"+i).className = \"\";\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "4012a41e9bef925756c6c599dd643e48", "score": "0.5733645", "text": "function ratingOverview(ratingElem) {\r\n\r\n $(ratingElem).each(function() {\r\n var dataRating = $(this).attr('data-rating');\r\n // Rules\r\n if (dataRating >= 4.0) {\r\n $(this).addClass('high');\r\n $(this).find('.rating-bars-rating-inner').css({ width: (dataRating/5)*100 + \"%\", });\r\n } else if (dataRating >= 3.0) {\r\n $(this).addClass('mid');\r\n $(this).find('.rating-bars-rating-inner').css({ width: (dataRating/5)*80 + \"%\", });\r\n } else if (dataRating < 3.0) {\r\n $(this).addClass('low');\r\n $(this).find('.rating-bars-rating-inner').css({ width: (dataRating/5)*60 + \"%\", });\r\n }\r\n\r\n });\r\n}", "title": "" }, { "docid": "4012a41e9bef925756c6c599dd643e48", "score": "0.5733645", "text": "function ratingOverview(ratingElem) {\r\n\r\n $(ratingElem).each(function() {\r\n var dataRating = $(this).attr('data-rating');\r\n // Rules\r\n if (dataRating >= 4.0) {\r\n $(this).addClass('high');\r\n $(this).find('.rating-bars-rating-inner').css({ width: (dataRating/5)*100 + \"%\", });\r\n } else if (dataRating >= 3.0) {\r\n $(this).addClass('mid');\r\n $(this).find('.rating-bars-rating-inner').css({ width: (dataRating/5)*80 + \"%\", });\r\n } else if (dataRating < 3.0) {\r\n $(this).addClass('low');\r\n $(this).find('.rating-bars-rating-inner').css({ width: (dataRating/5)*60 + \"%\", });\r\n }\r\n\r\n });\r\n}", "title": "" }, { "docid": "34a6c88e8ab9a25a2e131532126afa6a", "score": "0.57258505", "text": "function grabScore () {\n\timageScore = $('#your-vote').val();\n\tscore = parseInt(imageScore);\n}", "title": "" }, { "docid": "e6062d89befc5587aa3e2061802b43b5", "score": "0.57117933", "text": "function refine() {\n $(\".pagination\").hide();\n $(\"#products\").html('<center><br /><i class=\"fa fa-spinner fa-spin fa-2x\"></i></center>');\n $.post(site_url + 'home/refine_search', post_data, function (response) {\n $(\"#products\").html(response);\n $(\".prop-count\").text($(document).find(\".list-group .item\").length);\n $(document).find('.input-3').rating({displayOnly: true, step: 0.5});\n })\n }", "title": "" }, { "docid": "c444878381882e9e65d71b01b58eb425", "score": "0.57043165", "text": "function submit_review(){\n\t$('.review-stars .star').on('click', function(){\n\t\t$('.review-stars .star').removeClass('active');\n\t\tvar clickedCurrent = $(this);\n\t\t$('.review-stars .star').each(function(){\n\t\t\t$(this).addClass('active');\n\t\t\tif(clickedCurrent.is($(this))) return false;\n\t\t});\n\t});\n}", "title": "" }, { "docid": "0f1184751c072d460eceafd3d7ff0867", "score": "0.56846356", "text": "function postScore() {\n $('#scoreInner').html(model.playerScore);\n}", "title": "" }, { "docid": "82af9ab4513e73e73117195a01bd5db6", "score": "0.56842977", "text": "ratingChanged(newRating) {\n this.props\n\t .dispatch(rateRecipie(this.props.id, {\n\t \tid: this.props.id,\n\t \trating: this.props.recipie.rating + newRating,\n\t \tnumberOfRatings: this.props.recipie.numberOfRatings + 1\n\t }));\n }", "title": "" }, { "docid": "2d5815271c045e199c43e2b020c45fc6", "score": "0.56818473", "text": "function ratingDevX(divLoad, folder) {\n\tvar ratingHelpfulValue;\n\tvar pageName = document.location.href.split('\\\\').pop().split('/').pop().split('?')[0].split('#')[0];\n\tvar cookieName = \"ratingDevX-\" + pageName;\n\tvar ratingObject = {\n\t page: pageName,\n\t pageProgress: \"\", //name of the last visible card the user has seen\n\t\tuserPrompted : false,\t\t//did user see the rating window\n\t\tisPageHelpful : undefined,\t//did they answer Yes (true) or No (false) that the page is useful\n\t\tuserComments : \"\"\t\t\t//user's verbatim comments\n\t}\n\t\n\tthis.init = function () {\n\t\t$(document).ready(function() {\n\t\t\tvar div = $(\"#\" + divLoad).append($(\"<div id='ratingDevX'></div>\"));\n\t\t\t$(\"#ratingDevX\").load(folder +\"/rating.html\", function(response, status, xhr) {\n\t\t\t\tsetupControlHandlers();\n\t\t\t\tshowRatingIfNeeded();\n\t\t\t});\n\t\t\t$(\"head\").append($(\"<link rel='stylesheet' href='\" + folder + \"/rating.css' type='text/css'/>\"));\n\t\t}); \n\n\t\t//Load script for telemetry logging\t\n\t\tinitTelemetry();\n\t}\n\n\tthis.updateProgress = function (userProgress) {\n\t ratingObject.pageProgress = userProgress;\n\t}\n\n\tfunction setupControlHandlers() {\n\t\t$(document).scroll(function () {\n\t\t\tshowRatingIfNeeded();\n\t\t})\n\t\t\n\t\t$(\"#s_ratingYes\").click(function() {\n\t\t\tratingHelpfulValue = true;\t\n\t\t\t$(\"#s_ratingSection1\").hide();\n\t\t\t$(\"#s_ratingSection2\").show();\n\t\t})\n\t\t\n\t\t$(\"#s_ratingNo\").click(function() {\n\t\t\tratingHelpfulValue = false;\t\t\n\t\t\t$(\"#s_ratingSection1\").hide();\n\t\t\t$(\"#s_ratingSection2\").show();\n\t\t})\n\n\t\t$(\"#s_ratingSubmit\").click(function() {\n\t\t\n\t\t\t$(\"#s_ratingSection2\").hide();\n\t\t\t$(\"#s_ratingSection3\").show();\n\t\t\tcloseRating();\n\t\t})\n\n\t\t$(\"#s_ratingSkipThis\").click(function() {\n\t\t\n\t\t\t$(\"#s_ratingSection2\").hide();\n\t\t\t$(\"#s_ratingSection3\").show();\n\t\t\tcloseRating();\n\t\t})\n\t\t\n\t\t$(\".closeSmallWhite\").click(function() {\n\t\t closeRating();\n\t\t})\n\n\t\tfunction updateCharCount() {\n\t\t\tvar maxLength = $(this).attr(\"maxLength\");\n\t\t\t$(\"#feedbackTextCounter\").text(maxLength - $(this).val().length);\n\t\t}\n\n\t\t$(\"#s_ratingText\").keyup(updateCharCount).keypress(updateCharCount);\n\t}\n\n\tfunction closeRating() {\n\t\tratingObject.userPrompted = true;\n\t\tratingObject.isPageHelpful = ratingHelpfulValue;\n\t\tratingObject.userComments = $(\"#s_ratingText\").val();\n\t\twriteLog(JSON.stringify(ratingObject));\n\t\tdocument.cookie = cookieName + \"=\" + ratingHelpfulValue;\n\t\twindow.setTimeout (function () {$(\"#responsiveRating\").removeClass(\"show\")}, 1000);\n\t}\n\t\n\tthis.clearCookie = function() {\n\t\t//used while debugging to clear session cookie\n\t\tdocument.cookie = cookieName + \"=; expires=Thu, 01 Jan 1970 00:00:01 GMT;\";\n \n\t}\n\n\tfunction hasUserResponded() {\n\t\treturn document.cookie.indexOf(cookieName) > -1\n\t}\n\t\n\tfunction showRatingIfNeeded() {\n\t\tif (!hasUserResponded()) {\n\t\t\tvar pos = viewPos(divLoad);\n\t\t\tif (pos.inViewPartial) {\n\t\t\t\t$(\"#responsiveRating\").addClass(\"show\");\n\t\t\t}\n\t\t}\n\t}\n\n\t //Return an object that represents where the element is vertically on the page\n\tfunction viewPos(id) {\n\t\tid = id[0] == \"#\" ? id : \"#\" + id;\n\t\tvar $el = $(id);\n\t\tvar $window = $(window);\n\n\t\tvar docViewTop = $window.scrollTop();\n\t\tvar docViewBottom = docViewTop + window.innerHeight;\n\n\t\tvar elTop = $el.offset().top;\n\t\tvar elBottom = elTop + $el.height();\n\t\tvar topInView = (elTop >= docViewTop) && (elTop <= docViewBottom);\n\t\tvar bottomInView = (elBottom >= docViewTop) && (elBottom <= docViewBottom);\n\t\tvar aboveMiddleTopInView = (elTop <= (docViewBottom - docViewTop) / 2);\n\n\t\tvar elVisible = _isVisible(id);\n\n\t\treturn { inViewFull: (topInView && bottomInView && elVisible),\n\t\t inViewPartial: ((topInView || bottomInView) && elVisible),\n\t\t aboveTop: (elBottom <= docViewTop),\n\t\t belowBottom: (elTop >= docViewBottom),\n\t\t aboveMiddle: aboveMiddleTopInView\n\t\t};\n\t}\n\t\n\t\t//Return whether the element is visible (and its parent elements)\n\tfunction _isVisible(id) {\n\t\t//set id to jquery element selector if not already\n\t\tid = id[0] == \"#\" ? id : \"#\" + id;\n\t var el = $(id);\n\n \treturn $(el).is(\":visible\");\n\t}\n\n\t//JavaScript helper to load javascript library and notify completion \n\tfunction getScript(url, callback) {\n\t\tvar script = document.createElement(\"script\")\n\t\tscript.type = \"text/javascript\";\n\t\tif (script.readyState) { //IE\n\t\t\tscript.onreadystatechange = function () {\n\t\t\t\tif (script.readyState == \"loaded\" || script.readyState == \"complete\") {\n\t\t\t\t\tscript.onreadystatechange = null;\n\t\t\t\t\tif (typeof callback == \"function\") callback();\n\t\t\t\t}\n\t\t\t};\n\t\t} else { //Others\n\t\t\tscript.onload = function () {\n\t\t\t\tif (typeof callback == \"function\") callback();\n\t\t\t};\n\t\t}\n\t\tscript.src = url;\n\t\tdocument.getElementsByTagName(\"head\")[0].appendChild(script);\n\t}\n\n\tfunction initTelemetry(callback) {\n\t\tvar telemetryScript = \"https://appsforoffice.microsoft.com/telemetry/lib/1.0/hosted/AppsTelemetry.js\";\n\t\tgetScript(telemetryScript, function () {\n\t\t\t//Init telemetry\n\t\t\tvar telemetryOptions = {};\n\t\t\ttelemetryOptions[\"appVersion\"] = \"1.0\";\n\t\t\tAppsTelemetry.initialize(\"ratingDevX\", telemetryOptions);\t\t\t\t\n\t\t\tif (callback != undefined) {\n\t\t\t\tcallback();\n\t\t\t}\n\t\t})\t\t\n\t}\n\t\n\tfunction writeLog(msg) {\n\t\tif (AppsTelemetry != undefined) {\n\t\t\tAppsTelemetry.sendLog(AppsTelemetry.TraceLevel.info, msg);\n\t\t}\n\t\telse {\n\t\t\tinitTelemetry(function() {\n\t\t\t\tAppsTelemetry.sendLog(AppsTelemetry.TraceLevel.info, msg);\n\t\t\t})\n\t\t}\n\t}\t\n\t\n\t//call the init function as part of instantiation\n\tthis.init();\t\n}", "title": "" }, { "docid": "f7172ca3d728fd1d1ca98ad67f03a683", "score": "0.56205153", "text": "function updateScore() {\n changeScore();\n $('#score').text(score);\n}", "title": "" }, { "docid": "9e2acc90f610db13d504b64eeb2a350f", "score": "0.5607459", "text": "function setRating(rating) {\n document.getElementById(\"starRating\").innerHTML = \"\" + rating.toFixed(1) + \" / 5\";\n}", "title": "" }, { "docid": "5aaa4945a2db96fa62ecd008bb96204e", "score": "0.55994904", "text": "function updateReview(target, rating, index) {\n let patchData = {\n fields: {\n \"Star Rating\": [rating],\n },\n };\n\n $.ajax({\n headers: {\n Authorization: \"Bearer keyJY1gNiblDln7CL\",\n \"Content-Type\": \"application/json\",\n },\n url: `https://api.airtable.com/v0/appnjLNnNOAa7as5U/holidayData/${airtableResponse[index].id}`,\n type: \"PATCH\",\n data: JSON.stringify(patchData),\n }).done(function () {\n $(target).parent().parent().html(renderStars(rating));\n });\n}", "title": "" }, { "docid": "ccd79bd98cc19d0128e8c66cb3086084", "score": "0.55906487", "text": "function starRating() {\n\tif (moveCount === 35) {\n\t\t$('#one').css('display', 'none');\n\t\tstar = '2 stars';\n\t}\n\tif (moveCount === 45) {\n\t\t$('#two').css('display', 'none');\n\t\tstar = '1 star';\n\t}\n\tif (moveCount === 50) {\n\t\t$('#three').css('display', 'none');\n\t\tstar = '0 stars';\n\t}\n}", "title": "" }, { "docid": "0c46f3820b880574c5ee1748726a7770", "score": "0.55848527", "text": "function rating(num, provider_id){\n\tsMax = 0;\t// Isthe maximum number of stars\n\tfor(n=0; n<num.parentNode.childNodes.length; n++){\n\t\tif(num.parentNode.childNodes[n].nodeName == \"A\"){\n\t\t\tsMax++;\t\n\t\t}\n\t}\n\t\n\tif(!rated){\n\t\ts = num.id.replace(\"_\", ''); // Get the selected star\n\t\ta = 0;\n\t\tfor(i=1; i<=sMax; i++){\t\t\n\t\t\tif(i<=s){\n\t\t\t\tdocument.getElementById(\"_\"+i).className = \"on\";\n\t\t\t\tdocument.getElementById(\"rateStatus\").innerHTML = num.title;\t\n\t\t\t\tholder = a+1;\n\t\t\t\ta++;\n\t\t\t}else{\n\t\t\t\tdocument.getElementById(\"_\"+i).className = \"\";\n\t\t\t}\n\t\t}\n\t}\n\t\n\telse {\n\t\tids = prev_id.indexOf(provider_id);\n\t\tif(ids == -1){\n\t\t\ts = num.id.replace(\"_\", ''); // Get the selected star\n\t\t\ta = 0;\n\t\t\tfor(i=1; i<=sMax; i++){\t\t\n\t\t\t\tif(i<=s){\n\t\t\t\t\tdocument.getElementById(\"_\"+i).className = \"on\";\n\t\t\t\t\tdocument.getElementById(\"rateStatus\").innerHTML = num.title;\t\n\t\t\t\t\tholder = a+1;\n\t\t\t\t\ta++;\n\t\t\t\t}else{\n\t\t\t\t\tdocument.getElementById(\"_\"+i).className = \"\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "f242301ee3aff6d017549ace5f952b28", "score": "0.55793196", "text": "function AppsVotingWidget (url, holder, average, userVote) {\n //create an object to store our state\n var that = {\n url : url,\n userVote : userVote,\n average : average,\n /**\n * Function to send vote to the appserver\n * Vote is the vote - a number between 0 and 100\n */\n doVote : function (vote) {\n if (vote != that.userVote) {\n //do an ajax call to our url\n $.ajax({\n url : url + vote,\n context : that,\n success : function (data, status, xhr) {\n if (!data.error) {\n that.updateWidget(data, vote);\n } else {\n that.showError('Error recording vote', data);\n }\n },\n error : function (xhr, status, error) {\n that.showError('Ajax Error['+status+']: ', xhr);\n }\n });\n }\n },\n /**\n * Function to update each part of the widget when a vote is sent\n */\n updateWidget : function(data, user) {\n that.userVote = user;\n that.average = data.message.average;\n if(!that.over){\n that.setPosition(that.average);\n }\n \n var userRating = $('.app-user-rating', holder);\n userRating.removeClass('no-vote');\n //update the user's stars\n var stars = Math.round(user / 2) / 10;\n $('.stars-count', userRating).text(stars);\n //update the average stars also\n var stars = Math.round(data.message.average / 2) / 10;\n $('.app-average-rating .stars-count', holder).text(stars);\n \n $('.app-rating-count .rating-count', holder).text(data.message.count);\n\n //clear the error if it exists\n $('#apps-voting-error').remove();\n },\n /**\n * Abstracts setting the stars position (controls how many stars appear)\n */\n setPosition : function(percent) {\n $('.app-stars', holder).css('width', percent);\n },\n showError : function(message, object) {\n that.log(message, object);\n $('#apps-voting-error').remove();\n $(holder).append('<div id=\"apps-voting-error\" class=\"messages error\">' \n + Drupal.t('Failed to save vote. Please try again later.') + '</div>');\n },\n /**\n * Debug logging\n */\n log : function(message, object) {\n if (typeof(console) != 'undefined' && typeof(console.log) == 'function') {\n console.log(message, object);\n }\n }\n };\n\n //attach the event handlers for the voting widget\n $('.app-stars-holder', holder)\n .mousemove(function(e) { //move the stars around when you mouseover\n //this is the current element\n var left = e.pageX - $(this).offset().left;\n that.setPosition(left);\n that.over = true;\n }) \n .mouseout(function(e) { //reset the stars to the proper place when you mouse out\n that.over = false;\n that.setPosition(that.average);\n })\n .click(function(e){ //register a vote on click\n var vote = parseInt($('.app-stars', this).css('width'));\n that.doVote(vote);\n });\n\n //return our object\n return that;\n }", "title": "" }, { "docid": "4c87afcd076f26739a9baff467b6e979", "score": "0.5578895", "text": "function refreshLikes(event, rates, user, rate_by_user) {\n var likes = dislikes = 0;\n\n for (var key in rates) {\n if (rates.hasOwnProperty(key)) {\n rates[key].like == 1 ? likes ++ : dislikes++;\n }\n }\n\n l_msg = rate_by_user == 1 ? ' le gusta el ' : ' no le gusta el ';\n l_msg = l_msg + ' ' + event.type + ' ' + event.name;\n\n $('.likes-counter').text(likes);\n $('.dislikes-counter').text(dislikes);\n \n toastr.info('A ' + ' ' +user.name + ' ' +user.lastname + l_msg);\n}", "title": "" }, { "docid": "933ac16d6dcd95425b57f4febd2ed951", "score": "0.55762285", "text": "function updateScore () {\n changeScore ();\n $('.score').text(score);\n }", "title": "" }, { "docid": "f351ab15bc2665bdab5042d54d825e34", "score": "0.55681455", "text": "function processUpdates (rating) {\n // First rating is the one recorded in the database.\n if ($scope.active.reviewed == 1) {\n $scope.active.rating = rating;\n // Build updates object removing properties used by study controller that don't conform to schema.\n var updates = $scope.active;\n delete updates.reviewed;\n delete updates.inPlay;\n\n // Send updates to API\n CardFactory.update(updates)\n .then(function (updatedCard) {\n console.log(\"Updates to active card during study. Check the rating.\");\n console.log(updatedCard);\n\n if (rating == 2) {\n\n }\n $scope.nextCard();\n });\n\n } else {\n $scope.nextCard();\n }\n }", "title": "" }, { "docid": "8c360470be9d97fa433f611b9a9e605e", "score": "0.55552197", "text": "function setRateAjax(value, bookId, bars) {\n $.ajax({\n url: \"/ratings/\" + bookId,\n dataType: 'json',\n type: 'POST',\n data: {\n 'value': value,\n '_method': 'POST',\n '_token': $('meta[name=\"csrf-token\"]').attr('content')\n },\n success: function (data) {\n if (data['result'] == 2) {\n $(bars).barrating('readonly', true);\n $('#book-rating').barrating('destroy');\n setBarratingRead($('#book-rating'), parseFloat(data['average']));\n $('#book-reviews-amount').text(data['amount'] + ' reviews');\n }\n },\n error: function (data) {\n /* */\n }\n });\n}", "title": "" }, { "docid": "4e0d98494c66eae713bb9eba0ec9592d", "score": "0.5554201", "text": "function prItemRatingDisplay() {\n\tif (prDebug) {\n\t\talert(\"ratingDisplay\");\n\t}\n\tvar prItemRating = document.getElementById('prItemRating');\n\tif (prItemRating) {\n\t\thtml = '';\n\t\tif (pdPrOverall.reviewCount > 0) {\n\t\t\tif (pdPrOverall.reviewCount > 1) {\n\t\t\t\tvar prS = \"s\"\n\t\t\t} else {\n\t\t\t\tvar prS = \"\";\n\t\t\t}\n\t\t\thtml += '<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr>';\n\t\t\thtml += '<td>';\n\t\t\thtml += '<div class=\"prItemRatingStars\"><a href=\"#reviews\" onclick=\"pdOpenProductReviewsTab();\">';\n\t\t\thtml += '<img src=\"' + prClientDomain + 'mod_productReviews/skins/'\n\t\t\t\t\t+ prClientSkin + '/images/' + pdPrOverall.rating\n\t\t\t\t\t+ '.png\" border=\"0\">';\n\t\t\thtml += '</a></div>';\n\t\t\thtml += '</td>';\n\n\t\t\thtml += '<td>';\n\t\t\thtml += '<div class=\"prItemRatingLinks\"><a href=\"#reviews\" onclick=\"pdOpenProductReviewsTab();\" id=\"pdReadReviews\">';\n\t\t\thtml += pdPrOverall.reviewCount;\n\t\t\thtml += ' Review';\n\t\t\tif (pdPrOverall.reviewCount > 1) {\n\t\t\t\thtml += 's';\n\t\t\t}\n\t\t\thtml += '</a></div>';\n\t\t\thtml += '</td>';\n\n\t\t\thtml += '<td><span class=\"prItemRatingBar\">|</span></td>';\n\n\t\t\thtml += '<td>';\n\t\t\thtml += '<div class=\"prItemRatingLinks\">';\n\t\t\thtml += '<a href=\"' + prClientDomain\n\t\t\t\t\t+ 'mod_productReviews/reviewForm.php?productId='\n\t\t\t\t\t+ pdPrOverall.productId + '\">';\n\t\t\thtml += 'Write a Review';\n\t\t\thtml += '</a></div>';\n\t\t\thtml += '</td></tr></table>';\n\t\t\tprItemRating.innerHTML = html;\n\t\t}\n\t}\n\tif (prDebug) {\n\t\talert(\"ratingDisplay\");\n\t}\n}", "title": "" }, { "docid": "ddfcf19d79f10a0324c77673c95713ac", "score": "0.5550728", "text": "function update_stars(oStarContainer, sVote) {\r\n\t\r\n\tconsole.log('sVote:' + sVote + 'TotalStars:' + iTotalStars);\r\n\t\r\n\tif (sVote == \"\") {\r\n\t\tvar iVote = -1;\r\n\t} else {\r\n\t\tvar iVote = parseInt(sVote); \r\n\t}\r\n\t\r\n\tfor (var i=0; i<iTotalStars; i++) {\r\n//\t\toStarContainer.childNodes[i+1].src = getStarURL(iVote, i);\r\n//\t\toStarContainer.childNodes[i+1].src_orig = oStarContainer.childNodes[i+1].src;\r\n\t\toStarContainer.childNodes[i+1].className = '';\r\n\t\toStarContainer.childNodes[i+1].classList.add(getStarSize(iVote, i));\r\n\t\toStarContainer.childNodes[i+1].classList.add(getStarType(iVote, i));\r\n\t\toStarContainer.childNodes[i+1].originalClasses = oStarContainer.childNodes[i+1].className;\r\n\t}\r\n\r\n}", "title": "" }, { "docid": "985dfa2e7ab851fbd75f825eacbed843", "score": "0.55488145", "text": "function woo_review_star() {\n if (jQuery(\".stars\", \"#review_form\").length > 0) {\n jQuery(\".stars\").find(\"a\").on(\"click\", function() {\n jQuery(\"a.active\").removeClass(\"active\");\n jQuery(this).addClass(\"active\");\n return false;\n });\n }\n}", "title": "" }, { "docid": "7bc97b77e4b11594ee7e814dc3582306", "score": "0.55466354", "text": "function ratings_off(rating_score, insert_half, half_rtl) {\n\tif(!is_being_rated) {\n\t\tfor(i = 1; i <= ratingsL10n.max; i++) {\n\t\t\tif(i <= rating_score) {\n\t\t\t\tif(ratingsL10n.custom) {\n\t\t\t\t\tjQuery('#rating_' + post_id + '_' + i).attr('src', ratingsL10n.plugin_url + '/images/' + ratingsL10n.image + '/rating_' + i + '_on.' + ratingsL10n.image_ext);\n\t\t\t\t} else {\n\t\t\t\t\tjQuery('#rating_' + post_id + '_' + i).attr('src', ratingsL10n.plugin_url + '/images/' + ratingsL10n.image + '/rating_on.' + ratingsL10n.image_ext);\n\t\t\t\t}\n\t\t\t} else if(i == insert_half) {\n\t\t\t\tif(ratingsL10n.custom) {\n\t\t\t\t\tjQuery('#rating_' + post_id + '_' + i).attr('src', ratingsL10n.plugin_url + '/images/' + ratingsL10n.image + '/rating_' + i + '_half' + (half_rtl ? '-rtl' : '') + '.' + ratingsL10n.image_ext);\n\t\t\t\t} else {\n\t\t\t\t\tjQuery('#rating_' + post_id + '_' + i).attr('src', ratingsL10n.plugin_url + '/images/' + ratingsL10n.image + '/rating_half' + (half_rtl ? '-rtl' : '') + '.' + ratingsL10n.image_ext);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif(ratingsL10n.custom) {\n\t\t\t\t\tjQuery('#rating_' + post_id + '_' + i).attr('src', ratingsL10n.plugin_url + '/images/' + ratingsL10n.image + '/rating_' + i + '_off.' + ratingsL10n.image_ext);\n\t\t\t\t} else {\n\t\t\t\t\tjQuery('#rating_' + post_id + '_' + i).attr('src', ratingsL10n.plugin_url + '/images/' + ratingsL10n.image + '/rating_off.' + ratingsL10n.image_ext);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(jQuery('#ratings_' + post_id + '_text').length) {\n\t\t\tjQuery('#ratings_' + post_id + '_text').hide();\n\t\t\tjQuery('#ratings_' + post_id + '_text').empty();\n\t\t}\n\t}\n}", "title": "" }, { "docid": "fd665f449a52b159b241396bbf5785ce", "score": "0.55308354", "text": "function rate_product(wineryID,wineID,rate){ \n\tif(window.localStorage.getItem('cache-rate-'+wineryID)==null){\n\t\tvar winery_rating={}\n\t\twinery_rating[wineryID]={}\n\t\twinery_rating[wineryID].products={}\n\t\twinery_rating[wineryID].products[wineID]={}\n\t\t\n\n\t\tsaveRatingsToRemoteServer(wineryID,wineID,rate+1,function(json){\n\t\t\t\n\t\t\t //aws returns object\n if(typeof json=='object'){\n \tvar data=json\n }else{\n \t//show result into the target div\n \t\tvar data=JSON.parse(json);\n }\n\t\t\t\n\n\n\n\t\t\t//save to storage\n\t\t\twinery_rating[wineryID].products[wineID].rate=rate+1;\n\t\t\t\n\n\t\t\twinery_rating[wineryID].products[wineID].id=data.id\n\t\t\t\n\t\t\t//save to device\n\t\t\twindow.localStorage.setItem('cache-rate-'+wineryID,JSON.stringify(winery_rating));\n\t\t},function(){\n\t\t\t$('.cork-'+wineID).removeClass('active')\n\t\t})\n\n\t\n\t}else{\n\t\tvar winery_rating=JSON.parse(window.localStorage.getItem('cache-rate-'+wineryID));\n\n\n\t\tif(typeof winery_rating[wineryID].products[wineID]=='undefined') winery_rating[wineryID].products[wineID]={}\n\n\t\t//if item is present but no ratings yet\n\t\tif(typeof winery_rating[wineryID].products[wineID].rate=='undefined'){\n\t\t\tsaveRatingsToRemoteServer(wineryID,wineID,rate+1,function(json){\n\n\t\t\t\t //aws returns object\n\t if(typeof json=='object'){\n\t \tvar data=json\n\t }else{\n\t \t//show result into the target div\n\t \t\tvar data=JSON.parse(json);\n\t }\n\t\t\t\n\n\t\t\t\t//save to storage\n\t\t\t\twinery_rating[wineryID].products[wineID].rate=rate+1;\n\n\t\t\t\twinery_rating[wineryID].products[wineID].id=data.id\n\t\t\t\t//save to device\n\t\t\t\twindow.localStorage.setItem('cache-rate-'+wineryID,JSON.stringify(winery_rating))\n\n\t\t\t},function(){\n\t\t\t\t$('.cork-'+wineID).removeClass('active')\n\t\t\t})\n\n\t\t}else{ \n\t\t\tvar new_rate=rate+1\n\t\t\tif(winery_rating[wineryID].products[wineID].rate==new_rate){\n\t\t\t\tnew_rate=0\n\n\t\t\t\t//delete\n\t\t\t\tdeleteRatingsFromRemoteServer(winery_rating[wineryID].products[wineID].id,new_rate,function(json){\n\n\t\t\t\t\t //aws returns object\n\t\t if(typeof json=='object'){\n\t\t \tvar data=json\n\t\t }else{\n\t\t \t//show result into the target div\n\t\t \t\tvar data=JSON.parse(json);\n\t\t }\n\t\t\t\t\n\n\t\t\t\t\t//remove storage\n\t\t\t\t\tdelete winery_rating[wineryID].products[wineID]\n\n\n\t\t\t\t\t//save to device\n\t\t\t\t\twindow.localStorage.setItem('cache-rate-'+wineryID,JSON.stringify(winery_rating))\n\n\t\t\t\t\t$('.cork-'+wineID).removeClass('active')\n\n\t\t\t\t},function(){\n\t\t\t\t\tvar old_ratings=(winery_rating[wineryID].products[wineID].rate)\n\n\t\t\t\t\t$('.cork-'+wineID).removeClass('active')\n\n\t\t\t\t\tfor(var a=0;a<old_ratings.length;a++){\n\t\t\t\t\t\t$('.cork-'+wineID)[a].classList.add('active')\n\t\t\t\t\t}\n\n\t\t\t\t\t\n\t\t\t\t})\n\t\t\t//end delete\n\n\n\t\t\t}else{\n\t\t\t\n\t\t\t\t//update\n\t\t\t\tupdateRatingsToRemoteServer(winery_rating[wineryID].products[wineID].id,new_rate,function(json){\n\n\t\t\t\t\t //aws returns object\n\t\t if(typeof json=='object'){\n\t\t \tvar data=json\n\t\t }else{\n\t\t \t//show result into the target div\n\t\t \t\tvar data=JSON.parse(json);\n\t\t }\n\t\t\t\t\n\n\t\t\t\t\t//save to storage\n\t\t\t\t\twinery_rating[wineryID].products[wineID].rate=new_rate;\n\n\n\t\t\t\t\t//save to device\n\t\t\t\t\twindow.localStorage.setItem('cache-rate-'+wineryID,JSON.stringify(winery_rating))\n\n\t\t\t\t},function(){\n\t\t\t\t\tvar old_ratings=(winery_rating[wineryID].products[wineID].rate)\n\n\t\t\t\t\t$('.cork-'+wineID).removeClass('active')\n\n\t\t\t\t\tfor(var a=0;a<old_ratings.length;a++){\n\t\t\t\t\t\t$('.cork-'+wineID)[a].classList.add('active')\n\t\t\t\t\t}\n\n\t\t\t\t\t\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\n\t}\n}", "title": "" }, { "docid": "273f35e572c3fb1bbd32f440b95a3afb", "score": "0.55268013", "text": "function sendRate(node){\n\tnode.siblings('[name=\"rating\"]').val(node.data('rating'));\n\trated = node.data('rating');\n}", "title": "" }, { "docid": "c0acf4391c9a4cf1cd8671925350e200", "score": "0.55257964", "text": "function renderReviews() {\n averageRating = 0;\n count = 0;\n reviews.forEach(function(eachReview) {\n var eachRate = eachReview.get('rating');\n var li = $(document.createElement('li'))\n .raty({\n readOnly: true,\n score: (eachRate),\n hints: ['crap', 'awful', 'ok', 'nice', 'awesome']\n })\n .appendTo(reviewsList);\n\n count++;\n averageRating += eachRate;\n\n $(document.createElement('p'))\n .text(\"Time: \" + eachReview.get('createdAt'))\n .appendTo(li);\n\n $(document.createElement('p'))\n .text(\"Heard about event from: \" + eachReview.get('heardFrom'))\n .appendTo(li);\n\n $(document.createElement('p'))\n .text(\"Rate clearness of instructions: \" + eachReview.get('clearnessWeb'))\n .appendTo(li);\n\n $(document.createElement('p'))\n .text(\"Purchased challenger package?: \" + eachReview.get('challengerPurchased'))\n .appendTo(li);\n\n $(document.createElement('p'))\n .text(\"Satisfaction of pack: \" + eachReview.get('challengerSatisfaction'))\n .appendTo(li);\n\n $(document.createElement('p'))\n .text(\"Comments about bus: \" + eachReview.get('challengerBus'))\n .appendTo(li);\n\n $(document.createElement('p'))\n .text(\"Venue Rating: \" + eachReview.get('venueRate'))\n .appendTo(li);\n\n $(document.createElement('p'))\n .text(\"Venue comments: \" + eachReview.get('venueComments'))\n .appendTo(li);\n\n $(document.createElement('p'))\n .text(\"Rate event activities: \" + eachReview.get('rateActivities'))\n .appendTo(li);\n\n $(document.createElement('p'))\n .text(\"Would attend in the future again: \" + eachReview.get('attendAgain'))\n .appendTo(li);\n\n $(document.createElement('p'))\n .text(\"Event comments: \" + eachReview.get('eventComments'))\n .appendTo(li);\n\n $(document.createElement('p'))\n .text(\"Additional comments: \" + eachReview.get('additionalComments'))\n .appendTo(li);\n\n $(document.createElement('p'))\n .text(\"Future event comments: \" + eachReview.get('futureComments'))\n .appendTo(li);\n });\n }", "title": "" }, { "docid": "9559c2ec48bab2ee3462897ae93ef5ec", "score": "0.55127615", "text": "function RateSkill() {\n\n $.ajax({\n type: \"POST\",\n url: '/SkillRating/EmployeeRating',\n data: {},\n complete: function (result) {\n if (result.responseText) {\n\n AddReload();\n\n\n }\n else {\n ValidateEmployee('Db Error!Please check your connection');\n\n }\n\n }\n\n });\n\n }", "title": "" }, { "docid": "070be95d60e7d9b1fd549c99db1d58bc", "score": "0.55070204", "text": "function sendData(rating) {\n Alert.alert(\"pressed\");\n sendRatingPost(rating);\n}", "title": "" }, { "docid": "38bc5cdb8f6a9b5977312163bf3c394b", "score": "0.5483213", "text": "function addRatings(divid) {\n\n}", "title": "" }, { "docid": "e5f4d3aa926532df49538bd81eb8a9ed", "score": "0.5474226", "text": "function vote(oStarImage) {\r\n\t\r\n\tvar oStarContainer = oStarImage.parentNode;\r\n\t\r\n\tvar sID = oStarContainer.getAttribute('id').toString();\r\n\tsUUID = sID.replace(/stars_/g, '');\r\n\t\r\n\tvar iSelectedStar = 0;\r\n\tvar oCurrentStar = oStarImage;\r\n\twhile (oCurrentStar.previousSibling != null) {\r\n\t\tiSelectedStar++;\r\n\t\toCurrentStar = oCurrentStar.previousSibling;\r\n\t}\r\n\t\r\n\tvar iVote = aStarDefinition[iSelectedStar-1]['vote'];\r\n\t\r\n\tvar sURL = '/' + sUUID + '/votes/placeVote/?vote=' + iVote;\r\n\tvar myAjaxVoter = new Ajax.Request( \r\n\t\tsURL, \r\n\t\t{\r\n\t\t\tmethod: 'get', \r\n\t\t\tparameters: null,\r\n\t\t\tasynchronous: false,\r\n\t\t\tonComplete: function(response) {\r\n \t\t\tupdate_stars(oStarContainer, response.getHeader('X-sbVote'));\r\n \t\t}\r\n\t\t}\r\n\t);\r\n\t\r\n}", "title": "" }, { "docid": "554f676236f91660af0bb17218a9d897", "score": "0.5472267", "text": "function rating(approved) {\r\n\t\r\n\t //Gets the form from the HTML above\r\n var form = document.getElementById(\"form\");\r\n\t //Total is always incremented\r\n total++;\r\n \r\n\t\r\n\t\r\n\t//Initializes the firebase database and sets the table to be the default at '/'\r\n\tvar ref = firebase.database().ref('/');\r\n\t\r\n\t//Initializes the two values this program will change, total and approval\r\n\tvar totalRef = ref.child('total');\r\n\tvar approvalRef = ref.child('approval');\r\n\t\r\n\t//If the user has not submitted a rating yet, they can rate, otherwise they cannot affect the rating\r\n\tif(!submitted){\r\n\t\r\n\t//a transaction - Takes the value total in the table and adds one to it\r\n\ttotalRef.transaction(function(total) {\r\n\t\t\treturn total + 1;\r\n\t\t});\r\n\t//Does the same as above, but the transaction (increment) occurs when the approval button is pressed\r\n\tif(approved){\r\n approvalRef.transaction(function(approval) {\r\n\t\treturn approval + 1;\r\n\t\t});\r\n\t\t}\r\n\t\tsubmitted = true;\r\n\t\t}\r\n\t//This prints the rating using values from the table\r\n\tref.on(\"value\", function(snapshot) {\r\n document.getElementById(\"rating\").innerHTML = \"Approval Rating: \" + Math.floor((snapshot.val().approval/snapshot.val().total)*100) + \"%\";\r\n \r\n});\r\n\t\r\n \r\n }", "title": "" }, { "docid": "a8daf060a3f4ed0f1989c0e68033591e", "score": "0.5453778", "text": "function updateReviews(reviewList){\n\tfor(var r in reviewList){\n\t\t$(\"#reviewStyle\").html($(\"#reviewStyle\").html() + \n\t\t\"<div id=\\\"individReviews\\\"> Posted by: \" + \n\t\treviewList[r].name + \"(@\" + reviewList[r].author + \") <br />\" +\n\t\t\treviewList[r].text +\n\t\t\t\"<br /> <br /> Rating: \" + reviewList[r].rating.toString() +\n\t\t\t\"/5<br /></div>\");\n\t}\n}", "title": "" }, { "docid": "14f6a8f9c01c1bcd9c7be8935da8cc4c", "score": "0.5450452", "text": "function updateStars () {\n\tif (moves > 11 && moves <= 14){\n\t\t$(stars[2]).css(\"visibility\", \"hidden\");\n\t\trating = 2;\n\t}\t\t\n\telse if (moves > 14 && moves <= 18) {\n\t\t$(stars[1]).css(\"visibility\", \"hidden\");\n\t\trating = 1;\n\t}\n\telse if (moves > 18) {\n\t\t$(stars[0]).css(\"visibility\", \"hidden\");\n\t\trating = 0;\n\t}\t\n}", "title": "" }, { "docid": "c0ab8afd8ce521dabbf493ea561c1370", "score": "0.5446296", "text": "function UserSessionUpdate(object){\n \t\tif(object[$(\".Pro_detail\").attr(\"id\")]!==null){\n\t\t\t\t$('.inputzone').fadeOut(function(){1000,$(this).empty();$(this).append(\"<h6>Your Rating: \"+ object[$(\".Pro_detail\").attr(\"id\")]).fadeIn(500);});\n\t\t\t}\t\n \t}", "title": "" }, { "docid": "e5f1614922b7713afd0fc0e5d034fbf7", "score": "0.5440802", "text": "function newScore(score, comment_id, post_id){\n object = {\n score: score,\n comment_id: comment_id,\n post_id: post_id\n };\n // Default to comment url\n let url = '../api/comments';\n if (object.comment_id === null){\n url = '../api/posts';\n }\n $.ajax({\n url: url,\n type: \"post\",\n data: object,\n success: function (response) {\n // Create typeCol object to hold values needed to change button color\n let typeCol = null;\n if (object.comment_id !== null) {\n typeCol = [comment_id, \"up\", \"down\"];\n type = [\"comment\", comment_id];\n }\n else {\n typeCol = [post_id ,\"upPOST\", \"downPOST\"];\n type = [\"post\", post_id];\n }\n // Button color toggling logic\n toggleColor(typeCol, score);\n updateScore(type, response);\n }\n });\n}", "title": "" }, { "docid": "f6d9a1364c328239d9f64426e571049d", "score": "0.5429016", "text": "function off(me){\n\t\tif(!rated){\n\t\tif(!preSet){\n\t\t\tfor(i=1; i<=sMax; i++){\n\t\t\t\tdocument.getElementById(\"_\"+i).className = \"\";\n\t\t\t\tdocument.getElementById(\"rateStatus\").innerHTML = me.parentNode.title;\n\t\t\t}\n\t\t}else{\n\t\t\trating(preSet);\n\t\t\tdocument.getElementById(\"rateStatus\").innerHTML = document.getElementById(\"ratingSaved\").innerHTML;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "2726c93e5aa4ba79705f4f4c2511c593", "score": "0.541708", "text": "function update() {\n // Check for any sensitive content and update their style\n $sensitiveContent.each(updateSensitiveContent);\n // Display the $secretTotal number to the appropriate span on the page\n $(\".secretReportedCounter\").text($secretTotal);\n}", "title": "" }, { "docid": "9c9b4d3d17f6dd9696d62308824ca85a", "score": "0.5411309", "text": "function sendRating(rate, type, id)\n{\n $.ajax({\n headers: {\n 'X-CSRF-TOKEN': $('meta[name=\"csrf-token\"]').attr('content')\n },\n url: '/ratings',\n method: \"POST\",\n data:\n {\n 'rateNum' : rate,\n 'rateType': type,\n 'id': id\n },\n success: function(data)\n {\n var countRate = data.countRate;\n var avgRate = data.avgRate;\n var message = data.message;\n var userRate = data.userRate;\n\n if(typeof(countRate) != \"undefined\" && countRate !== null) {\n console.log(avgRate);\n $('#avgrate').html(`${avgRate} ستاره`);\n $('#countrate').html(`${countRate} رای`);\n $('#userRate').html(`${userRate} ستاره`);\n\n //showing message as sweetalert\n\n Toast.fire({\n icon: 'success',\n title: message\n });\n // Swal.fire({\n // icon: 'success',\n // title: 'تبریک!',\n // text: message,\n // });\n }\n else //calling sweetalert for display related message\n {\n Swal.fire({\n icon: 'warning',\n title: 'متاسفم!',\n text: message,\n footer: '<pre><a href=\"/register\">ثبت نام</a> <a href=\"/login\">ورود</a></pre>',\n showClass: {\n popup: 'animated fadeInDown faster'\n },\n hideClass: {\n popup: 'animated fadeOutUp faster'\n }\n });\n }\n\n },\n error: function(data)\n {\n var errors = data.responseJSON;\n console.log(errors);\n }\n });\n\n}", "title": "" }, { "docid": "c5f664d0a0d4453b5e780a1449c60030", "score": "0.5384627", "text": "function testStarRating() {\n if ((board.cardClickCount >= (oneStarThreshold * maxNumberCardsMultiplier *\n numberCards)) && (board.ratingStars == 2)) {\n board.ratingStars = 1;\n ratingDiv.innerHTML = oneStarInnerHTML;\n // keeping modal in sync with dashboard\n modalRating.innerHTML = oneStarInnerHTML;\n window.alert('You have one star left in the ratings. Keep going!');\n\n } else if ((board.cardClickCount >= (twoStarsThreshold *\n maxNumberCardsMultiplier * numberCards)) && (board.ratingStars == 3)) {\n board.ratingStars = 2;\n ratingDiv.innerHTML = twoStarsInnerHTML;\n // keeping modal in sync with dashboard\n modalRating.innerHTML = twoStarsInnerHTML;\n window.alert('You have two stars left. You can still finish well!');\n } else {\n console.log('');\n }\n}", "title": "" }, { "docid": "057073b61a402c81e53492b52005f5dd", "score": "0.53843707", "text": "function updateScore() {\n score++;\n $('.score').text(score);\n}", "title": "" }, { "docid": "057073b61a402c81e53492b52005f5dd", "score": "0.53843707", "text": "function updateScore() {\n score++;\n $('.score').text(score);\n}", "title": "" }, { "docid": "38199d4049e4a32c75d4402161e08309", "score": "0.5382998", "text": "function StarClick(rating) {\n\n currentClickedRating = rating;\n StarReset();\n StarFill(rating);\n\n // Sets display message to show current rating\n document.getElementById(\"starMessage\").innerHTML = IntRatingtoText(currentClickedRating);\n \n // Sets StarRating variable to a number from 0-10 based on where the click occurred\n document.getElementById(\"StarRating\").value = rating;\n}", "title": "" }, { "docid": "658565c7f1a07a6d8e9886b8fa932936", "score": "0.53761965", "text": "function rate(rating) {\r\n //set all to blank\r\n for (var i = 0; i < 5; i++) {\r\n document.getElementById(i).src = \"./images/blank.png\";\r\n }\r\n //set images to filled rating\r\n for (var i = 0; i <= rating; i++) {\r\n document.getElementById(i).src = \"./images/rating.png\";\r\n }\r\n}", "title": "" }, { "docid": "a6a67ad70c927bce3a6525f4c8f8b25d", "score": "0.5367989", "text": "function updateScore(score) {\r\n\tnum_of_guesses++;\r\n\t$('#score').html('Score: ' + score + ' / ' + num_of_guesses);\r\n}", "title": "" }, { "docid": "99687d2d1a81398478048c09e4b203cd", "score": "0.53586775", "text": "function adjustRating(severity) {\n document.getElementById(\"severity_value\").innerHTML = severity;\n}", "title": "" }, { "docid": "73f5f8db82f35cc00cb7059fb54b0544", "score": "0.5356264", "text": "function vote(guessIndex) {\n // Disable all vote buttons (user can only vote once per round)\n $(\".answer-card\").removeClass(\"answer-card-enabled\");\n $(\".answer-card\").addClass(\"answer-card-disabled\");\n\n $.ajax({\n url: '/vote',\n type: 'POST',\n data: {'guess': revealedGuesses[guessIndex]},\n contentType: 'application/json; charset=utf-8',\n dataType: 'json'\n });\n}", "title": "" }, { "docid": "6172aaa65efacaefb264b6c5633efe8d", "score": "0.53477067", "text": "function updateScore(){\n\t\t$(\"#num_correct\").html(got_correct);\n\t\t$(\"#completed\").html(completed);\n\t}", "title": "" } ]
141d438079d76884ab0c971a5f2da33b
Update Left hand fields.
[ { "docid": "47308f710cefce1fd37a80ce4b55ffb4", "score": "0.0", "text": "function getFields_click(key, opt) {\n \t var element = opt.$trigger.attr(\"connFieldId\");\n \t //element = element.substring(0, element.indexOf(\"-clone\"));\n \t getFieldsForContainer(element);\n \n }", "title": "" } ]
[ { "docid": "010f46d98362be60cafbae1d7e2dad5a", "score": "0.58439755", "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.58439755", "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": "3d874285e5979b031206bb9a2fad6a03", "score": "0.57824695", "text": "resetFields() {\n keys(this.initialFields).forEach((key) => this[key] = this.initialFields[key]);\n }", "title": "" }, { "docid": "43d9fdb28168b11167ac1d5f86ff68ec", "score": "0.5701013", "text": "function toggleLeftRightField() {\n if (currentField === 'leftField') {\n setCurrentField('rightField');\n setCurrentFieldHover('rightField');\n } else {\n setCurrentField('leftField');\n setCurrentFieldHover('leftField');\n }\n }", "title": "" }, { "docid": "74a49e4ae01450ea5e28645b640eea58", "score": "0.55657274", "text": "setLeft(_left) {\n this.left = _left;\n this.updateSecondaryValues();\n return this;\n }", "title": "" }, { "docid": "12aee66a829502c63ccf230071a74d33", "score": "0.5519496", "text": "updateFieldItems() {\n this.fieldItems = this.getFieldItems();\n this.fullQueryFields = this.getFullQueryFields();\n this.availableFieldItemsForFieldMapping = this.getAvailableFieldItemsForFieldMapping();\n this.availableFieldItemsForMocking = this.getAvailableFieldItemsForMocking();\n this.mockPatterns = this.getMockPatterns();\n }", "title": "" }, { "docid": "57abdf4dd7a85f5e2f9cb5226b91344a", "score": "0.54128575", "text": "updateFieldInternal(payload){ // payload = {field (req), newValue (req)}\n var self = this;\n var editField, newVal;\n var val = null, displayVal = '', valObj = null;\n\n if(payload.hasOwnProperty('field') && payload.field && payload.hasOwnProperty('newValue')){\n newVal = payload.newValue;\n if(newVal == \"\") newVal = null;\n \n editField = payload.field;\n //else if(payload.hasOwnProperty('storeName') && payload.hasOwnProperty('propname')) editField = clone(self.state.form[payload.storeName][payload.propname]);\n\n editField.dbVal = newVal;\n\n if(newVal != null){\n if(editField.valType == 'number'){\n val = newVal;\n displayVal = newVal.toString();\n }\n else if(editField.valType == 'text' || editField.valType == 'textarea'){\n displayVal = newVal;\n val = newVal.toString().toUpperCase();\n }\n else if(editField.valType == 'boolean'){\n if (currVal == true || currVal == 1){\n val = true;\n }\n else{\n val = false;\n }\n displayVal = val ? 'true' : 'false';\n }\n else if (editField.valType == 'combobox'){\n var subset, valObj;\n var joinSet = editField.JoinSet;\n if(joinSet){\n if(this.state.form[joinSet].length > 0 || this.state.database[joinSet].length > 0){\n if(self.state.form[joinSet].length > 0) subset = 'form';\n else subset = 'database';\n\n if(this.state[subset][joinSet].length > 0 && this.state[subset][joinSet][0].hasOwnProperty(editField.ValProp)){\n valObj = self.state[subset][joinSet].find(function(s){\n if(typeof(s[editField.ValProp]) === \"object\") return s[editField.ValProp].val == newVal;\n else return s[editField.ValProp] == newVal;\n });\n if(valObj){\n if(typeof(valObj[editField.ValProp]) === \"object\") val = valObj[editField.ValProp].val;\n else val = valObj[editField.ValProp];\n\n if(typeof(valObj[editField.TextProp]) === \"object\") displayVal = valObj[editField.TextPron].displayVal;\n else displayVal = valObj[editField.TextProp];\n }\n else{\n if(this.errDebug) console.error('ERROR: getValObj - NOT FOUND IN STATE.' + subset + '.' + joinSet + ' - ' + newVal);\n }\n }\n }\n else if(newVal !== null){\n if(this.errDebug) console.error('ERROR: getValObj - ' + joinSet + ' NOT LOADED')\n val = newVal;\n displayVal = newVal.toString();\n }\n }\n else {\n if(self.errDebug) console.error('ERROR: getValObj - NO JOINSET SPECIFIED')\n val = currVal;\n displayVal = currVal.toString();\n }\n }\n else{\n if (this.errDebug) console.error('ERROR: updateFieldInternal: TYPE NOT HANDLED - ' + this.payloadToStr(payload));\n /* NEED TO DO SOMETHING HERE */\n }\n }\n editField.val = val;\n editField.displayVal = displayVal\n\n //this.updateObjectProp({storeName: payload.storeName, propname: payload.propname, valObj: newValObj});\n }\n else{\n if (this.errDebug) console.error('ERROR: updateFieldInternal: PAYLOAD - ' + this.payloadToStr(payload));\n }\n }", "title": "" }, { "docid": "fe31281a2a955b81c42d1ccb3c2e62b0", "score": "0.5354761", "text": "changeField(name,value) { Store.changeProperty(\"profile.\"+name,value); }", "title": "" }, { "docid": "90f8e6eb0e4d4fa07d34cfd4ca50c12d", "score": "0.53080714", "text": "updateSelfData(ro) {}", "title": "" }, { "docid": "67b817be0309bae7fadda9e5b9acde9c", "score": "0.53049624", "text": "updateFieldsStatus () {\n let service = dependencyService\n service.updateFieldsStatus(this.formParameters)\n }", "title": "" }, { "docid": "841aa3400f2c38258480b698e857fe86", "score": "0.5304278", "text": "function update() {\n\t\tfilterName = $(\"#new_pipeline #filterName\");\n\t\trequestType = $(\"#new_pipeline #requestType\");\n\t\trequestRank = $(\"#new_pipeline #requestRank\");\n\t\tmakeTrace = $(\"#new_pipeline #makeTrace\");\n\t\ttips = $(\"#new_pipeline .validateTips\");\n\t\tallFields = $([]).add(filterName).add(requestType).add(requestRank).add(makeTrace);\n\t}", "title": "" }, { "docid": "8763820b5e59d6e40bf0c5904ed2b140", "score": "0.5297873", "text": "changeField(name,value) {\n Store.changeProperty(\"login.\"+name,value);\n }", "title": "" }, { "docid": "676bdbfe03a7fac92f7497f383f57c25", "score": "0.5215149", "text": "static modifyFields() {\n return [\n 'article_id',\n 'user_id',\n 'comment',\n 'flagged',\n ];\n }", "title": "" }, { "docid": "ca2893f58b4c4d778ad66baf93a8715e", "score": "0.52138364", "text": "setLeftAndUpdateParent(node) {\n this.left = node;\n if (node) {\n node.parent = this;\n node.parentSide = LEFT;\n }\n }", "title": "" }, { "docid": "42a499b0e7d5034e54e5ff6c4e3180c7", "score": "0.5203687", "text": "updateUser (field, newValue) {\n this.state[field] = newValue\n this.setState(this.state)\n }", "title": "" }, { "docid": "4bb5387b063e5747803df9554f0efe3a", "score": "0.5202188", "text": "static update(fields, value) {\n if (typeof value === 'number') {\n fields.position = value;\n } else if (typeof value === 'string') {\n fields.insertString = value;\n } else if (typeof value === 'object' && value.d !== undefined) {\n fields.delNum = value.d;\n }\n }", "title": "" }, { "docid": "1b6095cac020030473c0a10f86b1d24b", "score": "0.5199091", "text": "onUpdateOthers (data) {\n const { challenge: oldChallenge } = this.state\n const newChallenge = { ...oldChallenge }\n newChallenge[data.field] = data.value\n this.setState({ challenge: newChallenge })\n }", "title": "" }, { "docid": "27d6fe5f2a0adf722dd7aef5e58bb7d3", "score": "0.51609004", "text": "moveMaterialSchemaValue(fieldName, newField, oldField) {\n this.fields[fieldName].attributes[newField] = this.fields[fieldName].attributes[oldField]; // Copy the oldField value to the newField value\n this.fields[fieldName].attributes[oldField] = null; // And now remove the oldField by Nulling\n }", "title": "" }, { "docid": "ab670ddb0cf82bcc878810625d06ee63", "score": "0.513566", "text": "updated(_changedProperties) { }", "title": "" }, { "docid": "6a1aedf4821c9cdd8d9b8be20b26462a", "score": "0.51336795", "text": "function updateDisplayedValues() {\n displayNameField.text(displayNameVal);\n emailField.text(emailVal);\n phoneField.text(phoneVal);\n zipcodeField.text(zipcodeVal);\n }", "title": "" }, { "docid": "a2dcbe37e2f6a55ce216ae9e38a0c756", "score": "0.5085615", "text": "function updateRequiredField() {\n var fieldObject = pageFieldList[1];\n fieldObject = ['proposal.plannedPlatforms'];\n\n var platformField = conceptCommonServiceField.field('proposal.plannedPlatforms');\n var platforms = platformField.value() || [];\n\n platforms.forEach(angular.bind(this, function(platform){\n var fieldList = this.getFieldList(platform.platform.code);\n\n for (var field in fieldList) {\n fieldObject.push( fieldList[field] );\n\n //set field active\n conceptCommonServiceField.field(fieldList[field]).active(true);\n }\n }));\n\n pageFieldList[1] = fieldObject;\n }", "title": "" }, { "docid": "3923bb1749f87f26497d10c42dfa6859", "score": "0.5085448", "text": "fillFields(newParameters, newOptional) {\n this.setState({parameters: newParameters, optional:newOptional})\n\n }", "title": "" }, { "docid": "bf2ce86d3bbe8b0f011623fc6bdeada2", "score": "0.5080828", "text": "function updateField() {\r\n //update general text field\r\n for (var i = 0; i < glob_data.length; i++) {\r\n try {\r\n var this_node_key = glob_data[i].pk + '.' + glob_data[i].fields.node_name\r\n if (this_node_key == obj) {\r\n $('#node_details .description').text(glob_data[i].fields.node_description)\r\n $('#node_details .details').text(glob_data[i].fields.details)\r\n $('.node-name-details').text(glob_data[i].fields.node_name)\r\n $active_node_name = glob_data[i].fields.node_name\r\n }\r\n else { }\r\n }\r\n catch (err) {\r\n console.log(err)\r\n }\r\n }\r\n updatePicture()\r\n\r\n function updatePicture() { }\r\n // update picture set for slides\r\n var $target_slides = $('.slide img')\r\n\r\n for (var j = 0; j < $target_slides.length; j++) {\r\n $thisslide = $target_slides[j]\r\n $thisslide.src = \"\\\\static\\\\app\\\\content\\\\node_content\\\\\" + $active_node_name + \"images\\\\\" + (j + 1).toString() + \".jpg\"\r\n\r\n }\r\n }", "title": "" }, { "docid": "0dc9e739450091d0ade21128ab830404", "score": "0.5079072", "text": "function update(req, res){\n console.log(req.body.local.firstName);\n User.findById(req.params._id, function(err,user){\n user.local.firstName = req.body.local.firstName\n user.local.lastName = req.body.local.lastName\n user.local.email = req.body.local.email\n user.local.password = req.body.local.password\n user.save(function(err){\n if(err) console.log(err)\n res.json({success: true, message: \"User has been updated!\"});\n });\n });\n}", "title": "" }, { "docid": "177cbec28ee1f0ede0dde63223f4fa65", "score": "0.507257", "text": "function updateField(event) {\n const val = event.target.value;\n changeAct(val);\n }", "title": "" }, { "docid": "f58ee553bc66448345c4a94b083f80f4", "score": "0.50720245", "text": "function Update(self){\n self.key.update(); //do not edit this line\n /********************************/\n /**PUT YOUR UPDATING CODE BELOW**/\n /*******************************/\n\n\n}", "title": "" }, { "docid": "41a566086bee8ac8c9374beebf40ddaf", "score": "0.5059227", "text": "function localFormAdjustment(formid,fieldid,data){\r\n var form = cachedForms[formid];\r\n var field = _.find(form.elements,function(f){\r\n return fieldid == f.id\r\n });\r\n _.each(_.keys(data),function(k){\r\n if(data[k]){\r\n field.localEdits[k] = data[k] \r\n }else{\r\n /*if(k=='validations'){\r\n if(field.localEdits.hasOwnProperty('validations')){\r\n delete field.localEdits[k][0].localmessage;\r\n }\r\n }else{\r\n delete field.localEdits[k];\r\n }*/\r\n delete field.localEdits[k];\r\n }\r\n });\r\n return field;\r\n}", "title": "" }, { "docid": "ce609f529704ceeb7676e6022a479356", "score": "0.5055697", "text": "update() {\n\t\tlet title = this.refs.newTitle.value\n\t\tlet date = this.refs.newDate.value\n\t\tlet des = this.refs.newDescription.value\n\t\tlet link = this.refs.newLink.value\n\t\tlet id = this.props._id\n\n\t\tif(title == \"\" || date == \"\" || des == \"\" || link == \"\"){\n\t\t\talert(\"Fields can not be empty\")\n\t\t}else{\n\t\t\tlet data = '{\"Title\":\"' + title + '\",\"Description\":\"' + des + '\",\"Year\":\"' + date + '\",\"Link\":\"' + link + '\"}'\n\n\t\t\tthis.props.dispatch(updateProject(this.props._id, data))\n\t\t}\n\t}", "title": "" }, { "docid": "b7ef0c6fcfe2eb29437278107f3e76ee", "score": "0.5052583", "text": "setLeft(newLeft) {\n this.#leftChild = newLeft;\n }", "title": "" }, { "docid": "5cbd53cb8b7195dea63cb6a5a67f72a3", "score": "0.50390387", "text": "function adminUpdate(data) {\n\t\t\t\n\t\t\t\n\t\t}", "title": "" }, { "docid": "755ca1b2b6f3ce4bcbb50a311856fa4e", "score": "0.50390184", "text": "function ClearFields() {\r\n self.model.code = \"\";\r\n self.model.component = \"\";\r\n }", "title": "" }, { "docid": "a89fbadfa228c6a5d0db308116ea96c3", "score": "0.5031442", "text": "update(){}", "title": "" }, { "docid": "a89fbadfa228c6a5d0db308116ea96c3", "score": "0.5031442", "text": "update(){}", "title": "" }, { "docid": "a89fbadfa228c6a5d0db308116ea96c3", "score": "0.5031442", "text": "update(){}", "title": "" }, { "docid": "78939a49dbfcd6a49d700a1fed8a9296", "score": "0.5027176", "text": "_updatePreviewField(){\n if(this._showingContacts && this._chosenContact !== null){\n // Meh\n this._displayName.value = this._chosenContact.firstName + \" \" + this._chosenContact.lastName;\n }\n else{\n this._displayName.value = this._user.FirstName + \" \" + this._user.LastName;\n }\n }", "title": "" }, { "docid": "d9eba996c692474c27f4845ac0a4ad1d", "score": "0.5023911", "text": "function thisFieldOverwrite(fldobj){\r\n\tif (!overwritemodeenabled) return;\r\n\t\r\n\tvar aaname = fldobj.name;\r\n\tvar pool = aaname.split(\"_\");\r\n\t//var ipos = parseInt(pool[1]);\r\n\tvar ilen = parseInt(pool[2]);\r\n\tvar vlen = fldobj.value.length;\r\n\tif (ilen <= vlen){ //we have a full field\r\n\t\tsetOverWriteMode((overwriteSetting==1)||(overwriteSetting==3)||(overwriteSetting==5)||(overwriteSetting==7));\r\n\t} else if ((ilen > vlen) && (vlen != 0)){\r\n\t\tsetOverWriteMode((overwriteSetting==2)||(overwriteSetting==3)||(overwriteSetting==6)||(overwriteSetting==7));\r\n\t} else if (vlen == 0){\r\n\t\tsetOverWriteMode((overwriteSetting==4)||(overwriteSetting==5)||(overwriteSetting==6)||(overwriteSetting==7));\r\n\t}\r\n}", "title": "" }, { "docid": "445934ed3d632d1bc1badb090e291612", "score": "0.5013097", "text": "handleUpdate() { \n if (// Check if the needed fields are not empty\n this.state.email !== '' &&\n this.state.firstName !== '' &&\n this.state.lastName !== ''\n ) {// The Put method will be as follow\n fetch(myGet + '/' + this.state.user.id, {\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n method: 'put',\n body: JSON.stringify({\n // Declare and stringify the fields that need updating\n email: this.state.email,\n firstName: this.state.firstName,\n lastName: this.state.lastName\n })\n })\n .then(() => this.props.fectchAccount()) // Fetch the exact account again to apply changes\n alert('The account has been successfully updated')\n } else {\n alert('Please enter correct information')\n }\n }", "title": "" }, { "docid": "9fdc3a2c6916a8fae80879fd4dad51df", "score": "0.50063425", "text": "modifyField(field) {\r\n\r\n // Ask user for value\r\n var value = prompt(field.description || field.name, this.props.action.options[field.id] || \"\")\r\n if (!value)\r\n return\r\n\r\n // Store value\r\n this.props.action.options[field.id] = value\r\n this.forceUpdate()\r\n\r\n }", "title": "" }, { "docid": "d8ede4cf679a429ff0effebc83ab8d25", "score": "0.49993506", "text": "function update() {\n\t\tvar updateField = \"\";\n\t\tif ((newName.value != \"\") && (newName.value != name.innerHTML)) {\n\t\t\tupdateField += \"name will be updated from \" + name.innerHTML + \" to \" + newName.value +\"\\n\";\n\t\t}\n\t\tif ((newEmail.value != \"\") && (newEmail.value != email.innerHTML)) {\n\t\t\tupdateField += \"email will be updated from \" + email.innerHTML + \" to \" + newEmail.value +\"\\n\";\n\t\t}\n\t\tif ((newPhone.value != \"\") && (phone.innerHTML != newPhone.value)) {\n\t\t\tupdateField += \"phone will be updated from \" + phone.innerHTML + \" to \" + newPhone.value +\"\\n\";\n\t\t}\n\t\tif ((newZipcode.value != \"\") && (zipcode.innerHTML != newZipcode.value)) {\n\t\t\tupdateField += \"zipcode will be updated from \" + zipcode.innerHTML + \" to \" + newZipcode.value +\"\\n\";\n\t\t}\n\t\tif ((newPassword.value != \"\") && (password.innerHTML != newPassword.value)) {\n\t\t\tupdateField += \"password will be updated from \" + password.innerHTML + \" to \" + newPassword.value +\"\\n\";\n\t\t}\n\t\tif (updateField != \"\") {\n\t\t\talert(updateField);\n\t\t} else {\n\t\t\talert(\"nothing will be updated.\");\n\t\t}\n\t\tupdateProfile();\n\t}", "title": "" }, { "docid": "38c169f73f8bc0145d7bc92479da5e78", "score": "0.4993635", "text": "function setMenuLeft() {\n removeMenuChanges();\n $('.menu').addClass('menu-left');\n }", "title": "" }, { "docid": "fe7bf20c69ba0629875755a90451545f", "score": "0.4975429", "text": "updateOffice(field, event){\n\t //this gives a warning, but ignore it because the state\n\t //is not used for rendering\n\t this.state.office[field]= event.target.value;\n }", "title": "" }, { "docid": "24e616a2d03ad205d188592641041091", "score": "0.49749786", "text": "setLeft(valueNew){let t=e.ValueConverter.toNumber(valueNew);null===t&&(t=this.getAttributeDefaultValueInternal(\"Left\")),t!==this.__left&&(this.__left=t,e.EventProvider.raise(this.__id+\".onPropertyChanged\",{propertyName:\"Left\"}),this.__processLeft())}", "title": "" }, { "docid": "493f6bf24818aa231bd570c142c78878", "score": "0.49674085", "text": "_updateCommonFields(updateData, {\n firstName, lastName, picture, website, interests, careerGoals, retired,\n }) {\n if (firstName) {\n updateData.firstName = firstName;\n }\n if (lastName) {\n updateData.lastName = lastName;\n }\n if (picture) {\n updateData.picture = picture;\n }\n if (website) {\n updateData.website = website;\n }\n if (interests) {\n updateData.interestIDs = Interests.getIDs(interests);\n }\n if (careerGoals) {\n updateData.careerGoalIDs = CareerGoals.getIDs(careerGoals);\n }\n if (_.isBoolean(retired)) {\n updateData.retired = retired;\n }\n // console.log('_updateCommonFields', updateData);\n }", "title": "" }, { "docid": "c99e7aedc52b17f47082e11c752219d5", "score": "0.49663693", "text": "edit() {\n if (this.valid && this.changed) {\n\n ipcRenderer.send('studentUpdate', {\n id: this.id,\n fullName: this.name.value,\n socialID: this.sid.value,\n parentsName: this.parentName.value,\n parentNumber: this.parentPhone.value,\n sex: this.sex.value,\n phoneNumber: this.phone.value,\n birthDate: `${this.birthDate.year.value}/${this.birthDate.month.value}/${this.birthDate.day.value}`,\n address: this.address.value\n })\n\n this.changed = false\n }\n }", "title": "" }, { "docid": "514e1caa3151ae217945088609d829a7", "score": "0.49661168", "text": "function updateFieldLabel (event) {\n lib.updateActiveFieldLabel(this.value);\n }", "title": "" }, { "docid": "56c98da62b2378323a5b1ee1760e70e6", "score": "0.49641323", "text": "updateForm(data) {\n\t\tthis.employeeName.value = data.name;\n\t\tthis.employeeAge.value = data.age;\n\t\tthis.employeePosition.value = data.position;\n\t\tthis.employeeSalary.value = data.salary;\n\t}", "title": "" }, { "docid": "373944cbc2cb61d00f234a8bd488c037", "score": "0.49616203", "text": "function ClearFields() {\r\n self.model.code = \"\";\r\n self.model.name = \"\";\r\n self.model.address = \"\";\r\n }", "title": "" }, { "docid": "c98c9b6b3f9d32312ca12deb2c6feddf", "score": "0.49561644", "text": "_fieldUpdated(e) {\n // Ensure the VIN is valid, and update the year and make accordingly\n if(e.propertyName === VehicleFields.vin){\n const value = this.VIN.value;\n\n if (value === \"\"){\n this._vin.error = null;\n this.Make.value = \"\";\n this.Year.value = \"\";\n }\n else if (Vehicle._validateVIN(value)) {\n this._vin.error = null;\n this.Make.value = Vehicle._getMake(value);\n this.Year.value = Vehicle._getYear(value);\n }\n else {\n this._vin.error = \"Invalid VIN\";\n this.Make.value = \"INVALID\";\n this.Year.htmlObj.value = \"INVALID\";\n }\n }\n\n this.__sendPropChangeEvent(e.propertyName);\n }", "title": "" }, { "docid": "5872e7653e62e3ca34abb5989addc6b7", "score": "0.49442497", "text": "async update(props) {\n try {\n const {id, password, type} = props\n if (!(id, password, type) || Object.values(props.includes(\"\"))) {\n throw \"One of the required fields are empty!\"\n }\n const hashedPassword = await this.hash(password)\n // fix this so we use sql file\n // await this.db.none(sql.add, [id, name, chinese, price, category, enabled]);\n await this.db.none(\"UPDATE menu SET(id, password, type) VALUES($1, $2, $3) WHERE id = $1\", [id, hashedPassword, type]);\n } catch (err) {\n console.log(err)\n }\n }", "title": "" }, { "docid": "dd0a7340962d1c28fc7024056a710fc5", "score": "0.4943204", "text": "updateFullName() {\n if (\n this.state.changedName !== \"\" &&\n this.state.changedName !== null &&\n this.state.changedName !== undefined\n ) {\n this.setState({\n fullName: this.state.changedName,\n editModalFlag: false,\n });\n } else {\n this.setState({\n error: {\n required: true,\n },\n });\n return;\n }\n }", "title": "" }, { "docid": "43f07d2ff097cf623d676ade19b405f9", "score": "0.49429283", "text": "updated(_changedProperties){}", "title": "" }, { "docid": "43f07d2ff097cf623d676ade19b405f9", "score": "0.49429283", "text": "updated(_changedProperties){}", "title": "" }, { "docid": "6d19beba41ef68fab6f187142c04de93", "score": "0.4934269", "text": "function _addToChangedFields(obj)\r\n {\r\n if(obj && !(this.isFieldModified(obj.id)))\r\n {\r\n this._mChangedFields[this._mChangedFields.length] = obj.id;\r\n this._mHasUserModifiedData = true;\r\n }\r\n }", "title": "" }, { "docid": "5423b38699dfedab39c1e29cfb7b10eb", "score": "0.49306056", "text": "function saveLeft(callback) {\n if (!_templateName) {\n return callback(\"templateName not set\");\n }\n var data = superGetData(_currentPath + \".left\");\n DistModel.touch({ root: data });\n superGetObject({\n objId: _templateName,\n type: \"cad-template\",\n data: data\n }, function (err) {\n if (err) {\n return callback(err);\n }\n return callback(null);\n });\n }", "title": "" }, { "docid": "e52d927abd3855fe01db75caa7f9314a", "score": "0.4930305", "text": "function update() {\n\t\tfilterIdentifier = $(\"#new_filter #filterIdentifier\");\n\t\talgorithmName = $(\"#new_filter #algorithmName\");\n\t\tmanagerName = $(\"#new_filter #managerName\");\n\t\tallFields = $([]).add(filterIdentifier).add(algorithmName).add(managerName);\n\t}", "title": "" }, { "docid": "2773ccccf78c7fcbcce2865371d6f2d3", "score": "0.4925773", "text": "left(){\n this.save();\n this.x--;\n this.isConflict();\n }", "title": "" }, { "docid": "6e8045c68cbd91ac0448cb51a0a2f310", "score": "0.49242282", "text": "updateWidgetLeft(x) {\n this.x = x;\n this.updateChildWidgetLeft(x);\n }", "title": "" }, { "docid": "7ea90803c58c28aaa99eee3f0f50eefb", "score": "0.49221888", "text": "function update_fields() {\n const mods = get_mods();\n document.getElementById(\"od-field\").value = mods.ez ? beatmap_data.od * 0.5 : beatmap_data.od;\n document.getElementById(\"n-field\").value = beatmap_data.note_count;\n document.getElementById(\"stars-field\").value = (mods.dt ? beatmap_data.stars_dt : (mods.ht ? beatmap_data.stars_ht : beatmap_data.stars_nt)).toFixed(2);\n // refresh their styles\n document.getElementById(\"od-field\").dispatchEvent(new Event(\"blur\"));\n document.getElementById(\"n-field\").dispatchEvent(new Event(\"blur\"));\n document.getElementById(\"stars-field\").dispatchEvent(new Event(\"blur\"));\n}", "title": "" }, { "docid": "10698bf5fc8629381d607644afb724a9", "score": "0.4919942", "text": "function update_field(name, path, type, content) {\n\t\t$.ajax({\n\t\t\ttype: 'post',\n\t\t\turl: WSData.server_path + '/admin/fields',\n\t\t\tdata: {name: name, path: path, type: type, content: content}\n\t\t}).done(function (d) {\n\t\t\t$('#ws-saving-status').html('<i class=\"icon-check\"></i> Saved.');\n\t\t}).fail(function (d) {\n\t\t\t$('#ws-saving-status').html('<i class=\"icon-remove\"></i> Error saving.');\n\t\t});\n\t}", "title": "" }, { "docid": "c41d6a8f118744690dbc93aa7a6b84e8", "score": "0.49193934", "text": "changeFocusToLeft() {\n cadManager.setCurrentFoot(\"left\");\n this.forceUpdate();\n }", "title": "" }, { "docid": "6c4dacf8457b5ffcc2325ad0798c42e8", "score": "0.4914023", "text": "function modifyForm() {\n\tshowStatusMessage(\"\");\n\t// override manual deposit fields\n\tif ((dojo.byId('status').value == 'PROC' && dojo.byId(\"moduleId\").value == \"ADVW003\") ||\n\t\t\t((dojo.byId('status').value == 'APPR' && dojo.byId(\"moduleId\").value == \"ADVW003\") || \n\t\t\t(dojo.byId('status').value == 'SUBM' && dojo.byId(\"moduleId\").value == \"ADVW003\") || \n\t\t\t(dojo.byId('status').value == 'RJCT' && dojo.byId(\"moduleId\").value == \"ADVW003\") ||\n\t\t\t(dojo.byId('status').value == 'APPR' && dojo.byId(\"moduleId\").value == \"APRW004\") || \n\t\t\t(dojo.byId('status').value == 'RJCT' && dojo.byId(\"moduleId\").value == \"APRW004\") ||\n\t\t\t(dojo.byId('status').value == 'SUBM' && dojo.byId(\"moduleId\").value == \"APRW004\")) &&\n\t\t\t(dojo.byId('previouslyPROC').value == 'Y')) {\n\t\ttoggleAllFieldsReadonly(true);\n\t\t// toggleDojoControlsReadonly('advance', true);\n\t\ttoggleFieldReadonly(manualDepositDocNum, false);\n\t\ttoggleFieldReadonly(manualDepositAmount, false);\n\t\ttoggleDojoControlsReadOnly('advance', true);\n\t\tdisableCbDeleteButtons(true);\n\t\tdojo.byId('buttonSave').disabled = true;\n\t\t\n\t\tbuttonSave.disabled = true;\n\t\t\n\t} else {\n\t\ttoggleAllFields(false);\n\t\ttoggleImages(\"visible\");\n\t\ttoggleDojoControls('advance', false);\n\t\ttoggleField(manualDepositDocNum, true);\n\t\ttoggleField(manualDepositAmount, true);\n\t\n\t\t// override manual warrant field\n\t\tif (dojo.byId(\"moduleId\").value == \"ADVW003\" || dojo.byId(\"moduleId\").value == \"APRW004\"){\n\t\t\ttoggleField(manualWarrantIssdInd, false);\n\t\t\ttoggleField(manualWarrantDocNum, false);\n\t\t}\n\t\telse{\n\t\t\ttoggleField(manualWarrantIssdInd, true);\n\t\t\ttoggleField(manualWarrantDocNum, true);\n\t\t}\n\t\t\n\t\t/*\n\t\t * if (dojo.byId(\"moduleId\").value.substring(0,2) == \"AP\"){ // approver\n\t\t * is modifying buttonSave.disabled = true; } else{ buttonSave.disabled =\n\t\t * false; }\n\t\t */\n}\n\tbuttonSave.disabled = true;\n\tbuttonModify.disabled = true;\n\tbuttonSave.style.display = \"inline\";\t\n\tbuttonSubmit.style.display = \"inline\";\n\tbuttonSubmit.disabled = false;\n\tbuttonApprove.style.display = \"none\";\n\tbuttonApproveWithComments.style.display = \"none\";\n\tbuttonApproveNext.style.display = \"none\";\n\tbuttonApproveSkip.style.display = \"none\";\n\tbuttonReject.style.display = \"none\";\n\tmodifyClicked = true;\n}", "title": "" }, { "docid": "6972dc8710a99f9c8b2d245b231c0510", "score": "0.4906214", "text": "update(_changedProperties) {\n super.update();\n }", "title": "" }, { "docid": "743154580eb427c3bd6945f8ed801a6d", "score": "0.49055046", "text": "function updateRightandLeft()\n{\n\tvar leftColor;\n\tvar rightColor;\n\tleftColor = leftDrop.getFill();\n\trightColor = rightDrop.getFill();\n\tif(leftColor == 'red')\n\t{\n\t\tleftV = 0;\n\t}\n\tif(leftColor == 'green')\n\t{\n\t\tleftV = 1;\n\t}\n\tif(rightColor == 'red')\n\t{\n\t\trightV = 0;\n\t}\n\tif(rightColor == 'green')\n\t{\n\t\trightV = 1;\n\t}\n}", "title": "" }, { "docid": "c003db93cff00d8859b60e1144e3e6ad", "score": "0.4904566", "text": "function updateField( F, S ){\n\t$( F ).val( $( F ).val( ) + S );\t//Appends content of TXT to the field FLD\n}", "title": "" }, { "docid": "dab10bee70ca03952cc156bd9da4672b", "score": "0.49031648", "text": "updateField(field) {\n this.setState({\n [field.target.id]: field.target.value\n });\n console.log(\"ESTADO :\" + field.target.id + \" Valor :\" + field.target.value);\n }", "title": "" }, { "docid": "64d66e3289200fab95b0938fbf117db1", "score": "0.49003032", "text": "function setHeadLabel(){\n ctrl.headlabel = ctrl.itemTypes[ctrl.editedItem.type][ctrl.editedItem.id?'update':'create'];\n }", "title": "" }, { "docid": "28d804e48837bd10814da79388b5e795", "score": "0.4887223", "text": "function SetField(key1, key2, key3)\n{\n GoPage('fields');\n\n // See whether we are on the right field\n if ( key1 && key2 && key3 &&\n\t (!DocTest(\"<b>\"+key1+\"</b></td>\") ||\n\t !DocTest(\"<b>\"+key2+\"</b></td>\") ||\n\t !DocTest(\"<b>\"+key3+\"</b></td>\")) )\n {\n\t// Go to the right field if possible\n\tif ( FormSelect(null, 'key_1', null, key1) &&\n\t FormSelect(null, 'key_2', null, key2) &&\n\t FormSelect(null, 'key_3', null, key3) )\n\t{\n\t FormSubmit('field', 'Changing to: ' + key1 + ' ' + key2 + ' ' + key3);\n\t}\n }\n}", "title": "" }, { "docid": "6242a23aeddd3def894f6e13d7efc732", "score": "0.48828813", "text": "update() {\n //DEBUG\n console.log('update ')\n //set the state variables so that they correspond the values currently in the corresponding input fields\n this.setState({\n name: this.refs.name.value,\n address: this.refs.address.value,\n email: this.refs.email.value,\n gender: this.refs.gender.value,\n });\n }", "title": "" }, { "docid": "0e3344d9eb1a17ed5537db8a9d7b36c3", "score": "0.48816645", "text": "updated(_changedProperties) {\n }", "title": "" }, { "docid": "0e3344d9eb1a17ed5537db8a9d7b36c3", "score": "0.48816645", "text": "updated(_changedProperties) {\n }", "title": "" }, { "docid": "0e3344d9eb1a17ed5537db8a9d7b36c3", "score": "0.48816645", "text": "updated(_changedProperties) {\n }", "title": "" }, { "docid": "c18876771837fe26a5bd0aaa771a95a2", "score": "0.48788676", "text": "updateStudent() {\n\n\t}", "title": "" }, { "docid": "ed61a6ded23314e6535c59fb551feb1f", "score": "0.48785383", "text": "function onRegFieldUpdate(fieldEdited) {\n var fieldId = fieldEdited.id;\n var fieldContent = fieldEdited.text;\n switch (fieldId) {\n case \"regFirstNameInput\":\n //D007: Adding code to capitalize first character for fieldContent and fieldContent\n //volunteerRegObject.firstname = fieldContent;\n volunteerRegObject.firstName = fieldContent.charAt(0).toUpperCase() + fieldContent.slice(1);\n //End of D007\n break;\n case \"regLastNameInput\":\n //D007: Adding code to capitalize first character for fieldContent and fieldContent\n //volunteerRegObject.lastname = fieldContent;\n volunteerRegObject.lastName = fieldContent.charAt(0).toUpperCase() + fieldContent.slice(1);\n //End of D007\n break;\n case \"regUsernameInput\":\n volunteerRegObject.username = fieldContent;\n break;\n case \"regPasswordInput\":\n volunteerRegObject.password = fieldContent;\n break;\n case \"regReenterPasswordInput\":\n volunteerRegObject.reenteredPassword = fieldContent;\n break;\n case \"regWorkDetailsInput\":\n volunteerRegObject.workDetails = fieldContent;\n break;\n case \"regAboutMeInput\":\n volunteerRegObject.aboutMe = fieldContent;\n break;\n case \"regCompanyInput\":\n //Start of D012\n volunteerRegObject.companyName = fieldEdited.selectedKey;\n if (volunteerRegObject.companyName === \"Select\" || volunteerRegObject.companyName === null || volunteerRegObject.companyName === \"\") {\n volunteerRegObject.companyName = \"\";\n }\n //End of D012\n break;\n case \"regRoleInput\":\n volunteerRegObject.role = fieldContent;\n break;\n case \"regBusinessUnitInput\":\n volunteerRegObject.businessUnit = fieldContent;\n break;\n case \"regStateInput\":\n volunteerRegObject.state = fieldEdited.selectedKey;\n if (volunteerRegObject.state === \"Select\" || volunteerRegObject.state === null || volunteerRegObject.state === \"\") {\n volunteerRegObject.state = \"\";\n }\n break;\n case \"regAddressInput\":\n volunteerRegObject.address = fieldContent;\n break;\n case \"regCityInput\":\n volunteerRegObject.city = fieldContent;\n break;\n case \"regContactNumberInput\":\n volunteerRegObject.contactNumber = fieldContent;\n break;\n case \"regEmailAddressInput\":\n volunteerRegObject.emailAddress = fieldContent;\n break;\n default:\n break;\n }\n}", "title": "" }, { "docid": "d03f5a6182c704e0b33125437f5eb858", "score": "0.48783636", "text": "function updateFromLps() {\n\tstate.larvae += state.lps*0.05;\n}", "title": "" }, { "docid": "45779e72582ae764355d5c87280e102a", "score": "0.4871663", "text": "setUserData(field, value) {\r\n\r\n // Get all user data\r\n var userData = this.getUserData()\r\n\r\n // Set new field\r\n userData[field] = value\r\n\r\n // Update entity\r\n Entities.editEntity(this.id, JSON.stringify(userData))\r\n\r\n }", "title": "" }, { "docid": "453d42274e57a1598d6ef97bba0f74b5", "score": "0.4861701", "text": "function inputMinSliderLeft(){//slider update inputs\n inputMin.value=sliderLeft.value;\n}", "title": "" }, { "docid": "6014b03ce927642afb987ef594851700", "score": "0.48569945", "text": "sendUpdatedField(newDisplayname, newOptional, newType, newMin, newMax){\n var optional=null;\n newOptional === true ? optional = '1' : optional = '0'\n this.setState({\n edit: false\n })\n $.ajax({url: '/php/update_signup_field.php', type: 'POST',\n dataType: 'json',\n data: {\n 'name': newDisplayname,\n 'optional': optional,\n 'type': newType,\n 'minimum': newMin,\n 'maximum': newMax,\n 'DataID': this.state.signupFields[this.state.currentIndex].DataID\n },\n success: response => {\n this.checkifLive();\n this.getFields();\n },\n error: response => {\n alert(\"An error occured, please refresh the page!\")\n }\n });\n }", "title": "" }, { "docid": "1563d8891a2e71f7bde82276a18c06a1", "score": "0.48476708", "text": "_mapFieldsToMenu() {\n const that = this;\n\n if (!that.fields && !that._valueFields) {\n return;\n }\n\n that._fields = (that.fields || that._valueFields).concat(that._manuallyAddedFields).map(field => {\n return { label: field.label, value: field.dataField, dataType: field.dataType, filterOperations: field.filterOperations, lookup: field.lookup };\n });\n }", "title": "" }, { "docid": "d1bb98995d1d8b8e3fe3518e8723b3d1", "score": "0.48400638", "text": "function setChanged (){\n\tformModified = true;\n}", "title": "" }, { "docid": "e0c39d9014e80436f0b5891adfa44287", "score": "0.48377386", "text": "handleFormUpdate(data) {\n console.log(data);\n const assay = {\n ...this.state.assay,\n ...data\n };\n console.log(assay);\n this.setState({\n assay: assay\n })\n }", "title": "" }, { "docid": "67fb9bbb0f9bc61cba7ad586467b7886", "score": "0.48359618", "text": "function moveLeft() {\n var grid = null;\n for(grid of GameData.activePiece.getOrientation()) {\n GameData.mainPlayField.setBlock(\n GameData.row + grid.getRow(),\n correctColumn(GameData.column + grid.getColumn()),\n 0\n );\n }\n\n GameData.column = correctColumn(GameData.column - 1);\n\n var grid = null;\n for(grid of GameData.activePiece.getOrientation()) {\n GameData.mainPlayField.setBlock(\n GameData.row + grid.getRow(),\n correctColumn(GameData.column + grid.getColumn()),\n GameData.activePiece.getType()\n );\n }\n}", "title": "" }, { "docid": "affe8afd51aa291011a4e032e53d29e3", "score": "0.4835957", "text": "handleUpdate(e) {\r\n\t\te.preventDefault();\r\n\t\t//--- Declare state variable for this component ---//\r\n\t\tconst data = {\r\n id : this.state.id,\r\n language : this.state.language\r\n\t\t}\r\n\t\tif( !this.checkValidation(data) ) {\r\n var referenceToEdit = firebase.database().ref('language').orderByChild('id').equalTo(this.state.id);\r\n referenceToEdit.once('value',function(snapshot){\r\n snapshot.forEach(function(child) {\r\n child.ref.child('language').set(data.language);\r\n });\r\n });\r\n\t\t\tthis.reset();\r\n\t\t\tthis.props.updateState(data, 1);\r\n\t\t\tdocument.getElementById(\"closeEditModal\").click();\r\n\t\t\ttoastr.warn('Language updated successfully!', {position : 'top-right', heading: 'Done'});\r\n }\r\n\t}", "title": "" }, { "docid": "5acd9bf314c204a8327b2c9d0ac3862f", "score": "0.483214", "text": "function updateLeft(c) {\n if (c.currMonth === 0) {\n c.currMonth = 11;\n c.currYear--;\n } else {\n c.currMonth--;\n }\n showCalendar();\n showEvents(c.currMonth, c.currYear);\n }", "title": "" }, { "docid": "90f4f73d04fd446eebfb458df9fb58ae", "score": "0.48285806", "text": "updateSelf(properties) {\n this.firebaseUserRef.update(properties);\n }", "title": "" }, { "docid": "a04be43fc94d9700b09d7f1ba2fbae55", "score": "0.48231265", "text": "updateProfile(e) {\n this.editForm.get('role').setValue(e, {\n onlySelf: true\n });\n }", "title": "" }, { "docid": "0187484b8741bf87ec2fc94557070276", "score": "0.4821299", "text": "function syncFields(){\r\n var cm = grid.getColumnModel();\r\n ntTitle.setSize(cm.getColumnWidth(1)-2);\r\n ntCat.setSize(cm.getColumnWidth(2)-4);\r\n ntDue.setSize(cm.getColumnWidth(3)-4);\r\n }", "title": "" }, { "docid": "7c010cc9e721f008d10daa6775083285", "score": "0.48210126", "text": "updateForm(context, payload) {\n context.commit(\"updateForm\", payload);\n }", "title": "" }, { "docid": "22b10c67f179f02ba346ff580efd4794", "score": "0.48204538", "text": "function syncFields(){\n var cm = grid.getColumnModel();\n ntTitle.setSize(cm.getColumnWidth(1)-2);\n ntCat.setSize(cm.getColumnWidth(2)-4);\n ntDue.setSize(cm.getColumnWidth(3)-4);\n }", "title": "" }, { "docid": "3786e7b46e70730a57dda4e253744446", "score": "0.48176843", "text": "function updateInputs() {\r\n Inputang.setAttribute('value', Inputang.value);\r\n Inputvel.setAttribute('value', Inputvel.value);\r\n }", "title": "" }, { "docid": "4690ee34317d4290fe608b4a01eff691", "score": "0.48105398", "text": "function updateUI(whatChanged)\r\n{\r\n switch (whatChanged)\r\n {\r\n\r\n case \"masterFieldsLength\":\r\n var masterFieldsArr = _MasterPageFields.getValue();\r\n var linkFieldsArr = _LinkField.listControl.list;\r\n\r\n if (masterFieldsArr.length != linkFieldsArr.length)\r\n {\r\n _LinkField.listControl.setAll(masterFieldsArr,masterFieldsArr);\r\n }\r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n}", "title": "" }, { "docid": "a0141ac8f590ee1ebd02f974cace5156", "score": "0.48005575", "text": "handleFieldsChangeByPlugin(e, value) {\n let name = value.name;\n\n if (this.currentComponent && name){\n let fields = Object.assign({}, this.currentComponent.state.fields);\n fields[name] = value.value;\n\n this.currentComponent.setState({fields: fields});\n }\n }", "title": "" }, { "docid": "14c52cba98b6d8a90d18df7b62309c7e", "score": "0.4791821", "text": "updated(_changedProperties) {\n }", "title": "" }, { "docid": "ec2b5f30497f8a86b0fc2616e1cf5d3c", "score": "0.47874975", "text": "moveLeft() {\n dataMap.get(this).moveX = -5;\n }", "title": "" }, { "docid": "9552cad0f6d30ffabd5a6cc89b35adb2", "score": "0.47870705", "text": "_onEdit(type) {\n this.refs.screen.updateValues(type);\n this.refs.advanced.updateValues(type);\n this.refs.misc.updateValues(type);\n }", "title": "" }, { "docid": "df6483d52e4337d0bb9735065daa7457", "score": "0.4785954", "text": "left() {\n switch (this.f) {\n case NORTH:\n this.f = WEST;\n break;\n case SOUTH:\n this.f = EAST;\n break;\n case EAST:\n this.f = NORTH;\n break;\n case WEST:\n default:\n this.f = SOUTH;\n }\n }", "title": "" }, { "docid": "bf4022223784a59befa3d77f4ee3df24", "score": "0.47855794", "text": "function updateFormItemOptions() {\n\n\tvar labelType = '';\n\tvar readOnly = '';\n\twindow.selectedFormItems.each(function(i,item) {\n\t\tvar thisLabelType = $(item).data('labelType');\n\t\tvar thisReadOnly = $(item).data('readOnly');\n\n\t\tif(labelType === '')\n\t\t\tlabelType = thisLabelType;\n\t\telse if(labelType !== thisLabelType)\n\t\t\tlabelType = 'mixed';\n\n\t\tif(readOnly === '')\n\t\t\treadOnly = thisReadOnly;\n\t\telse if(readOnly !== thisReadOnly)\n\t\t\treadOnly = 'mixed';\n\t});\n\t$('#labelType').val(labelType);\n\t$('#readOnly').val(readOnly);\n}", "title": "" }, { "docid": "2ffef1d271fdb3fb38a8ac98c52ef6df", "score": "0.47736204", "text": "function ex3_update_node(node_name, field_name, value) {\n get_node(node_name)[field_name] = value;\n // Update everything\n update_all();\n}", "title": "" }, { "docid": "f56028aeb91a9e4d4bab22f410d5da6d", "score": "0.47663146", "text": "componentWillReceiveProps(nextProps) {\n this.setState({\n first_name: nextProps.first_name,\n last_name: nextProps.last_name,\n email: nextProps.email,\n username: nextProps.username\n //materialize library, READ THE DOCS!\n }, () => window.M.updateTextFields())\n }", "title": "" }, { "docid": "c99e71f244df86dcac6443d3ca3e4ea8", "score": "0.47636768", "text": "update() {\n\t this.value = this.originalInputValue;\n\t }", "title": "" }, { "docid": "e9641a0ad97289c0302eaa91054ac2a2", "score": "0.47625282", "text": "function enableFormFields() {\n\tvar modifyButton = $(modifyButtonName);\n\tvar saveButton = $(saveButtonName);\n\t\n\t//The additional arguments are field names we don't wat to touch.\n\tvar keep = $A(arguments);\n\n\tif (modifyButton) {\n\t\t//Transform the modify in a cancel button\n\t\tmodifyButton.oldOnclick = modifyButton.onclick;\n\t\tmodifyButton.onclick = modifyResetClick;\n\t\tmodifyButton.form.keepFields = keep;\n\t\tmodifyButton.value = cancelLabel;\n\t\tmodifyButton = null;\n\t}\n\tif (saveButton) {\n\t\tenableField(saveButton);\n\t\tsaveButton = null;\n\t}\n\n\t//Process each field\n\tprocessFields(this, keep, enableField);\n}", "title": "" }, { "docid": "99c2987e8ca40014095bdd0259a1ee09", "score": "0.4757769", "text": "updateProfileName(event) {\n const field = event.target.name;\n let newProfile = update(this.state.profile,\n {\n user_name: {\n [field]: {$set: event.target.value}\n }\n }\n );\n // update the local state\n return this.setState({profile: newProfile});\n }", "title": "" } ]
c54ff8842d2e19670fa01e190f4fab5e
! moment.js locale configuration
[ { "docid": "8efd6fcbb0a6a40b3758afa4ca9597b2", "score": "0.0", "text": "function t(e){return e%100==11||e%10!=1}", "title": "" } ]
[ { "docid": "ebb5f27bdb5dc355a9b06d43593649ed", "score": "0.8263063", "text": "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nfunction(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}({ss:t?\"секунда_секунды_секунд\":\"секунду_секунды_секунд\",mm:t?\"минута_минуты_минут\":\"минуту_минуты_минут\",hh:\"час_часа_часов\",dd:\"день_дня_дней\",MM:\"месяц_месяца_месяцев\",yy:\"год_года_лет\"}[n],+e)}", "title": "" }, { "docid": "13d0bc08492a5674fb64e5650d75b785", "score": "0.8035005", "text": "function Os(e,t,n){return\"m\"===n?t?\"хвилина\":\"хвилину\":\"h\"===n?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\nfunction(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}({ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[n],+e)}", "title": "" }, { "docid": "ab9e4bbb7b5122c32beff4ed5b231c61", "score": "0.7877146", "text": "function At(e,t,a){return\"m\"===a?t?\"хвилина\":\"хвилину\":\"h\"===a?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\nfunction(e,t){var a=e.split(\"_\");return t%10==1&&t%100!=11?a[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?a[1]:a[2]}({ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[a],+e)}", "title": "" }, { "docid": "157f60aa42f6cc835675896915a22a65", "score": "0.75484014", "text": "function localizeMoment(mom) {\n\t\tif ('_locale' in mom) { // moment 2.8 and above\n\t\t\tmom._locale = localeData;\n\t\t}\n\t\telse { // pre-moment-2.8\n\t\t\tmom._lang = localeData;\n\t\t}\n\t}", "title": "" }, { "docid": "c90316409017a609d767bb60f1ce89ab", "score": "0.7204236", "text": "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}else{if(typeof console!=='undefined'&&console.warn){//warn user if arguments are passed but the locale could not be set\nconsole.warn('Locale '+key+' not found. Did you forget to load it?');}}}return globalLocale._abbr;}", "title": "" }, { "docid": "83aee654a8d97aa81bf251da5968faeb", "score": "0.7198218", "text": "function localizeMoment(mom) {\n\t\tmom._locale = localeData;\n\t}", "title": "" }, { "docid": "a6a20d7508327a12115cf807781607ea", "score": "0.7173406", "text": "function hd(i,ee,te){return i+\" \"+function kd(i,ee){return 2===ee?function ld(i){var ee={m:\"v\",b:\"v\",d:\"z\"};return void 0===ee[i.charAt(0)]?i:ee[i.charAt(0)]+i.substring(1)}\n//! moment.js locale configuration\n//! locale : bosnian (bs)\n//! author : Nedim Cholich : https://github.com/frontyard\n//! based on (hr) translation by Bojan Marković\n(i):i}({mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"}[te],i)}", "title": "" }, { "docid": "b0d4c1b699e678f87040e762f40a7ead", "score": "0.7170998", "text": "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}}return globalLocale._abbr;}", "title": "" }, { "docid": "d11d49c1c0d4ff5684649e17cdef56d0", "score": "0.7132494", "text": "function localizeMoment(mom) {\n\t\t\tmom._locale = localeData;\n\t\t}", "title": "" }, { "docid": "4e03616dae3fddf08d2c43dad9db0b29", "score": "0.71289635", "text": "function Io(e,t,n){var i={mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},o=\" \";return(e%100>=20||e>=100&&e%100===0)&&(o=\" de \"),e+o+i[n]}//! moment.js locale configuration", "title": "" }, { "docid": "8b517e8eff3aebc7e1d179555be13226", "score": "0.7045183", "text": "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data = getLocale(key);}else {data = defineLocale(key,values);}if(data){ // moment.duration._locale = moment._locale = data;\nglobalLocale = data;}else {if(typeof console !== 'undefined' && console.warn){ //warn user if arguments are passed but the locale could not be set\nconsole.warn('Locale ' + key + ' not found. Did you forget to load it?');}}}return globalLocale._abbr;}", "title": "" }, { "docid": "754a931003fb6f90c333651f5cebe2b3", "score": "0.6671976", "text": "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=locale_locales__getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\r\n\tglobalLocale=data;}}return globalLocale._abbr;}", "title": "" }, { "docid": "754a931003fb6f90c333651f5cebe2b3", "score": "0.6671976", "text": "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=locale_locales__getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\r\n\tglobalLocale=data;}}return globalLocale._abbr;}", "title": "" }, { "docid": "f229b3d4e3ba9f5e400e92e075168029", "score": "0.6335302", "text": "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n __f__(\"warn\",\n 'Locale ' + key + ' not found. Did you forget to load it?', \" at node_modules/moment/moment.js:2121\");\n\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "6cb190258d2a738de0bde43ee97d247d", "score": "0.6293571", "text": "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else\n {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else\n {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n __f__(\"warn\", 'Locale ' + key + ' not found. Did you forget to load it?', \" at node_modules/moment/moment.js:1880\");\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "fe8cccfeb08a82911f2984d5a476dcd7", "score": "0.62770087", "text": "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "title": "" }, { "docid": "fe8cccfeb08a82911f2984d5a476dcd7", "score": "0.62770087", "text": "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "title": "" }, { "docid": "fe8cccfeb08a82911f2984d5a476dcd7", "score": "0.62770087", "text": "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "title": "" }, { "docid": "fe8cccfeb08a82911f2984d5a476dcd7", "score": "0.62770087", "text": "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "title": "" }, { "docid": "e3c0b355a68474435250e27a4a402c3d", "score": "0.6210929", "text": "static getLocale() {\n return 'en_US';\n }", "title": "" }, { "docid": "20c04ccea0a22e09f4c67e63cd045b45", "score": "0.60947174", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.60930073", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.60930073", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.60930073", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.60930073", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.60930073", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.6078206", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.6078206", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.6078206", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.6078206", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.6078206", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.6078206", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "47855cf644f12aecb048d6def51b0578", "score": "0.6077143", "text": "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6072981", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" } ]
da7281f3c9d89ece91d18c52a14ce398
this function adds a msg (line) to the frequency table if the message doesn't exist it makes an entry for it else, it updates the frequency
[ { "docid": "c5b0c44d6dffdb6181e2cd5951260636", "score": "0.58941686", "text": "function addLineToTable(table, l){\n if (table != emoteTable){\n \tvar line = l.toLowerCase()\n } else {\n \tvar line = l\n }\n if(table[line]){\n table[line].freq++;\n } else {\n table[line] = {'freq':1, 'used':false};\n }\n}", "title": "" } ]
[ { "docid": "594f86feebae2ba3a12c77aba788950d", "score": "0.57308185", "text": "add(message) {\r\n let count = this._messages[message];\r\n if (!count) {\r\n count = 0;\r\n }\r\n count++;\r\n this._messages[message] = count;\r\n }", "title": "" }, { "docid": "594f86feebae2ba3a12c77aba788950d", "score": "0.57308185", "text": "add(message) {\r\n let count = this._messages[message];\r\n if (!count) {\r\n count = 0;\r\n }\r\n count++;\r\n this._messages[message] = count;\r\n }", "title": "" }, { "docid": "d8f156056549f582d2b7e52e6b749753", "score": "0.5513325", "text": "function updateTable(msg,new_row){\n\t\n\tif (new_row == false ){\n\t\t\n\t\t//Take the current row count from \n\t\trow_number = $('#count'+ msg.headerID +' td:first').html();\n\t\t\n\t\t//console.log(\"row number: \"+ row_number);\n\t\t\n\t}\n\telse{\n\t\t\n\t\t//Adding new row to the frontdesk, thead will be an extra row count at any time.\n\t\trow_number = $('#fdtable tr').length;\n\t\t\n\t}\n\t\n var tableString = \"\";\n tableString += '<tr id=\"count'+ msg.headerID +'\">';\n \n tableString += \"<td align=center><b>\"+ row_number +'</b></td> <td align=\"center\"><a href=\"/jqmtab/patient/' + msg.headerID + '/\" class=\"ui-link\">'+ msg.patient.name +\"</a></td>\";\n \n //Get the ordered table string from this function.\n dynamic_td_content = get_cell_order(msg);\n \n tableString += dynamic_td_content;\n \n tableString += \"</tr>\";\t\n \n \n if( new_row == true){\n \t//Add new two at first of tbody. If empty tbody do first, or the else part.\n \tif( row_number == 1 ){\n \t\t\n \t\t$('#fdtable > tbody').append(tableString);\n \t}\n \telse {\n \t\t$('#fdtable > tbody > tr:first').before(tableString);\n \t}\n \t\n }\n else{\n \t//Update the row of given 'id'.\n \t$('#count'+ msg.headerID).replaceWith(tableString); \n }\n}", "title": "" }, { "docid": "b6e4ef052b554a95ed8282d056f325e0", "score": "0.5462957", "text": "function updateHistory(msg){\n if (msgHistory.length < 250){\n msgHistory.push(msg);\n }else{\n msgHistory.shift();\n msgHistory.push(msg);\n }\n}", "title": "" }, { "docid": "2651b58dc23b401416f9ce546f615848", "score": "0.54281807", "text": "function recordEntry(msg) {\n\tfs.appendFile(fileName, msg, function(err) {\n\t\tif(err) {\n\t\t\tconsole.log(\"There was an error appending the user transaction to \" + fileName + \"!\");\n\t\t}\n\t});\n}", "title": "" }, { "docid": "eb1640a8bbd2dcbd09490e59f86ba2d2", "score": "0.5370629", "text": "function email_word_freq(email, freq_table){\n\tvar email_split = email.split(' ');\n\temail_split.forEach(function(email_word){\n\t\tif(freq_table[email_word]){\n\t\t\tfreq_table[email_word] += 1;\n\t\t}\n\t\telse{\n\t\t\tfreq_table[email_word] = 1;\n\t\t}\n\t});\n}", "title": "" }, { "docid": "28091398a364f12cfc1e3bce03c963e2", "score": "0.53106964", "text": "function updateUserEntry(username){\n if(knownMembers[username]){\n knownMembers[username].freq++;\n } else {\n knownMembers[username] = {'username': username,'freq':1};\n }\n}", "title": "" }, { "docid": "98d19ac1da180b79d899cf9fadecb59d", "score": "0.5309506", "text": "function record_message(msg) {\n let message_name = msg.content.match(/{{name=.*?}}/g);\n if (message_name === null) {\n LOG.debug('record_message() - other message has no name');\n return;\n }\n\n let message_log_index = state[STATE_NAME][MESSAGE_LOG_INDEX];\n state[STATE_NAME][MESSAGE_LOG][message_log_index] = msg;\n message_log_index = message_log_index + 1;\n if (message_log_index === MESSAGE_LOG_SIZE) {\n message_log_index = 0;\n }\n state[STATE_NAME][MESSAGE_LOG_INDEX] = message_log_index;\n }", "title": "" }, { "docid": "9c16bb221cad4f806220fdc72b4fa4a3", "score": "0.52677363", "text": "function spam (id, msg) {\n let s = m[id] ? m[id].time + INTERVAL < Date.now() ? false : true : false\n m[id] = { msg, time: Date.now() }\n return s\n}", "title": "" }, { "docid": "fde89fe6ac4f190e28264ad295ac27b4", "score": "0.5205954", "text": "function onMessageArrived(message) {\n console.log(\"onMessageArrived:\"+message.payloadString);\n var rec_topic = message.topic.slice(\"IoT/\".length);\n var rec_message = message.payloadString;\n var log = document.getElementById('last_messages_log');\n\n // TODO better way to append?\n log.value = log.value + '\\n' + new Date() + '\\t' + rec_topic + '\\t' + rec_message;\n log.scrollTop = log.scrollHeight\n\n //TODO check for topics\n if (!rec_topic.includes(\"temperature\") && !rec_topic.includes(\"humidity\")) {\n return;\n }\n\n //TODO sanity checks? (e.g. true/false)\n var number_value = Number(rec_message);\n if (!isNaN(number_value)) {\n //add value to our dictionary\n if (typeof(sensor_dict[rec_topic]) === \"undefined\") {\n // sensor_dict[message.topic] = [['Date', rec_topic]];\n sensor_dict[rec_topic] = [];\n // sensor_dict[message.topic] = new google.visualization.DataTable();\n // sensor_dict[message.topic].addColumn('date', 'Date');\n // sensor_dict[message.topic].addColumn('number', rec_topic);\n }\n sensor_dict[rec_topic].push([new Date(), number_value]);\n\n //console.log(rec_topic + \" is now: \" + sensor_dict[rec_topic])\n\n refreshCharts();\n }\n\n}", "title": "" }, { "docid": "dcc0e67c05d9d58dd7c7383641fdbcd0", "score": "0.5166539", "text": "async function insert_message(topic, message_str, packet) {\n try {\n let topic_split = topic.split(\"/\");\n let topic_sensor = topic_split[2];\n\n let readings = message_str.split(\" : \");\n\n let req_faucet = await findOne(\"faucet\", {\n sensor: topic_sensor,\n activity: 1\n });\n // + Math.random()*30\n await insert(\"flow\", {\n flow: readings[0] * 60,\n sensor_code: topic_sensor,\n dt_h: readings[1] / (1000 * 3600),\n faucet_id: req_faucet.id\n });\n\n countInstances(message_str);\n } catch (err) {\n console.log(err);\n }\n }", "title": "" }, { "docid": "760a94b7b010fe8c4ffc0a66e9829cf1", "score": "0.51584435", "text": "recordMessage(message) //adds a single message to the .json\n {\n this.json[\"messages\"].push(message);\n this.updateWordCount(message);\n }", "title": "" }, { "docid": "d016f6ee02680a085d2bbc57a0e2b805", "score": "0.5140501", "text": "function msgAdd(msg) {\r\n _message.push(msg);\r\n}", "title": "" }, { "docid": "700c0509a4ccedca5de4d96e947af636", "score": "0.51264745", "text": "function addNewReplyFile(msg){\n\t\tvar reply = ''\n\t\tif(msg.sticker) { // msg.sticker != undefined é o mesmo que msg.sticker (true)\n\t\t\treply = msg.sticker.file_id\n\t\t} else {\n\t\t\treply = msg.text\n\t\t}\n\t\t\n\t\tconst messageObject = {\n\t\t\tmessage: msg.reply_to_message.sticker.file_id,\n\t\t\treply: [reply]\n\t\t}\n\t\n\t\treplyDataBase = new Reply()\n\t\treplyDataBase.message = messageObject.message\n\t\treplyDataBase.reply = messageObject.reply[0]\n\t\t\n\t\treplyDataBase.save()\n\t\t\t.then(() => {\n\t\t\t\tconsole.log('Salvo')\n\t\t\t})\n\t\t \t.catch(e => {\n\t\t \t\tconsole.log('Erro: ',e)\n\t\t \t})\n\t}", "title": "" }, { "docid": "dcde8c0a5cc7c0886e4fc7856e6635b9", "score": "0.51088035", "text": "function add_to_gc_log(msg) {\n if(gc_log.length === 96) {\n gc_log.shift();\n } else if(gc_log.length > 96) {\n let shift = gc_log.length - 95;\n gc_log = gc_log.slice(shift);\n }\n gc_log.push(msg);\n}", "title": "" }, { "docid": "bb7659b5a22d223d3afbaefcaac0fea1", "score": "0.50900966", "text": "function addNewReplyFile(msg){\n\t var reply = ''\n\t\tif(msg.sticker != undefined){\n\t\t\treply = msg.sticker.file_id\n\t\t} else {\n\t\t\treply = msg.text\n\t\t}\n\t\t\n\t\tconst messageObject = {\n\t\t\tmessage: msg.reply_to_message.sticker.file_id,\n\t\t\treply: [reply]\n\t\t}\n\t\n\t\treplyDataBase = new Reply()\n\t\treplyDataBase.message = messageObject.message\n\t\treplyDataBase.reply = messageObject.reply[0]\n\t\t\n\t\treplyDataBase.save()\n\t\t .then(s => {\n\t\tconsole.log('Salvo')\n\t\t})\n\t\t .catch(e => {\n\t\t \tconsole.log('Erro: ',e)\n\t\t })\n\t}", "title": "" }, { "docid": "e37f84c13abb5bb96edf407ec7380655", "score": "0.50894135", "text": "function addToFreqs(item) {\n const freqRef = db.collection('users').doc(item);\n\n const current = freqRef.get()\n .then(doc => {\n const newFreq = doc.data() ? doc.data()['freq'] + 1 : 1;\n const updateFreq = freqRef.set({ freq: newFreq });\n console.log(\"the item \" + item + \" has frequency \" + newFreq);\n }).catch(err => {\n console.log('Error getting document', err);\n });\n}", "title": "" }, { "docid": "9f1847926287e32ca3cdf6910fb6e718", "score": "0.5087758", "text": "async AddMessage(entry) {\n try {\n await db.add(entry)\n _this.queryGet()\n } catch (e) {\n console.error(e)\n }\n }", "title": "" }, { "docid": "283dc3038924cbf205162be61e13b844", "score": "0.50845116", "text": "addMess() {\r\n if (this.newMess.trim() !== '') {\r\n this.contacts[this.indexContact].messages.push( {\r\n date: dayjs().format('DD/MM/YYYY HH:mm:ss'),\r\n message: this.newMess,\r\n status: 'send'\r\n });\r\n this.newMess = ''; // per fare il clear del messaggio dopo l'invio\r\n }\r\n // funzione per ricevere dopo 1 sec una risposta dopo l'input\r\n setTimeout(() => {\r\n this.contacts[this.indexContact].messages.push( {\r\n date: dayjs().format('DD/MM/YYYY HH:mm:ss'),\r\n message: 'Ok',\r\n status: 'received'\r\n });\r\n }, 1000 )\r\n }", "title": "" }, { "docid": "2f69750e59a2ac9919715281d2fc30af", "score": "0.5084188", "text": "function onMessageArrived(message) {\n\n if(myDeviceId != message.id)return;\n updateTable(message);\n\n //check if it is a new topic, if not add it to the array\n if (dataTopics.indexOf(message.id) < 0){\n console.log(\"New Data Topic\", message.id)\n dataTopics.push(message.id); //add new topic to array\n var y = dataTopics.indexOf(message.id); //get the index no\n\n //create new data series for the chart\n var newseries = {\n id: y,\n name: message.id,\n data: []\n };\n\n chart.addSeries(newseries); //add the series\n };\n var oldMessage = null;\n var y = dataTopics.indexOf(message.id); //get the index no of the topic from the array\n var myEpoch = new Date().getTime(); //get current epoch time\n var thenum = json.value;\n if(oldMessage != null && oldMessage.timestamp == message.timestamp)return;\n var plotMqtt = [myEpoch, Number(thenum)]; //create the array\n if (isNumber(thenum)) { //check if it is a real number and not text\n plot(plotMqtt, y);\t//send it to the plot function\n oldMessage = message;\n };\n }", "title": "" }, { "docid": "69b9ce10c77de6d8a99d12ee60128715", "score": "0.5054438", "text": "function appendNewMessage(msg) {\n vm.messages.push(msg);\n \n if(msg.id !== this.id && msg.message.name !== \"Console\"){\n var newMessageSound = new Audio(\"audio/message.mp3\");\n newMessageSound.play();\n }\n}", "title": "" }, { "docid": "7846540cecc4500fa2dc70597b2cfb86", "score": "0.5051167", "text": "function rePushHead() {\n count++;\n console.log(count);\n const data = req.response;\n const raw = data['raw'];\n let factLocation = getRandomInt(list.length);\n console.log(\"list \" + list.toString());\n console.log(\"location \" + factLocation);\n let factText = \"\";\n for (let j = 0; j < raw.length; j++){\n if(raw[j].topic_id == list[factLocation]){\n factText = raw[j].fact.text;\n console.log(factText);\n }\n }\n seen.push(list[factLocation]);\n pandsFunc(factLocation, factText);\n\n}", "title": "" }, { "docid": "73e4bbdb49300edfadd0ab41eb276d58", "score": "0.500685", "text": "function addNewQuickMessage(message) {\n let loggedInUser = firebase.auth().currentUser;\n let userRef = db.collection(\"users\").doc(loggedInUser.uid);\n\n userRef.update({\n quickMessages: firebase.firestore.FieldValue.arrayUnion(sanitize(message))\n }).then(function () {\n createFeedbackPopup(\"Beskjeden ble laget!\");\n populateUserMessages(loggedInUser);\n }).catch(function (error) {\n createFeedbackPopup(\"Noe gikk feil, beskjed ble ikke laget!\");\n });\n}", "title": "" }, { "docid": "679273a810247d5277eba2c2ce51b7e3", "score": "0.5006751", "text": "function newMsg(log) {\n if (log.length <= 1) return;\n\n const args = log.toString().split('|');\n\n const name = args[0].replace(/\\s+/g, '_');\n const date = args[1];\n const time = args[2];\n const msg = args[3];\n const meta = args[4];\n\n if (name.length <= 1 || msg.length <= 1) return;\n\n if(msg.startsWith(config.prefix)) {\n processCommand(name, time, msg);\n return;\n }\n \n mainWindow.webContents.send('newMsg', name, msg);\n\n // Increment the index of each message (new message is added at the top of the list)\n msgs.forEach((value, key) => {\n if (key.name == name) {\n msgs.set(key, value + 1);\n }\n });\n \n // Add the new message to the map of messages\n const newKey = {\n name: name, \n time: time\n };\n msgs.set(newKey, 0);\n\n // Set a timer calling an event in the ipc renderer to remove this message from the screen\n setTimeout(() => {\n removeMsg(name, time);\n }, 6000);\n}", "title": "" }, { "docid": "b347f0aacb9bc8fd477db311ff0d94c3", "score": "0.49990386", "text": "function addChangeMessage(messages, messagesHash, msg) {\n messages.push(msg);\n messagesHash[msg.path] = msg;\n }", "title": "" }, { "docid": "5a875920bf6fe0e967f5a33bbf802827", "score": "0.4978251", "text": "#setMessagesForChartByDay () {\n this.messages.forEach(message => {\n const contact = message.contact.replace(/\\s/g, '_') + '_'\n const splitted = message.date.split(' ')\n const date = splitted[0]\n\n const i = this.chartDataByDay.findIndex(m => m.date === date)\n if (i < 0) {\n const data = {\n date,\n ...this.#contacts,\n }\n data[contact + 'Chars'] = message.chars\n data[contact + 'Messages'] = 1\n\n this.chartDataByDay.push(data)\n } else {\n this.chartDataByDay[i][contact + 'Chars'] += message.chars\n this.chartDataByDay[i][contact + 'Messages'] += 1\n }\n })\n }", "title": "" }, { "docid": "30d899baf0cb6eebd43621b419c140f4", "score": "0.49753216", "text": "function update_db(){\n db.received\n .reverse()\n .sortBy('rid')\n .then(function(arr){\n var rid;\n if(arr[0]!=undefined){\n rid = arr[0].rid;\n }else{\n rid = 0;\n }\n var url = new URL('../redis/messages?rid='+rid,C.hostname);\n fetch(url).then(function(res){\n res.json().then(function(messages){\n\n var from_me = 0, from_others = 0;\n messages.forEach(function(el){\n if(el.from === util.get_cookie('username')){\n from_me++;\n }else{\n from_others++;\n }\n add_received(el);\n });\n\n if(from_others>0){\n new Notification(\"Exictype\",{\n body:'You have '+from_others+' new message(s)!',\n icon:'imgs/icon.png'\n })\n }\n\n if(from_me>0){\n new Notification(\"Exictype\",{\n body:'Your '+from_me+' message(s) have been sent!',\n icon:'imgs/icon.png'\n })\n }\n });\n });\n });\n}", "title": "" }, { "docid": "c3909afa675b490987849a46edc93c35", "score": "0.49527907", "text": "function add_message_to_queue(message) {\n\tpending_chat_messages[pending_chat_messages.length] = message;\n}", "title": "" }, { "docid": "f517d12ea73fafaaa7c1ca9060692a9d", "score": "0.49519026", "text": "function onMessageArrived(message) {\n console.log(message.destinationName, '',message.payloadString);\n\n var json;\n\n try {\n json = JSON.parse(message.payloadString);\n } catch(e) {\n\n }\n\n updateTable(json);\n\n //check if it is a new topic, if not add it to the array\n if (dataTopics.indexOf(message.destinationName) < 0){\n console.log(\"New Data Topic\", message.destinationName)\n dataTopics.push(message.destinationName); //add new topic to array\n var y = dataTopics.indexOf(message.destinationName); //get the index no\n\n //create new data series for the chart\n var newseries = {\n id: y,\n name: message.destinationName,\n data: []\n };\n\n chart.addSeries(newseries); //add the series\n };\n\n var y = dataTopics.indexOf(message.destinationName); //get the index no of the topic from the array\n var myEpoch = new Date().getTime(); //get current epoch time\n //\t\t var thenum = message.payloadString.replace( /^\\D+/g, ''); //remove any text spaces from the message\n var thenum = json.value;\n var plotMqtt = [myEpoch, Number(thenum)]; //create the array\n if (isNumber(thenum)) { //check if it is a real number and not text\n plot(plotMqtt, y);\t//send it to the plot function\n };\n }", "title": "" }, { "docid": "fc7ad54a1f419116221f84e0453641ae", "score": "0.49478063", "text": "recordMessage(msg, msgType) {\n this.lastMessage = msgType;\n this.stats.messages[msgType] = this.stats.messages[msgType] + 1 || 1;\n\n const schemaName = SchemaNames[msgType];\n\n if (schemaName === undefined) {\n throw Error(`\"${msgType}\" does not have a schema name`);\n }\n\n try {\n this.msgValidator.validate(schemaName, msg);\n } catch (e) {\n if (e instanceof ValidationError) {\n // Gather unique errors per item\n const errMsg = e.toString();\n let uniqueErrors = this.stats.uniqueErrors[msgType];\n const newError = uniqueErrors === undefined;\n\n if (newError) {\n uniqueErrors = {};\n uniqueErrors[errMsg] = 1;\n this.stats.uniqueErrors[msgType] = uniqueErrors;\n } else {\n uniqueErrors[errMsg] = uniqueErrors[errMsg] + 1 || 1;\n }\n\n this.stats.validationErrors[msgType] = this.stats.validationErrors[msgType] + 1 || 1;\n\n if (newError && this.options.invalidCallback) {\n this.options.invalidCallback(msgType, e, msg);\n }\n } else {\n throw e;\n }\n }\n }", "title": "" }, { "docid": "c8a6578f427280c074830f84e5f99240", "score": "0.494642", "text": "function savemessage(email){\r\n var newmessageref=messagesref.push();\r\n newmessageref.set({\r\n email: email\r\n\r\n\r\n\r\n \r\n })\r\n}", "title": "" }, { "docid": "9cfc2950bebe77f3e4fd7be970ce297f", "score": "0.49360263", "text": "function addMessage(message) {\r\n // add message at the beginning of the array\r\n messages.splice(0, 0, message);\r\n \r\n // if the array is getting long\r\n if (messages.length > 100) {\r\n // remove the last message\r\n messages.splice(messages.length - 1, 1);\r\n }\r\n}", "title": "" }, { "docid": "de26f024359dc128d1e7d9e5d8fa579f", "score": "0.49348405", "text": "async function msgCount(msg) {\n let userid = msg.author.id;\n let timestamp = msg.createdTimestamp;\n const userRef = db.collection('users').doc(userid);\n const doc = await userRef.get();\n if (doc.exists) {\n var firstTimestamp = await doc.data().firstTimestamp;\n if (firstTimestamp === undefined) {\n await userRef.update({\n msgCount: 1,\n firstTimestamp: timestamp\n });\n }\n else {\n if ((timestamp - firstTimestamp) / 1000 > 3600) {\n await userRef.update({\n msgCount: 1,\n firstTimestamp: timestamp\n });\n }\n else {\n await userRef.update({\n msgCount: admin.firestore.FieldValue.increment(1)\n });\n var msgCount = await doc.data().msgCount;\n if (msgCount > 30) {\n msg.author.send(\"Calm down champ. You've sent more than 30 messages in the last hour, go drink some water! 🥤\")\n await userRef.update({\n msgCount: 1,\n firstTimestamp: timestamp\n });\n }\n }\n }\n }\n}", "title": "" }, { "docid": "7e3ade04d94590e8e650f8236f531f92", "score": "0.49297377", "text": "function sendMessages(newMessages){ \n console.log(newMessages); \n db.add(newMessages[0]); \n }", "title": "" }, { "docid": "50c35425b4c09b78e036f559739fa266", "score": "0.49248394", "text": "async chit(nick,msg) {\n let results = await this.db.run(\"INSERT INTO CHITS (NICK,CHIT,TIMESTAMP,ISDELETED) VALUES (?,?,?,?)\",\n nick.toLowerCase(),msg,Math.floor(Date.now()/1000),0);\n if(results.lastID)\n return results.lastID;\n return 0;\n }", "title": "" }, { "docid": "a2821d80e54ea79412d7d4162d3546e0", "score": "0.49235314", "text": "function onMessageArrived(message) {\n logMessage(\"INFO\", \"Message Recieved: [Topic: \", message.destinationName, \", Payload: \", message.payloadString, \", QoS: \", message.qos, \", Retained: \", message.retained, \", Duplicate: \", message.duplicate, \"]\");\n var messageTime = new Date().toISOString();\n // Insert into History Table\n var table = document.getElementById(\"incomingMessageTable\").getElementsByTagName(\"tbody\")[0];\n var row = table.insertRow(0);\n row.insertCell(0).innerHTML = message.destinationName;\n row.insertCell(1).innerHTML = safeTagsRegex(message.payloadString);\n row.insertCell(2).innerHTML = messageTime;\n row.insertCell(3).innerHTML = message.qos;\n\n\n if (!document.getElementById(message.destinationName)) {\n var lastMessageTable = document.getElementById(\"lastMessageTable\").getElementsByTagName(\"tbody\")[0];\n var newlastMessageRow = lastMessageTable.insertRow(0);\n newlastMessageRow.id = message.destinationName;\n newlastMessageRow.insertCell(0).innerHTML = message.destinationName;\n newlastMessageRow.insertCell(1).innerHTML = safeTagsRegex(message.payloadString);\n newlastMessageRow.insertCell(2).innerHTML = messageTime;\n newlastMessageRow.insertCell(3).innerHTML = message.qos;\n\n } else {\n // Update Last Message Table\n var lastMessageRow = document.getElementById(message.destinationName);\n lastMessageRow.id = message.destinationName;\n lastMessageRow.cells[0].innerHTML = message.destinationName;\n lastMessageRow.cells[1].innerHTML = safeTagsRegex(message.payloadString);\n lastMessageRow.cells[2].innerHTML = messageTime;\n lastMessageRow.cells[3].innerHTML = message.qos;\n }\n\n}", "title": "" }, { "docid": "97771e75e818f44f567333871d5227df", "score": "0.49227175", "text": "function addNewReply(msg){\n\t\t\n\t\tconst messageObject = {\n\t\t\tmessage: msg.reply_to_message.text,\n\t\t\treply: [msg.text]\n\t\t}\n\t\n\t\treplyDataBase = new Reply()\n\t\treplyDataBase.message = messageObject.message\n\t\treplyDataBase.reply = messageObject.reply[0]\n\t\t\n\t\treplyDataBase.save()\n\t\t .then(s => {\n\t\tconsole.log('Salvo')\n\t\t})\n\t\t .catch(e => {\n\t\t \tconsole.log('Erro: ',e)\n\t\t })\n\t}", "title": "" }, { "docid": "6111863a4c9ca80874112ab36639aaa5", "score": "0.49195045", "text": "function addMessageToView(msg, date, user) {\n \n var dateStr = date.toLocaleDateString() + \",\" + date.toLocaleTimeString();\n \n $('#chatMessages').prepend('<tr>' + '<td class=\"cellvalue\">' + msg + '</td>' + '</tr>');\n $('#chatMessages').prepend('<tr>' + '<td class=\"cellheader\">' + dateStr + ' ' + user + '</td>' + '</tr>');\n}", "title": "" }, { "docid": "8089d28ddb24d9b8e0bb16607c4f7639", "score": "0.49162143", "text": "function addChatMessage(message) {\n msgText = \"[\" + myScreenName + \"] \" + message;\n dbRefMessages.set(msgText);\n}", "title": "" }, { "docid": "91ed9dbc11bbcfae73cf34286eaa83cb", "score": "0.49144956", "text": "function process0006(q,dak,msg) {\n q.live.clk.date = dak.msg.substring(0,10);\n q.live.clk.tod = dak.msg.substring(10,18);\n q.update[\"live.clk.date\"] = q.live.clk.date;\n q.update[\"live.clk.tod\"] = q.live.clk.tod;\n}", "title": "" }, { "docid": "100c93c19957daabeef931031b2a87f0", "score": "0.48892993", "text": "addMessage(msg) {\n\n if( msg.content && msg.date && msg.sender ) {\n\n this.historyMessageList.push(msg);\n PubSub.publish('newChatMessage', this.getAllMessages());\n }\n else {\n throw new Error('The argument needs to be a Message instance.');\n }\n }", "title": "" }, { "docid": "e5fc4fd24bc186d6469a2f246f44d448", "score": "0.48867354", "text": "function add_message(key, value){\n $('<div>',{\n class: \"received_msg\"\n }).append( $('<div>',{\n class: \"received_withd_msg\"\n }).append( $('<p>'\n ).append(\n value[0]['text']))\n ).append( $('<span>',{\n class: \"time_date\"\n }).append(`${value[0]['time']} | ${value[0]['date']}`)\n ).appendTo('#msg_history')\n $('#msg_history').scrollTop($('#msg_history')[0].scrollHeight);\n}", "title": "" }, { "docid": "5c17e3a76adcd0f76ebfd9b193104c0b", "score": "0.48863932", "text": "function saveMessage(name,track,email,phone){\r\n var newmesgref=messageref.push();\r\n newmesgref.set({ID:name,\r\n email:email,\r\n track:track,\r\n phone:phone\r\n});\r\n }", "title": "" }, { "docid": "36814eb7ab0573126fd1deaf90cca562", "score": "0.4882007", "text": "function addNewReply(msg){\n\t\t\n\t\tconst messageObject = {\n\t\t\tmessage: msg.reply_to_message.text,\n\t\t\treply: [msg.text]\n\t\t}\n\t\n\t\treplyDataBase = new Reply()\n\t\treplyDataBase.message = messageObject.message\n\t\treplyDataBase.reply = messageObject.reply[0]\n\t\t\n\t\treplyDataBase.save()\n\t\t \t.then(() => {\n\t\t\t\tconsole.log('Salvo')\n\t\t})\n\t\t\t.catch(e => {\n\t\t \t\tconsole.log('Erro: ' + e.message)\n\t\t })\n\t}", "title": "" }, { "docid": "715dee272468e8c0733df418aec29c0a", "score": "0.48655465", "text": "function addFixed(arg) {\n f = xen.freq(arg);\n freqs.push(f.freq);\n baseFreq = baseFreq || f;\n }", "title": "" }, { "docid": "4fbc236d3a419b7fd83896bf00e81dae", "score": "0.4864426", "text": "function sendMsg(chnl, msg){\n if(!util.inChronOrder(tosend)){\n console.log(\"messages to be sent are not in chronological order\")\n debugger;\n }\n let currentTime = new Date();\n let secsAgo = util.addMinutes(currentTime, (-1 * sendrate)/60.0);\n if(lastSentTime > secsAgo){\n console.log(\"storing message...\" + msg);\n tosend.push(\n { msg:msg,\n time: currentTime,\n channel: chnl\n });\n } else {\n console.log(\"sending message...\" + msg);\n lastSentTime = currentTime;\n client.say(chnl, msg).then((data) => {\n }).catch((err) => {\n console.log(\"failed to send message\", err);\n });\n }\n}", "title": "" }, { "docid": "c33acf5f8907ee0ae18070748132b5fa", "score": "0.48605835", "text": "generateMessage(message, status) {\n const currentChat = this.contacts[this.activeContact].messages;\n const newMessage = {\n date: dayjs().format(\"DD/MM/YYYY HH:mm:ss\"),\n message: message,\n status: status,\n };\n currentChat.push(newMessage);\n }", "title": "" }, { "docid": "11d542070a63e2a329eb6f2f6a1aef7b", "score": "0.4802277", "text": "onNotification(msg) {\n const [event, table, ...keys] = msg.payload.split(':');\n if (keys.length === 0) {\n this.emitter.emit(msg.channel, { event, table });\n }\n else {\n for (const key of keys) {\n this.emitter.emit(msg.channel, { event, table, key });\n }\n }\n }", "title": "" }, { "docid": "8dbc880689793af4c49e19042e835b96", "score": "0.4800872", "text": "function pushMetrics(message){\n if(!message.status){\n messages.push(message);\n timingMetrics.push( new Date() - new Date (message.time ));\n byteMetrics.push(byteCount(message.message));\n\n mongo.insert({\n message:message,\n timingMetrics:timingMetrics[timingMetrics.length-1],\n byteMetrics:byteMetrics[byteMetrics.length-1]\n })\n }\n}", "title": "" }, { "docid": "748da5153005ff00a8c6f30e7936606e", "score": "0.4795934", "text": "function pushString() {\n if (strings[msgid] === undefined) {\n strings[msgid] = {};\n }\n if (strings[msgid][msgctxt] === undefined) {\n strings[msgid][msgctxt] = { refs: [] };\n if (f_isPlural) {\n strings[msgid][msgctxt].msgid_plural = msgid_plural;\n }\n }\n strings[msgid][msgctxt].refs.push(line);\n }", "title": "" }, { "docid": "d89c0bff22b593e9bf0646022a4be4e4", "score": "0.47931832", "text": "function svmsg(chat_id,msg_id){\n let r = indexRows(chat_id) // mencari baris dimana chat_id disimpan\n if(r){\n return db.setValue(r,3,msg_id) // menambahkan message_id di baris yang sama kolom ke 3\n }\n}", "title": "" }, { "docid": "ca94e834b84195dbd7a8212d10b220dd", "score": "0.47886458", "text": "function savedata(n,a,e,f,d,T,s,t){\n var newMessageRef = messagesRef.push();\n newMessageRef.set({\n\n Company_Name:n,\n\n About_Company:a,\n\n email:e,\n\n Field:f,\n\n Duration:d,\n\n Starting_Date:T,\n\n salary:s,\n\n task:t\n \n \n });\n}", "title": "" }, { "docid": "85e75acfe6748aca67dfef0871d98379", "score": "0.4786946", "text": "function addRoomMessage(message) {\n switch (message.type) {\n case \"Customer\":\n\n if (lastMsgBy == 'Agent') {\n $('#chats').append('<p class=\"systemmessage\">' + time + '</p>');\n $('#chats1').append('<p class=\"systemmessage\">' + time + '</p>');\n }\n\n agentMsgCount = 0;\n customerMsgCount++;\n /** cases of concurrent messages **/\n if (customerMsgCount == 1) {\n $(\"#chats\").append('<div class=\"chat_message_wrapper chat_message_left\"><ul class=\"chat_message\"><li class=\"messagestart\"><p>' + message.message + '</p></li></ul></div>');\n $(\"#chats1\").append('<div class=\"chat_message_wrapper chat_message_left\"><ul class=\"chat_message\"><li class=\"messagestart1\"><p>' + message.message + '</p></li></ul></div>');\n } else {\n $('.messagestart:last').parent().append('<li class=\"message2nd\"><p>' + message.message + '</p></li>');\n $('.messagestart1:last').parent().append('<li class=\"message2nd\"><p>' + message.message + '</p></li>');\n }\n\n time = new Date();\n time = time.toLocaleString('en-US', { hour: 'numeric', minute: 'numeric', hour12: true });\n\n lastMsgBy = 'Customer';\n\n break;\n case \"Agent\":\n console.log(\"Nuevo mensaje del agente !!!\");\n if (lastMsgBy == 'Customer') {\n $('#chats').append('<p class=\"systemmessage\">' + time + '</p>');\n $('#chats1').append('<p class=\"systemmessage\">' + time + '</p>');\n }\n\n customerMsgCount = 0;\n agentMsgCount++;\n /** case of concurrent messages **/\n if (agentMsgCount == 1) {\n $(\"#chats\").append('<div class=\"chat_message_wrapper chat_message_right\"><ul class=\"chat_message\"><li class=\"messageagent\"><p class=\"test\" data-id=\"'+agentMsgCount+'\">' + message.message + '</p></li></ul></div>');\n $(\"#chats1\").append('<div class=\"chat_message_wrapper chat_message_right\"><ul class=\"chat_message\"><li class=\"messageagent2\"><p class=\"test\" data-id=\"'+agentMsgCount+'\">' + message.message + '</p></li></ul></div>');\n\n } else {\n $('.messageagent:last').parent().append('<li class=\"messageagent2nd\"><p class=\"prueba\" data-id=\"'+agentMsgCount+'\">' + message.message + '</p></li>');\n $('.messageagent2:last').parent().append('<li class=\"messageagent2nd\"><p class=\"prueba\" data-id=\"'+agentMsgCount+'\">' + message.message + '</p></li>');\n }\n\n time = new Date();\n time = time.toLocaleString('en-US', { hour: 'numeric', minute: 'numeric', hour12: true });\n\n lastMsgBy = 'Agent';\n\n break;\n default:\n // var time = message.time.toLocaleString('en-US', { hour: 'numeric', minute: 'numeric', hour12: true });\n $('#chats').append('<p class=\"systemmessage\">' + message.message + '</p>');\n $('#chats1').append('<p class=\"systemmessage text-center\">' + message.message + '</p>');\n break;\n }\n\n $('#scroll').animate({ scrollTop: $('#scroll').prop('scrollHeight') }, 300);\n $('#scroll1').animate({ scrollTop: $('#scroll1').prop('scrollHeight') }, 300);\n\n\n\n}", "title": "" }, { "docid": "6799391b12a03b212b976647be601fc8", "score": "0.4769421", "text": "function search_insert (msg, done) {\n console.log('PUT')\n index.PUT([{\n id: msg.id,\n text: msg.text,\n user: msg.user,\n when: msg.when\n }])\n .then(function(result) {\n console.log(result)\n done({})\n })\n .catch(function (err) {\n console.log('Something went wrong!');\n console.log(err);\n done({})\n })\n }", "title": "" }, { "docid": "c02831ee71e6b575f97318ed2025b3d0", "score": "0.4769154", "text": "function addMessage () {\n let msg = {\n \"objet\" : objet.value, \"corps\" : corps.value\n };\n\n if (msg.objet == \"\" || msg.corps == \"\")\n showAlert(\"Error ! All fields are required\", \"alert-danger\");\n else {\n dbRef.push().set(msg);\n objet.value = \"\";\n corps.value = \"\";\n showAlert(\"Success. Your message has been added\", \"alert-success\");\n }\n }", "title": "" }, { "docid": "a61d7a88dd1f1e6ece4c867094fb2771", "score": "0.4759478", "text": "function createMessageOnMessageMap(type, text, date, user, isFile) {\n if (messageMap.get(user) === undefined) {\n messageMap.set(user, {\n messages: []\n });\n }\n const messageArray = messageMap.get(user).messages;\n messageArray.push({\n type: type,\n text: text,\n date: date,\n user: user,\n isFile: isFile\n });\n // .log(messageMap);\n}", "title": "" }, { "docid": "97c3014b946510b2fcb76dd886434bd5", "score": "0.47570804", "text": "function count(msg) {\n //console.log(\"[\"+msg.channel.name+\"]:\"+ msg.author.username);\n\n // rAnime count\n if (msg.channel.guild.id === db.etc.rAnimeServerID) {\n // filtered channels\n if (dbObj.channelFilter.indexOf(msg.channel.id) != -1)\n return;\n\n // main channel message\n if (msg.channel.id in dbObj.mainChannels) {\n dbObj.mainChannels[msg.channel.id].count++;\n dbObj.mainChannels[msg.channel.id].total++;\n dbObj.totals.mainTotal.count++;\n dbObj.totals.mainTotal.total++;\n }\n // optin channel message\n else if (msg.channel.id in dbObj.optinChannels) {\n dbObj.optinChannels[msg.channel.id].count++;\n dbObj.optinChannels[msg.channel.id].total++;\n dbObj.totals.optinTotal.count++;\n dbObj.totals.optinTotal.total++;\n }\n // temp channel message\n else if (msg.channel.id in dbObj.otherChannels) {\n dbObj.otherChannels[msg.channel.id].count++;\n dbObj.otherChannels[msg.channel.id].total++;\n dbObj.totals.tempTotal.count++;\n dbObj.totals.tempTotal.total++;\n }\n else { // new temp channel not in db\n dbObj.otherChannels[msg.channel.id] = {\n name: msg.channel.name,\n count: 1,\n total: 1\n };\n dbObj.totals.tempTotal.count++;\n dbObj.totals.tempTotal.total++;\n }\n }\n\n\n // rLL Count\n else if (msg.channel.guild.id === db.etc.rLLServerID) {\n // message is in list of counting channels\n if (msg.channel.id in dbLL) {\n dbLL[msg.channel.id].count++;\n dbLL[msg.channel.id].total++;\n }\n }\n\n }", "title": "" }, { "docid": "e18882ce6799c2f9c906357a2392abb6", "score": "0.47409782", "text": "function handleMessage(msg) {\n if (isOur(msg)) return;\n let incomingMessage = {\n cid: cid,\n uid: 'TODO: Change me',\n text: 'TODO: Change me',\n channel: 'TODO: Change me',\n msgType: 'chatMessage',\n timeReceived: msg.timestamp || Date.now()\n };\n \n rootRef.child('pendingMessages').push(incomingMessage)\n}", "title": "" }, { "docid": "344ddccdc3c464c2a5a937a75797e2df", "score": "0.4738977", "text": "function sentMessage() {\n var message = validator.escape(html_sanitize($('#messageInput').val().trim()).trim());\n if (message !== \"\") {\n frequency -= (new Date() - lastMsg) * 0.05;\n frequency = (frequency < 0) ? 0 : frequency;\n if ((frequency += penalty) < 1000) { /* if within threshold */\n socket.emit('message', message);\n addMessage(message, \"Me\");\n $('#messageInput').val('');\n } else { /* display alert on flood lockout */\n $('.alert').css('visibility', 'visible');\n $('.alert').fadeIn(1000);\n window.scrollTo(0, document.body.scrollHeight);\n $('.alert').fadeOut(1000);\n }\n lastMsg = new Date();\n }\n}", "title": "" }, { "docid": "4911ab3d6c9dd2449933301cbaf61112", "score": "0.47304475", "text": "process(message, timeStamp) {\n\t\tif (timeStamp > this.periodStart && timeStamp < this.periodEnd) {\n\t\t\tthis.counter += 1;\n\t\t} else {\n\t\t\t//ignore the message if outside of this timeStamp\n\t\t}\n\t\t\n\t}", "title": "" }, { "docid": "ef868febcda418488e5f823ce3a8d51f", "score": "0.47283655", "text": "onNewMessage(cleanMessage) {\n let index = this.model.channelList.findIndex(c => c.id === cleanMessage.channelId);\n // Checks if the message is from a joined channel.\n if(index >= 0 && this.model.channelList[index].joinStatus) { \n this.model.channelList[index].messages.push(cleanMessage); \n // Adds a notifications if the message is not in the current group \n if(index != this.model.currentGroupIndex) {\n this.model.channelList[index].notification++;\n if(!this.model.applicationMute){\n this.model.notifSound.play();\n }\n this.view.refreshGroups(this.model);\n } else {\n this.view.refreshConversation(this.model);\n } \n }\n }", "title": "" }, { "docid": "aabb5bab68835f95e57a67c5bb4d35fa", "score": "0.4727824", "text": "async addEntry(name, title, message)\n {\n const data = await this.getData();\n data.unshift({ name, title, message });\n\n return writeFile(this.dataFile, JSON.stringify(data));\n }", "title": "" }, { "docid": "d6328b39f78bde86c747241005bddf72", "score": "0.472313", "text": "function writeCell(msg)\n{ if(!_rowStarted)\n { _outputBuffer += '<tr>';\n _rowStarted = true;\n }\n _outputBuffer += ('<td style=\"text-align: right;\">'+LFT+msg+RGT+'</td>');\n}", "title": "" }, { "docid": "21b53d13df66c29982943745206b4472", "score": "0.4719834", "text": "function addMessage(){\n\tvar new_line = [].slice.apply(arguments).join(\" \");\n\tvar lines = document.getElementById( 'messages' ).value.split(\"\\n\", MESSAGE_WINDOW_LINES-1);\n\tlines.unshift(new_line);\n\tdocument.getElementById( 'messages' ).value = lines.join(\"\\n\");\n}", "title": "" }, { "docid": "31f9b7c10041372da7b7d28b59252cb1", "score": "0.47178027", "text": "function storeMessage(downloadURL, timestamp, fileName, fileType){\n let msgForm = document.querySelector('.submitMessage');\n const id = document.querySelector('.messages').id;\n const newMessage = msgForm['newTxt'].value;\n console.log(downloadURL);\n\n db.collection('chats').doc(id).collection('messages').add({\n userID: currUser,\n content: newMessage,\n fileURL: downloadURL,\n fileName: fileName,\n fileType: fileType,\n timestamp: timestamp\n }).then(docRef => {\n db.collection('chats').doc(id).update({\n latestMessage: docRef.id\n });\n }).then(() => {\n if(lastMsg){\n unsubscribe = db.collection('chats').doc(id).onSnapshot(doc => {\n if(doc.exists){\n const msgID = doc.data().latestMessage;\n db.collection('chats').doc(id).collection('messages').doc(msgID).get().then(msgInfo => {\n if(msgInfo.exists){\n const messageInfo = msgInfo.data();\n let msgOwner;\n console.log(\"sending message: \"+messageInfo.fileURL);\n if (messageInfo.userID == currUser) genMessage(\"own\", messageInfo.content, fileName, fileType, downloadURL); \n else genMessage(\"otherUser\", messageInfo.content, fileName, fileType, downloadURL); \n \n //scroll down to reveal new message\n scrollBottom();\n msgForm.reset();\n \n }\n })\n }\n })\n lastMsg = false;\n }\n })\n}", "title": "" }, { "docid": "2c0e4d16d59b44d6be4714549538012e", "score": "0.47167203", "text": "function add_new_user_message(){\r\n\t\t\t\r\n\t\t\t//user added user type\r\n\t\t\tvar userType = req.query.user_type;\r\n\t \t\tvar user_type = userType.replace(userType[0], userType[0].toUpperCase());//capitalize first letter\r\n\t\t\t\r\n\t\t\t//user adding usertype\t\t\t\r\n\t\t\tvar added_by_userType = req.query.added_by_usertype;\r\n\t \t\tvar added_by_user_type = added_by_userType.replace(added_by_userType[0], added_by_userType[0].toUpperCase());//capitalize first letter\r\n\t\t\t\r\n\t\t\t//date and time\r\n\t\t\tvar date = new Date();\r\n\t\t\tvar hour = date.getHours();\r\n\t\t\tvar minutes = date.getMinutes();\r\n\t\t\tvar day = date.getDay();\r\n\t\t\tvar day_of_month = date.getDate()\r\n\t\t\tvar month = date.getMonth();\r\n\t\t\tvar year = date.getFullYear();\r\n\t\t\t\r\n\t\t\tvar week_array=['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];\r\n\t\t\tvar month_array = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];\r\n\t\t\t\r\n\t\t\tvar message_date_time = hour+':'+minutes+((hour > 12)?'am':'pm')+' '+week_array[day]+' '+day_of_month+' '+month_array[month]+' '+year;\r\n\t\t\t//welcome message\r\n\t\t\tvar new_message_contents =['{\"from\":\"'+req.query.added_by_name+' : '+added_by_user_type+'\",\"message\":\"Hello, Welcome, Please read Help , to know how the system works!.\",\"date\":\"'+message_date_time+'\"}','{\"from\":\"'+req.query.added_by_name+' : '+added_by_user_type+'\",\"message\":\"Reply to this message to contact me.\",\"date\":\"'+message_date_time+'\"}'];\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tkeystone.createItems({//add items to db//user details\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t'Messaging' : [\t\t\t\t\t\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmessage_initiator_id:req.query.added_by_id, message_initiator_names:req.query.added_by_name, message_initiator_usertype:added_by_user_type, message_parcitipant_id:req.query.id, message_parcitipant_names:req.query.name.toLowerCase()+' '+req.query.surname.toLowerCase(), message_parcitipant_usertype:user_type, new_message_participator:true, messages_array:new_message_contents, last_updated_month:month, last_updated_date: date,\r\n\t\t\t\t\t}\r\n\t\t\t\t]\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t}, function(err, results){\r\n\t\t\t\tif(err){\r\n\t\t\t\t\tconsole.log('Error creating message to db message initiatotor ID : '+ req.query.added_by_id+', usertype : '+added_by_user_type+' , new user id : '+req.query.id+', usertype : '+user_type);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t});\r\n\t\t\t\r\n\t\t}", "title": "" }, { "docid": "1ece0f21af57380fb6c0ccfc5f51ad7a", "score": "0.47130886", "text": "function cadNextMessage()\n{\n\tmsg++;\n\n\tupdateCad();\n}", "title": "" }, { "docid": "fec262d5288a15db22f61121834ac495", "score": "0.47129625", "text": "function addToMessage() {\n // create message span if not created before\n let messageContainer = document.getElementById(\"message-container\");\n if (document.getElementById(\"message\") == null) {\n let span = document.createElement(\"span\");\n span.id = \"message\";\n messageContainer.appendChild(span);\n }\n\n // insert message to span\n let message = [\"\"];\n let span = document.getElementById(\"message\");\n let letters = document.querySelectorAll(\".result\");\n for (let i = 0; i < letters.length; i++) {\n message.push(letters[i].innerHTML);\n }\n span.innerText += message.join(\"\");\n\n // reset binary rows\n let div = document.getElementById(\"binary-container\");\n while (div.firstChild) {\n //div.removeChild(div.lastChild);\n deleteRow(div.querySelector(\".letter\"));\n }\n addRow();\n}", "title": "" }, { "docid": "ae148f1ee722240171b17255c6ae5cf2", "score": "0.47117245", "text": "update(msg) {\n this.conversation.next([msg]);\n }", "title": "" }, { "docid": "fa0af5e1e838eabcee087a975e8979a0", "score": "0.47070548", "text": "_ (speakingAs, input, callback, options) {\n\t\t\t\t\tconst message = {\n\t\t\t\t\t\twho: speakingAs,\n\t\t\t\t\t\ttype: \"general\",\n\t\t\t\t\t\tcontent: input,\n\t\t\t\t\t\tplayerid: window.currentPlayer.id,\n\t\t\t\t\t\tavatar: null,\n\t\t\t\t\t\tinlinerolls: []\n\t\t\t\t\t};\n\n\t\t\t\t\tconst key = d20.textchat.chatref.push().key();\n\t\t\t\t\td20.textchat.chatref.child(key).setWithPriority(message, Firebase.ServerValue.TIMESTAMP)\n\t\t\t\t}", "title": "" }, { "docid": "fa0af5e1e838eabcee087a975e8979a0", "score": "0.47070548", "text": "_ (speakingAs, input, callback, options) {\n\t\t\t\t\tconst message = {\n\t\t\t\t\t\twho: speakingAs,\n\t\t\t\t\t\ttype: \"general\",\n\t\t\t\t\t\tcontent: input,\n\t\t\t\t\t\tplayerid: window.currentPlayer.id,\n\t\t\t\t\t\tavatar: null,\n\t\t\t\t\t\tinlinerolls: []\n\t\t\t\t\t};\n\n\t\t\t\t\tconst key = d20.textchat.chatref.push().key();\n\t\t\t\t\td20.textchat.chatref.child(key).setWithPriority(message, Firebase.ServerValue.TIMESTAMP)\n\t\t\t\t}", "title": "" }, { "docid": "85a874f7a4c92ec9da8caffe8616f9b5", "score": "0.4705722", "text": "log(sApp, level, message) {\n this.checkCache(sApp, 0);\n\n const emptyRow = this.getFirstEmptyRowInMemory(sApp);\n\n const timeColumn = Cell.getColumnByTitleInMemory(this.tableCache, TIME_TITLE, TITLE_ROW - 1);\n const typeColumn = Cell.getColumnByTitleInMemory(this.tableCache, TYPE_TITLE, TITLE_ROW - 1);\n const messageColumn = Cell.getColumnByTitleInMemory(this.tableCache, MESSAGE_TITLE, TITLE_ROW - 1);\n\n if (timeColumn == undefined || typeColumn == undefined || messageColumn == undefined) {\n throw new Error(`Jotakin otsikoista: ${TIME_TITLE}, ${TYPE_TITLE}, ${MESSAGE_TITLE} ei voitu löytää` +\n ` riviltä: ${TITLE_ROW}. Tarkista, että otsikot on merkitty taulukkoon.`);\n }\n\n // Update real sheet\n this.logSheet.getRange(emptyRow + 1, timeColumn + 1).setValue(new Date()).setNumberFormat(\"dd.mm.yyyy hh:mm\");\n this.logSheet.getRange(emptyRow + 1, typeColumn + 1).setValue(level);\n this.logSheet.getRange(emptyRow + 1, messageColumn + 1).setValue(message);\n\n // Update cache table\n this.tableCache[emptyRow][timeColumn] = new Date();\n this.tableCache[emptyRow][typeColumn] = level;\n this.tableCache[emptyRow][messageColumn] = message;\n }", "title": "" }, { "docid": "7da12ad6b79df12f3eb72d2574dbd534", "score": "0.47046277", "text": "function notification(message) {\n if (message.type === 'JOIN') {\n $('#userinfo').append('<tr><td class=\"user-information\">' + capitalizeFirstLetter(message.user) + ' joined!</td></tr>');\n } else if (message.type === 'LEAVE') {\n $('#userinfo').append('<tr><td class=\"user-information\">' + capitalizeFirstLetter(message.user) + ' left!</td></tr>');\n }\n}", "title": "" }, { "docid": "e16d5fbe05ddb5a93b78e55ad189b55f", "score": "0.4696707", "text": "function saveMessage(fname, lname, country, subject){\r\n\t\t\tvar newMessageRef = messagesRef.push();\r\n\t\t\tnewMessageRef.set({\r\n\t\t\t\tfname: fname,\r\n lname: lname,\r\n country: country,\r\n\t\t\t\tsubject:subject,\r\n\r\n\t\t\t});\r\n }", "title": "" }, { "docid": "ca4e8d5a1b8a73cbfd2edd0eec1be32f", "score": "0.46932483", "text": "function updateCurrentDataFirebase(message) {\n\t var d = new Date();\n var timeInMillis = d.getTime();\nreturn db.ref(`/devices/`).push({\n\taccelX: message.accelX,\n accelY: message.accelY,\n\taccelZ: message.accelZ\n });\n}", "title": "" }, { "docid": "b831cdfbe51d2a8a1e0aca708bbcacce", "score": "0.4680746", "text": "function saveMessage(service_type, vehical_make, vehical_model,appointment_date, appointment_time, name, email, phone, message){\n var newMessageRef = messagesRef.push();\n newMessageRef.set({\n service_type: service_type,\n vehical_make: vehical_make, \n vehical_model: vehical_model,\n appointment_date:appointment_date,\n appointment_time:appointment_time,\n name: name,\n email:email,\n phone:phone,\n message:message\n });\n }", "title": "" }, { "docid": "793721b3f11e9251c56843ed2f89f502", "score": "0.46807012", "text": "set frequency(value) {}", "title": "" }, { "docid": "1b68d2c1136d1d285d98b8d7e5c75b85", "score": "0.46766677", "text": "async addNewMessage(newMessage, teamName) {\n // console.log(\"FROM DATABASEFACADE:\",newMessage,teamName)\n return await Team.findOneAndUpdate(\n { name: teamName },\n { $push: { \"messages\": newMessage } },\n { safe: true, upsert: false })\n .then((model) => {\n if (model === null) { return false }\n else { return true }\n })\n }", "title": "" }, { "docid": "e7f67b5c5f294419e178ffafe02e674d", "score": "0.4676191", "text": "function recoverFrequency (x) {\n if (register[x]) {\n recoveredFrequencies.push(lastSoundPlayed)\n }\n }", "title": "" }, { "docid": "28b5216bdb0e8f6329e0aedc27232a1c", "score": "0.46742612", "text": "function adding(message) {\n counter += 1\n let addnewmsg = document.createElement('div')\n addnewmsg.classList.add('newmsg')\n addnewmsg.setAttribute('id', counter)\n addnewmsg.innerText = message\n addnewmsg.style.color = 'black'\n msgfield.append(addnewmsg)\n}", "title": "" }, { "docid": "5dcb753838112c8b24a737f6021dd1d7", "score": "0.4671619", "text": "function saveMessage(cname, ccnum, expmonth, expyear, cvv){\n\tvar newMessageRef = messagesRef.push();\n\tnewMessageRef.set({ \n\tcname: cname,\n\tccnum: ccnum,\n\texpmonth: expmonth,\n\texpyear: expyear,\n\tcvv: cvv\n\t\n\t});\n}", "title": "" }, { "docid": "6084c54db300bb076c68461d97f2c75f", "score": "0.46638477", "text": "function sendMessage(){\n\t\t\t\t\tvar ref = fb.messages.push({\n\t\t\t\t\t\tsentAt: Date.now()\n\t\t\t\t\t})\n\t\t\t\t\tref.setPriority(thread.$id)\t\n\t\t\t\t}", "title": "" }, { "docid": "19c94d5724717e2efad80833e6c7fe0c", "score": "0.46635857", "text": "function addMessage(msg, type) {\n\t\tvar msgClass = type;\n\t\tvar initials = my_initials;\n\t\tif (type == \"them\") {\n\t\t\tvar initials = their_initials;\n\t\t} else if (type == \"lilac\") {\n\t\t\tvar msgClass = \"them\";\n\t\t\tvar initials = lilac_initials;\n\t\t}\n\t\ttime = (new Date()).toLocaleString();\n\t\tnewMsg = $('<div name = ' + time + ' class=\"cd-timeline-block\"><div class=\"cd-timeline-img is-hidden\">' + initials + '</div><div class=\"cd-timeline-content ' + msgClass + ' is-hidden\"><h6 style=\"line-height:1.5em;overflow-wrap: break-word; word-wrap: break-word\">' + msg + '</h6><span class=\"cd-date\">' + time + '</span></div></div>');\n\t\t$(\"#cd-timeline\").append(newMsg);\n\t\tscrollDown();\n\t\tnewMsg.find('.cd-timeline-img, .cd-timeline-content').removeClass('is-hidden').addClass('bounce-in');\n\t}", "title": "" }, { "docid": "bb71643bc5d238db5dcdf4352fc35d03", "score": "0.46563825", "text": "function addUnreadNotification()\n{\n\tvar todayDate = today();\n\tallUserSubscribe.forEach(function(item, key, mapObj){\n\t\tvar ref = admin.database().ref(\"users/\" + key + \"/unread/\");\n\t\tvar contactToTopicListTable = pivotContactTable(item);\n\t\tvar contactWithSelectedTopicList = [];\n\t\tcontactWithSelectedTopicList = pickOneTopicForContact(contactToTopicListTable);\n\t\tusersToUnread.set(key,contactWithSelectedTopicList);\n\t\tfor(var index in contactWithSelectedTopicList)\n\t\t{\n\t\t\tref.push().set({\n\t\t\t title: contactWithSelectedTopicList[index].get(\"title\"),\n\t\t\t link: contactWithSelectedTopicList[index].get(\"url\"),\n\t\t\t date: todayDate,\n\t\t\t contactID: contactWithSelectedTopicList[index].get(\"id\"),\n\t\t\t contactName: contactWithSelectedTopicList[index].get(\"name\"),\n\t\t\t email: contactWithSelectedTopicList[index].get(\"email\"),\n\t\t\t tag: contactWithSelectedTopicList[index].get(\"tag\"),\n\t\t\t source: contactWithSelectedTopicList[index].get(\"source\")\n\t\t \t});\n\t\t}\n\t});\n}", "title": "" }, { "docid": "84018b26cba599a7c336607a91a1e6af", "score": "0.46551225", "text": "function addMessagesToList(messages, list) {\n\tvar origional_number_messages_length = list.rows.length;\n\t// Use old rows first\n\tfor (var i = origional_number_messages_length; messages.length > i ; i++) {\n\t\tvar tableRow = list.insertRow(1);\n\t\tvar tableItem = document.createElement('td');\n\t\ttableItem.appendChild(document.createTextNode(messages[i].from));\n\t\ttableRow.appendChild(tableItem);\n\t\ttableItem = document.createElement('td');\n\t\ttableItem.appendChild(document.createTextNode(messages[i].timeSlice));\n\t\ttableRow.appendChild(tableItem);\n\t\ttableItem = document.createElement('td');\n\t\ttableItem.appendChild(document.createTextNode(messages[i].timeLeft));\n\t\ttableRow.appendChild(tableItem);\n\t\ttableItem = document.createElement('td');\n\t\ttableItem.appendChild(document.createTextNode(messages[i].log));\n\t\ttableRow.appendChild(tableItem);\n\t}\n}", "title": "" }, { "docid": "a252379c5d90a5fc29057b41afdf336d", "score": "0.46535942", "text": "function saveMessage(id, existMsg, sendMsg) {\n addMsg(existMsg, sendMsg);\n allMsg[id] = existMsg;\n}", "title": "" }, { "docid": "afe58ea15d59e878be098ab0cdb0f037", "score": "0.46474254", "text": "function storeMessage() {\n\tvar firebaseRef = firebase.database().ref(\"Messages\");\n\tfirebaseRef.push().set(newMessage);\n}", "title": "" }, { "docid": "11acd0aabfcefdd2a3870cc538e7dd42", "score": "0.4637876", "text": "function saveMessage(name,dob,dobreg,gender,category,religion,mothertongue,nationality,aadhaar,bloodgroup,healthid,idmark,acyear,admno,admstatus,prclass,pvschool,prsec,prroll,praddl,prstream,prfcomp1,prfcomp2,prfsub1,prfsub2,prfsub3,prfsub4,pvclass,pvsec,pvroll,pvstream,pvaddl,medium,vill,habitation,district,block,panchayat,po,ps,pin,phone,email,fname,mname,gname,relationship,aincome,gqualification,gvill,ghabitation,gdistrict,gblock,gpanchayat,gpo,gps,gpin,gphone,gemail,bplstatus,bplno,cwsn,cwsntyp,bname,bcode,bifsc,acno,appid,updphoto,updsign,updbproof,updslc,updaadhaarpic,updbpass,updcaste){\r\n /*\r\n var newMessageRef = messagesRef.push();\r\n MessageRef.set({\r\n */\r\n firebase.database().ref('users/' + appid).set({\r\nappid:appid,\r\nname:name,\r\ndob:dob,\r\ndobreg:dobreg,\r\ngender:gender,\r\ncategory:category,\r\nreligion:religion,\r\nmothertongue:mothertongue,\r\nnationality:nationality,\r\naadhaar:aadhaar,\r\nbloodgroup:bloodgroup,\r\nhealthid:healthid,\r\nidmark:idmark,\r\nacyear:acyear,\r\nadmno:admno,\r\nadmstatus:admstatus,\r\nprclass:prclass,\r\npvschool:pvschool,\r\nprsec:prsec,\r\nprroll:prroll,\r\npraddl:praddl,\r\nprstream:prstream,\r\nprfcomp1:prfcomp1,\r\nprfcomp2:prfcomp2,\r\nprfsub1:prfsub1,\r\nprfsub2:prfsub2,\r\nprfsub3:prfsub3,\r\nprfsub4:prfsub4,\r\npvclass:pvclass,\r\npvsec:pvsec,\r\npvroll:pvroll,\r\npvstream:pvstream,\r\npvaddl:pvaddl,\r\nmedium:medium,\r\nvill:vill,\r\nhabitation:habitation,\r\ndistrict:district,\r\nblock:block,\r\npanchayat:panchayat,\r\npo:po,\r\nps:ps,\r\npin:pin,\r\nphone:phone,\r\nemail:email,\r\nfname:fname,\r\nmname:mname,\r\ngname:gname,\r\nrelationship:relationship,\r\naincome:aincome,\r\ngqualification:gqualification,\r\ngvill:gvill,\r\nghabitation:ghabitation,\r\ngdistrict:gdistrict,\r\ngblock:gblock,\r\ngpanchayat:gpanchayat,\r\ngpo:gpo,\r\ngps:gps,\r\ngpin:gpin,\r\ngphone:gphone,\r\ngemail:gemail,\r\nbplstatus:bplstatus,\r\nbplno:bplno,\r\ncwsn:cwsn,\r\ncwsntyp:cwsntyp,\r\nbname:bname,\r\nbcode:bcode,\r\nbifsc:bifsc,\r\nacno:acno,\r\nupdphoto:updphoto,\r\nupdsign:updsign,\r\nupdbproof:updbproof,\r\nupdslc:updslc,\r\nupdaadhaarpic:updaadhaarpic,\r\nupdbpass:updbpass,\r\nupdcaste:updcaste\r\n });\r\n}", "title": "" }, { "docid": "20077993240dd55957a26cce3792e003", "score": "0.463428", "text": "function writeMessage (msg,t,p,f) {\n\t//alert('s');\n\t\t//cria se ele nao existir\n\t\tvar str='<table style=\"width:100%;margin-bottom:10px\" id=\"tb_message\"><tr><td>'+\n\t\t\t\t'<div id=\"div_message\" class=\"message warning\" style=\"display:none\">'+\n\t\t\t\t'<div class=\"icon\"></div>'+\n\t\t\t\t'<div class=\"msg\"></div>'+\n\t\t\t\t'<div class=\"close\" onclick=\"$(\\'#div_message\\').hide(\\'slow\\')\">X</div>'+\n\t\t\t\t'</div>'+\n\t\t\t\t'</td></tr></table>';\n\n\t\t//se existir entao remove para garantir q ele nao exista no lugar incorreto\tcomo por exemplo existe em listar e está com o riwabox aberto e precisa aparecer la\n\t\tif ($('#tb_message').length> 0 && p) {\n\t\t\t$('#tb_message').remove();\n\t\t};\n\n\t\tif ($('#tb_message').length<1 && p) {\n\t\t\t$('#'+p).before(str);\n\t\t};\n\n\t\tvar _class='message warning';\n\t\tif (t=='c') {\n\t\t\tvar _class='message confirm';//()verde\n\t\t};\n\t\tif (t=='w') {\n\t\t\tvar _class='message warning';//()amarelo\n\t\t};\n\t\tif (t=='e') {\n\t\t\tvar _class='message error';//()vermelho\n\t\t};\n\n\t\t$('#div_message').attr('class',_class).fadeIn('slow');\n\t\t$('#div_message .msg').html(msg);\n\n\t\tif(f){\n\t\t\tf= (f*1000);//multiplica para aplicar em milisegundos\n\t\t\tsetTimeout(function(){ $('#div_message').fadeOut('slow'); }, f);\n\t\t}\n\n\n}", "title": "" }, { "docid": "b726e313da50638ac62a6e1df3b78297", "score": "0.46264973", "text": "function addMention(mention) {\n\n var currentMessage = getInputBoxValue(); //Get the actual value of the text area\n\n // Using a regex to figure out positions\n var regex = new RegExp(\"\\\\\" + settings.triggerChar + currentDataQuery, \"gi\");\n regex.exec(currentMessage); //Executes a search for a match in a specified string. Returns a result array, or null\n\n var startCaretPosition = regex.lastIndex - currentDataQuery.length - 1; //Set the star caret position\n var currentCaretPosition = regex.lastIndex; //Set the current caret position\n\n var start = currentMessage.substr(0, startCaretPosition);\n var end = currentMessage.substr(currentCaretPosition, currentMessage.length);\n var startEndIndex = (start + mention.value).length + 1;\n\n // See if there's the same mention in the list\n if( !_.find(mentionsCollection, function (object) { return object.id == mention.id; }) ) {\n mentionsCollection.push(mention);//Add the mention to mentionsColletions\n }\n\n // Cleaning before inserting the value, otherwise auto-complete would be triggered with \"old\" inputbuffer\n resetBuffer();\n currentDataQuery = '';\n hideAutoComplete();\n\n // Mentions and syntax message\n var updatedMessageText = start + mention.value + ' ' + end;\n elmInputBox.val(updatedMessageText); //Set the value to the txt area\n\t elmInputBox.trigger('mention');\n updateValues();\n\n // Set correct focus and selection\n elmInputBox.focus();\n utils.setCaratPosition(elmInputBox[0], startEndIndex);\n }", "title": "" }, { "docid": "dadeb001d7067b489b44e3b1e1d7fa7f", "score": "0.4623211", "text": "function getNextHighFreqNoun(){\n\n var maxkey = \"\";\n for (const [key, value] of Object.entries(nounTable)) {\n if(maxkey === \"\" && !value.used) maxkey = key;\n if(!value.used && value.freq >= nounTable[maxkey].freq) maxkey = key;\n }\n if(maxkey === \"\"){\n console.log(\"no words in table yet... exiting\");\n return \"something..?\";\n }\n nounTable[maxkey].used = true;\n return maxkey;\n}", "title": "" }, { "docid": "f5ed99ebb4c25871ee5e4e0831787cd9", "score": "0.46214005", "text": "function saveMessage(owner_name, nagad_number, transection_id,transection_date,amount){\n var newMessageRef = messagesRef.push();\n newMessageRef.set({\n owner_name: owner_name,\n nagad_number:nagad_number,\n transection_id:transection_id,\n\ttransection_date:transection_date,\n\tamount:amount\n });\n}", "title": "" }, { "docid": "357840451f95e315125abbe43152f2a9", "score": "0.46197724", "text": "function newEntry() {\n //if the message from the user isn't empty then run\n if (document.getElementById(\"chatbox\").value != \"\")\n {\n //pulls the value from the chatbox ands sets it to lastUserMessage\n lastUserMessage = document.getElementById(\"chatbox\").value;\n //sets the chat box to be clear\n document.getElementById(\"chatbox\").value = \"\";\n //adds the value of the chatbox to the array messages\n messages.push(lastUserMessage);\n //Speech(lastUserMessage); //says what the user typed outloud\n //sets the variable botMessage in response to lastUserMessage\n chatbotResponse();\n\n }\n }", "title": "" }, { "docid": "ad2164a99a26b3e188419a10485a2daa", "score": "0.4611751", "text": "save(path, line, metricsName = null) {\n fs.appendFileSync(path, line+'\\n');\n if (metricsName) this.metrics[metricsName]++;\n }", "title": "" }, { "docid": "fe7325e91aff63090955c5b82628355e", "score": "0.46102154", "text": "function message_create_and_send (message, count) {\r\n \r\n // convert from message Buffer to JSON object\r\n obj = JSON.parse(message.toString())\r\n\r\n // copy object values for this topic to rtview data object\r\n var data = {};\r\n data.plant_name='MixingPlant';\r\n data.plant_id='A';\r\n data.metric_name=topicsOfInterest[count].slice(14);\r\n data.measurement=obj.measurement;\r\n data.unit=obj.unit;\r\n console.log('... sending: ' + JSON.stringify(data));\r\n rtview.send_datatable(cacheName, data);\r\n \r\n // Simulate data for Plant B\r\n data = {};\r\n data.plant_name='MixingPlant';\r\n data.plant_id='B';\r\n data.metric_name=topicsOfInterest[count].slice(14);\r\n data.measurement=obj.measurement + randomIntInc(-50,50);\r\n data.unit=obj.unit;\r\n console.log('... sending: ' + JSON.stringify(data));\r\n rtview.send_datatable(cacheName, data);\r\n \r\n // Simulate data for Plant C\r\n data = {};\r\n data.plant_name='MixingPlant';\r\n data.plant_id='C';\r\n data.metric_name=topicsOfInterest[count].slice(14);\r\n data.measurement=obj.measurement + randomIntInc(-50,50);\r\n data.unit=obj.unit;\r\n console.log('... sending: ' + JSON.stringify(data));\r\n rtview.send_datatable(cacheName, data); \r\n}", "title": "" }, { "docid": "c9b7e411496e3925cad489bc0545cf90", "score": "0.460457", "text": "function writeLoadingMessage(sitemapSheet, msg){\n sitemapSheet.getRange(1, 1, 1, 1).setValues([[msg]]);\n SpreadsheetApp.flush();\n}", "title": "" }, { "docid": "835db3fe0514ece5017f01ca93b9f0b5", "score": "0.46029684", "text": "function append_line() {\n\tvar c = PROOF.length+1;\n\tvar f = document.getElementById('frm').value.replace(/ /g,'');\n\tvar t = parse(f);\n\tvar r = document.getElementById('rul').value;\n\tvar s = [];\n\tvar l = document.getElementById('lin').value.replace(/ /g,'');\n\tif(r=='SI/TI') {\n\t\tr = document.getElementById('siti').value;\n\t\ts = getSeq(r);\n\t\tr = getSeqHead(r);\n\t}\n\tvar l = new Line(c,f,t,r,s,l);\n\n\tif(l.rul=='Assumption') {\n\t\tl.sig = document.getElementById('dth').value==\"Plus 1\" ? '+' : '-';\n\t}\n\ttry{validate_line(l);} catch(err) {return errmess([0],err);}\n\tPROOF.push(l);\n\tclear_app();\n\tdraw();\n\tcheckifdone();\n}", "title": "" }, { "docid": "b6ee1ec50a823e5d74e8dc0d06c3c372", "score": "0.4602399", "text": "function saveMessage(veg,qty1,nveg,qty2,ewaste,qty3){\n var newMessageRef = messagesRef.push();\n newMessageRef.set({\n veg:veg,\n qty1:qty1,\n nveg:nveg,\n qty2:qty2,\n ewaste:ewaste,\n qty3:qty3\n });\n}", "title": "" }, { "docid": "6388c82ccda568a8f4862580c1562760", "score": "0.46017724", "text": "submit(msg) {\n\n let chatFolder = gameDB.database.ref('chat');\n\n let newMessage = chatFolder.push();\n\n newMessage.set({\n\n user: userID,\n message: msg,\n time: firebase.database.ServerValue.TIMESTAMP\n\n })\n }", "title": "" }, { "docid": "74a8b356837960467647b343883e3815", "score": "0.45995736", "text": "addNewMex(){\r\n var newMessage = {\r\n date: '10/01/2020 15:30:55',\r\n message: this.newMex,\r\n status: 'sent'\r\n };\r\n this.contacts[this.chatActive].messages.push(newMessage);\r\n //azzero l'input\r\n this.newMex = '';\r\n\r\n // -------aggiungere vue.nexttick-------\r\n app.autoScroll();\r\n\r\n //imposto un settimeout per la risposta \"ok\"\r\n // senza arrow function non funziona\r\n setTimeout(() => {\r\n let reply = {\r\n date: '10/01/2020 15:31:00',\r\n message: 'okok',\r\n status: 'received'\r\n }\r\n this.contacts[this.chatActive].messages.push(reply);\r\n\r\n app.autoScroll();\r\n }, 1000)\r\n }", "title": "" } ]
26cd7354f0a443fc8aef0c13abb84b27
Examines the CloudFormation resource and discloses attributes.
[ { "docid": "025f14352269e87f30d3ca49d5b48184", "score": "0.0", "text": "inspect(inspector) {\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_TreeInspector(inspector);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, this.inspect);\n }\n throw error;\n }\n inspector.addAttribute(\"aws:cdk:cloudformation:type\", CfnApplication.CFN_RESOURCE_TYPE_NAME);\n inspector.addAttribute(\"aws:cdk:cloudformation:props\", this.cfnProperties);\n }", "title": "" } ]
[ { "docid": "d628e09f23d5cf170bc6a351cf50d308", "score": "0.5161213", "text": "function closeResources() {\n _.each(AACtrlResourcesService.getCtrlKeys(), function (key) {\n cleanResourceFieldIndex('saved', 0, key);\n delete resources[key];\n });\n }", "title": "" }, { "docid": "b59ed308d8a300187fdcf63c2fe29997", "score": "0.5075759", "text": "_ensureAttributes() {}", "title": "" }, { "docid": "805147d6a98772e4877c8e4869881647", "score": "0.49541694", "text": "attributeChangedCallback(name, oldValue, newValue) {\n if (!this.open) {\n this.close();\n }\n }", "title": "" }, { "docid": "9444954d2f141c79a00eeabedeadffe0", "score": "0.48260498", "text": "closeCap () {\n\t\tthis.Body.removeChild(this._elements._cap);\n\n\t\tthis._active = true;\n\t\tthis._elements._cap = undefined;\n\t}", "title": "" }, { "docid": "1ed2d89cc718362c46b56d2d57b13464", "score": "0.4824156", "text": "disable() {\n _.each(this._attributes, attr => {\n attr.disable();\n });\n }", "title": "" }, { "docid": "0c1c60c698dd3f2e1fadfbd6c93c7a79", "score": "0.48189756", "text": "function attrMouseover(event) \r\n{ \r\n var attr; \r\n \r\n // Find the target attr element. \r\n\r\n \r\n if (browser.isIE) \r\n { \r\n attr = getContainerWith(window.event.srcElement, \"DIV\", \"attr\" ); \r\n } \r\n else \r\n { \r\n attr = event.currentTarget; \r\n } \r\n \r\n // Close any active sub attr. \r\n\r\n \r\n if (attr.activeItem != null) \r\n { \r\n closeSubattr(attr); \r\n } \r\n}", "title": "" }, { "docid": "6ef72740bd4836d5024d25387e1103a5", "score": "0.4752414", "text": "async validateAttributes () {\n\t\tfor (let i = 0, length = Object.keys(this.attributes).length; i < length; i++) {\n\t\t\tconst attribute = Object.keys(this.attributes)[i];\n\t\t\tif (!await this.validateAttribute(attribute)) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "3561447e602e746dfe72a72f9a1eae1c", "score": "0.46624988", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnSecretPropsFromCloudFormation(resourceProperties);\n const ret = new CfnSecret(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "648f16b1ac015ef0c62185518777a791", "score": "0.46376514", "text": "_removeA11yAttributes() {\n this.trigger.removeAttribute('aria-expanded');\n this.trigger.removeAttribute('aria-controls');\n\n this.target.removeAttribute('aria-labelledby');\n this.target.removeAttribute('aria-hidden');\n }", "title": "" }, { "docid": "a64e1c50cdbca3ba929dc5e8661859fd", "score": "0.46251947", "text": "constructor(scope, id, props) {\n super(scope, id, { type: CfnInstance.CFN_RESOURCE_TYPE_NAME, properties: props });\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_lightsail_CfnInstanceProps(props);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, CfnInstance);\n }\n throw error;\n }\n cdk.requireProperty(props, 'blueprintId', this);\n cdk.requireProperty(props, 'bundleId', this);\n cdk.requireProperty(props, 'instanceName', this);\n this.attrHardwareCpuCount = cdk.Token.asNumber(this.getAtt('Hardware.CpuCount', cdk.ResolutionTypeHint.NUMBER));\n this.attrHardwareRamSizeInGb = cdk.Token.asNumber(this.getAtt('Hardware.RamSizeInGb', cdk.ResolutionTypeHint.NUMBER));\n this.attrInstanceArn = cdk.Token.asString(this.getAtt('InstanceArn', cdk.ResolutionTypeHint.STRING));\n this.attrIsStaticIp = this.getAtt('IsStaticIp', cdk.ResolutionTypeHint.STRING);\n this.attrLocationAvailabilityZone = cdk.Token.asString(this.getAtt('Location.AvailabilityZone', cdk.ResolutionTypeHint.STRING));\n this.attrLocationRegionName = cdk.Token.asString(this.getAtt('Location.RegionName', cdk.ResolutionTypeHint.STRING));\n this.attrNetworkingMonthlyTransferGbPerMonthAllocated = cdk.Token.asString(this.getAtt('Networking.MonthlyTransfer.GbPerMonthAllocated', cdk.ResolutionTypeHint.STRING));\n this.attrPrivateIpAddress = cdk.Token.asString(this.getAtt('PrivateIpAddress', cdk.ResolutionTypeHint.STRING));\n this.attrPublicIpAddress = cdk.Token.asString(this.getAtt('PublicIpAddress', cdk.ResolutionTypeHint.STRING));\n this.attrResourceType = cdk.Token.asString(this.getAtt('ResourceType', cdk.ResolutionTypeHint.STRING));\n this.attrSshKeyName = cdk.Token.asString(this.getAtt('SshKeyName', cdk.ResolutionTypeHint.STRING));\n this.attrStateCode = cdk.Token.asNumber(this.getAtt('State.Code', cdk.ResolutionTypeHint.NUMBER));\n this.attrStateName = cdk.Token.asString(this.getAtt('State.Name', cdk.ResolutionTypeHint.STRING));\n this.attrSupportCode = cdk.Token.asString(this.getAtt('SupportCode', cdk.ResolutionTypeHint.STRING));\n this.attrUserName = cdk.Token.asString(this.getAtt('UserName', cdk.ResolutionTypeHint.STRING));\n this.blueprintId = props.blueprintId;\n this.bundleId = props.bundleId;\n this.instanceName = props.instanceName;\n this.addOns = props.addOns;\n this.availabilityZone = props.availabilityZone;\n this.hardware = props.hardware;\n this.keyPairName = props.keyPairName;\n this.location = props.location;\n this.networking = props.networking;\n this.state = props.state;\n this.tags = new cdk.TagManager(cdk.TagType.STANDARD, \"AWS::Lightsail::Instance\", props.tags, { tagPropertyName: 'tags' });\n this.userData = props.userData;\n }", "title": "" }, { "docid": "841b8fcfdf0ed07ac58808d882c86471", "score": "0.46247074", "text": "function _cleanupAttributes(target) {\n\t for (var n in this.attributes) {\n\t target.removeAttribute(n);\n\t }\n\t }", "title": "" }, { "docid": "841b8fcfdf0ed07ac58808d882c86471", "score": "0.46247074", "text": "function _cleanupAttributes(target) {\n\t for (var n in this.attributes) {\n\t target.removeAttribute(n);\n\t }\n\t }", "title": "" }, { "docid": "d955ad0b22f4b030715c819df372d4a9", "score": "0.46102265", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnFlywheelPropsFromCloudFormation(resourceProperties);\n const ret = new CfnFlywheel(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "314861f2b61860bafa88db1fc1d9f7dd", "score": "0.46010965", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnApiPropsFromCloudFormation(resourceProperties);\n const ret = new CfnApi(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "6be6ad8392cf69c25c6b5377b7f0e3f3", "score": "0.45651934", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnCanaryPropsFromCloudFormation(resourceProperties);\n const ret = new CfnCanary(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "9fda2a4edd984e40ae115b39a6c8bcb0", "score": "0.45556536", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnInstancePropsFromCloudFormation(resourceProperties);\n const ret = new CfnInstance(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "4e96520cdb089fd74a3834e7abdc1c38", "score": "0.45463142", "text": "close() {\n\t\tthis.detailViewHolder.remove();\n\t\tthis.book = null;\n\t}", "title": "" }, { "docid": "673385fc15f8fe0968c8f6f85d668970", "score": "0.4545799", "text": "_refreshAttributes() {\n\t\tthis._updateAttributes( true );\n\t}", "title": "" }, { "docid": "673385fc15f8fe0968c8f6f85d668970", "score": "0.4545799", "text": "_refreshAttributes() {\n\t\tthis._updateAttributes( true );\n\t}", "title": "" }, { "docid": "5d5f752515ab8974a9d20d0d60fd8959", "score": "0.45452064", "text": "close() {\n log.sessionManager(\"[%s] Closing the SessionMaanger for entity '%s'.\", this._context.namespace.connectionId, this._context.entityPath);\n this._isCancelRequested = true;\n this._isManagingSessions = false;\n }", "title": "" }, { "docid": "638787f3f49ef58576a74e9ff7986e2c", "score": "0.45195282", "text": "function removeExculdedAttributes() {\n //that.platform.log('Having a cached accessory, build a duplicate and see if I can detect obsolete characteristics');\n var _device = device.deviceid;\n device.deviceid = 'filter'+_device.deviceid;\n var newAccessory = new HE_ST_Accessory(platform, group, device);\n\n for (var k in that.accessory.services) {\n for (var l in that.accessory.services[k].optionalCharacteristics) {\n var remove = true;\n for (var j in newAccessory.accessory.services) {\n for (var t in newAccessory.accessory.services[j].optionalCharacteristics) {\n if (that.accessory.services[k].optionalCharacteristics[l].UUID === newAccessory.accessory.services[j].optionalCharacteristics[t].UUID)\n remove = false;\n }\n }\n if (remove === true)\n that.accessory.services[k].removeCharacteristic(that.accessory.services[k].optionalCharacteristics[l]);\n }\n \n for (var l in that.accessory.services[k].characteristics) {\n var remove = true;\n for (var j in newAccessory.accessory.services) {\n for (var t in newAccessory.accessory.services[j].characteristics) {\n if (that.accessory.services[k].characteristics[l].UUID === newAccessory.accessory.services[j].characteristics[t].UUID)\n remove = false;\n }\n }\n if (remove === true)\n that.accessory.services[k].removeCharacteristic(that.accessory.services[k].optionalCharacteristics[l]);\n }\n var removeService = true;\n for (var l in newAccessory.accessory.services) {\n if (newAccessory.accessory.services[l].UUID === that.accessory.services[k].UUID)\n removeService = false;\n }\n if (removeService === true)\n that.accessory.removeService(that.accessory.services[k]);\n }\n device.deviceid = _device;\n return;\n }", "title": "" }, { "docid": "87ebb113ba11c7ad361228495c1a0d49", "score": "0.45082012", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnWebACLPropsFromCloudFormation(resourceProperties);\n const ret = new CfnWebACL(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "87ebb113ba11c7ad361228495c1a0d49", "score": "0.45082012", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnWebACLPropsFromCloudFormation(resourceProperties);\n const ret = new CfnWebACL(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "0c13cb9610d408220dcbf5e3fe229dfb", "score": "0.4503313", "text": "_ensureAttributes() {\n if (info.hostAttributes) {\n for (let a in info.hostAttributes) {\n this._ensureAttribute(a, info.hostAttributes[a]);\n }\n }\n super._ensureAttributes();\n }", "title": "" }, { "docid": "7ec3229bec4931cd0c00f9ba14264bdf", "score": "0.44986966", "text": "function closeBlockElement() {\n\t\t\tcloseInlineElements();\n\t\t\tswitch (xmlNode.nodeName.toLowerCase()) {\n\t\t\t\tcase 'p':\n\t\t\t\tcase 'h1':\n\t\t\t\tcase 'h2':\n\t\t\t\tcase 'h3':\n\t\t\t\tcase 'ul':\n\t\t\t\tcase 'ol':\n\t\t\t\t\tvar child = xmlNode;\n\t\t\t\t\txmlNode = xmlNode.parentNode;\n\t\t\t\t\tbreak;\n\t\t\t}\t\t\t\n\t\t}", "title": "" }, { "docid": "0cc888ea62ef544c3baac9e4b341e357", "score": "0.4490469", "text": "detachResources(resources) {\n return Nova.request({\n url: '/nova-api/' + this.resourceName + '/detach',\n method: 'delete',\n params: {\n ...this.queryString,\n ...{ resources: mapResources(resources) },\n },\n }).then(() => {\n this.deleteModalOpen = false\n this.getResources()\n })\n }", "title": "" }, { "docid": "c8accca7afae1158a655f59fb694e74e", "score": "0.4480618", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnSecurityConfigurationPropsFromCloudFormation(resourceProperties);\n const ret = new CfnSecurityConfiguration(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "5f6d5549dd05a34dd55595fff8a75948", "score": "0.44780686", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnStateMachinePropsFromCloudFormation(resourceProperties);\n const ret = new CfnStateMachine(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "73482fa5ffa37ab3400fdc4fe8ae20b8", "score": "0.44734952", "text": "deallocate () {\n this.lastReturnTime = Date.now()\n this.state = PooledResourceStateEnum.IDLE\n }", "title": "" }, { "docid": "89496767e8e45a23c001fcc716dbbc0b", "score": "0.44726035", "text": "exitLibraryAttributeParameter(ctx) {\n\t}", "title": "" }, { "docid": "ba035737ccbffc9b70cf70888344226d", "score": "0.44673532", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnDiskPropsFromCloudFormation(resourceProperties);\n const ret = new CfnDisk(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "5486b5e5ba7075b73de3408dd33dd165", "score": "0.44649923", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnThingPropsFromCloudFormation(resourceProperties);\n const ret = new CfnThing(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "a1bfb71f3a6671dd26eb1d17ec4e32bb", "score": "0.44613963", "text": "exitInspectBy(ctx) {\n\t}", "title": "" }, { "docid": "db30d7c34c5a9bf5e3633120ca3d7111", "score": "0.4456894", "text": "_setAttributes() {}", "title": "" }, { "docid": "09dc6e13b154fe1b349c5e835a572075", "score": "0.4451452", "text": "close() {\n // _close will also be called later from the requester;\n this.requester.closeRequest(this);\n }", "title": "" }, { "docid": "4bae70a8d556177b19c7351da76bf987", "score": "0.44446597", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnAlarmPropsFromCloudFormation(resourceProperties);\n const ret = new CfnAlarm(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "b3755e1251626df6f43acdbfc3f66547", "score": "0.4443438", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnConnectorPropsFromCloudFormation(resourceProperties);\n const ret = new CfnConnector(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "464bba921261c805ff8560c6435b95f3", "score": "0.4439655", "text": "_clearAttributes() {\n\t\tthis._attrs.clear();\n\t}", "title": "" }, { "docid": "464bba921261c805ff8560c6435b95f3", "score": "0.4439655", "text": "_clearAttributes() {\n\t\tthis._attrs.clear();\n\t}", "title": "" }, { "docid": "464bba921261c805ff8560c6435b95f3", "score": "0.4439655", "text": "_clearAttributes() {\n\t\tthis._attrs.clear();\n\t}", "title": "" }, { "docid": "c2307e1e64a85a42a89ffc4c68dfafda", "score": "0.44305754", "text": "exitInspectFor(ctx) {\n\t}", "title": "" }, { "docid": "fce4171bfdd5adba784a4b9ee49b5148", "score": "0.4428517", "text": "function removeAttributes(record, entry) { \n\n if (record && record[entry].entryInfo._shrId) {\n delete record[entry].entryInfo._shrId;\n }\n if (record && record[entry].entryInfo._entryId) {\n delete record[entry].entryInfo._entryId;\n } \n if (record && record[entry].entryInfo._creationTime) {\n delete record[entry].entryInfo._creationTime;\n }\n if (record && record[entry].entryInfo._lastUpdated && entry !== \"_deathInformation\") {\n delete record[entry].entryInfo._lastUpdated;\n } \n}", "title": "" }, { "docid": "f810cc26ecbff2cafe8434012221bf70", "score": "0.44215673", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnBucketPropsFromCloudFormation(resourceProperties);\n const ret = new CfnBucket(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "5d5468660f2cc2dc252e747c5493780c", "score": "0.44117132", "text": "destroy() {\n this.#writable = false;\n this.#body = undefined;\n this.#serverResponse = undefined;\n for (const rid of this.#resources) {\n Deno.close(rid);\n }\n }", "title": "" }, { "docid": "48122cef869a0666c0bd255e6b5cc36b", "score": "0.44056296", "text": "function closeBlock()\n{\n\tif (!inBlock) return;\n\tinBlock = false;\n\thideBlock();\n var proToCall = unblock_process;\n\tunblock_process = null;\n\tcallProcess(proToCall);\n\tif (describe_location_flag) descriptionLoop();\n}", "title": "" }, { "docid": "15c7bde7c3ec4e9faa571f069b2cd2b1", "score": "0.44006094", "text": "exitReadWith(ctx) {\n\t}", "title": "" }, { "docid": "237dd31b854bafa315202b351e7f8b0a", "score": "0.43985137", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnSecretTargetAttachmentPropsFromCloudFormation(resourceProperties);\n const ret = new CfnSecretTargetAttachment(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "82791a56c8f3a859166e05063f03cc6a", "score": "0.43980286", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnGroupPropsFromCloudFormation(resourceProperties);\n const ret = new CfnGroup(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "86e535ef1b6be94efb0611722c0d41dc", "score": "0.43952727", "text": "exitLibraryAttributeFunction(ctx) {\n\t}", "title": "" }, { "docid": "0f47e6d7996e4a05dabaee4c19b28805", "score": "0.43948215", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnPipePropsFromCloudFormation(resourceProperties);\n const ret = new CfnPipe(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "2f42550543613d1518c6f59c81ac69bd", "score": "0.4393147", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnContainerPropsFromCloudFormation(resourceProperties);\n const ret = new CfnContainer(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "17b7367e0b3ae5b1cd189360c2a0f6d7", "score": "0.43915245", "text": "complete() {\n if (this.boundKeyboard) {\n this.eventSource.unbindKeydownHandler(this.keydownHandler);\n }\n $('body').removeClass('showAttributeDialog');\n $('body').trigger('dialogDismiss');\n this.dgDom.trapper.close();\n }", "title": "" }, { "docid": "17b7367e0b3ae5b1cd189360c2a0f6d7", "score": "0.43915245", "text": "complete() {\n if (this.boundKeyboard) {\n this.eventSource.unbindKeydownHandler(this.keydownHandler);\n }\n $('body').removeClass('showAttributeDialog');\n $('body').trigger('dialogDismiss');\n this.dgDom.trapper.close();\n }", "title": "" }, { "docid": "572a5644f6448589f73e7706c4c1d030", "score": "0.43897808", "text": "function closeReview(){\n props.setTrigger(false)\n setService('')\n }", "title": "" }, { "docid": "795388460dc8f5254f19902771f10458", "score": "0.43874186", "text": "close() {\n if (!this._open) {\n return;\n }\n\n if (this._negotiator) {\n this._negotiator.cleanup();\n }\n\n this._open = false;\n\n const message = {\n roomName: this.name,\n };\n this.emit(SFURoom.MESSAGE_EVENTS.leave.key, message);\n this.emit(SFURoom.EVENTS.close.key);\n }", "title": "" }, { "docid": "68d5fa9b379f14811c25f551e4919e5b", "score": "0.43869907", "text": "close() {\n if (!this._open) {\n return;\n }\n\n if (this._negotiator) {\n this._negotiator.cleanup();\n }\n\n this._open = false;\n\n const message = {\n roomName: this.name\n };\n this.emit(SFURoom.MESSAGE_EVENTS.leave.key, message);\n this.emit(SFURoom.EVENTS.close.key);\n }", "title": "" }, { "docid": "2941286adbf6818689e58f8df10098d7", "score": "0.43835014", "text": "rollbackAttributes() {\n this.setObjects(get(this, '_originalState'));\n }", "title": "" }, { "docid": "530382a9b39c7eb8fa24f477c9e70411", "score": "0.43752292", "text": "onDismiss() {\n RAG.config.readDisclaimer = true;\n this.dom.hidden = true;\n RAG.views.main.hidden = false;\n this.btnDismiss.onclick = null;\n RAG.config.save();\n if (this.lastActive) {\n this.lastActive.focus();\n this.lastActive = undefined;\n }\n }", "title": "" }, { "docid": "1882067ae9e0ae8c91eed4f4929efdba", "score": "0.43716028", "text": "close() {\n this.isCollapsed = true;\n this.clean();\n }", "title": "" }, { "docid": "d5da6a97d8c7d87ca2f5e06ca72b6d0c", "score": "0.4368601", "text": "actionModifyInstanceAttributeGet(incomingOptions, cb) {\n const AmazonEc2 = require(\"./dist\");\n let defaultClient = AmazonEc2.ApiClient.instance;\n // Configure API key authorization: hmac\n let hmac = defaultClient.authentications[\"hmac\"];\n hmac.apiKey = incomingOptions.apiKey;\n // Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n //hmac.apiKeyPrefix = 'Token';\n\n let apiInstance = new AmazonEc2.DefaultApi(); // String | Region where you are making the reques // String | The ID of the instance.\n /*let region = \"region_example\";*/ /*let instanceId = \"instanceId_example\";*/ let opts = {\n // 'xAmzContentSha256': \"xAmzContentSha256_example\", // String |\n // 'xAmzDate': \"xAmzDate_example\", // String |\n // 'xAmzAlgorithm': \"xAmzAlgorithm_example\", // String |\n // 'xAmzCredential': \"xAmzCredential_example\", // String |\n // 'xAmzSecurityToken': \"xAmzSecurityToken_example\", // String |\n // 'xAmzSignature': \"xAmzSignature_example\", // String |\n // 'xAmzSignedHeaders': \"xAmzSignedHeaders_example\", // String |\n // 'sourceDestCheckValue': \"sourceDestCheckValue_example\", // String | Describes a value for a resource attribute that is a Boolean value. The attribute value. The valid values are <code>true</code> or <code>false</code>.\n // 'attribute': \"attribute_example\", // String | The name of the attribute.\n blockDeviceMapping: [\"null\"], // [String] | <p>Modifies the <code>DeleteOnTermination</code> attribute for volumes that are currently attached. The volume must be owned by the caller. If no value is specified for <code>DeleteOnTermination</code>, the default is <code>true</code> and the volume is deleted when the instance is terminated.</p> <p>To add instance store volumes to an Amazon EBS-backed instance, you must add them when you launch the instance. For more information, see <a href=\\\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html#Using_OverridingAMIBDM\\\">Updating the Block Device Mapping when Launching an Instance</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>\n // 'disableApiTerminationValue': \"disableApiTerminationValue_example\", // String | Describes a value for a resource attribute that is a Boolean value. The attribute value. The valid values are <code>true</code> or <code>false</code>.\n dryRun: false, // Boolean | Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.\n // 'ebsOptimizedValue': \"ebsOptimizedValue_example\", // String | Describes a value for a resource attribute that is a Boolean value. The attribute value. The valid values are <code>true</code> or <code>false</code>.\n // 'enaSupportValue': \"enaSupportValue_example\", // String | Describes a value for a resource attribute that is a Boolean value. The attribute value. The valid values are <code>true</code> or <code>false</code>.\n groupId: [\"null\"], // [String] | [EC2-VPC] Changes the security groups of the instance. You must specify at least one security group, even if it's just the default security group for the VPC. You must specify the security group ID, not the security group name.\n // 'instanceInitiatedShutdownBehaviorValue': \"instanceInitiatedShutdownBehaviorValue_example\", // String | Describes a value for a resource attribute that is a String. The attribute value. The value is case-sensitive.\n // 'instanceTypeValue': \"instanceTypeValue_example\", // String | Describes a value for a resource attribute that is a String. The attribute value. The value is case-sensitive.\n // 'kernelValue': \"kernelValue_example\", // String | Describes a value for a resource attribute that is a String. The attribute value. The value is case-sensitive.\n // 'ramdiskValue': \"ramdiskValue_example\", // String | Describes a value for a resource attribute that is a String. The attribute value. The value is case-sensitive.\n // 'sriovNetSupportValue': \"sriovNetSupportValue_example\", // String | Describes a value for a resource attribute that is a String. The attribute value. The value is case-sensitive.\n // 'userDataValue': \"userDataValue_example\", // String | Changes the instance's user data to the specified value. If you are using an AWS SDK or command line tool, base64-encoding is performed for you, and you can load the text from a file. Otherwise, you must provide base64-encoded text.\n // 'value': \"value_example\", // String | A new value for the attribute. Use only with the <code>kernel</code>, <code>ramdisk</code>, <code>userData</code>, <code>disableApiTermination</code>, or <code>instanceInitiatedShutdownBehavior</code> attribute.\n // 'action': \"action_example\", // String |\n version: \"'2016-11-15'\" // String |\n };\n\n if (!incomingOptions.opts) delete incomingOptions.opts;\n incomingOptions.opts = Object.assign(opts, incomingOptions.opts);\n\n apiInstance.actionModifyInstanceAttributeGet(\n incomingOptions.region,\n incomingOptions.instanceId,\n incomingOptions.opts,\n (error, data, response) => {\n if (error) {\n cb(error, null, response);\n } else {\n cb(null, \"\", response);\n }\n }\n );\n }", "title": "" }, { "docid": "183736461549d0c52cac712c8e28661b", "score": "0.43651313", "text": "function removeCurrentAttribute(attribute){\n\t\t var index =$scope.attributes.indexOf(attribute); \n\t\t $scope.attributes.splice(index,1);\n\t }", "title": "" }, { "docid": "af2683faff5de5f5c088ed2c5bb8e39c", "score": "0.43638486", "text": "getCurrentAttributes_ () {\n if (!this.currentAttributes_) {\n this.updateCurrentAttributes_()\n }\n return this.currentAttributes_\n }", "title": "" }, { "docid": "8a81a47904a8dd93fa52147eea039eb2", "score": "0.43594593", "text": "onCancel() {\n var feature = this.options['feature'];\n if (feature && this.originalProperties_) {\n feature.setProperties(this.originalProperties_);\n osStyle.setFeatureStyle(feature);\n\n var layer = osFeature.getLayer(feature);\n if (layer) {\n osStyle.notifyStyleChange(layer, [feature]);\n }\n }\n\n dispatcher.getInstance().dispatchEvent(EventType.RESTORE_FEATURE);\n }", "title": "" }, { "docid": "622003902d9cc79fde13f931dfb02e69", "score": "0.43584922", "text": "async close() {\n this.activated = false;\n }", "title": "" }, { "docid": "622003902d9cc79fde13f931dfb02e69", "score": "0.43584922", "text": "async close() {\n this.activated = false;\n }", "title": "" }, { "docid": "9a24c5564766cb295eb0e4f6ba941eaf", "score": "0.43498436", "text": "requestClosing(patientCreated) {\n\t\tconst { closeModalRequest } = this.props;\n\n\t\tthis.setState ({\n\t\t\tfirstName: \"\",\n\t\t\tlastName: \"\",\n\t\t\tdetails: \"\",\n\t\t\tisWIP: \"false\",\n\t\t\tpriority: \"Emergent\",\n\t\t\tprocessRequested: false,\n\t\t\tfirstNameHasError: false,\n\t\t\tlastNameHasError: false\n\n\t\t}, () => \n\t\t\tcloseModalRequest(patientCreated)\n\t\t);\n\t}", "title": "" }, { "docid": "dc9645b08296eabe6e1ad43d679a55ac", "score": "0.43483576", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnDBInstancePropsFromCloudFormation(resourceProperties);\n const ret = new CfnDBInstance(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "dc9645b08296eabe6e1ad43d679a55ac", "score": "0.43483576", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnDBInstancePropsFromCloudFormation(resourceProperties);\n const ret = new CfnDBInstance(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "3d4a8caa9660f4f79fd418ef43a6d2e2", "score": "0.43444157", "text": "close() {\n if (!this.knex) {\n return;\n }\n\n const onClosed = () => {\n this.knex = undefined;\n this.bookshelf = undefined;\n this.st = undefined;\n this.isOpen = false;\n };\n\n this.knex.destroy().then(onClosed, onClosed);\n }", "title": "" }, { "docid": "ef81903c53fb9fa4fd8f66b4113c0abb", "score": "0.43401948", "text": "function cancelChanges() {\n NewDrug.Close();\n}", "title": "" }, { "docid": "38ade84b0636a0f4c8403fe8b72cd1d8", "score": "0.43393654", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnStreamPropsFromCloudFormation(resourceProperties);\n const ret = new CfnStream(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "6afe09c4e8983b23ca51e12f9a9fbfc2", "score": "0.4339104", "text": "static get observedAttributes() {\n return ['open']\n }", "title": "" }, { "docid": "64269b8932abb41ee88d35f99521838c", "score": "0.433816", "text": "detachAllMatchingResources() {\n return Nova.request({\n url: '/nova-api/' + this.resourceName + '/detach',\n method: 'delete',\n params: {\n ...this.queryString,\n ...{ resources: 'all' },\n },\n }).then(() => {\n this.deleteModalOpen = false\n this.getResources()\n })\n }", "title": "" }, { "docid": "25ea5f16cd7265807e0fbdce8028a942", "score": "0.43373027", "text": "close() {\n this.setOpenAmount(0, true);\n }", "title": "" }, { "docid": "01658fbc364c45f82957150dbde9528c", "score": "0.43322086", "text": "invalidateAttribute() {\n }", "title": "" }, { "docid": "9b4def535b1a73f001fe053961d3cf9d", "score": "0.43283927", "text": "function closeBio() {\n for (let j = 0; j < closeBtn.length; j++) {\n $(closeBtn[j]).on(\"click\", function () {\n $(this).prevUntil(fullName).hide();\n $(this).hide();\n $(this).delay(1000).parent(bioDivs).height(350);\n });\n }\n }", "title": "" }, { "docid": "218e438e012e5caf966070ce4b108a41", "score": "0.43275705", "text": "dispose() {\n if (!this.options.groupedItem) {\n document.body.removeEventListener('click', this._onTriggerClick);\n }\n\n this._removeA11yAttributes();\n }", "title": "" }, { "docid": "bb41d47a8320f4a9c1413ac67cb422d5", "score": "0.43263963", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnHttpApiPropsFromCloudFormation(resourceProperties);\n const ret = new CfnHttpApi(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "556bf3490e4903e321b792a92cac00f0", "score": "0.43242064", "text": "removeChildAttributes(item) {\n let style = item.style || {};\n\n style.flex = item.flex || null;\n item.style = style;\n }", "title": "" }, { "docid": "983f2b31c6668b13e2355673292cd5e9", "score": "0.43227327", "text": "function close() {\n\n var sig = this;\n\n sig._children.forEach(function (child) {\n child._parents = child._parents.filter(function (parent) {\n return parent._id !== sig._id;\n });\n });\n\n sig._parents.forEach(function (parent) {\n parent._children = parent._children.filter(function (child) {\n return child._id !== sig._id;\n });\n });\n\n sig._children.length = 0;\n sig._parents.length = 0;\n }", "title": "" }, { "docid": "54483204e9cc389a06a754a5e1bdaea4", "score": "0.43210533", "text": "function cancel() {\n\t\tvar isNew = sources.userFood.isNewElement();\n\t\t\n\t\tif (isNew) {\n\t\t\tsources.userFood.removeCurrentReference();\n\t\t}\n\t\t$comp.hide();\n\t}", "title": "" }, { "docid": "fdcd85cfb6b605e56618833d3e1bc286", "score": "0.4319918", "text": "close() {\n if(!this.opened){\n return;\n }\n this.opened = false;\n }", "title": "" }, { "docid": "6c0f3d4ec5279b56992f073517199031", "score": "0.43184605", "text": "disclaim() {\n if (RAG.config.readDisclaimer)\n return;\n this.lastActive = document.activeElement;\n RAG.views.main.hidden = true;\n this.dom.hidden = false;\n this.btnDismiss.onclick = this.onDismiss.bind(this);\n this.btnDismiss.focus();\n }", "title": "" }, { "docid": "850b86a1f6ed2eb3cc7e03f98a99802c", "score": "0.43096393", "text": "async close() {\n this.setOpenAmount(0, true);\n }", "title": "" }, { "docid": "0feeb8d386cea142a706910e1c264bc7", "score": "0.43073097", "text": "close() {\n this.options.reviewRequestEditor.decr('editCount');\n this._$dlg.modalBox('destroy');\n this.trigger('closed');\n\n this.remove();\n }", "title": "" }, { "docid": "bc2503714d78669ca93e3660db13b851", "score": "0.43069217", "text": "close() {\n if (this.locationsRef) {\n this.locationsRef.off();\n }\n }", "title": "" }, { "docid": "5aeffec1a627260e7f37080249106df2", "score": "0.43064138", "text": "close() {\n const fd = this._fileDescriptor;\n if (fd) {\n this._fileDescriptor = undefined;\n fsx.closeSync(fd);\n }\n }", "title": "" }, { "docid": "38a5ead63a69ab777d4a2bee5bbfca86", "score": "0.4305227", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnCACertificatePropsFromCloudFormation(resourceProperties);\n const ret = new CfnCACertificate(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "3b8ac86cbde881011538404de9db764f", "score": "0.42936808", "text": "affectsResource() { return true; }", "title": "" }, { "docid": "8a9dd209ad04349b5ba8e150b6690701", "score": "0.4286565", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnCertificatePropsFromCloudFormation(resourceProperties);\n const ret = new CfnCertificate(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "8a9dd209ad04349b5ba8e150b6690701", "score": "0.4286565", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnCertificatePropsFromCloudFormation(resourceProperties);\n const ret = new CfnCertificate(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "8a9dd209ad04349b5ba8e150b6690701", "score": "0.4286565", "text": "static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnCertificatePropsFromCloudFormation(resourceProperties);\n const ret = new CfnCertificate(scope, id, propsResult.value);\n for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {\n ret.addPropertyOverride(propKey, propVal);\n }\n options.parser.handleAttributes(ret, resourceAttributes, id);\n return ret;\n }", "title": "" }, { "docid": "7db74c10bd96a7c133d1036567c99a77", "score": "0.42805654", "text": "_removeResources() {\n return S.actions.resourcesRemove({\n options: {\n stage: this.evt.options.stage,\n region: this.evt.options.region,\n noExeCf: !!this.evt.options.noExeCf\n }\n });\n }", "title": "" }, { "docid": "93410dd177a9ae3ed5c88ce1c2409088", "score": "0.42773053", "text": "constructor(parent, name, properties) {\n super(parent, name, { type: SecurityGroupResource.resourceTypeName, properties });\n cdk.requireProperty(properties, 'groupDescription', this);\n this.securityGroupId = this.getAtt('GroupId').toString();\n this.securityGroupVpcId = this.getAtt('VpcId').toString();\n this.securityGroupName = this.ref.toString();\n this.addWarning('DEPRECATION: \"cloudformation.SecurityGroupResource\" will be deprecated in a future release in favor of \"CfnSecurityGroup\" (see https://github.com/awslabs/aws-cdk/issues/878)');\n }", "title": "" }, { "docid": "1725c45adb3db5d6f7e6e91910f6e66e", "score": "0.42630288", "text": "resetCassette() {\n this.setCassetteState(CassetteState.CLOSE);\n }", "title": "" }, { "docid": "fa69c915bd8d08c8c3382dd6488454a1", "score": "0.42607898", "text": "exitDetailRevoke(ctx) {\n\t}", "title": "" }, { "docid": "21fd1333ab9f96407b7dcbdcaf786d28", "score": "0.42467126", "text": "sanitizeAttributes (object) {\n\t\tObject.keys(this.attributeDefinitions).forEach(attribute => {\n\t\t\tif (this.attributeDefinitions[attribute].serverOnly) {\n\t\t\t\tdelete object[attribute];\n\t\t\t}\n\t\t});\n\t\treturn object;\n\t}", "title": "" }, { "docid": "fe6eac533991d2ddc92b91dd31724f3f", "score": "0.42387694", "text": "function updateAttributes() {\n var newAttributes = {};\n var isFormValid = true;\n\n lodash.forEach(ctrl.attributes, function (attribute) {\n if (!attribute.ui.isFormValid) {\n isFormValid = false;\n }\n\n newAttributes[attribute.name] = attribute.value;\n });\n\n $rootScope.$broadcast('change-state-deploy-button', {\n component: 'runtime-attribute',\n isDisabled: !isFormValid\n });\n\n lodash.set(ctrl.version, 'spec.runtimeAttributes.responseHeaders', newAttributes);\n\n ctrl.onChangeCallback();\n }", "title": "" }, { "docid": "fe6eac533991d2ddc92b91dd31724f3f", "score": "0.42387694", "text": "function updateAttributes() {\n var newAttributes = {};\n var isFormValid = true;\n\n lodash.forEach(ctrl.attributes, function (attribute) {\n if (!attribute.ui.isFormValid) {\n isFormValid = false;\n }\n\n newAttributes[attribute.name] = attribute.value;\n });\n\n $rootScope.$broadcast('change-state-deploy-button', {\n component: 'runtime-attribute',\n isDisabled: !isFormValid\n });\n\n lodash.set(ctrl.version, 'spec.runtimeAttributes.responseHeaders', newAttributes);\n\n ctrl.onChangeCallback();\n }", "title": "" }, { "docid": "05305a3f12922c94fe716425fba58da0", "score": "0.42357823", "text": "constructor(parent, name, properties) {\n super(parent, name, { type: VolumeResource.resourceTypeName, properties });\n cdk.requireProperty(properties, 'availabilityZone', this);\n this.volumeId = this.ref.toString();\n this.addWarning('DEPRECATION: \"cloudformation.VolumeResource\" will be deprecated in a future release in favor of \"CfnVolume\" (see https://github.com/awslabs/aws-cdk/issues/878)');\n }", "title": "" }, { "docid": "e5ca46c13717368480d0c0ed68fb8521", "score": "0.4220079", "text": "close () {\n this._registry.closeKey(this);\n }", "title": "" } ]
6679dcb889009de5ba2259462e8fecb5
\briefobserve a specific resource.
[ { "docid": "431c95215e10f65c0be522b04a3e3747", "score": "0.0", "text": "function observe(endpoint, Oid, i, Rid, handle, callback)\n{\n\tlwm2mServer.getDevice(endpoint, function (num, device) {\n\t\tif (device === undefined) {\n\t\t\treturn;\n\t\t}\n\t\tlwm2mServer.observe(device.id, Oid, i, Rid, handle, callback);\n\t});\n}", "title": "" } ]
[ { "docid": "ac8c099a32786eecb291928f4a4b5fdd", "score": "0.5814095", "text": "function isResource(req, res, next) {\n let uri = req._parsedOriginalUrl.path;\n if (uri.includes('/api')){\n uri = uri.substring(4);\n }\n if (uri.includes('?')){\n uri = uri.substring(0, uri.indexOf(\"?\"));\n }\n uri = uri.substring(1);\n uri = uri.substring(0, uri.indexOf('/'));\n // let table = uri.substring(0, uri.length - 1);\n let table = uri;\n let id = Number(req.params.id);\n client.query(`SELECT id FROM ${table} WHERE id = '${id}'`, function(error, results) {\n // error will be an Error if one occurred during the query\n // results will contain the results of the query\n // fields will contain information about the returned results fields (if any)\n if (error) {\n throw error;\n }\n if (results.rowCount === 0){\n res.render('404');\n }\n else {\n next();\n }\n });\n}", "title": "" }, { "docid": "ac8c099a32786eecb291928f4a4b5fdd", "score": "0.5814095", "text": "function isResource(req, res, next) {\n let uri = req._parsedOriginalUrl.path;\n if (uri.includes('/api')){\n uri = uri.substring(4);\n }\n if (uri.includes('?')){\n uri = uri.substring(0, uri.indexOf(\"?\"));\n }\n uri = uri.substring(1);\n uri = uri.substring(0, uri.indexOf('/'));\n // let table = uri.substring(0, uri.length - 1);\n let table = uri;\n let id = Number(req.params.id);\n client.query(`SELECT id FROM ${table} WHERE id = '${id}'`, function(error, results) {\n // error will be an Error if one occurred during the query\n // results will contain the results of the query\n // fields will contain information about the returned results fields (if any)\n if (error) {\n throw error;\n }\n if (results.rowCount === 0){\n res.render('404');\n }\n else {\n next();\n }\n });\n}", "title": "" }, { "docid": "9a172043f1bbaea66d490cddfd489a52", "score": "0.57729703", "text": "setResource(value) {\n super.put(\"resource\", value);\n }", "title": "" }, { "docid": "586b7ac31faa1601c8fd3a2e672f8894", "score": "0.570807", "text": "function resource(thing) {\n var res = is.str(thing) ? resources[thing] : thing;\n is.js(res) && js(res);\n is.data(res) && data(res.name);\n is.css(res) && css(res.name);\n is.html(res) && html(res.name);\n }", "title": "" }, { "docid": "1affd114c33b0da3742ddfd90680f175", "score": "0.55517817", "text": "function Resource(model, resource_name, options) {\n this.model = model;\n this.options = {\n limit: 20,\n refs: null\n };\n this.many_path = \"/\" + resource_name;\n this.single_path = \"/\" + resource_name + \"/:_id\";\n _.merge(this.options, options);\n this.options.path = this.many_path;\n this.emitter = new EventEmitter();\n }", "title": "" }, { "docid": "a821e4b1e395aacc0f03b656a3acc02c", "score": "0.55407804", "text": "get resource () {\n\t\treturn this._resource;\n\t}", "title": "" }, { "docid": "a821e4b1e395aacc0f03b656a3acc02c", "score": "0.55407804", "text": "get resource () {\n\t\treturn this._resource;\n\t}", "title": "" }, { "docid": "9c0afdbd2e6838f82130538378729a7c", "score": "0.5517486", "text": "function productResource($resource) {\n return $resource(\"/api/products/:productId\")\n //The function then simply returns the $resource object giving it the URL for the products,\n //this sets up the communication with the web Server.\n }", "title": "" }, { "docid": "72f79fdd7e6375b289b5e48d6c076b2a", "score": "0.5509309", "text": "function produtoResource($resource) {\n\t\treturn $resource(\"/api/produtos/:id\"); //Retorna um objeto resource para ser utilizado na obtenção de dados do backend webservice\n\t}", "title": "" }, { "docid": "a8ce5c22de5c4560416963e40f249018", "score": "0.550111", "text": "function inner_onResource(filename, resource)\r\n\t\t{\r\n\t\t\tresource.filename = filename;\r\n\t\t\tif(options.filename) //used to overwrite\r\n\t\t\t\tresource.filename = options.filename;\r\n\r\n\t\t\tif(!resource.fullpath)\r\n\t\t\t\tresource.fullpath = url;\r\n\r\n\t\t\tif(LS.ResourcesManager.resources_being_processes[filename])\r\n\t\t\t\tdelete LS.ResourcesManager.resources_being_processes[filename];\r\n\r\n\t\t\t//keep original file inside the resource\r\n\t\t\tif(LS.ResourcesManager.keep_files && (data.constructor == ArrayBuffer || data.constructor == String) )\r\n\t\t\t\tresource._original_data = data;\r\n\r\n\t\t\t//load associated resources\r\n\t\t\tif(resource.getResources)\r\n\t\t\t\tResourcesManager.loadResources( resource.getResources({}) );\r\n\r\n\t\t\t//register in the containers\r\n\t\t\tLS.ResourcesManager.registerResource(url, resource);\r\n\r\n\t\t\t//callback \r\n\t\t\tif(on_complete)\r\n\t\t\t\ton_complete(url, resource, options);\r\n\t\t}", "title": "" }, { "docid": "bfe035d4a38caa2d40c4dcad859f4149", "score": "0.5493662", "text": "function getResource(u, cb) {\n\n }", "title": "" }, { "docid": "bfe035d4a38caa2d40c4dcad859f4149", "score": "0.5493662", "text": "function getResource(u, cb) {\n\n }", "title": "" }, { "docid": "2a3fd26b7268ca735e5561e56973f2f9", "score": "0.5415401", "text": "function Resource()\r\n{\r\n\tthis.filename = null; //name of file without folder or path\r\n\tthis.fullpath = null; //contains the unique name as is to be used to fetch it by the resources manager\r\n\tthis.remotepath = null; //the string to fetch this resource in internet (local resources do not have this name)\r\n\tthis._data = null;\r\n\t//this.type = 0;\r\n}", "title": "" }, { "docid": "43b5022ff6597a4f760349650ba53504", "score": "0.5395177", "text": "static get __resourceType() {\n\t\treturn 'Resource';\n\t}", "title": "" }, { "docid": "0c175e6ce35811b2dae4e4aeb114fea2", "score": "0.5379714", "text": "addResource(value) {\n const props = this.props.model.props;\n this.getWebSocketResourceInfo().forEach((resource) => {\n if (resource.resourceName === value) {\n let serviceDef = props.model;\n let thisNodeIndex;\n if (TreeUtil.isResource(props.model)) {\n const resourceDef = props.model;\n serviceDef = resourceDef.parent;\n thisNodeIndex = serviceDef.getIndexOfResources(resourceDef) + 1;\n }\n serviceDef.addResources(DefaultNodeFactory.createWSResource(resource.fragment), thisNodeIndex);\n }\n });\n props.model.viewState.showOverlayContainer = false;\n props.model.viewState.overlayContainer = {};\n this.context.editor.update();\n }", "title": "" }, { "docid": "876285da933b9632e07f2466992ab448", "score": "0.5360571", "text": "function responder(req, res) {\n if (req.url === '/hello-world.txt') {\n res.write('Hello World!');\n } else {\n res.statusCode = 404;\n res.write('not found');\n }\n res.end();\n}", "title": "" }, { "docid": "d84b439f16dd9627f5159f6f2c7f37bc", "score": "0.53459215", "text": "function isResource(request) {\n return request.url.match(/\\/imgs\\/.*$/) && request.method === 'GET';\n}", "title": "" }, { "docid": "8ac2ed7bf6f187cb6d8103b1161d015e", "score": "0.5304835", "text": "function onResourceRequested(requestData, request){\n resources[requestData.id] = requestData.stage;\n var domain = get_domain(requestData['url']);\n if ((/http:\\/\\/.+?\\.(css|ssi)$/gi).test(requestData['url'])) {\n // abort all css request\n request.abort();\n return;\n }else if((/^http.*\\.js.*/).test(requestData['url'])){\n //This a js request would not be aborted\n return;\n } else if (root_domain != null && domain.indexOf(root_domain) == -1 && !_valid_request(domain, root_domain)){\n // abort request for other sites\n request.abort();\n return;\n }\n}", "title": "" }, { "docid": "35615f260f0a0e929b1504aebe30af70", "score": "0.5260139", "text": "function Resource(resource, resourceName) {\n\tthis.mRes = resource; // our resource data\n\tthis.mResName = resourceName; // the id of our resource (string)\n}", "title": "" }, { "docid": "18345de8f960b4cdeadd94501aa6a324", "score": "0.524871", "text": "function onResourceReceived(response){\n resources[response.id] = response.stage;\n}", "title": "" }, { "docid": "ddecf8945ddff25e5e4b4131df529536", "score": "0.51914793", "text": "function apiHandler(req, reply) {\n\n var rb = new RepresentationBuilder(settings.relsUrl);\n var resource = rb.create({}, req.url);\n\n // grab the routing table and iterate\n var routes = req.server.table();\n for (var i = 0; i < routes.length; i++) {\n var route = routes[i];\n\n // :\\\n var halConfig = route.settings.app && route.settings.app.hal;\n\n if (halConfig && halConfig.apiRel) {\n var rel = halConfig.apiRel;\n var href = routes[i].path;\n\n // grab query options\n if (halConfig.query) {\n href += halConfig.query;\n }\n\n // check if link is templated\n var link = new hal.Link(rb.resolve(rel), href);\n if (/{.*}/.test(href)) {\n link.templated = true;\n }\n\n // todo process validations for query parameters\n resource.link(link);\n }\n }\n\n // handle any curies\n rb.addCuries(resource);\n reply(resource).type('application/hal+json');\n }", "title": "" }, { "docid": "c238bc5174b0f6ce100ccf756e4eb93e", "score": "0.5177812", "text": "fetchSingleResource(context, id) {\n\t\t\tfetch(`${process.env.VUE_APP_API_URL}/v1/tool/${id}`, { method: `GET` }) //=> Fetch API\n\t\t\t\t.then(response => !response.ok ? console.log(response) : response.json(response)) //=> Check response\n\t\t\t\t.then(async (apiResponse) => await context.commit(`SINGLERESOURCE`, { data: apiResponse.data })) //=> Commit changes\n\t\t\t\t.catch(apiError => console.log(apiError)) //=> Catch error\n\t\t}", "title": "" }, { "docid": "a3e54569001ad5c0beabccf5bdeb76b6", "score": "0.5158664", "text": "function resource(_id, _type, _paths) { // Queues a resource for download. Called it resource so it can be declared in the same way of a scene\n\tvar resi = {\n\t\tpaths: _paths, // Multiple paths, will try until one works\n\t\tpathToTry: 0, // Increments each time until a path works\n\t\ttype: _type, // image, audio, video\n\t\tdownloaded: false,\n\t\tfailed: false,\n\t\tdata: (_type == \"image\") ? new Image() :\n\t\t\t (_type == \"audio\") ? new Audio() :\n\t\t\t (console.log(_type + \" is not supported by the resource downloader.\")) ? false : false // To do: add video support\n\t};\n\tres[_id] = resi;\n\tresVars.totalResources++;\n\tresVars.resourcesLeftToDownload++;\n}", "title": "" }, { "docid": "6b74195fc3d438ed6eb071994ddf5844", "score": "0.51497805", "text": "function sendResource(resource) {\n\t\tresource.initiator = \"xhr\";\n\t\tBOOMR.responseEnd(resource);\n\t}", "title": "" }, { "docid": "f21b642acc8ae5869d197eb132f9f691", "score": "0.5135099", "text": "function serveHTML(resource, sekiResponse, queryResponse) {\n\n\t// set up HTML builder\n\tvar viewTemplater = templater(htmlTemplates.viewTemplate);\n\t// verbosity(\"GOT RESPONSE \");\n\n\tvar saxer = require('./srx2map');\n\tvar stream = saxer.createStream();\n\n\tsekiResponse.pipe(stream);\n\n\tqueryResponse.on('data', function(chunk) {\n\t\tstream.write(chunk);\n\t});\n\n\tqueryResponse.on('end', function() {\n\n\t\tstream.end();\n\n\t\tvar bindings = stream.bindings;\n\t\tif (bindings.title) { // // this is ugly\n\t\t\tverbosity(\"GOT: \" + JSON.stringify(bindings));\n\t\t\t// verbosity(\"TITLE: \" + bindings.title);\n\t\t\tverbosity(\"WRITING HEADERS \" + JSON.stringify(sekiHeaders));\n\t\t\tsekiResponse.writeHead(200, sekiHeaders);\n\t\t\tvar html = viewTemplater.fillTemplate(bindings);\n\t\t} else {\n\t\t\tverbosity(\"404\");\n\t\t\tsekiResponse.writeHead(404, sekiHeaders);\n\t\t\t// /////////////////////////////// refactor\n\t\t\tvar creativeTemplater = templater(htmlTemplates.creativeTemplate);\n\t\t\tvar creativeMap = {\n\t\t\t\t\"uri\" : resource\n\t\t\t};\n\t\t\tvar html = creativeTemplater.fillTemplate(creativeMap);\n\t\t\t// ///////////////////////////////////////////\n\t\t\t// serveFile(sekiResponse, 404, files[\"404\"]);\n\t\t\t// return;\n\t\t}\n\t\t// sekiResponse.writeHead(200, {'Content-Type': 'text/plain'});\n\t\t// verbosity(\"HERE \"+html);\n\t\t// sekiResponse.write(html, 'binary');\n\t\tsekiResponse.end(html);\n\t});\n}", "title": "" }, { "docid": "34ef15764f20cac0cf772008f2ae227b", "score": "0.5118283", "text": "function Resource(c){\n // Use this instead of creating an emitter\n var self = this\n process.nextTick(function(){\n var counter = 0;\n self.emit(\"start\");\n var t = setInterval(function(){\n self.emit(\"data\", ++counter);\n if (counter === c){\n self.emit(\"end\", counter);\n clearInterval(t);\n }\n },10);\n });\n return (self);\n}", "title": "" }, { "docid": "e2c5af09e1692ffb605ca9019737aa8c", "score": "0.51091844", "text": "function Resource(url,params,actions,options$$1){var self=this||{},resource={};actions=assign({},Resource.actions,actions);each(actions,function(action,name){action=merge({url:url,params:assign({},params)},options$$1,action);resource[name]=function(){return(self.$http||Http)(opts(action,arguments));};});return resource;}", "title": "" }, { "docid": "e2c5af09e1692ffb605ca9019737aa8c", "score": "0.51091844", "text": "function Resource(url,params,actions,options$$1){var self=this||{},resource={};actions=assign({},Resource.actions,actions);each(actions,function(action,name){action=merge({url:url,params:assign({},params)},options$$1,action);resource[name]=function(){return(self.$http||Http)(opts(action,arguments));};});return resource;}", "title": "" }, { "docid": "3a337c179dd01d169786f21761bc08ce", "score": "0.50967807", "text": "function sendResource(resource) {\n\t\tresource.initiator = \"xhr\";\n\n\t\tBOOMR.responseEnd(resource);\n\t}", "title": "" }, { "docid": "b848537152cb5dfd557f0dd795d3cfeb", "score": "0.5088532", "text": "function serveHTML(resource, viewTemplate, sekiResponse, queryResponse) {\n log.debug(\"in serveHTML, viewTemplate = \" + viewTemplate);\n if (!viewTemplate) {\n viewTemplate = htmlTemplates.contentTemplate; // \n }\n\n var saxer = require('./srx2map');\n var stream = saxer.createStream();\n\n sekiResponse.pipe(stream);\n\n queryResponse.on('data', function(chunk) {\n log.debug(\"CHUNK: \" + chunk);\n stream.write(chunk);\n });\n\n queryResponse.on('end', function() {\n\n stream.end();\n\n var bindings = stream.bindings;\n\n // verbosity(\"bindings \" + JSON.stringify(bindings));\n\n if (!bindings || !bindings.title) { // // this is shite\n var creativeMap = {\n \"uri\": resource,\n \"title\": \"Enter title\",\n \"content\": \"Enter content\",\n \"login\": \"nickname\"\n }\n // \"uri\" : sekiRequest.url\n };\n\n sekiResponse.writeHead(200, sekiHeaders);\n\n bindings[\"uri\"] = resource;\n\n var html = freemarker.render(viewTemplate, bindings);\n\n log.info(\"404\");\n\n // log.debug(\"viewTemplate = \"+viewTemplate);\n // log.debug(\"bindings = \"+JSON.stringify(bindings));\n sekiResponse.end(html);\n });\n}", "title": "" }, { "docid": "c6f944fb706b883d7967d4781bfb9e47", "score": "0.508249", "text": "function onFetch(event) {\n var abstractResource = event.request.url;\n var actualResource = findActualResource(abstractResource);\n event.respondWith(fetch(actualResource || abstractResource));\n}", "title": "" }, { "docid": "4a57c232cbdd0fe4b8601f7ca584c4b4", "score": "0.5077962", "text": "async function getResourceById(req, res) {\n let id = req.params.id;\n await Resource.findOne({ where: { id } })\n .then(resource => {\n if (resource === null) {\n return res.status(200).json({\n ok: false,\n message: 'No existe un recurso con ese id asociado',\n });\n } else {\n res.status(200).json({\n ok: true,\n message: 'correcto',\n resource\n });\n }\n })\n .catch(err => {\n res.status(500).json({\n ok: false,\n message: 'Ha ocurrido un error',\n error: err.message\n });\n });\n}", "title": "" }, { "docid": "abc6de34b2a7bf0b5a63d89063fed5a5", "score": "0.50723624", "text": "function updateResource(resource) {\n ajaxRequest(\n HTTP_METHODS.PUT,\n resource.restUpdatePath(),\n function () {\n resource.updateView();\n },\n resource.updateJson());\n}", "title": "" }, { "docid": "044ab813b5dfbd54c4a289eccebdfbbc", "score": "0.50650656", "text": "function Resource(name) {\n\tif (!name) name = \"resource\";\n\tvar o = mustShut();//we have to remember to shut it\n\to.pulse = function() { log(\"pulse \" + name); }//the program will pulse it for us\n\to.text = name;\n\treturn o;\n}", "title": "" }, { "docid": "fb73866fa68f1244b0fe311f4af6f209", "score": "0.50524205", "text": "handleResourceURIChanged(resourceURI) {\n var self = this;\n let options = {\n uri: resourceURI,\n headers: {\n 'Accept': 'application/x-oslc-compact+xml;q=0.5,application/rdf+xml;q=0.4',\n 'OSLC-Core-Version': '2.0'\n }\n };\n\n this.server.read(options, function(err, resource) {\n if (err) {\n console.log(`Could not read resource ${resourceURI}, status: ${err}`);\n } else {\n self.setState({resource: resource});\n }\n });\n }", "title": "" }, { "docid": "8176552fe488c3a1d5e18ac9b664ea3e", "score": "0.5047795", "text": "procureResource(type){\n this.resources[type] += 1\n }", "title": "" }, { "docid": "a91c85df76ce8bd7c6e6ded9fc240e22", "score": "0.5034585", "text": "serve() {\n\t // a no-op, these are absolute URLs\n\t return function (req, res, next) {\n\t next();\n\t };\n\t}", "title": "" }, { "docid": "becd38c3c7a57f5c19c343b3e72cfa0a", "score": "0.502202", "text": "async function processResource(resource) {\n let tags = await db.query('SELECT * FROM tags')\n resource.type = ['singular', 'instanced'][resource.type]\n if (resource.type === 'instanced') {\n resource.instances = await db.query('SELECT * FROM resource_instances WHERE resource = ?', [resource.id])\n for (let inst of resource.instances) {\n inst.attachments = await db.query('SELECT * FROM resource_attachments WHERE res_id = ?', [inst.id])\n for (let att of inst.attachments) att.iscover = Boolean(att.iscover)\n }\n }\n resource.attachments = await db.query('SELECT * FROM resource_attachments WHERE res_id = ?', [resource.id])\n let rtags = await db.query('SELECT * FROM resource_tags WHERE res_id = ?', [resource.id])\n resource.tags = rtags.map(t => tags.find(tg => tg.id === (t.tag_id || 'NONE')) || { \"name\": t.tag_id, \"reference\": t.tag_id, \"description\": \"\" })\n return resource\n }", "title": "" }, { "docid": "686de3351d62eaa5525c2d9ee28a0bee", "score": "0.50204366", "text": "function addResc(resource){\n return db.insert(resource, '*').into('resources');\n}", "title": "" }, { "docid": "2c4ebd27449e3a72c858f5fd66877ddc", "score": "0.49929807", "text": "function resFilter(resourceKey) {\n return resource.get(resourceKey);\n }", "title": "" }, { "docid": "18080cacab02265468b877c1c33e9c41", "score": "0.4961588", "text": "setResource(internal_name, resource) {\n if (IsString(internal_name, true) && IsObject(resource)) {\n PopLog.info(this.name, `Entity Resource set for ${internal_name}`, resource);\n this.asset.resource.set(internal_name, resource);\n }\n }", "title": "" }, { "docid": "07807ed35199da7b6dd5d9988e48bbbd", "score": "0.49550712", "text": "function show(req, res) {}", "title": "" }, { "docid": "eb732dcee0badb274f57bf5a275750aa", "score": "0.49382854", "text": "function serve(req, res) {\n const urlFromServer = url.parse(req.url, true);\n var ergebnis = undefined;\n var contentType = \"application/json\";\n var statusCode = 200;\n let params = urlFromServer.pathname.split(\"/\");\n let queryParams = urlFromServer.query;\n let tag = queryParams[\"tag\"];\n let suchwort = queryParams[\"suchwort\"];\n if (tag) {\n ergebnis = JSON.stringify(artikels.filter((m) => !m.tags.includes(tag)));\n } else if (suchwort) {\n ergebnis = JSON.stringify(getBySuchwort(suchwort));\n } else {\n if (params[1] === \"artikels\" && !Number.isNaN(Number(params[2]))) {\n let artikel = artikels.find((m) => m.id === params[2]);\n\n if (artikel) {\n ergebnis = JSON.stringify(artikel);\n } else {\n ergebnis = `Artikel mit der id ${params[2]} wurde nicht gefunden.`;\n statusCode = 404;\n contentType = \"text/plain\";\n }\n } else if (params[1] === \"artikels\" || urlFromServer.pathname === \"/\") {\n ergebnis = JSON.stringify(artikels);\n } else {\n ergebnis = \"Die Seite wurde nicht gefunden...\";\n statusCode = 404;\n contentType = \"text/plain\";\n }\n }\n\n res.writeHead(statusCode, {\n \"content-type\": contentType,\n \"Access-Control-Allow-Origin\": \"*\",\n });\n\n res.write(ergebnis);\n}", "title": "" }, { "docid": "ccacbd1bac6566ba5fb58c40b8d6552f", "score": "0.4938069", "text": "function getResource(resourceType, itemName) {\n var res,\n store,\n view = this;\n\n if (\"\" + itemName === itemName) {\n while (res === undefined && view) {\n store = view.tmpl && view.tmpl[resourceType];\n res = store && store[itemName];\n view = view.parent;\n }\n\n return res || $views[resourceType][itemName];\n }\n }", "title": "" }, { "docid": "2a72b33f6f893c0f8a73412b30c234e1", "score": "0.49346143", "text": "function get(req, res, next) {\n const prop = toProp(req.params.resource)\n req.query[prop] = toId(req.params.id)\n req.url = `/${req.params.nested}`\n next()\n }", "title": "" }, { "docid": "0a7a98963106d70765eaa0bd5a244952", "score": "0.49281788", "text": "function collectResource(res){\n if((Game.structures.storage()[res.id]-res.count) >= res.perClick){ //Collect resource only if storage is available\n res.count += res.perClick;\n Game.updateScreen();\n }\n}", "title": "" }, { "docid": "23567d4cae8c2446952daf6f4a69960a", "score": "0.49280542", "text": "function Resource(name, type, inline, element) {\n this.name = name;\n this.type = type;\n this.inline = inline;\n this.element = element;\n}", "title": "" }, { "docid": "1a8e944ed705b30fe3b49b45a28d2336", "score": "0.4920485", "text": "function Post($resource,BaseUrl){//nos permite pillar datos de esta url\n\t\treturn $resource(BaseUrl + 'posts/:id', {id:'@id'})\n\t}", "title": "" }, { "docid": "a5cdbc35186dfc17bfa4b52f968d0340", "score": "0.4919654", "text": "addResource(resource) {\n this._resource = this._resource.merge(resource);\n }", "title": "" }, { "docid": "1864f6cec8316a401146a40cfb1fd700", "score": "0.4894902", "text": "function addResource(newResource){\n return db('resources')\n .insert(newResource, 'id')\n .then(id => {\n return getResourceById(id[0])\n })\n}", "title": "" }, { "docid": "42d81cda78cd13bc04af16dc9e534a6f", "score": "0.48809502", "text": "function getResource(resource = getCurrentHash(), method = 'GET', data = null) {\n\t\t\n if (resource.trim() === '') {\n window.location.hash = apiRoot;\n window.location.reload();\n\t\t\tresource = apiRoot;\n }\n\n // Adding '/' to the resource if missing\n if (resource.substring(0, 1) !== '/') {\n resource = '/' + resource;\n }\n\n let url = apiU + resource;\n\t\t\n\t\tif( method === 'DELETE' ){\n\t\t\tif (resource.substring(0, 1) == '/') {\n\t\t\t\tresource = resource.substring(1);\n\t\t\t}\n\t\t\turl = resource;\n\t\t}\n\t\t\n\t\tif( method === 'PUT' ){\t\t\n\t\t\t\n\t\t\tif (resource.substr(resource.length - 2) == '//') {\n\t\t\t\tresource = resource.substring(0, resource.length - 1);\n\t\t\t}\n\t\t\tif (resource.substring(0, 1) == '/') {\n\t\t\t\tresource = resource.substring(1);\n\t\t\t}\n\t\t\turl = resource;\n\t\t\tconsole.log(url)\n\t\t}\n\t\t\n //history.replaceState(null, null, '#!' + resource);\n\n $.ajax({\n contentType: data !== null ? PLAINJSON : null,\n data: data,\n timeout: xhrTimeout,\n type: method,\n url: url,\n })\n .done(renderData)\n .fail(handleAjaxError)\n\t\t\n }", "title": "" }, { "docid": "68912da5ee7b24763ced47520f163d7d", "score": "0.48803416", "text": "function pertainsTo(statement, resource) {\n let resources = statement.Resource\n\n for (let i = 0; i < resources.length; i++) {\n if (_.startsWith(resources[i], resource)) return true\n }\n\n return false\n}", "title": "" }, { "docid": "3fc0df14ef08ed85db86198bb21e8b22", "score": "0.48783183", "text": "function get(req, res, next) {\n const prop = pluralize.singular(req.params.resource);\n req.query[`${prop}${opts.foreignKeySuffix}`] = req.params.id;\n req.url = `/${req.params.nested}`;\n next();\n } // Rewrite URL (/:resource/:id/:nested -> /:nested) and request body", "title": "" }, { "docid": "bd89d0a3468d6ebf00817867afd85d6c", "score": "0.48636267", "text": "function userGet(req, res, next) {\n res.send(req.currentResources);\n}", "title": "" }, { "docid": "26581803c9b66aba35861f1e34188a2d", "score": "0.4862507", "text": "async function getResource(identifier) {\n let res = await db.query('SELECT * FROM resources WHERE id = ?', [identifier])\n if (res.length > 0) return res[0]\n res = await db.query('SELECT * FROM resources WHERE reference = ?', [identifier])\n if (res.length > 0) return res[0]\n return null\n }", "title": "" }, { "docid": "f8f7c6b279a6ffd8b32fe86c26ef7185", "score": "0.48548257", "text": "function getResourceUrl() { return \"http://\"+location.href.split(\"//\")[1].split(\"/\").splice(0,3).join(\"/\")+'.json?api_key='+MoviePilot.apikey;}", "title": "" }, { "docid": "d1f33851c31fc23eced29790ffc73c7b", "score": "0.48518994", "text": "function findActualResource(abstractResource) {\n var actualResource;\n var patterns = Object.keys(mapping);\n for (var index = 0; index < patterns.length; index++) {\n var pattern = patterns[index];\n // A really silly matcher just for learning purposes.\n if (abstractResource.endsWith(pattern)) {\n actualResource = mapping[pattern];\n break;\n }\n }\n // Can return undefined if there is no actual resource.\n return actualResource;\n}", "title": "" }, { "docid": "640fdce2660deadae27b3f44280cc731", "score": "0.48468566", "text": "edit(req, res) {\n\n\t}", "title": "" }, { "docid": "4c0bed80f6783aadd6d6958dd52be944", "score": "0.48460957", "text": "function resource(title,id,description,tasks,start,end,complete) {\n\t\t\tthis.title = title;\n\t\t\tthis.id = id;\n\t\t\tthis.description = description;\n\t\t\tthis.tasks = tasks;\n\t\t\tthis.start = start;\n\t\t\tthis.end = end;\n\t\t\tthis.complete = complete;\n\t\t}", "title": "" }, { "docid": "9f3603976c8001f76df08c57bd628427", "score": "0.48402506", "text": "function Cache_Get_Resource(strId, listener, state)\n{\n\t//overload\n\treturn this.Get_Item(strId, __CACHE_TYPE_RESOURCE, listener, state);\n}", "title": "" }, { "docid": "a7ac48413b0f4d3c18ff13ff69dc6c47", "score": "0.484013", "text": "resourceNamed(name) {\n return this.object.plugin.urlForResourceNamed_(name)\n }", "title": "" }, { "docid": "f09c55dcd6cdabf6df5d3b3063b104a8", "score": "0.4838617", "text": "function pgp_getResource(resource){\r\n\treturn pgp_Resources[resource+pgp_location];\r\n}", "title": "" }, { "docid": "4f67c3c48ec58a5dabe3965bc94a2ee2", "score": "0.48357978", "text": "function discover(resource) {\n for (var key in resource) {\n if (resource[key].spec && resource[key].spec.method && allowedMethods.indexOf(resource[key].spec.method.toLowerCase())>-1) {\n addMethod(appHandler, resource[key].action, resource[key].spec); } \n else {\n console.log('auto discover failed for: ' + key); }\n }\n}", "title": "" }, { "docid": "675297e6c143b535dd4ca2b7402e0b41", "score": "0.4828074", "text": "retrieve(req, res) {\n const { index } = req.params // Equivalent to req.params.index\n\n if (!isValidIndex(index)) {\n return res.status(HTTP_NOT_FOUND).send()\n }\n\n const resource = simpleDatabase[index]\n \n return res.status(HTTP_OK).json(resource)\n }", "title": "" }, { "docid": "e0c61a08d3edb86ab0b7557b05571c3b", "score": "0.48273218", "text": "function show(req, res) {\n return _media2.default.findById(req.params.id).exec().then(handleEntityNotFound(res)).then(respondWithResult(res)).catch(handleError(res));\n}", "title": "" }, { "docid": "b5035245de5312ddb3f88e6ae7a0ff79", "score": "0.4823327", "text": "fetch () {\n this._makeRequest('GET', resources);\n }", "title": "" }, { "docid": "e9513558a9e84b342c54e0d4c12ecc99", "score": "0.4819761", "text": "serve() {\n // a no-op, these are absolute URLs\n return function(req, res, next) {\n next();\n };\n }", "title": "" }, { "docid": "5db67b77aee241f88d78f3bbd3106d9b", "score": "0.48169622", "text": "function selectResource(location){\n var parts = location.split('/');\n parts.shift();\n var result = resources;\n for(var i=0; i<parts.length; i++){\n result = result[parts[i]];\n }\n //console.info(result);\n return result;\n}", "title": "" }, { "docid": "04aa88403f53d38ce11b0438be36cfe5", "score": "0.48156768", "text": "static isResource(_object) {\n return (Reflect.has(_object, \"idResource\"));\n }", "title": "" }, { "docid": "5e113001261fd2b82cd346f4a813a9f1", "score": "0.48126286", "text": "show(request, response, next) {\n SiteModel.find({title: request.params.title},\n (error, site) => response.json({site})\n );\n }", "title": "" }, { "docid": "07d1bc5f6d2e67c5ca93622cca9f5b2f", "score": "0.48095846", "text": "function PHPJS_Resource (type, id, opener) { // Can reuse the following for other resources, just changing the instantiation\r\n // See http://php.net/manual/en/resource.php for types\r\n this.type = type;\r\n this.id = id;\r\n this.opener = opener;\r\n }", "title": "" }, { "docid": "07d1bc5f6d2e67c5ca93622cca9f5b2f", "score": "0.48095846", "text": "function PHPJS_Resource (type, id, opener) { // Can reuse the following for other resources, just changing the instantiation\r\n // See http://php.net/manual/en/resource.php for types\r\n this.type = type;\r\n this.id = id;\r\n this.opener = opener;\r\n }", "title": "" }, { "docid": "2d4759befaa1e04b0a18beb1f4d422b8", "score": "0.4808684", "text": "function validateResource (req, res, next) {\n // @todo: SECURITY handle/cleanse request data\n const { resource } = req.params;\n\n if (!resource || !_.includes(resources, resource)) {\n return APIError({ code: 400, msg: 'Invalid resource' }, req, res);\n }\n \n /*if (!collection || !_.includes(collections, collection)) {\n return APIError({ code: 400, msg: 'Invalid collection' }, req, res);\n }*/\n next();\n}", "title": "" }, { "docid": "c64efe835741d908d2e716526a1eb4a6", "score": "0.48085132", "text": "function productResource($resource, appSettings) {\r\n return $resource(appSettings.serverPath + \"/api/products\");\r\n\r\n // This is to test URL path routing.\r\n //return $resource(appSettings.serverPath + \"/api/products/id\");\r\n //return $resource(appSettings.serverPath + \"/api/products/:search\");\r\n }", "title": "" }, { "docid": "37f855451b820f721f50215eb332f0a7", "score": "0.4806168", "text": "async index({response, params}) {\n const targetResource = await this.repo.findOneOrFailed(params.id)\n\n return response.dataJSON(targetResource)\n }", "title": "" }, { "docid": "4128fd3756ac7d6744372f93afb7727a", "score": "0.47872627", "text": "function getOne(req, res, next) {\n req.url = `/${req.params.nested}/${req.params.nestedId}`\n next()\n }", "title": "" }, { "docid": "0d318d031f0379b00efb0f33118b7d65", "score": "0.478", "text": "function listener(req, res) {\n //req.setEncoding('utf8');\n w.dep.syncho(function request_handler() {\n var rcontext = w.newRequestContext(req, res);\n route.call(rcontext);\n });\n}", "title": "" }, { "docid": "fc0f89721ffd49f50c6f882546abaa86", "score": "0.47765204", "text": "function mongooseResource(name, model) {\n\tyarm.remove(name);\n\treturn yarm.mongoose(name, model);\n}", "title": "" }, { "docid": "7a6f2ad4e0cb9aff3eb3fc0d0f7dc597", "score": "0.47746497", "text": "function handler (req, res) {\n if (req.url === '/reload') {\n reload.handler(res)\n } else {\n serve.handler(req, res)\n }\n}", "title": "" }, { "docid": "6c678aa822f93008e93dc64bc9dae2c3", "score": "0.47735286", "text": "run (req, res, next) {}", "title": "" }, { "docid": "e99619862352eedf9c0bb04d5260043e", "score": "0.476842", "text": "static viewSpecificFarm(req, res, next) {\n const { id } = req.params;\n Farm.findById(id)\n .then((farm) => {\n if (farm) {\n const foods = Math.floor((Date.now() - farm.lastCollected) / 60000);\n res.status(200).json({\n success: true,\n data: farm,\n foods: foods > 20 ? 20 : foods,\n });\n } else {\n throw \"NOT_FOUND\";\n }\n })\n .catch(next);\n }", "title": "" }, { "docid": "b577822f9e0f1d15a1cd20fe79bc288c", "score": "0.47592512", "text": "function queryResource(action, option, name, new_name, content) {\n\n var formData = {\n 't': d_settings.token,\n 'action': action,\n 'option': option,\n 'name': name,\n 'new_name': new_name,\n 'content': content,\n };\n jQuery.ajax({\n type: 'POST',\n url: '/teachers/resource',\n data: formData,\n dataType: 'json',\n encode: true\n }).done(function(data) {\n console.log(data);\n if (data.result.number_error != 0) {\n swalc(data.result.msg_error, \"Error Nro. \" + data.result.number_error, \"error\");\n return false;\n }\n });\n return true;\n}", "title": "" }, { "docid": "79a422fcadf59fd9703e1cda062cbbc9", "score": "0.4756681", "text": "serve() {\n return function (req, res, next) {\n next();\n };\n }", "title": "" }, { "docid": "73a7a4c9d68fd309e6077025d41b88ea", "score": "0.47564933", "text": "function getSubresources(req, res) {\n var id = req.params.id,\n key = req.params.key,\n originalFilter = req.query.filter ? _.cloneDeep(req.query.filter) : {};\n\n zipkinTracer.scoped(() => {\n const traceId = zipkinTracer.createRootId();\n req.zipkinTraceId = traceId;\n zipkinTracer.setId(traceId);\n zipkinTracer.recordServiceName('fortune-read-sub-resource');\n zipkinTracer.recordRpc(req.method.toUpperCase());\n zipkinTracer.recordBinary('fortune.resource', name);\n zipkinTracer.recordBinary('fortune.subresource', key);\n zipkinTracer.recordAnnotation(new Annotation.ServerRecv());\n });\n const localTracer = zipkin.makeLocalCallsWrapper(req, zipkinTracer);\n\n var projection = {};\n var select = parseSelectProjection(req.query.fields, model.modelName);\n\n req.query.fortuneExtensions = [{}];\n req.fortune.routeMetadata = _.extend({}, req.fortune.routeMetadata, {\n type: ROUTE_TYPES.getSubresources,\n resource: collection,\n subResourcePath: key\n });\n if (select){\n projection = {\n select: select\n };\n }\n\n if (!_.isUndefined(req.query.limit)){\n projection.limit = parseInt(req.query.limit,10);\n }\n\n if(id){\n //Reset query.filter to value applied to primary resource\n req.query.filter = {};\n req.query.filter.id = id;\n }\n\n localTracer('before-read-hooks-primary', () => beforeReadHook({}, req, res))\n .then(function(){\n // get a resource by ID\n return localTracer('reading-database-primary', () => {\n zipkinTracer.recordBinary('fortune.mongo_query', zipkin.safeStringify(req.query.filter));\n zipkinTracer.recordBinary('fortune.mongo_projection', zipkin.safeStringify(projection));\n return adapter.find(model, req.query.filter, projection)\n });\n }, function(err){\n sendError(req, res, 500, err);\n })\n\n // run after read hook\n .then(function(resource) {\n return localTracer('after-read-hooks-primary', () => afterReadHook(resource, req, res));\n }, function(error) {\n sendError(req, res, 404, error);\n })\n\n // change context to resource\n .then(function(resource) {\n var ids, relatedModel;\n try {\n ids = resource.links[key];\n if (_.isUndefined(ids)) {\n ids = [];\n }\n ids = _.isArray(ids) ? ids : [ids];\n relatedModel = _this._schema[name][key];\n relatedModel = _.isArray(relatedModel) ? relatedModel[0] : relatedModel;\n relatedModel = _.isPlainObject(relatedModel) ? relatedModel.ref : relatedModel;\n if (key && key.length > 0 && !relatedModel) {\n return sendError(req, res, 404);\n }\n } catch(error) {\n return sendError(req, res, 404, error);\n }\n\n var findPromise;\n if (_.size(ids) > 0) {\n //Reset req.query.filter to original value discarding changes applied for parent resource\n req.query.filter = originalFilter;\n req.query.filter.id = {$in: ids};\n //run before read hook\n findPromise = localTracer('before-read-hooks-secondary', () => beforeReadHook(relatedModel, {}, req, res))\n .then(function(){\n // find related resources\n return localTracer('readin-database-secondary', () => adapter.findMany(relatedModel,\n req.query.filter,\n _.isNumber(projection.limit) ? projection.limit : undefined));\n }, function(err){\n sendError(req, res, 500, err);\n });\n } else {\n var deferred = RSVP.defer();\n deferred.resolve([]);\n findPromise = deferred.promise;\n }\n\n // do after transforms\n findPromise.then(function(resources) {\n return localTracer('after-read-hooks-secondary', () => {\n return RSVP.all(resources.map(function (resource) {\n return afterReadHook(relatedModel, resource, req, res);\n }));\n });\n }, function(error) {\n sendError(req, res, 500, error);\n })\n\n // send the response\n .then(function(resources) {\n var body = {};\n body[inflect.pluralize(relatedModel)] = resources;\n sendResponse(req, res, 200, body);\n }, function(error) {\n sendError(req, res, 403, error);\n });\n\n }, function(error) {\n sendError(req, res, 403, error);\n });\n }", "title": "" }, { "docid": "c5a17e2bc6f06c1b1228f2840a7f40d5", "score": "0.47480464", "text": "function _embed(resource, e) {\n e && [].concat(e).forEach(externalResource => {\n if (db.get(externalResource).value) {\n var query = {};\n const singularResource = pluralize.singular(name);\n query[`${singularResource}${opts.foreignKeySuffix}`] = resource.id;\n var results = db.get(externalResource).filter(query).value(); // check for one to many relationships\n\n if (results.length === 0) {\n query = {};\n query[`${name}${opts.foreignKeySuffix}`] = [resource.id];\n results = db.get(externalResource).filter(query).value();\n }\n\n resource[externalResource] = results;\n }\n });\n } // Expand function used in GET /name and GET /name/id", "title": "" }, { "docid": "8ae1230f743102574f24f52875d61d5e", "score": "0.47479966", "text": "function load(req, res, next, id) {\n Tag.get(id).then((tag) => {\n req.tag = tag;\t\t// eslint-disable-line no-param-reassign\n return next();\n }).error((e) => next(e));\n}", "title": "" }, { "docid": "e8947397f0ffd6f47c269c6f6ae8fc07", "score": "0.47474667", "text": "function GetResourceEventHandler(sender){this.sender=sender;}", "title": "" }, { "docid": "413051fcf51e3e898423fb0a70806b3f", "score": "0.47437054", "text": "function updateResourcePara(ev){\n var params = {};\n params.method = \"POST\";\n params.url = \"/section/back/resources/resourcePara\";\n params.data = \"paragraph=\" + document.getElementById(\"resource-paragraph\").value;\n params.setHeader = true;\n toggleLoadingGif(true);\n ajaxRequest(params, mainPannelResponse);\n }", "title": "" }, { "docid": "4efb5885f237edbf70c7c5943d9595c7", "score": "0.4741052", "text": "function autoTrigger_onResourceReceived(pageData, e) {\n pageData.activeRequests.splice(pageData.activeRequests.indexOf(e.id), 1);\n autoTrigger_getContent(pageData, 'resources loaded');\n\n }", "title": "" }, { "docid": "26aa93189cc8d9b75589db8c2ec3cc9c", "score": "0.4739967", "text": "get resourceType () {\n\t\treturn this._resourceType;\n\t}", "title": "" }, { "docid": "26aa93189cc8d9b75589db8c2ec3cc9c", "score": "0.4739967", "text": "get resourceType () {\n\t\treturn this._resourceType;\n\t}", "title": "" }, { "docid": "26aa93189cc8d9b75589db8c2ec3cc9c", "score": "0.4739967", "text": "get resourceType () {\n\t\treturn this._resourceType;\n\t}", "title": "" }, { "docid": "26aa93189cc8d9b75589db8c2ec3cc9c", "score": "0.4739967", "text": "get resourceType () {\n\t\treturn this._resourceType;\n\t}", "title": "" }, { "docid": "26aa93189cc8d9b75589db8c2ec3cc9c", "score": "0.4739967", "text": "get resourceType () {\n\t\treturn this._resourceType;\n\t}", "title": "" }, { "docid": "26aa93189cc8d9b75589db8c2ec3cc9c", "score": "0.4739967", "text": "get resourceType () {\n\t\treturn this._resourceType;\n\t}", "title": "" }, { "docid": "26aa93189cc8d9b75589db8c2ec3cc9c", "score": "0.4739967", "text": "get resourceType () {\n\t\treturn this._resourceType;\n\t}", "title": "" }, { "docid": "26aa93189cc8d9b75589db8c2ec3cc9c", "score": "0.4739967", "text": "get resourceType () {\n\t\treturn this._resourceType;\n\t}", "title": "" }, { "docid": "26aa93189cc8d9b75589db8c2ec3cc9c", "score": "0.4739967", "text": "get resourceType () {\n\t\treturn this._resourceType;\n\t}", "title": "" }, { "docid": "26aa93189cc8d9b75589db8c2ec3cc9c", "score": "0.4739967", "text": "get resourceType () {\n\t\treturn this._resourceType;\n\t}", "title": "" }, { "docid": "26aa93189cc8d9b75589db8c2ec3cc9c", "score": "0.4739967", "text": "get resourceType () {\n\t\treturn this._resourceType;\n\t}", "title": "" }, { "docid": "927a8a4d99e3b40963278788458099d4", "score": "0.4731636", "text": "function send(req, res, resource) {\n var headers = resource.headers;\n\n // Set headers\n var keys = Object.keys(headers);\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n res.setHeader(key, headers[key]);\n }\n\n if (fresh(req.headers, res._headers)) {\n res.statusCode = 304;\n res.end();\n return;\n }\n\n res.statusCode = 200;\n res.setHeader('Content-Length', resource.body.length);\n res.setHeader('Content-Type', resource.type);\n res.end(resource.body);\n}", "title": "" } ]
2afef6b13786769e35dd28fee189d766
Translate a coordinate in the document to a percentage on the slider
[ { "docid": "58f91e8b366393d571aad7da9c412592", "score": "0.56402516", "text": "function calcPointToPercentage ( calcPoint ) {\r\n\t\tvar location = calcPoint - offset(scope_Base, options.ort);\r\n\t\tvar proposal = ( location * 100 ) / baseSize();\r\n\r\n\t\t// Clamp proposal between 0% and 100%\r\n\t\t// Out-of-bound coordinates may occur when .noUi-base pseudo-elements\r\n\t\t// are used (e.g. contained handles feature)\r\n\t\tproposal = limit(proposal);\r\n\r\n\t\treturn options.dir ? 100 - proposal : proposal;\r\n\t}", "title": "" } ]
[ { "docid": "2bab4aaf95fe0cd62ffba56914365d19", "score": "0.69370776", "text": "function set_perc(e){\n return ((e.pageX-railStart)/(railEnd-railStart)); // calculates how far the slider is on the rail\n }", "title": "" }, { "docid": "2c1db9bf7c44f902ed05f598ee4758a1", "score": "0.66841394", "text": "function setValue() {\n var newValue = (range.val() - range.attr('min')) * 100 / (range.attr('max') - range.attr('min'));\n var newPosition = 10 - (newValue * 0.2);\n\n rangeV.html(\"<span>\" + range.val() + \"$</span>\");\n\n rangeV.css('left', \"calc(\" + newValue + \"% + (\" + newPosition + \"px))\");\n}", "title": "" }, { "docid": "0df828c96984bc589037a6affaf37581", "score": "0.65890044", "text": "function _update() {\n const handle = _dom.querySelector( '.rangeslider__handle' );\n const matchPx = /translate\\((\\d*.*\\d*)px,.+\\)$/;\n const leftVal = Number(\n handle.style.transform.match( matchPx )[1]\n );\n\n _updateValues();\n\n _labelDom.textContent = `${ _valMin } - ${ _valMax }`;\n _labelDom.style.left = leftVal - 9 + 'px';\n }", "title": "" }, { "docid": "3073ebbd31ae52030d99f353bdc3c2ab", "score": "0.65212715", "text": "xCoordToPercent(x) {\n x -= this.$parent.offset().left; // pixel position\n const max = this.$parent.innerWidth();\n return Number(((x / max) * 100).toFixed(2)); // round to 2 decimal places\n }", "title": "" }, { "docid": "f5416416f31433bbd189777fca2d96a8", "score": "0.64159834", "text": "function rangeSlide(value){\n document.getElementById('rangeValue').innerHTML=value;\n document.getElementById('current').innerHTML=Math.round(12/value*100)/100;}", "title": "" }, { "docid": "fcdb421bfb5ea4fb1fc35e0dc103e1ac", "score": "0.64073133", "text": "get percentage() {\n if (this._slider.min >= this._slider.max) {\n return this._slider._isRtl ? 1 : 0;\n }\n return (this.value - this._slider.min) / (this._slider.max - this._slider.min);\n }", "title": "" }, { "docid": "7a1b9748332c696b27616cf504c3edeb", "score": "0.6398327", "text": "function setSongPosition(obj,e){\n //Gets the offset from the left so it gets the exact location.\n var songSliderWidth = obj.offsetWidth;\n var evtobj=window.event? event : e;\n clickLocation = evtobj.layerX - obj.offsetLeft;\n \n var percentage = (clickLocation/songSliderWidth);\n //Sets the song location with the percentage.\n //console.log(percentage);\n setLocation(percentage);\n\n}", "title": "" }, { "docid": "88122556a18822708bb230f4b60b332a", "score": "0.6371715", "text": "_updateSliderPosition() {\n // 100 * ( slide position ) / ( number of elements in slider )\n const position = 100 * (this.currentSlide + this.numberOfVisibleSlides - 1) / (this.slides.length);\n this.slider.style.transform = `translate3d(-${position}%,0,0)`;\n this._updateTabindex();\n }", "title": "" }, { "docid": "010f8f9b3eb99172cf28e037e0c2cbfc", "score": "0.63346785", "text": "function onDrag(percent) {\n var target = self.at(percent > 0 ? self.next() : self.previous());\n var current = self.at(self.selected());\n\n target && target.transform(percent);\n current && current.transform(percent);\n }", "title": "" }, { "docid": "5b699740f8ab345aca53616da37ba016", "score": "0.6306693", "text": "onMouseMove (event) {\n let x = event.offsetX;\n\n let vel = x - this.prevOffset;\n let offset = this.offsetX - vel;\n\n let center = this.width / this.scale;\n this.setValue(offset / center);\n this.prevOffset = x;\n\n // fire 'changed'\n var number = new Float(this.getValue());\n this.trigger('changed', number);\n this.overPoint = true;\n }", "title": "" }, { "docid": "0ec4b2a645d779d1205588380cb735a2", "score": "0.62801147", "text": "svgCoordinateToPercentages(svgPoint) {\n const point = {\n x: (svgPoint.x / this.props.slideWidth) * 100,\n y: (svgPoint.y / this.props.slideHeight) * 100,\n };\n\n return point;\n }", "title": "" }, { "docid": "c21272822dfa417bd74f4eeb88ce5e03", "score": "0.6273552", "text": "function moveSlider (event, sliderPos, xMin, xMax, range, marker, label, offset) {\n var sliderPos;\n var newValue;\n if (event.x < xMin) {\n sliderPos = [xMin];\n } else if (xMax < event.x) {\n sliderPos = [xMax];\n } else {\n sliderPos = [event.x];\n }\n newValue = ((xMin - sliderPos[0])*range)/(xMin - xMax) + offset;\n marker.attr(\"cx\", sliderPos)\n label.attr(\"x\", sliderPos)\n .text(parseFloat(newValue.toFixed(2)))\n return newValue;\n}", "title": "" }, { "docid": "6d1e62d61d5fe05fa824749a1a9e14b4", "score": "0.6244743", "text": "translate(x) {\n const range = this.max - this.min;\n const { left, width } = this.el.getBoundingClientRect();\n const percent = (x - left) / width;\n const mirror = this.shouldMirror();\n let value = this.clamp(this.min + range * (mirror ? 1 - percent : percent));\n if (this.snap && this.step) {\n value = this.getClosestStep(value);\n }\n return value;\n }", "title": "" }, { "docid": "f3199494e69a3f2371fafefb4c4e25d2", "score": "0.61849743", "text": "function positionperc(perc, $parent, vertical, $track, trackSize) {\n\n var $handle = $parent.find(\".slidepicker-handle\");\n\n if (vertical) {\n var increment = trackSize.trackHeight / 1000;\n perc = (Math.round(perc * 1000) * increment) / trackSize.trackHeight;\n } else {\n var increment = trackSize.trackWidth / 1000;\n perc = (Math.round(perc * 1000) * increment) / trackSize.trackWidth;\n }\n\n\n if (perc < 0) {\n perc = 0;\n }\n if (perc > 1) {\n perc = 1;\n }\n\n $handle.css((vertical) ? \"top\" : \"left\", (perc * 100) + \"%\");\n\n }", "title": "" }, { "docid": "1b902fc352feef4882e64144e6ec0ac2", "score": "0.61796343", "text": "function adjustThumbPosition( x ) { // 9811\n var exactVal = percentToValue( positionToPercent( x )); // 9812\n var closestVal = minMaxValidator( stepValidator(exactVal) ); // 9813\n setSliderPercent( positionToPercent(x) ); // 9814\n thumbText.text( closestVal ); // 9815\n } // 9816", "title": "" }, { "docid": "f503b6851d265398836971e396cef2e6", "score": "0.61784244", "text": "YCoordToPercent(y) {\n y -= this.$parent.offset().top; // pixel position\n const max = this.$parent.innerHeight();\n return Number(((y / max) * 100).toFixed(2)); // round to 2 decimal places\n }", "title": "" }, { "docid": "c7b232a887bc52a6967213b6da53b4d5", "score": "0.61657906", "text": "function sliderForward(){\n TweenMax.to(sliderWindow, 2, {xPercent: (tl.currentLabel())*(-100), ease: Power2.easeOut});\n}", "title": "" }, { "docid": "25b85184ce2400c5430329f16b0900e9", "score": "0.61456484", "text": "function setPositionPercent(selector, percent) {\n var slider = document.querySelector(selector);\n var progress = slider.querySelector(\"#sliderBar\");\n var rect = progress.getBoundingClientRect();\n var clientX = rect.left + percent * rect.width;\n var clientY = rect.top + 1;\n simulateMouseEvent(\"mousedown\", progress, clientX, clientY);\n setTimeout(function() {\n simulateMouseEvent(\"mouseup\", progress, clientX, clientY);\n }, 250);\n }", "title": "" }, { "docid": "c97e7cb07b4a4b40e69a8617c376a5c5", "score": "0.60856956", "text": "_setValuePercent() {\n const dif = ((this.value - this.min) / (this.max - this.min)) * 100;\n this.el.style.setProperty('--valuePercent', `${dif}%`);\n }", "title": "" }, { "docid": "a7807b6255108b1e08b8708037ad23d3", "score": "0.6045196", "text": "_updateValueFromPosition(pos) {\n if (!this._sliderDimensions) {\n return;\n }\n let offset = this.vertical ? this._sliderDimensions.top : this._sliderDimensions.left;\n let size = this.vertical ? this._sliderDimensions.height : this._sliderDimensions.width;\n let posComponent = this.vertical ? pos.y : pos.x;\n // The exact value is calculated from the event and used to find the closest snap value.\n let percent = this._clamp((posComponent - offset) / size);\n if (this._shouldInvertMouseCoords()) {\n percent = 1 - percent;\n }\n // Since the steps may not divide cleanly into the max value, if the user\n // slid to 0 or 100 percent, we jump to the min/max value. This approach\n // is slightly more intuitive than using `Math.ceil` below, because it\n // follows the user's pointer closer.\n if (percent === 0) {\n this.value = this.min;\n }\n else if (percent === 1) {\n this.value = this.max;\n }\n else {\n const exactValue = this._calculateValue(percent);\n // This calculation finds the closest step by finding the closest\n // whole number divisible by the step relative to the min.\n const closestValue = Math.round((exactValue - this.min) / this.step) * this.step + this.min;\n // The value needs to snap to the min and max.\n this.value = this._clamp(closestValue, this.min, this.max);\n }\n }", "title": "" }, { "docid": "a7807b6255108b1e08b8708037ad23d3", "score": "0.6045196", "text": "_updateValueFromPosition(pos) {\n if (!this._sliderDimensions) {\n return;\n }\n let offset = this.vertical ? this._sliderDimensions.top : this._sliderDimensions.left;\n let size = this.vertical ? this._sliderDimensions.height : this._sliderDimensions.width;\n let posComponent = this.vertical ? pos.y : pos.x;\n // The exact value is calculated from the event and used to find the closest snap value.\n let percent = this._clamp((posComponent - offset) / size);\n if (this._shouldInvertMouseCoords()) {\n percent = 1 - percent;\n }\n // Since the steps may not divide cleanly into the max value, if the user\n // slid to 0 or 100 percent, we jump to the min/max value. This approach\n // is slightly more intuitive than using `Math.ceil` below, because it\n // follows the user's pointer closer.\n if (percent === 0) {\n this.value = this.min;\n }\n else if (percent === 1) {\n this.value = this.max;\n }\n else {\n const exactValue = this._calculateValue(percent);\n // This calculation finds the closest step by finding the closest\n // whole number divisible by the step relative to the min.\n const closestValue = Math.round((exactValue - this.min) / this.step) * this.step + this.min;\n // The value needs to snap to the min and max.\n this.value = this._clamp(closestValue, this.min, this.max);\n }\n }", "title": "" }, { "docid": "1ffebb8d9d5065eacf6b9caee1053c80", "score": "0.60450196", "text": "function scroll_to_percent(){\n perc = parseInt(Private.cordx_slider1);\n idx_perc = Math.round(( (Private.frames + Private.padding) - (Private.step * Private.frame_rate * (Private.window_width-1))) * perc / 100);\n idx = idx_perc - idx_perc % (Private.step * Private.frame_rate) + 1; // to scroll always exactly as the selected step\n scroll_to(idx);\n }", "title": "" }, { "docid": "8d371ed03ba3256e2659377a90fa2f4d", "score": "0.6037856", "text": "function px(x) {\n return x*g.getWidth()/100;\n}", "title": "" }, { "docid": "796de0594e13c5b07848c50cd1a2c4c8", "score": "0.6034072", "text": "get value() { return this.from + (this.to - this.from) * this.ease(this.percent); }", "title": "" }, { "docid": "1e8ad76b577424e81f5e23a9a808353e", "score": "0.60204583", "text": "function updateSlider(slideAmount) {\n radiusMapDistanceValue = Number(slideAmount);\n initSearchingMap();\n $('#lblDistance').text(\"Distance radius: \" + slideAmount + \" km\"); \n}", "title": "" }, { "docid": "12f5f808acf8f78a1727cafd08e33cc3", "score": "0.6003639", "text": "function doSlide( x ) {\n\t scope.$evalAsync( function() {\n\t setModelValue( percentToValue( positionToPercent(x) ));\n\t });\n\t }", "title": "" }, { "docid": "ba942d9e12ceb5353cb85e703610c0e0", "score": "0.59882617", "text": "function doSlide( x ) {\n scope.$evalAsync( function() {\n setModelValue( percentToValue( positionToPercent(x) ));\n });\n }", "title": "" }, { "docid": "ba942d9e12ceb5353cb85e703610c0e0", "score": "0.59882617", "text": "function doSlide( x ) {\n scope.$evalAsync( function() {\n setModelValue( percentToValue( positionToPercent(x) ));\n });\n }", "title": "" }, { "docid": "ba942d9e12ceb5353cb85e703610c0e0", "score": "0.59882617", "text": "function doSlide( x ) {\n scope.$evalAsync( function() {\n setModelValue( percentToValue( positionToPercent(x) ));\n });\n }", "title": "" }, { "docid": "ba942d9e12ceb5353cb85e703610c0e0", "score": "0.59882617", "text": "function doSlide( x ) {\n scope.$evalAsync( function() {\n setModelValue( percentToValue( positionToPercent(x) ));\n });\n }", "title": "" }, { "docid": "ba942d9e12ceb5353cb85e703610c0e0", "score": "0.59882617", "text": "function doSlide( x ) {\n scope.$evalAsync( function() {\n setModelValue( percentToValue( positionToPercent(x) ));\n });\n }", "title": "" }, { "docid": "ba942d9e12ceb5353cb85e703610c0e0", "score": "0.59882617", "text": "function doSlide( x ) {\n scope.$evalAsync( function() {\n setModelValue( percentToValue( positionToPercent(x) ));\n });\n }", "title": "" }, { "docid": "1d5705043817982fad68246624423db3", "score": "0.5977211", "text": "function updateSeek() {\n let currentPos = (audio.currentTime / audio.duration) * 100;\n sliders[0].value = currentPos;\n}", "title": "" }, { "docid": "c751927ecc29cf08c3dd3c136a91f8ae", "score": "0.5971353", "text": "function SlideBar_SetPropValue(v)\n{\n\tif(v > 100) v = 100;\n\telse if(v < 0) v = 0;\n\tthis.value.value = v;\n\tif(this.horizontal)\n\t{\n\t\tthis.handle.x = v * this.length / 100;\n\t\tthis.handle.block.style.left = v * this.length * 0.009 + \"px\";\n\t}\n\telse\n\t{\n\t\tthis.handle.y = v * this.length / 100;\n\t\tthis.handle.block.style.top = v * this.length * 0.009 + \"px\";\n\t}\n}", "title": "" }, { "docid": "09d53c5ac0925da3e32c3a7d2e05d132", "score": "0.59572154", "text": "function adjustThumbPosition( x ) {\n\t var exactVal = percentToValue( positionToPercent( x ));\n\t var closestVal = minMaxValidator( stepValidator(exactVal) );\n\t setSliderPercent( positionToPercent(x) );\n\t thumbText.text( closestVal );\n\t }", "title": "" }, { "docid": "b1d0a750464e8887410093de2259ec5b", "score": "0.5953847", "text": "function firstSlider() {\n let percent = inputPercentage.value;\n\n percentageTip = Number(percent);\n /* appending the percentage value to the dom */\n selectTipFigure.textContent = percentageTip;\n\n /* CALCULATING THE TIP PERCENTAGE */\n tip = (bill * percent) / 100;\n \n \n tipValue.textContent = tip;\n \n /* calculating the value for the total value */\n \n totalValue.textContent = bill + tip\n billEach.textContent = bill + tip;\n}", "title": "" }, { "docid": "51208288cf155641940f49351ab31090", "score": "0.59240043", "text": "function inceressValue() {\r\n const modelViewerTransform = document.querySelector(\"model-viewer#transform\");\r\n const x = document.querySelector('#x');\r\n const y = document.querySelector('#y');\r\n const z = document.querySelector('#z');\r\n var amount = 2;\r\n modelViewerTransform.scale.x = modelViewerTransform.scale.x * amount;\r\n modelViewerTransform.scale.y = modelViewerTransform.scale.y * amount;\r\n modelViewerTransform.scale.z = modelViewerTransform.scale.y * amount;\r\n console.log(modelViewerTransform.scale.x * amount)\r\n console.log(modelViewerTransform.scale.y * amount)\r\n console.log(modelViewerTransform.scale.z * amount)\r\n}", "title": "" }, { "docid": "d128b98691429612880861783d075ca9", "score": "0.59126055", "text": "function value2pos(target, value){\n\t\tvar state = $.data(target, 'slider');\n\t\tvar opts = state.options;\n\t\tvar slider = state.slider;\n\t\tif (opts.mode == 'h'){\n\t\t\tvar pos = (value-opts.min)/(opts.max-opts.min)*slider.width();\n\t\t\tif (opts.reversed){\n\t\t\t\tpos = slider.width() - pos;\n\t\t\t}\n\t\t} else {\n\t\t\tvar pos = slider.height() - (value-opts.min)/(opts.max-opts.min)*slider.height();\n\t\t\tif (opts.reversed){\n\t\t\t\tpos = slider.height() - pos;\n\t\t\t}\n\t\t}\n\t\treturn pos.toFixed(0);\n\t}", "title": "" }, { "docid": "2eb3e88e0a3ae5d15bc99f45b490f4a9", "score": "0.5911895", "text": "function moveSlider() {\n document.getElementById('compare-overlay').style.width =\n document.getElementById('compare-slider').value + '%';\n}", "title": "" }, { "docid": "920899bc6b34a47fefaca5c8ab750ecd", "score": "0.59102243", "text": "function adjustThumbPosition( x ) {\n var exactVal = percentToValue( positionToPercent( x ));\n var closestVal = minMaxValidator( stepValidator(exactVal) );\n setSliderPercent( positionToPercent(x) );\n thumbText.text( closestVal );\n }", "title": "" }, { "docid": "920899bc6b34a47fefaca5c8ab750ecd", "score": "0.59102243", "text": "function adjustThumbPosition( x ) {\n var exactVal = percentToValue( positionToPercent( x ));\n var closestVal = minMaxValidator( stepValidator(exactVal) );\n setSliderPercent( positionToPercent(x) );\n thumbText.text( closestVal );\n }", "title": "" }, { "docid": "920899bc6b34a47fefaca5c8ab750ecd", "score": "0.59102243", "text": "function adjustThumbPosition( x ) {\n var exactVal = percentToValue( positionToPercent( x ));\n var closestVal = minMaxValidator( stepValidator(exactVal) );\n setSliderPercent( positionToPercent(x) );\n thumbText.text( closestVal );\n }", "title": "" }, { "docid": "920899bc6b34a47fefaca5c8ab750ecd", "score": "0.59102243", "text": "function adjustThumbPosition( x ) {\n var exactVal = percentToValue( positionToPercent( x ));\n var closestVal = minMaxValidator( stepValidator(exactVal) );\n setSliderPercent( positionToPercent(x) );\n thumbText.text( closestVal );\n }", "title": "" }, { "docid": "920899bc6b34a47fefaca5c8ab750ecd", "score": "0.59102243", "text": "function adjustThumbPosition( x ) {\n var exactVal = percentToValue( positionToPercent( x ));\n var closestVal = minMaxValidator( stepValidator(exactVal) );\n setSliderPercent( positionToPercent(x) );\n thumbText.text( closestVal );\n }", "title": "" }, { "docid": "920899bc6b34a47fefaca5c8ab750ecd", "score": "0.59102243", "text": "function adjustThumbPosition( x ) {\n var exactVal = percentToValue( positionToPercent( x ));\n var closestVal = minMaxValidator( stepValidator(exactVal) );\n setSliderPercent( positionToPercent(x) );\n thumbText.text( closestVal );\n }", "title": "" }, { "docid": "3f51976680885d33e475a32789065dd7", "score": "0.5909744", "text": "getTranslateValue() {\n // calculate the % position of the element comparing to the viewport\n // rounding percentage to a 1 number float to avoid unn unnecessary calculation\n let percentage = ((viewport.positions.bottom - this.elementTop) / ((viewport.positions.height + this.elementHeight) / 100)).toFixed(1);\n\n // sometime the percentage exceeds 100 or goes below 0\n percentage = Math.min(100, Math.max(0, percentage));\n\n // if a maxTransition has been set, we round the percentage to that number\n if (this.settings.maxTransition !== 0 && percentage > this.settings.maxTransition) {\n percentage = this.settings.maxTransition;\n }\n\n // sometime the same percentage is returned\n // if so we don't do aything\n if (this.oldPercentage === percentage) {\n return false;\n }\n\n // if not range max is set, recalculate it\n if (!this.rangeMax) {\n this.getRangeMax();\n }\n\n // transform this % into the max range of the element\n // rounding translateValue to a non float int - as minimum pixel for browser to render is 1 (no 0.5)\n this.translateValue = ((percentage / 100) * this.rangeMax - this.rangeMax / 2).toFixed(0);\n\n // sometime the same translate value is returned\n // if so we don't do aything\n if (this.oldTranslateValue === this.translateValue) {\n return false;\n }\n\n // store the current percentage\n this.oldPercentage = percentage;\n this.oldTranslateValue = this.translateValue;\n\n return true;\n }", "title": "" }, { "docid": "e90e7a077a9308e679e2bad65120b1b8", "score": "0.5837694", "text": "function doSlide(x) {\n scope.$evalAsync(function() {\n setModelValue(percentToValue(positionToPercent(x)));\n });\n }", "title": "" }, { "docid": "87af959922834fc9969470fa9aa6f8ed", "score": "0.5831854", "text": "function doSlide( x ) { // 9801\n scope.$evalAsync( function() { // 9802\n setModelValue( percentToValue( positionToPercent(x) )); // 9803\n }); // 9804\n } // 9805", "title": "" }, { "docid": "17ce4abb5ffd6fbc377af7355c0c1908", "score": "0.5823327", "text": "function sliderOffset (v) {\n return minPos + (v - minValue) / (maxValue - minValue) * (maxPos - minPos);\n }", "title": "" }, { "docid": "d9e344bb1c59b8b3f1cc0a4bcdf60e7d", "score": "0.5820521", "text": "function setSongPosition(obj,e){\r\n //Gets the offset from the left so it gets the exact location.\r\n var songSliderWidth = obj.offsetWidth;\r\n var evtobj=window.event? event : e;\r\n clickLocation = evtobj.layerX - obj.offsetLeft;\r\n\r\n var percentage = (clickLocation/songSliderWidth);\r\n //Sets the song location with the percentage.\r\n setLocation(percentage);\r\n}", "title": "" }, { "docid": "b317d238e093b1221ce7894ea6f4c043", "score": "0.58161706", "text": "function percentToTrackCoords(n) {\n return n * 10;\n}", "title": "" }, { "docid": "ba5b32c2c2c4506b7f3d0f55fea0225b", "score": "0.5809953", "text": "function sliderChange() {\n var sliderVal = document.getElementById(\"slider1\").value;\n //document.getElementById(\"rangeValue1\").value = sliderVal;\n// var angleChange = angularSpeed * timeDiff * 2 * Math.PI / 1000;\n// cube.rotation.y += angleChange;\n CUBEScene.cube.rotation.y = +sliderVal * (Math.PI / 180);\n // render\n render();\n}", "title": "" }, { "docid": "f00b21f6d1f9e011943b3baaf88b92b9", "score": "0.57918495", "text": "function onWheel(evt) {\r\n\t// Various equations could be used here, but this is what I chose\r\n\tcur_scale *= (1000-evt.deltaY) / 1000;\r\n\tupdate_model_view();\r\n}", "title": "" }, { "docid": "4e6f1acf2251b6cb8a335cac2e3f4210", "score": "0.5790502", "text": "function desplazamientoD(valor){\n valor = valor + 100;\n slider.style.marginLeft = \"-\"+valor+\"%\";\n}", "title": "" }, { "docid": "ec1c7bca2fdf17213ea88688afde408d", "score": "0.57830435", "text": "function update() {\n min = isAttrNum(slider.min) ? +slider.min : 0;\n max = isAttrNum(slider.max) ? +slider.max : 100;\n if (max < min)\n max = min > 100 ? min : 100;\n step = isAttrNum(slider.step) && slider.step > 0 ? +slider.step : 1;\n range = max - min;\n draw(true);\n }", "title": "" }, { "docid": "f734fecace971e7ba308494382b3206a", "score": "0.57762563", "text": "function updateSlider(){\n\t\tslider.slider(\"value\", mainTimeline.progress() *100);\n\t}", "title": "" }, { "docid": "932d15c8825eacb1420caf56a7eb223b", "score": "0.5771647", "text": "function setSongPosition_1(obj, e) {\n //Gets the offset from the left so it gets the exact location.\n var songSliderWidth = obj.offsetWidth;\n var evtobj = window.event ? event : e;\n clickLocation = evtobj.layerX - obj.offsetLeft;\n\n var percentage = (clickLocation / songSliderWidth);\n //Sets the song location with the percentage.\n setLocation(percentage);\n }", "title": "" }, { "docid": "7b160d761d909a852145414e3ee6dc85", "score": "0.57686394", "text": "function setBubble(slider, bubble) {\n\n const val = slider.value ; \n const min = slider.min ; \n const max = slider.max ; \n\n const offset = Number(((val - min) * 100) / (max - min)) ; \n\n bubble.textContent = val ; \n \n bubble.style.left = `calc(${offset}% - 14px)` ; \n}", "title": "" }, { "docid": "5885da2ed28de2abc4b17e9bd686c90a", "score": "0.5760729", "text": "function listener_theta()\r\n{\r\n MV_THETA = document.getElementById(\"slider_theta\").value;\r\n document.getElementById(\"val_theta\").innerHTML = MV_THETA;\r\n MV_THETA = MV_THETA * Math.PI / 180;\r\n\r\n render();\r\n}", "title": "" }, { "docid": "ee78ab275b410bc547966274274c5b60", "score": "0.5760628", "text": "get travelPercent() {\n // value of `selectionStartPercent` when we're at far-right of window\n const maxSelectionStartPercent = 1 - this.aminoAcidSelectionWidthPercent;\n // percent selection box has been dragged across window, where far-right is 1.0\n return Math.min(this.props.selectionStartPercent / maxSelectionStartPercent, 1);\n }", "title": "" }, { "docid": "b4facbada996b7162a36cb8e84ca2d29", "score": "0.5750225", "text": "function currentvalue(){\n var value=document.getElementById('rangeValue').innerHTML;\n var Current=Math.round(12/value*100)/100;\n document.getElementById(\"current\").innerHTML =Current;\n }", "title": "" }, { "docid": "7627768a18985c9ac51f7c7f7f635f60", "score": "0.57450885", "text": "function translateX(x) {\n return (180 + x) * 3;\n}", "title": "" }, { "docid": "2e796f0bcc37ede581a87ea6ca483abb", "score": "0.5742005", "text": "function v(a,c,d,e){if(100===e)return e;var f,g,h=s(e,a);\n// If 'snap' is set, steps are used as fixed points on the slider.\n// If 'snap' is set, steps are used as fixed points on the slider.\n// Find the closest position, a or b.\nreturn d?(f=a[h-1],g=a[h],e-f>(g-f)/2?g:f):c[h-1]?a[h-1]+b(e-a[h-1],c[h-1]):e}", "title": "" }, { "docid": "451b34cad783474d8ce02a8dfcaa6ee2", "score": "0.57354057", "text": "function SlideBar_SetValue(v)\n{\n\tif(v > this.length) v = this.length;\n\telse if(v < 0) v = 0;\n\tthis.value.value = v * 100 / this.length;\n\tif(this.horizontal)\n\t{\n\t\tthis.handle.x = v;\n\t\tthis.handle.block.style.left = v * 0.9 + \"px\";\n\t}\n\telse\n\t{\n\t\tthis.handle.y = v;\n\t\tthis.handle.block.style.top = v * 0.9 + \"px\";\n\t}\n}", "title": "" }, { "docid": "a34002d76da86168b389ca8380666fb5", "score": "0.571278", "text": "function desplazamientoI(valor){\n slider.style.marginLeft = (valor-100)+\"%\";\n}", "title": "" }, { "docid": "1aa8ee35dbb1c04af0d09ba20f53555d", "score": "0.571264", "text": "function calculatePercentage(){\n\t\t\t\t//Calculate Horizontal Percentage\n\t\t\t\tif ( (e.pageX - getCurScrollValue_x) < hArea_point01 ) {\n\t\t\t\t\tcurXPosValue = (e.pageX - getCurScrollValue_x - hArea_point01) * -1 ;\n\t\t\t\t} else if ( (e.pageX - getCurScrollValue_x) > hArea_point02 ) {\n\t\t\t\t\tcurXPosValue = e.pageX - getCurScrollValue_x - hArea_point02 ;\n\t\t\t\t}\n\t\t\t\ttempStore = $(window).width() - hArea_point02;\n\t\t\t\tcurXPercentage = parseInt((curXPosValue/tempStore) * 100);\n\t\t\t\t//$('.pos05').html('Mouse X Percentage: ' + curXPercentage + '%');\n\t\t\t\t\n\t\t\t\t//Calculate Vertical Percentage\n\t\t\t\tif ( (e.pageY - getCurScrollValue_y) < vArea_point01 ) {\n\t\t\t\t\tcurYPosValue = (e.pageY - getCurScrollValue_y - vArea_point01) * -1 ;\n\t\t\t\t} else if ( (e.pageY - getCurScrollValue_y) > vArea_point02 ) {\n\t\t\t\t\tcurYPosValue = e.pageY - getCurScrollValue_y - vArea_point02 ;\n\t\t\t\t}\n\t\t\t\ttempStore = $(window).height() - vArea_point02;\n\t\t\t\tcurYPercentage = parseInt((curYPosValue/tempStore) * 100);\n\t\t\t\t//$('.pos06').html('Mouse Y Percentage: ' + curYPercentage + '%');\n\t\t\t\t\n\t\t\t\tif ( curXPercentage > curYPercentage ) {\n\t\t\t\t\tposProgressBar( (100 - curXPercentage) * 0.01 );\n\t\t\t\t} else {\n\t\t\t\t\tposProgressBar( (100 - curYPercentage) * 0.01 );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}", "title": "" }, { "docid": "767b5bb71c4ae7671fd5526dbb1dc94e", "score": "0.57024705", "text": "function progressUpdate() {\n //the percentage loaded based on the tween's progress\n loadingProgress = Math.round(progressTl.progress() * 100);\n //we put the percentage in the screen\n $(\".txt-perc\").text(loadingProgress + '%');\n\n }", "title": "" }, { "docid": "cfe125161f52d942200202fcc0a5682a", "score": "0.57004356", "text": "translateOffset (coords) {\n this.offset = this.unproject(coords).map(coord => coord - Math.floor(coord))\n this.trigger('change')\n }", "title": "" }, { "docid": "6c397e2bb7afd007c7a179090aa36eb4", "score": "0.56955516", "text": "function valueToPercent(value,min,max){return(value-min)*100/(max-min);}", "title": "" }, { "docid": "46514b724aa1219cafa0cf97bfec51cf", "score": "0.569163", "text": "function move(p) {\n var elem = document.getElementById(\"myBar\");\n \n // Write the progress to the console\n console.log(p);\n\n // Take the value given by onProgress --> 0.125, 0.25, 0.375, 0.5, 0.625, 0.75, 0.875, 1\n // Replace move(p) with console.log(p) below to see the above values of p.\n var width = 100 * p;\n \n // Change the width attribute in the element.\n // The width is a percentage e.g. 20%\n elem.style.width = width + '%';\n \n // Replace the innerhtml percentage e.g. <div>20%</div>\n elem.innerHTML = width + '%';\n \n}", "title": "" }, { "docid": "d2800c1ac4f9d772c919c26e8be9c4ad", "score": "0.5681555", "text": "function adjustThumbPosition(x) {\n var exactVal = percentToValue(positionToPercent(x));\n var closestVal = minMaxValidator(stepValidator(exactVal));\n setSliderPercent(positionToPercent(x));\n thumbText.text(closestVal);\n }", "title": "" }, { "docid": "63ca381247b303769cb843239bd0fd52", "score": "0.5677668", "text": "function updateIntensity()\n {\n \t\tintensity = intensitySlider.value/100;\n }", "title": "" }, { "docid": "e79cb89e1010669bfad322a5ed9964e8", "score": "0.56692487", "text": "_centerOutput() {\n const unencoded = this._slider.noUiSlider.get();\n const sliderAverage = typeof unencoded === 'object'\n ? unencoded.reduce((previousValue, currentValue) => {\n return previousValue + parseFloat(currentValue);\n }, 0) / unencoded.length\n : parseFloat(unencoded);\n const maxRight = this._element.offsetWidth - this._output.offsetWidth;\n const handleSize = this._slider.offsetHeight;\n const position = mapLinear(sliderAverage, this._rangeMin, this._rangeMax, 0, 1) * this._slider.offsetWidth - this._output.offsetWidth / 2 + handleSize / 2;\n this._output.style.left = `${limit(position, 0, maxRight)}px`;\n }", "title": "" }, { "docid": "0859871442aa8d8a27a723081d87dde1", "score": "0.5646612", "text": "function parallaxTranslate(parallaxValue, el){\n el.style.transform = \"translate3d(0, \" + yScrollPos * parallaxValue + \"px, 0)\" ; \n}", "title": "" }, { "docid": "6b0ba8a7a22af1c9f48b310334cc3748", "score": "0.5643942", "text": "function goSlide(change) { \n let newWidth = change * vw;\n testimonialLetters.style.transform = \"translate(\" + -newWidth + \"px)\";\n}", "title": "" }, { "docid": "9b810af40d6c01bdcaa034ba0abb57d4", "score": "0.56390685", "text": "function setPoint_update(new_value, idName, unit, styleX, min, max){\n \tnew_value=Number(new_value);\n \tmax=Number(max);\n \tmin=Number(min);\n\t\tlog_set_points(\"style:\"+styleX);\n\t\tlog_set_points(\"idName:\"+idName);\n\t\tlog_set_points(\"min:\"+min);\n\t\tlog_set_points(\"max:\"+max);\n \t\tswitch(styleX) {\n\t\t\tcase \"style1\":\n\t\t\t\tlog_set_points(\"upravuji style1\");\n\t\t\t\t\tif (document.getElementById(\"slider_pointer_\"+idName).isEditable!=true) break;\n \t\t\t//startX = $(\"#slider_\"+idName).offset().left;\n \t\t\tstartX = 0;\n \t\t\tlog_set_points(\"startX:\"+startX);\n \t\t\twidthX=$(\"#slider_img_\"+idName).width()-$(\"#slider_pointer_\"+idName).width();\n\t\t\t\t\tlog_set_points(\"widthX:\"+widthX);\n\t\t\t\t\timgX=((new_value-min)/(max-min))*widthX; // spocitani nove X-ove souradnice obrazku posuvniku\n\t\t\t\t\tnewX=startX+imgX;\n\t\t\t\t\tlog_set_points(\"newX:\"+newX);\n\t\t\t\t\t//slider_pointer.style.left = imgX + 'px'; // posunitu posuvniku\n\t\t\t\t\t$(\"#slider_pointer_\"+idName).css({left: newX});\n\t\t\t\t\t$(\"#slider_text_\"+idName).text(new_value+\" \"+unit); // prepsani textu\n\t \t\t\t\tbreak;\n\t\t}\n\t}", "title": "" }, { "docid": "744a25feab77aa81e8279cfd19fa69e8", "score": "0.5620784", "text": "function clickPercent(event) {\n //var pos = (e.pageX - (this.offsetLeft + this.offsetParent.offsetLeft + this.offsetParent.offsetParent.offsetLeft)) / this.offsetWidth;\n var timelineWidth = getTimelineWidth();\n return (event.clientX - getPosition(timeline)) / timelineWidth;\n }", "title": "" }, { "docid": "719da9c8b21314a0ea3932cdc7a6496c", "score": "0.56176776", "text": "_calculateValue(percentage) {\n return this.min + percentage * (this.max - this.min);\n }", "title": "" }, { "docid": "719da9c8b21314a0ea3932cdc7a6496c", "score": "0.56176776", "text": "_calculateValue(percentage) {\n return this.min + percentage * (this.max - this.min);\n }", "title": "" }, { "docid": "09533e4a32d0d184e33270490839349c", "score": "0.5612681", "text": "function calcPointToPercentage ( calcPoint ) {\r\n\t\tvar location = calcPoint - offset(scope_Base, options.ort);\r\n\t\tvar proposal = ( location * 100 ) / baseSize();\r\n\t\treturn options.dir ? 100 - proposal : proposal;\r\n\t}", "title": "" }, { "docid": "3cb44284c446257faac4a03179b11e68", "score": "0.56126183", "text": "scale(val) {\n for (let i = 0; i < ruler.ticks.length; i++) {\n ruler.ticks[i]?.move(i * val * editor$1.zoomX, 0);\n }\n\n this.scaleVal = val;\n playback.caret.cx(playback.position * val);\n }", "title": "" }, { "docid": "e51890cc30156e5238f54f2ffba59513", "score": "0.5612053", "text": "function HomekitPositionToSlideAPI(position) {\n var newPosition = 100 - position\n newPosition = newPosition / 100\n return Math.min(Math.max(newPosition, 0), 1)\n}", "title": "" }, { "docid": "e9676fa88225532fc275f9637ba052fd", "score": "0.5605591", "text": "setProgress(progress){\n var _this =this;\n\n if(_this.element != null){\n\n if(!Array.isArray(_this.element)){\n _this.element.style.transform = _this.transformPrefixString + (_this.from+(_this.to-_this.from) * progress) + _this.transformSuffixString\n }\n else{\n for (var i = 0;i < ((_this.element).length);i++){\n _this.element[i].style.transform = _this.transformPrefixString[i] + (_this.from[i]+(_this.to[i]-_this.from[i]) * progress) + _this.transformSuffixString[i];\n }\n }\n\n }\n }", "title": "" }, { "docid": "84b1a9d75ce04072ad493dede2b8b903", "score": "0.5597729", "text": "function movePosition(self, pos) {\n pos = pos / self.trackWidth * 100;\n self.trackControl.style.left = pos + '%';\n self.trackInner.style.width = pos + '%';\n }", "title": "" }, { "docid": "5369c638062191ed72ff32a3e46f3d4c", "score": "0.5595382", "text": "function UpdateSliderbar1(newvalue){\n //document.getElementById(\"bar\").value = newvalue;\n document.getElementById(\"range1\").innerHTML = newvalue + \"px\";\n}", "title": "" }, { "docid": "4824f95f3be701a36e62f2ba2e9cd0d5", "score": "0.55852485", "text": "function percentage()\n {\n currentInput = currentInput / 100\n displayCurrentInput();\n }", "title": "" }, { "docid": "9ea04f608d2a60d8bcb2aad8bde9ddb5", "score": "0.5584706", "text": "function calcPointToPercentage ( calcPoint ) {\n var location = calcPoint - offset(scope_Base, options.ort);\n var proposal = ( location * 100 ) / baseSize();\n return options.dir ? 100 - proposal : proposal;\n }", "title": "" }, { "docid": "a2ef6477f9fc15918470065b54a997c8", "score": "0.558313", "text": "function sliderPos (v) {\n return bbox.y + sliderOffset(v);\n }", "title": "" }, { "docid": "150e86b8f32d105d6738e330d24c14c6", "score": "0.5580291", "text": "function fromPosition2Percentage(k) {\r\n return k/N;\r\n }", "title": "" }, { "docid": "f081995324e5cbe5fd728139cd55dc90", "score": "0.55798584", "text": "setProgressPercentage(progressPercentage) {\r\n this.progressPercentage = progressPercentage;\r\n this.currentPosition = fromPercentage2Position(progressPercentage);\r\n progressBar.style.width = `${this.progressPercentage * 100}%`;\r\n thumb.style.left = `${this.progressPercentage * 100}%`;\r\n\r\n this.callbacks.map(f => {\r\n f(fromPercentage2Value(this.progressPercentage), this.currentPosition, this.progressPercentage);\r\n });\r\n }", "title": "" }, { "docid": "af366a42c6a42cd7f25bb55b2a230760", "score": "0.55784005", "text": "function seek(x, e) { \n\t\t\t\n\t\t\t// fit inside the slider\t\t\n\t\t\tx = Math.min(Math.max(0, x), len);\t\t\t \n\t\t\t\n\t\t\t// increment in steps\n\t\t\tif (conf.step) {\n\t\t\t\tx = toSteps(x, conf.step, len);\t\n\t\t\t}\n\t\t\t\n\t\t\t// calculate value\t\t\t\n\t\t\tvar v = round(x / len * range + conf.min, conf.decimals);\t\t\n\n\t\t\t// onSlide\n\t\t\te = e || $.Event();\n\t\t\te.type = \"onSlide\";\n\t\t\tfire.trigger(e, [v]); \n\t\t\tif (e.isDefaultPrevented()) { return self; } \n\t\t\t\n\t\t\t\n\t\t\tif (v != value) { \n\t\t\t\t\n\t\t\t\t// move handle & resize progress\n\t\t\t\tvar isClick = e && e.originalEvent && e.originalEvent.type == \"click\",\n\t\t\t\t\t speed = isClick ? conf.speed : 0,\n\t\t\t\t\t callback = isClick ? function() {\n\t\t\t\t\t \te.type = \"change\";\n\t\t\t\t\t \tfire.trigger(e, [v]); \n\t\t\t\t\t } : null;\n\t\t\t\t\n\t\t\t\tif (conf.vertical) {\n\t\t\t\t\thandle.animate({top: -(x - len)}, speed, callback);\n\t\t\t\t\tprogress.animate({height: x}, speed);\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\thandle.animate({left: x}, speed, callback);\n\t\t\t\t\tprogress.animate({width: x}, speed);\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvalue = v; \n\t\t\t\tpos = x;\t\t\t\n\t\t\t\tinput.val(v);\n\t\t\t} \n\t\t\t\n\t\t\treturn self;\n\t\t}", "title": "" }, { "docid": "63f18663f417fd324f702e4faac1a611", "score": "0.5569152", "text": "function calcPointToPercentage ( calcPoint ) {\n\t\tvar location = calcPoint - offset(scope_Base, options.ort);\n\t\tvar proposal = ( location * 100 ) / baseSize();\n\t\treturn options.dir ? 100 - proposal : proposal;\n\t}", "title": "" }, { "docid": "63f18663f417fd324f702e4faac1a611", "score": "0.5569152", "text": "function calcPointToPercentage ( calcPoint ) {\n\t\tvar location = calcPoint - offset(scope_Base, options.ort);\n\t\tvar proposal = ( location * 100 ) / baseSize();\n\t\treturn options.dir ? 100 - proposal : proposal;\n\t}", "title": "" }, { "docid": "63f18663f417fd324f702e4faac1a611", "score": "0.5569152", "text": "function calcPointToPercentage ( calcPoint ) {\n\t\tvar location = calcPoint - offset(scope_Base, options.ort);\n\t\tvar proposal = ( location * 100 ) / baseSize();\n\t\treturn options.dir ? 100 - proposal : proposal;\n\t}", "title": "" }, { "docid": "106d28957b44095e16ea71574f2ac900", "score": "0.55686516", "text": "updateThumbPosition (input) {\n // updating Thumb position logic\n let thumb = input.parentElement.querySelector('.' + this.getProps().cssPrefix + this.getProps().rangeSlidersClass + '-thumb')\n let label = input.parentElement.querySelector('.' + this.getProps().cssPrefix + this.getProps().rangeSlidersClass + '-label')\n let value = input.value\n thumb.style.bottom = value + '%'\n label.style.bottom = value + '%'\n\n // adding current value inside the thumb inner label\n let thumbInnerLabel = thumb.querySelector('.' + this.getProps().cssPrefix + this.getProps().rangeSlidersClass + '-thumb-inner-label')\n thumbInnerLabel.innerHTML = Math.round(value/10)\n }", "title": "" }, { "docid": "2827a2a44a4cf24869db0e6e09016081", "score": "0.55685306", "text": "function pos2value(target, pos){\n\t\tvar state = $.data(target, 'slider');\n\t\tvar opts = state.options;\n\t\tvar slider = state.slider;\n\t\tif (opts.mode == 'h'){\n\t\t\tvar value = opts.min + (opts.max-opts.min)*(pos/slider.width());\n\t\t} else {\n\t\t\tvar value = opts.min + (opts.max-opts.min)*((slider.height()-pos)/slider.height());\n\t\t}\n\t\treturn opts.reversed ? opts.max - value.toFixed(0) : value.toFixed(0);\n\t}", "title": "" }, { "docid": "66b0b2d3622d7dd025f5611d18f637ab", "score": "0.5564175", "text": "function setHandle(handle, to, slider) {\n handle.css(pos, to + '%').data('input').val(percentage.is(settings.range, to).toFixed(res));\n }", "title": "" }, { "docid": "8770a4b7a891c4f322db419538142191", "score": "0.5558959", "text": "function resta(pX,pY){\n\treturn pX-pY;\n}", "title": "" } ]
093a0354bafde94a34f3eccdedacea33
Decode the "FD" prefix (IY instructions).
[ { "docid": "1b79bb95f9d3bdf6d7f2a9f2442095c4", "score": "0.72053105", "text": "function decodeFD(z80) {\n const inst = fetchInstruction(z80);\n const func = decodeMapFD.get(inst);\n if (func === undefined) {\n console.log(\"Unhandled opcode in FD: \" + toHex(inst, 2));\n }\n else {\n func(z80);\n }\n}", "title": "" } ]
[ { "docid": "dd27446bc8942d5b8f75eb8f25f94440", "score": "0.721388", "text": "function decodeFD(z80) {\n const inst = fetchInstruction(z80);\n const func = decodeMapFD.get(inst);\n if (func === undefined) {\n console.log(\"Unhandled opcode in FD: \" + toHex(inst, 2));\n }\n else {\n func(z80);\n }\n }", "title": "" }, { "docid": "74018d75e4c580ad8d8da224e4864b07", "score": "0.62479645", "text": "function tinf_decode_symbol$1(d, t) {\n while(d.bitcount < 24){\n d.tag |= d.source[d.sourceIndex++] << d.bitcount;\n d.bitcount += 8;\n }\n var sum = 0, cur = 0, len11 = 0;\n var tag = d.tag;\n /* get more bits while code value is above sum */ do {\n cur = 2 * cur + (tag & 1);\n tag >>>= 1;\n ++len11;\n sum += t.table[len11];\n cur -= t.table[len11];\n }while (cur >= 0)\n d.tag = tag;\n d.bitcount -= len11;\n return t.trans[sum + cur];\n}", "title": "" }, { "docid": "0307846424a101690281cc4a4fcb2645", "score": "0.6056832", "text": "function tinf_decode_symbol(d, t) {\n\t while (d.bitcount < 24) {\n\t d.tag |= d.source[d.sourceIndex++] << d.bitcount;\n\t d.bitcount += 8;\n\t }\n\t \n\t var sum = 0, cur = 0, len = 0;\n\t var tag = d.tag;\n\n\t /* get more bits while code value is above sum */\n\t do {\n\t cur = 2 * cur + (tag & 1);\n\t tag >>>= 1;\n\t ++len;\n\n\t sum += t.table[len];\n\t cur -= t.table[len];\n\t } while (cur >= 0);\n\t \n\t d.tag = tag;\n\t d.bitcount -= len;\n\n\t return t.trans[sum + cur];\n\t}", "title": "" }, { "docid": "545b974a3072f875d036f6b20f6e597e", "score": "0.6056074", "text": "function decodeDD(z80) {\n const inst = fetchInstruction(z80);\n const func = decodeMapDD.get(inst);\n if (func === undefined) {\n console.log(\"Unhandled opcode in DD: \" + toHex(inst, 2));\n }\n else {\n func(z80);\n }\n}", "title": "" }, { "docid": "182c1d362580225fda37ed6f6dd2dce8", "score": "0.6052674", "text": "function decodeDD(z80) {\n const inst = fetchInstruction(z80);\n const func = decodeMapDD.get(inst);\n if (func === undefined) {\n console.log(\"Unhandled opcode in DD: \" + toHex(inst, 2));\n }\n else {\n func(z80);\n }\n }", "title": "" }, { "docid": "b230357dcf9395fbdb180f1ef43abe49", "score": "0.6030594", "text": "function tinf_decode_symbol(d, t) {\n while(d.bitcount < 24){\n d.tag |= d.source[d.sourceIndex++] << d.bitcount;\n d.bitcount += 8;\n }\n var sum = 0, cur = 0, len11 = 0;\n var tag = d.tag;\n /* get more bits while code value is above sum */ do {\n cur = 2 * cur + (tag & 1);\n tag >>>= 1;\n ++len11;\n sum += t.table[len11];\n cur -= t.table[len11];\n }while (cur >= 0)\n d.tag = tag;\n d.bitcount -= len11;\n return t.trans[sum + cur];\n}", "title": "" }, { "docid": "07648a85063cd37541df7dc3b5baa5cc", "score": "0.6015968", "text": "function tinf_decode_symbol(d, t) {\n while (d.bitcount < 24) {\n d.tag |= d.source[d.sourceIndex++] << d.bitcount;\n d.bitcount += 8;\n }\n\n var sum = 0,\n cur = 0,\n len = 0;\n var tag = d.tag;\n /* get more bits while code value is above sum */\n\n do {\n cur = 2 * cur + (tag & 1);\n tag >>>= 1;\n ++len;\n sum += t.table[len];\n cur -= t.table[len];\n } while (cur >= 0);\n\n d.tag = tag;\n d.bitcount -= len;\n return t.trans[sum + cur];\n }", "title": "" }, { "docid": "cf7a1e39146f00c86a2769c288617bd7", "score": "0.59899604", "text": "function tinf_decode_symbol(d, t) {\n while (d.bitcount < 24) {\n d.tag |= d.source[d.sourceIndex++] << d.bitcount;\n d.bitcount += 8;\n }\n \n var sum = 0, cur = 0, len = 0;\n var tag = d.tag;\n\n /* get more bits while code value is above sum */\n do {\n cur = 2 * cur + (tag & 1);\n tag >>>= 1;\n ++len;\n\n sum += t.table[len];\n cur -= t.table[len];\n } while (cur >= 0);\n \n d.tag = tag;\n d.bitcount -= len;\n\n return t.trans[sum + cur];\n }", "title": "" }, { "docid": "7c4d2bf1a5e48bf84cb43e3f5868f758", "score": "0.5979365", "text": "function tinf_decode_symbol(d, t) {\n while (d.bitcount < 24) {\n d.tag |= d.source[d.sourceIndex++] << d.bitcount;\n d.bitcount += 8;\n }\n \n var sum = 0, cur = 0, len = 0;\n var tag = d.tag;\n\n /* get more bits while code value is above sum */\n do {\n cur = 2 * cur + (tag & 1);\n tag >>>= 1;\n ++len;\n\n sum += t.table[len];\n cur -= t.table[len];\n } while (cur >= 0);\n \n d.tag = tag;\n d.bitcount -= len;\n\n return t.trans[sum + cur];\n}", "title": "" }, { "docid": "7c4d2bf1a5e48bf84cb43e3f5868f758", "score": "0.5979365", "text": "function tinf_decode_symbol(d, t) {\n while (d.bitcount < 24) {\n d.tag |= d.source[d.sourceIndex++] << d.bitcount;\n d.bitcount += 8;\n }\n \n var sum = 0, cur = 0, len = 0;\n var tag = d.tag;\n\n /* get more bits while code value is above sum */\n do {\n cur = 2 * cur + (tag & 1);\n tag >>>= 1;\n ++len;\n\n sum += t.table[len];\n cur -= t.table[len];\n } while (cur >= 0);\n \n d.tag = tag;\n d.bitcount -= len;\n\n return t.trans[sum + cur];\n}", "title": "" }, { "docid": "7c4d2bf1a5e48bf84cb43e3f5868f758", "score": "0.5979365", "text": "function tinf_decode_symbol(d, t) {\n while (d.bitcount < 24) {\n d.tag |= d.source[d.sourceIndex++] << d.bitcount;\n d.bitcount += 8;\n }\n \n var sum = 0, cur = 0, len = 0;\n var tag = d.tag;\n\n /* get more bits while code value is above sum */\n do {\n cur = 2 * cur + (tag & 1);\n tag >>>= 1;\n ++len;\n\n sum += t.table[len];\n cur -= t.table[len];\n } while (cur >= 0);\n \n d.tag = tag;\n d.bitcount -= len;\n\n return t.trans[sum + cur];\n}", "title": "" }, { "docid": "7c4d2bf1a5e48bf84cb43e3f5868f758", "score": "0.5979365", "text": "function tinf_decode_symbol(d, t) {\n while (d.bitcount < 24) {\n d.tag |= d.source[d.sourceIndex++] << d.bitcount;\n d.bitcount += 8;\n }\n \n var sum = 0, cur = 0, len = 0;\n var tag = d.tag;\n\n /* get more bits while code value is above sum */\n do {\n cur = 2 * cur + (tag & 1);\n tag >>>= 1;\n ++len;\n\n sum += t.table[len];\n cur -= t.table[len];\n } while (cur >= 0);\n \n d.tag = tag;\n d.bitcount -= len;\n\n return t.trans[sum + cur];\n}", "title": "" }, { "docid": "7c4d2bf1a5e48bf84cb43e3f5868f758", "score": "0.5979365", "text": "function tinf_decode_symbol(d, t) {\n while (d.bitcount < 24) {\n d.tag |= d.source[d.sourceIndex++] << d.bitcount;\n d.bitcount += 8;\n }\n \n var sum = 0, cur = 0, len = 0;\n var tag = d.tag;\n\n /* get more bits while code value is above sum */\n do {\n cur = 2 * cur + (tag & 1);\n tag >>>= 1;\n ++len;\n\n sum += t.table[len];\n cur -= t.table[len];\n } while (cur >= 0);\n \n d.tag = tag;\n d.bitcount -= len;\n\n return t.trans[sum + cur];\n}", "title": "" }, { "docid": "8f8035b1a7199f9a35a1eec2471f8493", "score": "0.5846888", "text": "function $c629a57505f8e824c7a91df958$var$tinf_decode_symbol(d, t) {\n while (d.bitcount < 24) {\n d.tag |= d.source[d.sourceIndex++] << d.bitcount;\n d.bitcount += 8;\n }\n\n var sum = 0,\n cur = 0,\n len = 0;\n var tag = d.tag;\n /* get more bits while code value is above sum */\n\n do {\n cur = 2 * cur + (tag & 1);\n tag >>>= 1;\n ++len;\n sum += t.table[len];\n cur -= t.table[len];\n } while (cur >= 0);\n\n d.tag = tag;\n d.bitcount -= len;\n return t.trans[sum + cur];\n }", "title": "" }, { "docid": "78922654f59ad8a80d92e9c8638cdf9a", "score": "0.5796672", "text": "function decodeED(z80) {\n const inst = fetchInstruction(z80);\n const func = decodeMapED.get(inst);\n if (func === undefined) {\n console.log(\"Unhandled opcode in ED: \" + toHex(inst, 2));\n }\n else {\n func(z80);\n }\n}", "title": "" }, { "docid": "323816996f5a333bc37e695c3e6f322d", "score": "0.579624", "text": "function decodeED(z80) {\n const inst = fetchInstruction(z80);\n const func = decodeMapED.get(inst);\n if (func === undefined) {\n console.log(\"Unhandled opcode in ED: \" + toHex(inst, 2));\n }\n else {\n func(z80);\n }\n }", "title": "" }, { "docid": "2190e680a0192fcdd9f9b663287f04d9", "score": "0.55947906", "text": "function decodeFDCB(z80) {\n z80.incTStateCount(3);\n const offset = z80.readByteInternal(z80.regs.pc);\n z80.regs.memptr = add16(z80.regs.iy, signedByte(offset));\n z80.regs.pc = inc16(z80.regs.pc);\n z80.incTStateCount(3);\n const inst = z80.readByteInternal(z80.regs.pc);\n z80.incTStateCount(2);\n z80.regs.pc = inc16(z80.regs.pc);\n const func = decodeMapFDCB.get(inst);\n if (func === undefined) {\n console.log(\"Unhandled opcode in FDCB: \" + toHex(inst, 2));\n }\n else {\n func(z80);\n }\n }", "title": "" }, { "docid": "4d82c70899415bcf8633326a427c633f", "score": "0.55942804", "text": "function decodeFDCB(z80) {\n z80.incTStateCount(3);\n const offset = z80.readByteInternal(z80.regs.pc);\n z80.regs.memptr = add16(z80.regs.iy, signedByte(offset));\n z80.regs.pc = inc16(z80.regs.pc);\n z80.incTStateCount(3);\n const inst = z80.readByteInternal(z80.regs.pc);\n z80.incTStateCount(2);\n z80.regs.pc = inc16(z80.regs.pc);\n const func = decodeMapFDCB.get(inst);\n if (func === undefined) {\n console.log(\"Unhandled opcode in FDCB: \" + toHex(inst, 2));\n }\n else {\n func(z80);\n }\n}", "title": "" }, { "docid": "2570982d47f28d71aa3ba89f4c9b272e", "score": "0.5543956", "text": "function decode(z80) {\n const inst = fetchInstruction(z80);\n const func = decodeMap.get(inst);\n if (func === undefined) {\n console.log(\"Unhandled opcode \" + toHex(inst, 2));\n }\n else {\n func(z80);\n }\n }", "title": "" }, { "docid": "d5227b3fbba676a9952b3735d406b60d", "score": "0.5541225", "text": "function decode(z80) {\n const inst = fetchInstruction(z80);\n const func = decodeMap.get(inst);\n if (func === undefined) {\n console.log(\"Unhandled opcode \" + toHex(inst, 2));\n }\n else {\n func(z80);\n }\n}", "title": "" }, { "docid": "45b3c77da2907346638fc541779c611b", "score": "0.54045385", "text": "decodeInstruction(ri){\n // Extract instruction code\n let code = ri & 240;\n let mnem = this.decodingTable[code];\n\n if (mnem === undefined) {\n return this.decodingTable[256];\n } else {\n return mnem\n }\n }", "title": "" }, { "docid": "2525b70f06a4499ac64276e69dc800ad", "score": "0.5305617", "text": "function Fixed8Parser(item) {\r\n return u_1.Fixed8.fromReverseHex(item.value);\r\n}", "title": "" }, { "docid": "3d27eabba86b751ba998ef85801a1500", "score": "0.5297392", "text": "function decode(id) {\n\t var alphabet = characters();\n\t return {\n\t version: alphabet.indexOf(id.substr(0, 1)) & 0x0f,\n\t worker: alphabet.indexOf(id.substr(1, 1)) & 0x0f\n\t };\n\t}", "title": "" }, { "docid": "112787b88dc8acb12fcff8adaee8d8be", "score": "0.52742374", "text": "function decode(id) {\n var alphabet = characters();\n return {\n version: alphabet.indexOf(id.substr(0, 1)) & 0x0f\n };\n }", "title": "" }, { "docid": "6918c89966c780accedf5a76b6006dbe", "score": "0.5259891", "text": "function decode(str, keepSlashes) {\n if (isEncoded) {\n str = str.replace(/\\uFEFF[0-9]/g, function (str) {\n return encodingLookup[str];\n });\n }\n\n if (!keepSlashes) {\n str = str.replace(/\\\\([\\'\\\";:])/g, \"$1\");\n }\n\n return str;\n }", "title": "" }, { "docid": "5d3caab5cb886df0e5f1aa7a5d7688b3", "score": "0.5185616", "text": "function XUserDefinedDecoder(options) {\n\t var fatal = options.fatal;\n\t /**\n\t * @param {Stream} stream The stream of bytes being decoded.\n\t * @param {number} bite The next byte read from the stream.\n\t * @return {?(number|!Array.<number>)} The next code point(s)\n\t * decoded, or null if not enough data exists in the input\n\t * stream to decode a complete code point.\n\t */\n\t this.handler = function(stream, bite) {\n\t // 1. If byte is end-of-stream, return finished.\n\t if (bite === end_of_stream)\n\t return finished;\n\t\n\t // 2. If byte is an ASCII byte, return a code point whose value\n\t // is byte.\n\t if (isASCIIByte(bite))\n\t return bite;\n\t\n\t // 3. Return a code point whose value is 0xF780 + byte − 0x80.\n\t return 0xF780 + bite - 0x80;\n\t };\n\t }", "title": "" }, { "docid": "32706488f38874b707845fa4b9504db6", "score": "0.5177652", "text": "function SourceMappingDecoder() {// s:l:f:j\n}", "title": "" }, { "docid": "b4220d96dd54025080ba8c578c1179f3", "score": "0.5155091", "text": "function decode(str) {\n if (str.length < 8) {\n throw new TypeError(str + ' too short');\n }\n // don't allow mixed case\n const lowered = str.toLowerCase();\n const uppered = str.toUpperCase();\n if (str !== lowered && str !== uppered) {\n throw new Error('Mixed-case string ' + str);\n }\n str = lowered;\n const split = str.lastIndexOf('1');\n if (split === -1) {\n throw new Error('No separator character for ' + str);\n }\n if (split === 0) {\n throw new Error('Missing prefix for ' + str);\n }\n const prefix = str.slice(0, split);\n const wordChars = str.slice(split + 1);\n if (wordChars.length < 6) {\n throw new Error('Data too short');\n }\n let chk = prefixChk(prefix);\n const words = [];\n for (let i = 0; i < wordChars.length; ++i) {\n const c = wordChars.charAt(i);\n const v = ALPHABET_MAP.get(c);\n if (v === undefined) {\n throw new Error('Unknown character ' + c);\n }\n chk = polymodStep(chk) ^ v;\n // not in the checksum?\n if (i + 6 >= wordChars.length) {\n continue;\n }\n words.push(v);\n }\n // ok, can be 1 (bech32) or 0x2bc830a3 (bech32m)\n if (chk !== 1) {\n if (chk !== BECH32M_CONST) {\n throw new Error('Invalid checksum for ' + str);\n }\n }\n return { prefix, words, chk };\n}", "title": "" }, { "docid": "1f0c6fb3ce80496b271a84ac64440bc2", "score": "0.51339155", "text": "function decode(string){\n\n}", "title": "" }, { "docid": "a2482a28a3fe946d50c1ecd4825ef657", "score": "0.51286614", "text": "function decode({ buffer, end_index }) {\n\tconst result = [];\n\tif (buffer.length % 2 !== 0) {\n\t\tconsole.log('length is not even. Invalid JISx0208', buffer, buffer.length)\n\t\tconsole.log(s)\n\t}\n\n\tfor (let i=0; i<buffer.length; i+=2) {\n\t\t//if (buffer[i] == 0x00) {\n\t\t//\t{ code, skip } = parse_control(buffer, i);\n\t\t//\ti += skip;\n\t\t//}\n\t\tconst mb = (buffer[i] << 8) | buffer[i+1];\n\t\tconst byte = decode_table[mb];\n\t\tresult.push(byte)\n\t}\n\treturn { result: String.fromCodePoint(...result), end_index };\n}", "title": "" }, { "docid": "f7d75a6b23b8f748cc6b92721b3970bf", "score": "0.5107527", "text": "function flagDecode( flags ) {\n switch( flags & 3 ) {\n // case 0b00000000000000001000000000000000: return 'r';\n // case 0b00000000000000001000000000000010: return 'r+';\n // case 0b00000000000000001001000000000000: return 'rs';\n // case 0b00000000000000001001000000000010: return 'rs+';\n // case 0b00000000000000001000000000000001: return 'w';\n // case 0b00000000000000001000000000000010: return 'w+';\n // case 0b00000000000000001000010000000001: return 'a';\n // case 0b00000000000000001000010000000010: return 'a+';\n case 0: return 'r';\n case 1: return 'w';\n default: return 'r+';\n }\n}", "title": "" }, { "docid": "0aa6e910532eb5ab5c903fd9d2b6fc00", "score": "0.5082551", "text": "function full_char_code_at(str, i) {\n\t \t const code = str.charCodeAt(i);\n\t \t if (code <= 0xd7ff || code >= 0xe000)\n\t \t return code;\n\t \t const next = str.charCodeAt(i + 1);\n\t \t return (code << 10) + next - 0x35fdc00;\n\t \t}", "title": "" }, { "docid": "aa26a6edc3aa704e87203fe9ceb92e5c", "score": "0.5080156", "text": "function _hexDecode(data) {\n var j\n , hexes = data.match(/.{1,4}/g) || []\n , back = \"\"\n ;\n\n for (j = 0; j < hexes.length; j++) {\n back += String.fromCharCode(parseInt(hexes[j], 16));\n }\n\n return back;\n }", "title": "" }, { "docid": "d8e68ae8f16761503e989bb63da73519", "score": "0.5075998", "text": "function decodeDDCB(z80) {\n z80.incTStateCount(3);\n const offset = z80.readByteInternal(z80.regs.pc);\n z80.regs.memptr = add16(z80.regs.ix, signedByte(offset));\n z80.regs.pc = inc16(z80.regs.pc);\n z80.incTStateCount(3);\n const inst = z80.readByteInternal(z80.regs.pc);\n z80.incTStateCount(2);\n z80.regs.pc = inc16(z80.regs.pc);\n const func = decodeMapDDCB.get(inst);\n if (func === undefined) {\n console.log(\"Unhandled opcode in DDCB: \" + toHex(inst, 2));\n }\n else {\n func(z80);\n }\n }", "title": "" }, { "docid": "37ae947f3dde6c97335f0875bac025f6", "score": "0.5074684", "text": "function decode()\n{\n\tget_ui_vals();\t\t\t\t// Update the content of all user interface related variables\n\tclear_dec_items();\t\t\t// Clears all the the decoder items and its content\n\n\tsigArr = new Array();\n\n\tif (decode_manchester() != true)\n\t{\n\t\treturn false;\n\t}\n\n\twhile (sigArr.length > 0)\t// Dsiplay all\n\t{\n\t\tvar sigObject = sigArr.shift();\n\n\t\tif (sigObject.type == SIGOBJECT_TYPE.ONE_T)\n\t\t{\n\t\t\tvar tempObject = sigArr.shift();\n\n\t\t\tif (tempObject.type != SIGOBJECT_TYPE.ONE_T)\n\t\t\t{\n\t\t\t\tsigArr.unshift(tempObject);\n\t\t\t}\n\t\t}\n\t\telse if (sigObject.type == SIGOBJECT_TYPE.TWO_T)\n\t\t{\n\t\t\tvar tempObject = sigArr.shift();\n\n\t\t\tif (tempObject.type != SIGOBJECT_TYPE.ONE_T)\n\t\t\t{\n\t\t\t\tsigArr.unshift(tempObject);\n\t\t\t}\n\t\t}\n\n\t\tif (sigObject.type != SIGOBJECT_TYPE.UNKNOWN)\n\t\t{\n\t\t\tdec_item_new(chD, sigObject.end - (oneT / 2), sigObject.end + (oneT / 2));\n\t\t\t\n\t\t\tif (uiLogic1Conv == 0)\n\t\t\t{\n\t\t\t\tdec_item_add_post_text(sigObject.value ? 0 : 1);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdec_item_add_post_text(sigObject.value);\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "9554fc386483cfbf26d90dfaf2b6b2f8", "score": "0.50647014", "text": "function decodeDDCB(z80) {\n z80.incTStateCount(3);\n const offset = z80.readByteInternal(z80.regs.pc);\n z80.regs.memptr = add16(z80.regs.ix, signedByte(offset));\n z80.regs.pc = inc16(z80.regs.pc);\n z80.incTStateCount(3);\n const inst = z80.readByteInternal(z80.regs.pc);\n z80.incTStateCount(2);\n z80.regs.pc = inc16(z80.regs.pc);\n const func = decodeMapDDCB.get(inst);\n if (func === undefined) {\n console.log(\"Unhandled opcode in DDCB: \" + toHex(inst, 2));\n }\n else {\n func(z80);\n }\n}", "title": "" }, { "docid": "fef78d469b1bbaffe7e63ccea0a58c17", "score": "0.50233287", "text": "decode( string ) {\n\n // Decode the given string.\n return he.decode(string);\n\n }", "title": "" }, { "docid": "45f952e9f62aa8578f4455e8a9132b19", "score": "0.50225985", "text": "static decodeKey(key) {\n return key.replace(/uff0e/g, \".\").replace(/uff04/g, \"\\$\").replace(/uff3c/g, \"\\\\\")\n }", "title": "" }, { "docid": "c76efae1dfeb450ad8e8d704f8282cf5", "score": "0.5022143", "text": "function funDecode(str = 'L1') {\n let arr = str.replace(/(\\D\\d*)/g, '$1 ').trim().split(' '), res = '';\n for (let code of arr) {\n let data = code.split(''),\n type = data.shift(),\n num = parseInt(data.join(''));\n switch (type) {\n case 'S':\n res += ' ';\n break;\n case 'U':\n res += String.fromCharCode(num + config.asciiUpper);\n break;\n case 'L':\n res += String.fromCharCode(num + config.asciiLower);\n break;\n default:\n break;\n }\n }\n return res;\n}", "title": "" }, { "docid": "233351f994ad79683e0f6122ef867324", "score": "0.5014941", "text": "function parseCFFEncoding(data, start, charset) {\n var code;\n var enc = {};\n var parser = new parse.Parser(data, start);\n var format = parser.parseCard8();\n\n if (format === 0) {\n var nCodes = parser.parseCard8();\n\n for (var i = 0; i < nCodes; i += 1) {\n code = parser.parseCard8();\n enc[code] = i;\n }\n } else if (format === 1) {\n var nRanges = parser.parseCard8();\n code = 1;\n\n for (var i$1 = 0; i$1 < nRanges; i$1 += 1) {\n var first = parser.parseCard8();\n var nLeft = parser.parseCard8();\n\n for (var j = first; j <= first + nLeft; j += 1) {\n enc[j] = code;\n code += 1;\n }\n }\n } else {\n throw new Error('Unknown encoding format ' + format);\n }\n\n return new CffEncoding(enc, charset);\n } // Take in charstring code and return a Glyph object.", "title": "" }, { "docid": "197f6f91b3e8ac261484e67b21e381c2", "score": "0.5014322", "text": "function parseCFFEncoding(data, start, charset) {\n\t var i;\n\t var code;\n\t var enc = {};\n\t var parser = new parse.Parser(data, start);\n\t var format = parser.parseCard8();\n\t if (format === 0) {\n\t var nCodes = parser.parseCard8();\n\t for (i = 0; i < nCodes; i += 1) {\n\t code = parser.parseCard8();\n\t enc[code] = i;\n\t }\n\t } else if (format === 1) {\n\t var nRanges = parser.parseCard8();\n\t code = 1;\n\t for (i = 0; i < nRanges; i += 1) {\n\t var first = parser.parseCard8();\n\t var nLeft = parser.parseCard8();\n\t for (var j = first; j <= first + nLeft; j += 1) {\n\t enc[j] = code;\n\t code += 1;\n\t }\n\t }\n\t } else {\n\t throw new Error('Unknown encoding format ' + format);\n\t }\n\n\t return new encoding.CffEncoding(enc, charset);\n\t}", "title": "" }, { "docid": "89ebc0eae73d8d258b7ba12b5148302f", "score": "0.49958012", "text": "function decode(str, keep_slashes) {\n\t\t\t\t\tif (isEncoded) {\n\t\t\t\t\t\tstr = str.replace(/\\uFEFF[0-9]/g, function(str) {\n\t\t\t\t\t\t\treturn encodingLookup[str];\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!keep_slashes) {\n\t\t\t\t\t\tstr = str.replace(/\\\\([\\'\\\";:])/g, \"$1\");\n\t\t\t\t\t}\n\n\t\t\t\t\treturn str;\n\t\t\t\t}", "title": "" }, { "docid": "89ebc0eae73d8d258b7ba12b5148302f", "score": "0.49958012", "text": "function decode(str, keep_slashes) {\n\t\t\t\t\tif (isEncoded) {\n\t\t\t\t\t\tstr = str.replace(/\\uFEFF[0-9]/g, function(str) {\n\t\t\t\t\t\t\treturn encodingLookup[str];\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!keep_slashes) {\n\t\t\t\t\t\tstr = str.replace(/\\\\([\\'\\\";:])/g, \"$1\");\n\t\t\t\t\t}\n\n\t\t\t\t\treturn str;\n\t\t\t\t}", "title": "" }, { "docid": "89ebc0eae73d8d258b7ba12b5148302f", "score": "0.49958012", "text": "function decode(str, keep_slashes) {\n\t\t\t\t\tif (isEncoded) {\n\t\t\t\t\t\tstr = str.replace(/\\uFEFF[0-9]/g, function(str) {\n\t\t\t\t\t\t\treturn encodingLookup[str];\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!keep_slashes) {\n\t\t\t\t\t\tstr = str.replace(/\\\\([\\'\\\";:])/g, \"$1\");\n\t\t\t\t\t}\n\n\t\t\t\t\treturn str;\n\t\t\t\t}", "title": "" }, { "docid": "89ebc0eae73d8d258b7ba12b5148302f", "score": "0.49958012", "text": "function decode(str, keep_slashes) {\n\t\t\t\t\tif (isEncoded) {\n\t\t\t\t\t\tstr = str.replace(/\\uFEFF[0-9]/g, function(str) {\n\t\t\t\t\t\t\treturn encodingLookup[str];\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!keep_slashes) {\n\t\t\t\t\t\tstr = str.replace(/\\\\([\\'\\\";:])/g, \"$1\");\n\t\t\t\t\t}\n\n\t\t\t\t\treturn str;\n\t\t\t\t}", "title": "" }, { "docid": "89ebc0eae73d8d258b7ba12b5148302f", "score": "0.49958012", "text": "function decode(str, keep_slashes) {\n\t\t\t\t\tif (isEncoded) {\n\t\t\t\t\t\tstr = str.replace(/\\uFEFF[0-9]/g, function(str) {\n\t\t\t\t\t\t\treturn encodingLookup[str];\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!keep_slashes) {\n\t\t\t\t\t\tstr = str.replace(/\\\\([\\'\\\";:])/g, \"$1\");\n\t\t\t\t\t}\n\n\t\t\t\t\treturn str;\n\t\t\t\t}", "title": "" }, { "docid": "89ebc0eae73d8d258b7ba12b5148302f", "score": "0.49958012", "text": "function decode(str, keep_slashes) {\n\t\t\t\t\tif (isEncoded) {\n\t\t\t\t\t\tstr = str.replace(/\\uFEFF[0-9]/g, function(str) {\n\t\t\t\t\t\t\treturn encodingLookup[str];\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!keep_slashes) {\n\t\t\t\t\t\tstr = str.replace(/\\\\([\\'\\\";:])/g, \"$1\");\n\t\t\t\t\t}\n\n\t\t\t\t\treturn str;\n\t\t\t\t}", "title": "" }, { "docid": "89ebc0eae73d8d258b7ba12b5148302f", "score": "0.49958012", "text": "function decode(str, keep_slashes) {\n\t\t\t\t\tif (isEncoded) {\n\t\t\t\t\t\tstr = str.replace(/\\uFEFF[0-9]/g, function(str) {\n\t\t\t\t\t\t\treturn encodingLookup[str];\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!keep_slashes) {\n\t\t\t\t\t\tstr = str.replace(/\\\\([\\'\\\";:])/g, \"$1\");\n\t\t\t\t\t}\n\n\t\t\t\t\treturn str;\n\t\t\t\t}", "title": "" }, { "docid": "a1e8799780735b8acc5d0b5853919da0", "score": "0.49940798", "text": "function decode(id) {\n\t var characters = alphabet.shuffled();\n\t return {\n\t version: characters.indexOf(id.substr(0, 1)) & 0x0f,\n\t worker: characters.indexOf(id.substr(1, 1)) & 0x0f\n\t };\n\t}", "title": "" }, { "docid": "d9f13a85abdafea1f27326cea372119c", "score": "0.4979303", "text": "function parseCFFEncoding(data, start, charset) {\n\t var code;\n\t var enc = {};\n\t var parser = new parse.Parser(data, start);\n\t var format = parser.parseCard8();\n\t if (format === 0) {\n\t var nCodes = parser.parseCard8();\n\t for (var i = 0; i < nCodes; i += 1) {\n\t code = parser.parseCard8();\n\t enc[code] = i;\n\t }\n\t } else if (format === 1) {\n\t var nRanges = parser.parseCard8();\n\t code = 1;\n\t for (var i$1 = 0; i$1 < nRanges; i$1 += 1) {\n\t var first = parser.parseCard8();\n\t var nLeft = parser.parseCard8();\n\t for (var j = first; j <= first + nLeft; j += 1) {\n\t enc[j] = code;\n\t code += 1;\n\t }\n\t }\n\t } else {\n\t throw new Error('Unknown encoding format ' + format);\n\t }\n\n\t return new CffEncoding(enc, charset);\n\t}", "title": "" }, { "docid": "5f91964c1dbdd1712d0e4daaee91ea26", "score": "0.49787545", "text": "function decode(input) {\n return exports.decoder.decode(input);\n }", "title": "" }, { "docid": "7a494fcc3e189c2479110192b97e73e4", "score": "0.49457464", "text": "function h$_hs_text_decode_latin1(dest_d, src_d, src_o, srcend_d, srcend_o) {\n var p = src_o;\n var d = 0;\n var su8 = src_d.u8;\n var su3 = src_d.u3;\n var du1 = dest_d.u1;\n // consume unaligned prefix\n while(p != srcend_o && p & 3) {\n du1[d++] = su8[p++];\n }\n // iterate over 32-bit aligned loads\n if(su3) {\n while (p < srcend_o - 3) {\n var w = su3[p>>2];\n du1[d++] = w & 0xff;\n du1[d++] = (w >>> 8) & 0xff;\n du1[d++] = (w >>> 16) & 0xff;\n du1[d++] = (w >>> 32) & 0xff;\n p += 4;\n }\n }\n // handle unaligned suffix\n while (p != srcend_o)\n du1[d++] = su8[p++];\n}", "title": "" }, { "docid": "7a494fcc3e189c2479110192b97e73e4", "score": "0.49457464", "text": "function h$_hs_text_decode_latin1(dest_d, src_d, src_o, srcend_d, srcend_o) {\n var p = src_o;\n var d = 0;\n var su8 = src_d.u8;\n var su3 = src_d.u3;\n var du1 = dest_d.u1;\n // consume unaligned prefix\n while(p != srcend_o && p & 3) {\n du1[d++] = su8[p++];\n }\n // iterate over 32-bit aligned loads\n if(su3) {\n while (p < srcend_o - 3) {\n var w = su3[p>>2];\n du1[d++] = w & 0xff;\n du1[d++] = (w >>> 8) & 0xff;\n du1[d++] = (w >>> 16) & 0xff;\n du1[d++] = (w >>> 32) & 0xff;\n p += 4;\n }\n }\n // handle unaligned suffix\n while (p != srcend_o)\n du1[d++] = su8[p++];\n}", "title": "" }, { "docid": "7a494fcc3e189c2479110192b97e73e4", "score": "0.49457464", "text": "function h$_hs_text_decode_latin1(dest_d, src_d, src_o, srcend_d, srcend_o) {\n var p = src_o;\n var d = 0;\n var su8 = src_d.u8;\n var su3 = src_d.u3;\n var du1 = dest_d.u1;\n // consume unaligned prefix\n while(p != srcend_o && p & 3) {\n du1[d++] = su8[p++];\n }\n // iterate over 32-bit aligned loads\n if(su3) {\n while (p < srcend_o - 3) {\n var w = su3[p>>2];\n du1[d++] = w & 0xff;\n du1[d++] = (w >>> 8) & 0xff;\n du1[d++] = (w >>> 16) & 0xff;\n du1[d++] = (w >>> 32) & 0xff;\n p += 4;\n }\n }\n // handle unaligned suffix\n while (p != srcend_o)\n du1[d++] = su8[p++];\n}", "title": "" }, { "docid": "7a494fcc3e189c2479110192b97e73e4", "score": "0.49457464", "text": "function h$_hs_text_decode_latin1(dest_d, src_d, src_o, srcend_d, srcend_o) {\n var p = src_o;\n var d = 0;\n var su8 = src_d.u8;\n var su3 = src_d.u3;\n var du1 = dest_d.u1;\n // consume unaligned prefix\n while(p != srcend_o && p & 3) {\n du1[d++] = su8[p++];\n }\n // iterate over 32-bit aligned loads\n if(su3) {\n while (p < srcend_o - 3) {\n var w = su3[p>>2];\n du1[d++] = w & 0xff;\n du1[d++] = (w >>> 8) & 0xff;\n du1[d++] = (w >>> 16) & 0xff;\n du1[d++] = (w >>> 32) & 0xff;\n p += 4;\n }\n }\n // handle unaligned suffix\n while (p != srcend_o)\n du1[d++] = su8[p++];\n}", "title": "" }, { "docid": "7a494fcc3e189c2479110192b97e73e4", "score": "0.49457464", "text": "function h$_hs_text_decode_latin1(dest_d, src_d, src_o, srcend_d, srcend_o) {\n var p = src_o;\n var d = 0;\n var su8 = src_d.u8;\n var su3 = src_d.u3;\n var du1 = dest_d.u1;\n // consume unaligned prefix\n while(p != srcend_o && p & 3) {\n du1[d++] = su8[p++];\n }\n // iterate over 32-bit aligned loads\n if(su3) {\n while (p < srcend_o - 3) {\n var w = su3[p>>2];\n du1[d++] = w & 0xff;\n du1[d++] = (w >>> 8) & 0xff;\n du1[d++] = (w >>> 16) & 0xff;\n du1[d++] = (w >>> 32) & 0xff;\n p += 4;\n }\n }\n // handle unaligned suffix\n while (p != srcend_o)\n du1[d++] = su8[p++];\n}", "title": "" }, { "docid": "7a494fcc3e189c2479110192b97e73e4", "score": "0.49457464", "text": "function h$_hs_text_decode_latin1(dest_d, src_d, src_o, srcend_d, srcend_o) {\n var p = src_o;\n var d = 0;\n var su8 = src_d.u8;\n var su3 = src_d.u3;\n var du1 = dest_d.u1;\n // consume unaligned prefix\n while(p != srcend_o && p & 3) {\n du1[d++] = su8[p++];\n }\n // iterate over 32-bit aligned loads\n if(su3) {\n while (p < srcend_o - 3) {\n var w = su3[p>>2];\n du1[d++] = w & 0xff;\n du1[d++] = (w >>> 8) & 0xff;\n du1[d++] = (w >>> 16) & 0xff;\n du1[d++] = (w >>> 32) & 0xff;\n p += 4;\n }\n }\n // handle unaligned suffix\n while (p != srcend_o)\n du1[d++] = su8[p++];\n}", "title": "" }, { "docid": "7a494fcc3e189c2479110192b97e73e4", "score": "0.49457464", "text": "function h$_hs_text_decode_latin1(dest_d, src_d, src_o, srcend_d, srcend_o) {\n var p = src_o;\n var d = 0;\n var su8 = src_d.u8;\n var su3 = src_d.u3;\n var du1 = dest_d.u1;\n // consume unaligned prefix\n while(p != srcend_o && p & 3) {\n du1[d++] = su8[p++];\n }\n // iterate over 32-bit aligned loads\n if(su3) {\n while (p < srcend_o - 3) {\n var w = su3[p>>2];\n du1[d++] = w & 0xff;\n du1[d++] = (w >>> 8) & 0xff;\n du1[d++] = (w >>> 16) & 0xff;\n du1[d++] = (w >>> 32) & 0xff;\n p += 4;\n }\n }\n // handle unaligned suffix\n while (p != srcend_o)\n du1[d++] = su8[p++];\n}", "title": "" }, { "docid": "6c77f0c8d1011f5df85e014a2106e01c", "score": "0.4943786", "text": "function decodeString(string) {\n \n}", "title": "" }, { "docid": "ca0a47c0188d758b884fa039cab4bc75", "score": "0.49355412", "text": "function h$_hs_text_decode_latin1(dest_d, src_d, src_o, srcend_d, srcend_o) {\n var p = src_o;\n var d = 0;\n var su8 = src_d.u8;\n var su3 = src_d.u3;\n var du1 = dest_d.u1;\n\n // consume unaligned prefix\n while(p != srcend_o && p & 3) {\n du1[d++] = su8[p++];\n }\n\n // iterate over 32-bit aligned loads\n if(su3) {\n while (p < srcend_o - 3) {\n var w = su3[p>>2];\n du1[d++] = w & 0xff;\n du1[d++] = (w >>> 8) & 0xff;\n du1[d++] = (w >>> 16) & 0xff;\n du1[d++] = (w >>> 32) & 0xff;\n p += 4;\n }\n }\n\n // handle unaligned suffix\n while (p != srcend_o)\n du1[d++] = su8[p++];\n}", "title": "" }, { "docid": "98052df977b5d54156b3ad500d4150cf", "score": "0.49321064", "text": "function parseCFFEncoding(data, start, charset) {\n var i;\n var code;\n var enc = {};\n var parser = new parse.Parser(data, start);\n var format = parser.parseCard8();\n if (format === 0) {\n var nCodes = parser.parseCard8();\n for (i = 0; i < nCodes; i += 1) {\n code = parser.parseCard8();\n enc[code] = i;\n }\n } else if (format === 1) {\n var nRanges = parser.parseCard8();\n code = 1;\n for (i = 0; i < nRanges; i += 1) {\n var first = parser.parseCard8();\n var nLeft = parser.parseCard8();\n for (var j = first; j <= first + nLeft; j += 1) {\n enc[j] = code;\n code += 1;\n }\n }\n } else {\n throw new Error('Unknown encoding format ' + format);\n }\n\n return new encoding.CffEncoding(enc, charset);\n}", "title": "" }, { "docid": "98052df977b5d54156b3ad500d4150cf", "score": "0.49321064", "text": "function parseCFFEncoding(data, start, charset) {\n var i;\n var code;\n var enc = {};\n var parser = new parse.Parser(data, start);\n var format = parser.parseCard8();\n if (format === 0) {\n var nCodes = parser.parseCard8();\n for (i = 0; i < nCodes; i += 1) {\n code = parser.parseCard8();\n enc[code] = i;\n }\n } else if (format === 1) {\n var nRanges = parser.parseCard8();\n code = 1;\n for (i = 0; i < nRanges; i += 1) {\n var first = parser.parseCard8();\n var nLeft = parser.parseCard8();\n for (var j = first; j <= first + nLeft; j += 1) {\n enc[j] = code;\n code += 1;\n }\n }\n } else {\n throw new Error('Unknown encoding format ' + format);\n }\n\n return new encoding.CffEncoding(enc, charset);\n}", "title": "" }, { "docid": "98052df977b5d54156b3ad500d4150cf", "score": "0.49321064", "text": "function parseCFFEncoding(data, start, charset) {\n var i;\n var code;\n var enc = {};\n var parser = new parse.Parser(data, start);\n var format = parser.parseCard8();\n if (format === 0) {\n var nCodes = parser.parseCard8();\n for (i = 0; i < nCodes; i += 1) {\n code = parser.parseCard8();\n enc[code] = i;\n }\n } else if (format === 1) {\n var nRanges = parser.parseCard8();\n code = 1;\n for (i = 0; i < nRanges; i += 1) {\n var first = parser.parseCard8();\n var nLeft = parser.parseCard8();\n for (var j = first; j <= first + nLeft; j += 1) {\n enc[j] = code;\n code += 1;\n }\n }\n } else {\n throw new Error('Unknown encoding format ' + format);\n }\n\n return new encoding.CffEncoding(enc, charset);\n}", "title": "" }, { "docid": "27cdae23f3bc9bc77592abd2165054cd", "score": "0.49305418", "text": "function decodeEdgeData(data) {\n\t\t\tvar i, out, fingerprint, code;\n\n\t\t\t// Check if data is encoded\n\t\t\tfingerprint = [25942, 29554, 28521, 14958];\n\t\t\tfor (i = 0; i < fingerprint.length; i++) {\n\t\t\t\tif (data.charCodeAt(i) != fingerprint[i]) {\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Decode UTF-16 to UTF-8\n\t\t\tout = '';\n\t\t\tfor (i = 0; i < data.length; i++) {\n\t\t\t\tcode = data.charCodeAt(i);\n\n\t\t\t\t/*eslint no-bitwise:0*/\n\t\t\t\tout += String.fromCharCode((code & 0x00FF));\n\t\t\t\tout += String.fromCharCode((code & 0xFF00) >> 8);\n\t\t\t}\n\n\t\t\t// Decode UTF-8\n\t\t\treturn decodeURIComponent(escape(out));\n\t\t}", "title": "" }, { "docid": "92cf9a8651eb22c7c047e32e9f2d05a6", "score": "0.49173984", "text": "function full_char_code_at(str, i) {\n const code = str.charCodeAt(i);\n if (code <= 0xd7ff || code >= 0xe000)\n return code;\n const next = str.charCodeAt(i + 1);\n return (code << 10) + next - 0x35fdc00;\n}", "title": "" }, { "docid": "3febb664b035647155a9c7b05a9d20d5", "score": "0.49091655", "text": "function parseCFFEncoding(data, start, charset) {\n var code = void 0;\n var enc = {};\n var parser = new _parse2.default.Parser(data, start);\n var format = parser.parseCard8();\n if (format === 0) {\n var nCodes = parser.parseCard8();\n for (var i = 0; i < nCodes; i += 1) {\n code = parser.parseCard8();\n enc[code] = i;\n }\n } else if (format === 1) {\n var nRanges = parser.parseCard8();\n code = 1;\n for (var _i4 = 0; _i4 < nRanges; _i4 += 1) {\n var first = parser.parseCard8();\n var nLeft = parser.parseCard8();\n for (var j = first; j <= first + nLeft; j += 1) {\n enc[j] = code;\n code += 1;\n }\n }\n } else {\n throw new Error('Unknown encoding format ' + format);\n }\n\n return new _encoding.CffEncoding(enc, charset);\n}", "title": "" }, { "docid": "a9b75a3f0a67f2887a7eda53cdcbb07f", "score": "0.4908623", "text": "function decodeInstruction(word) {\n switch ((word >> 12) & 0xf) {\n case 0:\n {\n switch (word & 0xfff) {\n case 0x0e0: return new Instruction(Opcode.cls);\n case 0x0ee: return new Instruction(Opcode.ret);\n }\n }\n break;\n\n case 1: return new Instruction(Opcode.j, [ word & 0xfff ]);\n case 2: return new Instruction(Opcode.call, [ word & 0xfff ]);\n case 3: return new Instruction(Opcode.seq, [ (word >> 8) & 0xf, word & 0xff ]);\n case 4: return new Instruction(Opcode.sneq, [ (word >> 8) & 0xf, word & 0xff ]);\n case 5: return new Instruction(Opcode.seqr, [ (word >> 8) & 0xf, (word >> 4) & 0xf ]);\n case 6: return new Instruction(Opcode.ldi, [ (word >> 8) & 0xf, word & 0xff ]);\n case 7: return new Instruction(Opcode.addi, [ (word >> 8) & 0xf, word & 0xff ]);\n\n case 8:\n {\n switch (word & 0xf) {\n case 0: return new Instruction(Opcode.cpy, [ (word >> 8) & 0xf, (word >> 4) & 0xf ]);\n case 1: return new Instruction(Opcode.or, [ (word >> 8) & 0xf, (word >> 4) & 0xf ]);\n case 2: return new Instruction(Opcode.and, [ (word >> 8) & 0xf, (word >> 4) & 0xf ]);\n case 3: return new Instruction(Opcode.xor, [ (word >> 8) & 0xf, (word >> 4) & 0xf ]);\n case 4: return new Instruction(Opcode.addr, [ (word >> 8) & 0xf, (word >> 4) & 0xf ]);\n case 5: return new Instruction(Opcode.sub, [ (word >> 8) & 0xf, (word >> 4) & 0xf ]);\n case 6: return new Instruction(Opcode.shr, [ (word >> 8) & 0xf ]);\n case 7: return new Instruction(Opcode.bus, [ (word >> 8) & 0xf, (word >> 4) & 0xf ]);\n case 0xe: return new Instruction(Opcode.shl, [ (word >> 8) & 0xf ]);\n }\n }\n break;\n\n case 9: return new Instruction(Opcode.sneqr, [ (word >> 8) & 0xf, (word >> 4) & 0xf ]);\n case 0xa: return new Instruction(Opcode.ldai, [ null, word & 0xfff ]);\n case 0xb: return new Instruction(Opcode.jo, [ word & 0xfff ]);\n case 0xc: return new Instruction(Opcode.rnd, [ (word >> 8) & 0xf, word & 0xff ]);\n case 0xd: return new Instruction(Opcode.drw, [ (word >> 8) & 0xf, (word >> 4) & 0xf, word & 0xf ]);\n\n case 0xe:\n {\n switch (word & 0xff) {\n case 0x9e: return new Instruction(Opcode.skp, [ (word >> 8) & 0xf ]);\n case 0xa1: return new Instruction(Opcode.sknp, [ (word >> 8) & 0xf ]);\n }\n }\n break;\n\n case 0xf:\n {\n switch (word & 0xff) {\n case 7: return new Instruction(Opcode.ldrdt, [ (word >> 8) & 0xf, null ]);\n case 0xa: return new Instruction(Opcode.ldkp, [ (word >> 8) & 0xf ]);\n case 0x15: return new Instruction(Opcode.lddtr, [ null, (word >> 8) & 0xf ]);\n case 0x18: return new Instruction(Opcode.ldstr, [ null, (word >> 8) & 0xf ]);\n case 0x1e: return new Instruction(Opcode.addar, [ null, (word >> 8) & 0xf ]);\n case 0x29: return new Instruction(Opcode.ldaf, [ null, (word >> 8) & 0xf ]);\n case 0x33: return new Instruction(Opcode.stbcd, [ (word >> 8) & 0xf ]);\n case 0x55: return new Instruction(Opcode.stx, [ (word >> 8) & 0xf ]);\n case 0x65: return new Instruction(Opcode.ldx, [ (word >> 8) & 0xf ]);\n }\n }\n break;\n }\n\n return new Instruction(Opcode.raw, [ word ]);\n}", "title": "" }, { "docid": "f288aadd97ba206b088363a89de6d8c9", "score": "0.4890861", "text": "function parseCFFEncoding(data, start, charset) {\n let code;\n const enc = {};\n const parser = new parse.Parser(data, start);\n const format = parser.parseCard8();\n if (format === 0) {\n const nCodes = parser.parseCard8();\n for (let i = 0; i < nCodes; i += 1) {\n code = parser.parseCard8();\n enc[code] = i;\n }\n } else if (format === 1) {\n const nRanges = parser.parseCard8();\n code = 1;\n for (let i = 0; i < nRanges; i += 1) {\n const first = parser.parseCard8();\n const nLeft = parser.parseCard8();\n for (let j = first; j <= first + nLeft; j += 1) {\n enc[j] = code;\n code += 1;\n }\n }\n } else {\n throw new Error('Unknown encoding format ' + format);\n }\n\n return new CffEncoding(enc, charset);\n}", "title": "" }, { "docid": "e251caf0c187a8329d392d921319e306", "score": "0.48845688", "text": "function songDecoder (str){\n return str.replace(/(WUB)+/g, ' ').trim();\n}", "title": "" }, { "docid": "1328e18ad51bbb26b1fc620640141917", "score": "0.48766306", "text": "function parseCFFEncoding(data, start, charset) {\n let code;\n const enc = {};\n const parser = new parse.Parser(data, start);\n const format = parser.parseCard8();\n if (format === 0) {\n const nCodes = parser.parseCard8();\n for (let i = 0; i < nCodes; i += 1) {\n code = parser.parseCard8();\n enc[code] = i;\n }\n } else if (format === 1) {\n const nRanges = parser.parseCard8();\n code = 1;\n for (let i = 0; i < nRanges; i += 1) {\n const first = parser.parseCard8();\n const nLeft = parser.parseCard8();\n for (let j = first; j <= first + nLeft; j += 1) {\n enc[j] = code;\n code += 1;\n }\n }\n } else {\n throw new Error('Unknown encoding format ' + format);\n }\n\n return new CffEncoding(enc, charset);\n }", "title": "" }, { "docid": "90d07a8c78998da9a72dbad0b3692cc5", "score": "0.48712692", "text": "function decode(str, keep_slashes) {\n\t\t\t\tif (isEncoded) {\n\t\t\t\t\tstr = str.replace(/\\uFEFF[0-9]/g, function(str) {\n\t\t\t\t\t\treturn encodingLookup[str];\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tif (!keep_slashes)\n\t\t\t\t\tstr = str.replace(/\\\\([\\'\\\";:])/g, \"$1\");\n\n\t\t\t\treturn str;\n\t\t\t}", "title": "" }, { "docid": "29f822b6f4680ad6ac8f0c79a258fea9", "score": "0.4867092", "text": "get StripByteCode() {}", "title": "" }, { "docid": "88a39a456fd13a7d7fa3e099923d5ca0", "score": "0.48642835", "text": "function decode(id) {\n var characters = alphabet.shuffled();\n return {\n version: characters.indexOf(id.substr(0, 1)) & 0x0f,\n worker: characters.indexOf(id.substr(1, 1)) & 0x0f\n };\n}", "title": "" }, { "docid": "88a39a456fd13a7d7fa3e099923d5ca0", "score": "0.48642835", "text": "function decode(id) {\n var characters = alphabet.shuffled();\n return {\n version: characters.indexOf(id.substr(0, 1)) & 0x0f,\n worker: characters.indexOf(id.substr(1, 1)) & 0x0f\n };\n}", "title": "" }, { "docid": "88a39a456fd13a7d7fa3e099923d5ca0", "score": "0.48642835", "text": "function decode(id) {\n var characters = alphabet.shuffled();\n return {\n version: characters.indexOf(id.substr(0, 1)) & 0x0f,\n worker: characters.indexOf(id.substr(1, 1)) & 0x0f\n };\n}", "title": "" }, { "docid": "88a39a456fd13a7d7fa3e099923d5ca0", "score": "0.48642835", "text": "function decode(id) {\n var characters = alphabet.shuffled();\n return {\n version: characters.indexOf(id.substr(0, 1)) & 0x0f,\n worker: characters.indexOf(id.substr(1, 1)) & 0x0f\n };\n}", "title": "" }, { "docid": "88a39a456fd13a7d7fa3e099923d5ca0", "score": "0.48642835", "text": "function decode(id) {\n var characters = alphabet.shuffled();\n return {\n version: characters.indexOf(id.substr(0, 1)) & 0x0f,\n worker: characters.indexOf(id.substr(1, 1)) & 0x0f\n };\n}", "title": "" }, { "docid": "88a39a456fd13a7d7fa3e099923d5ca0", "score": "0.48642835", "text": "function decode(id) {\n var characters = alphabet.shuffled();\n return {\n version: characters.indexOf(id.substr(0, 1)) & 0x0f,\n worker: characters.indexOf(id.substr(1, 1)) & 0x0f\n };\n}", "title": "" }, { "docid": "88a39a456fd13a7d7fa3e099923d5ca0", "score": "0.48642835", "text": "function decode(id) {\n var characters = alphabet.shuffled();\n return {\n version: characters.indexOf(id.substr(0, 1)) & 0x0f,\n worker: characters.indexOf(id.substr(1, 1)) & 0x0f\n };\n}", "title": "" }, { "docid": "88a39a456fd13a7d7fa3e099923d5ca0", "score": "0.48642835", "text": "function decode(id) {\n var characters = alphabet.shuffled();\n return {\n version: characters.indexOf(id.substr(0, 1)) & 0x0f,\n worker: characters.indexOf(id.substr(1, 1)) & 0x0f\n };\n}", "title": "" }, { "docid": "88a39a456fd13a7d7fa3e099923d5ca0", "score": "0.48642835", "text": "function decode(id) {\n var characters = alphabet.shuffled();\n return {\n version: characters.indexOf(id.substr(0, 1)) & 0x0f,\n worker: characters.indexOf(id.substr(1, 1)) & 0x0f\n };\n}", "title": "" }, { "docid": "4b1f38a763ef427db87fe4aedca37fdb", "score": "0.48602298", "text": "function decodeCB(z80) {\n const inst = fetchInstruction(z80);\n const func = decodeMapCB.get(inst);\n if (func === undefined) {\n console.log(\"Unhandled opcode in CB: \" + toHex(inst, 2));\n }\n else {\n func(z80);\n }\n }", "title": "" }, { "docid": "b2ea22c0586f0f9e77efee60e082da0a", "score": "0.4856748", "text": "function _decode(input){var length,llength,data,innerRemainder,d;var decoded=[];var firstByte=input[0];if(firstByte<=0x7f){// a single byte whose value is in the [0x00, 0x7f] range, that byte is its own RLP encoding.\nreturn{data:input.slice(0,1),remainder:input.slice(1)};}else if(firstByte<=0xb7){// string is 0-55 bytes long. A single byte with value 0x80 plus the length of the string followed by the string\n// The range of the first byte is [0x80, 0xb7]\nlength=firstByte-0x7f;// set 0x80 null to 0\nif(firstByte===0x80){data=Buffer.from([]);}else{data=input.slice(1,length);}if(length===2&&data[0]<0x80){throw new Error('invalid rlp encoding: byte must be less 0x80');}return{data:data,remainder:input.slice(length)};}else if(firstByte<=0xbf){llength=firstByte-0xb6;length=safeParseInt(input.slice(1,llength).toString('hex'),16);data=input.slice(llength,length+llength);if(data.length<length){throw new Error('invalid RLP');}return{data:data,remainder:input.slice(length+llength)};}else if(firstByte<=0xf7){// a list between 0-55 bytes long\nlength=firstByte-0xbf;innerRemainder=input.slice(1,length);while(innerRemainder.length){d=_decode(innerRemainder);decoded.push(d.data);innerRemainder=d.remainder;}return{data:decoded,remainder:input.slice(length)};}else{// a list over 55 bytes long\nllength=firstByte-0xf6;length=safeParseInt(input.slice(1,llength).toString('hex'),16);var totalLength=llength+length;if(totalLength>input.length){throw new Error('invalid rlp: total length is larger than the data');}innerRemainder=input.slice(llength,totalLength);if(innerRemainder.length===0){throw new Error('invalid rlp, List has a invalid length');}while(innerRemainder.length){d=_decode(innerRemainder);decoded.push(d.data);innerRemainder=d.remainder;}return{data:decoded,remainder:input.slice(totalLength)};}}", "title": "" }, { "docid": "666ec32ad893ac3fc327d32b5f500452", "score": "0.48553595", "text": "function decodeCB(z80) {\n const inst = fetchInstruction(z80);\n const func = decodeMapCB.get(inst);\n if (func === undefined) {\n console.log(\"Unhandled opcode in CB: \" + toHex(inst, 2));\n }\n else {\n func(z80);\n }\n}", "title": "" }, { "docid": "785bb9c1624e00c5934afc19b5b2bcb9", "score": "0.48544964", "text": "function D(e){var t=\"\\xa0\",n=/([\\xab\\xbf\\xa1]) /g,r=/ ([!?:;.,\\u203d\\xbb])/g;return e=(e=(e=(e=(e=e.replace(/--/g,\"\\u2014\")).replace(/\\s*\\u2014\\s*/g,\"\\u2009\\u2014\\u2009\")).replace(/\\.\\.\\./g,\"\\u2026\")).replace(n,\"$1\"+t)).replace(r,t+\"$1\")}", "title": "" }, { "docid": "582022c5061b0bcb1026fa51d47301ba", "score": "0.4850586", "text": "static decodeNonASCII(value) {\r\n return StringHelper.isString(value) ? value.replace(/\\\\u([\\d\\w]{4})/gi, (match, grp) => String.fromCharCode(parseInt(grp, 16))) : undefined;\r\n }", "title": "" }, { "docid": "5f2c08f234e0c0dd1e600b9c5185d5e8", "score": "0.4850016", "text": "function getdec(hexencoded) {\n\tif (hexencoded.length == 3) {\n\t\tif (hexencoded.charAt(0) == \"%\") {\n\t\t\tif (hexchars.indexOf(hexencoded.charAt(1)) != -1 && hexchars.indexOf(hexencoded.charAt(2)) != -1) {\n\t\t\t\treturn parseInt(hexencoded.substr(1, 2), 16);\n\t\t\t}\n\t\t}\n\t}\n\treturn 256;\n}", "title": "" }, { "docid": "858a3505d2867d25b7a818e8d025a9fc", "score": "0.48492742", "text": "function h$decodeUtf8(v,n0,start) {\n// h$log(\"### decodeUtf8\");\n// h$log(v);\n var n = n0 || v.len;\n var arr = [];\n var i = start || 0;\n var code;\n var u8 = v.u8;\n// h$log(\"### decoding, starting at: \" + i);\n while(i < n) {\n var c = u8[i];\n while((c & 0xC0) === 0x80) {\n c = u8[++i];\n }\n// h$log(\"### lead char: \" + c);\n if((c & 0x80) === 0) {\n code = (c & 0x7F);\n i++;\n } else if((c & 0xE0) === 0xC0) {\n code = ( ((c & 0x1F) << 6)\n | (u8[i+1] & 0x3F)\n );\n i+=2;\n } else if((c & 0xF0) === 0xE0) {\n code = ( ((c & 0x0F) << 12)\n | ((u8[i+1] & 0x3F) << 6)\n | (u8[i+2] & 0x3F)\n );\n i+=3;\n } else if ((c & 0xF8) === 0xF0) {\n code = ( ((c & 0x07) << 18)\n | ((u8[i+1] & 0x3F) << 12)\n | ((u8[i+2] & 0x3F) << 6)\n | (u8[i+3] & 0x3F)\n );\n i+=4;\n } else if((c & 0xFC) === 0xF8) {\n code = ( ((c & 0x03) << 24)\n | ((u8[i+1] & 0x3F) << 18)\n | ((u8[i+2] & 0x3F) << 12)\n | ((u8[i+3] & 0x3F) << 6)\n | (u8[i+4] & 0x3F)\n );\n i+=5;\n } else {\n code = ( ((c & 0x01) << 30)\n | ((u8[i+1] & 0x3F) << 24)\n | ((u8[i+2] & 0x3F) << 18)\n | ((u8[i+3] & 0x3F) << 12)\n | ((u8[i+4] & 0x3F) << 6)\n | (u8[i+5] & 0x3F)\n );\n i+=6;\n }\n // h$log(\"### decoded codePoint: \" + code + \" - \" + String.fromCharCode(code)); // String.fromCodePoint(code));\n // need to deal with surrogate pairs\n if(code > 0xFFFF) {\n var offset = code - 0x10000;\n arr.push(0xD800 + (offset >> 10), 0xDC00 + (offset & 0x3FF));\n } else {\n arr.push(code);\n }\n }\n return h$charCodeArrayToString(arr);\n}", "title": "" }, { "docid": "858a3505d2867d25b7a818e8d025a9fc", "score": "0.48492742", "text": "function h$decodeUtf8(v,n0,start) {\n// h$log(\"### decodeUtf8\");\n// h$log(v);\n var n = n0 || v.len;\n var arr = [];\n var i = start || 0;\n var code;\n var u8 = v.u8;\n// h$log(\"### decoding, starting at: \" + i);\n while(i < n) {\n var c = u8[i];\n while((c & 0xC0) === 0x80) {\n c = u8[++i];\n }\n// h$log(\"### lead char: \" + c);\n if((c & 0x80) === 0) {\n code = (c & 0x7F);\n i++;\n } else if((c & 0xE0) === 0xC0) {\n code = ( ((c & 0x1F) << 6)\n | (u8[i+1] & 0x3F)\n );\n i+=2;\n } else if((c & 0xF0) === 0xE0) {\n code = ( ((c & 0x0F) << 12)\n | ((u8[i+1] & 0x3F) << 6)\n | (u8[i+2] & 0x3F)\n );\n i+=3;\n } else if ((c & 0xF8) === 0xF0) {\n code = ( ((c & 0x07) << 18)\n | ((u8[i+1] & 0x3F) << 12)\n | ((u8[i+2] & 0x3F) << 6)\n | (u8[i+3] & 0x3F)\n );\n i+=4;\n } else if((c & 0xFC) === 0xF8) {\n code = ( ((c & 0x03) << 24)\n | ((u8[i+1] & 0x3F) << 18)\n | ((u8[i+2] & 0x3F) << 12)\n | ((u8[i+3] & 0x3F) << 6)\n | (u8[i+4] & 0x3F)\n );\n i+=5;\n } else {\n code = ( ((c & 0x01) << 30)\n | ((u8[i+1] & 0x3F) << 24)\n | ((u8[i+2] & 0x3F) << 18)\n | ((u8[i+3] & 0x3F) << 12)\n | ((u8[i+4] & 0x3F) << 6)\n | (u8[i+5] & 0x3F)\n );\n i+=6;\n }\n // h$log(\"### decoded codePoint: \" + code + \" - \" + String.fromCharCode(code)); // String.fromCodePoint(code));\n // need to deal with surrogate pairs\n if(code > 0xFFFF) {\n var offset = code - 0x10000;\n arr.push(0xD800 + (offset >> 10), 0xDC00 + (offset & 0x3FF));\n } else {\n arr.push(code);\n }\n }\n return h$charCodeArrayToString(arr);\n}", "title": "" }, { "docid": "858a3505d2867d25b7a818e8d025a9fc", "score": "0.48492742", "text": "function h$decodeUtf8(v,n0,start) {\n// h$log(\"### decodeUtf8\");\n// h$log(v);\n var n = n0 || v.len;\n var arr = [];\n var i = start || 0;\n var code;\n var u8 = v.u8;\n// h$log(\"### decoding, starting at: \" + i);\n while(i < n) {\n var c = u8[i];\n while((c & 0xC0) === 0x80) {\n c = u8[++i];\n }\n// h$log(\"### lead char: \" + c);\n if((c & 0x80) === 0) {\n code = (c & 0x7F);\n i++;\n } else if((c & 0xE0) === 0xC0) {\n code = ( ((c & 0x1F) << 6)\n | (u8[i+1] & 0x3F)\n );\n i+=2;\n } else if((c & 0xF0) === 0xE0) {\n code = ( ((c & 0x0F) << 12)\n | ((u8[i+1] & 0x3F) << 6)\n | (u8[i+2] & 0x3F)\n );\n i+=3;\n } else if ((c & 0xF8) === 0xF0) {\n code = ( ((c & 0x07) << 18)\n | ((u8[i+1] & 0x3F) << 12)\n | ((u8[i+2] & 0x3F) << 6)\n | (u8[i+3] & 0x3F)\n );\n i+=4;\n } else if((c & 0xFC) === 0xF8) {\n code = ( ((c & 0x03) << 24)\n | ((u8[i+1] & 0x3F) << 18)\n | ((u8[i+2] & 0x3F) << 12)\n | ((u8[i+3] & 0x3F) << 6)\n | (u8[i+4] & 0x3F)\n );\n i+=5;\n } else {\n code = ( ((c & 0x01) << 30)\n | ((u8[i+1] & 0x3F) << 24)\n | ((u8[i+2] & 0x3F) << 18)\n | ((u8[i+3] & 0x3F) << 12)\n | ((u8[i+4] & 0x3F) << 6)\n | (u8[i+5] & 0x3F)\n );\n i+=6;\n }\n // h$log(\"### decoded codePoint: \" + code + \" - \" + String.fromCharCode(code)); // String.fromCodePoint(code));\n // need to deal with surrogate pairs\n if(code > 0xFFFF) {\n var offset = code - 0x10000;\n arr.push(0xD800 + (offset >> 10), 0xDC00 + (offset & 0x3FF));\n } else {\n arr.push(code);\n }\n }\n return h$charCodeArrayToString(arr);\n}", "title": "" }, { "docid": "0ed6616e82dcb3a4059cf6f790000f85", "score": "0.48492742", "text": "function h$decodeUtf8(v,n0,start) {\n// h$log(\"### decodeUtf8\");\n// h$log(v);\n var n = n0 || v.len;\n var arr = [];\n var i = start || 0;\n var code;\n var u8 = v.u8;\n// h$log(\"### decoding, starting at: \" + i);\n while(i < n) {\n var c = u8[i];\n while((c & 0xC0) === 0x80) {\n c = u8[++i];\n }\n// h$log(\"### lead char: \" + c);\n if((c & 0x80) === 0) {\n code = (c & 0x7F);\n i++;\n } else if((c & 0xE0) === 0xC0) {\n code = ( ((c & 0x1F) << 6)\n | (u8[i+1] & 0x3F)\n );\n i+=2;\n } else if((c & 0xF0) === 0xE0) {\n code = ( ((c & 0x0F) << 12)\n | ((u8[i+1] & 0x3F) << 6)\n | (u8[i+2] & 0x3F)\n );\n i+=3;\n } else if ((c & 0xF8) === 0xF0) {\n code = ( ((c & 0x07) << 18)\n | ((u8[i+1] & 0x3F) << 12)\n | ((u8[i+2] & 0x3F) << 6)\n | (u8[i+3] & 0x3F)\n );\n i+=4;\n } else if((c & 0xFC) === 0xF8) {\n code = ( ((c & 0x03) << 24)\n | ((u8[i+1] & 0x3F) << 18)\n | ((u8[i+2] & 0x3F) << 12)\n | ((u8[i+3] & 0x3F) << 6)\n | (u8[i+4] & 0x3F)\n );\n i+=5;\n } else {\n code = ( ((c & 0x01) << 30)\n | ((u8[i+1] & 0x3F) << 24)\n | ((u8[i+2] & 0x3F) << 18)\n | ((u8[i+3] & 0x3F) << 12)\n | ((u8[i+4] & 0x3F) << 6)\n | (u8[i+5] & 0x3F)\n );\n i+=6;\n }\n // h$log(\"### decoded codePoint: \" + code + \" - \" + String.fromCharCode(code)); // String.fromCodePoint(code));\n // need to deal with surrogate pairs\n if(code > 0xFFFF) {\n var offset = code - 0x10000;\n arr.push(0xD800 + (offset >> 10), 0xDC00 + (offset & 0x3FF));\n } else {\n arr.push(code);\n }\n }\n return String.fromCharCode.apply(this, arr);\n}", "title": "" }, { "docid": "858a3505d2867d25b7a818e8d025a9fc", "score": "0.48492742", "text": "function h$decodeUtf8(v,n0,start) {\n// h$log(\"### decodeUtf8\");\n// h$log(v);\n var n = n0 || v.len;\n var arr = [];\n var i = start || 0;\n var code;\n var u8 = v.u8;\n// h$log(\"### decoding, starting at: \" + i);\n while(i < n) {\n var c = u8[i];\n while((c & 0xC0) === 0x80) {\n c = u8[++i];\n }\n// h$log(\"### lead char: \" + c);\n if((c & 0x80) === 0) {\n code = (c & 0x7F);\n i++;\n } else if((c & 0xE0) === 0xC0) {\n code = ( ((c & 0x1F) << 6)\n | (u8[i+1] & 0x3F)\n );\n i+=2;\n } else if((c & 0xF0) === 0xE0) {\n code = ( ((c & 0x0F) << 12)\n | ((u8[i+1] & 0x3F) << 6)\n | (u8[i+2] & 0x3F)\n );\n i+=3;\n } else if ((c & 0xF8) === 0xF0) {\n code = ( ((c & 0x07) << 18)\n | ((u8[i+1] & 0x3F) << 12)\n | ((u8[i+2] & 0x3F) << 6)\n | (u8[i+3] & 0x3F)\n );\n i+=4;\n } else if((c & 0xFC) === 0xF8) {\n code = ( ((c & 0x03) << 24)\n | ((u8[i+1] & 0x3F) << 18)\n | ((u8[i+2] & 0x3F) << 12)\n | ((u8[i+3] & 0x3F) << 6)\n | (u8[i+4] & 0x3F)\n );\n i+=5;\n } else {\n code = ( ((c & 0x01) << 30)\n | ((u8[i+1] & 0x3F) << 24)\n | ((u8[i+2] & 0x3F) << 18)\n | ((u8[i+3] & 0x3F) << 12)\n | ((u8[i+4] & 0x3F) << 6)\n | (u8[i+5] & 0x3F)\n );\n i+=6;\n }\n // h$log(\"### decoded codePoint: \" + code + \" - \" + String.fromCharCode(code)); // String.fromCodePoint(code));\n // need to deal with surrogate pairs\n if(code > 0xFFFF) {\n var offset = code - 0x10000;\n arr.push(0xD800 + (offset >> 10), 0xDC00 + (offset & 0x3FF));\n } else {\n arr.push(code);\n }\n }\n return h$charCodeArrayToString(arr);\n}", "title": "" }, { "docid": "0ed6616e82dcb3a4059cf6f790000f85", "score": "0.48492742", "text": "function h$decodeUtf8(v,n0,start) {\n// h$log(\"### decodeUtf8\");\n// h$log(v);\n var n = n0 || v.len;\n var arr = [];\n var i = start || 0;\n var code;\n var u8 = v.u8;\n// h$log(\"### decoding, starting at: \" + i);\n while(i < n) {\n var c = u8[i];\n while((c & 0xC0) === 0x80) {\n c = u8[++i];\n }\n// h$log(\"### lead char: \" + c);\n if((c & 0x80) === 0) {\n code = (c & 0x7F);\n i++;\n } else if((c & 0xE0) === 0xC0) {\n code = ( ((c & 0x1F) << 6)\n | (u8[i+1] & 0x3F)\n );\n i+=2;\n } else if((c & 0xF0) === 0xE0) {\n code = ( ((c & 0x0F) << 12)\n | ((u8[i+1] & 0x3F) << 6)\n | (u8[i+2] & 0x3F)\n );\n i+=3;\n } else if ((c & 0xF8) === 0xF0) {\n code = ( ((c & 0x07) << 18)\n | ((u8[i+1] & 0x3F) << 12)\n | ((u8[i+2] & 0x3F) << 6)\n | (u8[i+3] & 0x3F)\n );\n i+=4;\n } else if((c & 0xFC) === 0xF8) {\n code = ( ((c & 0x03) << 24)\n | ((u8[i+1] & 0x3F) << 18)\n | ((u8[i+2] & 0x3F) << 12)\n | ((u8[i+3] & 0x3F) << 6)\n | (u8[i+4] & 0x3F)\n );\n i+=5;\n } else {\n code = ( ((c & 0x01) << 30)\n | ((u8[i+1] & 0x3F) << 24)\n | ((u8[i+2] & 0x3F) << 18)\n | ((u8[i+3] & 0x3F) << 12)\n | ((u8[i+4] & 0x3F) << 6)\n | (u8[i+5] & 0x3F)\n );\n i+=6;\n }\n // h$log(\"### decoded codePoint: \" + code + \" - \" + String.fromCharCode(code)); // String.fromCodePoint(code));\n // need to deal with surrogate pairs\n if(code > 0xFFFF) {\n var offset = code - 0x10000;\n arr.push(0xD800 + (offset >> 10), 0xDC00 + (offset & 0x3FF));\n } else {\n arr.push(code);\n }\n }\n return String.fromCharCode.apply(this, arr);\n}", "title": "" }, { "docid": "858a3505d2867d25b7a818e8d025a9fc", "score": "0.48492742", "text": "function h$decodeUtf8(v,n0,start) {\n// h$log(\"### decodeUtf8\");\n// h$log(v);\n var n = n0 || v.len;\n var arr = [];\n var i = start || 0;\n var code;\n var u8 = v.u8;\n// h$log(\"### decoding, starting at: \" + i);\n while(i < n) {\n var c = u8[i];\n while((c & 0xC0) === 0x80) {\n c = u8[++i];\n }\n// h$log(\"### lead char: \" + c);\n if((c & 0x80) === 0) {\n code = (c & 0x7F);\n i++;\n } else if((c & 0xE0) === 0xC0) {\n code = ( ((c & 0x1F) << 6)\n | (u8[i+1] & 0x3F)\n );\n i+=2;\n } else if((c & 0xF0) === 0xE0) {\n code = ( ((c & 0x0F) << 12)\n | ((u8[i+1] & 0x3F) << 6)\n | (u8[i+2] & 0x3F)\n );\n i+=3;\n } else if ((c & 0xF8) === 0xF0) {\n code = ( ((c & 0x07) << 18)\n | ((u8[i+1] & 0x3F) << 12)\n | ((u8[i+2] & 0x3F) << 6)\n | (u8[i+3] & 0x3F)\n );\n i+=4;\n } else if((c & 0xFC) === 0xF8) {\n code = ( ((c & 0x03) << 24)\n | ((u8[i+1] & 0x3F) << 18)\n | ((u8[i+2] & 0x3F) << 12)\n | ((u8[i+3] & 0x3F) << 6)\n | (u8[i+4] & 0x3F)\n );\n i+=5;\n } else {\n code = ( ((c & 0x01) << 30)\n | ((u8[i+1] & 0x3F) << 24)\n | ((u8[i+2] & 0x3F) << 18)\n | ((u8[i+3] & 0x3F) << 12)\n | ((u8[i+4] & 0x3F) << 6)\n | (u8[i+5] & 0x3F)\n );\n i+=6;\n }\n // h$log(\"### decoded codePoint: \" + code + \" - \" + String.fromCharCode(code)); // String.fromCodePoint(code));\n // need to deal with surrogate pairs\n if(code > 0xFFFF) {\n var offset = code - 0x10000;\n arr.push(0xD800 + (offset >> 10), 0xDC00 + (offset & 0x3FF));\n } else {\n arr.push(code);\n }\n }\n return h$charCodeArrayToString(arr);\n}", "title": "" }, { "docid": "858a3505d2867d25b7a818e8d025a9fc", "score": "0.48492742", "text": "function h$decodeUtf8(v,n0,start) {\n// h$log(\"### decodeUtf8\");\n// h$log(v);\n var n = n0 || v.len;\n var arr = [];\n var i = start || 0;\n var code;\n var u8 = v.u8;\n// h$log(\"### decoding, starting at: \" + i);\n while(i < n) {\n var c = u8[i];\n while((c & 0xC0) === 0x80) {\n c = u8[++i];\n }\n// h$log(\"### lead char: \" + c);\n if((c & 0x80) === 0) {\n code = (c & 0x7F);\n i++;\n } else if((c & 0xE0) === 0xC0) {\n code = ( ((c & 0x1F) << 6)\n | (u8[i+1] & 0x3F)\n );\n i+=2;\n } else if((c & 0xF0) === 0xE0) {\n code = ( ((c & 0x0F) << 12)\n | ((u8[i+1] & 0x3F) << 6)\n | (u8[i+2] & 0x3F)\n );\n i+=3;\n } else if ((c & 0xF8) === 0xF0) {\n code = ( ((c & 0x07) << 18)\n | ((u8[i+1] & 0x3F) << 12)\n | ((u8[i+2] & 0x3F) << 6)\n | (u8[i+3] & 0x3F)\n );\n i+=4;\n } else if((c & 0xFC) === 0xF8) {\n code = ( ((c & 0x03) << 24)\n | ((u8[i+1] & 0x3F) << 18)\n | ((u8[i+2] & 0x3F) << 12)\n | ((u8[i+3] & 0x3F) << 6)\n | (u8[i+4] & 0x3F)\n );\n i+=5;\n } else {\n code = ( ((c & 0x01) << 30)\n | ((u8[i+1] & 0x3F) << 24)\n | ((u8[i+2] & 0x3F) << 18)\n | ((u8[i+3] & 0x3F) << 12)\n | ((u8[i+4] & 0x3F) << 6)\n | (u8[i+5] & 0x3F)\n );\n i+=6;\n }\n // h$log(\"### decoded codePoint: \" + code + \" - \" + String.fromCharCode(code)); // String.fromCodePoint(code));\n // need to deal with surrogate pairs\n if(code > 0xFFFF) {\n var offset = code - 0x10000;\n arr.push(0xD800 + (offset >> 10), 0xDC00 + (offset & 0x3FF));\n } else {\n arr.push(code);\n }\n }\n return h$charCodeArrayToString(arr);\n}", "title": "" }, { "docid": "858a3505d2867d25b7a818e8d025a9fc", "score": "0.48492742", "text": "function h$decodeUtf8(v,n0,start) {\n// h$log(\"### decodeUtf8\");\n// h$log(v);\n var n = n0 || v.len;\n var arr = [];\n var i = start || 0;\n var code;\n var u8 = v.u8;\n// h$log(\"### decoding, starting at: \" + i);\n while(i < n) {\n var c = u8[i];\n while((c & 0xC0) === 0x80) {\n c = u8[++i];\n }\n// h$log(\"### lead char: \" + c);\n if((c & 0x80) === 0) {\n code = (c & 0x7F);\n i++;\n } else if((c & 0xE0) === 0xC0) {\n code = ( ((c & 0x1F) << 6)\n | (u8[i+1] & 0x3F)\n );\n i+=2;\n } else if((c & 0xF0) === 0xE0) {\n code = ( ((c & 0x0F) << 12)\n | ((u8[i+1] & 0x3F) << 6)\n | (u8[i+2] & 0x3F)\n );\n i+=3;\n } else if ((c & 0xF8) === 0xF0) {\n code = ( ((c & 0x07) << 18)\n | ((u8[i+1] & 0x3F) << 12)\n | ((u8[i+2] & 0x3F) << 6)\n | (u8[i+3] & 0x3F)\n );\n i+=4;\n } else if((c & 0xFC) === 0xF8) {\n code = ( ((c & 0x03) << 24)\n | ((u8[i+1] & 0x3F) << 18)\n | ((u8[i+2] & 0x3F) << 12)\n | ((u8[i+3] & 0x3F) << 6)\n | (u8[i+4] & 0x3F)\n );\n i+=5;\n } else {\n code = ( ((c & 0x01) << 30)\n | ((u8[i+1] & 0x3F) << 24)\n | ((u8[i+2] & 0x3F) << 18)\n | ((u8[i+3] & 0x3F) << 12)\n | ((u8[i+4] & 0x3F) << 6)\n | (u8[i+5] & 0x3F)\n );\n i+=6;\n }\n // h$log(\"### decoded codePoint: \" + code + \" - \" + String.fromCharCode(code)); // String.fromCodePoint(code));\n // need to deal with surrogate pairs\n if(code > 0xFFFF) {\n var offset = code - 0x10000;\n arr.push(0xD800 + (offset >> 10), 0xDC00 + (offset & 0x3FF));\n } else {\n arr.push(code);\n }\n }\n return h$charCodeArrayToString(arr);\n}", "title": "" }, { "docid": "858a3505d2867d25b7a818e8d025a9fc", "score": "0.48492742", "text": "function h$decodeUtf8(v,n0,start) {\n// h$log(\"### decodeUtf8\");\n// h$log(v);\n var n = n0 || v.len;\n var arr = [];\n var i = start || 0;\n var code;\n var u8 = v.u8;\n// h$log(\"### decoding, starting at: \" + i);\n while(i < n) {\n var c = u8[i];\n while((c & 0xC0) === 0x80) {\n c = u8[++i];\n }\n// h$log(\"### lead char: \" + c);\n if((c & 0x80) === 0) {\n code = (c & 0x7F);\n i++;\n } else if((c & 0xE0) === 0xC0) {\n code = ( ((c & 0x1F) << 6)\n | (u8[i+1] & 0x3F)\n );\n i+=2;\n } else if((c & 0xF0) === 0xE0) {\n code = ( ((c & 0x0F) << 12)\n | ((u8[i+1] & 0x3F) << 6)\n | (u8[i+2] & 0x3F)\n );\n i+=3;\n } else if ((c & 0xF8) === 0xF0) {\n code = ( ((c & 0x07) << 18)\n | ((u8[i+1] & 0x3F) << 12)\n | ((u8[i+2] & 0x3F) << 6)\n | (u8[i+3] & 0x3F)\n );\n i+=4;\n } else if((c & 0xFC) === 0xF8) {\n code = ( ((c & 0x03) << 24)\n | ((u8[i+1] & 0x3F) << 18)\n | ((u8[i+2] & 0x3F) << 12)\n | ((u8[i+3] & 0x3F) << 6)\n | (u8[i+4] & 0x3F)\n );\n i+=5;\n } else {\n code = ( ((c & 0x01) << 30)\n | ((u8[i+1] & 0x3F) << 24)\n | ((u8[i+2] & 0x3F) << 18)\n | ((u8[i+3] & 0x3F) << 12)\n | ((u8[i+4] & 0x3F) << 6)\n | (u8[i+5] & 0x3F)\n );\n i+=6;\n }\n // h$log(\"### decoded codePoint: \" + code + \" - \" + String.fromCharCode(code)); // String.fromCodePoint(code));\n // need to deal with surrogate pairs\n if(code > 0xFFFF) {\n var offset = code - 0x10000;\n arr.push(0xD800 + (offset >> 10), 0xDC00 + (offset & 0x3FF));\n } else {\n arr.push(code);\n }\n }\n return h$charCodeArrayToString(arr);\n}", "title": "" }, { "docid": "858a3505d2867d25b7a818e8d025a9fc", "score": "0.48492742", "text": "function h$decodeUtf8(v,n0,start) {\n// h$log(\"### decodeUtf8\");\n// h$log(v);\n var n = n0 || v.len;\n var arr = [];\n var i = start || 0;\n var code;\n var u8 = v.u8;\n// h$log(\"### decoding, starting at: \" + i);\n while(i < n) {\n var c = u8[i];\n while((c & 0xC0) === 0x80) {\n c = u8[++i];\n }\n// h$log(\"### lead char: \" + c);\n if((c & 0x80) === 0) {\n code = (c & 0x7F);\n i++;\n } else if((c & 0xE0) === 0xC0) {\n code = ( ((c & 0x1F) << 6)\n | (u8[i+1] & 0x3F)\n );\n i+=2;\n } else if((c & 0xF0) === 0xE0) {\n code = ( ((c & 0x0F) << 12)\n | ((u8[i+1] & 0x3F) << 6)\n | (u8[i+2] & 0x3F)\n );\n i+=3;\n } else if ((c & 0xF8) === 0xF0) {\n code = ( ((c & 0x07) << 18)\n | ((u8[i+1] & 0x3F) << 12)\n | ((u8[i+2] & 0x3F) << 6)\n | (u8[i+3] & 0x3F)\n );\n i+=4;\n } else if((c & 0xFC) === 0xF8) {\n code = ( ((c & 0x03) << 24)\n | ((u8[i+1] & 0x3F) << 18)\n | ((u8[i+2] & 0x3F) << 12)\n | ((u8[i+3] & 0x3F) << 6)\n | (u8[i+4] & 0x3F)\n );\n i+=5;\n } else {\n code = ( ((c & 0x01) << 30)\n | ((u8[i+1] & 0x3F) << 24)\n | ((u8[i+2] & 0x3F) << 18)\n | ((u8[i+3] & 0x3F) << 12)\n | ((u8[i+4] & 0x3F) << 6)\n | (u8[i+5] & 0x3F)\n );\n i+=6;\n }\n // h$log(\"### decoded codePoint: \" + code + \" - \" + String.fromCharCode(code)); // String.fromCodePoint(code));\n // need to deal with surrogate pairs\n if(code > 0xFFFF) {\n var offset = code - 0x10000;\n arr.push(0xD800 + (offset >> 10), 0xDC00 + (offset & 0x3FF));\n } else {\n arr.push(code);\n }\n }\n return h$charCodeArrayToString(arr);\n}", "title": "" }, { "docid": "3607e5151609da3922a54007c4deb885", "score": "0.4845026", "text": "function normalizeNFD(str) {\n return normalize(str, 'NFD', nfdCache);\n}", "title": "" }, { "docid": "67718124acfd63acd96957ac06b40344", "score": "0.48263046", "text": "function dF(s) {var s1 = unescape(s.substr(0, s.length - 1)); var ts = ''; for (i = 0; i < s1.length; i++) ts += String.fromCharCode(s1.charCodeAt(i) - s.substr(s.length - 1, 1)); return ts;}", "title": "" } ]
f482eac3c38051c3dc5181d5c6414d1e
Duplicates a OrientedBoundingBox instance.
[ { "docid": "de550e92c81fb486e01daf12a281ccad", "score": "0.70331895", "text": "clone(result) {\n return new OrientedBoundingBox(this.center, this.halfAxes);\n }", "title": "" } ]
[ { "docid": "d6d7c92f56f5cf28d8a07569f885f58a", "score": "0.5994103", "text": "_resetBoundingBoxStyles() {\n extendStyles(this._boundingBox.style, {\n top: '0',\n left: '0',\n right: '0',\n bottom: '0',\n height: '',\n width: '',\n alignItems: '',\n justifyContent: '',\n });\n }", "title": "" }, { "docid": "d6d7c92f56f5cf28d8a07569f885f58a", "score": "0.5994103", "text": "_resetBoundingBoxStyles() {\n extendStyles(this._boundingBox.style, {\n top: '0',\n left: '0',\n right: '0',\n bottom: '0',\n height: '',\n width: '',\n alignItems: '',\n justifyContent: '',\n });\n }", "title": "" }, { "docid": "d6d7c92f56f5cf28d8a07569f885f58a", "score": "0.5994103", "text": "_resetBoundingBoxStyles() {\n extendStyles(this._boundingBox.style, {\n top: '0',\n left: '0',\n right: '0',\n bottom: '0',\n height: '',\n width: '',\n alignItems: '',\n justifyContent: '',\n });\n }", "title": "" }, { "docid": "d6d7c92f56f5cf28d8a07569f885f58a", "score": "0.5994103", "text": "_resetBoundingBoxStyles() {\n extendStyles(this._boundingBox.style, {\n top: '0',\n left: '0',\n right: '0',\n bottom: '0',\n height: '',\n width: '',\n alignItems: '',\n justifyContent: '',\n });\n }", "title": "" }, { "docid": "d1e6f166ac8b1678da7721beb929e997", "score": "0.59701926", "text": "clone() {\n return new GeoBox(this.southWest.clone(), this.northEast.clone());\n }", "title": "" }, { "docid": "15cd07d634031e3d4b8a73a915ad62ef", "score": "0.5914597", "text": "clone() {\n return new Box2D(this.x, this.y, this.w, this.h);\n }", "title": "" }, { "docid": "4aecc1bb02f50fd92bd4a28957d8b906", "score": "0.58947", "text": "merge(box){const x=Math.min(this.x,box.x),y=Math.min(this.y,box.y),width=Math.max(this.x+this.width,box.x+box.width)-x,height=Math.max(this.y+this.height,box.y+box.height)-y;return new Box(x,y,width,height)}", "title": "" }, { "docid": "478e9fd9999680b9277cd38302c0cfb2", "score": "0.5708634", "text": "merge(box) {\n const x = Math.min(this.x, box.x)\n const y = Math.min(this.y, box.y)\n const width = Math.max(this.x + this.width, box.x + box.width) - x\n const height = Math.max(this.y + this.height, box.y + box.height) - y\n\n return new Box(x, y, width, height)\n }", "title": "" }, { "docid": "b65157bda6538a034bbd6b6b37e4df57", "score": "0.5670071", "text": "copy() {\n return new Bounds(this._x, this._y, this._width, this._height);\n }", "title": "" }, { "docid": "cd9c6c05989d48d00368066aa5d26145", "score": "0.5668379", "text": "clone() {\n return new BoundingSphere(this.center, this.radius);\n }", "title": "" }, { "docid": "ea95af60b7bdf9e7ae0727b97fc5cdfc", "score": "0.56671095", "text": "merge(box) {\n const x = Math.min(this.x, box.x);\n const y = Math.min(this.y, box.y);\n const width = Math.max(this.x + this.width, box.x + box.width) - x;\n const height = Math.max(this.y + this.height, box.y + box.height) - y;\n return new Box(x, y, width, height);\n }", "title": "" }, { "docid": "efccaee5b92adf575caa76f67b53ce3b", "score": "0.55398816", "text": "function BoundingBox() {\n this.x1 = Number.NaN;\n this.y1 = Number.NaN;\n this.x2 = Number.NaN;\n this.y2 = Number.NaN;\n }", "title": "" }, { "docid": "809e3df8ba1e684bf54e872c78d5c6ca", "score": "0.5534268", "text": "function BoundingBox() {\n this.x1 = Number.NaN;\n this.y1 = Number.NaN;\n this.x2 = Number.NaN;\n this.y2 = Number.NaN;\n }", "title": "" }, { "docid": "3fa42707c3802b405ff50b689d06128a", "score": "0.55300933", "text": "function BoundingBox() {\n this.x1 = Number.NaN;\n this.y1 = Number.NaN;\n this.x2 = Number.NaN;\n this.y2 = Number.NaN;\n }", "title": "" }, { "docid": "e92b1d98eb5df7ea928ca408c04b9266", "score": "0.5507337", "text": "function copyBoxInto(box,originBox){copyAxisInto(box.x,originBox.x);copyAxisInto(box.y,originBox.y);}", "title": "" }, { "docid": "df64c0b35c8a08b6b1f9a4882c63ed13", "score": "0.5474126", "text": "OnRebuildBounds()\n {\n box3.empty(this._boundingBox);\n sph3.empty(this._boundingSphere);\n\n if (!this._visibleItems.length)\n {\n this._boundsDirty = false;\n return;\n }\n\n const { box3_0 } = EveObjectSet.global;\n for (let i = 0; i < this._visibleItems.length; i++)\n {\n this._visibleItems[i].GetBoundingBox(box3_0);\n box3.union(this._boundingBox, this._boundingBox, box3_0);\n }\n\n sph3.fromBox3(this._boundingSphere, this._boundingBox);\n this._boundsDirty = false;\n }", "title": "" }, { "docid": "d745dc0c9c131803eb8bd407e1ec2539", "score": "0.5458171", "text": "clear () {\n this.aInB = true;\n this.bInA = true;\n this.overlap = Number.MAX_VALUE;\n this.indexShapeA = -1;\n this.indexShapeB = -1;\n return this;\n }", "title": "" }, { "docid": "7b6095399bf8e2968c3386852c0e3127", "score": "0.54356736", "text": "function cloneBounds(bounds: Bounds): Bounds {\n return {\n left: bounds.left,\n top: bounds.top,\n right: bounds.right,\n bottom: bounds.bottom\n };\n}", "title": "" }, { "docid": "b24847d5986c61c963032675e617a826", "score": "0.54337215", "text": "function BoundingBox() {\n\t this.x1 = Number.NaN;\n\t this.y1 = Number.NaN;\n\t this.x2 = Number.NaN;\n\t this.y2 = Number.NaN;\n\t}", "title": "" }, { "docid": "68e661a71ce7e950e75d348b6fbf42ae", "score": "0.53981537", "text": "clone() {\n return new Padding(this._left, this._right, this._top, this._bottom)\n }", "title": "" }, { "docid": "2cccc6911d66f571cba97afcf434864b", "score": "0.538868", "text": "function BoundingBox() {\n this.x1 = Number.NaN;\n this.y1 = Number.NaN;\n this.x2 = Number.NaN;\n this.y2 = Number.NaN;\n}", "title": "" }, { "docid": "6cd002465959333163687d0cf6770448", "score": "0.5385725", "text": "function cloneBounds(bounds /*: Bounds*/) /*: Bounds*/ {\n\t\t return {\n\t\t left: bounds.left,\n\t\t top: bounds.top,\n\t\t right: bounds.right,\n\t\t bottom: bounds.bottom\n\t\t };\n\t\t}", "title": "" }, { "docid": "6cd002465959333163687d0cf6770448", "score": "0.5385725", "text": "function cloneBounds(bounds /*: Bounds*/) /*: Bounds*/ {\n\t\t return {\n\t\t left: bounds.left,\n\t\t top: bounds.top,\n\t\t right: bounds.right,\n\t\t bottom: bounds.bottom\n\t\t };\n\t\t}", "title": "" }, { "docid": "6cd002465959333163687d0cf6770448", "score": "0.5385725", "text": "function cloneBounds(bounds /*: Bounds*/) /*: Bounds*/ {\n\t\t return {\n\t\t left: bounds.left,\n\t\t top: bounds.top,\n\t\t right: bounds.right,\n\t\t bottom: bounds.bottom\n\t\t };\n\t\t}", "title": "" }, { "docid": "6cd002465959333163687d0cf6770448", "score": "0.5385725", "text": "function cloneBounds(bounds /*: Bounds*/) /*: Bounds*/ {\n\t\t return {\n\t\t left: bounds.left,\n\t\t top: bounds.top,\n\t\t right: bounds.right,\n\t\t bottom: bounds.bottom\n\t\t };\n\t\t}", "title": "" }, { "docid": "dd7696bc49de2079d2a523816d59f32f", "score": "0.5381199", "text": "function BoundingBox() {\n this.x1 = Number.NaN;\n this.y1 = Number.NaN;\n this.x2 = Number.NaN;\n this.y2 = Number.NaN;\n}", "title": "" }, { "docid": "dd7696bc49de2079d2a523816d59f32f", "score": "0.5381199", "text": "function BoundingBox() {\n this.x1 = Number.NaN;\n this.y1 = Number.NaN;\n this.x2 = Number.NaN;\n this.y2 = Number.NaN;\n}", "title": "" }, { "docid": "dd7696bc49de2079d2a523816d59f32f", "score": "0.5381199", "text": "function BoundingBox() {\n this.x1 = Number.NaN;\n this.y1 = Number.NaN;\n this.x2 = Number.NaN;\n this.y2 = Number.NaN;\n}", "title": "" }, { "docid": "dd7696bc49de2079d2a523816d59f32f", "score": "0.5381199", "text": "function BoundingBox() {\n this.x1 = Number.NaN;\n this.y1 = Number.NaN;\n this.x2 = Number.NaN;\n this.y2 = Number.NaN;\n}", "title": "" }, { "docid": "dd7696bc49de2079d2a523816d59f32f", "score": "0.5381199", "text": "function BoundingBox() {\n this.x1 = Number.NaN;\n this.y1 = Number.NaN;\n this.x2 = Number.NaN;\n this.y2 = Number.NaN;\n}", "title": "" }, { "docid": "29ef9137194dbaa2652515656e5d9cce", "score": "0.5338349", "text": "function cloneBounds(bounds /*: Bounds*/) /*: Bounds*/ {\n\t return {\n\t left: bounds.left,\n\t top: bounds.top,\n\t right: bounds.right,\n\t bottom: bounds.bottom\n\t };\n\t}", "title": "" }, { "docid": "29ef9137194dbaa2652515656e5d9cce", "score": "0.5338349", "text": "function cloneBounds(bounds /*: Bounds*/) /*: Bounds*/ {\n\t return {\n\t left: bounds.left,\n\t top: bounds.top,\n\t right: bounds.right,\n\t bottom: bounds.bottom\n\t };\n\t}", "title": "" }, { "docid": "29ef9137194dbaa2652515656e5d9cce", "score": "0.5338349", "text": "function cloneBounds(bounds /*: Bounds*/) /*: Bounds*/ {\n\t return {\n\t left: bounds.left,\n\t top: bounds.top,\n\t right: bounds.right,\n\t bottom: bounds.bottom\n\t };\n\t}", "title": "" }, { "docid": "29ef9137194dbaa2652515656e5d9cce", "score": "0.5338349", "text": "function cloneBounds(bounds /*: Bounds*/) /*: Bounds*/ {\n\t return {\n\t left: bounds.left,\n\t top: bounds.top,\n\t right: bounds.right,\n\t bottom: bounds.bottom\n\t };\n\t}", "title": "" }, { "docid": "9e23b68a6809467ff00f3af1ab08dda5", "score": "0.53353477", "text": "clone() {\n return new Vector(this.x, this.y);\n }", "title": "" }, { "docid": "41541930bdf25afb14c392749adb7c07", "score": "0.5316454", "text": "function cloneBounds(bounds /*: Bounds*/) /*: Bounds*/ {\n return {\n left: bounds.left,\n top: bounds.top,\n right: bounds.right,\n bottom: bounds.bottom\n };\n}", "title": "" }, { "docid": "41541930bdf25afb14c392749adb7c07", "score": "0.5316454", "text": "function cloneBounds(bounds /*: Bounds*/) /*: Bounds*/ {\n return {\n left: bounds.left,\n top: bounds.top,\n right: bounds.right,\n bottom: bounds.bottom\n };\n}", "title": "" }, { "docid": "41541930bdf25afb14c392749adb7c07", "score": "0.5316454", "text": "function cloneBounds(bounds /*: Bounds*/) /*: Bounds*/ {\n return {\n left: bounds.left,\n top: bounds.top,\n right: bounds.right,\n bottom: bounds.bottom\n };\n}", "title": "" }, { "docid": "41541930bdf25afb14c392749adb7c07", "score": "0.5316454", "text": "function cloneBounds(bounds /*: Bounds*/) /*: Bounds*/ {\n return {\n left: bounds.left,\n top: bounds.top,\n right: bounds.right,\n bottom: bounds.bottom\n };\n}", "title": "" }, { "docid": "41541930bdf25afb14c392749adb7c07", "score": "0.5316454", "text": "function cloneBounds(bounds /*: Bounds*/) /*: Bounds*/ {\n return {\n left: bounds.left,\n top: bounds.top,\n right: bounds.right,\n bottom: bounds.bottom\n };\n}", "title": "" }, { "docid": "cfa0004707ebdcbc78be52d3041a85a8", "score": "0.52969414", "text": "clone(samay = new Samay()){ \n Object.getOwnPropertyNames(samay).forEach(prop => {\n if(this.hasOwnProperty(prop)){\n samay[prop] = this[prop];\n }\n });\n return samay;\n }", "title": "" }, { "docid": "75003ca0b787a209adabb63a9dcc2d68", "score": "0.5279688", "text": "copy() {\r\n return new Rect(this.width, this.height);\r\n }", "title": "" }, { "docid": "f1bac4584563f937c61d58f0e7aadcc0", "score": "0.5239577", "text": "clone()\n {\n return new Point(this.x, this.y);\n }", "title": "" }, { "docid": "137a5a6c695fe4a2fd4fddc0b1bfe93e", "score": "0.5203589", "text": "union(box) {\n const uni = new Box2D(\n Math.min(this.x, box.x),\n Math.min(this.y, box.y),\n 0, 0,\n );\n\n uni.right = Math.max(this.right, box.x + box.w);\n uni.bottom = Math.max(this.bottom, box.y + box.h);\n\n return uni;\n }", "title": "" }, { "docid": "23cc34839e780542737608fa4b3815d0", "score": "0.5199128", "text": "function cloneBounds(bounds) {\n\t return {\n\t left: bounds.left,\n\t top: bounds.top,\n\t right: bounds.right,\n\t bottom: bounds.bottom\n\t };\n\t}", "title": "" }, { "docid": "0a3b1f225a848a4f6147f64561a9062f", "score": "0.519277", "text": "clone () {\n\n var newBoard = new GameBoard(this.size);\n var i,j;\n\n for (i=0; i<this.size; i++) {\n for (j=0; j<this.size; j++) {\n newBoard.set(this.get(i, j), i, j);\n }\n }\n\n return newBoard;\n }", "title": "" }, { "docid": "c30fe3c45f5f30da4e53bc6fb59ebe18", "score": "0.51891446", "text": "insertObjectWithBoundingBox(obj, box) {\n for (var c of this.cellsIntersectingWith(box))\n this.insertObjectInCell(obj, c)\n }", "title": "" }, { "docid": "f7c26d30df93fe9ae78503e19e5d80d8", "score": "0.5186575", "text": "static OverlapBoxAll() {}", "title": "" }, { "docid": "6287eb29a2618dc96518b51c44efaf7b", "score": "0.51460195", "text": "increasBox(){\n this.size1 += 5;\n this.size2 -= 5;\n }", "title": "" }, { "docid": "9a2475e8bba7fb32b92f52022e0f1791", "score": "0.5143079", "text": "copy( shape ) {\n this.GLSL = shape.GLSL;\n this.gl = shape.gl;\n this.color = shape.color;\n this.fill = shape.fill;\n this.transformMatrix = shape.transformMatrix.duplicate();\n\n let vertices = [];\n let indices = [];\n\n for(let i = 0; i < shape.vertices.length; ++i) {\n let vertex = [];\n let index = [];\n for(let j = 0; j < 0; ++j) {\n vertex.push(shape.vertices[i][j]);\n index.push(shape.indices[i][j]);\n }\n vertices.push(vertex);\n indices.push(index);\n }\n\n this.vertices = vertices;\n this.indices = indices;\n\n for(let child of shape.children) {\n this.children.push( child.duplicate() );\n }\n\n return this;\n }", "title": "" }, { "docid": "a3c0decb47c42a92ed32faeb857825a1", "score": "0.5141643", "text": "clone() {\n return new this.constructor(this.attributes);\n }", "title": "" }, { "docid": "3110137fd7e3c0d81eaffa246939c40e", "score": "0.51239026", "text": "clone() {\n return new Point2D(this._x, this._y);\n }", "title": "" }, { "docid": "36e4e720a1d4c558b394d6e646aa3218", "score": "0.5122848", "text": "makeDefaultBoundingBox() {\n return new BoundingBox(this.pos.x, this.pos.y, this.dim.x, this.dim.y);\n }", "title": "" }, { "docid": "a82685410493e66144d2c4756225b047", "score": "0.508584", "text": "static OverlapBox() {}", "title": "" }, { "docid": "dbe02aa142494a2ddb5480949d160fd1", "score": "0.5083363", "text": "duplicate() {\n // if player is within the radius of the enemy\n if (player.x >= this.x-40 && player.x <= this.x+60 && player.y >= this.y-40 && player.y <= this.y+60) {\n // this if condition is to ensure enemy only duplicates once even if the player stays in the radius\n if (this.dup == true){\n enemy.push(new BlueGhost());\n this.dup = false;\n }\n }\n // if player is out of the radius, and comes within it again, enemy can duplicate again\n else {\n this.dup = true\n }\n }", "title": "" }, { "docid": "68192441b75a891baf377c3cce192daf", "score": "0.50715274", "text": "clone() {\n const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));\n if (this.range)\n copy.range = this.range.slice();\n return copy;\n }", "title": "" }, { "docid": "6517c3723d4b5528587f6f05978be0e6", "score": "0.5065666", "text": "copy() {\n\t\tvar newOrganism = new Organism(organism.genome.copy());\n\t\tnewOrganism.maxInputCount = maxInputCount;\n\t\tnewOrganism.maxOutputCount = maxOutputCount;\n\t\tnewOrganism.nodes = nodes.slice();\n\t\tnewOrganism.outputNodes = outputNodes.slice();\n\t}", "title": "" }, { "docid": "c82271422d516e8b74f4e98fc88c6223", "score": "0.50473964", "text": "function toBoundingBox(original) {\n return [\n { x: original[0], y: original[1] },\n { x: original[2], y: original[3] },\n { x: original[4], y: original[5] },\n { x: original[6], y: original[7] }\n ];\n}", "title": "" }, { "docid": "185ef5ebbdf5ed300d6cfceec416b42d", "score": "0.5046514", "text": "__init5() {this.boundingBoxes = new Array();}", "title": "" }, { "docid": "020ec70a837a52b50edbfa2f125f9528", "score": "0.5036153", "text": "get clone() {\n return new Point(this._x, this._y)\n }", "title": "" }, { "docid": "d42d2012f150ee4b00a161eb811d36ed", "score": "0.50240475", "text": "function copyBoxInto(box, originBox) {\n copyAxisInto(box.x, originBox.x);\n copyAxisInto(box.y, originBox.y);\n }", "title": "" }, { "docid": "44a342bf4dd8957faa0d12c69c19cad2", "score": "0.50203574", "text": "clone() {\n return new Vector3(this);\n }", "title": "" }, { "docid": "6059af0832269acd48d0affc74de7931", "score": "0.5016183", "text": "function Position(xtl, ytl, xbr, ybr, occluded, outside)\n{\n this.xtl = xtl;\n this.ytl = ytl;\n this.xbr = xbr;\n this.ybr = ybr;\n this.occluded = occluded ? true : false;\n this.outside = outside ? true : false;\n this.width = xbr - xtl;\n this.height = ybr - ytl;\n\n if (this.xbr <= this.xtl)\n {\n this.xbr = this.xtl + 1;\n }\n\n if (this.ybr <= this.ytl)\n {\n this.ybr = this.ytl + 1;\n }\n\n this.serialize = function() {\n return this.xtl + \",\" + \n this.ytl + \",\" +\n this.xbr + \",\" + \n this.ybr + \",\" +\n this.occluded + \",\" +\n this.outside;\n }\n\n this.serialize = function (scalingFactor) {\n\n var sxtl = Math.floor(this.xtl / scalingFactor);\n var sytl = Math.floor(this.ytl / scalingFactor);\n var sxbr = Math.floor(this.xbr / scalingFactor);\n var sybr = Math.floor(this.ybr / scalingFactor);\n\n return sxtl + \",\" +\n sytl + \",\" +\n sxbr + \",\" +\n sybr + \",\" +\n this.occluded + \",\" +\n this.outside;\n }\n\n /*this.serialize = function()\n {\n return \"[\" + this.xtl + \",\" +\n this.ytl + \",\" +\n this.xbr + \",\" +\n this.ybr + \",\" +\n this.occluded + \",\" +\n this.outside + \"]\";\n }*/\n\n this.clone = function()\n {\n return new Position(this.xtl,\n this.ytl,\n this.xbr,\n this.ybr,\n this.occluded,\n this.outside)\n }\n}", "title": "" }, { "docid": "865d8f6c109eb497fb03056024a804f9", "score": "0.49701938", "text": "function cloneSVG(){\n return this.element.cloneNode(true);\n }", "title": "" }, { "docid": "4729a3832a09f59fc2d2c3247484675b", "score": "0.49527213", "text": "Combine1(aabb) {\n this.lowerBound.x = b2_math_js_1.b2Min(this.lowerBound.x, aabb.lowerBound.x);\n this.lowerBound.y = b2_math_js_1.b2Min(this.lowerBound.y, aabb.lowerBound.y);\n this.upperBound.x = b2_math_js_1.b2Max(this.upperBound.x, aabb.upperBound.x);\n this.upperBound.y = b2_math_js_1.b2Max(this.upperBound.y, aabb.upperBound.y);\n return this;\n }", "title": "" }, { "docid": "e381dbf992a41a749eeb4c5018e6cbfe", "score": "0.49292973", "text": "clone() {\n const clone = new Brain(this.directions.length);\n for (let i = 0; i < this.directions.length ; i++) {\n const angle = this.directions[i].getDirection();\n clone.directions[i].setDirection(angle);\n }\n\n return clone;\n }", "title": "" }, { "docid": "42973c4a3645037c51fb7a4994ee44c1", "score": "0.49272412", "text": "function copyPlace (oldPlace) {\n console.log(\n '%c' + NAME + ': %c created a copy of the POI ' + oldPlace.attributes.name,\n 'color: #0DAD8D; font-weight: bold',\n 'color: dimgray; font-weight: normal'\n )\n\n let newPlace = new WazeFeatureVectorLandmark\n newPlace.attributes.name = oldPlace.attributes.name + ' (copy)'\n newPlace.attributes.phone = oldPlace.attributes.phone\n newPlace.attributes.url = oldPlace.attributes.url\n newPlace.attributes.categories = [].concat(oldPlace.attributes.categories)\n newPlace.attributes.aliases = [].concat(oldPlace.attributes.aliases)\n newPlace.attributes.description = oldPlace.attributes.description\n newPlace.attributes.houseNumber = oldPlace.attributes.houseNumber\n newPlace.attributes.lockRank = oldPlace.attributes.lockRank\n newPlace.attributes.geometry = oldPlace.attributes.geometry.clone()\n\n if (oldPlace.attributes.geometry.toString().match(/^POLYGON/)) {\n for (let i = 0; i < newPlace.attributes.geometry.components[0].components.length - 1; i++) {\n newPlace.attributes.geometry.components[0].components[i].x += 5\n newPlace.attributes.geometry.components[0].components[i].y += 5\n }\n } else {\n // Geometry not used for points as is\n // But you can use select multiple venues, and then click \"copy\"\n newPlace.attributes.geometry.x += 5\n newPlace.attributes.geometry.y += 5\n }\n\n newPlace.attributes.services = [].concat(oldPlace.attributes.services)\n newPlace.attributes.openingHours = [].concat(oldPlace.attributes.openingHours)\n newPlace.attributes.streetID = oldPlace.attributes.streetID\n\n if (oldPlace.attributes.categories.includes('GAS_STATION')) {\n newPlace.attributes.brand = oldPlace.attributes.brand\n }\n\n if (oldPlace.attributes.categories.includes('PARKING_LOT')) {\n newPlace.attributes.categoryAttributes.PARKING_LOT = {}\n\n let attributes = oldPlace.attributes.categoryAttributes.PARKING_LOT\n if ((attributes.lotType != null)) {\n newPlace.attributes.categoryAttributes.PARKING_LOT.lotType = [].concat(oldPlace.attributes.categoryAttributes.PARKING_LOT.lotType)\n }\n if ((attributes.canExitWhileClosed != null)) {\n newPlace.attributes.categoryAttributes.PARKING_LOT.canExitWhileClosed = oldPlace.attributes.categoryAttributes.PARKING_LOT.canExitWhileClosed\n }\n if ((attributes.costType != null)) {\n newPlace.attributes.categoryAttributes.PARKING_LOT.costType = oldPlace.attributes.categoryAttributes.PARKING_LOT.costType\n }\n if ((attributes.estimatedNumberOfSpots != null)) {\n newPlace.attributes.categoryAttributes.PARKING_LOT.estimatedNumberOfSpots = oldPlace.attributes.categoryAttributes.PARKING_LOT.estimatedNumberOfSpots\n }\n if ((attributes.hasTBR != null)) {\n newPlace.attributes.categoryAttributes.PARKING_LOT.hasTBR = oldPlace.attributes.categoryAttributes.PARKING_LOT.hasTBR\n }\n if ((attributes.lotType != null)) {\n newPlace.attributes.categoryAttributes.PARKING_LOT.lotType = [].concat(oldPlace.attributes.categoryAttributes.PARKING_LOT.lotType)\n }\n if ((attributes.parkingType != null)) {\n newPlace.attributes.categoryAttributes.PARKING_LOT.parkingType = oldPlace.attributes.categoryAttributes.PARKING_LOT.parkingType\n }\n if ((attributes.paymentType != null)) {\n newPlace.attributes.categoryAttributes.PARKING_LOT.paymentType = [].concat(oldPlace.attributes.categoryAttributes.PARKING_LOT.paymentType)\n }\n }\n\n W.model.actionManager.add(new WazeActionAddLandmark(newPlace))\n W.selectionManager.setSelectedModels(newPlace)\n }", "title": "" }, { "docid": "e47b8f693c0e332ede0a00cd182e5bf0", "score": "0.49031416", "text": "function ScriptelBoundingBox() {\n \"use strict\";\n /**\n * The left most edge.\n * @public\n * @instance\n * @type {number}\n */\n this.x1 = -1;\n /**\n * The right most edge.\n * @public\n * @instance\n * @type {number}\n */\n this.x2 = -1;\n /**\n * The top most edge.\n * @public\n * @instance\n * @type {number}\n */\n this.y1 = -1;\n /**\n * The bottom most edge.\n * @public\n * @instance\n * @type {number}\n */\n this.y2 = -1;\n /**\n * The total width of the points.\n * @public\n * @instance\n * @type {number}\n */\n this.width = -1;\n /**\n * The total height of the points.\n * @public\n * @instance\n * @type {number}\n */\n this.height = -1;\n}", "title": "" }, { "docid": "69de41acc66e309508892d433733f391", "score": "0.49006173", "text": "clone() {\n return createLineEdge();\n }", "title": "" }, { "docid": "caa6843e34fe3bd383474e638736e409", "score": "0.48973835", "text": "clone() { return this; }", "title": "" }, { "docid": "c50f4fa197cca1723d5af158de8c760e", "score": "0.48923433", "text": "_generate() {\n\n\t\tthis.faces.length = 0;\n\n\t\tthis._computeInitialHull();\n\n\t\tlet vertex;\n\n\t\twhile ( vertex = this._nextVertexToAdd() ) {\n\n\t\t\tthis._addVertexToHull( vertex );\n\n\t\t}\n\n\t\tthis._updateFaces();\n\n\t\tthis._postprocessHull();\n\n\t\tthis._reset();\n\n\t\treturn this;\n\n\t}", "title": "" }, { "docid": "a2b2e43a8031d7913a2b1b63727b4ee5", "score": "0.48829332", "text": "function BoundingBox(x1, y1, x2, y2) {\n this.x1 = Number.NaN;\n this.y1 = Number.NaN;\n this.x2 = Number.NaN;\n this.y2 = Number.NaN;\n\n Object.defineProperty(this, 'x', {\n get: function() {\n return this.x1;\n },\n set: function(val) {\n this.x1 = val;\n }\n });\n\n Object.defineProperty(this, 'y', {\n get: function() {\n return this.y1;\n },\n set: function(val) {\n this.y1 = val;\n }\n });\n\n Object.defineProperty(this, 'width', {\n get: function() {\n return this.x2 - this.x1;\n }\n });\n\n Object.defineProperty(this, 'height', {\n get: function() {\n return this.y2 - this.y1;\n }\n });\n\n this.addPoint(x1, y1);\n this.addPoint(x2, y2);\n}", "title": "" }, { "docid": "5da978044e7e623e76c7546b3d53b1c5", "score": "0.4862369", "text": "clone() {\n return Object.create(this);\n }", "title": "" }, { "docid": "5da978044e7e623e76c7546b3d53b1c5", "score": "0.4862369", "text": "clone() {\n return Object.create(this);\n }", "title": "" }, { "docid": "5da978044e7e623e76c7546b3d53b1c5", "score": "0.4862369", "text": "clone() {\n return Object.create(this);\n }", "title": "" }, { "docid": "c5317d375610f3d1265f71ad5bb9f0f3", "score": "0.48565164", "text": "clone() {\n var result = new vec2( this.m[0], this.m[1] );\n return result;\n }", "title": "" }, { "docid": "efd3b0432e833077281868d83c80af38", "score": "0.48548016", "text": "replaceArea(dst, src) {\r\n if (dst === src)\r\n return;\r\n\r\n src.pos[0] = dst.pos[0];\r\n src.pos[1] = dst.pos[1];\r\n src.size[0] = dst.size[0];\r\n src.size[1] = dst.size[1];\r\n\r\n src.floating = dst.floating;\r\n src._borders = dst._borders;\r\n src._verts = dst._verts;\r\n\r\n if (this.sareas.indexOf(src) < 0) {\r\n this.sareas.push(src);\r\n this.shadow.appendChild(src);\r\n }\r\n\r\n if (this.sareas.active === dst) {\r\n this.sareas.active = src;\r\n }\r\n\r\n //this.sareas.remove(dst);\r\n //dst.remove();\r\n\r\n this.sareas.remove(dst);\r\n dst.remove();\r\n\r\n this.regenScreenMesh();\r\n this.snapScreenVerts();\r\n this._updateAll();\r\n }", "title": "" }, { "docid": "72762b5dfe0f380e5bb1394187208404", "score": "0.48523274", "text": "get clone() {\n return new Vec2(this.x, this.y);\n }", "title": "" }, { "docid": "8833a96c7e84799a8ae46da5af758460", "score": "0.48432195", "text": "reconstruct() {\n this.x_coordinate = innerWidth;\n this.calculateDimensions();\n this.cleared = false;\n }", "title": "" }, { "docid": "f57dcda0043e8985c9d696fbdc4172a2", "score": "0.4834335", "text": "function cloneSVG(){ // 6812\n return this.element.cloneNode(true); // 6813\n }", "title": "" }, { "docid": "779309237f9722054e470b0180d415ec", "score": "0.48326877", "text": "generateBoundingBox(pIndex) {\n\n var rotation = this.listOfObjects[pIndex].getRotation();\n var rotationMatrix = Matrix.createRotation(rotation);\n\n \n var object = this.listOfObjects[pIndex].getPolygon();\n var scale = this.listOfObjects[pIndex].getScale();\n var scaleMatrix = Matrix.createScale(scale);\n var vector = new Vector(0,0,0);\n var tempScale = new Vector(1,1,1);\n var tempPolygon = new Polygon(vector, 0, tempScale)\n\n //getting reference of object in relation to the canvas\n var trueOrigin = this.listOfObjects[pIndex].getPosition();\n \n for(var i = 0; i< object.getNumberOfPoints();i++) {\n var tempVector = new Vector(0,0,0);\n \n //need to rotate the points so that rotated objects have their proper point positions\n var transform = Matrix.createTranslation(object.getPointAt(i));\n var newMatrix = rotationMatrix.multiply(transform);\n newMatrix = scaleMatrix.multiply(newMatrix);\n\n tempVector.setX(newMatrix.getElement(0,2));\n tempVector.setY(newMatrix.getElement(1,2));\n \n var point = tempVector.add(trueOrigin);\n tempPolygon.addPoint(point.getX(), point.getY(), point.getZ());\n }\n\n //having the min/max values stored in arrays since there can be multiple points at the lowest x or y value, a non-rotated square is a good example\n var minX = [];\n minX.push(tempPolygon.getPointAt(0));\n var maxX = [];\n maxX.push(tempPolygon.getPointAt(0));\n var minY = [];\n minY.push(tempPolygon.getPointAt(0));\n var maxY = [];\n maxY.push(tempPolygon.getPointAt(0));\n\n //find min x\n for(var i = 1; i < tempPolygon.getNumberOfPoints(); i++) {\n if(tempPolygon.getPointAt(i).getX() < minX[0].getX()) {\n minX = [];\n minX.push(tempPolygon.getPointAt(i));\n } else if(tempPolygon.getPointAt(i).getX() == minX[0].getX()) {\n minX.push(tempPolygon.getPointAt(i))\n }\n }\n\n //find max x\n for(var i = 1; i < tempPolygon.getNumberOfPoints(); i++) {\n if(tempPolygon.getPointAt(i).getX() > maxX[0].getX()) {\n maxX = [];\n maxX.push(tempPolygon.getPointAt(i));\n } else if(tempPolygon.getPointAt(i).getX() == maxX[0].getX()) {\n maxX.push(tempPolygon.getPointAt(i));\n }\n }\n\n //find min y\n for(var i = 1; i < tempPolygon.getNumberOfPoints(); i++) {\n if(tempPolygon.getPointAt(i).getY() < minY[0].getY()) {\n minY = [];\n minY.push(tempPolygon.getPointAt(i));\n } else if(tempPolygon.getPointAt(i).getY() == minY[0].getY()) {\n minY.push(tempPolygon.getPointAt(i));\n }\n }\n\n //find max y\n for(var i = 1; i < tempPolygon.getNumberOfPoints(); i++) {\n if(tempPolygon.getPointAt(i).getY() > maxY[0].getY()) {\n maxY = [];\n maxY.push(tempPolygon.getPointAt(i));\n } else if(tempPolygon.getPointAt(i).getY() == maxY[0].getY()) {\n maxY.push(tempPolygon.getPointAt(i));\n }\n }\n\n //They are stored as vectors still since it is worthless having just a x or y value\n this.listOfObjects[pIndex].setMaxX(maxX);\n this.listOfObjects[pIndex].setMinX(minX);\n this.listOfObjects[pIndex].setMaxY(maxY);\n this.listOfObjects[pIndex].setMinY(minY);\n }", "title": "" }, { "docid": "805215ea51d02c4c7d092754f91b0818", "score": "0.48110715", "text": "addNew() {\n this.rectangulars.push({\n height: 0,\n width: 0,\n color: '#000',\n x: 0,\n y: 0,\n rx: 0,\n ry: 0\n });\n }", "title": "" }, { "docid": "da17a441054c5fb5ebe0c91b3436902b", "score": "0.48045167", "text": "function cloneBox(object) {\r\n var clone = new Physijs.BoxMesh(object.clone().geometry, object.material, object.mass);\r\n clone.visible = false;\r\n return clone;\r\n}", "title": "" }, { "docid": "5d7685e3fc3f00648dca387329aed7a1", "score": "0.47997", "text": "copy() {\n\t\tvar newGenome = new Genome();\n\t\tthis.nodeGenes.forEach(function (nodeGene) {\n\t\t\tnewGenome.addNodeGene(nodeGene.copy());\n\t\t});\n\t\tthis.connectionGenes.forEach(function (connGene) {\n\t\t\tnewGenome.addConnectionGene(connGene.copy());\n\t\t});\n\t\treturn newGenome;\n\t}", "title": "" }, { "docid": "2403283ce800297363ad1ef48edab5d9", "score": "0.47971496", "text": "updateBB() {\n this.lastWorldBB = this.worldBB;\n this.worldBB = this.makeDefaultBoundingBox();\n }", "title": "" }, { "docid": "572867ed74cc56824c540571a1e86365", "score": "0.47947896", "text": "copy() {\n this._copy();\n }", "title": "" }, { "docid": "f09d65fb27a9c594c800fbf986d876d2", "score": "0.47937313", "text": "clone() {\n return Object.create(this);\n }", "title": "" }, { "docid": "f09d65fb27a9c594c800fbf986d876d2", "score": "0.47937313", "text": "clone() {\n return Object.create(this);\n }", "title": "" }, { "docid": "f09d65fb27a9c594c800fbf986d876d2", "score": "0.47937313", "text": "clone() {\n return Object.create(this);\n }", "title": "" }, { "docid": "f09d65fb27a9c594c800fbf986d876d2", "score": "0.47937313", "text": "clone() {\n return Object.create(this);\n }", "title": "" }, { "docid": "f09d65fb27a9c594c800fbf986d876d2", "score": "0.47937313", "text": "clone() {\n return Object.create(this);\n }", "title": "" }, { "docid": "8ebbec0a8e6894c6b96a8cd9bb9b4a46", "score": "0.47875613", "text": "cloneBoard(newBoard){\n for(let i=0; i<this.size; ++i){\n for(let j=0; j<this.size; ++j){\n if (!this.grid[i][j]){\n newBoard.grid[i][j] = false;\n }else{\n newBoard.grid[i][j] = this.grid[i][j]\n }\n }\n }\n newBoard.ships = this.ships;\n return newBoard;\n }", "title": "" }, { "docid": "7e2976cdf6a340048fed3eb537243a53", "score": "0.47859818", "text": "function Box () {\n this.coordinate = [],\n this.marked = false\n}", "title": "" }, { "docid": "ab6fad0eed39e9c33c484c818041c0e3", "score": "0.4755515", "text": "normalize() {\n return this.resize(1);\n }", "title": "" }, { "docid": "8b4ee33171a84edd9057f7aa9ae80f98", "score": "0.47444475", "text": "clone() {\n return this.slice()\n }", "title": "" }, { "docid": "5b0a444c83357268e24d061a8d7992a8", "score": "0.47434515", "text": "updateAABB() {\n const that = this;\n var aabb = (function mergeAABBRecursively(elem) {\n if (elem instanceof M_Group) {\n var children = elem.getChildren();\n for (let i = 0; i < children.length; i++) {\n var aabb = mergeAABBRecursively(children[i]);\n if (aabb instanceof AABB) {\n elem.AABB.mergeAABB(aabb);\n } else {\n console.assert(\"calculation of AABB error!\");\n }\n }\n if (!elem.AABB.isValid()) {\n that._logger.out(\n GLBoost.LOG_LEVEL_WARN,\n GLBoost.LOG_TYPE_AABB,\n true,\n \"This AABB has abnormal values\",\n elem.userFlavorName,\n elem.AABB\n );\n }\n return elem.AABB;\n //return AABB.multiplyMatrix(elem.transformMatrix, elem.AABB);\n }\n if (elem instanceof M_Mesh) {\n let aabb = elem.AABBInWorld;\n //console.log(aabb.toString());\n return aabb;\n }\n\n return null;\n })(this);\n this.AABB.mergeAABB(aabb);\n\n let newAABB = this.AABB;\n\n // this._AABB = aabbInWorld;\n\n this._updateAABBGizmo();\n\n return newAABB;\n }", "title": "" }, { "docid": "3acf824805059baa3ea58dd0ee07e021", "score": "0.4740893", "text": "function duplicateEntry() {\n const oldEntryID = $('#entries_combo').val();\n if (oldEntryID >= 0) {\n const newEntryTop = canvas.stageHeight - canvas.entryHeight - 50;\n const oldEntryTop = canvas.entries[oldEntryID].top;\n const newEntry = createEntry(0, newEntryTop);\n\n // Duplicate all markareas of the old entry\n const oldEntryAreas = canvas.entries[oldEntryID].answerSpaces;\n Object.values(oldEntryAreas).forEach((oldEntryArea) => {\n const newMarkTop = (oldEntryArea.top - oldEntryTop) + newEntryTop;\n const newMarkLeft = oldEntryArea.left;\n const newMarkVariable = oldEntryArea.variable;\n const newMarkValue = oldEntryArea.value;\n newEntry.createAnswerSpace(newMarkLeft, newMarkTop, newMarkVariable, newMarkValue);\n });\n }\n }", "title": "" }, { "docid": "e098755013a49471706c67456173abf7", "score": "0.47406945", "text": "function BoundingBoxRect() { }", "title": "" }, { "docid": "159631687efa4725c94964b4478c1146", "score": "0.47390977", "text": "function OverlapKeeper(){this.overlappingShapesLastState=new TupleDictionary,this.overlappingShapesCurrentState=new TupleDictionary,this.recordPool=[],this.tmpDict=new TupleDictionary,this.tmpArray1=[]}", "title": "" }, { "docid": "075326cd982946e20a3ebdd4c412cc85", "score": "0.47389594", "text": "clone () {\n const l = this._location\n return new Location(l.lat(), l.lon(), l.place(), l.region(), l.country(), l.timezone(), l.gmt())\n }", "title": "" } ]
320719e391eb4754ef406764eacdcb95
Open subnavigation in mobile
[ { "docid": "c7efdd31b9b96c4319826ed8be81d6f9", "score": "0.63505226", "text": "openSubNav(e, subitem, siblings) {\n let parent = subitem;\n\n siblings.forEach(sibling => {\n if(sibling !== parent) {\n sibling.classList.remove('open');\n }\n })\n\n if (parent.classList.contains('open')) {\n parent.classList.remove('open');\n }else {\n parent.classList.add('open');\n\n }\n }", "title": "" } ]
[ { "docid": "0f47930d4ff1e1450ef689c659447ed3", "score": "0.70208126", "text": "function toggleMobileNavSubmenu(e) {\n var listItem = e.delegateTarget;\n var id = $(listItem).attr('id');\n var levelPrefix = id.substr(0, id.indexOf('-'));\n\n e.preventDefault();\n e.stopPropagation();\n \n if (debugPreopen) {\n console.log('Subnav button clicked');\n }\n toggleSubnavState(listItem, levelPrefix);\n }", "title": "" }, { "docid": "68cdc48a111f403b22164c99dad73d4f", "score": "0.69322515", "text": "function mobile_nav(){\n\t\tjQuery(\".sub-menu\").parent('li').addClass('has-child');\n\t\tjQuery(\".mega-menu\").parent('li').addClass('has-child');\n\t\tjQuery(\"<div class='fa fa-angle-right submenu-toogle'></div>\").insertAfter(\".has-child > a\");\n\t\tjQuery('.has-child a+.submenu-toogle').on('click',function(ev) {\n\t\t\tjQuery(this).next(jQuery('.sub-menu')).slideToggle('fast', function(){\n\t\t\t\tjQuery(this).parent().toggleClass('nav-active');\n\t\t\t});\n\t\t\tev.stopPropagation();\n\t\t});\n\t }", "title": "" }, { "docid": "fed42ac253ddfd36455c1acc3e327b85", "score": "0.68547916", "text": "function mobile_nav(){\r\n\t\tjQuery(\".sub-menu\").parent('li').addClass('has-child');\r\n\t\tjQuery(\".mega-menu\").parent('li').addClass('has-child');\r\n\t\tjQuery(\"<div class='fa fa-plus submenu-toogle'></div>\").insertAfter(\".has-child > a\");\r\n\t\tjQuery('.has-child a+.submenu-toogle').on('click',function(ev) {\r\n\t\t\tjQuery(this).next(jQuery('.sub-menu')).slideToggle('fast', function(){\r\n\t\t\t\tjQuery(this).parent().toggleClass('nav-active');\r\n\t\t\t});\r\n\t\t\tev.stopPropagation();\r\n\t\t});\r\n\t\t\r\n\t }", "title": "" }, { "docid": "3b3f14e6b657aa1c14a96b77dac22a1f", "score": "0.6772163", "text": "function openSubNavFromNavItem() {\n theme.cache.$actionBarMainMenu.removeClass(showClass);\n\n // loop through any dropdowns that exist\n theme.cache.$actionBarSubMenus.each(function() {\n var $el = $(this);\n\n if (activeSubNavTarget === $el.attr('data-child-list-handle')) {\n $el.prepareTransition().addClass(showClass);\n theme.setFocus($el.find('.action-bar__link').eq(0), 'action-bar');\n }\n });\n\n actionBarScroll();\n }", "title": "" }, { "docid": "a22cd206fafc95e8064d4f2c2cfa4125", "score": "0.6742074", "text": "function mobileNavToggle () {\r\n if ($('.header .header-navigation.navbar .navbar-nav .sub-menu').length) {\r\n $('.header .header-navigation.navbar .navbar-nav .sub-menu').parent('li').children('a').append(function () {\r\n return '<button class=\"sub-nav-toggler\"> <span class=\"sr-only\">Toggle navigation</span> <span class=\"icon-bar\"></span> <span class=\"icon-bar\"></span> <span class=\"icon-bar\"></span> </button>';\r\n });\r\n $('.header .header-navigation.navbar .navbar-nav .sub-nav-toggler').on('click', function () {\r\n var Self = $(this);\r\n Self.parent().parent().children('.sub-menu').slideToggle();\r\n return false;\r\n });\r\n\r\n };\r\n}", "title": "" }, { "docid": "acc15e8d6cba39b7f7435aeb54e8bf70", "score": "0.66766554", "text": "function setupMobileMenu() {\n\n $('.mobile-subnav-control').bind('click.citishare', function (e) {\n var $this = $(this);\n var $subnav = $('#' + $this.attr('aria-controls'));\n\n openSubNav($subnav, $this);\n\n $subnav.find('.sub-nav-back').bind('click touchend', function (e) {\n closeSubNav($subnav, $this);\n $(this).unbind('click');\n setTimeout(function () {\n $('#mobile-menu a:visible:first').focus();\n }, 25);\n e.preventDefault();\n return false;\n });\n\n e.preventDefault();\n return false;\n });\n\n /**\n * Triggers close search and removes padding top when\n * browser is resized to larger than tablet 960px\n *\n * Conditions: If the browser width is larger than tablet,\n * and search bar is opened (true state set in openSearch())\n */\n $(window).bind('resize', function () {\n if (Header.windowWidth > 960 && Header.searchOpen) {\n closeSearch();\n }\n });\n\n initMenu();\n }", "title": "" }, { "docid": "4d100e49f329bb54cf88b1e70274f6eb", "score": "0.6657853", "text": "function mobileNav() {\n var mobileMenu = document.getElementById('mobile-menu');\n var mobileMenuState = mobileMenu.dataset.toggle;\n\n if (mobileMenuState === 'off') {\n\n\n //add active-tab class to currently open nav location\n var pointer = document.elementFromPoint(30, (window.innerHeight / 2)).parentNode.id;\n if ((pointer != \"\" )&&( pointer != null) && ( document.querySelector('[data-target=\\'' + pointer + '\\']') != null) ) {\n document.querySelector('[data-target=\\'' + pointer + '\\']').classList.add('active-tab');\n document.querySelector('[data-target=\\'' + pointer + '\\']').parentNode.classList.add('active-tab');\n document.querySelector('[data-target=\\'' + pointer + '\\']').parentNode.previousElementSibling.classList.add('active-tab');\n }\n mobileMenu.dataset.toggle = 'on';\n //add active-url class to mobile navigations open window menu\n var currUrl = /\\/www.kaiskauda.lt\\/(.*)\\//.exec(document.URL);\n if (currUrl === null) {\n document.getElementById('renginiai').classList.add('active-url');\n } else if (currUrl[1] != null) {\n document.getElementById(currUrl[1]).classList.add('active-url');\n }\n\n } else {\n mobileMenu.dataset.toggle = 'off';\n removeAllClass('active-tab');\n }\n}", "title": "" }, { "docid": "787ccac2213ae469893709828e20b852", "score": "0.6657457", "text": "function showPersooDemoLocalNavigation(){\n var localNavDiv = document.getElementById('localNavigation');\n localNavDiv.className += ' well';\n localNavDiv.style.padding = '8px 0';\n\n var navConfig = persooDemo.localNavigation;\n var navHTML = '<ul class=\"nav nav-list\">' +\n '<li class=\"nav-header\">This demo pages</li>';\n var active;\n var uniqueID=1;\n for(var item in navConfig){\n if( navConfig.hasOwnProperty(item) ){\n if( typeof navConfig[item] === 'string' ){\n // add item\n active = ( matchFilenameInUrl(document.URL, navConfig[item]) ? ' class=\"active\"' : '');\n navHTML += '<li'+ active +'><a href=\"' + navConfig[item] + '\">' + item + '</a></li>';\n } else if( typeof navConfig[item] === 'object' ){\n // add sub section\n\n\n var subNavHTML = \"\",\n subConfig = navConfig[item],\n activeSubNav = false;\n for(var subitem in subConfig){\n if( subConfig.hasOwnProperty(subitem) ){\n if( typeof subConfig[subitem] === 'string' ){\n // add sub item\n active = ( matchFilenameInUrl(document.URL, subConfig[subitem]) ? ' class=\"active\"' : '');\n subNavHTML += '<li' + active + '><a href=\"' + subConfig[subitem] + '\">' + subitem + '</a></li>';\n if(active){ activeSubNav = true; }\n }\n // other levels are not supported\n }\n }\n\n navHTML += '<li><a href=\"#\" data-target=\"#submenu' + uniqueID + '\" data-toggle=\"collapse\"><i class=\"icon-chevron-right\"></i>' +\titem + '</a>';\n navHTML += '<ul id=\"submenu' + uniqueID + '\" class=\"nav nav-list collapse' + (activeSubNav ? ' in':'') + '\">';\n uniqueID++;\n navHTML += subNavHTML;\n navHTML += '</ul></li>';\n }\n }\n }\n navHTML += '</ul>';\n\n localNavDiv.innerHTML = navHTML;\n}", "title": "" }, { "docid": "3582c971486e1d7de57bde4740e506cc", "score": "0.66491896", "text": "function mobileNav() {\n\t\tvar width = $(window).width();\n\t\t$('.submenu').on('click', function() {\n\t\t\tif(width < 767) {\n\t\t\t\t$('.submenu ul').removeClass('active');\n\t\t\t\t$(this).find('ul').toggleClass('active');\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "66619b84aa6d3ccd3f587cb220464448", "score": "0.6617495", "text": "function mobileNav() {\n\t\t\n\t\tvar width = $(window).width();\n\t\t\n\t\t$('.submenu').on('click', function() {\n\t\t\tif(width < 767) {\n\t\t\t\t$('.submenu ul').removeClass('active');\n\t\t\t\t$(this).find('ul').toggleClass('active');\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "b021768085480a54aaf95ee34339dab0", "score": "0.6612138", "text": "function openSubNav(subnav, subnavTitle) {\n subnav.attr('aria-expanded', true).attr('aria-hidden', false).addClass('opened');\n subnavTitle.attr('aria-expanded', true);\n subnavTitle.addClass('sub-menu-opened').attr('aria-hidden', true);\n Header.openedSubNav = subnavTitle;\n\n setTimeout(function () {\n $('#mobile-menu > ol > li > a').not('.sub-menu-opened').parent().each(function (i, elem) {\n $(elem).attr('aria-hidden', true);\n });\n $('#oc-trigger').attr('aria-hidden', true);\n $('.sub-nav-back:visible:first').focus();\n }, 25);\n }", "title": "" }, { "docid": "c7ac4ec204642d5651e65803c67a0f45", "score": "0.66011566", "text": "function mobileNav() {\n\tvar width = $(window).width();\n\t$('.submenu').on('click', function () {\n\t if (width < 767) {\n\t\t$('.submenu ul').removeClass('active');\n\t\t$(this).find('ul').toggleClass('active');\n\t }\n\t});\n }", "title": "" }, { "docid": "d7b217a572d8dc774eb0bba3fb46674a", "score": "0.65504783", "text": "function smallNavFunctionality() {\n var windowWidth = window.innerWidth;\n var mainNav = $(\".navigation-holder\");\n var smallNav = $(\".navigation-holder > .small-nav\");\n var subMenu = smallNav.find(\".sub-menu\");\n var megamenu = smallNav.find(\".mega-menu\");\n var menuItemWidthSubMenu = smallNav.find(\".menu-item-has-children > a\");\n if (windowWidth <= 991) {\n subMenu.hide();\n megamenu.hide();\n menuItemWidthSubMenu.on(\"click\", function (e) {\n var $this = $(this);\n $this.siblings().slideToggle();\n e.preventDefault();\n e.stopImmediatePropagation();\n });\n }\n else if (windowWidth > 991) {\n mainNav.find(\".sub-menu\").show();\n mainNav.find(\".mega-menu\").show();\n }\n }", "title": "" }, { "docid": "2fc06e87118ff3d43d6acef343bbb3ec", "score": "0.6547755", "text": "function smallNavchild() {\n var mainNav = $(\".navigation-mobile\");\n var smallNav = $(\".navigation-mobile > .small-nav\");\n var subMenu = smallNav.find(\".sub-menu\");\n var menuItemWidthSubMenu = smallNav.find(\"> li:has(ul) > a \");\n\n subMenu.hide();\n menuItemWidthSubMenu.on(\"click\", function(e) {\n var $this = $(this);\n $this.siblings().slideToggle();\n e.preventDefault();\n e.stopImmediatePropagation();\n })\n }", "title": "" }, { "docid": "262349f80e1166a6ec6d5461f46752ae", "score": "0.6505244", "text": "function smallNavFunctionality() {\n var windowWidth = window.innerWidth;\n var mainNav = $(\".navigation-holder\");\n var smallNav = $(\".navigation-holder > .small-nav\");\n var subMenu = smallNav.find(\".sub-menu\");\n var megamenu = smallNav.find(\".mega-menu\");\n var menuItemWidthSubMenu = smallNav.find(\".menu-item-has-children > a\");\n\n if (windowWidth <= 991) {\n subMenu.hide();\n megamenu.hide();\n menuItemWidthSubMenu.on(\"click\", function(e) {\n var $this = $(this);\n $this.siblings().slideToggle();\n e.preventDefault();\n e.stopImmediatePropagation();\n })\n } else if (windowWidth > 991) {\n mainNav.find(\".sub-menu\").show();\n mainNav.find(\".mega-menu\").show();\n }\n }", "title": "" }, { "docid": "4d40c88707b175df2f7ef69acf75cbb6", "score": "0.6491597", "text": "function archiplus_mobile_menu() {\n\t\tif ( $( window ).width() > 768 ) return false;\n\n\t\t$( '.open-sub-menu' ).each( function() {\n\t\t\t$( this ).on( 'click', function( e ) {\n\t\t\t\te.preventDefault();\n\t\t\t\t$( this ).next().slideUp( 300 );\n\t\t\t\t$( this ).text( '+' );\n\t\t\t\tif ( $( this ).next().is( ':hidden' ) === true ) {\n\t\t\t\t\t$( this ).next().slideDown( 300 );\n\t\t\t\t\t$( this ).text( '-' );\n\t\t\t\t}\n\t\t\t} );\n\t\t} );\n\n\t\t$( '.mean-link-open' ).each( function() {\n\t\t\t$( this ).on( 'click', function( e ) {\n\t\t\t\te.preventDefault();\n\t\t\t\t$( this ).next().slideUp( 300 );\n\t\t\t\t$( this ).parent().addClass( 'close-menu' );\n\t\t\t\t$( this ).parent().removeClass( 'open-menu' );\n\t\t\t\tif ( $( this ).next().is( ':hidden' ) === true ) {\n\t\t\t\t\t$( this ).next().slideDown( 300 );\n\t\t\t\t\t$( this ).parent().addClass( 'open-menu' );\n\t\t\t\t\t$( this ).parent().removeClass( 'close-menu' );\n\t\t\t\t}\n\t\t\t} );\n\t\t} );\n\t}", "title": "" }, { "docid": "4b7b5de11e6f78a57a589a174137376b", "score": "0.64657414", "text": "function toggleMobileNavigation() {\n\n\tif ($(window).width() < breakPointValue) {\n\t\tif ($('.mobile-nav-icon').attr('toggled') === 'false') {\n\t\t\t$('.mobile-nav-icon').attr('toggled', 'true');\n\t\t\t$('.navbar').css('display', 'block');\n\t\t} else {\n\t\t\t$('.mobile-nav-icon').attr('toggled', 'false');\n\t\t\t$('.navbar').css('display', 'none');\n\t\t}\n\t}\n\n}", "title": "" }, { "docid": "ca9e14f2335afc7d0e9a77bb1cbaf0df", "score": "0.64421624", "text": "function openSubNavFromSubNavItem() {\n //select the first active subnav item (uses .last() because jQuery)\n var $activeSubNav = $activeSubNavItem\n .parents('.action-bar__menu--sub')\n .last();\n\n theme.cache.$actionBarMainMenu.removeClass(showClass);\n $activeSubNav.addClass(showClass);\n\n // find parent menu item and mark it active\n theme.cache.$actionBarMenuHasDropdown.each(function() {\n var $el = $(this);\n var menuHandle = $el.attr('data-child-list-handle');\n\n if (menuHandle === $activeSubNav.attr('data-child-list-handle')) {\n $el.addClass('action-bar--disabled');\n\n //update the active parent childListHandle\n activeSubNavTarget = menuHandle;\n }\n });\n\n actionBarScroll();\n }", "title": "" }, { "docid": "fd2c6495fbfd2a47ff316af824f02bc8", "score": "0.64176255", "text": "function openNav(){\n $('.sub-sidebar > ul.menu').toggle();\n}", "title": "" }, { "docid": "45f2b6d2653425575a0a9e7e250b6c04", "score": "0.64124954", "text": "function mobileNavigation(){\n if( $(window).width() < 979 ){\n $(\".main-navigation.navigation-top-header\").remove();\n $(\".toggle-navigation\").css(\"display\",\"inline-block\");\n $(\".main-navigation.navigation-off-canvas\").load(\"assets/external/_navigation.html\");\n $(\"body\").removeClass(\"navigation-top-header\");\n $(\"body\").addClass(\"navigation-off-canvas\");\n }\n}", "title": "" }, { "docid": "32d34e81d4f8c5db4ea0babbb2d3ac80", "score": "0.63517094", "text": "function showMobileNav() {\n // Permet d'afficher le sous menu de nav sur mobile (A revoir -> RMC)\n $('#mobile-nav').click(function () {\n setTimeout(function () {\n $('#selectedSite').find('a').click()\n }, 300);\n });\n}", "title": "" }, { "docid": "40d97b6afa2598e45a7c6006c36ef94c", "score": "0.63110054", "text": "function toggleMobileMenu() {\n $('#header nav').toggleClass('open');\n }", "title": "" }, { "docid": "464ffe526392d441182a1ec3b7c1f608", "score": "0.6306898", "text": "function openMobile() {\n // Show overlay\n $(\".mobile__fade\").fadeIn('200');\n // add the active class from the mobile nav\n $(\".mobile__navigation\").addClass('mobile__navigation--active');\n // add the overflow restrictions from the website\n $(\"body, html\").addClass('overflow');\n // Swap the menu icon for the close icon. \n $(\".mobile__icon\").addClass(\"mobile__icon--close\");\n}", "title": "" }, { "docid": "b205917d5ea2074837bfba3efbd36976", "score": "0.62532574", "text": "function showMobileNavigation(){\n $(\".pf-mobile-navigation-trigger\").on('click',function(){\n \n if($(\"#pf-header\").hasClass(\"pf-header-hide\")){\n $(this).find(\"span\").first().addClass(\"is-clicked\");\n $(\"#pf-header\").switchClass(\"pf-header-hide\",\"pf-header-show\");\n\n }\n else{\n $(this).find(\"span\").first().removeClass(\"is-clicked\");\n $(\"#pf-header\").switchClass(\"pf-header-show\",\"pf-header-hide\");\n }\n \n });\n}", "title": "" }, { "docid": "26827ea004efcf2b1e7d50ccdb30938c", "score": "0.62178385", "text": "function init_menumobile()\r\n {\r\n $('.navbar-collapse ul li a').on('click', function (e)\r\n {\r\n $('.navbar-toggle:visible').click();\r\n });\r\n }", "title": "" }, { "docid": "c59fe4f8252d56df6889307042d4b709", "score": "0.6187419", "text": "function openNav() {\n\t\n\tvar html=\"\";\n\n\n\tStore.treeIterate(function(node){\n\t\thtml+='<li class=\"list-group-item node-treeview4\" data-nodeid=\"0\" style=\"color:undefined;background-color:undefined;\" data-cell=\"'+node.cell+'\">'+node.title+'</li>';\t\t\n\t});\n\t\n\t// Store.iterate(function(index,row){\n\t// \tvar value=row[\"id\"];\n\t//\n\t// \tif (value){\n\t// \t\thtml+='<li class=\"list-group-item node-treeview4\" data-nodeid=\"0\" style=\"color:undefined;background-color:undefined;\">Article '+index+'</li>';\n\t// \t\t// html+=\"<button class='btn btn-default'> Article \"+value+\". </button>\";\n\t// \t}\n\t// });\n\n\tvar el=$(\"#mySidenav\");\n\tel.html('<ul class=\"list-group\">'+\n\t\t\thtml+\n\t\t\t'</ul>');\n\t\n\tel.css(\"width\",\"200px\");\n\t\n document.getElementById(\"main\").style.marginLeft = \"200px\";\n}", "title": "" }, { "docid": "133f6d68348d6bb08d6177969444a3e7", "score": "0.6186764", "text": "function setup_responsive_nav() {\r\n\t\t\r\n\t\t/* build responsive menu in dropdown select */\t\t\r\n\t\tselectnav('accordion-menu-js', {\r\n\t\t label: 'Quick Menu ',\r\n\t\t nested: true,\r\n\t\t indent: '-'\r\n\t\t});\r\n\t\t\r\n\t}", "title": "" }, { "docid": "6e4714fa7230a2743cfab25fd98a1489", "score": "0.61779106", "text": "function initMainNavigation(container) {\n // Add dropdown toggle that displays child menu items.\n var dropdownToggle = $('<button />', {\n 'class': 'nav-toggle',\n 'aria-expanded': false\n }).append($( '<span />', {\n 'class': 'sr-only',\n text: screenReaderText.expand\n }));\n\n container.find('.menu-item-has-children:has(ul) > a').after(dropdownToggle);\n\n // Toggle buttons and submenu items with active children menu items.\n // container.find('.current-menu-ancestor > button').addClass('expanded');\n // container.find('.current-menu-ancestor > .sub-menu').addClass('expanded');\n\n // Add menu items with submenus to aria-haspopup=\"true\".\n container.find('.menu-item-has-children:has(ul)').attr('aria-haspopup', 'true');\n\n container.find('.nav-toggle').click(function(e) {\n var _this = $(this),\n screenReaderSpan = _this.find('.sr-only'),\n expand = _this.attr('aria-expanded') === 'false';\n e.preventDefault();\n\n var browserWidth = ($(window).width() < 1200);\n if (_this.parent().parent().parent()[0].nodeName !== 'NAV' || browserWidth) {\n _this.toggleClass('expanded', expand);\n if (expand) {\n _this.next('.children, .sub-menu').stop(true, false).slideDown(200);\n }\n else {\n _this.next('.children, .sub-menu').stop(true, false).slideUp(200);\n }\n _this.parent().toggleClass('expanded', expand);\n _this.attr('aria-expanded', expand ? 'true' : 'false');\n\n // If not mobile, always close all expended navigation-elements,\n // because the current scroll position could jump when toggling an\n // item below the currently expanded one.\n if (_this.parent().parent().parent()[0].nodeName !== 'NAV' && !browserWidth) {\n // Fold all the expanded elements except all buttons that are\n // parents of the clicked item.\n var expandedElements = $('.nav-primary .nav-toggle.expanded').not(_this).not(_this.parents('.menu-item').children('.nav-toggle.expanded'));\n expandedElements.each(function (iterationCount) {\n $(this).toggleClass('expanded', false);\n $(this).next('.children, .sub-menu').stop(true, false).slideUp(200);\n $(this).parent().toggleClass('expanded', false);\n $(this).attr('aria-expanded', 'false');\n });\n }\n\n // jscs:disable\n // jscs:enable\n screenReaderSpan.text(screenReaderSpan.text() === screenReaderText.expand ? screenReaderText.collapse : screenReaderText.expand);\n }\n });\n }", "title": "" }, { "docid": "ec6f323c8715ad08502cd30a4674dac8", "score": "0.6173245", "text": "function openNav() {\n open();\n wt();\n}", "title": "" }, { "docid": "ee56111c45ac9ec84c8d186831a5f4fb", "score": "0.6167196", "text": "function toggleMobileNavigation() {\n\t\t\tvar navbar = $(\"#navbar\");\n\t\t\tvar navLinks = $(\"#navbar > ul > li > a:not(.dropdown-toggle)\");\n\t\t\tvar openBtn = $(\".navbar-header .open-btn\");\n\t\t\tvar closeBtn = $(\"#navbar .close-navbar\");\n\n\t\t\topenBtn.on(\"click\", function () {\n\t\t\t\tif (!navbar.hasClass(\"slideInn\")) {\n\t\t\t\t\tnavbar.addClass(\"slideInn\");\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t});\n\n\t\t\tcloseBtn.on(\"click\", function () {\n\t\t\t\tif (navbar.hasClass(\"slideInn\")) {\n\t\t\t\t\tnavbar.removeClass(\"slideInn\");\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "0204a918f0f532e9894085995cfa55ab", "score": "0.61450607", "text": "function toggleMobileNavMenu (e) {\n\n var elem = e.target.tagName === 'path' ? e.target.parentElement : e.target;\n\tvar elemClass = elem.getAttribute('class');\n\tif(elemClass.indexOf('nav-menu__icon_state_closed')>=0) {\t\t\n\t\tshowMobileNavMenu();\n\t} else {\n\t\thideMobileNavMenu();\n\t}\n}", "title": "" }, { "docid": "78ecc2437bcb160534340efc6e55d5fd", "score": "0.61336523", "text": "transformToMobileMenu() {\n if (window.innerWidth < 770) {\n const arrows = document.querySelectorAll(\".menuArrow\");\n for (let i = 0; i < arrows.length; i++) {\n // moving apart mobile menu in order to display submentu\n arrows[i].addEventListener(\"click\", function (event) {\n event.preventDefault();\n const ulUnderArrow = arrows[i].parentNode.parentNode.childNodes[1];\n if (ulUnderArrow.id === \"display\") {\n ulUnderArrow.id = \"\";\n arrows[i].classList.remove(\"upSideDown\");\n // cleans third level menu\n } else {\n ulUnderArrow.id = \"display\";\n arrows[i].classList.add(\"upSideDown\");\n }\n });\n }\n }\n }", "title": "" }, { "docid": "1fb9991adf34cde2b9526b1f20e51079", "score": "0.61330795", "text": "function toggleMobileNav(windowWidth, breakpoint) {\n\n if (windowWidth < breakpoint) {\n $('.nav').hide();\n } else {\n $('.nav').show();\n }\n }", "title": "" }, { "docid": "f7313e3d9d97e26e56c000762158821e", "score": "0.61223185", "text": "goToMain(){\n this.props.navigator.push({\n component: Main\n });\n }", "title": "" }, { "docid": "d745076f505c26d261a5729af5121b31", "score": "0.6116469", "text": "function toggleNavigation() {\n var windowsize = $window.width();\n if (windowsize > 767) {\n navigation.show();\n } else {\n navigation.hide();\n }\n }", "title": "" }, { "docid": "5fc4dc69790be5904e2e244473057792", "score": "0.6091512", "text": "function menuMobilePublic(){\n\t\t$('.wsmenu-arrow').on('click', function(e){\n\t\t\t\te.preventDefault();\n\t\t\t\t//grabs inital clicked target element(arrow icon)\n\t\t\t\tvar homeInit = $(e.target);\n\t\t\t\t//grabs list parent of target arrow icon\t\n\t\t\t\tvar homeBase = homeInit.closest('li');\n\t\t\t\t//Traverses down the DOM to first child .wsmenu-submenu\n\t\t\t \thomeBase.children('.wsmenu-submenu').slideToggle('slow');\n\t\t\t \t$('.wsmenu-click').children('.wsmenu-arrow').toggleClass('wsmenu-rotate');\n\t\t\t});\n\t}", "title": "" }, { "docid": "fcbf76c32fd600244405260e8b7c13dd", "score": "0.6079527", "text": "function openSubNav() {\n var x = document.getElementById(\"dropdown-content\").style.display;\n\n if (x === \"\" || x === \"none\") {\n document.getElementById(\"dropdown-content\").style.display = \"block\";\n } else {\n document.getElementById(\"dropdown-content\").style.display = \"none\";\n }\n}", "title": "" }, { "docid": "8ccb168c6c2702de74764d96998c9732", "score": "0.60427773", "text": "function setupSideNavigation() {\n var menubarItems = $('ul.top-level li [role=\"menuitem\"]'),\n firstMenubarItem = menubarItems.filter(':first'),\n lastMenubarItem = menubarItems.filter(':last'),\n timeout = 500,\n interval = 50,\n closeMenu = function (menuToClose) {\n if (typeof menuToClose === 'undefined') {\n $('.openSideNavTitle').removeClass('openSideNavTitle');\n } else {\n $(menuToClose).removeClass('openSideNavTitle');\n }\n };\n // Mouse actions\n menubarItems.filter('.no-touch [role=\"menuitem\"]').parent().hoverIntent({\n over: function (event) {\n if ($(event.target).closest('ul.sub-UL').closest('li.notSelected.hasSub').length === 0) {\n closeMenu();\n }\n $(this).addClass('openSideNavTitle');\n },\n out: function () {\n closeMenu(this);\n },\n timeout: timeout,\n interval: interval,\n sensitivity: 5\n });\n // KEYBOARD AND TOUCH ACTIONS\n // Make sure that the menu is visible when menuitem's etc are focused\n menubarItems.filter('.no-touch [role=\"menuitem\"]').focus(function () {\n closeMenu();\n $(this).closest('.sub-UL').parent().addClass('openSideNavTitle');\n });\n // Keep note of whether menu is open or not when using touch, or if input is focused\n menubarItems.each(function () {\n if ($(this).parent('.notSelected.hasSub').length === 1) {\n $(this).attr({'data-sidemenu-open': 'false'});\n }\n });\n // Toggle menu with touch events\n menubarItems.on('touchstart', function (event) {\n if ($(this).attr('data-sidemenu-open') === 'false') {\n event.preventDefault();\n closeMenu();\n $('[data-sidemenu-open=true]').attr('data-sidemenu-open', 'false');\n $(this).attr('data-sidemenu-open', 'true');\n $(this).parent().addClass('openSideNavTitle');\n }\n });\n // Enable keyboard navigation of main menu - navigation along menubar\n $('ul.top-level[role=\"menu\"]').on('keydown.sidemenubar', 'li[role=presentation] > [role=\"menuitem\"]', function (event) {\n switch (event.which) {\n // down\n case 40:\n event.preventDefault();\n if ($(event.target).is(lastMenubarItem)) {\n firstMenubarItem.focus();\n } else {\n menubarItems.eq(menubarItems.index($(this)) + 1).focus();\n }\n break;\n // up\n case 38:\n event.preventDefault();\n if ($(event.target).is(firstMenubarItem)) {\n lastMenubarItem.focus();\n } else {\n menubarItems.eq(menubarItems.index($(this)) - 1).focus();\n }\n break;\n // right\n case 39:\n event.preventDefault();\n $(event.target).parent('li.open').removeClass('openSideNavTitle');\n $(event.target).siblings('ul').find('[role~=\"menuitem\"]').first().focus();\n break;\n }\n });\n // Hide menu when focus goes outside nav\n $(this).find('.no-touch :focusable').last().keydown(function (event) {\n if (event.keyCode === 9) {\n closeMenu();\n }\n });\n $(document).on('mousedown touchstart', function (event) {\n if ($(event.target).closest('#siteMapNavContainer').length === 0) {\n closeMenu();\n $('[data-sidemenu-open=true]').attr('data-sidemenu-open', 'false');\n }\n });\n return this;\n }", "title": "" }, { "docid": "0c3f82f0270acc712b99df0f35bab6c6", "score": "0.6028228", "text": "function primary_nav() {\n\n\t\t$( '.main-navigation ul .genericon' ).remove();\n\n\t\tif( $( window ).width() < 960 ) {\n\t\t\t$( '.main-navigation .page_item_has_children > a, .main-navigation .menu-item-has-children > a' ).append( '<span class=\"genericon genericon-expand\" />' );\n\t\t\t$( '.main-navigation ul .genericon' ).click( function( event ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\t$( this ).toggleClass( 'genericon-expand' ).toggleClass( 'genericon-collapse' );\n\t\t\t\t$( this ).closest( 'li' ).toggleClass( 'toggle-on' );\n\t\t\t\t$( this ).parent().next( '.children, .sub-menu' ).toggleClass( 'toggle-on' );\n\t\t\t} );\n\t\t}\n\n\t}", "title": "" }, { "docid": "6e187a2f25076a882cea837ef2bee672", "score": "0.6024643", "text": "function setupDropdown() {\n //if mobile menu is showing\n if($('#mainNavToggler').css('display') != 'none') {\n //disable link to 'services.html'\n $('.dropdown-link').removeAttr('href');\n $('.dropdown-link').css('cursor', 'pointer');\n //set dropdown to open on click\n addDropdownClickEventHandler();\n } else {\n //enable link to 'services.html'\n $('.dropdown-link').attr('href', 'services.html');\n //remove inline styling (set 'cursor' back to default)\n $('.dropdown-link').removeAttr('style');\n //set dropdown to open on hover\n addDropdownHoverEventHandler();\n }\n }", "title": "" }, { "docid": "d75d28f6fdd3d5f1df9b3613139e5163", "score": "0.60124475", "text": "clickOptionSub(evt) {\r\n var target = evt.target;\r\n if (evt.target.tagName == \"A\") target = evt.target.parentNode;\r\n if (!document.getElementsByClassName('navBarMobile')[0].offsetHeight > 0) return; // If is not in mobile, this doesnt apply\r\n if (!target.classList) return;\r\n\r\n if (target.classList.contains('link')) {\r\n window.open(target.querySelector('a').href, '_new');\r\n }\r\n if (!target.classList.contains('subSelect') && target.parentNode.style.display == 'block') {\r\n target.parentNode.style.display = 'none'\r\n\r\n }\r\n\r\n evt.preventDefault();\r\n evt.stopPropagation();\r\n }", "title": "" }, { "docid": "da6fe854c250f3b4beb5886a1d1abc5b", "score": "0.60006404", "text": "function toggleMobileMenu(){\n var menuElement = document.getElementById('mobileNavigation')\n menuElement.classList.toggle(\"open\");\n}", "title": "" }, { "docid": "82286742ac8e22b8d98fc527486c01dc", "score": "0.5991932", "text": "function closeMobileNavbar(){\n mobileNav.click();\n}", "title": "" }, { "docid": "5543ca45f9c9acdef7c5817747ca3d62", "score": "0.59899044", "text": "function openSideNav() {\n getOverlay();\n\n /*start click go back sub layer*/\n goBackButton.forEach(function (elm, index) {\n elm.addEventListener('click', goBack);\n });\n /*end click go back sub layer*/\n\n /*start click close sidebar*/\n sideBarClose.forEach(function (elm, index) {\n elm.addEventListener('click', closeNav);\n });\n /*end click close sidebar*/\n\n if (winWidth >= 768 || winWidth === 1024) {\n winWidth = window.innerWidth / 2;\n setAttr();\n setPlatform(winWidth);\n } else {\n setAttr();\n setPlatform(winWidth);\n }\n }", "title": "" }, { "docid": "3a190c37daa64526cae404e45eea6568", "score": "0.5988001", "text": "function mobileNavMenu() {\n\tconst x = document.getElementById('myLinks');\n\tif (x.style.display === 'block') {\n\t\tx.style.display = 'none';\n\t} else {\n\t\tx.style.display = 'block';\n\t}\n}", "title": "" }, { "docid": "266622ddd549465facb69bb4e8ad2466", "score": "0.5984336", "text": "function openMobileNav(){\n document.getElementById('mobilenav').style.width='100%';\n}", "title": "" }, { "docid": "874918119b0cead6223b865832b642dd", "score": "0.5984052", "text": "function trigger_641(){\n // In ipad and tablet top task element should be open by default\n var elementSize = jQuery(\".node--service-home .toggle-content\").size();\n if(elementSize > 1) {\n open_collapsed_item();\n } else {\n closed_collapsed_item();// On Mobile, all element should be collapsed\n }\n comparision_table_show_on_mobile();// Hide the Desktop version of Comparision Table\n situation_element_desktop_view(); // Show the Situation element mobile view\n change_pbb_view('tablet');\n jQuery(\"ul.first-level-item\").find('li:eq(3)').addClass(\"border-Bblue\");\n jQuery(\"ul.first-level-item li:last-child\" ).addClass(\"border-Bblue\");\n }", "title": "" }, { "docid": "e700c1817e3af38fd51ba6004a72893a", "score": "0.5981701", "text": "function toggleSubnav(event) {\n $(event.currentTarget).find('.navbar-dropdown').toggle(300);\n}", "title": "" }, { "docid": "5362e3443481dab6ff1ca0304452fed6", "score": "0.59549105", "text": "function mobMenu() {\n/* var x = document.getElementById(\"pfTopnav\");\n if (x.className === \"navlist\") {\n x.className += \" responsive\";\n } else {\n x.className = \"navlist\";\n }\n*/\ndocument.getElementById(\"pfTopnav\").classList.toggle(\"responsive\");\n}", "title": "" }, { "docid": "24cf685111e4e6acb723cbd2be3533c1", "score": "0.5950678", "text": "function mobile() {\n \n if (menuBtn.is(':hidden')) {\n\n // PC Visible\n\n $('.menu-language').appendTo(menuGroup);\n $('.inquiry').prependTo(menuGroup);\n $('.menu, .menu-lists').attr('style','');\n menuBtn.removeClass('open');\n $('header').removeClass('menuOpen');\n\n } else{\n\n // Mobile Visible\n\n $('.menu-language').prependTo(menuMain);\n $('.inquiry').appendTo(menuMain);\n \n }\n\n }", "title": "" }, { "docid": "75bce212f1e01f9cd16a34f4455f6d0d", "score": "0.59471846", "text": "function showDesktopSub(e) {\r\n e.target.nextElementSibling.classList.toggle('sub--active')\r\n}", "title": "" }, { "docid": "9a7c7de96ba55c73fbcf8cd1f3ad22f1", "score": "0.5935385", "text": "function mobileNav() {\n $('.main-nav-list a i').on('click', function(e) {\n e.preventDefault();\n\n var $this = $(this),\n parent = $this.closest('li'),\n dropDown = parent.find('.tt-dropdown-menu'),\n innerDropDown = parent.find('.inner-dropdown-menu');\n\n parent.toggleClass('active');\n\n if (dropDown.length > 0) {\n dropDown.slideToggle();\n } else if (innerDropDown.length > 0) {\n innerDropDown.slideToggle();\n }\n })\n\n $(document).on('mouseup', function(e) {\n var div = $(\".main-nav\"); // ID or CLASS f elemen click\n if (!div.is(e.target) && div.has(e.target).length === 0 && div.hasClass('active')) {\n $('.main-nav').removeClass('active');\n $('body').removeClass('active');\n }\n })\n}", "title": "" }, { "docid": "915861e9b37d047418881a496581ccb7", "score": "0.5932907", "text": "function toggleMobileMenu() {\n selectDOM.nav.classList.toggle(\"hidden\");\n}", "title": "" }, { "docid": "282db5b135f234a03ff97a448a5959ac", "score": "0.5929492", "text": "function expandNav() {\n\tvar x = document.getElementById(\"navigation\");\n\tif (x.className === \"navigation\") {\n\t\tx.className += \" responsive\";\n\t} else {\n\t\tx.className = \"navigation\";\n\t}\n}", "title": "" }, { "docid": "329bae06b2b35c6221301fc81fa83b02", "score": "0.5923701", "text": "function toggleMobileMenu() {\n selectDOM.nav.classList.toggle('hidden');\n}", "title": "" }, { "docid": "1807c63189048bbfb504fbe232563bad", "score": "0.59193254", "text": "function OpenAdminNav() {\n\tSetDisplay('AdminNavHeadOpened','block');\n\tSetDisplay('AdminNavHeadClosed','none');\n\tSetDisplay('AdminNavContentOpened','block');\n\tSetDisplay('AdminNavContentMinWidth','block');\n\tSetDisplay('AdminNavContentClosed','none');\n\tcj.ajax.setVisitProperty('','AdminNavOpen','1');\n\tnavBindNodes();\n\tif(!AdminNavPop){\n\t\tcj.ajax.addonCallback(\"AdminNavigatorGetNode\",'',OpenAdminNavCallback);\n\t\tAdminNavPop=true;\n\t}else{\n\t\tcj.ajax.addon('AdminNavigatorOpenNode');\n\t}\n}", "title": "" }, { "docid": "fd355978cab96d04cbce8bb0347f6468", "score": "0.5902621", "text": "function trigger_901(){\n // In ipad and tablet top task element should be open by default\n var elementSize = jQuery(\".node--service-home .toggle-content\").size();\n if(elementSize > 1) {\n open_collapsed_item();\n } else {\n closed_collapsed_item();// On Mobile, all element should be collapsed\n }\n comparision_table_show_on_mobile();// Hide the Desktop version of Comparision Table\n situation_element_desktop_view(); // Show the Situation element mobile view\n change_pbb_view('desktop');\n jQuery(\"ul.first-level-item\").find('li:eq(3)').addClass(\"border-Bblue\");\n jQuery(\"ul.first-level-item li:last-child\" ).addClass(\"border-Bblue\");\n }", "title": "" }, { "docid": "fe437d1c42f72b02d5872ff485bca511", "score": "0.5899043", "text": "goToHomePage() {\n pages.homePage.goToHomePage()\n I.say('Mobile mode')\n }", "title": "" }, { "docid": "1955ba4da7cab55c47043115511cadda", "score": "0.5897369", "text": "mobileSidebarToggle(e) {\n document.documentElement.classList.toggle('nav-open');\n }", "title": "" }, { "docid": "1e6ad0f30331dfbbdac4c797d3aa8bf1", "score": "0.5894327", "text": "function MobileShow(){\r\n Mob_Menu = document.getElementById('mob-menu');\r\n nav = document.getElementById('Mobile-Icon');\r\n \r\n Mob_Menu.addEventListener('click',()=>{\r\n \r\n nav.ClassList.toggle('.nav-active')\r\n \r\n})\r\n}", "title": "" }, { "docid": "45c172f1daff533549f8aaa33496c49a", "score": "0.589268", "text": "function gotoMobiles() {\n window.location.href = \"catagories_pages/mobiles.html\";\n}", "title": "" }, { "docid": "a6c890693777779d1d427d2d6a8e83ff", "score": "0.5886395", "text": "showMobilemenu() {\n\t\tdocument.getElementById('main-wrapper').classList.toggle('show-sidebar');\n\t}", "title": "" }, { "docid": "e6f942078b6c1d7816713616ae55cf66", "score": "0.5875599", "text": "function OpenNavMobile() {\n var x = document.getElementById(\"navBarID\");\n if (x.className === \"navBar\") {\n x.className += \" responsive\";\n } else {\n x.className = \"navBar\";\n }\n \n var x = document.getElementById(\"icon\");\n if (x.className === \"hamburger hamburger--squeeze\") {\n x.className += \" is-active\";\n } else {\n x.className = \"hamburger hamburger--squeeze\";\n }\n}", "title": "" }, { "docid": "5a3424e3dd25a9ad5b41b35a00069165", "score": "0.58712214", "text": "function mobileTopMenu() {\n document.getElementById(this.dataset.tabTarget).classList.toggle(\"active-url\");\n}", "title": "" }, { "docid": "79f5876217acb839d7c6a19ec187f880", "score": "0.5865913", "text": "function openMenuItem(element){\n $(element).children('ul').slideToggle('fast', function() {\n $(this).parent('li').toggleClass('toc-aria-arrow-open', $(this).is(':visible'));\n });\n }", "title": "" }, { "docid": "4d858cf0603c5cda544dbf99d97cb1f0", "score": "0.58589005", "text": "function toggleSubnavOnScroll() {\r\n if($(window).scrollTop() == 0 ) {\r\n $('body').addClass('open-subnav');\r\n } else {\r\n $('body').removeClass('open-subnav');\r\n }\r\n}", "title": "" }, { "docid": "41bd18b149dd4c43e1861f80552c4e2c", "score": "0.5853702", "text": "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"15%\";\n $(\"#mySidenav\").addClass('full-width-mobile');\n }", "title": "" }, { "docid": "cd4379167b455345c14d308c5e817bc8", "score": "0.5845249", "text": "function mobileParentMulti() {\n\t\t\t\tif (window.innerWidth < 1025) {\n\t\t\t\t\t\tif ($ttMobileParentMulti.children().lenght) return false;\n\t\t\t\t\t\tif ($('.stuck').length) return false;\n\t\t\t\t\t\tif($('#tt-header').hasClass('embed-mobilemenu')) return false;\n\t\t\t\t\t\t$ttMobileParentMulti.append($ttMultiObj.detach());\n\t\t\t\t} else {\n\t\t\t\t\t\tif ($ttDesctopParentMulti.children().lenght) return false;\n\t\t\t\t\t\tif ($('.stuck').length) return false;\n\t\t\t\t\t\t$ttDesctopParentMulti.append($ttMultiObj.detach());\n\t\t\t\t};\n\t\t}", "title": "" }, { "docid": "a1282dc2293ea5383f190c315fee0f8b", "score": "0.5833716", "text": "function toggleSubnav(trigger) {\n var target = $(trigger);\n $(trigger).attr('aria-expanded', !($(trigger).attr('aria-expanded') === 'true'));\n $(trigger).toggleClass('expanded');\n $(trigger).parent().find('.nav-children').slideToggle(300);\n}", "title": "" }, { "docid": "0ceef61fdfc544cc84fc221e2b7302df", "score": "0.5832833", "text": "function mobileNavHandler() {\r\n const navMenu = document.querySelector('.header-top__nav');\r\n document.addEventListener('click', (e) => {\r\n\r\n if (e.target.classList.contains('js-nav-mobile-btn')) {\r\n navMenu.classList.add('enable');\r\n } else if (!e.target.closest('.header-top__nav')) {\r\n navMenu.classList.remove('enable');\r\n }\r\n\r\n });\r\n }", "title": "" }, { "docid": "f63db3f80a41998111d38f860c932e28", "score": "0.5831573", "text": "function openNavMobile() {\n document.getElementById(\"nav-slide\").style.height = \"380px\";\n }", "title": "" }, { "docid": "5b270064eb37ddc59e42652f9e0eaa96", "score": "0.5830779", "text": "function jubilee_activate_mobile_menu() {\n\n\tvar $logo, move_up;\n\n\tif ( jQuery( '.mean-container .mean-bar' ).length ) {\n\n\t // Move mobile search container into bottom of mobile menu\n\t if ( jQuery( '#jubilee-header-search' ).length && ! jQuery( '#jubilee-header-search-mobile' ).length ) {\n\t\t \tjQuery( '.mean-nav > ul' ).append( '<li id=\"jubilee-header-search-mobile\" role=\"search\">' + jQuery( '#jubilee-header-search .jubilee-search-form' ).html() + '</li>' );\n\t\t}\n\n\t}\n\n}", "title": "" }, { "docid": "f06fe1a9c8e85b259ab4048f89cdbe3d", "score": "0.5828784", "text": "function openNavMestrajets() {\n document.getElementById(\"mySidenavMestrajets\").style.width = \"85%\";\n $(\"#mySidenavMestrajets\").addClass('full-width-mobile');\n }", "title": "" }, { "docid": "7764c742e0aa59561ab09248059ab55f", "score": "0.58268183", "text": "function mmOpen(id) {\n //\n // If the mini navigation menu is shown i.e. its a compact touch device just ignore mouseover\n // This is because the sub-menu display is inline with the main menu and moves everything around.\n // This causes havoc with touch devices particularly as there is a delay to the click.\n // We let the More.. button open up because it's at the end, and there's no other way of seeing the \n // top level sections in it.\n //\n if ($(\"div.miniNav\").is(\":visible\") && // if the miniNav bar is visible\n $(\"#main-link\" + id).attr(\"href\") != '#') // and the mouseover is not on the \"More..\" button then ignore it\n {\n g_mm_nIDRecentMouseOver = g_mm_NO_MENU_ITEM; // reset just in case\n return;\n }\n //\n // Check if Windows touch in which case a mouseout will have occurred after tap.\n // If there is another mouseover then we just ignore it as the mega menu is already dropped.\n //\n if (g_mm_nWindowsTouchOn == id) {\n return;\n }\n //\n // If we get a click event before the timer below fires, we know it was a touch event so we can\n // ignore it if it is for the current tab. If the click occurs after the timer has fired then we \n // let it go through. That way the first tap opens the mega menu; second tap follows the hotlink.\n //\n g_mm_nIDRecentMouseOver = id; // this indicates that a recent mouseover event occurred on this item\n if (g_mm_timerRecentMouseOver) // reset the timer if it's already active for another item\n {\n window.clearTimeout(g_mm_timerRecentMouseOver);\n }\n g_mm_timerRecentMouseOver = window.setTimeout(function() {\n g_mm_nIDRecentMouseOver = g_mm_NO_MENU_ITEM; // no recent mouseover now\n g_mm_timerRecentMouseOver = null;\n },\n 500); // can be adjusted if some touch devices are very slow at sending the click through after a mouseover\n // cancel close timer\n mmCancelCloseTime();\n // close old layer\n mmClose();\n // get new layer and show it\n menuDiv = $ge('mega-menu');\n g_mm_menuParent = $ge('main-link' + id);\n //\n // Set up mouseup handler so we can detect Windows touch device which sends mouseup & then mouseout after a tap\n //\n if (!g_mm_mapListenersAdded['mouseup' + id]) {\n AddEvent(g_mm_menuParent, \"mouseup\", mmMouseUpHandler(id));\n g_mm_mapListenersAdded['mouseup' + id] = true;\n }\n g_mm_menuItem = $ge('tc' + id);\n //show the menu to enable dimension properties and show on page\n g_mm_menuItem.style.display = 'block';\n //reposition \n //get position and size dimensions\n var topNavWidth = menuDiv.offsetWidth;\n var menuDropWidth = g_mm_menuItem.offsetWidth;\n var menuPosOnPage = findLeftPos(menuDiv);\n var itemPosOnPage = findLeftPos(g_mm_menuParent);\n // the width from the default menu start position to the edge of the container\n var MenuPlaceholderwidth = (topNavWidth - itemPosOnPage);\n //alert('menu placeholder width = ' + MenuPlaceholderwidth);\n\n //if the menu to display is greater than the top nav \n if (topNavWidth < menuDropWidth) {\n //get difference\n var widthDifference = menuDropWidth - topNavWidth;\n //center item\n g_mm_menuItem.style.left = (-1 * (itemPosOnPage + Math.floor((widthDifference / 2)) - menuPosOnPage)) + \"px\";\n } else if (topNavWidth < ((itemPosOnPage - menuPosOnPage) + menuDropWidth)) {\n // off the page so align to right\n g_mm_menuItem.style.left = -1 * (((itemPosOnPage - menuPosOnPage) + menuDropWidth) - topNavWidth) + \"px\";\n } else {\n //not wider than menu; not off the page, so set to standard\n g_mm_menuItem.style.left = 0 + \"px\";\n }\n}", "title": "" }, { "docid": "f336ed243848d6d234232e1f3cfd896c", "score": "0.5813836", "text": "function mobileNav() {\n $('#mobilenavlist').html(`\n <div class=\"icon\">\n <div class=\"hamburger\"></div>\n </div>\n <div class=\"menu-mobile\">\n <strong><a href=\"/about\">About</a></strong>\n <strong><a href=\"/programs\">Programs</a></strong>\n <a href=\"/programs/enchanted-tech-22\">Enchanted Tech</a>\n <a href=\"/programs/xrchive\">XRchive</a>\n <a href=\"/gallery-of-the-future/\">Gallery of the Future</a>\n <a href=\"/device-sharing\">Device Sharing</a>\n <a href=\"/programs/constellations\">Winter Light Festival</a>\n <strong><a href=\"/community\">Community</a></strong>\n <strong><a href=\"/learn\">Workshops</a></strong>\n <strong><a href=\"/techlab\">Lab</a> </strong>\n </div>\n `)\n}", "title": "" }, { "docid": "c6f68704ac2c89cdae8cd8b26ab7d69a", "score": "0.5811833", "text": "function openNav() {\n document.getElementById(\"myNav\").style.width = \"100%\";\n navHome.style.display=\"none\";\n navBase.style.display=\"none\";\n }", "title": "" }, { "docid": "cea93c45c8325e0897b8953a73c58e1f", "score": "0.580841", "text": "function openNav() {\n var x = document.getElementById(\"navDemo\");\n if (x.className.indexOf(\"w3-show\") == -1) {\n x.className += \" w3-show\";\n } else { \n x.className = x.className.replace(\" w3-show\", \"\");\n }\n }", "title": "" }, { "docid": "0d3b2bd3328a1194dad7ac041859944e", "score": "0.5800646", "text": "function switchStartSubNavigation(target) {\n var links = $(\"div#topnav div.baseline div.nav ul.links li\");\n $(links).removeClass(\"selected\");\n $(target).addClass(\"selected\");\n\n $(\"div#topnav\").addClass(\"switching\");\n}", "title": "" }, { "docid": "e15b263015495331fd9c778f9bbba971", "score": "0.57839507", "text": "function showMobileNavMenu() {\n\tvar menu = document.querySelector('.nav-menu');\n\tmenu.setAttribute('class', menu.className.replace(/nav-menu_mobile_closed/g,''));\n}", "title": "" }, { "docid": "399151290ad3f31bb4e72923bd9a86cc", "score": "0.5777042", "text": "static _open(navigator: TNavigator, params: Object) {\n if (Platform.OS === 'ios')\n Router._push(navigator, params);\n else Router._show(navigator, params);\n }", "title": "" }, { "docid": "804e035aafa6f22c52de5317670040df", "score": "0.57691526", "text": "showNavigationMenu() {\n if (this.props.isSidebarShown) {\n return;\n }\n\n this.toggleNavigationMenu();\n }", "title": "" }, { "docid": "06e709787c451473456aa865e815becd", "score": "0.5768748", "text": "toggleMobileNav(open) {\n let tray = document.getElementById('nav-tray')\n let logo = document.getElementById('menu-logo')\n let arr = Array.from(tray.children)\n\n if (open === 'false') {\n const tl = new TimelineMax()\n TweenMax.to(tray, 0.3, {\n width: 300,\n boxShadow: '-10px 0 40px rgba(0, 0, 0, 0.2)'\n })\n tl.add(TweenMax.to(logo, 0.3, { opacity: 1, bottom: 30 }))\n tl.add(\n TweenMax.staggerTo(arr, 0.2, { opacity: 1, margin: '10px 40px' }, 0.1)\n )\n } else {\n const tl = new TimelineMax()\n tl.add(\n TweenMax.staggerTo(\n arr.reverse(),\n 0.2,\n { opacity: 0, margin: '50px 40px' },\n 0.1\n )\n )\n tl.add(TweenMax.to(logo, 0.3, { opacity: 0, bottom: -70 }))\n tl.add(TweenMax.to(tray, 0.3, { width: 0 }))\n }\n }", "title": "" }, { "docid": "f89e5066c1ca4005b33a87a28731af12", "score": "0.57676184", "text": "function displayMobileNavbar() {\n if (window.innerWidth < breakpoints.values.lg) {\n setMobileView(true);\n setMobileNavbar(false);\n } else {\n setMobileView(false);\n setMobileNavbar(false);\n }\n }", "title": "" }, { "docid": "ca328c17834d702656625e8703d43603", "score": "0.57637054", "text": "function toggleMobMainNav(){\n\t\t// toggle header menus : main-nav--mob\n\t\ttoggle({\n\t\t\tnav: headerMobNavMain,\n\t\t\topenButton: headerMobPullIcons,\n\t\t\tcloseButton: headerMobPushIcons,\n\t\t\tevents:'click',\n\t\t\tinverseButtonAppearance: false,\n\t\t\tcloseOnLinkClick: true,\n\t\t\teffects: {\n\t\t\t\topen: function(elements){\n\t\t\t\t\tconsole.log(elements);\n\t\t\t\t\tTweenLite.to(elements.el,.7,{\n\t\t\t\t\t\tautoAlpha: 1,\n\t\t\t\t\t\tease: Power4.easeOut\n\t\t\t\t\t});\n\t\t\t\t\tTweenLite.to(elements.$this,.3,{\n\t\t\t\t\t\tautoAlpha: 0\n\t\t\t\t\t});\n\t\t\t\t\tTweenLite.to(elements.visibleBtn,.3,{\n\t\t\t\t\t\tautoAlpha: 1\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t},\n\t\t\t\tclose: function(elements){\n\t\t\t\t\tconsole.log(elements);\n\t\t\t\t\tTweenLite.to(elements.el,.7,{\n\t\t\t\t\t\tautoAlpha: 0,\n\t\t\t\t\t\tease: Power4.easeOut\n\t\t\t\t\t});\n\n\t\t\t\t\tif(!elements.anchorPressed){\n\t\t\t\t\t\tTweenLite.to(elements.$this,.3,{\n\t\t\t\t\t\t\tautoAlpha:0\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tTweenLite.to(elements.visibleBtn,.3,{\n\t\t\t\t\t\tautoAlpha: 1\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}", "title": "" }, { "docid": "c7057803f2122dfccbdd7b1ab6b90668", "score": "0.5760777", "text": "function navbarClick() {\n\t\t\n\t\tvar windowW = window.innerWidth || $j(window).width();\n\t\t// mobile menu off width\n\t\tif (windowW > 1025) {\n\t\t\t$j('.navbar .dropdown > a').on('click', function(){\n\t\t\t\tlocation.href = this.href;\n\t\t\t\treturn false\n\t\t\t});\n\t\t}\n\t\t\n\t}", "title": "" }, { "docid": "5ea3c3163012eaa5105dd3b98eef480f", "score": "0.57602596", "text": "showMobilemenu() {\n document.getElementById('main-wrapper').classList.toggle('show-sidebar');\n }", "title": "" }, { "docid": "ff6f6495e93544a4b8dd42c20774298c", "score": "0.57578814", "text": "function transition() {\n if (targetParentId) {\n openChildPage();\n } else {\n openNewPage();\n }\n }", "title": "" }, { "docid": "bcc3cbaf236648e121d78a6e5ee17d28", "score": "0.57463616", "text": "function deviceNav_open() {\n document.getElementById(\"deviceNav\").style.width = \"100%\";\n document.getElementById(\"deviceNav\").style.display = \"block\";\n}", "title": "" }, { "docid": "d6b1f3e339b9edb4b02ec957dd18cafd", "score": "0.57397497", "text": "function setupMainMenuMobile(){\n\t$('#mainmenu-wrapper, #mainmenu-wrapper ul, #mainmenu-wrapper ul li').unbind().removeAttr('style');\n\t$('#mainmenu-wrapper ul li').each(function(){\n\t\tvar childul = $(this).children('ul')\n\t\tif (childul.length > 0) {\n\t\t\tsetupCollapseableArea($(this), childul, 500, 'easeInOutCirc', true, false)\n\t\t}\n\t});\n}", "title": "" }, { "docid": "b70231d6138aa5c7e57856adbad95f77", "score": "0.57340527", "text": "function openMobileMenu() {\n var omm = document.getElementById(\"mobile_menu_collapse\");\n omm.classList.add(\"toggled\");\n\n var omm1 = document.getElementById(\"mobile_close_panel\");\n omm1.classList.add(\"toggled\");\n}", "title": "" }, { "docid": "2a45e61480e73159c0a41b6a69ff4071", "score": "0.57337165", "text": "function displayNav(){\n if ($(document).width()>=961 && !$('body').hasClass('url_index')) {\n $('.main-nav').show();\n $('.sub-nav').show();\n active = true;\n return;\n } else if ($(document).width()<=960) {\n $('.main-nav').hide();\n $('.sub-nav').hide();\n $('.hamburger').removeClass('active').addClass('inactive');\n }\n}", "title": "" }, { "docid": "bbb02a6bd95daa3aec3fef2a86f5af96", "score": "0.5731716", "text": "goToNews(navigator){\n navigator.push({\n title: 'News'\n })\n }", "title": "" }, { "docid": "a01e00a9bd29437f431796a385f46eb6", "score": "0.5726223", "text": "function open(el) {\n $(el).click(function(e) {\n $('[am-nav~=container], [am-burger~=container]').toggleClass('nav-active');\n\n // Adding inline styles a Windows phone doesn't like class added to body\n if ($('[am-nav~=container]').hasClass('nav-active')) {\n $('body').css({ 'overflow-y': 'hidden', height: '100%', width: '100%'});\n\n $(this).delay(500).queue(function (next) {\n $('body').css('position', 'fixed');\n next();\n });\n\n } else {\n $('body').css('position', 'relative');\n \n $(this).delay(300).queue(function (next) {\n $('body').css({ 'overflow-y': 'auto', height: 'auto', width: 'auto'});\n next();\n });\n }\n\n e.preventDefault();\n });\n }", "title": "" }, { "docid": "77dc15c1d713ad1e2e4980b3ade1ffb4", "score": "0.57229215", "text": "function toggleNav2() {\n nav ? closeNav2() : openNav2();\n}", "title": "" }, { "docid": "bcd088905cc81d3c67861f9dd8e80b69", "score": "0.5721243", "text": "function openNavMob (){\n document.getElementById('mobility-menu').style.width = \"320px\";\n document.getElementById('mobility-menu').style.opacity = \"1\";\n document.getElementById(\"discovery-menu\").style.width = \"0\";\n document.getElementById(\"distribution-menu\").style.width = \"0\";\n document.getElementById('vector-menu').style.width = \"0\";\n document.getElementById('climate-menu').style.width = \"0\";\n document.getElementById('forestcover-menu').style.width = \"0\";\n document.getElementById('land-cover-menu').style.width = \"0\";\n document.getElementById('mobility').classList.add('btn-active')\n\n}", "title": "" }, { "docid": "ab3ca4592b0e9ef7c0ecf9c56a75cba5", "score": "0.57065284", "text": "function open_Current_Screen()\r\n{\r\n var nScreenNum = sessionStorage.getItem(\"ScreenNum\"); // num of current screen (according to the array)\r\n \r\n // Array of all the a tags on the page \r\n var ArrayLinks = document.getElementsByTagName('a');\r\n \r\n // loops over the links to find the current active one\r\n for(var i = 0; i < ArrayLinks.length; i ++ )\r\n {\r\n // If it's indeed a page link and the link is the current one \r\n if (ArrayLinks[i].name.charAt(0) == 'a' && ArrayLinks[i].name.substring(1,ArrayLinks[i].name.length) == String(Number(nScreenNum) - 1))\r\n {\r\n // checking two 'fathers' above to see if it's in a dropdown menu \r\n var grandpa_Of_a_tag = ArrayLinks[i].parentElement.parentElement;\r\n if (grandpa_Of_a_tag.classList.contains(\"dropdown-menu\"))\r\n {\r\n // Getting the main li of the dropdown section to reach every wanted element, check the order of the tags for help \r\n var Specific_DropDown = grandpa_Of_a_tag.parentElement;\r\n var menu = Specific_DropDown.querySelector('.dropdown-menu'),\r\n icon = Specific_DropDown.querySelector('img.plus_icon');\r\n \r\n // Open\r\n menu.classList.add('show');\r\n menu.classList.remove('hide');\r\n icon.classList.add('open');\r\n icon.classList.remove('close');\r\n\r\n \r\n // Updating the current element \r\n LastIcon = icon;\r\n LastMenu = menu;\r\n \r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "c19a1ef1c9148db2b66fdf3958de15c5", "score": "0.5705364", "text": "function menuOpen() {\n\n if (window.matchMedia(\"(min-width: 851px)\").matches) {\n $('nav, #titre1, .menuGauche, .liseret, section .titre, section #caroussel').css('transform', 'translate(0)');\n\n } else {\n $('.menuGauche').slideDown(500);\n $('.liseret').css('border-bottom', '1px solid #3a3a3a');\n\n }\n menuOuvert = true;\n }", "title": "" }, { "docid": "b67ad84fbdc4d433304a5c1c3e4378b8", "score": "0.569978", "text": "function mobileFunctions(){\n showMenu();\n linksClicked();\n}", "title": "" }, { "docid": "7961e20324b44cac6aa097ed0248e082", "score": "0.5689863", "text": "function trigger_1024(){\n open_collapsed_item();// On Desktop, all element should be open\n comparision_table_hide_on_desktop();// Hide the Mobile version of Comparision Table\n situation_element_desktop_view();\n change_pbb_view('desktop');\n jQuery(\"ul.first-level-item\").find('li:eq(3)').addClass(\"border-Bblue\");\n jQuery(\"ul.first-level-item li:last-child\" ).addClass(\"border-Bblue\");\n }", "title": "" }, { "docid": "592217a7a9bb89f6364cf3410ad38127", "score": "0.5688268", "text": "function SetupMobileNavBar(){\n let toggleLinks = function(){\n //Check if navbar items are displayed and hide them if true\n if(DisplayTypes.includes(links[1].style.display)){\n for(let i = 1; i < links.length; i++){\n links[i].style.display = \"none\";\n }\n navbar.style.height = NavbarDefaultHeight;\n }\n\n //Display each navbar item\n else{\n navbar.style.height = navbarClickedHeight;\n\n for(let i = 1; i < links.length; i++){\n setTimeout(function() {\n links[i].style.display = \"block\";\n }, 300);\n }\n }\n };\n\n // Add click event listener to the navbar icon to toggle navbar items in Mobile view\n navIcon.addEventListener(\"click\", function(){\n mobileToggle = true;\n toggleLinks();\n });\n\n // Add click event listener to each navbar item to toggle display on click\n Array.prototype.forEach.call(links, function(elem){\n elem.addEventListener(\"click\", function(){\n if(mobileToggle){\n mobileToggle = false;\n toggleLinks();\n }\n });\n });\n}", "title": "" } ]
8eff60e907f59b5e76abc95eb3f17aa7
This function determines the radius of the earthquake marker based on its magnitude. Earthquakes with a magnitude of 0 were being plotted with the wrong radius.
[ { "docid": "3a715576d6e1886cb7b5e2b04a762a20", "score": "0.0", "text": "function getRadius(ratio) {\r\n if (ratio === 0) {\r\n return 1;\r\n }\r\n\r\n return ratio;\r\n }", "title": "" } ]
[ { "docid": "2e85eb7e52d44b8e8f06c0e358b7ef52", "score": "0.78650624", "text": "function markerRadius(magnitude) {\n return magnitude*5;\n}", "title": "" }, { "docid": "cb78335cf9c1887a68da24dbde05e830", "score": "0.78305435", "text": "function getEarthquakeCircleRadius(pMagnitude) {\n\n // Assign radius based on magnitude: \n // If magnitude > 0 = return magnitude * 3 \n // Else return 1\n\n if (pMagnitude >0) {\n return pMagnitude*3; \n } \n else {\n return 1;\n }\n\n}", "title": "" }, { "docid": "dd489b10c681720f05f8052274e14984", "score": "0.719308", "text": "function radius(magnitude){\n return magnitude * 5;\n }", "title": "" }, { "docid": "f20b2a9943a7c2ce6ec92b4808322035", "score": "0.71822083", "text": "function radius(magnitude) {\n if (magnitude === 0) {\n return 1;\n }\n return magnitude * 4;\n }", "title": "" }, { "docid": "1365f3ce5e37bb28cb4260d76408efcc", "score": "0.7174766", "text": "function getRadius(magnitude) {\n if (magnitude === 0) {\n return 1;\n }\n \n return magnitude * 3;\n }", "title": "" }, { "docid": "0da3c14aaa93605f88a8a94b49ddc6d2", "score": "0.71407944", "text": "function getRadius (magnitude) {\n if (magnitude === 0 ) {\n return 1;\n }\n return magnitude * 3;\n }", "title": "" }, { "docid": "74013c10d09cb5beb75b6df7bbe55459", "score": "0.7110194", "text": "function getRadius (magnitude) {\n if (magnitude === 0) {\n return 1\n }\n return magnitude * 2\n }", "title": "" }, { "docid": "a0dd6c8f8c069e7cf27a381fceb25709", "score": "0.7109805", "text": "function radius(mag){\n if (mag === 0){\n return 1;\n }\n return mag * 5;\n }", "title": "" }, { "docid": "1fdf575a52476f15d6f3e6051e63a74c", "score": "0.7093453", "text": "function getRadius(magnitude) {\n if (magnitude === 0) {\n return 1;\n }\n return magnitude * 2;\n }", "title": "" }, { "docid": "a6c902aa2e126ed95910bd496a64e68d", "score": "0.70744956", "text": "function getRadius(magnitude) {\r\n if (magnitude === 0) {\r\n return 1;\r\n }\r\n\r\n return magnitude * 3;\r\n }", "title": "" }, { "docid": "4aba1ed388f3511e47e673cb3680de01", "score": "0.7062009", "text": "function getRadius(magnitude) {\n if (magnitude === 0) {\n return 1;\n }\n\n return magnitude * 4;\n }", "title": "" }, { "docid": "221ed09a3153b42a6e92d78a85b7f6ba", "score": "0.706032", "text": "function getRadius(magnitude) {\n if (magnitude === 0) {\n return 1;\n }\n\n return magnitude * 4;\n }", "title": "" }, { "docid": "221ed09a3153b42a6e92d78a85b7f6ba", "score": "0.706032", "text": "function getRadius(magnitude) {\n if (magnitude === 0) {\n return 1;\n }\n\n return magnitude * 4;\n }", "title": "" }, { "docid": "4ff02cb78552df0df04b052f9d74d067", "score": "0.7008961", "text": "function getRadius(magnitude) {\n if (magnitude === 0) {\n return 1;\n }\n\n return magnitude * 4;\n }", "title": "" }, { "docid": "af9ab0518f7d79d064002ca5e8fc7d85", "score": "0.6996991", "text": "function getRadius(magnitude) {\n if (magnitude === 0) {\n return 1;\n }\n return magnitude * 4;\n}", "title": "" }, { "docid": "f699e756938c58fcbc04904411091039", "score": "0.699357", "text": "function getRadius(magnitude) {\n if (magnitude === 0) {\n return 1;\n }\n return magnitude * 4;\n}", "title": "" }, { "docid": "e47e653d1b442ca6ec28a676d78aa30b", "score": "0.69857025", "text": "function getRadius(mag){\n if (mag === 0){\n return 1;\n }\n return mag * 4;\n }", "title": "" }, { "docid": "b43b291855bd88d430885af5de5907c4", "score": "0.6973008", "text": "function getRadius(mag) {\r\n if (mag === 0) {\r\n return 1;\r\n }\r\n\r\n return mag * 3;\r\n }", "title": "" }, { "docid": "a596cc1bfb7f647ed02ef60eb26ea040", "score": "0.6970824", "text": "function getRadius(magnitude) {\r\n if (magnitude === 0) {\r\n return 1;\r\n }\r\n\r\n return magnitude * 2;\r\n }", "title": "" }, { "docid": "8eac9f0ffdd88e9de56f787fb4aa289f", "score": "0.6969776", "text": "function getRadius(magnitude) {\r\n if (magnitude === 0) {\r\n return 1;\r\n }\r\n return magnitude * 4;\r\n}", "title": "" }, { "docid": "82aec1d4295c6c05ced39e58618b3d14", "score": "0.6960263", "text": "function getRadius(magnitude) {\n if (magnitude === 0) {\n return 1;\n }\n\n return magnitude * 4;\n }", "title": "" }, { "docid": "62f902830300a0e2a533500bcd1b1234", "score": "0.6937602", "text": "function quakeRadius(mag) {\n return ((mag+1) ** 2) * 30000;\n}", "title": "" }, { "docid": "d2dae4c3cb6744bc63880753a84dfe81", "score": "0.685123", "text": "function calcRadius(magnitude) {\n return (magnitude/5) * 20;\n}", "title": "" }, { "docid": "3b892f472f757f87be5cfcba28d1c14c", "score": "0.68495566", "text": "function radiusSize(magnitude) {\n return magnitude * 3.5;\n }", "title": "" }, { "docid": "468869833529bd976479d2245d235fa7", "score": "0.6800978", "text": "function getRadiusSize(magnitude){\n if (magnitude === 0){\n return 0.1;\n }\n return magnitude * 5;\n}", "title": "" }, { "docid": "857dae11fcc909c8dd21562984398684", "score": "0.6714918", "text": "function radius_detection(mag){\n r = mag*20000;\n return r;\n }", "title": "" }, { "docid": "cd2dcef4f72e1259e83d066d1c2169f4", "score": "0.66658634", "text": "function setRadius(magnitude) {\n\treturn magnitude * 2\n}", "title": "" }, { "docid": "06cac3cb3970c5c30de8d234a7af2eb4", "score": "0.6640586", "text": "function radiusSize(magnitude) {\n return magnitude * 20000;\n }", "title": "" }, { "docid": "065cadf872639b03713ff32bc9d86291", "score": "0.6567141", "text": "function Earthradius(lat) {\n return Math.sqrt((6378137.0 * 6378137.0 * Math.cos(lat) * 6378137.0 * 6378137.0 * Math.cos(lat) + 6356752.3 * 6356752.3 * Math.sin(lat) * 6356752.3 * 6356752.3 * Math.sin(lat)) / (6378137.0 * Math.cos(lat) * 6378137.0 * Math.cos(lat) + 6356752.3 * Math.sin(lat) * 6356752.3 * Math.sin(lat)));\n}", "title": "" }, { "docid": "6f1e2e6e9414d8f3a90265e414b07112", "score": "0.65234655", "text": "function getMarkerRadius(val, minVal, maxVal, lo, hi) {\n // Normalize magnitude between 0 to 1\n var normalizedValue = ((val - minVal) / (maxVal - minVal));\n\n return (lo + normalizedValue * (hi - lo));\n}", "title": "" }, { "docid": "ef87d28eeda2ea5d5bed3eee8dc2fa73", "score": "0.64500815", "text": "function markerSize(magnitude) {\n if (magnitude === 0) {\n return 1;\n }\n return magnitude * 3;\n }", "title": "" }, { "docid": "db6ad7f79fc9b7f1313ff6d4c47b85c1", "score": "0.63946974", "text": "function MarkerSize(magnitude){\n // Filter positive magnitudes, there ARE negative magnitude recordings in the data\n if (magnitude > 0) {\n return magnitude * 35000; \n } else { return 0}\n}", "title": "" }, { "docid": "543e932d3713a018c8d8b53f6b526a00", "score": "0.63842964", "text": "function markerSize(magnitude) {\n let multiplier = 50000\n if (magnitude <= 0) {\n return multiplier;\n }\n return (Math.sqrt(magnitude) * multiplier) + multiplier;\n}", "title": "" }, { "docid": "de2e35da8336657514dd7783537ff2d1", "score": "0.6365463", "text": "function chooseRadius(magnitude) {\n return magnitude * 2.5;\n }", "title": "" }, { "docid": "2860d774c14de1bd688278031335577a", "score": "0.6365083", "text": "function circleRadius(feature) {\n // If magnitude is less than 0, return 0, otherwise return 3x values\n return feature.properties.mag <= 0 ? 0: feature.properties.mag * 3;\n \n}", "title": "" }, { "docid": "96ca2f02ff13273526807ab17eea1063", "score": "0.6361817", "text": "function MarkerSize(magnitude){\n // Filter positive magnitudes, there ARE negative magnitude recordings in the data\n if (magnitude > 0) {\n return magnitude * 17000; \n } else { return 0}\n}", "title": "" }, { "docid": "d43bea616b693befe97ab3037c356f85", "score": "0.63250524", "text": "function markerSize(magnitude) {\n return magnitude * 3;\n}", "title": "" }, { "docid": "8347bbc94b51c0ed5f22c8558d15c402", "score": "0.63224185", "text": "function markerSize(mag) {\n if (mag === 0){\n mag=1\n return mag\n };\n return mag*4;\n }", "title": "" }, { "docid": "4827d8ff55202f2afe10e007c6b977a1", "score": "0.62909484", "text": "function markerSize(magnitude) {\n if (magnitude < 1) {\n return 5;\n }\n else if (magnitude < 2) {\n return 10;\n }\n else if (magnitude < 3) {\n return 20;\n }\n else if (magnitude < 4) {\n return 30;\n }\n else if (magnitude < 5) {\n return 40;\n }\n else {\n return 50;\n }\n}", "title": "" }, { "docid": "3850ef6b32a25208486e41115a207d90", "score": "0.62811595", "text": "function markerSize(magnitude) {\n return magnitude / 0.00005;\n }", "title": "" }, { "docid": "5c86032e0737f51abc1b477a08c1f2d6", "score": "0.62726516", "text": "function markerSize(magnitude){\n return magnitude * 2\n}", "title": "" }, { "docid": "c354789354b35648498d13a5c4cbcf70", "score": "0.6244357", "text": "function markerSize(earthquake_size) {\n return 200;\n}", "title": "" }, { "docid": "197b2e813f2fce99eb45ee3224be20cc", "score": "0.6238527", "text": "function markerSize(mag) {\r\n if (mag === 0) {\r\n return 1;\r\n }\r\n return mag * 3;\r\n }", "title": "" }, { "docid": "b0b236970546b8a9e314f8bb1b100d79", "score": "0.62266904", "text": "function getCircleMarkerRadius(numLocations) {\n for (const range of CIRCLE_MARKER_RADII) {\n const max = range.max;\n const radius = range.radius;\n\n if (numLocations < max) {\n return radius;\n }\n }\n}", "title": "" }, { "docid": "42e3ee083bf2aca3c1a63349914af5a8", "score": "0.6210461", "text": "function calcCircleRadius() {\n\t/* Calc max radius: */\n\tvar latLng1 = myMap.getBounds().getNorthEast();\n\tvar latLng2 = myMap.getBounds().getSouthWest();\n\tvar distance = distanceInMeter(latLng1.lat(), latLng1.lng(), \n\t\t\tlatLng2.lat(), latLng2.lng());\n\t\n\tvar maxRadius = distance * 0.22; // 22% fits very well..\n\t// TODO zoom level 0 und 1 passen hier fuer nicht ganz..\n\tvar radInM = ((currentSliderValue) / MAX_SLIDER_VALUE) * maxRadius;\n\tcurrentRange = Math.round(radInM);\n\treturn radInM;\n}", "title": "" }, { "docid": "e09affa9ff0afe4a6becc29c3b23fe9c", "score": "0.61941653", "text": "function markerSize(magnitude) {\n return magnitude* 1300;\n}", "title": "" }, { "docid": "a0a57e5ad1d6a0054da434d8bc0028c1", "score": "0.61926264", "text": "function markerSize(magnitude) {\n return magnitude * 4;\n}", "title": "" }, { "docid": "3ed183bbd5c61ccd0badcc090bb7d120", "score": "0.61914706", "text": "function getRadius() {\n bounds = map.getBounds();\n\n center = bounds.getCenter();\n ne = bounds.getNorthEast();\n\n // r = radius of the earth in statute miles\n var r = 3963.0; \n\n // Convert lat or lng from decimal degrees into radians (divide by 57.2958)\n var lat1 = center.lat() / 57.2958; \n var lon1 = center.lng() / 57.2958;\n var lat2 = ne.lat() / 57.2958;\n var lon2 = ne.lng() / 57.2958;\n\n // distance = circle radius from center to Northeast corner of bounds\n var distance = r * Math.acos(Math.sin(lat1) * Math.sin(lat2) + \n Math.cos(lat1) * Math.cos(lat2) * Math.cos(lon2 - lon1));\n \n return distance;\n}", "title": "" }, { "docid": "64b103c6fed7b3ee94b5e848b8fcd26e", "score": "0.61906", "text": "function circleSize(mag) {\n return mag * 10000;\n}", "title": "" }, { "docid": "1ba3564320c3fbf7a5c34a1e78b51108", "score": "0.6164405", "text": "function markerSize(magnitude) {\n return magnitude * 5;\n}", "title": "" }, { "docid": "2768d05341770442414ffcc68c24951e", "score": "0.6152091", "text": "function markerSize(magnitude) {\n return magnitude * 5\n }", "title": "" }, { "docid": "4aa342257310390d557535c316b8ddee", "score": "0.615024", "text": "function updateRadius(){\n var zoom = mymap.getZoom();\n \n switch(zoom) {\n case 13 : return 8;\n case 14 : return 10;\n case 15 : return 12;\n case 16 : return 14;\n case 17 : return 16;\n case 18 : return 18;\n default : return 8; \n }\n }", "title": "" }, { "docid": "4ee83a83492704d494b701b72c346634", "score": "0.6130338", "text": "function markerSize(magnitude) {\n return magnitude * 5;\n}", "title": "" }, { "docid": "d77fdeddf9a107b8785fe091fc19b2e1", "score": "0.61292416", "text": "function circleSize(magnitude) {\r\n return magnitude ** 2;\r\n}", "title": "" }, { "docid": "44cd0f3ece6ba7c9abae1edb5b644dac", "score": "0.6127513", "text": "function circleSize(magnitude) {\n return magnitude * 20000;\n}", "title": "" }, { "docid": "c8595b4d37d4f50ab81eb2714da2ae70", "score": "0.6120289", "text": "function markerSize(mag){\n return mag * 35000\n }", "title": "" }, { "docid": "016e6317c3e4b59fd84e78571d317c9c", "score": "0.61158323", "text": "function WGS84EarthRadius(lat){\n\t// http://en.wikipedia.org/wiki/Earth_radius\n var An = WGS84_a*WGS84_a * Math.cos(lat);\n var Bn = WGS84_b*WGS84_b * Math.sin(lat);\n var Ad = WGS84_a * Math.cos(lat);\n var Bd = WGS84_b * Math.sin(lat);\n return Math.sqrt( (An*An + Bn*Bn)/(Ad*Ad + Bd*Bd) );\n}", "title": "" }, { "docid": "32753eb4ae2842043d5a9e4d27b22ca8", "score": "0.61083204", "text": "function markerSize(mag){\n return mag * 2\n }", "title": "" }, { "docid": "ea2e27e032bbaf6e2f0f10113b38bbfa", "score": "0.6058181", "text": "function markerSize(mag) {\n return mag * 10000;\n }", "title": "" }, { "docid": "9feb0871eb09b94832caa55851b1e689", "score": "0.60251844", "text": "function markerSize(mag) {\n return mag*10000;\n}", "title": "" }, { "docid": "3840157469a0bbb8bea27ac90857a451", "score": "0.60222155", "text": "function markerSize(magnitude) {\n\n // multiply magnitude by a large number so we can actually see it on the map\n return magnitude * 25000;\n \n}", "title": "" }, { "docid": "c3ea516c8b067b5b4c3bf3e9414d91e8", "score": "0.5987488", "text": "function markerSize(mag){\n return mag * 5\n}", "title": "" }, { "docid": "cea16cce04ab5ed1edb2b11555229062", "score": "0.5957384", "text": "function markerSize(mag) {\n return mag * 20000;\n}", "title": "" }, { "docid": "89af5c7a0f7fd80db98e5539a1dc20c1", "score": "0.59493035", "text": "function radiusToZoom(radius)\n{\n return Math.round(14-Math.log(radius)/Math.LN2);\n}", "title": "" }, { "docid": "ff28f713fe43657de1af05ba8b4349a3", "score": "0.59431773", "text": "function markerSize(magnitude) {\n return magnitude * 10000; // 40000 is arbitrary\n}", "title": "" }, { "docid": "98b234aa08d3a912056ba93012538796", "score": "0.5942395", "text": "function sizeCircle(magnitude) {\n return magnitude * 4;\n}", "title": "" }, { "docid": "1c496bb65542402a4eaa35d17f9545ea", "score": "0.592361", "text": "function markerSize(mag) {\n return mag * 5;\n }", "title": "" }, { "docid": "c76c6d3893e20e29a47ac91a48201855", "score": "0.59167933", "text": "function markerSize(magnituge) {\n return magnituge*5;\n}", "title": "" }, { "docid": "b18c590a29f046fc9d1a789ebe78a89d", "score": "0.5914511", "text": "function Sphere(radius){\n return -1;\n }", "title": "" }, { "docid": "f9459102bc1caf93c2c489bd04d3d303", "score": "0.59130275", "text": "function markerOpacity(magnitude) {\n if (magnitude > 6) {\n return 1\n } else if (magnitude > 5) {\n return .90\n } else if (magnitude > 4) {\n return .80\n } else if (magnitude > 3) {\n return .70\n } else if (magnitude > 2) {\n return .60\n } else if (magnitude > 1) {\n return .50\n } else {\n return .40\n }\n}", "title": "" }, { "docid": "08e394f76b1105674c9766d3da9b9227", "score": "0.5909018", "text": "function radiusToZoom(radius){\n radius *= 0.00035;\n return Math.round(14-Math.log(radius)/Math.LN2) - 1;\n}", "title": "" }, { "docid": "7da60a5bd6cead69103c5b61c3d794ed", "score": "0.59010804", "text": "function getEarthquakeCircleColor(pMagnitude) {\n\n // Assign color based on magnitude: \n // >=5 = #cc0000 \n // >=4 = #ff8080\n // >=3 = #ff9933\n // >=2 = #ffe066\n // >=1 = #ffff00\n // <1 = #80ff00\n \n if (pMagnitude > 5) {\n return \"#ff0000\"; \n } \n if (pMagnitude >= 4) {\n return \"#ff8080\"; \n } \n if (pMagnitude >= 3) {\n return \"#ff9933\"; \n } \n if (pMagnitude >= 2) {\n return \"#ffe066\"; \n } \n if (pMagnitude >= 1) {\n return \"#ffff00\"; \n } \n if (pMagnitude < 1) {\n return \"#80ff00\"; \n } \n\n}", "title": "" }, { "docid": "e8e3db877104591e1f7e750232b4d829", "score": "0.58686644", "text": "function getMapRadiusKM(){\n let mapBoundNorthEast = map.getBounds().getNorthEast();\n let mapDistance = mapBoundNorthEast.distanceTo(map.getCenter());\n return mapDistance/1000;\n}", "title": "" }, { "docid": "adff0d7421e22fece77ed164292fbecd", "score": "0.5858405", "text": "function getRadiusFromZoom(zoom) {\n return Math.pow(2, 14 - zoom) * 1609.34 * 2; // the last \"* 2\" is a magic number for more results\n}", "title": "" }, { "docid": "5f364dfdb5b5851aa4938b43bc44d0f6", "score": "0.5839787", "text": "function getradius(magnitude){\n return magnitude*5;\n}", "title": "" }, { "docid": "7d17f5aa6084a8fcbd96b7e354942574", "score": "0.58366823", "text": "function buildCircles(earthquakes){\n circlearray = []\n console.log(\"function buildCircles in process... \")\n \n for (var i = 0; i < earthquakes.length; i++) {\n circlearray.push(\n\n L.circle([earthquakes[i].geometry.coordinates[1], earthquakes[i].geometry.coordinates[0]], {\n fillOpacity: 0.75,\n color: \"white\",\n stroke:false,\n fill: true,\n fillColor: magnitudeColors(earthquakes[i].properties.mag), \n\n // -- depth of earthquake -- color\n // fillColor: magnitudeColors([earthquakes[i].geometry.coordinates[3]]), \n\n radius: markerSize(earthquakes[i].properties.mag),\n }).bindPopup (\"<h3>\" + earthquakes[i].properties.place + \n \"<h3> Magnitude: \" + earthquakes[i].properties.mag +\n \"</h3><hr><p>\" + new Date(earthquakes[i].properties.time) + \"</p>\")\n ) // end of push\n }\n console.log(circlearray.length)\n console.log(\"Magnitude = \")\n console.log(markerSize)\n \n // .addTo(myMap);\n return L.layerGroup(circlearray)\n \n} // end bracket for function createMap", "title": "" }, { "docid": "afe08d61b0c2a186c5271832a059a120", "score": "0.5782799", "text": "function calculateRadius(altitude) {\n let earthRadius = 6371; // * [km]\n altitude = parseFloat(altitude);\n let radiusVisible = Math.sqrt((earthRadius + altitude) ** 2 - earthRadius ** 2);\n radiusVisible = radiusVisible * 1000; //* [m]\n radiusVisible = parseFloat(radiusVisible);\n visibilityISS.setRadius(radiusVisible);\n currentRadiusText.innerText = `${(radiusVisible / 1000).toFixed(2)} km`;\n}", "title": "" }, { "docid": "1f0fef9df9d763d750db19bb22caad8c", "score": "0.574259", "text": "function getCircle(magnitude) {\n return {\n path: google.maps.SymbolPath.CIRCLE,\n fillColor: 'red',\n fillOpacity: .2,\n scale: Math.pow(2, magnitude) / 2,\n strokeColor: 'white',\n strokeWeight: .5\n };\n}", "title": "" }, { "docid": "07e3127fe96944ce63ade4636ef5bf63", "score": "0.5719417", "text": "function radius_abrechnung(){\r\n if(isNaN(srface_area) && isNaN(chord) && isNaN(radius)){\r\n r = (arc_legth) / ((angel*(2*Math.PI))/360);\r\n }\r\n else if (isNaN(radius) && isNaN(arc_legth) && isNaN(chord)){\r\n var r = Math.sqrt((srface_area)/(0.5*((angel*(2*Math.PI))/360)));\r\n }\r\n else if(isNaN(srface_area) && isNaN(arc_legth) && isNaN(radius)){\r\n var x = ((angel*Math.PI)/180);\r\n r = (chord*0.5)/(Math.sin(0.5*(x)))\r\n }\r\n else{\r\n r = (srface_area)/(0.5*arc_legth);\r\n }\r\n document.getElementById(\"test3\").innerHTML= r;\r\nreturn r;\r\n}", "title": "" }, { "docid": "99465fa5c5abe05509cdd95d7f38fba8", "score": "0.57043594", "text": "function kmToRadius(km) {\n return Math.floor(km / h3.edgeLength(h3Resolution, h3.UNITS.km));\n}", "title": "" }, { "docid": "99465fa5c5abe05509cdd95d7f38fba8", "score": "0.57043594", "text": "function kmToRadius(km) {\n return Math.floor(km / h3.edgeLength(h3Resolution, h3.UNITS.km));\n}", "title": "" }, { "docid": "060e341f6807b8aa1533786563a536f1", "score": "0.56830966", "text": "function markerColor(magnitude) {\n if (magnitude < 5) {\n return \"#ea2c2c\";\n } else if (magnitude < 4) {\n return \"#ea822c\";\n } else if (magnitude < 3) {\n return \"#ee9c00\";\n } else if (magnitude < 2) {\n return \"#eecc00\";\n } else if (magnitude < 1) {\n return #d4ee00\";\n } else {\n return \"98ee00\";\n };\n}", "title": "" }, { "docid": "1b82c70e8736937521692014d4dc1a7a", "score": "0.563051", "text": "function getRadius(value){\n return value*60000\n}", "title": "" }, { "docid": "97ef093563946cba7e1b05fb46578e21", "score": "0.56249446", "text": "function circleColor(quakeMag) {\n if (quakeMag > 7.9) {\n return \"#FF0909\"\n }\n else if (quakeMag > 6.9) {\n return \"#FF3209\"\n }\n else if (quakeMag > 5.9) {\n return \"#FF5309\"\n }\n else if (quakeMag > 4.9) {\n return \"#FF7C09\"\n }\n else if (quakeMag > 3.9) {\n return \"#FF9D09\"\n }\n else {\n return \"#FFD709\"\n }\n}", "title": "" }, { "docid": "a3740d16ec596ebc7aa53ce2ce3f21f1", "score": "0.56223613", "text": "function getRadius(value){\n return value*45000\n }", "title": "" }, { "docid": "c4e13b4d73e5691bee83567d2ac5f395", "score": "0.5614549", "text": "function getRadius(value) {\n if (value === 0) {\n return 1;\n }\n return value * 41000;\n}", "title": "" }, { "docid": "53fce304bf34ab5e5fdbbb3dc90b2c9c", "score": "0.5603954", "text": "function radius_of_planet(planet){\n //return planet['radius'] * OBJ_SIZE_COEFFICIENT;\n\n if (planet['type'] == 'Dwarf'){\n return 2;\n } else if (planet['type'] === 'Terrestrial'){\n return 4;\n } else /* Gas Giant */ {\n return 6;\n }\n}", "title": "" }, { "docid": "c0d4973e894c206063b0bc3abf0022cf", "score": "0.556604", "text": "function markerColor(magnitude) {\n if (magnitude < 0) {\n return \"#9ACD32\"\n }\n else if (magnitude <1) {\n return \"#FFFF00\"\n }\n else if (magnitude < 2) {\n return \"#FFA500\"\n }\n else if (magnitude < 3) {\n return \"#FFD700\"\n }\n else if (magnitude < 4) {\n return \"#FF8C00\"\n }\n else if (magnitude < 5) {\n return \"#FF4500\"\n }\n else {\n return \"#FFD700\"\n }\n }", "title": "" }, { "docid": "597c7d04676ab7d609ce08ff8bb0d8c1", "score": "0.5561398", "text": "function markerColor(magnitude) {\n if (magnitude < 1) {\n return \"#ffe6e6\";\n }\n else if (magnitude < 2) {\n return \"#ff8080\";\n }\n else if (magnitude < 3) {\n return \"#ff3333\";\n }\n else if (magnitude < 4) {\n return \"#cc0000\";\n }\n else if (magnitude < 5) {\n return \"#800000\";\n }\n else {\n return \"#330000\";\n }\n}", "title": "" }, { "docid": "f129f7a521ab92720ff03dd40149c4e1", "score": "0.5556607", "text": "function calcRadius() {\n var rowHeight = height / data.length;\n var circleHeight = rowHeight - paddingBetweenCircles;\n radius = circleHeight / 2;\n }", "title": "" }, { "docid": "7eefc799a9fb7ebbb2c22bf7106afd5a", "score": "0.55503124", "text": "function calcCircumference(r) {\r\n radius = (2 * Math.PI * r);\r\n console.log(\"The Circumference Is: \" + Math.round(radius));\r\n}", "title": "" }, { "docid": "32439ea5e93e1d8d4129ddf216d1d954", "score": "0.5539147", "text": "function markerSize(magnitud) {\n return magnitud;\n}", "title": "" }, { "docid": "4e481d852871320750a3e05ac2bcabc7", "score": "0.5534195", "text": "function unifyAngel(radius) {\n var ans = radius;\n while (ans < 0) ans += Math.PI * 2;\n while (ans > Math.PI * 2) ans -= Math.PI * 2;\n return ans;\n }", "title": "" }, { "docid": "d32985308d2778e9e78fd978fc0a455a", "score": "0.55199087", "text": "function set_bokeh_radius() {\n RADIUS_MIN_VAR = Math.min(bokeh_radiusMin.value, bokeh_radiusMax.value);\n RADIUS_MAX_VAR = Math.max(bokeh_radiusMin.value, bokeh_radiusMax.value);\n radiusMin = (RADIUS_MIN_VAR * Math.min(WIDTH, HEIGHT)) / 256;\n radiusMax = (RADIUS_MAX_VAR * Math.min(WIDTH, HEIGHT)) / 256;\n radiusDepth = radiusMax * DEPTH_VAR;\n main();\n}", "title": "" }, { "docid": "a6291f4a0ef15bf990ecab0544440032", "score": "0.5519", "text": "function calcRadius(val) {\n var radius = Math.sqrt(val / Math.PI);\n return radius * .5;\n }", "title": "" }, { "docid": "22e3ec51110f761a70239874d535e9b0", "score": "0.5512681", "text": "function markerColor(magnitude) {\n if (magnitude > 4) {\n return '#ff3300'\n } else if (magnitude > 3) {\n return '#ff9900'\n } else if (magnitude > 2) {\n return '#ffff00'\n } else if (magnitude > 1) {\n return '#ccff33'\n } else {\n return '#339933'\n }\n}", "title": "" }, { "docid": "ef2f948e473e5efcc9c6c7c7c38d8704", "score": "0.54938704", "text": "function solar_radius_vector(t) {\n var d2r = Math.PI / 180.0;\n var e = Math.exp(0);\n return (1.000001018 * (1.0 - e)) /\n (1.0 + e * Math.cos(d2r * solar_true_anomaly(t)));\n}", "title": "" }, { "docid": "b206b7c602e29aaa4c9d2528acb8ef99", "score": "0.5469466", "text": "function calculateCircumference(radius) {\n return 2 * Math.PI * radius;\n}", "title": "" }, { "docid": "3953b56f684f1f64e4f0416859fe05ff", "score": "0.5445319", "text": "function getRadius(value){\n return value*25000\n }", "title": "" }, { "docid": "d4699efb66f415a4bffe24e852a0416b", "score": "0.54339373", "text": "function getRadius(value){\n return value*25000\n }", "title": "" }, { "docid": "d50b84bd877d8fa13aab3978458108f1", "score": "0.54330856", "text": "get innerRadius () {\n return 0;\n }", "title": "" } ]
6481335e7afa3947799c19069b0568cf
Function finds what pagination link is clicked, then shows the corresponding students. Shows students 1 10 by default.
[ { "docid": "5c5e909d056eaa09c646db9531ad3d10", "score": "0.6620696", "text": "function displayStudents(perPage, currentPage) {\n\tconst low = ((currentPage * perPage) - perPage)\n\tconst high = (currentPage * perPage)\n\n\tfor (let i = 0; i < studentArray.length; i++) {\n\t\tif (i < low || i >= high) {\n\t\t\tstudentArray[i].style.display = 'none';\n\t\t\tconsole.log('none' + studentArray[i])\n\t\t}\n\t\tif (i >= low && i < high) {\n\t\t\tstudentArray[i].style.display = 'block';\n\t\t\tconsole.log('block' + studentArray[i])\n\t\t}\n\t}\n}", "title": "" } ]
[ { "docid": "19b88507d3e7badd709c9e40b5ad3cea", "score": "0.7711573", "text": "function paginationLinks() {\n\tdocument.addEventListener(\"click\", (e) => {\n\t\tif (e.target.parentNode.parentNode.className === 'pagination') {\n\t\t\tcurrentPage = e.target.textContent;\n\t\t\tdisplayStudents(perPage, currentPage);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "58437c8d317d4e3ded5682e5ece846f6", "score": "0.75640845", "text": "function showPage(students, selectedPage, numPerPage) {\r\n hide(students);\r\n\r\n for (let i = (selectedPage * numPerPage - numPerPage); i < (selectedPage * numPerPage) && i < students.length; i++) {\r\n students[i].style.display = '';\r\n }\r\n}", "title": "" }, { "docid": "cb167a4fbbb2da9fa323c5afc3f7d47e", "score": "0.7511405", "text": "function NewPage() {\n\n//remove active class from page links\n$('.page-numbers div').removeClass('active');\n\n//make the pressed page number have the active class\n$(this).addClass('active');\n\n//store the page number into a variable so we can use it for indexing\nvar pageNumber = parseInt($(this).text());\n\n//Show only ten student's according to the page number and hide the others\n $StudentsToShow.each(function(index) {\n var $StudentParent = $(this).parents('.student-item');\n if (index >= (pageNumber-1) * 10 && index < pageNumber * 10) {\n $StudentParent.show();\n } else {\n $StudentParent.hide();\n }\n });\n\n}", "title": "" }, { "docid": "221e36400d4c36e19dacaaa42648c3d0", "score": "0.749501", "text": "function studentsPerPage(){\n $('.pagination li a').removeClass('active'); //removes active class from all links by default\n $(this).addClass('active');\n\n let blockCounter = 0; //list item counter\n let pageNumber = parseInt($(this).text()); //parse page #\n let start = (pageNumber * 10) - 10;\n let end = pageNumber * 10;\n\n\n // if condition checks for search event\n if($('.pagination').children().length < originalPagesNumber){\n let index = getIndex(pageNumber); // get the index of the first block element\n for(var i=0; i<$masterList.children().length; i++){ // hide all students\n $('.student-list li').eq(i).hide();\n\n }\n for(var i = index; i < $masterList.children().length; i++){\n if($('.student-list li').eq(i).hasClass('block')){\n blockCounter++;\n $('.student-list li').eq(i).css('display', 'block');\n }\n if(blockCounter > 10){\n $('.student-list li').eq(i).hide();\n }\n }\n\n }else{ // if no search then, hide all and display based on the page number.\n for(var i=0; i<$masterList.children().length; i++){\n $('.student-list li').css('display', 'none');\n }\n\n for(var i = start; i < end; i++){\n $('.student-list li').eq(i).css('display', 'block');\n }\n }\n}", "title": "" }, { "docid": "9bd06ff616e8fdaab76e9971eaa0ced3", "score": "0.74593425", "text": "function pcf (list) {\n // remove the noResults message if it was appended from a previous search\n $(\".noResults\").remove();\n // empty the pagination links class div\n $(\".pagination\").empty();\n // start by hiding everything with animation for extra credit\n list.hide();\n // populate html with new list\n $(\".student-list\").html(list);\n // count all elements to be possibly shown\n var studentCount = 1;\n list.each(function(index) {\n if ($(this).attr(\"id\") !== \"!display\") {\n $(this).attr(\"id\", \"show-index-\"+(studentCount));\n studentCount++;\n }\n });\n // count total students to be shown for calculating the number of pagination links\n var totalStudents = studentCount-1;\n // if search comes back with no results, append message to the list stating to the effect\n if (totalStudents === 0) {\n $(\".student-list\").append(\"<li class='noResults'>No Students Match Your Search.</li>\");\n }\n // count total number of links required for pagination\n var numLink = Math.ceil(totalStudents/studentsPerPage);\n //only paginate if there is more than one page\n if (numLink > 1) {\n // pagination link html string constructor\n var pagStr = \"<ul>\";\n // add one page link per ten students\n for (var i=0; i < numLink; i++) {\n pagStr += \"\";\n pagStr += \"<li> <a>\" + (i+1) + \"</a> </li>\";\n }\n pagStr +=\"</ul>\";\n // assign inner html of pagination div with constructed pagination string, 1st element class set to active\n $(\".pagination\").html(pagStr);\n }\n // stop pagination links from going to the top of the page when clicked. It's confusing.\n $(\".pagination > ul > li > a\").click(function(event) {\n event.preventDefault();\n }\n );\n // construct pagination html as it's seen in the example\n $(\".pagination > ul > li > a\").attr(\"href\", \"#\");\n // default set active class to the first element on page load\n $(\".pagination > ul > li:first-child > a\").attr(\"class\", \"active\");\n // showing first set of students and hiding the rest with animation for extra credit\n for (var i = 1; i < studentsPerPage+1; i++) {\n $(\"#show-index-\" + i).fadeIn();\n }\n // pagination class element construction function\n$(\".pagination > ul > li > a\").click(function() {\n //erase any lingering transparency from fadeIn function\n listClone.css( \"opacity\", 1);\n // hide everything in the list first, but all child elements, not parent element itself\n list.hide();\n // make pagination link class active when clicked and remove from unlicked element\n $(this).parent().parent().children().children().removeClass(\"active\");\n $(this).addClass(\"active\");\n // get integer for student list show function\n var pageLinkActive = parseInt($(\".active\").html());\n // starting id for element to show\n var startId = pageLinkActive * studentsPerPage - studentsPerPage + 1;\n // ending id for element to show\n var endId = (startId + studentsPerPage);\n // show elements between start and end ID with animation for extra credit\n for (var i = startId; i < endId; i++) {\n $(\"#show-index-\" + i).fadeIn();\n }\n// click function closing braces\n });\n// pagination constructor function closing braces\n}", "title": "" }, { "docid": "b1e704aa3eb7a672217f4156272982be", "score": "0.74225914", "text": "function showPage(studentList, page) {\n //Set the student info display to none for the students after the selection\n for (let i = (page * itemsPerPage); i < studentList.length; i++) {\n studentList[i].style.display = \"none\";\n }\n //Set the student info display to none for the students before the selection\n for (let i = 0; i < (page * itemsPerPage) - itemsPerPage; i++) {\n studentList[i].style.display = \"none\";\n }\n //Display the students in the selection\n for (let i = (page * itemsPerPage) - itemsPerPage; i < page * itemsPerPage; i++) {\n studentList[i].style.display = '';\n }\n}", "title": "" }, { "docid": "90f87e7bbac8ebda8036da3398f56090", "score": "0.7381088", "text": "function appendPageLinks(studentList) {\r\n let pages = Math.ceil((studentList.length)/10);\r\n let prevPages;\r\n removePagination(prevPages);\r\n prevPages = pages;\r\n addPagination(pages);\r\n if(document.querySelector('.active')) {\r\n let newNum = (parseInt(document.querySelector('.active').innerText));\r\n showPage(newNum,studentList);\r\n const divSelect = document.querySelector('.pagination');\r\n divSelect.addEventListener('click', (event) => {\r\n let pageNum;\r\n if (event.target.tagName === 'A') {\r\n pageNum = parseInt(event.target.textContent);\r\n document.querySelector('.active').classList.remove('active');\r\n event.target.classList.add('active');\r\n }\r\n showPage(pageNum, studentList);\r\n });\r\n } else {\r\n $(list).hide();\r\n }\r\n}", "title": "" }, { "docid": "3e76a68bfe1c52484c6529e4e704d13b", "score": "0.7373869", "text": "function showPage (pageNumber, listOfStudents) {\n\n // remove previous elements from the page and set new structure for the students to display on a page\n hideStudents();\n setPageStructure();\n const ul = document.getElementsByClassName('student-list')[0];\n\n //calculate portion of 10 (or less) students to show\n let studentStartingFrom = (pageNumber * 10) - 10;\n\n // condition to check if you are on the last page\n let increment = getIncrement(studentStartingFrom, listOfStudents);\n\n //display the 10 (or less) students on the page\n for (var i = studentStartingFrom; i < (studentStartingFrom + increment); i+= 1){\n showStudent(ul, listOfStudents[i]);\n }\n}", "title": "" }, { "docid": "25d97a5e39076ed02b1bdcab157ec4b6", "score": "0.72963744", "text": "function showPage(studentsList, page) {\r\n\r\n\t/* get start and end index */\r\n\tlet showFirstStudentsIdx = (page - 1) * 10;\t\r\n\tlet showLastStudentsIdx = showFirstStudentsIdx + 9;\t\r\n\t\r\n\t/* display students on the page */\r\n\tfor(let i=0; i<studentsList.length; i++) {\r\n\t\tstudentsList[i].style.display = 'none';\r\n\t\tif(showFirstStudentsIdx <= i && i <= showLastStudentsIdx) {\r\n\t\t\tstudentsList[i].style.display = 'block';\t\r\n\t\t} \r\n\t}\r\n}", "title": "" }, { "docid": "b97b8315bec9ba907a41023c55c8d827", "score": "0.7292115", "text": "function showPage(pageNumber, studentList) {\r\n\r\n\t// hide students\r\n\tfor(let i = 0; i < studentList.length; i++) {\r\n\t\tstudentList[i].style.display = 'none';\r\n\t}\r\n\r\n\t// loop through students in student list\r\n\tfor(let i = 0; i < studentList.length; i++) {\r\n\r\n\t\t// if student belong, show them\r\n\t\tif ( (i+1) >= (pageNumber * 10 - 9) && (i+1) <= (pageNumber * 10) ) {\r\n\t\t\tlet studentItem = studentList[i];\r\n\t\t\tstudentItem.style.display = 'block';\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "692fa5d5ce4c6c38137da7c281f3d474", "score": "0.7276125", "text": "function goToPage(pageNum) {\n const start = showPerPage * pageNum;\n const end = start + showPerPage; \n \n $students.css('display', 'none'); \n $students.slice(start, end).css('display', 'block'); \n \n}", "title": "" }, { "docid": "9ab79a99a10085d7b4b9d5ce0b90b276", "score": "0.72745645", "text": "function showPage(pageNumber, students, perPage) { // show variable number of students perpage, and by page number)\n maxItems = pageNumber * perPage ; //this computes what students should show up based on page number\n minItems = (maxItems) - perPage;\n // loop through students array\n for (var i = 0; i < students.length ; i++) {\n students[i].style.display = 'none'; // set to showing non\n if (i >= minItems && i <= (maxItems - 1)) {\n students[i].style.display = 'block'; //fill in the page with the students that should be there\n }\n }\n}", "title": "" }, { "docid": "2984eb40c977ebc4d964de0852a2b7a6", "score": "0.7272033", "text": "function showPage(pageNumber, students) {\r\n // Calculate beginning and ending number for displaying students\r\n let studentListBegin = ((pageNumber - 1) * studentToDisplay);\r\n let studentListEnd = (pageNumber * studentToDisplay);\r\n // If student list ending is more than students array length, change its value\r\n if (studentListEnd > students.length) {\r\n studentListEnd = students.length;\r\n }\r\n // Hide previous students and display new students\r\n hideStudents();\r\n for (let i = studentListBegin; i < studentListEnd; i++) {\r\n students[i].style.display = '';\r\n }\r\n}", "title": "" }, { "docid": "446f9d27314e07a96fdc2e51ed8a4d55", "score": "0.7259088", "text": "function showPage(list,page){\n/**The list parameter constains the array of of students that will be displayed*/\n const startIndex = (page * itemsPerPage)-itemsPerPage; \n const endIndex = page * itemsPerPage; \n/**Clear the innerHTML of the UL element*/\n studentList.innerHTML =\"\"; \n/** Create a conditional that if no results match with the search value, \"No results found\" will display in the page*/\n if (list.length === 0){\n studentList.innerHTML=\"\";\n studentList.insertAdjacentHTML('beforeend', '<h2>No results found </h2>');\n/**Else, the students that matched the searchvalue will display */\n } else {\n for(i=0;i<list.length;i++){\n let student = list[i];\n if(i>=startIndex && i<endIndex){\n studentItems= `<li class=\"student-item cf\">\n <div class=\"student-details\">\n <img class=\"avatar\" src=\"${student.picture.thumbnail}\" alt=\"Profile Picture\">\n <h3>${student.name.title} ${student.name.first} ${student.name.last}</h3>\n <span class=\"email\">${student.email}</span>\n </div>\n <div class=\"joined-details\">\n <span class=\"date\">${student.registered.date}</span>\n </div>\n </li>\n `;\n studentList.insertAdjacentHTML('beforeend', studentItems); \n }\n }\n }\n}", "title": "" }, { "docid": "7b9bcc24d81b1e6ad82284a40001ab0e", "score": "0.7246689", "text": "function pagination (){\n $(window).on('load', function(){\n\n $(\".student-item\").hide();\n\n//pagination in the first page when loading\n\n a = 0;\n b = (numberForPage * 1);\n $(\"h2\").append('<text class=\"shower\">Students ' + 1 + ' - ' + b + ' out of ' + numberOfStudents.length + '</text>');\n for (i = a; i < b;i += 1){\n\n $(\".student-item\").eq(i).show();\n\n }\n\n//pagination and creating to the page for the number of students in the list\n\n for (d = 1; d < numberOfPage; d += 1) {\n $(\".pagination ul\").append('<li><a class=\"' + d + '\" href=\"#\">' + d + '</a></li>');\n }\n\n//an equation for adding users and making the correct location with reference to the number of pages;\n\n $( \".pagination ul li a\" ).click(function( event ) {\n $('h10').remove();\n $(\".student-item\").hide();\n\n c = parseInt( event.target.className);\n\n a = ( c - 1 ) * numberForPage;\n b = (numberForPage * c);\n\n for (i = a; i < b;i += 1){\n\n $(\".student-item\").eq(i).show();\n $('text').remove();\n }\n\n shower();\n });\n});\n\n}", "title": "" }, { "docid": "52910a5955c71410bc3c1f00b5654646", "score": "0.7188977", "text": "function appendPageLinks(studentList){\n let page = Math.ceil(studentList.length/10);\n $('.page').append(\"<div class=\\\"pagination\\\">\"\n +\"<ul>\");\n for(let i = 1; i <= page; i++){\n $(\".pagination ul\").append(\"<li> <a href = \\\"#\\\" onclick = showPage(\" +i +\",\"+\"\\$(\\\".student-item\\\"))>\" + i + \"</a> </li>\");\n }\n $('.page').append(\"</ul>\" + \"</div>\")\n}", "title": "" }, { "docid": "89a9072dce2cf45b6c809257cf47b130", "score": "0.7181639", "text": "function pageLoad () {\r\n$('.student-item:gt(9)').hide(); //hides all but first 10 students\r\npaginationLinks(pagination(studentListLength)); //adds page links\r\npageLinks(studentList); //click handler for page links\r\nsearchHTML(); //search input and button\r\n}", "title": "" }, { "docid": "7966af5ed402a89f7741798fe3743a7e", "score": "0.7161927", "text": "function showPage(pageNumber, studentDetails) {\r\n //hiding all students\r\n for(let i=0; i<studentDetails.length; i++ ){\r\n studentDetails[i].style.display= 'none';\r\n }\r\n //building list of 10 students based on page number\r\n let counter= pageNumber*10;\r\n for(counter; (counter)< ((pageNumber*10)+10); counter++){\r\n if (counter<studentDetails.length){\r\n studentDetails[counter].style.display= 'block';\r\n }\r\n }\r\n }", "title": "" }, { "docid": "85406174e7b06d841882e58ff88564e1", "score": "0.7152766", "text": "function appendPageLinks(students) {\n\tlet pages = Math.ceil(students.length/10); \n\n\tif($('.pagination').length===0){\n\t\t$('.page').append('<div class=\"pagination\"></div>');\n\t} \n\t\n\tif (pages > 1)\n\t{\t\n\t\t$('.pagination').append('<ul></ul>');\n\t\tfor (let i=1;i<=pages;i=i+1)\n\t\t{\n\t\t\tif (i === 1) {text = '<li><a href=\"#\" class=\"active\">' + i + '</a></li>';}\n\t\t\telse{text = '<li><a href=\"#\">' + i + '</a></li>';}\n\t\t\t$('.pagination ul').append(text);\n\n\t\t}\n\t\tshowPage(1,students);\n\t\tlet selector = $('.pagination ul li a');\n\t\t$(selector).on('click',(event)=>{\n\t\t $(selector).removeClass('active');\n\t\t $(event.target).addClass('active');\n\t\t showPage(parseInt(event.target.textContent),students);\n\t });\n\t}\n\telse{\n\t\t$('.pagination').empty();\n\t}\n\n}", "title": "" }, { "docid": "7d54548d47c3d3c505c1a5aa862e7440", "score": "0.71366245", "text": "function appendPageLinks(studentList) {\r\n\r\n\t// Function for determining the rounded number of pages based on the number of students\r\n\tconst nrOfPages = Math.ceil(currentStudents.length / studentsPerPage);\r\n\r\n\t// create a pagination section and give class 'pagination'\r\n\tconst pagination = document.createElement('div');\r\n\tpagination.className = 'pagination';\r\n\r\n\t// add unordered list within pagination section\r\n\tpagination.innerHTML += '<ul>';\r\n\r\n // add links (for every page, add li and a tags with page number text)\r\n\tfor(let i=0; i < nrOfPages; i++) {\r\n\t\tpagination.innerHTML += '<li>' + '<a href=\"#\">' + (i+1) + '</a>' + '</li>';\r\n\t}\r\n\r\n\t// add closing unordered list tag\r\n\tpagination.innerHTML += '</ul>';\r\n\r\n\t// append pagination section to the page\r\n\tpage.appendChild(pagination);\r\n\r\n\t// store pagination links in a var = paginationLinks\r\n const paginationLinks = document.querySelectorAll('.pagination a');\r\n\r\n\t// link 1 active standardly\r\n\tpaginationLinks[0].className = 'active';\r\n\r\n\t// event listener 'click' to all links\r\n\tfor (let i =0; i < paginationLinks.length; i++) {\r\n\t\tpaginationLinks[i].addEventListener('click', () => {\r\n\r\n\t\t// remove active class from all links\r\n\t\tfor (let i=0; i < paginationLinks.length; i++) {\r\n\t\t\tpaginationLinks[i].className='';\r\n\t\t}\r\n\r\n\t\t// store clicked number in a variable \"clickedPageNumber\"\r\n\t\tlet clickedPageNumber = paginationLinks[i].textContent;\r\n\r\n\t\t// use showPage function to display page for the link clicked\r\n\t\tshowPage(clickedPageNumber, currentStudents);\r\n\r\n\t\t// save that link as “active”\r\n\t\tpaginationLinks[i].className = 'active';\r\n\t\t});\r\n\t}\r\n}", "title": "" }, { "docid": "ba46ea6567802bba11a2ab9e8070ccd7", "score": "0.71023595", "text": "function showPage (list, page) {\n const startIndex = (page - 1) * itemsPerPage\n const endIndex = startIndex + itemsPerPage\n studentListUL.innerHTML = ''\n let studentHTML\n\n if (list.length > 0) {\n // for loop to go through data array and nested conditional to display students within specified index range\n for (let i = 0; i < list.length; i++) {\n if (i >= startIndex && i < endIndex) {\n studentHTML =\n `<li class=\"student-item cf\">\n <div class=\"student-details\">\n <img class=\"avatar\" src=\"${list[i].picture.large}\" alt=\"Profile Picture\">\n <h3>${list[i].name.title}. ${list[i].name.first} ${list[i].name.last}</h3>\n <span class=\"email\">${list[i].email}</span>\n </div>\n <div class=\"joined-details\">\n <span class=\"date\">Joined ${list[i].registered.date}</span>\n </div>\n </li>`\n studentListUL.insertAdjacentHTML('beforeend', studentHTML)\n }\n }\n } else {\n studentHTML = `<li>No results for your search were found. Try again!</li>`\n studentListUL.insertAdjacentHTML('beforeend', studentHTML)\n }\n}", "title": "" }, { "docid": "502d001ed88485db923f637c1b7d648d", "score": "0.71008253", "text": "function appendPageLinks(studentList) {\n\n const $paginationContainer = $('<div class=\"pagination\" ></div>');\n const $ul = $('<ul></ul>');\n //Looping through each available page\n for (let i = 1; i <= totalPages; i++) {\n let $li = $('<li></li>');\n let $link = $(`<a href=\"#\" >${i}</a>`);\n //adding number for every page in a link inside an li inside the ul\n $li.append($link);\n $ul.append($li);\n }\n //putting the ul in the pagination container at the bottom of the entire page\n $paginationContainer.append($ul);\n page.append($paginationContainer);\n\n //on click will display 10 students at a time\n $('.pagination a').click(function () {\n let pageNumber = parseInt($(this).text());\n\n //removing active class from all links then adding it on THIS clicked link\n $('.pagination a').removeClass('active');\n $(this).addClass('active');\n\n //Calling SHOW PAGE function when link is clicked\n showPage(pageNumber, studentList);\n });\n //adding active class to 1st link and calling the SHOW PAGE function to show the 1st page\n $('.pagination a').first().addClass('active');\n showPage(1, studentList);\n\n}", "title": "" }, { "docid": "421e44508208764695a0a242a7fea750", "score": "0.70835054", "text": "function showPage(page,students) {\n\thideAllStudents(students);\n\tlet max = (page*10 <= students.length)?page*10:students.length;\n\tfor(let i=page*10-9;i<max;i+=1)\n\t\t{\n\t\t\tstudents[i].style.display = '';\n\t\t}\n }", "title": "" }, { "docid": "57e674d1650bce105799711e0dc770dd", "score": "0.70625454", "text": "function showPage(list, page){\r\n let startIndex = (page * pageLimit) - pageLimit;\r\n let endIndex = page * pageLimit;\r\n\r\n for(let i = 0; i < students.length; i++){\r\n let student = students[i];\r\n if(i >= startIndex && i < endIndex){\r\n student.style.display = '';\r\n } else {\r\n student.style.display = 'none';\r\n }\r\n };\r\n}", "title": "" }, { "docid": "5729bb805ac060e465962e35894b653f", "score": "0.7051732", "text": "function showPage(pageNumber) {\n // Calculating ending index first so that we can use it to calculate the starting index\n let endingIndex = pageNumber * itemsPerPage;\n // Then, calculating the starting index\n const startingIndex = endingIndex - itemsPerPage;\n // This if-statement is for the last page only where maybe there are less than number of items per page to be shown\n if (endingIndex > studentsList.length) {\n // Set it to the length of the students list\n endingIndex = studentsList.length;\n }\n // Selecting the ul of the student list so that we can append list items\n const ul = document.querySelector('.student-list');\n // Remove all list items to prepare the unordered list to be filled with new items\n ul.innerHTML = '';\n // This for loop will iterate from the starting index to the ending index\n for (let i = startingIndex; i < endingIndex; i++) {\n // Getting the corresponding student\n const student = studentsList[i];\n // Creating a new li element which we will append to it some children later\n const li = document.createElement('li');\n // Setting the class names\n li.className = 'student-item cf';\n // Creating a div to store the student details\n const studentDetailsDiv = document.createElement('div');\n // Setting the class name for this div\n studentDetailsDiv.className = 'student-details';\n // Creating a new img to store the avatar\n const img = document.createElement('img');\n // Setting the class name for the image\n img.className = 'avatar';\n // Setting the source\n img.src = student.picture.large;\n // Setting the alternative text\n img.alt = 'Profile Picture';\n // Appending the img to the student details div\n studentDetailsDiv.appendChild(img);\n // Creating an h3 tag to store the full name of the student\n const h3 = document.createElement('h3');\n // Setting its text content\n h3.textContent = `${student.name.first} ${student.name.last}`;\n // Appending the h3 to our div\n studentDetailsDiv.appendChild(h3);\n // Creating a new span to hold the email\n const email = document.createElement('span');\n // Setting its class name;\n email.className = 'email';\n // Setting its text content\n email.textContent = student.email;\n // Appending it to our div\n studentDetailsDiv.appendChild(email);\n // Appending the student details to the list item\n li.appendChild(studentDetailsDiv);\n // Creating another div to hold the join date\n const joinedDetailsDiv = document.createElement('div');\n // Creating a span to hold the date text\n const date = document.createElement('span');\n // Assigning its class name\n date.className = 'date';\n // Setting its text content\n date.textContent = `Joined ${student.registered.date}`;\n // Appending the date span to the div\n joinedDetailsDiv.appendChild(date);\n // Adding the div to the list item\n li.appendChild(joinedDetailsDiv);\n // Finally, the list item is ready to be appending to the unordered list\n ul.appendChild(li);\n }\n}", "title": "" }, { "docid": "7f97518659217b27d90b78f299fb83b4", "score": "0.70241827", "text": "function showPage(pageNumber, studentList) {\r\n $(list).hide();\r\n for (let i = 0; i < studentList.length; i += 1) {\r\n if (i < pageNumber*10 && i >= pageNumber*10-10) {\r\n studentList[i].style.display = 'block';\r\n }\r\n }\r\n}", "title": "" }, { "docid": "fb89c347d74606903fc959a56f0fd9ef", "score": "0.69883937", "text": "function getPageNumber (pages, listOfStudents){\n for (let i = 0; i < pages.length; i += 1){\n pages[i].addEventListener('click', (e) => {\n // remove the active class from pagination\n for (let h = 0; h < pages.length; h += 1){\n pages[h].classList.remove('active');\n }\n pageNumber = e.target.textContent;\n showPage(pageNumber, listOfStudents);\n // set the active class to the active page\n pages[pageNumber-1].className = 'active';\n });\n }\n}", "title": "" }, { "docid": "afbbbdc919c305d5ac315d0aea9b64ec", "score": "0.69782275", "text": "function showPage(list, page) {\n let startIndex = (page * number) - number;\n let endIndex = page * number;\n // hide all the student item\n const studentList = document.getElementsByClassName('student-item cf');\n\n for(let i = 0; i < studentList.length; i++) {\n studentList[i].style.display = 'none';\n }\n\n // show 10 students each time\n\n for(let i = startIndex; i < endIndex; i++) {\n if(studentList[i] == undefined){\n break;\n }\n studentList[i].style.display = '';\n }\n}", "title": "" }, { "docid": "aeaeed1c0e842e6103e90d6c26817276", "score": "0.6934452", "text": "function showPage(list, page) {\n \n // First list item to be displayed\n const startIndex = (page * 9) - 9;\n \n // Last list item to be displayed\n const endIndex = page * 9;\n \n // Generates HTML for student cards\n studentList.innerHTML = '';\n\n // Loops through student data at multiples of 9, per page limit; adds filter functionality\n list\n .filter(student =>\n student.name.first.toUpperCase().includes(searchTerm.toUpperCase())\n )\n .forEach((student, i) => {\n if (i >= startIndex && i < endIndex) {\n studentList.innerHTML += `\n <li class=\"student-item\">\n <div class=\"student-details\">\n <img class=\"avatar\" src=\"${student.picture.large}\" alt=\"${student.name.first} ${student.name.last}\">\n <h3>${student.name.first} ${student.name.last}</h3>\n <p class=\"email\">${student.email}</p>\n </div>\n <div>\n <p class=\"date\">Joined ${student.registered.date}</p>\n </div>\n </li>\n `;\n }\n });\n}", "title": "" }, { "docid": "65a1ef5606890557b3badb5950780e9b", "score": "0.68808806", "text": "function showPage(list, page) {\n const startIndex = (page - 1) * itemsPerPage;\n let endIndex = page * itemsPerPage;\n if (endIndex > list.length) {\n endIndex = list.length;\n }\n const studentList = document.querySelector('ul.student-list');\n studentList.innerHTML = '';\n for (let i = startIndex; i < endIndex; i++) {\n if (i >= startIndex && i < endIndex) {\n const html = `<li class=\"student-item cf\">\n <div class=\"student-details\">\n <img class=\"avatar\" src=${list[i].picture.large} alt=\"Profile Picture\">\n <h3>${list[i].name.first} ${list[i].name.last}</h3>\n <span class=\"email\">${list[i].email}</span>\n </div>\n <div class=\"joined-details\">\n <span class=\"date\">Joined ${list[i].registered.date}\n </div>\n </li>`;\n studentList.insertAdjacentHTML('beforeend', html);\n }\n }\n if (list.length == 0) {\n studentList.innerHTML += '<h3>Uh Oh! There are no results found!!! Try again!</h3>';\n }\n}", "title": "" }, { "docid": "859e15c79c92ae173242f31b9c72fc0f", "score": "0.68733877", "text": "function appendPageLinks(studentList) {\n const numberOfPages = totalPages(studentList);//jumps into the totalPages variable above and returns how many pages need to be created \n const div = createElement(\"div\");//creates the div element to style \n const ul = createElement(\"ul\");//creates the ul element to style \n div.className = \"pagination\"; //container DIV element with a class name of “pagination”,\n document.querySelector(\".page\").appendChild(div);// and appended to the div element with the class name of page.\n div.appendChild(ul);//appended DOM element\n\n //creates actual links for the pages to be clicked on \n function pageNumbers(page) {\n for (let i = 1; i <= page; i++) {\n const li = createElement(\"li\");\n const a = createElement(\"a\");//Each LI element should contain an A element with an href attribute of #,\n a.href = \"#\"; \n li.className = \"links\"; //and text set to the page number each link will show. First link is 1. Second link is 2. And so on.\n ul.appendChild(li);\n a.textContent = i;\n li.appendChild(a);\n }\n }\n \n //show the default 1st page of students\n showPage(studentList, 1);\n \n //shows how many pages are available to be seen on page (depending on the number of students )\n pageNumbers(numberOfPages);\n \n //event listener added for clicks on a given page number \n ul.addEventListener(\"click\", e => {\n e.preventDefault();\n const a = document.querySelectorAll(\"a\");\n for (let i = 0; i < a.length; i++) {\n a[i].classList.remove(\"active\");\n if (a[i].textContent === e.target.textContent) {\n e.target.className = \"active\";\n showPage(studentList, e.target.textContent);\n }\n }\n });\n }", "title": "" }, { "docid": "14be000bfc22e55834c94dee40295031", "score": "0.6866817", "text": "function appendPageLinks(students) {\r\n let paginationLink = document.createElement('ul');\r\n // Calculate number of pages required for displaying student data\r\n const pagesRequired = Math.ceil(students.length / studentToDisplay);\r\n // add li to pagination div for each page\r\n for (let i = 1; i < pagesRequired + 1; i++) {\r\n paginationLink.innerHTML += `<li>\r\n <a href=\"#\">` + i + `</a>\r\n </li>`;\r\n }\r\n // If pagination links existed before, remove them.\r\n if (document.querySelector('.pagination ul')) {\r\n paginationDiv.removeChild(document.querySelector('.pagination ul'));\r\n }\r\n\r\n if (students.length > studentToDisplay) {\r\n // append new paginationDiv to DOM\r\n paginationDiv.appendChild(paginationLink);\r\n paginationLink.querySelector('a').classList.add('active');\r\n }\r\n}", "title": "" }, { "docid": "70ee2ee7a4dbc2c232c78a827215da27", "score": "0.68607783", "text": "function generatePages(list){\n let studentList = ``;\n const studentListLength = $(list).length;\n\n //Clear all pages to prepare for changes\n $('.pagination ul li').each(function(){\n this.remove();\n })\n\n //Generate new pages and functionality if more than 10 students\n if(studentListLength > 10) {\n //Generate page links\n for(let i = 0; i < (studentListLength / 10); i += 1){\n studentList += `<li><a href=\"#\">` + (i+1) + `</a></li>`;\n }\n $('.pagination ul').append(studentList);\n\n //Set first page as active\n setActivePage(document.querySelector('.pagination a'));\n\n //Click to navigate student pages\n $('.pagination ul li a').click(function(e){\n setActivePage(this);\n\n //Fix page clicks from scrolling to top of page\n e.preventDefault();\n\n //Display students for selected page\n let end = parseInt($(this).text()) * 10;\n let begin = end - 9;\n $(list).each(function(index){\n if(index < begin || index > end ) {\n $(this).hide();\n } else {\n $(this).show();\n }\n });\n });\n }\n\n //Show first 10 students in the list upon page load\n $(list).each(function(index){\n if(index > 9 ) {\n $(this).hide();\n }\n });\n}", "title": "" }, { "docid": "2ea0f6af20773b0e8ba2a0718c3b6e1b", "score": "0.6844775", "text": "nextPage() {\n this.displayedStudents = this.students.slice(10 * this.currentPage, (10 * this.currentPage) + 10);\n this.currentPage++;\n }", "title": "" }, { "docid": "98710bb3ca48badc6c0e7ed0bc2907fd", "score": "0.68263537", "text": "function showPage(list, page) {\n const itemsperPage = 9\n const startIndex = (page * itemsperPage) - itemsperPage; \n const endIndex = page * itemsperPage; \n let studentList = document.querySelector('.student-list'); \n studentList.innerHTML = ''; \n \n for (let i = 0; i < list.length; i++) {\n if (i >= startIndex && i < endIndex) {\n const studentItem = document.createElement('li');\n studentList.appendChild(studentItem);\n studentItem.innerHTML = `\n <li class=\"student-item cf\">\n <div class=\"student-details\">\n <img class=\"avatar\" src=\"${list[i].picture.large}\" alt=\"Profile Picture\">\n <h3>${list[i].name.first} ${list[i].name.last}</h3>\n <span class=\"email\">${list[i].email}</span>\n </div>\n <div class=\"joined-details\">\n <span class=\"date\">Joined ${list[i].registered.date}</span>\n </div>\n </li> \n `;\n }\n } \n}", "title": "" }, { "docid": "68dc18418082a820b3416c9eb74f997f", "score": "0.68234193", "text": "function pagesPerList(totalStudents) {\r\n let list = document.getElementsByClassName(\"pagination\")[0];\r\n const studentsPerPagin = 10;\r\n let totalPages = Math.ceil(totalStudents / studentsPerPagin);\r\n\r\n if (list) {\r\n removePagination(list);\r\n }\r\n\r\n if (currentPage > totalPages) {\r\n currentPage = 1;\r\n }\r\n\r\n if (totalPages > 1 ) {\r\n addPagination(totalPages, list);\r\n activePage(currentPage, true);\r\n }\r\n}", "title": "" }, { "docid": "d2ab568004356a07f6312492525fb24e", "score": "0.6820996", "text": "function pagination(pageNumber, arrayOfStudents) {\n //Calculate how many pages are needed for the amount of students in array\n const numberOfPages = Math.ceil(arrayOfStudents.length/10); //Rounds up to closest int\n\n //Set paginationDiv value\n paginationDiv = createElementAppend('div', 'className', 'pagination', pageDiv);\n\n //Create pagination links (ul), give current page number the class \"active\"\n const ul = document.createElement('ul');\n paginationDiv.appendChild(ul);\n\n for (let i = 1; i < numberOfPages+1; i++){\n const li = document.createElement('li');\n ul.appendChild(li);\n\n const a = createElementAppend('a', 'href', '#', li);\n a.text = i;\n if (i === pageNumber){\n a.className = 'active';\n }\n a.addEventListener('click', function(){\n if (paginationDivShows){\n removePagination();\n };\n showStudents(i, arrayOfStudents);\n });\n\n };\n paginationDivShows = true;\n\n}", "title": "" }, { "docid": "8c8b143f2cd8e4f4eb35bc2205459cd5", "score": "0.67970335", "text": "function studentPagination (studentListPage){\r\n startEndParameters(studentListLength); //calls function to get start and end paramenters\r\n for (var i = start; i < end; i++) { //iterate through students\r\n var studentAddClass = studentListPage[i]; //adds student to variable\r\n $(studentAddClass).addClass('show'); //add 'show' class to each matching <li>\r\n }\r\n $('.show').fadeIn('slow'); //show only students with 'show' class\r\n}", "title": "" }, { "docid": "ec339522aadfc72b18bde71485dd127a", "score": "0.67928904", "text": "function showPage(list) {\r\n const studentDivPerPage = 10;\r\n let startIndex = (currentPage * studentDivPerPage) - studentDivPerPage;\r\n let endIndex = currentPage * studentDivPerPage;\r\n let firstOfTen = startIndex;\r\n let lastOfTen = endIndex;\r\n\r\n if (endIndex > studentList.length) {\r\n lastOfTen = studentList.length;\r\n }\r\n range.innerHTML = \"<b> Students \" + (firstOfTen + 1) + \" to \" + lastOfTen + \" of \" + studentList.length + \"</b>\";\r\n range.style.display = \"block\";\r\n\r\n if (inputFieldName) {\r\n range.style.display = \"none\";\r\n }\r\n\r\n for (let i = 0; i < list.length; i++) {\r\n if (i >= startIndex && i < endIndex) {\r\n list[i].style.display = \"block\";\r\n } else {\r\n list[i].style.display = \"none\";\r\n }\r\n }\r\n}", "title": "" }, { "docid": "c2443fe0c2a1d04da5207092b9887e37", "score": "0.67911375", "text": "function showPage(list, page) {\n const itemsPerPage = 9;\n const startIndex = (page * itemsPerPage) - itemsPerPage;\n const endIndex = (page * itemsPerPage);\n const studentList_UL = document.querySelector('.student-list');\n studentList_UL.innerHTML = '';\n for (let i = 0; i < list.length; i++) {\n\tif (i >= startIndex && i < endIndex) {\n\t\tconst student = list[i];\n\t\tconst li = createElement('li', 'className', null, 'student-item cf', null);\n\n\t\t//Adds students detials to the student-details div element\n\t\tconst studentDetails_DIV = appendThis(createElement('div', 'className', 'student-details'), li);\n\t\tappendThis(createElement('img', 'className', 'src', 'avatar', `${student.picture.large}`), studentDetails_DIV);\n\t\tappendThis(createElement('h3', 'textContent', null, `${student.name.first} ${student.name.last}`, null), studentDetails_DIV);\n\t\tappendThis(createElement('span', 'className', 'textContent', 'email', `${student.email}`), studentDetails_DIV);\n\n\t\t//Adds student detials to the joined-details div \n\t\tconst joinedDetails_DIV = appendThis(createElement('div', 'className', null, 'joined-details', null), li);\n\t\tappendThis(createElement('span', 'className', 'textContent', 'date', `${student.registered.date}`), joinedDetails_DIV);\n\n\t\tstudentList_UL.insertAdjacentElement(\"beforeend\", li);\n\t}\n }\n}", "title": "" }, { "docid": "ec458fc1e63c8ab6c3391e435a74d734", "score": "0.67859185", "text": "function run(){\n searchBox();\n organizeStudentList();\n showStudents(1, students); //default page number and array of student to show\n}", "title": "" }, { "docid": "25acfb510e3464386920d2c4021f9d89", "score": "0.67618686", "text": "function goToPage(page) {\n var firstElt = (studentsRowsPerPage * page);\n var lastElt = firstElt + studentsRowsPerPage;\n displayOrHideElements(firstElt, lastElt);\n currentPage = page;\n $(\".page_link\").removeClass(\"active\");\n $(\"#id\" + page).addClass(\"active\");\n}", "title": "" }, { "docid": "aff3846c98400657fcff51842c63aa7c", "score": "0.67511934", "text": "function showStudents(studentList, pageNumber, maxStudentsInPage) {\n let startingStudentIndex;\n let numRecords = 0;\n\n hideAllStudents(studentList);\n startingStudentIndex = calcStartingStudentsIndex(pageNumber, maxStudentsInPage);\n for(let i = startingStudentIndex;\n numRecords < maxStudentsInPage && i < studentList.length;\n i += 1, numRecords += 1) {\n studentList[i].hidden = false;\n }\n\n return numRecords;\n}", "title": "" }, { "docid": "f74717ea97cc7f2151ddbc731fffe554", "score": "0.67335415", "text": "function renderStudentsPage(data){ //take our results array- go through the students and hide all of it\n\n\t\tvar page = $('.all-students'),\n\t\t\tallStudents = $('.all-students .students-list > li');\n\n\t\t// Hide all the students in the students list.\n\t\tallStudents.addClass('hidden'); //hide all of the students\n\n\t\t// Iterate over all of the students.\n\t\t// If their ID is somewhere in the data object remove the hidden class to reveal them.\n\t\tallStudents.each(function () {\n\n\t\t\tvar that = $(this);\n\n\t\t\tdata.forEach(function (item) {\n\t\t\t\tif(that.data('index') == item.id){\n\t\t\t\t\tthat.removeClass('hidden'); //removing the class hidden to show them\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t\t// Show the page itself.\n\t\t// (the render function hides all pages so we need to show the one we want).\n\t\tpage.addClass('visible');\n\t}", "title": "" }, { "docid": "89414fad88c8c5438cb0df765ad7c812", "score": "0.6721903", "text": "function showPage(list, page) {\n const startIndex = parseInt(page) * itemsPerPage - itemsPerPage;\n const endIndex = parseInt(page) * itemsPerPage - 1;\n for (let i = 0; i < studentList.length; i++) {\n studentList[i].style.display = \"none\";\n }\n for (let i = 0; i < list.length; i++) {\n if (i >= startIndex && i <= endIndex) {\n list[i].style.display = \"\";\n }\n }\n}", "title": "" }, { "docid": "ca75e696c5018ce13510ca8a0dde28aa", "score": "0.6704622", "text": "function addPagination(list) {\n //divide the total students by students per page (9) then round up to nearest whole number using Math.ceil\n const pageButtons = Math.ceil(list.length / 9);\n const linkList = document.getElementsByClassName('link-list')[0];\n\n //Remove any content already in the UL\n linkList.innerHTML = '';\n\n //loop over pageButtons and add a button to the HTML on each itteration\n for (let i = 1; i <= pageButtons; i++) {\n let button = document.createElement('li');\n button.innerHTML = `<button type=\"button\">${i}</button>`;\n linkList.insertAdjacentElement('beforeend', button);\n }\n\n //add active status to first Pagination button\n const firstPageButton = document.getElementsByTagName('button')[0];\n firstPageButton.classList.add('active');\n\n //event listener on click of Pagination button\n linkList.addEventListener('click', (e) => {\n if (e.target.tagName === 'BUTTON') {\n const buttons = document.getElementsByTagName('button');\n\n //loop over all buttons and remove active Class\n for (let i = 0; i < buttons.length; i++) {\n buttons[i].classList = '';\n }\n //add active class to the clicked on pagination button\n e.target.classList.add('active');\n\n //call the showpage function using the inner html of the button clicked to identify the page number after converting it to an interger.\n showPage(data, parseInt(e.target.innerHTML, 10));\n }\n });\n}", "title": "" }, { "docid": "3879c43075946723376140fefafaa375", "score": "0.6681062", "text": "function search() {\r\n searchInput = $('.student-search input').val().toLowerCase(); //capture input value make case insensitive \r\n if (searchInput.length > 0) { //check if any text has been inputted\r\n studentSearch(); //call student search function to retrieve matching students\r\n var searchList = $('.show'); //gets students matching search\r\n var searchLength = $('.show').length; //gets length of searched students \r\n $('.pagination').remove(); //removes page links \r\n paginationLinks(pagination(searchLength)); //calls functions for page links of searched students (10 per page)\r\n pageLinks(searchList); //calls function for click handler of page links\r\n } else { //if search has no input show all students\r\n $('.pagination').remove(); //removes page links \r\n $('.student-item').removeClass('show').hide(); //remove show class from students and hides students\r\n $('.student-item:lt(9)').show(); //hides all but first 10 students\r\n paginationLinks(pagination(studentListLength)); //adds page links\r\n pageLinks(studentList); //click handler for page links\r\n }\r\n}", "title": "" }, { "docid": "d2189eac707ecbd8fad2a06b88929ff7", "score": "0.6663346", "text": "function addPagination (numberOfPageItem) {\n var paginationTarget = document.getElementById('paginationOutputSection'),\n paginationHtml = ''; \n\n paginationHtml += '<div class=\"pagination\"><ul>';\n for (var i = 1; i <= numberOfPageItem; i += 1) {\n paginationHtml += '<li><a class=\"pagination-link\" href=\"#\">'+i+'</a>';\n }\n paginationHtml += '</div></ul>';\n printHtml(paginationHtml, paginationTarget);\n\n var paginationLink = document.querySelectorAll('.pagination-link');\n\n // Event listener to dynamically hide students & create pagination links\n for (var i = 0; i < paginationLink.length; i+= 1) { \n paginationLink[i].addEventListener(\"click\", function(event){\n // Prevent defautl behaviour on click\n event.preventDefault();\n var pageNumber = parseInt(event.target.innerText),\n itemListStart = pageNumber * totalItemByPage - totalItemByPage,\n itemListEnd = itemListStart + totalItemByPage; \n \n // We have a different behaviour if the clicked button is the last\n if (pageNumber === totalItemByPage) {\n itemListStart = pageNumber * totalItemByPage;\n itemListEnd = itemListStart + totalItemByPage + totalItemByPage;\n }\n // We get & hide visible item\n getItemToHide();\n \n // We get and hide next XXX items\n getItemToShow(itemListArray, itemListStart, itemListEnd);\n });\n }\n}", "title": "" }, { "docid": "b9b4392efb7f33c451fcc51cb25e9ea8", "score": "0.6661587", "text": "function appendPageLinks(list){\r\n const limit = Math.ceil(students.length / pageLimit);\r\n const div = create('div', 'className', 'pagination');\r\n const ul = create('ul');\r\n page.appendChild(div);\r\n div.appendChild(ul);\r\n\r\n\r\n\r\n //for loop that loops through and creates links for the other pages\r\n for(let i = 0; i < limit; i++){\r\n let pageNbr = i + 1;\r\n const li = create('li');\r\n ul.appendChild(li)\r\n const a = create('a');\r\n a.setAttribute(\"href\", \"#\");\r\n a.textContent = i + 1;\r\n li.appendChild(a);\r\n\r\n\r\n if(pageNbr === 1){\r\n a.className = 'active';\r\n }\r\n\r\n a.addEventListener('click', (e)=>{\r\n let clicked = e.target;\r\n let active = document.querySelector('.active');\r\n\r\n if(parseInt(e.target.textContent) === i+1){\r\n active.className = '';\r\n clicked.className = 'active';\r\n showPage(students, i+1);\r\n }\r\n\r\n\r\n });\r\n\r\n };\r\n}", "title": "" }, { "docid": "ccdcc09fe4ccf4f7d0b2427285a41e9c", "score": "0.66536117", "text": "function showPage(list, page) {\n const start = page * maxPage - maxPage; //Start of Container on Display\n const end = page * maxPage; // End of Containers on Display\n list.forEach((item, index) => {\n //Check if the index of student is greater than the start and less than the end\n if (index >= start && index < end) {\n item.style.display = \"block\";\n } else {\n item.style.display = \"none\";\n }\n });\n}", "title": "" }, { "docid": "4f4aae20cb3dd54e7e598743a0174841", "score": "0.6652975", "text": "function showPage (page, ChildListItem) {\n for (let i = 0; i < StudentListItem.length; i++) { // Loops through items to find what to hide or show\n if (i < (page * ItemPerPage) && i >= ((page * ItemPerPage) - ItemPerPage)) { // shows the first 10 items in list\n StudentListItem[i].style.display = 'block';\n } else {\n StudentListItem[i].style.display = 'none'; //hides the rest of the items\n }\n }\n}", "title": "" }, { "docid": "51b4e9e6e90b99050b70e2417fcfa79b", "score": "0.66189194", "text": "function showStudents(pageNumber, arrayOfStudents){\n pageDiv.removeChild(studentList); //Clear current student list before displaying a new one\n studentList = createElementAppend('ul', 'className', 'student-list', pageDiv);\n\n //Display each student in the array\n for (let i = pageNumber*10-10; i < pageNumber*10 && i < arrayOfStudents.length; i++){\n const li = createElementAppend('li', 'className', 'student-item cf', studentList);\n\n //Student's details div\n const studentDiv = createElementAppend('div', 'className', 'student-details', li);\n\n //Student's avatar\n const img = createElementAppend('img', 'className', 'avatar', studentDiv);\n img.src = arrayOfStudents[i].avatar;\n\n //Student's name\n const nameH3 = createElementAppend('h3', 'innerHTML', arrayOfStudents[i].name, studentDiv);\n\n //Student's email\n const emailSpan = createElementAppend('span', 'className', 'email', studentDiv);\n emailSpan.innerHTML = arrayOfStudents[i].email;\n\n //Student's join details div\n const joinedDiv = createElementAppend('div', 'className', 'joined-details', li);\n\n //Student's join date\n const dateSpan = createElementAppend('span', 'className', 'date', joinedDiv);\n dateSpan.innerHTML = arrayOfStudents[i].joined;\n };\n\n //Add pagination if there are more than 10 students in the list\n if (arrayOfStudents.length > 9){\n pagination(pageNumber, arrayOfStudents);\n };\n}", "title": "" }, { "docid": "419049a4e55f2e6e43a6db046076f6b5", "score": "0.66153103", "text": "function showPage(list, page) {\r\n const min = (page * maxStudents) - maxStudents;\r\n const max = (page * maxStudents) - 1;\r\n for(let i = 0; i < list.length; i++) {\r\n if(max >= i && min <= i) {\r\n list[i].style.display = 'block';\r\n }\r\n else {\r\n list[i].style.display = 'none';\r\n }\r\n }\r\n }", "title": "" }, { "docid": "a6085eb25bbdc503a4d53cc1168a9760", "score": "0.6585383", "text": "function showPage (list, page){\n\n const startIndex = (page * 9)-9;\n const endIndex = (page*9);\n const ul = document.getElementsByClassName(\"student-list\");\n const studentList = ul[0];\n studentList.innerHTML= \"\";\n\n for(let i =0; i<list.length; i++){\n\n if([i]>= startIndex && [i] < endIndex){\n\n const li = document.createElement('li');\n li.className = \"student-item cf\";\n\n const firstDiv = document.createElement('div');\n firstDiv.className = \"student-details\";\n\n li.appendChild(firstDiv);\n\n \n const image = document.createElement('img');\n image.className = \"avatar\";\n image.src = list[i].picture[\"large\"];\n image.alt = \"Profile Picture\"\n\n firstDiv.appendChild(image);\n\n const h3= document.createElement('h3');\n h3.textContent = list[i].name[\"first\"]+ \" \" + list[i].name[\"last\"];\n \n firstDiv.appendChild(h3);\n\n const span = document.createElement('span');\n span.className = \"email\";\n span.textContent= list[i].email;\n\n firstDiv.appendChild(span);\n\n const secondDiv = document.createElement('div');\n secondDiv.className = \"joined-details\";\n \n li.appendChild(secondDiv);\n\n const secondSpan = document.createElement('span');\n secondSpan.className = \"date\";\n secondSpan.textContent=\"Joined\" + \" \" + list[i].registered[\"date\"];\n \n secondDiv.appendChild(secondSpan);\n\n\n studentList.appendChild(li);\n\n \n\n };\n };\n return studentList;\n}", "title": "" }, { "docid": "c79d9e8eeb2d1fd438abb167fbeb804e", "score": "0.6582292", "text": "function showPage(list, page) {\n const startIndex = ((page * itemsPerPage) - itemsPerPage);\n const endIndex = (page * itemsPerPage);\n studentList.innerHTML = '';\n for (let i = 0; i < list.length; i++) {\n if (i >= startIndex && i < endIndex) {\n const studentItem = `<li class=\"student-item cf\">\n <div class=\"student-details\">\n <img class=\"avatar\" src=\"${list[i].picture.large}\" alt=\"Profile Picture\">\n <h3>${list[i].name.first} ${list[i].name.last}</h3>\n <span class=\"email\">${list[i].email}</span>\n </div>\n <div class=\"joined-details\">\n <span class=\"date\">Joined ${list[i].registered.date}</span>\n </div>\n </li>\n `;\n studentList.insertAdjacentHTML('beforeend', studentItem);\n }\n }\n}", "title": "" }, { "docid": "33c0e4bce364d62dd7767920dd288e3c", "score": "0.6577532", "text": "function clickedProgramPagination(){\n\t\t$(\".courses_pagination .page-item a\").click(function(){\t\n\t\t\tvar clickedPage = parseInt($(this).attr(\"id\"));\n\t\t\tsearchCourses(page=clickedPage);\n\t\t\thistoryReplacePage(page = page);\n\t\t});\n\t}", "title": "" }, { "docid": "8c65f330f4157026816344b6f401d4ae", "score": "0.657534", "text": "function showPage (page) {\n\n // get the list of page navigation elements which will be updated at the end of this function\n\n const pageDiv = document.querySelector ('div.pagination');\n const pageElements = pageDiv.querySelectorAll ('li');\n\n // calculate the start and end indices\n\n let endIndex = page * studentsPerPage; // assume pages 1 - n, no error check\n const startIndex = endIndex - studentsPerPage; // will never be less than 0\n \n // limit the endIndex value to the length of the active list\n\n endIndex = Math.min (endIndex, activeList.length);\n\n // iterate through all list items, adjusting the display property\n // as needed\n\n for (let i = 0; i < activeList.length; i++) {\n if (i < startIndex || i >= endIndex) { // hide this element\n activeList[i].style.display = 'none';\n } else { // display this element\n activeList[i].style.display = '';\n }\n }\n\n // Loop through each page navigation element, making all of them inactive except \n // for the target element\n\n for (let i = 0; i < pageElements.length; i++) {\n if (i === page - 1) {\n pageElements[i].firstElementChild.className = 'active';\n } else {\n pageElements[i].firstElementChild.className = '';\n }\n }\n }", "title": "" }, { "docid": "0ef16f303dcd8eefe8b86fb6f8c74209", "score": "0.6562206", "text": "function showPage (list, page) {\n\tlet startIndex = (page * pageItems) - pageItems;\n\tlet endIndex = page * pageItems;\n\tstudentsList.innerHTML = \"\";\n\t\tfor (let i = 0; i < list.length; i++) {\n\t\t\tif (i >= startIndex && i < endIndex) {\n\t\t\t\tlet listI = list[i];\t\n\t\t\tlet studentInfo =\t\t\n\t\t\t\t\t`<li class=\"student-item cf\">\n\t\t\t\t\t\t\t<div class=\"student-details\">\n\t\t\t\t\t\t\t\t <img class=\"avatar\" src=\"${listI.picture.large}\" alt=\"Profile Picture\">\n\t\t\t\t\t\t\t\t <h3>${listI.name.first} ${listI.name.last}</h3>\n\t\t\t\t\t\t\t\t <span class=\"email\">${listI.email}</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"joined-details\">\n\t\t\t\t\t\t\t<span class=\"date\">Joined ${listI.registered.date}</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t </li>`;\n\t\t\t\n\t\t\tstudentsList.insertAdjacentHTML(\"beforeend\", studentInfo);\n\t\t\t}\n\t\t}\n}", "title": "" }, { "docid": "7b810b8203e18be5ced2b2a9bc03b957", "score": "0.655434", "text": "function showPage (list, page) {\n let startIndex = (page * 9) - 9;\n let endIndex = page * 9;\n let ul = document.getElementsByClassName('student-list')[0];\n ul.innerHTML = '';\n for (let i = 0; i < list.length; i++) {\n if (i >= startIndex & i < endIndex) {\n let studentInfo = `\n <li class=\"student-item cf\">\n <div class=\"student-details\">\n <img class=\"avatar\" src=\"${list[i].picture.large}\" alt=\"Profile Picture\">\n <h3>${list[i].name.first} ${list[i].name.last}</h3>\n <span class=\"email\">${list[i].email}</span>\n </div>\n <div class=\"joined-details\">\n <span class=\"date\">Joined ${list[i].registered.date}</span>\n </div>\n </li>`;\n ul.insertAdjacentHTML('beforeend', studentInfo); \n }\n }\n}", "title": "" }, { "docid": "2d79bee029468ff936acc8f4526ac7ad", "score": "0.65417594", "text": "function showPage(list, page) {\r\n const startIndex = (page * 9) - 9;\r\n const endIndex = page * 9;\r\n const studentList = document.querySelector('ul.student-list');\r\n studentList.innerHTML = \"\";\r\n let htmlList = '';\r\n for (let i = 0; i < list.length; i++) {\r\n if (i >= startIndex && i < endIndex) {\r\n\r\n htmlList += `\r\n <li class=\"student-item cf\">\r\n <div class=\"student-details\">\r\n <img class=\"avatar\" src=\"${list[i].picture.large}\" alt=\"Profile Picture\">\r\n <h3>${list[i].name.first} ${list[i].name.last}</h3>\r\n <span class=\"email\">ethel.dean@example.com</span>\r\n </div>\r\n <div class=\"joined-details\">\r\n <span class=\"date\">Joined 12-15-2005</span>\r\n </div>\r\n </li>\r\n `;\r\n }\r\n }\r\n studentList.insertAdjacentHTML('beforeend', htmlList);\r\n}", "title": "" }, { "docid": "a23250b704f51895af2e6de88678fe07", "score": "0.653616", "text": "function showPage(list, page) {\n const startIndex = (page * 9) - 9;\n const endIndex = page * 9;\n const studentList = document.getElementsByClassName('student-list')[0];\n studentList.innerHTML = '';\n for (let i = 0; i < list.length; i++) {\n if (i >= startIndex && i <= endIndex) {\n studentList.insertAdjacentHTML('beforeend', `\n <li class=\"student-item cf\">\n <div class=\"student-details\">\n <img class=\"avatar\" src=\"${data[i].picture.large}\" alt=\"Profile Picture\">\n <h3>${data[i].name.first} ${data[i].name.last}</h3>\n <span class=\"email\">${data[i].email}</span>\n </div>\n <div class=\"joined-details\">\n <span class=\"date\">Joined ${data[i].registered.date}</span>\n </div> \n </li>\n `);\n\n }\n }\n}", "title": "" }, { "docid": "4e7144730732a9a7b8470dcc75b62455", "score": "0.65229887", "text": "function showPage (array, page) {\n for (let i = 0; i < array.length; i++) {\n // only show studentItems, that fall in the selected page range\n if ( i < page * 10 && i >= (page - 1) * 10) {\n array[i].style.display = \"block\";\n } else {\n array[i].style.display = \"none\";\n }\n }\n}", "title": "" }, { "docid": "695275b4dfb63fbc55e609ee7ce0c3cb", "score": "0.6522389", "text": "function display_page_and_its_ten_elements(page_to_display) {\n let items_per_page = 10;\n let page = page_to_display;\n let end_index = (page * items_per_page) - 1;\n\n // Select all student sections (by default) to NOT display on the page\n for (let i = 0; i < t_student_objects.length; i++) {\n t_student_objects[i].style.display = \"none\";\n }\n\n // if the end index is too big (out of range)\n // This code will only run for page 6\n if (end_index > t_student_objects.length - 1) {\n // students at indexes 50 - 53 will print out\n let out_of_range_end_index = (page * items_per_page) - 1;\n end_index = t_student_objects.length - 1; // 53\n let start_index = (out_of_range_end_index - items_per_page) + 1; // 50\n for (let i = start_index; i <= end_index; i++) {\n // Display the student sections\n t_student_objects[i].style.display = \"\";\n }\n }\n\n // if the end index is within range\n // This code will run for pages 1 - 5\n if (end_index < t_student_objects.length - 1) {\n let start_index = (end_index - items_per_page) + 1;\n\n for (let i = start_index; i <= end_index; i++) {\n t_student_objects[i].style.display = \"\";\n }\n }\n\n}", "title": "" }, { "docid": "550a9291ba0d167c93aeed6e88f3bd83", "score": "0.65205556", "text": "function showPage(list, page) { \n\n let startIndex = (page * 9) - 9;\n let endIndex = (page * 9);\n \n const studentList = document.querySelector('.student-list'); // The query selector get the first tag/element with class student-list\n // template literals are being used to insert data in the <h3>, <img> and <span> tags to help collect the information in the orderly fashion it is called for.\n studentList.innerHTML = '';\n for(let i = 0; i < list.length; i++){\n if(i >= startIndex && i < endIndex) {\n const studentItem = `\n <li class=\"student-item cf\">\n <div class=\"student-details\">\n <img class=\"avatar\" src=${list[i].picture.large} alt=\"Profile Picture\"> \n <h3>${list[i].name.first} ${list[i].name.last}</h3>\n <span class=\"email\">${list[i].email} </span>\n </div>\n <div class=\"joined-details\">\n <span class=\"date\">Joined ${list[i].registered.date}</span>\n </div>\n </li>\n `\n studentList.insertAdjacentHTML(\"beforeend\", studentItem);\n };\n \n };\n console.log(list);\n console.log(page);\n}", "title": "" }, { "docid": "b2b73070fb54e9febdb049f9e2614e36", "score": "0.6501321", "text": "function displayPage(pageNo, studentList) {\n\tstudentItems.hide();\n\t$.each(studentList, function(index, list) {\n\t\tif (pageNo === index) {\n\t\t\t$.each(list, function(i,l) {\n\t\t\t\t$(l).fadeIn('slow');\n\t\t\t})\n\t\t}\t\n\t});\n}", "title": "" }, { "docid": "d563c7727632dcb52c9d9aca77d1f31e", "score": "0.6483149", "text": "function activateNameFound() {\r\n let lastIndex = currentPageNb * nbStudentsPerPage;\r\n let firstIndex = lastIndex - nbStudentsPerPage;\r\n\r\n foundItem = 0;\r\n for(let i = 0; i < totalStudents; i++) {\r\n if((studentItemH3[i].innerText.search(searchFor) > 0) || (email[i].innerText.search(searchFor) > 0)) {\r\n if (foundItem >= firstIndex && foundItem < lastIndex) {\r\n studentItemLI[i].style.display = '';\r\n console.log('Index: ' + i + ' ' + studentItemH3[i].innerText + ' email = ' + email[i].innerText);\r\n } else {\r\n studentItemLI[i].style.display = 'none';\r\n\r\n }\r\n foundItem++;\r\n }\r\n }\r\n}", "title": "" }, { "docid": "f05a793aec8ff567e4c9bed1869d42e0", "score": "0.64675194", "text": "function goToNext() {\n studentRows = $(\".students-row\");\n var nbPages = Math.ceil(studentRows.length / studentsRowsPerPage);\n if (currentPage < nbPages) {\n goToPage(currentPage + 1);\n }\n}", "title": "" }, { "docid": "40db54739008709a6e46d467da57eb95", "score": "0.6465689", "text": "function addPagination(list) {\n const numberOfpages = Math.ceil(list.length / 9);\n const linkList = document.querySelector('.link-list');\n linkList.innerHTML = '';\n\n for (let i=1; i<=numberOfpages; i++) {\n const li = document.createElement('li');\n linkList.appendChild(li);\n li.innerHTML = `<li>\n <button type=\"button\">${[i]}</button>\n </li>\n `; \n\n//first button on the list will be set to 'active' class when you open the page\n\nconst firstButton = document.querySelector('button'); \nfirstButton.className = 'active';\n\n//if a button is clicked, it will become 'active'\n//any other button will have no active class\n//call showPage function in order to show the correct studentItem(s) when new page is clicked \n\nlinkList.addEventListener('click', (e) => {\n if (e.target.tagName === 'BUTTON') {\n const inactiveButton = document.querySelector('.active');\n inactiveButton.className = '';\n e.target.className = 'active';\n showPage(list, e.target.textContent);\n }\n }) \n }\n}", "title": "" }, { "docid": "4a1ef3a9a7b85250acf038e4db9bf985", "score": "0.6459228", "text": "function addStudents(){\n let start = pageLength * (currentPage - 1); \n for (let i = start; i < (start +10); i++) {\n console.log(i);\n $('.student-item').eq(i).show();\n }\n}", "title": "" }, { "docid": "caf0642ebfaa897e85e11c180e88d1ad", "score": "0.6441979", "text": "function appendPageLinks() {\n\n const parentDiv = document.querySelector('div.page'); // this gets us to our parent div that we will append to\n const pages = Math.ceil(studentList.length / studentsPerPage); // we need this many pages\n\n // create the new elements that we will append\n\n const pageDiv = document.createElement ('div');\n const ul = document.createElement ('ul');\n\n // add the correct class to this div element, then append the ul to the div and the div to our parent\n \n pageDiv.setAttribute ('class', 'pagination');\n pageDiv.appendChild (ul);\n parentDiv.appendChild (pageDiv);\n\n // For each page, create a list item element and link (href=# and content set to the page number).\n // Set up a click listener for each element. This is how the user selects the page they wish to view.\n\n for (let i = 0; i < pages; i++) {\n\n // create a new list item and link\n\n const li = document.createElement ('li');\n const a = document.createElement ('a');\n\n // add details to the new elements\n if (i === 0) { // start with page 1 as the active element\n a.className ='active';\n }\n a.setAttribute ('href','#');\n a.textContent = i+1; // this is the page number for this element\n\n // append the new items to the DOM\n\n li.appendChild (a); // append the link to the list item\n ul.appendChild (li); // append the list item to the list\n\n // add a 'click' event listener for this page navigation element\n\n a.addEventListener ('click', (e) => {\n\n // Display the page corresponding to the page number of this element\n\n showPage (e.target.textContent);\n });\n }\n }", "title": "" }, { "docid": "2191df9e4bee39cb25d8e072cfdd8028", "score": "0.6439602", "text": "function showFirstTen() {\n for (let i = 0; i < eachStudent.length; i++) {\n if (i < studentsPerPage) {\n eachStudent[i].style.display = '';\n } else {\n eachStudent[i].style.display = 'none';\n }\n }\n}", "title": "" }, { "docid": "76af817455d947c20ec13fd95b3ace8f", "score": "0.6413435", "text": "function showPage(list, page) {\n const start = page * 9 - 9;\n const end = page * 9;\n\n const studentList = document.getElementsByClassName('student-list')[0];\n\n studentList.innerHTML = '';\n\n for (let i = start; i >= start && i < end; i++) {\n let student = document.createElement('li');\n student.classList.add('student-item', 'cf');\n student.innerHTML = `<div class=\"student-details\">\n <img class=\"avatar\" src=\"${list[i].picture.large}\" alt=\"Profile Picture\">\n <h3>${list[i].name.first} ${list[i].name.last}</h3>\n <span class=\"email\">${list[i].email}</span>\n </div>\n <div class=\"joined-details\">\n <span class=\"date\">Joined ${list[i].registered.date}</span>\n </div>`;\n studentList.insertAdjacentElement('beforeend', student);\n }\n}", "title": "" }, { "docid": "7bc96af27ab5f5ece6b07d67d35e6913", "score": "0.6389617", "text": "function find_student_section(user_input) {\n const sections_to_display = [];\n\n // \"let found\" keeps track of the number of times a student match is found.\n let found = 0;\n for (let i = 0; i < t_student_objects.length; i++) {\n let the_student = t_student_names[i].textContent.toLowerCase();\n let student_email = t_student_emails[i].textContent.toLowerCase();\n let user_input_lc = user_input.toLowerCase();\n\n if (the_student.includes(user_input_lc)) {\n sections_to_display.push(t_student_objects[i]);\n document.body.style.backgroundColor = \"aqua\";\n found += 1;\n }\n else if (student_email.includes(user_input_lc)) {\n sections_to_display.push(t_student_objects[i]);\n document.body.style.backgroundColor = \"aqua\";\n found += 1;\n }\n }\n\n check_result(found);\n\n // remove old links at the bottom of the page\n var pag_div = document.querySelector(\"div.pagination\");\n while (pag_div.firstChild) {\n pag_div.removeChild(pag_div.firstChild);\n }\n\n // removes current values in the t_student_objects array\n t_student_objects.splice(0, t_student_objects.length);\n\n // adds values from sections_to_display to the t_student_objects\n for (let i = 0; i < sections_to_display.length; i++) {\n t_student_objects.push(sections_to_display[i]);\n }\n\n // This will display the new correct number of links on the page\n const new_pagination_links = make_pages(t_student_objects.length);\n attach_links_to_container(div_pagination, new_pagination_links);\n new_default_settings(new_pagination_links);\n\n}", "title": "" }, { "docid": "b3cd0cfaf648107418d2d59dc6c3e76a", "score": "0.63871056", "text": "function adjustPagination () {\n\n const pageDiv = document.querySelector ('div.pagination'); // select the pagination division\n const lis = pageDiv.querySelectorAll ('li'); // put all of the list items into an array\n const searchDiv = document.querySelector ('div.student-search'); // select the search division\n const p = searchDiv.querySelector ('p'); // select the error message for when the list is empty\n const pages = Math.ceil(activeList.length / studentsPerPage); // display this many page selection elements\n\n // Adjust the display values of the pagination elements\n // based on the length of the active list. We will only\n // display page navigation elements if there are 2 or more pages.\n\n for (let i = 0; i < lis.length; i++) {\n if (i > pages - 1 || pages === 1) {\n lis[i].style.display = 'none';\n } else {\n lis[i].style.display = '';\n }\n }\n\n // if the active list is empty, display the error message under the search bar\n \n if (activeList.length === 0) {\n p.style.display = ''; // display the 'no search results' message\n } else {\n p.style.display = 'none'; // hide the message\n }\n }", "title": "" }, { "docid": "e2345cdc499e14803daf163b237b319d", "score": "0.6382857", "text": "function showPage(list, page) {\n const studentList = document.querySelector(\"ul[class='student-list']\");\n console.log(studentList);\n\n studentList.innerHTML = \"\";\n\n startIdx = itemsPerPage * page - itemsPerPage;\n endIdx = itemsPerPage * page;\n\n if(endIdx > list.length) {\n endIdx = list.length;\n }\n\n for(let i = startIdx; i < endIdx; i++) {\n // Declare all the elements to dynamically insert\n let studentItem = document.createElement(\"LI\");\n let studentDetails = document.createElement(\"DIV\");\n let profilePicture = document.createElement(\"IMG\");\n let studentName = document.createElement(\"H3\");\n let studentEmail = document.createElement(\"SPAN\");\n let joinedDetails = document.createElement(\"DIV\");\n let dateJoined = document.createElement(\"span\");\n\n // Set the proper class names\n studentItem.className = \"student-item cf\";\n studentDetails.className = \"student-details\";\n\n // Put in profile picture and its HTML properties\n profilePicture.className = \"avatar\";\n profilePicture.src = list[i].picture.large;\n profilePicture.alt = \"Profile Picture\";\n\n // Set the name\n studentName.innerHTML = list[i].name.first + \" \" + list[i].name.last;\n\n // Set the email\n studentEmail.className = \"email\";\n studentEmail.innerHTML = list[i].email;\n \n // Build first div\n studentDetails.append(profilePicture, studentName, studentEmail);\n \n // Set other details\n joinedDetails.className = \"joined-details\";\n dateJoined.className = \"date\";\n dateJoined.innerHTML = list[i].registered.date;\n\n // Add it all together and add to DOM\n joinedDetails.append(dateJoined);\n\n studentItem.append(studentDetails, joinedDetails);\n\n studentList.appendChild(studentItem);\n }\n}", "title": "" }, { "docid": "a5476ade57982e3ed8940873d9a84cc2", "score": "0.63781434", "text": "function appendPageLinks(list) {\n\n // use math to calculate the number of pages are needed\n const numberOfList = Math.ceil(list.length / 10);\n\n // create and append a div to the div has class \"page\"\n const paginationDiv = document.createElement('div');\n paginationDiv.className = 'pagination';\n document.querySelector('.page').appendChild(paginationDiv);\n\n const paginationUl = document.createElement('ul');\n paginationDiv.appendChild(paginationUl);\n\n // use for loop to add enough li tag and a tag \n\n for(let i = 0; i < numberOfList; i++) {\n const paginationLi = document.createElement('li');\n const paginationA = document.createElement('a');\n paginationA.textContent = `${i+1}`;\n if(i == 0) {\n paginationA.className = \"active\";\n }\n paginationA.setAttribute(\"href\", \"#\");\n\n // add event listenr to every a tag\n // use the content of a tag to set the target a tag\n // pass in the content of a tag to function showPage to show those students\n paginationA.addEventListener('click', (event) => {\n showPage(list, i+1);\n\n // in the pass in function, remove the class active from all the a tag\n const paginationAs = document.querySelectorAll('.pagination ul li a');\n for(let i = 0; i < paginationAs.length; i++) {\n paginationAs[i].className = \"\";\n }\n \n // set class active to that a tag\n event.target.className = \"active\";\n });\n\n paginationLi.appendChild(paginationA);\n paginationUl.appendChild(paginationLi);\n }\n\n}", "title": "" }, { "docid": "763a7134e28326c2f21d67ee1b5b3ea0", "score": "0.63751465", "text": "function changePage(event) {\n if (event.target.tagName === \"A\") {\n const links = ul.querySelectorAll(\"li a\");\n for (let i = 0; i < links.length; i++) {\n links[i].className = \"\";\n }\n event.target.className = \"active\";\n showPage(studentList, event.target.textContent);\n }\n }", "title": "" }, { "docid": "45bcad497d199bd851cc2e94518f6487", "score": "0.63657284", "text": "function addPagination(pageNumber) {\n // Getting the list element so that we can add the pages buttons\n const ul = document.querySelector('.link-list');\n // Reset its content\n ul.innerHTML = '';\n // Calculating the number of pages.\n // We used ceil function because maybe the quotient of the division is a float number\n const numberOfPages = Math.ceil(studentsList.length / itemsPerPage);\n // This for loop starts from 1 to number of pages inclusively\n for (let i = 1; i <= numberOfPages; i++) {\n // Creating a new li element\n const li = document.createElement('li');\n // Creating a new button\n const button = document.createElement('button');\n // Setting the type of the button\n button.type = 'button';\n // Setting the text content of the button\n button.textContent = `${i}`;\n // If the iterator is at the current page number, mark the page number as active\n if (i === pageNumber) {\n // As we have said in the previous comment, we mark the page number s active\n button.className = 'active';\n }\n // Appending the button to the list item\n li.appendChild(button);\n // Appending the list item to the unordered list\n ul.appendChild(li);\n }\n // This event listener is for the whole unordered list. However, we will only consider clicks on the list items.\n // The event listener will report the click to parent which is the unordered list through bubbling\n ul.addEventListener('click', (event) => {\n // Only consider clicks on the buttons\n if (event.target.tagName === 'BUTTON') {\n // Save the clicked button object\n const button = event.target;\n // Get the page number\n const pageNumber = parseInt(button.textContent);\n // Call show page to update the items\n showPage(pageNumber);\n // Call add pagination to mark the new page number as active\n addPagination(pageNumber);\n }\n });\n}", "title": "" }, { "docid": "b11940372a8ca82e2d8bf8308299d651", "score": "0.6336772", "text": "function fetchPage(pageNumber) {\n var students = document.getElementsByClassName('student-item');\n for (let i = 0; i < students.length; i++) {\n if (i >= (pageNumber * 10) && i <= (pageNumber * 10) + 9) { // checking if 'i' fell within the number range to determine whether student will be displayed\n students[i].hidden = false;\n } else {\n students[i].hidden = true;\n }\n }\n}", "title": "" }, { "docid": "4200d59d18541a3ec8eec13079737d7c", "score": "0.6330283", "text": "function activateAll() {\r\n let lastIndex = currentPageNb * nbStudentsPerPage;\r\n let firstIndex = lastIndex - nbStudentsPerPage;\r\n\r\n for(i = 0; i < totalStudents; i++) {\r\n if (i >= firstIndex && i < lastIndex) {\r\n studentItemLI[i].style.display = '';\r\n } else {\r\n studentItemLI[i].style.display = 'none';\r\n }\r\n }\r\n}", "title": "" }, { "docid": "1ea2820e40382c2d1cce5246cea06b85", "score": "0.6321434", "text": "function clickedProgramPagination(){\n\t\t$(\".program_pagination .page-item a\").click(function(){\t\n\t\t\tvar clickedPage = parseInt($(this).attr(\"id\"));\n\t\t\tsearchPrograms(page=clickedPage);\n\t\t\thistoryReplacePage(page = page);\n\t\t});\n\t}", "title": "" }, { "docid": "680cf237e4c84d129ba46ffea5fe9d4c", "score": "0.6314634", "text": "function oneStudentLinkClick() {\n clearValues()\n hideAll();\n makeVisible(\"#oneStudent\");\n makeInvisible(\"#oneResult\");\n \n getAllStudents('getStudentsListOneCallBack'); //ajax call to get all student for select list\n}", "title": "" }, { "docid": "c854812b217b0c9fdcc88c8fa0ee2d70", "score": "0.6292754", "text": "function addPageButton(studentList) {\n\n\t// Append pagination div into the DOM\n\t$('.page').append(pagination);\n\n\t// Create each page button\n\tvar length = studentList.length;\n\tfor (var i = 1; i <=length; i++) {\n\t\t$('.pagination ul').append(\"<li><a href='#'>\" + i + \"</a></li>\");\n\t}\n\n\t// Make first page active\n\t$('.pagination ul li a').first().addClass(\"active\");\n\n\t// Add event listener for each page button\n\t$('.pagination ul li a').click(function() {\n\t\t\n\t\tvar pageNo = parseInt(this.text) - 1;\n\t\t\n\t\tdisplayPage(pageNo, studentList);\n\n\t\t// Remove all classes and make current page active\n\t\t$('.pagination ul li a').removeClass();\n\t\t$(this).addClass(\"active\");\n\t});\n\n}", "title": "" }, { "docid": "3bef4d81a3d108d28870e4ef4f76d905", "score": "0.6283804", "text": "function appendPageLinks(studentList) {\r\n // determine how many pages for this student list\r\n const noOfButtons= Math.ceil(studentList.length/10);\r\n\r\n // create a page link section\r\n const paginDiv= document.createElement('div');\r\n paginDiv.className= 'pagination';\r\n const mainDiv= document.querySelector('div.page');\r\n mainDiv.appendChild(paginDiv);\r\n const ul= document.createElement('ul');\r\n paginDiv.appendChild(ul);\r\n\r\n // based on no of buttons required, adding that number of buttons. \r\n for(let i=1; i<= noOfButtons; i++){\r\n const li= document.createElement('li');\r\n ul.appendChild(li);\r\n const a= document.createElement('a');\r\n li.appendChild(a);\r\n a.href= \"#\";\r\n a.innerText= i;\r\n }\r\n}", "title": "" }, { "docid": "dbfc7e7c259f5a65ffb6a7c77ff9b29b", "score": "0.6263941", "text": "function appendPageLinks(list) {\r\n const divPage = document.querySelector('.page');\r\n const div = document.createElement('div');\r\n div.classList.add('pagination');\r\n divPage.appendChild(div);\r\n const ul = document.createElement('ul');\r\n div.appendChild(ul);\r\n\r\n // Creating Li and a element, that gets appended to the page via a for loop\r\n const pages = Math.ceil(list.length / maxStudents);\r\n for(let i = 1; i < pages; i++) {\r\n const li = document.createElement('li');\r\n const aRef = document.createElement('a');\r\n aRef.setAttribute('href', '#');\r\n aRef.textContent = i;\r\n li.appendChild(aRef);\r\n ul.appendChild(li);\r\n }\r\n\r\n // Iterating over all the A elements, adding the active class to the target clicked\r\n // and removing it from all the other a elements\r\n\r\n const aTag = document.querySelectorAll('a');\r\n aTag[0].classList.add('active');\r\n for(let j = 0; j < aTag.length; j++) {\r\n ul.addEventListener('click', (e) => {\r\n // Checking to see if the target clicked is the link inside a li element\r\n // if it isnt, nothing happens\r\n if(e.target.hasAttribute('href')){\r\n aTag[j].classList.remove('active');\r\n e.target.classList.add('active');\r\n showPage(listItem, e.target.textContent);\r\n }\r\n }),false;\r\n }\r\n }", "title": "" }, { "docid": "6a7ac982da672d722f9d966a88e753af", "score": "0.6257566", "text": "function studentSearch() {\n\t\n\t// Get input value from search box\n\tvar input = $(this).val().toLowerCase().trim();\n\t\n\t// Filter method returns matching list items\n\tvar filterList = studentItems.filter(function() {\n\n\t\tvar name = $(this).find('h3').text();\n\t\tvar email = $(this).find('.email').text();\n\n\t\tif(name.indexOf(input) > -1 || email.indexOf(input) > -1) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t});\n\n\t// Remove page buttons from the DOM\n\t$('.pagination').remove();\n\n\tif (filterList.length === 0) {\n\t\t$('.page-header h2').text('NO MATCH FOUND');\n\t} else {\n\t\t$('.page-header h2').text('STUDENTS');\n\t}\n\n\tvar list = splitStudentList(filterList);\n\t\n\tif (filterList.length >= 10) {\n\t\taddPageButton(list);\n\t}\n\n\tdisplayPage(0, list);\n\n}", "title": "" }, { "docid": "35eed7dcf4ca0c23bd9793eb33af68f9", "score": "0.62543994", "text": "function startEndParameters (selectedStudents){ \r\n var selectedPage = $('.selected a').text(); //get page number\r\n var selectedPageNum = parseInt(selectedPage); //page number into integer\r\n end = (selectedPageNum * 10); //set ending number\r\n if (end > selectedStudents) { //checks if not enough students to fill final page\r\n end = selectedStudents; //makes end number total number of students\r\n }\r\n start = (end - 10); //start number 10 less than end number\r\n}", "title": "" }, { "docid": "614d3390b824b05f9be8334fa0ef0c47", "score": "0.62323576", "text": "function displayListItems(){\n const arr = [];\n const page = document.querySelector(\".page\");\n //removes h4 element that was created if there were no matches found\n if (document.querySelector(\".page h4\")!== null){\n const h4 = document.querySelector(\".page h4\");\n page.removeChild(h4);\n }\n for (let i = 0; i < studentList.length; i++){\n const h3 = studentList[i].querySelector(\"h3\");\n studentList[i].style.display = \"none\";\n\n if (h3.innerText.includes(input.value)){\n arr.push(studentList[i]);\n } \n }\n showPage(arr,1);\n \n const div = document.querySelector(\".pagination\");\n const h4 = document.createElement(\"h4\");\n if (arr.length === 0 ){ \n h4.textContent = \"There are no matches\";\n page.appendChild(h4);\n } \n //removes previous pagination div\n page.removeChild(div);\n appendPageLinks(arr);\n}", "title": "" }, { "docid": "743c5bccf445a3a54a3eaac90ba36773", "score": "0.6230854", "text": "function studentpaginatorNextButton() {\n var nextClick = localStorage.getItem('nextpage');\n // var prevClick = localStorage.getItem('previouspage');\n if (parseInt(nextClick) >= 1) {\n $('#prevButton').show();\n $('#prevButton').css('background-color', '');\n $('#prevButton').css('color', '#007dc6');\n\n $('#nextButton').css('background-color', '#007dc6');\n $('#nextButton').css('color', 'white');\n\n var next = parseInt(nextClick) + 1;\n var prev = parseInt(nextClick);\n\n localStorage.setItem('nextpage', next);\n localStorage.setItem('previouspage', prev);\n } else {\n return false;\n }\n\n var queryString = $('#examAjaxsearch').val();\n // --------------------------- next [search + pagination] ---------------------------------------------------------\n if (queryString.trim().length != 0) {\n // alert(queryString);\n // ---------------- AJax Call --------------------\n $.ajax({\n type: 'GET',\n url: \"examSearch\",\n data: { search_String: queryString, 'page': next },\n success: function (response) {\n console.log(response['searchResultList']);\n // -------------------------------------------------------------------------------------------------\n var filteredData = '';\n if (response['searchResultList'].length > 0) {\n for (var i = 0; i < response['searchResultList'].length; i++) {\n var addStudent = '<tr class=\"in-queue\">\\\n <td style=\"background-color:white;\"><a href=\"exam-details/'+response['searchResultList'][i]['id']+'\" class=\"link\">'+response['searchResultList'][i]['examName']+'<i class=\"fa fa-caret-right\"></i></a></td>\\\n <td style=\"background-color:white;\">'+response['searchResultList'][i]['examID']+'</td>\\\n <td style=\"background-color:white;\">'+response['searchResultList'][i]['examAssociateCourse']+'</td>\\\n <td style=\"background-color:white;\">'+response['searchResultList'][i]['examTotalPaper']+'</td>\\\n <td style=\"background-color:white;\">'+response['searchResultList'][i]['examTotalStudent']+'</td>\\\n <td style=\"background-color:white;\">'+response['searchResultList'][i]['examStartDate']+'</td>\\\n <td style=\"background-color:white;\">'+response['searchResultList'][i]['examEndDate']+'</td>\\\n <td style=\"background-color:white;\" class=\"details-control\">\\\n <a href=\"exam-details/'+response['searchResultList'][i]['id']+'\" class=\"view ml-1\"><i class=\"fa fa-eye\"></i></a>\\\n <a href=\"edit-exam/'+response['searchResultList'][i]['id']+'\" class=\"edit\"><i class=\"fa fa-edit\"></i></a>\\\n </td>\\\n </tr>';\n\n filteredData = filteredData + addStudent;\n }\n $('#examAppendData').html('');\n $('#examAppendData').append(filteredData);\n } else {\n $('#examAppendData').html('');\n $('#examAppendData').html('<tr>\\\n <td style=\"background: white !important;\"></td>\\\n <td style=\"background: white !important;color:black;\"></td>\\\n <td style=\"background: white !important;color:black;\"></td>\\\n <td style=\"background: white !important;color:black;\"></td>\\\n <td style=\"background: white !important;color:black;\">No record available.</td>\\\n <td style=\"background: white !important;color:black;\"></td>\\\n <td style=\"background: white !important;color:black;\"></td>\\\n <td style=\"background: white !important;color:black;\" class=\"details-control\">\\\n </td>\\\n </tr >');\n }\n\n\n\n // =================================================================================================\n }\n });\n\n // ---------------------------------------------------\n } else {\n // alert('blank query string!')\n $.ajax({\n type: 'GET',\n url: \"examSearch\",\n data: { search_String: '', 'page': next },\n success: function (response) {\n console.log(response['searchResultList']);\n\n // -------------------------------------------------------------------------------------------------\n var filteredData = '';\n if (response['searchResultList'].length > 0) {\n for (var i = 0; i < response['searchResultList'].length; i++) {\n var addStudent = '<tr class=\"in-queue\">\\\n <td style=\"background-color:white;\"><a href=\"exam-details/'+response['searchResultList'][i]['id']+'\" class=\"link\">'+response['searchResultList'][i]['examName']+'<i class=\"fa fa-caret-right\"></i></a></td>\\\n <td style=\"background-color:white;\">'+response['searchResultList'][i]['examID']+'</td>\\\n <td style=\"background-color:white;\">'+response['searchResultList'][i]['examAssociateCourse']+'</td>\\\n <td style=\"background-color:white;\">'+response['searchResultList'][i]['examTotalPaper']+'</td>\\\n <td style=\"background-color:white;\">'+response['searchResultList'][i]['examTotalStudent']+'</td>\\\n <td style=\"background-color:white;\">'+response['searchResultList'][i]['examStartDate']+'</td>\\\n <td style=\"background-color:white;\">'+response['searchResultList'][i]['examEndDate']+'</td>\\\n <td style=\"background-color:white;\" class=\"details-control\">\\\n <a href=\"exam-details/'+response['searchResultList'][i]['id']+'\" class=\"view ml-1\"><i class=\"fa fa-eye\"></i></a>\\\n <a href=\"edit-exam/'+response['searchResultList'][i]['id']+'\" class=\"edit\"><i class=\"fa fa-edit\"></i></a>\\\n </td>\\\n </tr>';\n\n filteredData = filteredData + addStudent;\n }\n $('#examAppendData').html('');\n $('#examAppendData').append(filteredData);\n } else {\n $('#examAppendData').html('');\n $('#examAppendData').html('<tr>\\\n <td style=\"background: white !important;\"></td>\\\n <td style=\"background: white !important;color:black;\"></td>\\\n <td style=\"background: white !important;color:black;\"></td>\\\n <td style=\"background: white !important;color:black;\"></td>\\\n <td style=\"background: white !important;color:black;\">No record available.</td>\\\n <td style=\"background: white !important;color:black;\"></td>\\\n <td style=\"background: white !important;color:black;\"></td>\\\n <td style=\"background: white !important;color:black;\" class=\"details-control\">\\\n </td>\\\n </tr >');\n }\n }\n });\n }\n\n\n\n\n // -----------------------------------------------------------------------------------------------------------------\n}", "title": "" }, { "docid": "e8c3d5d82cb0271f11387f761849010a", "score": "0.61920047", "text": "function search(query){\n \n let searchList = [];\n\n for(let i = 0; i < studentList.length; i++){\n\n studentList[i].style.display = \"none\";\n\n let name = studentList[i].getElementsByTagName(\"h3\")[0].textContent;\n\n if(name.indexOf(query) != -1){\n searchList.push( studentList[i] )\n }\n }\n if(searchList.length == 0){\n noResults.style.display = \"\";\n }\n else {\n noResults.style.display = \"none\";\n }\n //hand the list back to the showPage function\n showPage(searchList, 0); \n //update the pagination links at the bottom of the page\n appendPageLinks(searchList);\n\n\n}", "title": "" }, { "docid": "cbef962cecf55e4e021c68188ad420c3", "score": "0.61364", "text": "function showPage(list, page) {\n\n// console.log(list);\n// console.log(page);\n\n var indexStart = (page * 9) - 9;\n var indexEnd = (page * 9);\n var studentList = document.querySelector('.student-list'); \n studentList.innerHTML = \" \";\n \n// loop over the length of the `list` parameter\n\nfor (let i = 0; i < list.length; i++) {\n if(i >= indexStart && i<indexEnd) {\n\n// create the elements needed to display the student information\n var studentName = list[i].name.first + ' ' + list[i].name.last\n var avatar = list[i].picture.large\n var date = list[i].registered.date\n var email = list[i].email \n \n// insert the above elements\n let studentItem = \n `<li class=\"student-item cf\">\n <div class= \"student-details\">\n <img class = \"avatar\" src=\"${avatar}\">\n <h3>${studentName}<h3>\n <span class=\"email\">${email}</span>\n </div>\n <div class = \"Joined details\">\n <span class = \"date\">${date}</span> \n </div>\n </li> `\n\n console.log(avatar);\n studentList.insertAdjacentHTML('beforeend', studentItem);\n \n }\n }\n\n}", "title": "" }, { "docid": "4ea7e7e27f1707b3c4286573a71f2574", "score": "0.6116826", "text": "function init() { \n $students.css('display', 'none'); \n $students.slice(0, showPerPage).css('display', 'block'); \n \n}", "title": "" }, { "docid": "f3771aff90ec1d8712e7564a28438cd3", "score": "0.6107911", "text": "function next() {\n if (currentPage < MAX_PAGE_NUM) {\n hideAndDisplayItems(currentPage + 1);\n }\n}", "title": "" }, { "docid": "d7f2cdc10c73488926672939873598b4", "score": "0.61068285", "text": "function pagination(data) {\n $(\"#userPaging\").empty();\n\n var li = \"\";\n\n for (index = 0; index < data.total; index++) {\n var isActive = data.start-1 == index ? 'active' : '';\n\n if (isActive != \"\") {\n li = li + \"<li><a href='#' class=\" + isActive + \">\" + Number(index + 1) + \"</a></li>\";\n } else {\n li = li + \"<li><a href='#' onClick='getUsers(\" + Number(index + 1)+ \")'>\" + Number(index + 1) + \"</a></li>\";\n }\n\n }\n if (data.start < data.total - 1) {\n li = li + \"<li><a href='#' onClick='getUsers(\" + Number(data.start + 1) + \")'>Next <i class='fa fa-angle-double-right' aria-hidden='true'></i></a></li>\";\n } else {\n li = li + \"<li><a href='#' >Next <i class='fa fa-angle-double-right' aria-hidden='true'></i></a></li>\";\n }\n\n $(\"#userPaging\").append(li);\n\n}", "title": "" }, { "docid": "48b314a6ed47f0546c8c8a4ff73679ea", "score": "0.6028939", "text": "function searchStudent() {\n\n\t\t// Hide students when a new search begins\n\t\t$(\".student-item\").hide();\n\n\t\t// RegEx constructor to elvaluate text input for student matches\n\t\tvar searchVal = new RegExp($(\".student-search input\").val());\n\t\t\n\t\t// Clear searchResults array\n\t\tsearchResults = [];\n\n\t\tfor(var i = 0; i < $(\".student-item\").length; i++) {\n\n\t\t\t// If any student(s) HTML matches searchVal, push student(s) to searchResults\n\t\t\tif(searchVal.test($(\".student-details:eq(\" + i + \") h3\").text()) === true || searchVal.test($(\".student-details:eq(\" + i + \") span\").text()) === true) {\n\t\t\t\tsearchResults.push($(\".student-item:eq(\" + i + \")\"));\n\t\t\t}\n\n\t\t}\n\n\t\t// Create new pagination based on amount of matching results\n\t\tpaginationAmount(searchResults.length);\n\n\t\t// If no matches were found\n\t\tif(searchResults.length === 0) {\n\t\t\t$(\".page .no-results\").remove();\n\t\t\t$(\".page\").append(\"<p class='no-results'>No Matches Found...</p>\");\n\t\t} else {\n\t\t\t$(\".page .no-results\").remove();\n\t\t\tdisplayResults();\n\t\t}\n\t}", "title": "" }, { "docid": "27972c6a39fc361d9060046c504598cf", "score": "0.6026944", "text": "function showPage(pageNr, pageLi) {\n $(\".student-list li\").hide();\n $.each(pageLi, function(index, page){\n if (pageNr === index) {\n $.each(page, function(i, itemLi){\n $(itemLi).fadeIn('fast');\n });\n }\n });\n}", "title": "" }, { "docid": "58be488b943508fd2e9502d24a5d5ee1", "score": "0.60261923", "text": "function showPage(currentPage) {\r\n\tlet restPage = resLst.length - currentPage * 3\r\n\tif (restPage >= 0) {\r\n\t\tcontentBody.innerText = \"\"\r\n\t\tfor (let i = 0; i < maxReviews; i++) {\r\n\t\t\tlet j = ((currentPage-1)*3) + i\r\n\t\t\taddNewResToDom(resLst[j])\r\n\t\t}\r\n\t} else {\r\n\t\trestPage = maxReviews+restPage\r\n\t\tcontentBody.innerText = \"\"\r\n\t\tfor (let i = 0; i < restPage; i++) {\r\n\t\t\tlet j = ((currentPage-1)*3) + i\r\n\t\t\taddNewResToDom(resLst[j])\r\n\t\t}\r\n }\r\n}", "title": "" }, { "docid": "e6718921ad55263e3dc553504d9f4c08", "score": "0.6016912", "text": "function setUpPage(studentObjList, klass){\n\t\tfor (let i = 0; i < studentObjList.length; i += 1){\n\t\t\tconst hrefId = i +1;\n\t\t\t\t\tif(hrefId != 1){\n\t\t\t\t\t\t setUpStudentList(studentObjList[i], true, hrefId, klass);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t setUpStudentList(studentObjList[i], false, hrefId, klass);\n\t\t\t\t\t}\n\t\t\t\t\tif (hrefId != 1) {\n\t\t\t\t\t\t\tsetUpPageTabs(hrefId, false, klass);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\tsetUpPageTabs(hrefId, true, klass);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t}\n}", "title": "" }, { "docid": "483cfdde782299b7c65b155c13f835bf", "score": "0.6012912", "text": "function getStudents() {\r\n if(searchFor === '') {\r\n activateAll();\r\n } else {\r\n clearstudentItemLI();\r\n foundItem = getNbMatchingName();\r\n console.log('found ' +foundItem);\r\n activateNameFound();\r\n }\r\n}", "title": "" }, { "docid": "1f2d84d0ca324f19b3c2e122b76fa9ac", "score": "0.59920484", "text": "function searchPagination(){\r\n const paginationLinkList = document.querySelectorAll('.pagination li a');\r\n const paginationLi = document.querySelector('.pagination li');\r\n for(var i = 0; i<paginationLinkList.length; i += 1) {\r\n paginationLinkList[i].style.display = \"none\";}\r\n let resultsLength = results.length;\r\n for (var j = 0; j< Math.ceil(resultsLength/10); j +=1){\r\n let newLink = document.createElement(\"a\");\r\n newLink.textContent = `${j + 1}`;\r\n newLink.type = \"button\";\r\n newLink.setAttribute('href', '#');\r\n newLink.id = `${j+1}`\r\n newLink.classList.add(\"searchButton\");\r\n paginationLi.appendChild(newLink);\r\n \r\n }\r\nfunction showPageSearch() {\r\n let searchPagButton = document.querySelectorAll('.searchButton');\r\n for (var j = 0; j< searchPagButton.length; j+=1) {\r\n searchPagButton[j].addEventListener (\"click\", (e) =>{\r\n for (var i = 0; i < results.length; i +=1){\r\n if (i < parseInt(e.target.textContent) *10 && i >= (parseInt(e.target.textContent)*10) - 10 ) {\r\n results[i].parentNode.parentNode.style.display = \"\"; } else {\r\n results[i].parentNode.parentNode.style.display = \"none\";}\r\n }\r\n } \r\n )\r\n }\r\n searchPagButton[0].click();\r\n}\r\n\r\nshowPageSearch();\r\n}", "title": "" } ]
a27045eb78606ec8c284964502c4fa9b
TODO: Optimize groups of rules with nonempty prefix into some sort of decision tree
[ { "docid": "878696d4883d1de06840dab57c1f800d", "score": "0.0", "text": "function update(evt) {\n if (evt && evt.defaultPrevented) return;\n var ignoreUpdate = lastPushedUrl && $location.url() === lastPushedUrl;\n lastPushedUrl = undefined;\n // TODO: Re-implement this in 1.0 for https://github.com/angular-ui/ui-router/issues/1573\n //if (ignoreUpdate) return true;\n\n function check(rule) {\n var handled = rule($injector, $location);\n\n if (!handled) return false;\n if (isString(handled)) $location.replace().url(handled);\n return true;\n }\n var n = rules.length, i;\n\n for (i = 0; i < n; i++) {\n if (check(rules[i])) return;\n }\n // always check otherwise last to allow dynamic updates to the set of rules\n if (otherwise) check(otherwise);\n }", "title": "" } ]
[ { "docid": "8405b80c0144aa16094c93ae23a66da7", "score": "0.5767434", "text": "prefixed (str) {\n let rule = this.virtual(str)\n if (this.disabled(rule.first)) {\n return rule.nodes\n }\n\n let result = { warn: () => null }\n\n let prefixer = this.prefixer().add[rule.first.prop]\n prefixer && prefixer.process && prefixer.process(rule.first, result)\n\n for (let decl of rule.nodes) {\n for (let value of this.prefixer().values('add', rule.first.prop)) {\n value.process(decl)\n }\n Value.save(this.all, decl)\n }\n\n return rule.nodes\n }", "title": "" }, { "docid": "85ecd530fac2c23e44e2c0d91382985c", "score": "0.5713889", "text": "function compileRules ( rules, context ) {\n\tconst acceptSelf = rules [ 0 ].name === \"scope\" && rules [ 1 ].type === \"descendant\";\n\treturn rules.reduce ( ( func, rule, index ) => {\n\t\tif ( func === falseFunc ) {\n\t\t\treturn func;\n\t\t}\n\n\t\treturn general [ rule.type ] ( func, rule, context, acceptSelf && index === 1 );\n\t}, trueFunc );\n}", "title": "" }, { "docid": "bbe9c857de15dab82ed10b2b1f60387c", "score": "0.56656027", "text": "addRule(event, selectorNum) {\n var rulesets = this.state.rulesets\n var rule = rulesets[this.state.currentRuleset][selectorNum].rules[0]\n var selectorParameters = rulesets[this.state.currentRuleset][selectorNum].parameters\n\n if (!rule.rule) { // If the rule doesn't have a defined rule type yet, don't add this rule\n return\n }\n\n var parameters = rule.parameters\n\n // Iterate through each parameterin the rules\n for (var parameter of Object.keys(parameters)) {\n if ((selectorParameters.includes(\"all\") || selectorParameters.length > 1) && selectorParameters) { // If the selector is plural\n if (parameter == \"for\" && parameters[parameter] == \"\") { // If the for parameter is not present, then don't add this rule\n return\n } \n } else { // If the selector is not plural\n if (!parameters[parameter] && parameter != \"for\") { // If the selector isn't the for parameter, check if its empty, if it is empty, don't add this rule\n return \n } else if (parameter == \"for\" && parameters[parameter] == \"\") { // If the parameter is the for parameter and it is empty, set it to \"all\"\n rulesets[this.state.currentRuleset][selectorNum].rules[0].parameters.for = \"all\"\n }\n }\n }\n\n var newRule = rulesets[this.state.currentRuleset][selectorNum].rules[0]\n\n newRule[\"new\"] = false // Designate the rule as no longer new\n rulesets[this.state.currentRuleset][selectorNum].rules.splice(0, 1) // Delete the new rule\n rulesets[this.state.currentRuleset][selectorNum].rules.unshift(newRule) // Take the previously new rule and add it the beginning of the list\n rulesets[this.state.currentRuleset][selectorNum].rules.unshift({ // Add a new empty rule input field\n \"new\": true,\n \"rule\": \"\", \n \"parameters\": {}\n })\n\n this.setState({rulesets: rulesets}, () => {\n this.updateData()\n })\n }", "title": "" }, { "docid": "6050cbcb1b64f62b5be1084ae23a36d0", "score": "0.5661504", "text": "prefixeds(rule) {\n if (rule._autoprefixerPrefixeds) {\n if (rule._autoprefixerPrefixeds[this.name]) {\n return rule._autoprefixerPrefixeds\n }\n } else {\n rule._autoprefixerPrefixeds = {}\n }\n\n let prefixeds = {}\n if (rule.selector.includes(',')) {\n let ruleParts = list.comma(rule.selector)\n let toProcess = ruleParts.filter(el => el.includes(this.name))\n\n for (let prefix of this.possible()) {\n prefixeds[prefix] = toProcess\n .map(el => this.replace(el, prefix))\n .join(', ')\n }\n } else {\n for (let prefix of this.possible()) {\n prefixeds[prefix] = this.replace(rule.selector, prefix)\n }\n }\n\n rule._autoprefixerPrefixeds[this.name] = prefixeds\n return rule._autoprefixerPrefixeds\n }", "title": "" }, { "docid": "7ff6e3453b94399172de71fd31c06bd9", "score": "0.56280667", "text": "prefixeds (rule) {\n if (rule._autoprefixerPrefixeds) {\n if (rule._autoprefixerPrefixeds[this.name]) {\n return rule._autoprefixerPrefixeds\n }\n } else {\n rule._autoprefixerPrefixeds = {}\n }\n\n let prefixeds = {}\n if (rule.selector.includes(',')) {\n let ruleParts = list.comma(rule.selector)\n let toProcess = ruleParts.filter(el => el.includes(this.name))\n\n for (let prefix of this.possible()) {\n prefixeds[prefix] = toProcess\n .map(el => this.replace(el, prefix))\n .join(', ')\n }\n } else {\n for (let prefix of this.possible()) {\n prefixeds[prefix] = this.replace(rule.selector, prefix)\n }\n }\n\n rule._autoprefixerPrefixeds[this.name] = prefixeds\n return rule._autoprefixerPrefixeds\n }", "title": "" }, { "docid": "0dea0fee0272f467b90741bc7b11dbc0", "score": "0.56254864", "text": "already (rule, prefixeds, prefix) {\n let index = rule.parent.index(rule) - 1\n\n while (index >= 0) {\n let before = rule.parent.nodes[index]\n\n if (before.type !== 'rule') {\n return false\n }\n\n let some = false\n for (let key in prefixeds[this.name]) {\n let prefixed = prefixeds[this.name][key]\n if (before.selector === prefixed) {\n if (prefix === key) {\n return true\n } else {\n some = true\n break\n }\n }\n }\n if (!some) {\n return false\n }\n\n index -= 1\n }\n\n return false\n }", "title": "" }, { "docid": "550531a14c9a9b5fab09cebd7ac8a7e5", "score": "0.5572377", "text": "function prepareRules(rules, macros, actions, tokens, startConditions, caseless) {\n\t var m,i,k,action,conditions,\n\t newRules = [];\n\t\n\t if (macros) {\n\t macros = prepareMacros(macros);\n\t }\n\t\n\t function tokenNumberReplacement (str, token) {\n\t return \"return \" + (tokens[token] || \"'\" + token + \"'\");\n\t }\n\t\n\t actions.push('switch($avoiding_name_collisions) {');\n\t\n\t for (i=0;i < rules.length; i++) {\n\t if (Object.prototype.toString.apply(rules[i][0]) !== '[object Array]') {\n\t // implicit add to all inclusive start conditions\n\t for (k in startConditions) {\n\t if (startConditions[k].inclusive) {\n\t startConditions[k].rules.push(i);\n\t }\n\t }\n\t } else if (rules[i][0][0] === '*') {\n\t // Add to ALL start conditions\n\t for (k in startConditions) {\n\t startConditions[k].rules.push(i);\n\t }\n\t rules[i].shift();\n\t } else {\n\t // Add to explicit start conditions\n\t conditions = rules[i].shift();\n\t for (k=0;k<conditions.length;k++) {\n\t startConditions[conditions[k]].rules.push(i);\n\t }\n\t }\n\t\n\t m = rules[i][0];\n\t if (typeof m === 'string') {\n\t for (k in macros) {\n\t if (macros.hasOwnProperty(k)) {\n\t m = m.split(\"{\" + k + \"}\").join('(' + macros[k] + ')');\n\t }\n\t }\n\t m = new RegExp(\"^(?:\" + m + \")\", caseless ? 'i':'');\n\t }\n\t newRules.push(m);\n\t if (typeof rules[i][1] === 'function') {\n\t rules[i][1] = String(rules[i][1]).replace(/^\\s*function \\(\\)\\s?\\{/, '').replace(/\\}\\s*$/, '');\n\t }\n\t action = rules[i][1];\n\t if (tokens && action.match(/return '[^']+'/)) {\n\t action = action.replace(/return '([^']+)'/g, tokenNumberReplacement);\n\t }\n\t actions.push('case ' + i + ':' + action + '\\nbreak;');\n\t }\n\t actions.push(\"}\");\n\t\n\t return newRules;\n\t}", "title": "" }, { "docid": "23ca5399242bc6c20e9f38767f46c5f3", "score": "0.55661505", "text": "already(rule, prefixeds, prefix) {\n let index = rule.parent.index(rule) - 1\n\n while (index >= 0) {\n let before = rule.parent.nodes[index]\n\n if (before.type !== 'rule') {\n return false\n }\n\n let some = false\n for (let key in prefixeds[this.name]) {\n let prefixed = prefixeds[this.name][key]\n if (before.selector === prefixed) {\n if (prefix === key) {\n return true\n } else {\n some = true\n break\n }\n }\n }\n if (!some) {\n return false\n }\n\n index -= 1\n }\n\n return false\n }", "title": "" }, { "docid": "19d8466e28cd486e864272651e00edd2", "score": "0.5553279", "text": "function parseQoSRule(rule){\n\tvar n;\n\n\tif(!isArray(rule)){\n\t alert(\"Invalid rule rules!\");return 0;\n\t}\n\n for (n=0; n<rule.length; n++){//loop for each rule\n rule[n] = rule[n].split(\"\\x02\"); //category;name;<data>;<data>;prio\n if( !isArray(rule[n]) ){\n alert(\"Invalid rule rules!\");return 0;\n }\n if( rule[n].length != 5 && rule[n].length != 6){ //must have 5 parts, 6 for desc_name\n alert(\"1 \"+\"rule must have 4 parts; mark -del on rule\"+rule[n]);\n rule[n][_name] = \"-del\"; //we leave a mark here and to be removed by ruleHygiene\n continue;\n //we don't return because we still need to continue the parse\n }\n\t}\n\t//ruleHygiene(rule);\n return 1;\n}", "title": "" }, { "docid": "f92b88abbf6854bad8df91ae1b9f5efc", "score": "0.55528873", "text": "static kx_baseLabel_setRules(label=null) {\n let scan = label? [label]: Object.keys(SizedBigInt.kx_baseLabel)\n const rAlpha = {falsetrue:\"upper\", falsefalse:true, truefalse:\"lower\", truetrue:false};\n for (let i of scan) {\n const r = SizedBigInt.kx_baseLabel[i]\n if (!r.base) r.base = r.alphabet.length;\n if (!r.bitsPerDigit) r.bitsPerDigit = Math.log2(r.base);\n if (!r.alphabet) throw new Error(`err2, invalid null alphabet`);\n if (!r.isHierar) r.isHierar = false;\n else if (r.alphabet.length<(r.base*2-2))\n throw new Error(`err3, invalid hierarchical alphabet in \"${baseLabel}\": ${r.alphabet}`);\n let alphaRgx = r.alphabet.replace('-','\\\\-');\n if (!r.regex) r.regex = '^(['+ alphaRgx +']+)$';\n if (!r.case)\n r.case = rAlpha[String(r.alphabet==r.alphabet.toLowerCase()) + (r.alphabet==r.alphabet.toUpperCase())]\n let aux = (r.case===false)? 'i': '';\n if (typeof r.regex =='string') r.regex = new RegExp(r.regex,aux);\n if (r.isDefault===undefined) r.isDefault=false;\n if (r.isDefault && i!=r.base) SizedBigInt.kx_baseLabel[String(r.base)] = {isAlias: i};\n aux = String(r.bitsPerDigit) +','+ r.bitsPerDigit;\n if (i!='2')\n r.regex_b2 = new RegExp('^((?:[01]{'+ aux +'})'+(r.isHierar?'*)([01]*)':'+)')+'$');\n r.label = i\n } // \\for\n }", "title": "" }, { "docid": "573f0c079ca91ccf4845ccdc5d86eddd", "score": "0.55173945", "text": "static kx_baseLabel_setRules(label=null) {\n let scan = label? [label]: Object.keys(SizedBigInt.kx_baseLabel)\n const rAlpha = {falsetrue:\"upper\", falsefalse:true, truefalse:\"lower\", truetrue:false};\n for (let i of scan) {\n const r = SizedBigInt.kx_baseLabel[i]\n if (!r.base) r.base = r.alphabet.length;\n if (!r.bitsPerDigit) r.bitsPerDigit = Math.log2(r.base);\n if (!r.alphabet) throw new Error(`err2, invalid null alphabet`);\n if (!r.isHierar) r.isHierar = false;\n else if (r.alphabet.length<(r.base*2-2))\n throw new Error(`err3, invalid hierarchical alphabet in \"${baseLabel}\": ${r.alphabet}`);\n let alphaRgx = r.alphabet.replace('-','\\\\-');\n if (!r.regex) r.regex = '^(['+ alphaRgx +']+)$';\n if (!r.case)\n r.case = rAlpha[String(r.alphabet==r.alphabet.toLowerCase()) + (r.alphabet==r.alphabet.toUpperCase())]\n let aux = (r.case===false)? 'i': '';\n if (typeof r.regex =='string') r.regex = new RegExp(r.regex,aux);\n if (r.isDefault===undefined) r.isDefault=false;\n if (r.isDefault && i!=r.base) SizedBigInt.kx_baseLabel[String(r.base)] = {isAlias: i};\n aux = String(r.bitsPerDigit) +','+ r.bitsPerDigit;\n if (i!='2')\n r.regex_b2 = new RegExp('^((?:[01]{'+ aux +'})'+(r.isHierar?'*)([01]*)':'+)')+'$');\n r.label = i\n } // \\for\n }", "title": "" }, { "docid": "3e5e7c47bf359f8cd891b438ac3ef22b", "score": "0.5500352", "text": "function prepareRules(rules, macros, actions, tokens, startConditions, caseless) {\n var m,i,k,action,conditions,\n newRules = [];\n\n if (macros) {\n macros = prepareMacros(macros);\n }\n\n function tokenNumberReplacement (str, token) {\n return \"return \" + (tokens[token] || \"'\" + token + \"'\");\n }\n\n actions.push('switch($avoiding_name_collisions) {');\n\n for (i=0;i < rules.length; i++) {\n if (Object.prototype.toString.apply(rules[i][0]) !== '[object Array]') {\n // implicit add to all inclusive start conditions\n for (k in startConditions) {\n if (startConditions[k].inclusive) {\n startConditions[k].rules.push(i);\n }\n }\n } else if (rules[i][0][0] === '*') {\n // Add to ALL start conditions\n for (k in startConditions) {\n startConditions[k].rules.push(i);\n }\n rules[i].shift();\n } else {\n // Add to explicit start conditions\n conditions = rules[i].shift();\n for (k=0;k<conditions.length;k++) {\n startConditions[conditions[k]].rules.push(i);\n }\n }\n\n m = rules[i][0];\n if (typeof m === 'string') {\n for (k in macros) {\n if (macros.hasOwnProperty(k)) {\n m = m.split(\"{\" + k + \"}\").join('(' + macros[k] + ')');\n }\n }\n m = new RegExp(\"^(?:\" + m + \")\", caseless ? 'i':'');\n }\n newRules.push(m);\n if (typeof rules[i][1] === 'function') {\n rules[i][1] = String(rules[i][1]).replace(/^\\s*function \\(\\)\\s?\\{/, '').replace(/\\}\\s*$/, '');\n }\n action = rules[i][1];\n if (tokens && action.match(/return '[^']+'/)) {\n action = action.replace(/return '([^']+)'/g, tokenNumberReplacement);\n }\n actions.push('case ' + i + ':' + action + '\\nbreak;');\n }\n actions.push(\"}\");\n\n return newRules;\n}", "title": "" }, { "docid": "9219a1e80fa3712fd26948ebb189f4c9", "score": "0.5475758", "text": "isHack (rule) {\n let index = rule.parent.index(rule) + 1\n let rules = rule.parent.nodes\n\n while (index < rules.length) {\n let before = rules[index].selector\n if (!before) {\n return true\n }\n\n if (before.includes(this.unprefixed) && before.match(this.nameRegexp)) {\n return false\n }\n\n let some = false\n for (let [string, regexp] of this.prefixeds) {\n if (before.includes(string) && before.match(regexp)) {\n some = true\n break\n }\n }\n\n if (!some) {\n return true\n }\n\n index += 1\n }\n\n return true\n }", "title": "" }, { "docid": "42128428bcd919e3e45434d8cfaf5ab7", "score": "0.54695034", "text": "static nominee(rules) {\n\tif (!rules.length) return\n\n\tlet max_rank = rules.reduce( (acc, cur) => {\n\t return Math.max(acc, cur.rank)\n\t}, Number.MIN_SAFE_INTEGER)\n\tlet min_stem = rules.reduce( (acc, cur) => {\n\t return { stem: cur.stem,\n\t\t len: Math.min(acc.stem.length, cur.stem.length) }\n\t}, { stem: rules[0].stem, len: 0 })\n\n\tlet ranks_are_equal = rules.every( rule => rule.rank === max_rank)\n\tlet stem_len_are_equal = rules.every( rule => rule.stem.length === min_stem.len)\n\tif (ranks_are_equal)\n\t return rules[rules.findIndex(v => v.stem.length === min_stem.len)]\n\tif (stem_len_are_equal)\n\t return rules[rules.findIndex(v => v.rank === max_rank)]\n\treturn rules[0]\n }", "title": "" }, { "docid": "da0c957754048eaaf273a997cbafd3b9", "score": "0.5463344", "text": "_parseRuleNames(text, prefixToRemove) {\n text = text.replace(prefixToRemove, \"\");\n const rulesToDisable = text\n .split(\",\")\n .map(r => r.trim())\n .filter(r => r.length > 0);\n\n return rulesToDisable.length > 0 ? rulesToDisable : this.ALL_RULES;\n }", "title": "" }, { "docid": "8913d422d1a49bd53d5725a44970533a", "score": "0.53721446", "text": "function buildRules( languageNode )\n{\n\tvar contextList, contextNode, sRegExp, rootNode;\t\n\tvar rulePropList, rulePropNode, rulePropNodeAttributes, ruleList, ruleNode;\n\n\trootNode = languageNode.selectSingleNode(\"/*\");\n\t\n\t// first building keyword regexp\n\tbuildKeywordRegExp( languageNode );\t\n\t\n\tcontextList = languageNode.selectNodes(\"contexts/context\");\n\t// create regular expressions for context\n\tfor (contextNode = contextList.nextNode(); contextNode != null; contextNode = contextList.nextNode())\n\t{\n\t\tsRegExp = buildRuleRegExp( languageNode, contextNode );\n\t\t// add attribute\n\t\tcontextNode.setAttribute( \"regexp\", sRegExp );\t\n\t}\n}", "title": "" }, { "docid": "5eaa125aefb72a4bffb0fb3fb39e45d8", "score": "0.5367322", "text": "function rules() {\n\t\n}", "title": "" }, { "docid": "f2c6b2b84bc52e2809eeeab001546667", "score": "0.5323925", "text": "function prepareRules(dict, actions, tokens, startConditions, caseless, caseHelper, opts) {\n var m, i, k, action, conditions,\n active_conditions,\n rules = dict.rules,\n newRules = [],\n macros = {};\n\n // Depending on the location within the regex we need different expansions of the macros:\n // one expansion for when a macro is *inside* a `[...]` and another expansion when a macro\n // is anywhere else in a regex:\n if (dict.macros) {\n macros = prepareMacros(dict.macros, opts);\n }\n\n function tokenNumberReplacement (str, token) {\n return 'return ' + (tokens[token] || '\\'' + token.replace(/'/g, '\\\\\\'') + '\\'');\n }\n\n // make sure a comment does not contain any embedded '*/' end-of-comment marker\n // as that would break the generated code\n function postprocessComment(str) {\n if (Array.isArray(str)) {\n str = str.join(' ');\n }\n str = str.replace(/\\*\\//g, '*\\\\/'); // destroy any inner `*/` comment terminator sequence.\n return str;\n }\n\n actions.push('switch($avoiding_name_collisions) {');\n\n for (i = 0; i < rules.length; i++) {\n active_conditions = [];\n if (Object.prototype.toString.apply(rules[i][0]) !== '[object Array]') {\n // implicit add to all inclusive start conditions\n for (k in startConditions) {\n if (startConditions[k].inclusive) {\n active_conditions.push(k);\n startConditions[k].rules.push(i);\n }\n }\n } else if (rules[i][0][0] === '*') {\n // Add to ALL start conditions\n active_conditions.push('*');\n for (k in startConditions) {\n startConditions[k].rules.push(i);\n }\n rules[i].shift();\n } else {\n // Add to explicit start conditions\n conditions = rules[i].shift();\n for (k = 0; k < conditions.length; k++) {\n if (!startConditions.hasOwnProperty(conditions[k])) {\n startConditions[conditions[k]] = {\n rules: [], inclusive: false\n };\n console.warn('Lexer Warning : \"' + conditions[k] + '\" start condition should be defined as %s or %x; assuming %x now.');\n }\n active_conditions.push(conditions[k]);\n startConditions[conditions[k]].rules.push(i);\n }\n }\n\n m = rules[i][0];\n if (typeof m === 'string') {\n m = expandMacros(m, macros);\n m = new RegExp('^(?:' + m + ')', caseless ? 'i' : '');\n }\n newRules.push(m);\n if (typeof rules[i][1] === 'function') {\n rules[i][1] = String(rules[i][1]).replace(/^\\s*function \\(\\)\\s?\\{/, '').replace(/\\}\\s*$/, '');\n }\n action = rules[i][1];\n if (tokens && action.match(/return '(?:\\\\'|[^']+)+'/)) {\n action = action.replace(/return '((?:\\\\'|[^']+)+)'/g, tokenNumberReplacement);\n }\n if (tokens && action.match(/return \"(?:\\\\\"|[^\"]+)+\"/)) {\n action = action.replace(/return \"((?:\\\\\"|[^\"]+)+)\"/g, tokenNumberReplacement);\n }\n\n var code = ['\\n/*! Conditions::'];\n code.push(postprocessComment(active_conditions));\n code.push('*/', '\\n/*! Rule:: ');\n code.push(postprocessComment(rules[i][0]));\n code.push('*/', '\\n');\n\n // When the action is *only* a simple `return TOKEN` statement, then add it to the caseHelpers;\n // otherwise add the additional `break;` at the end.\n //\n // Note: we do NOT analyze the action block any more to see if the *last* line is a simple\n // `return NNN;` statement as there are too many shoddy idioms, e.g.\n //\n // ```\n // %{ if (cond)\n // return TOKEN;\n // %}\n // ```\n //\n // which would then cause havoc when our action code analysis (using regexes or otherwise) was 'too simple'\n // to catch these culprits; hence we resort and stick with the most fundamental approach here:\n // always append `break;` even when it would be obvious to a human that such would be 'unreachable code'.\n var match_nr = /^return[\\s\\r\\n]+((?:'(?:\\\\'|[^']+)+')|(?:\"(?:\\\\\"|[^\"]+)+\")|\\d+)[\\s\\r\\n]*;?$/.exec(action.trim());\n if (match_nr) {\n caseHelper.push([].concat(code, i, ':', match_nr[1]).join(' ').replace(/[\\n]/g, '\\n '));\n } else {\n actions.push([].concat('case', i, ':', code, action, '\\nbreak;').join(' '));\n }\n }\n actions.push('default:');\n actions.push(' return this.simpleCaseActionClusters[$avoiding_name_collisions];');\n actions.push('}');\n\n return {\n rules: newRules,\n macros: macros\n };\n}", "title": "" }, { "docid": "0fa07dcd687be4eb15c1b908004cf731", "score": "0.5294266", "text": "function consolidateRules(rules) {\n var newRules = [], lastRule;\n rules.forEach(function (rule) {\n if (rule.selectorGroup) {\n rule.name = rule.selectorGroup;\n }\n // Push the entry unless it refers to the same rule as the previous entry.\n if (!(lastRule &&\n rule.document === lastRule.document &&\n rule.lineStart === lastRule.lineStart &&\n rule.lineEnd === lastRule.lineEnd &&\n rule.selectorGroup === lastRule.selectorGroup)) {\n newRules.push(rule);\n }\n lastRule = rule;\n });\n return newRules;\n }", "title": "" }, { "docid": "601b57fa2d7244275828247bc53c1c07", "score": "0.52294135", "text": "function normalizeRules(rules) {\n // if falsy value return an empty object.\n var acc = {};\n Object.defineProperty(acc, '_$$isNormalized', {\n value: true,\n writable: false,\n enumerable: false,\n configurable: false\n });\n if (!rules) {\n return acc;\n }\n // Object is already normalized, skip.\n if (isObject(rules) && rules._$$isNormalized) {\n return rules;\n }\n if (isObject(rules)) {\n return Object.keys(rules).reduce(function (prev, curr) {\n var params = [];\n if (rules[curr] === true) {\n params = [];\n }\n else if (Array.isArray(rules[curr])) {\n params = rules[curr];\n }\n else if (isObject(rules[curr])) {\n params = rules[curr];\n }\n else {\n params = [rules[curr]];\n }\n if (rules[curr] !== false) {\n prev[curr] = buildParams(curr, params);\n }\n return prev;\n }, acc);\n }\n /* istanbul ignore if */\n if (typeof rules !== 'string') {\n warn('rules must be either a string or an object.');\n return acc;\n }\n return rules.split('|').reduce(function (prev, rule) {\n var parsedRule = parseRule(rule);\n if (!parsedRule.name) {\n return prev;\n }\n prev[parsedRule.name] = buildParams(parsedRule.name, parsedRule.params);\n return prev;\n }, acc);\n}", "title": "" }, { "docid": "01fc0b95e5fec5886eab914acd24fbe2", "score": "0.522598", "text": "function findRule(domain) {\n var punyDomain = punycode.toASCII(domain);\n return rules.reduce(function (memo, rule) {\n var punySuffix = punycode.toASCII(rule.suffix);\n if (!endsWith(punyDomain, '.' + punySuffix) && punyDomain !== punySuffix) {\n return memo;\n }\n // This has been commented out as it never seems to run. This is because\n // sub tlds always appear after their parents and we never find a shorter\n // match.\n //if (memo) {\n // var memoSuffix = punycode.toASCII(memo.suffix);\n // if (memoSuffix.length >= punySuffix.length) {\n // return memo;\n // }\n //}\n return rule;\n }, null);\n}", "title": "" }, { "docid": "71e2dbeeebe8c45388bcc547fe3f054b", "score": "0.52195394", "text": "validateRule(rule) {\n if (rule.id === 'null' || rule.id === null) {\n return;\n }\n if (this.executedRules.find(rl => rl.id == rule.id)) {\n return;\n }\n\n const body = rule.body;\n let ruleFunc = eval(`(${body})`);\n\n if (!ruleFunc || typeof ruleFunc !== 'function') {\n return;\n }\n\n const isSuccess = ruleFunc(this.state.data);\n let nextRule;\n if (isSuccess) {\n nextRule = this.state.rules.find(rl => rl.id == rule.true_id);\n } else {\n nextRule = this.state.rules.find(rl => rl.id == rule.false_id)\n }\n\n //let copyRule = Object.assign({}, rule);\n let copyRule = {...rule, isFailed: !isSuccess};\n //copyRule.isFailed = !isSuccess;\n this.executedRules.push(copyRule);\n\n if(!nextRule || nextRule.id === rule.id ){\n return;\n }\n this.validateRule(nextRule);\n\n }", "title": "" }, { "docid": "2df616fbf9cd26969da0d4ace4d45fe4", "score": "0.5211222", "text": "function rules(a, b, c) {\n if (a == 1 && b == 1 && c == 1) return ruleset[0];\n if (a == 1 && b == 1 && c === 0) return ruleset[1];\n if (a == 1 && b === 0 && c == 1) return ruleset[2];\n if (a == 1 && b === 0 && c === 0) return ruleset[3];\n if (a === 0 && b == 1 && c == 1) return ruleset[4];\n if (a === 0 && b == 1 && c === 0) return ruleset[5];\n if (a === 0 && b === 0 && c == 1) return ruleset[6];\n if (a === 0 && b === 0 && c === 0) return ruleset[7];\n return 0;\n}", "title": "" }, { "docid": "2c32ee44b39a9016d9968c57b6e8c5f4", "score": "0.5197804", "text": "function ProcessRules() {\n\n var retstr = \"\";\n var x;\n var str;\n\n for (i = 0; i < globalrulesobject.rules.length; i++) {\n x = globalrulesobject.rules[i];\n str = ProcessRule(x, i);\n if (str != \"\") { // look for a recommendation to output, and also suppress duplicates\n retstr += str;\n RecTypeList += \" \" + curRecType;\n }\n }\n\n return retstr;\n }", "title": "" }, { "docid": "98c1fd16cb7f62d14d5a742c07fa1796", "score": "0.51934713", "text": "function _SeSGetAllRules(/**SeSMatcherRule*/ rule, /**array*/ result)\r\n{\r\n result.push(rule);\r\n for (var i in rule.or_rules)\r\n {\r\n _SeSGetAllRules(rule.or_rules[i], result);\r\n }\r\n for (var i in rule.and_rules)\r\n {\r\n _SeSGetAllRules(rule.and_rules[i], result);\r\n }\r\n}", "title": "" }, { "docid": "1ea76f071d2398f17c79c239e3284d48", "score": "0.51637614", "text": "function groundrules (library)\n {var facts = compfacts(library);\n var rules = seq();\n for (var i=0; i<library.length; i++)\n {rules = groundrule(library[i],facts,rules)};\n return vniquify(rules)}", "title": "" }, { "docid": "f2d4bf55a16b82bf1d4ec030f0ba7a59", "score": "0.5160812", "text": "add (rule, prefix) {\n let prefixed = prefix + rule.name\n\n let already = rule.parent.some(\n i => i.name === prefixed && i.params === rule.params\n )\n if (already) {\n return undefined\n }\n\n let cloned = this.clone(rule, { name: prefixed })\n return rule.parent.insertBefore(rule, cloned)\n }", "title": "" }, { "docid": "8913f957abab67deb7c5588a84ec610f", "score": "0.51516694", "text": "function findRules(lexer, state) {\n while (state && state.length > 0) {\n var rules = lexer.tokenizer[state];\n if (rules) {\n return rules;\n }\n var idx = state.lastIndexOf('.');\n if (idx < 0) {\n state = null; // no further parent\n }\n else {\n state = state.substr(0, idx);\n }\n }\n return null;\n }", "title": "" }, { "docid": "908c3e45f91d82c06c74a84b94d08e96", "score": "0.51319987", "text": "generateLexRulesByStartConditions() {\n const lexGrammar = this._grammar.getLexGrammar();\n const lexRulesByConditions = lexGrammar.getRulesByStartConditions();\n const result = {};\n\n for (const condition in lexRulesByConditions) {\n result[condition] = lexRulesByConditions[condition].map(lexRule =>\n lexGrammar.getRuleIndex(lexRule)\n );\n }\n\n this.writeData(\n 'LEX_RULES_BY_START_CONDITIONS',\n `${this._toJuliaDictionary(result, 'string')}`,\n );\n }", "title": "" }, { "docid": "02d7b19b172325ae7bfd7296eb2dca70", "score": "0.5129788", "text": "function createSubrules(conditionsTree, conclusionTree) {\n\n\tfunction simplifyTrees(rule) {\n\t\tsyntaxTree.simplifyOperators(rule.conditionsTree)\n\t\tsyntaxTree.simplifyOperators(rule.conclusionTree)\n\t}\n\tcreateSubrulesFromConclusionTree()\n\tcreateSubrulesFromConditionsTree()\n\n\tfunction createSubrulesFromConclusionTree() {\n\t\tif (conclusionTree.type == 'OPERATOR')\n\t\t\thandleOperators()\n\t\telse if (conclusionTree.type == 'NOT')\n\t\t\thandleNot()\n\n\t\tfunction handleOperators() {\n\t\t\tif (conclusionTree.value == '+')\n\t\t\t\thandleAnd()\n\t\t\telse if (conclusionTree.value == '|')\n\t\t\t\thandleOr()\n\t\t\telse if (conclusionTree.value == '^')\n\t\t\t\thandleXor()\n\n\t\t\tfunction handleAnd() {\n\t\t\t\tconclusionTree.children.forEach(child => {\n\t\t\t\t\tlet rule = new Rule({\n\t\t\t\t\t\tconditionsTree: syntaxTree.duplicateNode(conditionsTree),\n\t\t\t\t\t\tconclusionTree: syntaxTree.duplicateNode(child)\n\t\t\t\t\t})\n\t\t\t\t\tsimplifyTrees(rule)\n\t\t\t\t\trules.push(rule)\n\t\t\t\t\tcreateSubrules(rule.conditionsTree, rule.conclusionTree)\n\t\t\t\t})\n\t\t\t}\n\t\t\tfunction handleOr() {\n\t\t\t\tconclusionTree.children.forEach(child => {\n\t\t\t\t\tlet rule = new Rule({\n\t\t\t\t\t\tconditionsTree: syntaxTree.duplicateNode(conditionsTree),\n\t\t\t\t\t\tconclusionTree: syntaxTree.duplicateNode(child)\n\t\t\t\t\t})\n\n\t\t\t\t\tlet node = new Node({value: '+', type: 'OPERATOR'})\n\t\t\t\t\tnode.children = [syntaxTree.duplicateNode(conditionsTree)]\n\t\t\t\t\tconclusionTree.children.forEach(subchild => {\n\t\t\t\t\t\tif (subchild != child) {\n\t\t\t\t\t\t\tsubchild.parent = node\n\t\t\t\t\t\t\tnode.children.push(syntaxTree.negateNode(subchild))\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\trule.conditionsTree = node\n\t\t\t\t\tsimplifyTrees(rule)\n\t\t\t\t\trules.push(rule)\n\t\t\t\t\tcreateSubrules(rule.conditionsTree, rule.conclusionTree)\n\t\t\t\t})\n\n\t\t\t\t// handle A|A in conclusion\n\t\t\t\tlet children = conclusionTree.children\n\t\t\t\tchildren.forEach(child => child.key = syntaxTree.createKeyFromNode(child))\n\t\t\t\tif (children.every(child => child.key == children[0].key)) {\n\t\t\t\t\tlet rule = new Rule({\n\t\t\t\t\t\tconditionsTree: syntaxTree.duplicateNode(conditionsTree),\n\t\t\t\t\t\tconclusionTree: syntaxTree.duplicateNode(children[0])\n\t\t\t\t\t})\n\t\t\t\t\tsimplifyTrees(rule)\n\t\t\t\t\trules.push(rule)\n\t\t\t\t\tcreateSubrules(rule.conditionsTree, rule.conclusionTree)\n\t\t\t\t}\n\t\t\t}\n\t\t\tfunction handleXor() {\n\t\t\t\tconclusionTree.children.forEach(child => {\n\t\t\t\t\tlet rule1 = new Rule({\n\t\t\t\t\t\tconditionsTree: syntaxTree.duplicateNode(conditionsTree),\n\t\t\t\t\t\tconclusionTree: syntaxTree.negateNode(child)\n\t\t\t\t\t})\n\t\t\t\t\tlet node1 = new Node({value: '+', type: 'OPERATOR'})\n\t\t\t\t\tnode1.children = [rule1.conditionsTree, conclusionTree.children.find(el => el != child)]\n\t\t\t\t\tnode1.children.forEach(el => el.parent = node1)\n\t\t\t\t\trule1.conditionsTree = node1\n\n\t\t\t\t\tlet rule2 = new Rule({\n\t\t\t\t\t\tconditionsTree: syntaxTree.duplicateNode(conditionsTree),\n\t\t\t\t\t\tconclusionTree: syntaxTree.duplicateNode(child)\n\t\t\t\t\t})\n\t\t\t\t\tlet node2 = new Node({value: '+', type: 'OPERATOR'})\n\t\t\t\t\tnode2.children = [rule2.conditionsTree, syntaxTree.negateNode(conclusionTree.children.find(el => el != child))]\n\t\t\t\t\tnode2.children.forEach(el => el.parent = node2)\n\t\t\t\t\trule2.conditionsTree = node2\n\n\t\t\t\t\tsimplifyTrees(rule1)\n\t\t\t\t\tsimplifyTrees(rule2)\n\t\t\t\t\trules.push(rule1)\n\t\t\t\t\trules.push(rule2)\n\t\t\t\t\tcreateSubrules(rule1.conditionsTree, rule1.conclusionTree)\n\t\t\t\t\tcreateSubrules(rule2.conditionsTree, rule2.conclusionTree)\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\n\t\tfunction handleNot() {\n\t\t\tlet node = syntaxTree.duplicateNode(conclusionTree.children[0])\n\n\t\t\tif (node.value == '+')\n\t\t\t\thandleAnd()\n\t\t\telse if (node.value == '|')\n\t\t\t\thandleOr()\n\t\t\telse if (node.value == '^')\n\t\t\t\thandleXor()\n\n\t\t\tfunction handleAnd() {\n\t\t\t\tnode.children.forEach(child => {\n\t\t\t\t\tlet rule = new Rule({\n\t\t\t\t\t\tconditionsTree: syntaxTree.duplicateNode(conditionsTree),\n\t\t\t\t\t\tconclusionTree: syntaxTree.negateNode(child)\n\t\t\t\t\t})\n\t\t\t\t\tlet node1 = new Node({value: '+', type: 'OPERATOR'})\n\t\t\t\t\tnode1.children = [rule.conditionsTree, ...node.children.filter(el => el != child)]\n\t\t\t\t\tnode1.children.forEach(el => el.parent = node1)\n\t\t\t\t\trule.conditionsTree = node1\n\t\t\t\t\tsimplifyTrees(rule)\n\t\t\t\t\trules.push(rule)\n\t\t\t\t\tcreateSubrules(rule.conditionsTree, rule.conclusionTree)\n\t\t\t\t})\n\t\t\t}\n\t\t\tfunction handleOr() {\n\t\t\t\tnode.children.forEach(child => {\n\t\t\t\t\tlet rule = new Rule({\n\t\t\t\t\t\tconditionsTree: syntaxTree.duplicateNode(conditionsTree),\n\t\t\t\t\t\tconclusionTree: syntaxTree.duplicateNode(child)\n\t\t\t\t\t})\n\t\t\t\t\trule.conclusionTree = syntaxTree.negateNode(rule.conclusionTree)\n\t\t\t\t\trules.push(rule)\n\t\t\t\t\tcreateSubrules(rule.conditionsTree, rule.conclusionTree)\n\t\t\t\t})\n\t\t\t}\n\t\t\tfunction handleXor() {\n\t\t\t\tnode.children.forEach(child => {\n\t\t\t\t\tlet rule1 = new Rule({\n\t\t\t\t\t\tconditionsTree: syntaxTree.duplicateNode(conditionsTree),\n\t\t\t\t\t\tconclusionTree: syntaxTree.duplicateNode(child)\n\t\t\t\t\t})\n\t\t\t\t\tlet node1 = new Node({value: '+', type: 'OPERATOR'})\n\t\t\t\t\tnode1.children = [rule1.conditionsTree, node.children.find(el => el != child)]\n\t\t\t\t\tnode1.children.forEach(el => el.parent = node1)\n\t\t\t\t\trule1.conditionsTree = node1\n\n\t\t\t\t\tlet rule2 = new Rule({\n\t\t\t\t\t\tconditionsTree: syntaxTree.duplicateNode(conditionsTree),\n\t\t\t\t\t\tconclusionTree: syntaxTree.negateNode(child)\n\t\t\t\t\t})\n\t\t\t\t\tlet node2 = new Node({value: '+', type: 'OPERATOR'})\n\t\t\t\t\tnode2.children = [rule2.conditionsTree, syntaxTree.negateNode(node.children.find(el => el != child))]\n\t\t\t\t\tnode2.children.forEach(el => el.parent = node2)\n\t\t\t\t\trule2.conditionsTree = node2\n\n\t\t\t\t\tsimplifyTrees(rule1)\n\t\t\t\t\tsimplifyTrees(rule2)\n\t\t\t\t\trules.push(rule1)\n\t\t\t\t\trules.push(rule2)\n\t\t\t\t\tcreateSubrules(rule1.conditionsTree, rule1.conclusionTree)\n\t\t\t\t\tcreateSubrules(rule2.conditionsTree, rule2.conclusionTree)\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction createSubrulesFromConditionsTree() {\n\t\tif (conditionsTree.type == 'OPERATOR')\n\t\t\thandleOperators()\n\t\telse if (conditionsTree.type == 'NOT')\n\t\t\thandleNot()\n\n\t\tfunction handleOperators() {\n\t\t\tif (conditionsTree.value == '+')\n\t\t\t\thandleAnd()\n\t\t\telse if (conditionsTree.value == '|')\n\t\t\t\thandleOr()\n\t\t\telse if (conditionsTree.value == '^')\n\t\t\t\thandleXor()\n\n\t\t\tfunction handleAnd() {}\n\t\t\tfunction handleOr() {\n\t\t\t\tlet nodes = createNodeTreeCombinations(conditionsTree, 1)\n\n\t\t\t\tnodes.forEach(node => {\n\t\t\t\t\tlet rule = new Rule({\n\t\t\t\t\t\tconditionsTree: node,\n\t\t\t\t\t\tconclusionTree: syntaxTree.duplicateNode(conclusionTree)\n\t\t\t\t\t})\n\t\t\t\t\tsimplifyTrees(rule)\n\t\t\t\t\trules.push(rule)\n\t\t\t\t\tcreateSubrules(rule.conditionsTree, rule.conclusionTree)\n\t\t\t\t})\n\t\t\t}\n\t\t\tfunction handleXor() {}\n\t\t}\n\n\t\tfunction handleNot() {\n\t\t\tlet node = syntaxTree.duplicateNode(conditionsTree.children[0])\n\n\t\t\tif (node.value == '+')\n\t\t\t\thandleAnd()\n\t\t\telse if (node.value == '|')\n\t\t\t\thandleOr()\n\t\t\telse if (node.value == '^')\n\t\t\t\thandleXor()\n\n\t\t\tfunction handleAnd() {\n\t\t\t\tlet nodes = createNodeTreeCombinations(node, 1)\n\t\t\t\tnodes.forEach(node => {\n\t\t\t\t\tlet rule = new Rule({\n\t\t\t\t\t\tconditionsTree: syntaxTree.negateNode(node),\n\t\t\t\t\t\tconclusionTree: syntaxTree.duplicateNode(conclusionTree)\n\t\t\t\t\t})\n\t\t\t\t\tsimplifyTrees(rule)\n\t\t\t\t\trules.push(rule)\n\t\t\t\t\tcreateSubrules(rule.conditionsTree, rule.conclusionTree)\n\t\t\t\t})\n\t\t\t}\n\t\t\tfunction handleOr() {}\n\t\t\tfunction handleXor() {}\n\t\t}\n\n\t\tfunction createNodeTreeCombinations(tree, min) {\n\t\t\tlet indexLists = createIndexCombinations(tree.children.length, min)\n\t\t\treturn indexLists.map(indexList => {\n\t\t\t\tif (indexList.length == 1) return tree.children[indexList[0]]\n\t\t\t\tlet node = new Node({type: 'OPERATOR', value: '|'})\n\t\t\t\tlet children = indexList.map(i => {\n\t\t\t\t\tlet child = syntaxTree.duplicateNode(tree.children[i])\n\t\t\t\t\tchild.parent = node\n\t\t\t\t\treturn child\n\t\t\t\t})\n\t\t\t\tnode.children = children\n\t\t\t\treturn node\n\t\t\t})\n\t\t}\n\n\t\t/*\n\t\t * return a table of tables of indices to find all combinations for case A | B | C => D\n\t\t */\n\t\tfunction createIndexCombinations(total, min) {\n\t\t\tmin = min || 2\n\t\t\tlet combinations = []\n\t\t\tfor (let size = min; size < total; size++) {\n\t\t\t\tlet list = []\n\t\t\t\tfor (let i = 0; i < size; i++) {\n\t\t\t\t\tlist.push(i)\n\t\t\t\t}\n\t\t\t\tcombinations.push(list.slice())\n\t\t\t\twhile (increment(list, list.length - 1)) {\n\t\t\t\t\tcombinations.push(list.slice())\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn combinations\n\n\t\t\tfunction increment(list, index) {\n\t\t\t\tlet updated = false\n\t\t\t\tif (list[index] < total - 1) {\n\t\t\t\t\tlist[index]++\n\t\t\t\t\tfor (let i = 1; index + i < list.length; i++) {\n\t\t\t\t\t\tlist[index + i] = list[index] + i\n\t\t\t\t\t\tif (list[index + i] >= total) {\n\t\t\t\t\t\t\tif (index > 0) {\n\t\t\t\t\t\t\t\treturn increment(list, index - 1)\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\treturn false\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn true\n\t\t\t\t} else if (index - 1 >= 0) {\n\t\t\t\t\treturn increment(list, index - 1)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "8d1549d0c86bad57d1ba5c2f53fb4be5", "score": "0.5124926", "text": "function normalizeRules(rules) {\n // if falsy value return an empty object.\n var acc = {};\n Object.defineProperty(acc, '_$$isNormalized', {\n value: true,\n writable: false,\n enumerable: false,\n configurable: false\n });\n if (!rules) {\n return acc;\n }\n // Object is already normalized, skip.\n if (isObject(rules) && rules._$$isNormalized) {\n return rules;\n }\n if (isObject(rules)) {\n return Object.keys(rules).reduce(function (prev, curr) {\n var params = [];\n var preserveArrayParams = false;\n if (rules[curr] === true) {\n params = [];\n }\n else if (Array.isArray(rules[curr])) {\n params = rules[curr];\n preserveArrayParams = true;\n }\n else if (isObject(rules[curr])) {\n params = rules[curr];\n }\n else {\n params = [rules[curr]];\n }\n if (rules[curr] !== false) {\n prev[curr] = buildParams(curr, params, preserveArrayParams);\n }\n return prev;\n }, acc);\n }\n /* istanbul ignore if */\n if (typeof rules !== 'string') {\n warn('rules must be either a string or an object.');\n return acc;\n }\n return rules.split('|').reduce(function (prev, rule) {\n var parsedRule = parseRule(rule);\n if (!parsedRule.name) {\n return prev;\n }\n prev[parsedRule.name] = buildParams(parsedRule.name, parsedRule.params);\n return prev;\n }, acc);\n}", "title": "" }, { "docid": "31b41478220d98d61d5900732ca55b24", "score": "0.5122077", "text": "function stripRules(token, re) {\n if (token.children) {\n let localRules = token.children.filter(x => x.type && re.test(x.type));\n for (let i = 0; i < localRules.length; i++) {\n let indexOnChildren = token.children.indexOf(localRules[i]);\n if (indexOnChildren != -1) {\n token.children.splice(indexOnChildren, 1);\n }\n }\n token.children.forEach(c => stripRules(c, re));\n }\n}", "title": "" }, { "docid": "05e5113d43ec264091d4b6eebfed5433", "score": "0.50780123", "text": "_buildRules() {\n this._rules = [\n {\n type: 'integer',\n defaultValue: 0,\n testSchema: element => element.match(/^[a-zA-Z-_]+:integer$/),\n take: it => {\n let value = Number.parseInt(it.next().value);\n if (Number.isNaN(value) || typeof value === 'undefined' || value == null) {\n throw new Error('wrong integer format');\n }\n return value;\n }\n },\n {\n type: 'string',\n defaultValue: '',\n testSchema: element => element.match(/^[a-zA-Z0-9_]+:string$/),\n take: it => {\n let value = it.next().value;\n if (typeof value === 'undefined' || value === null || value.trim().length === 0) {\n throw new Error('wrong string format');\n }\n return value;\n }\n },\n {\n type: 'boolean',\n defaultValue: false,\n testSchema: element => element.match(/^[a-zA-Z0-9_]+:boolean$/),\n take: it => true\n },\n {\n type: 'array',\n defaultValue: [],\n testSchema: element => element.match(/^[a-zA-Z0-9_]+:array$/),\n take: it => {\n let value = it.next().value;\n if (typeof value === 'undefined' || value === null || value.trim().length === 0) {\n throw new Error('wrong array format');\n }\n\n return value.split(',');\n }\n }\n ];\n }", "title": "" }, { "docid": "b572444c22c7e03325805f481e1c33be", "score": "0.50760406", "text": "function computed(group) {\n\t\t /*console.log('The process about how this computed function works...???');\n\t\t console.log('why computed function only is triggered when Add Condition, Add Group, Remove Group and Remove Rule has been called? Because, at beginning, group is undefined, thus, the inside if condition is triggered, then jump over this function.');\n\t\t console.log('when Add Condition or Add Group btns trigger their function. the group obj would be found.');\n\t\t console.log('Then, it is not undefined group obj, it is valided group obj. the if condition inside this computed function would be ignored.');\n\t\t console.log('Then, this computed function will generate and form the group data object.');*/\n\t\t if (!group) return \"\";\n\n\t\t for (var str = \"(\", i = 0; i < group.rules.length; i++) {\n\t\t i > 0 && (str += \" <strong>\" + group.operator + \"</strong> \");\n\t\t str += group.rules[i].group ?\n\t\t computed(group.rules[i].group) :\n\t\t group.rules[i].field + \" \" + htmlEntities(group.rules[i].condition) + \" \" + group.rules[i].data;\n\n\t\t // group.operator is AND or OR.\n\t\t // console.log('group.operator -- '+tq, group.operator);\n\t\t // group.rules[i].group is a undefined value, don't care...\n\t\t // console.log('group.rules[i].group -- '+tq, group.rules[i].group);\n\t\t // group.rules[i].field --> first field(input) content... link 'FirstName'.\n\t\t // console.log('group.rules[i].field --> '+tq, group.rules[i].field);\n\t\t // group.rules[i].condition is =, <>, <, <=, >, >= ...\n\t\t // console.log('group.rules[i].condition --> '+tq, group.rules[i].condition);\n\t\t // 'group.rules[i].data --> the last field (input). It is one letter one time...\n\t\t // console.log('group.rules[i].data --> '+tq, group.rules[i].data);\n\t\t // console.log('typ of group.rules[i].data is --> '+typeof(group.rules[i].data));\n\t\t // htmlEntities(group.rules[i].condition) only do one thing... if the condition has < or > , \n\t\t // those < or > would be replaced by &lt; &gt; -- then computer could understand.\n\t\t // console.log('html htmlEntities -> '+tq+\" : \", htmlEntities(group.rules[i].condition));\n\t\t }\n\n\t\t return str + \")\";\n\t\t }", "title": "" }, { "docid": "80ab68bfdfef71a68987806720d6baa8", "score": "0.50722605", "text": "rulesMatchesKeyword(rule) {\n if (this.state.selectedKeywords.length > 0) {\n if (rule.match) {\n var tags = [rule.match.hasPredicate.slice(4)];\n if (rule.match.hasObject) {\n tags.push(rule.match.hasObject.slice(4));\n }\n\n return tags\n .map(tag => {\n if (this.state.selectedKeywords.includes(tag)) {\n return true;\n }\n return false;\n })\n .includes(true);\n }\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "021dec18d6c04af9ffa49236beb0c426", "score": "0.5046268", "text": "[common_1.nodeType.rulelist](rulelist) {\n let rules = '{';\n for (let i = 0; i < rulelist.rules.length; ++i) {\n rules += this.visit(rulelist.rules[i]);\n }\n return rules + '}';\n }", "title": "" }, { "docid": "f5fb84e8f7a70b1e45f3308a3724c566", "score": "0.50457275", "text": "static parseRule(r) {\n if (typeof r === 'undefined' || r === null || r.match(REGEX_BLANK_OR_COMMENT)) return null;\n let m = r.match(REGEX_ALLOW_HTTP_URL);\n if (m) return new HttpRule('allow_http_url');\n m = r.match(REGEX_COPY_SESSION_FIELD);\n if (m) return new HttpRule('copy_session_field', null, this.parseRegex(r, m[1]));\n m = r.match(REGEX_REMOVE);\n if (m) return new HttpRule('remove', this.parseRegex(r, m[1]));\n m = r.match(REGEX_REMOVE_IF);\n if (m) return new HttpRule('remove_if', this.parseRegex(r, m[1]), this.parseRegex(r, m[2]));\n m = r.match(REGEX_REMOVE_IF_FOUND);\n if (m) return new HttpRule('remove_if_found', this.parseRegex(r, m[1]), this.parseRegexFind(r, m[2]));\n m = r.match(REGEX_REMOVE_UNLESS);\n if (m) return new HttpRule('remove_unless', this.parseRegex(r, m[1]), this.parseRegex(r, m[2]));\n m = r.match(REGEX_REMOVE_UNLESS_FOUND);\n if (m) return new HttpRule('remove_unless_found', this.parseRegex(r, m[1]), this.parseRegexFind(r, m[2]));\n m = r.match(REGEX_REPLACE);\n if (m) return new HttpRule('replace', this.parseRegex(r, m[1]), this.parseRegexFind(r, m[2]), this.parseString(r, m[3]));\n m = r.match(REGEX_SAMPLE);\n if (m) {\n const m1 = parseInt(m[1]);\n if (m1 < 1 || m1 > 99) throw new EvalError(`Invalid sample percent: ${m1}`);\n return new HttpRule('sample', null, m1);\n }\n m = r.match(REGEX_SKIP_COMPRESSION);\n if (m) return new HttpRule('skip_compression');\n m = r.match(REGEX_SKIP_SUBMISSION);\n if (m) return new HttpRule('skip_submission');\n m = r.match(REGEX_STOP);\n if (m) return new HttpRule('stop', this.parseRegex(r, m[1]));\n m = r.match(REGEX_STOP_IF);\n if (m) return new HttpRule('stop_if', this.parseRegex(r, m[1]), this.parseRegex(r, m[2]));\n m = r.match(REGEX_STOP_IF_FOUND);\n if (m) return new HttpRule('stop_if_found', this.parseRegex(r, m[1]), this.parseRegexFind(r, m[2]));\n m = r.match(REGEX_STOP_UNLESS);\n if (m) return new HttpRule('stop_unless', this.parseRegex(r, m[1]), this.parseRegex(r, m[2]));\n m = r.match(REGEX_STOP_UNLESS_FOUND);\n if (m) return new HttpRule('stop_unless_found', this.parseRegex(r, m[1]), this.parseRegexFind(r, m[2]));\n throw new EvalError(`Invalid rule: ${r}`);\n }", "title": "" }, { "docid": "ff987ee399cec9923f7b36d556df87d0", "score": "0.50417614", "text": "function findRules(lexer, state) {\n while (state && state.length > 0) {\n var rules = lexer.tokenizer[state];\n if (rules) {\n return rules;\n }\n var idx = state.lastIndexOf('.');\n if (idx < 0) {\n state = null; // no further parent\n }\n else {\n state = state.substr(0, idx);\n }\n }\n return null;\n}", "title": "" }, { "docid": "ff987ee399cec9923f7b36d556df87d0", "score": "0.50417614", "text": "function findRules(lexer, state) {\n while (state && state.length > 0) {\n var rules = lexer.tokenizer[state];\n if (rules) {\n return rules;\n }\n var idx = state.lastIndexOf('.');\n if (idx < 0) {\n state = null; // no further parent\n }\n else {\n state = state.substr(0, idx);\n }\n }\n return null;\n}", "title": "" }, { "docid": "19a514f7437f6d4cb3d5d0ac22229c9d", "score": "0.5028326", "text": "function addRules(state, newrules, rules) {\n var idx;\n for (idx in rules) {\n if (rules.hasOwnProperty(idx)) {\n var rule = rules[idx];\n var include = rule.include;\n if (include) {\n if (typeof (include) !== 'string') {\n __WEBPACK_IMPORTED_MODULE_1__monarchCommon_js__[\"k\" /* throwError */](lexer, 'an \\'include\\' attribute must be a string at: ' + state);\n }\n if (include[0] === '@') {\n include = include.substr(1); // peel off starting @\n }\n if (!json.tokenizer[include]) {\n __WEBPACK_IMPORTED_MODULE_1__monarchCommon_js__[\"k\" /* throwError */](lexer, 'include target \\'' + include + '\\' is not defined at: ' + state);\n }\n addRules(state + '.' + include, newrules, json.tokenizer[include]);\n }\n else {\n var newrule = new Rule(state);\n // Set up new rule attributes\n if (Array.isArray(rule) && rule.length >= 1 && rule.length <= 3) {\n newrule.setRegex(lexerMin, rule[0]);\n if (rule.length >= 3) {\n if (typeof (rule[1]) === 'string') {\n newrule.setAction(lexerMin, { token: rule[1], next: rule[2] });\n }\n else if (typeof (rule[1]) === 'object') {\n var rule1 = rule[1];\n rule1.next = rule[2];\n newrule.setAction(lexerMin, rule1);\n }\n else {\n __WEBPACK_IMPORTED_MODULE_1__monarchCommon_js__[\"k\" /* throwError */](lexer, 'a next state as the last element of a rule can only be given if the action is either an object or a string, at: ' + state);\n }\n }\n else {\n newrule.setAction(lexerMin, rule[1]);\n }\n }\n else {\n if (!rule.regex) {\n __WEBPACK_IMPORTED_MODULE_1__monarchCommon_js__[\"k\" /* throwError */](lexer, 'a rule must either be an array, or an object with a \\'regex\\' or \\'include\\' field at: ' + state);\n }\n if (rule.name) {\n newrule.name = string(rule.name);\n }\n if (rule.matchOnlyAtStart) {\n newrule.matchOnlyAtLineStart = bool(rule.matchOnlyAtLineStart);\n }\n newrule.setRegex(lexerMin, rule.regex);\n newrule.setAction(lexerMin, rule.action);\n }\n newrules.push(newrule);\n }\n }\n }\n }", "title": "" }, { "docid": "d40540154969cdc365b4a12709d39825", "score": "0.50067604", "text": "checkRuleForLeftRecursion (rule, cannotStartWith, stack) {\n this.parsers[rule].getParsers().forEach((parser) => { // all rules start with an or parser, that has at least one parser inside\n const leftmost = this.leftmostFor(parser)\n if (leftmost instanceof Token) return // terminal, we're done\n\n stack.push(rule)\n if (leftmost.rule === cannotStartWith) throw new Error(`Left recursion found: ${stack.join(' -> ')} -> ${cannotStartWith}`)\n if (stack.includes(leftmost.rule)) return // already checked\n this.checkRuleForLeftRecursion(leftmost.rule, cannotStartWith, stack)\n })\n }", "title": "" }, { "docid": "62a9eac3302857073ddf478abd64e987", "score": "0.5004712", "text": "genrule(target) {\n\tif (target in this.rules.normal) return true\n\n\tlet candidates = []\n\tfor (let rule of this.rules.implicit) {\n\t let stem = Maker.stem(rule.target, target)\n\t if (!stem) continue\n\n\t let candidate = new Rule(rule.location, target)\n\t candidate.stem = stem\n\t candidate.rank = 0\n\t let deps = []\n\t for (let dep of rule.deps) {\n\t\tlet prereq\n\t\tif (rule.target.indexOf('/') === -1) {\n\t\t let st = Maker.split(stem)\n\t\t let d = dep.replace('%', st.name)\n\t\t prereq = st.dir === '.' ? d : [st.dir, d].join('/')\n\t\t} else\n\t\t prereq = dep.replace('%', stem)\n\n\t\tif (!fs.existsSync(prereq)) candidate.rank -= 1\n\t\tif (!(this.genrule(prereq) || fs.existsSync(prereq))) {\n\t\t candidate.invalid = true\n\t\t break\n\t\t}\n\t\tdeps.push(prereq)\n\t }\n\t if (candidate.invalid) continue\n\n\t candidate.deps = deps\n\t candidate.recipes = rule.recipes\n\t candidates.push(candidate)\n\t}\n\n\tlet nominee = Maker.nominee(candidates)\n\tif (!nominee) return false\n\tthis.rules.normal[nominee.target] = nominee\n\tthis.rules.generated.push(nominee) // for stats\n\treturn true\n }", "title": "" }, { "docid": "c671e1690e833933094bf8dde6d2cfec", "score": "0.50016254", "text": "visitSomeRule(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "e28df56e70b2de643169e6611abba648", "score": "0.50002193", "text": "prefixedBy(prefix) {\n\t\tlet node = this.root;\n\t\tlet result = [];\n\n\t\tfor (let i = 0; i < prefix.length; i++) {\n\t\t\tif (node.children.get(prefix[i])) {\n\t\t\t\tnode = node.children;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "0ae4359a7aae755ee532c48fc7fb0fb4", "score": "0.4977911", "text": "function addRules(state, newrules, rules) {\n for (var idx in rules) {\n if (rules.hasOwnProperty(idx)) {\n var rule = rules[idx];\n var include = rule.include;\n if (include) {\n if (typeof (include) !== 'string') {\n _monarchCommon_js__WEBPACK_IMPORTED_MODULE_1__[\"throwError\"](lexer, 'an \\'include\\' attribute must be a string at: ' + state);\n }\n if (include[0] === '@') {\n include = include.substr(1); // peel off starting @\n }\n if (!json.tokenizer[include]) {\n _monarchCommon_js__WEBPACK_IMPORTED_MODULE_1__[\"throwError\"](lexer, 'include target \\'' + include + '\\' is not defined at: ' + state);\n }\n addRules(state + '.' + include, newrules, json.tokenizer[include]);\n }\n else {\n var newrule = new Rule(state);\n // Set up new rule attributes\n if (Array.isArray(rule) && rule.length >= 1 && rule.length <= 3) {\n newrule.setRegex(lexerMin, rule[0]);\n if (rule.length >= 3) {\n if (typeof (rule[1]) === 'string') {\n newrule.setAction(lexerMin, { token: rule[1], next: rule[2] });\n }\n else if (typeof (rule[1]) === 'object') {\n var rule1 = rule[1];\n rule1.next = rule[2];\n newrule.setAction(lexerMin, rule1);\n }\n else {\n _monarchCommon_js__WEBPACK_IMPORTED_MODULE_1__[\"throwError\"](lexer, 'a next state as the last element of a rule can only be given if the action is either an object or a string, at: ' + state);\n }\n }\n else {\n newrule.setAction(lexerMin, rule[1]);\n }\n }\n else {\n if (!rule.regex) {\n _monarchCommon_js__WEBPACK_IMPORTED_MODULE_1__[\"throwError\"](lexer, 'a rule must either be an array, or an object with a \\'regex\\' or \\'include\\' field at: ' + state);\n }\n if (rule.name) {\n newrule.name = string(rule.name);\n }\n if (rule.matchOnlyAtStart) {\n newrule.matchOnlyAtLineStart = bool(rule.matchOnlyAtLineStart);\n }\n newrule.setRegex(lexerMin, rule.regex);\n newrule.setAction(lexerMin, rule.action);\n }\n newrules.push(newrule);\n }\n }\n }\n }", "title": "" }, { "docid": "f79262be1b911b9e0ab9b02c6c5216b3", "score": "0.4961252", "text": "function makePredicate(words) {\n words = words.split(\" \");\n var f = \"\", cats = [];\n out: for (var i = 0; i < words.length; ++i) {\n for (var j = 0; j < cats.length; ++j)\n if (cats[j][0].length == words[i].length) {\n cats[j].push(words[i]);\n continue out;\n }\n cats.push([words[i]]);\n }\n function compareTo(arr) {\n if (arr.length == 1) return f += \"return str === \" + JSON.stringify(arr[0]) + \";\";\n f += \"switch(str){\";\n for (var i = 0; i < arr.length; ++i) f += \"case \" + JSON.stringify(arr[i]) + \":\";\n f += \"return true}return false;\";\n }\n\n // When there are more than three length categories, an outer\n // switch first dispatches on the lengths, to save on comparisons.\n\n if (cats.length > 3) {\n cats.sort(function(a, b) {return b.length - a.length;});\n f += \"switch(str.length){\";\n for (var i = 0; i < cats.length; ++i) {\n var cat = cats[i];\n f += \"case \" + cat[0].length + \":\";\n compareTo(cat);\n }\n f += \"}\";\n\n // Otherwise, simply generate a flat `switch` statement.\n\n } else {\n compareTo(words);\n }\n return new Function(\"str\", f);\n }", "title": "" }, { "docid": "f79262be1b911b9e0ab9b02c6c5216b3", "score": "0.4961252", "text": "function makePredicate(words) {\n words = words.split(\" \");\n var f = \"\", cats = [];\n out: for (var i = 0; i < words.length; ++i) {\n for (var j = 0; j < cats.length; ++j)\n if (cats[j][0].length == words[i].length) {\n cats[j].push(words[i]);\n continue out;\n }\n cats.push([words[i]]);\n }\n function compareTo(arr) {\n if (arr.length == 1) return f += \"return str === \" + JSON.stringify(arr[0]) + \";\";\n f += \"switch(str){\";\n for (var i = 0; i < arr.length; ++i) f += \"case \" + JSON.stringify(arr[i]) + \":\";\n f += \"return true}return false;\";\n }\n\n // When there are more than three length categories, an outer\n // switch first dispatches on the lengths, to save on comparisons.\n\n if (cats.length > 3) {\n cats.sort(function(a, b) {return b.length - a.length;});\n f += \"switch(str.length){\";\n for (var i = 0; i < cats.length; ++i) {\n var cat = cats[i];\n f += \"case \" + cat[0].length + \":\";\n compareTo(cat);\n }\n f += \"}\";\n\n // Otherwise, simply generate a flat `switch` statement.\n\n } else {\n compareTo(words);\n }\n return new Function(\"str\", f);\n }", "title": "" }, { "docid": "f79262be1b911b9e0ab9b02c6c5216b3", "score": "0.4961252", "text": "function makePredicate(words) {\n words = words.split(\" \");\n var f = \"\", cats = [];\n out: for (var i = 0; i < words.length; ++i) {\n for (var j = 0; j < cats.length; ++j)\n if (cats[j][0].length == words[i].length) {\n cats[j].push(words[i]);\n continue out;\n }\n cats.push([words[i]]);\n }\n function compareTo(arr) {\n if (arr.length == 1) return f += \"return str === \" + JSON.stringify(arr[0]) + \";\";\n f += \"switch(str){\";\n for (var i = 0; i < arr.length; ++i) f += \"case \" + JSON.stringify(arr[i]) + \":\";\n f += \"return true}return false;\";\n }\n\n // When there are more than three length categories, an outer\n // switch first dispatches on the lengths, to save on comparisons.\n\n if (cats.length > 3) {\n cats.sort(function(a, b) {return b.length - a.length;});\n f += \"switch(str.length){\";\n for (var i = 0; i < cats.length; ++i) {\n var cat = cats[i];\n f += \"case \" + cat[0].length + \":\";\n compareTo(cat);\n }\n f += \"}\";\n\n // Otherwise, simply generate a flat `switch` statement.\n\n } else {\n compareTo(words);\n }\n return new Function(\"str\", f);\n }", "title": "" }, { "docid": "8ab02859ef8f8ed3984bdf9f62a29d0b", "score": "0.4958267", "text": "function _regex_simplify_27(tree, fsmCache) {\n if (tree.tag === tags.SEQ && tree.elements.length > 1) {\n for (var i=0; i<tree.elements.length; i++) {\n if (tree.elements[i].tag === tags.KSTAR) {\n if (i > 0 && tree.elements[i-1].tag === tags.ALT && tree.elements[i-1].choices.length > 1) {\n var index_eps = noam.util.index(tree.elements[i-1].choices, makeEps());\n\n if (index_eps >= 0) {\n var eps = tree.elements[i-1].choices.splice(index_eps, 1)[0];\n\n var fsm_kstar = getFromCacheOrCreateFsm(tree.elements[i], fsmCache);\n var fsm_other = getFromCacheOrCreateFsm(tree.elements[i-1], fsmCache);\n\n var found = false;\n\n try {\n if (noam.fsm.isSubset(fsm_kstar, fsm_other)) {\n found = true;\n }\n } catch (e) {\n }\n\n if (found) {\n tree.elements.splice(i-1, 1);\n return true;\n } else {\n tree.elements[i-1].choices.splice(index_eps, 0, eps);\n }\n }\n } else if (i < tree.elements.length-1 && tree.elements[i+1].tag === tags.ALT && tree.elements[i+1].choices.length > 1) {\n var index_eps = noam.util.index(tree.elements[i+1].choices, makeEps());\n\n if (index_eps >= 0) {\n var eps = tree.elements[i+1].choices.splice(index_eps, 1)[0];\n\n var fsm_kstar = getFromCacheOrCreateFsm(tree.elements[i], fsmCache);\n var fsm_other = getFromCacheOrCreateFsm(tree.elements[i+1], fsmCache);\n\n var found = false;\n\n try {\n if (noam.fsm.isSubset(fsm_kstar, fsm_other)) {\n found = true;\n }\n } catch (e) {\n }\n\n if (found) {\n tree.elements.splice(i+1, 1);\n return true;\n } else {\n tree.elements[i+1].choices.splice(index_eps, 0, eps);\n }\n }\n }\n }\n }\n }\n }", "title": "" }, { "docid": "c075261c87d1f73e9b9a42516055a88c", "score": "0.4949024", "text": "visitModel_rules_part(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "8e28194fe8e919de921aec0100996278", "score": "0.4948781", "text": "buildJsepRules(strRules) {\n if (!strRules) {\n return null;\n }\n try {\n return jsep(strRules);\n } catch (e) {\n logger$2.error(`jsep couldn't parse with error ${e}`);\n }\n return null;\n }", "title": "" }, { "docid": "22247df8e0bf4c9217cafb213b9bcbd9", "score": "0.49461344", "text": "constructor() {\n super([], LexerTokens, {\n outputCst: true\n });\n\n const $ = this;\n\n $.RULE('prog', () => {\n $.MANY(() => {\n $.OR([\n { ALT: () => $.SUBRULE($.entityDeclaration) },\n { ALT: () => $.SUBRULE($.relationDeclaration) },\n { ALT: () => $.SUBRULE($.enumDeclaration) },\n { ALT: () => $.SUBRULE($.dtoDeclaration) },\n { ALT: () => $.SUBRULE($.paginationDeclaration) },\n { ALT: () => $.SUBRULE($.serviceDeclaration) },\n { ALT: () => $.CONSUME(LexerTokens.COMMENT) },\n { ALT: () => $.SUBRULE($.microserviceDeclaration) },\n { ALT: () => $.SUBRULE($.searchEngineDeclaration) },\n { ALT: () => $.SUBRULE($.noClientDeclaration) },\n { ALT: () => $.SUBRULE($.noServerDeclaration) },\n { ALT: () => $.SUBRULE($.angularSuffixDeclaration) },\n { ALT: () => $.SUBRULE($.noFluentMethod) },\n { ALT: () => $.SUBRULE($.filterDeclaration) },\n { ALT: () => $.SUBRULE($.clientRootFolderDeclaration) },\n { ALT: () => $.SUBRULE($.applicationDeclaration) },\n // a constantDeclaration starts with a NAME, but any keyword is also a NAME\n // So to avoid conflicts with most of the above alternatives (which start with keywords)\n // this alternative must be last.\n {\n // - A Constant starts with a NAME\n // - NAME tokens are very common\n // That is why a more precise lookahead condition is used (The GATE)\n // To avoid confusing errors (\"expecting EQUALS but found ...\")\n GATE: () => $.LA(2).tokenType === LexerTokens.EQUALS,\n ALT: () => $.SUBRULE($.constantDeclaration)\n }\n ]);\n });\n });\n\n $.RULE('constantDeclaration', () => {\n $.CONSUME(LexerTokens.NAME);\n $.CONSUME(LexerTokens.EQUALS);\n $.CONSUME(LexerTokens.INTEGER);\n });\n\n $.RULE('entityDeclaration', () => {\n $.OPTION(() => {\n $.CONSUME(LexerTokens.COMMENT);\n });\n\n $.CONSUME(LexerTokens.ENTITY);\n $.CONSUME(LexerTokens.NAME);\n\n $.OPTION1(() => {\n $.SUBRULE($.entityTableNameDeclaration);\n });\n\n $.OPTION2(() => {\n $.SUBRULE($.entityBody);\n });\n });\n\n $.RULE('entityTableNameDeclaration', () => {\n $.CONSUME(LexerTokens.LPAREN);\n $.CONSUME(LexerTokens.NAME);\n $.CONSUME(LexerTokens.RPAREN);\n });\n\n $.RULE('entityBody', () => {\n $.CONSUME(LexerTokens.LCURLY);\n $.MANY(() => {\n $.SUBRULE($.fieldDeclaration);\n $.OPTION(() => {\n $.CONSUME(LexerTokens.COMMA);\n });\n });\n $.CONSUME(LexerTokens.RCURLY);\n });\n\n $.RULE('fieldDeclaration', () => {\n $.OPTION(() => {\n $.CONSUME(LexerTokens.COMMENT);\n });\n\n $.CONSUME(LexerTokens.NAME);\n $.SUBRULE($.type);\n $.MANY(() => {\n $.SUBRULE($.validation);\n });\n\n $.OPTION2({\n GATE: () => {\n const prevTok = $.LA(0);\n const nextTok = $.LA(1);\n // simulate \"SPACE_WITHOUT_NEWLINE\" of the PEG parser\n return prevTok.startLine === nextTok.startLine;\n },\n DEF: () => {\n $.CONSUME2(LexerTokens.COMMENT);\n }\n });\n });\n\n $.RULE('type', () => {\n $.CONSUME(LexerTokens.NAME);\n });\n\n $.RULE('validation', () => {\n $.OR([\n { ALT: () => $.CONSUME(LexerTokens.REQUIRED) },\n { ALT: () => $.SUBRULE($.minMaxValidation) },\n { ALT: () => $.SUBRULE($.pattern) }\n ]);\n });\n\n $.RULE('minMaxValidation', () => {\n // Note that \"MIN_MAX_KEYWORD\" is an abstract token and could match 6 different concrete token types\n $.CONSUME(LexerTokens.MIN_MAX_KEYWORD);\n $.CONSUME(LexerTokens.LPAREN);\n $.OR([\n { ALT: () => $.CONSUME(LexerTokens.INTEGER) },\n { ALT: () => $.CONSUME(LexerTokens.NAME) }\n ]);\n $.CONSUME(LexerTokens.RPAREN);\n });\n\n $.RULE('pattern', () => {\n $.CONSUME(LexerTokens.PATTERN);\n $.CONSUME(LexerTokens.LPAREN);\n $.CONSUME(LexerTokens.REGEX);\n $.CONSUME(LexerTokens.RPAREN);\n });\n\n $.RULE('relationDeclaration', () => {\n $.CONSUME(LexerTokens.RELATIONSHIP);\n $.SUBRULE($.relationshipType);\n $.CONSUME(LexerTokens.LCURLY);\n $.AT_LEAST_ONE(() => {\n $.SUBRULE($.relationshipBody);\n $.OPTION(() => {\n $.CONSUME(LexerTokens.COMMA);\n });\n });\n $.CONSUME(LexerTokens.RCURLY);\n });\n\n $.RULE('relationshipType', () => {\n $.OR([\n { ALT: () => $.CONSUME(LexerTokens.ONE_TO_ONE) },\n { ALT: () => $.CONSUME(LexerTokens.ONE_TO_MANY) },\n { ALT: () => $.CONSUME(LexerTokens.MANY_TO_ONE) },\n { ALT: () => $.CONSUME(LexerTokens.MANY_TO_MANY) }\n ]);\n });\n\n $.RULE('relationshipBody', () => {\n $.SUBRULE($.relationshipSide, { LABEL: 'from' });\n $.CONSUME(LexerTokens.TO);\n $.SUBRULE2($.relationshipSide, { LABEL: 'to' });\n });\n\n $.RULE('relationshipSide', () => {\n $.SUBRULE($.comment);\n $.CONSUME(LexerTokens.NAME);\n $.OPTION(() => {\n $.CONSUME(LexerTokens.LCURLY);\n $.CONSUME2(LexerTokens.NAME, { LABEL: 'InjectedField' });\n\n // TODO (REVIEW-NEEDED): the pegjs grammar allowed parenthesis in 'INJECTED_FIELD_NAME'\n // We are using grammar rules instead of lexer rules for a similar effect.\n // The main difference is that only a single pair of parenthesis are allowed.\n // document this quirk in: https://github.com/jhipster/jhipster-core/issues/184\n $.OPTION1(() => {\n $.CONSUME(LexerTokens.LPAREN);\n $.CONSUME3(LexerTokens.NAME, { LABEL: 'InjectedFieldParam' });\n $.CONSUME(LexerTokens.RPAREN);\n });\n\n $.OPTION2(() => {\n $.CONSUME(LexerTokens.REQUIRED);\n });\n $.CONSUME(LexerTokens.RCURLY);\n });\n });\n\n $.RULE('enumDeclaration', () => {\n $.CONSUME(LexerTokens.ENUM);\n $.CONSUME(LexerTokens.NAME);\n $.CONSUME(LexerTokens.LCURLY);\n $.SUBRULE($.enumPropList);\n $.CONSUME(LexerTokens.RCURLY);\n });\n\n $.RULE('enumPropList', () => {\n $.CONSUME(LexerTokens.NAME);\n $.MANY(() => {\n $.CONSUME(LexerTokens.COMMA);\n $.CONSUME2(LexerTokens.NAME);\n });\n });\n\n $.RULE('dtoDeclaration', () => {\n $.CONSUME(LexerTokens.DTO);\n $.SUBRULE($.entityList);\n $.OPTION(() => {\n $.SUBRULE($.exclusion);\n });\n });\n\n $.RULE('entityList', () => {\n $.MANY({\n // the next section may contain [NAME, WITH], LA(2) check is used to resolve this.\n GATE: () => this.LA(2).tokenType === LexerTokens.COMMA,\n DEF: () => {\n $.CONSUME(LexerTokens.NAME);\n $.CONSUME(LexerTokens.COMMA);\n }\n });\n $.OR([\n { ALT: () => $.CONSUME(LexerTokens.ALL) },\n { ALT: () => $.CONSUME(LexerTokens.STAR) },\n // NAME appears after 'ALL' token as an 'ALL' token is also a valid 'NAME' token.\n { ALT: () => $.CONSUME1(LexerTokens.NAME) }\n ]);\n $.CONSUME(LexerTokens.WITH);\n $.CONSUME2(LexerTokens.NAME, { LABEL: 'Method' });\n });\n\n // combined \"exclusionSub\" and \"exclusion\".\n $.RULE('exclusion', () => {\n $.CONSUME(LexerTokens.EXCEPT);\n $.CONSUME(LexerTokens.NAME);\n $.MANY(() => {\n $.CONSUME(LexerTokens.COMMA);\n $.CONSUME2(LexerTokens.NAME);\n });\n });\n\n $.RULE('paginationDeclaration', () => {\n $.CONSUME(LexerTokens.PAGINATE);\n $.SUBRULE($.entityList);\n $.OPTION(() => {\n $.SUBRULE($.exclusion);\n });\n });\n\n $.RULE('serviceDeclaration', () => {\n $.CONSUME(LexerTokens.SERVICE);\n $.SUBRULE($.entityList);\n $.OPTION(() => {\n $.SUBRULE($.exclusion);\n });\n });\n\n $.RULE('microserviceDeclaration', () => {\n $.CONSUME(LexerTokens.MICROSERVICE);\n $.SUBRULE($.entityList);\n $.OPTION(() => {\n $.SUBRULE($.exclusion);\n });\n });\n\n $.RULE('searchEngineDeclaration', () => {\n $.CONSUME(LexerTokens.SEARCH);\n $.SUBRULE($.entityList);\n $.OPTION(() => {\n $.SUBRULE($.exclusion);\n });\n });\n\n $.RULE('noClientDeclaration', () => {\n $.CONSUME(LexerTokens.SKIP_CLIENT);\n $.SUBRULE($.filterDef);\n $.OPTION(() => {\n $.SUBRULE($.exclusion);\n });\n });\n\n $.RULE('noServerDeclaration', () => {\n $.CONSUME(LexerTokens.SKIP_SERVER);\n $.SUBRULE($.filterDef);\n $.OPTION(() => {\n $.SUBRULE($.exclusion);\n });\n });\n\n $.RULE('noFluentMethod', () => {\n $.CONSUME(LexerTokens.NO_FLUENT_METHOD);\n $.SUBRULE($.filterDef);\n $.OPTION(() => {\n $.SUBRULE($.exclusion);\n });\n });\n\n $.RULE('filterDeclaration', () => {\n $.CONSUME(LexerTokens.FILTER);\n $.SUBRULE($.filterDef);\n $.OPTION(() => {\n $.SUBRULE($.exclusion);\n });\n });\n\n $.RULE('clientRootFolderDeclaration', () => {\n $.CONSUME(LexerTokens.CLIENT_ROOT_FOLDER);\n $.SUBRULE($.entityList);\n $.OPTION(() => {\n $.SUBRULE($.exclusion);\n });\n });\n\n // merged \"subNoServerDeclaration\", \"subNoFluentMethod\", \"subFilterDeclaration\",\n // \"simpleEntityList\" and \"subNoClientDeclaration\"\n // as they are identical\n $.RULE('filterDef', () => {\n $.MANY({\n // the next section may contain [NAME, NOT_A_COMMA], LA(2) check is used to resolve this.\n GATE: () => this.LA(2).tokenType === LexerTokens.COMMA,\n DEF: () => {\n $.CONSUME(LexerTokens.NAME);\n $.CONSUME(LexerTokens.COMMA);\n }\n });\n $.OR([\n { ALT: () => $.CONSUME(LexerTokens.ALL) },\n { ALT: () => $.CONSUME(LexerTokens.STAR) },\n // NAME appears after 'ALL' token as an 'ALL' token is also a valid 'NAME' but is more specific.\n { ALT: () => $.CONSUME1(LexerTokens.NAME) }\n ]);\n });\n\n $.RULE('angularSuffixDeclaration', () => {\n $.CONSUME(LexerTokens.ANGULAR_SUFFIX);\n $.SUBRULE($.entityList);\n $.OPTION(() => {\n $.SUBRULE($.exclusion);\n });\n });\n\n $.RULE('comment', () => {\n $.OPTION(() => {\n $.CONSUME(LexerTokens.COMMENT);\n });\n });\n\n $.RULE('applicationDeclaration', () => {\n $.CONSUME(LexerTokens.APPLICATION);\n $.CONSUME(LexerTokens.LCURLY);\n $.SUBRULE($.applicationSubDeclaration);\n $.CONSUME(LexerTokens.RCURLY);\n });\n\n $.RULE('applicationSubDeclaration', () => {\n $.MANY(() => {\n $.OR([\n { ALT: () => $.SUBRULE($.applicationSubConfig) },\n { ALT: () => $.SUBRULE($.applicationSubEntities) }\n ]);\n });\n });\n\n $.RULE('applicationSubConfig', () => {\n $.CONSUME(LexerTokens.CONFIG);\n $.CONSUME(LexerTokens.LCURLY);\n $.MANY(() => {\n $.OR([\n { ALT: () => $.CONSUME(LexerTokens.COMMENT) },\n { ALT: () => $.SUBRULE($.applicationConfigDeclaration) }\n ]);\n });\n $.CONSUME(LexerTokens.RCURLY);\n });\n\n $.RULE('applicationSubEntities', () => {\n $.CONSUME(LexerTokens.ENTITIES);\n $.SUBRULE($.filterDef);\n $.OPTION(() => {\n $.SUBRULE($.exclusion);\n });\n });\n\n // The application config Rule was refactored\n // To reduce repetition and be more like pairs of keys and value\n // This means that we need to check if the value is valid for the key post parsing.\n // (e.g SKIP_CLIENT key id only used with a boolean value)\n\n // In general this can be refactored even farther and be made into proper\n // key:value pairs like JSON, so adding a new key will not require changing the syntax.\n $.RULE('applicationConfigDeclaration', () => {\n $.CONSUME(LexerTokens.CONFIG_KEY);\n $.SUBRULE($.configValue);\n $.OPTION(() => {\n $.CONSUME(LexerTokens.COMMA);\n });\n });\n\n $.RULE('configValue', () => {\n // note how these alternatives look more and more like a JSON Value Rule.\n // https://www.json.org/\n $.OR([\n { ALT: () => $.CONSUME(LexerTokens.BOOLEAN) },\n { ALT: () => $.SUBRULE($.qualifiedName) },\n { ALT: () => $.SUBRULE($.list) },\n { ALT: () => $.CONSUME(LexerTokens.INTEGER) },\n { ALT: () => $.CONSUME(LexerTokens.STRING) }\n ]);\n });\n\n $.RULE('qualifiedName', () => {\n $.AT_LEAST_ONE_SEP({\n SEP: LexerTokens.DOT,\n DEF: () => {\n $.CONSUME(LexerTokens.NAME);\n }\n });\n });\n\n $.RULE('list', () => {\n $.CONSUME(LexerTokens.LSQUARE);\n $.AT_LEAST_ONE_SEP({\n SEP: LexerTokens.COMMA,\n DEF: () => {\n $.CONSUME(LexerTokens.NAME);\n }\n });\n $.CONSUME(LexerTokens.RSQUARE);\n });\n\n // very important to call this after all the rules have been defined.\n // otherwise the parser may not work correctly as it will lack information\n // derived during the self analysis phase.\n Parser.performSelfAnalysis(this);\n }", "title": "" }, { "docid": "2711200e2754735a4df2bc23a163e7f5", "score": "0.4924759", "text": "function ruleparse(origstr) {\n // it seems to me i need this ugly while>for loop structure to allow for anything in the regex\n var parsetoobj = {};\n var workingarr = [];\n var workingval = 0;\n //origstr overused differentiate between the origstring and post regex str\n parsetoobj.origstring = origstr; // useful for diff tests on live edits to limit resource consumption\n //origstr=ruleclean(origstr); //wow, realised regex could do this easy and solve empty rule problem\n if (origstr.match(new RegExp('(-.*\")', 'gi')) === null) {\n return;\n } else {\n origstr = origstr.match(new RegExp('(-.*\")', 'gi')).join();\n }\n\n while (origstr.length > 0) {\n //(-[a-z]+[ ]\")\n //([\"\"'])(?:(?=(\\\\?))\\2.)*?\\1 \n var workingstringshrt = origstr.substring(0, 4);\n var workingstringfull = origstr.substring(0, 9);\n var secelstr;\n var secarrel = [];\n var bound = 0;\n for (var i = 0; i < dataobj.meta.parserule.options.length; i++) {\n if (dataobj.meta.parserule.options[i].shrt == workingstringshrt || dataobj.meta.parserule.options[i].full == workingstringfull) {\n if (dataobj.meta.parserule.options[i].shrt == workingstringshrt) {\n secarrel = origstr.split(dataobj.meta.parserule.options[i].shrt);\n workingarr[workingval] = i;\n workingval += 1;\n workingarr[workingval] = dataobj.meta.parserule.options[i].shrt;\n workingval += 1;\n }\n if (dataobj.meta.parserule.options[i].full[i] == workingstringfull) {\n secarrel = origstr.split(dataobj.meta.parserule.options[i].full);\n workingarr[workingval] = i;\n workingval += 1;\n workingarr[workingval] = dataobj.meta.parserule.options[i].full;\n workingval += 1;\n }\n secelstr = secarrel[1];\n while (secarrel.length > 1) {\n for (var ii = 0; ii < dataobj.meta.parserule.options.length; ii++) {\n secarrel = secelstr.split(dataobj.meta.parserule.options[ii].shrt);\n if (secarrel.length == 2) {\n secarrel.pop();\n secelstr = secarrel[0];\n }\n }\n for (var ii = 0; ii < dataobj.meta.parserule.options.length; ii++) {\n secarrel = secelstr.split(dataobj.meta.parserule.options[ii].full);\n if (secarrel.length == 2) {\n secarrel.pop();\n secelstr = secarrel[0];\n }\n }\n\n }\n secelstr = secarrel[0];\n\n workingarr[workingval] = secelstr;\n workingval = workingval + 1;\n //console.log(workingarr);\n //console.log(workingarr.length/3);\n subtractstring = workingarr[workingval - 2] + workingarr[workingval - 1];\n origstr = origstr.substring(subtractstring.length, origstr.length);\n bound = 0;\n } else {\n bound++;\n if (bound > dataobj.meta.parserule.options.length) {\n break; //really look into the necessity of this...\n }\n }\n } // end for\n } // end while ( origstr.length > 0 ) {\n parsetoobj.getopts = workingarr;\n return parsetoobj;\n}", "title": "" }, { "docid": "f6d0d135c5ecdcf46e9a8ebf48f4bcf9", "score": "0.49176025", "text": "function makePredicate(words) {\n words = words.split(\" \");\n var f = \"\",\n cats = [];\n out: for (var i = 0; i < words.length; ++i) {\n for (var j = 0; j < cats.length; ++j) {\n if (cats[j][0].length == words[i].length) {\n cats[j].push(words[i]);\n continue out;\n }\n }cats.push([words[i]]);\n }\n function compareTo(arr) {\n if (arr.length == 1) {\n return f += \"return str === \" + JSON.stringify(arr[0]) + \";\";\n }f += \"switch(str){\";\n for (var i = 0; i < arr.length; ++i) {\n f += \"case \" + JSON.stringify(arr[i]) + \":\";\n }f += \"return true}return false;\";\n }\n\n // When there are more than three length categories, an outer\n // switch first dispatches on the lengths, to save on comparisons.\n\n if (cats.length > 3) {\n cats.sort(function (a, b) {\n return b.length - a.length;\n });\n f += \"switch(str.length){\";\n for (var i = 0; i < cats.length; ++i) {\n var cat = cats[i];\n f += \"case \" + cat[0].length + \":\";\n compareTo(cat);\n }\n f += \"}\"\n\n // Otherwise, simply generate a flat `switch` statement.\n\n ;\n } else {\n compareTo(words);\n }\n return new Function(\"str\", f);\n}", "title": "" }, { "docid": "f6d0d135c5ecdcf46e9a8ebf48f4bcf9", "score": "0.49176025", "text": "function makePredicate(words) {\n words = words.split(\" \");\n var f = \"\",\n cats = [];\n out: for (var i = 0; i < words.length; ++i) {\n for (var j = 0; j < cats.length; ++j) {\n if (cats[j][0].length == words[i].length) {\n cats[j].push(words[i]);\n continue out;\n }\n }cats.push([words[i]]);\n }\n function compareTo(arr) {\n if (arr.length == 1) {\n return f += \"return str === \" + JSON.stringify(arr[0]) + \";\";\n }f += \"switch(str){\";\n for (var i = 0; i < arr.length; ++i) {\n f += \"case \" + JSON.stringify(arr[i]) + \":\";\n }f += \"return true}return false;\";\n }\n\n // When there are more than three length categories, an outer\n // switch first dispatches on the lengths, to save on comparisons.\n\n if (cats.length > 3) {\n cats.sort(function (a, b) {\n return b.length - a.length;\n });\n f += \"switch(str.length){\";\n for (var i = 0; i < cats.length; ++i) {\n var cat = cats[i];\n f += \"case \" + cat[0].length + \":\";\n compareTo(cat);\n }\n f += \"}\"\n\n // Otherwise, simply generate a flat `switch` statement.\n\n ;\n } else {\n compareTo(words);\n }\n return new Function(\"str\", f);\n}", "title": "" }, { "docid": "f6d0d135c5ecdcf46e9a8ebf48f4bcf9", "score": "0.49176025", "text": "function makePredicate(words) {\n words = words.split(\" \");\n var f = \"\",\n cats = [];\n out: for (var i = 0; i < words.length; ++i) {\n for (var j = 0; j < cats.length; ++j) {\n if (cats[j][0].length == words[i].length) {\n cats[j].push(words[i]);\n continue out;\n }\n }cats.push([words[i]]);\n }\n function compareTo(arr) {\n if (arr.length == 1) {\n return f += \"return str === \" + JSON.stringify(arr[0]) + \";\";\n }f += \"switch(str){\";\n for (var i = 0; i < arr.length; ++i) {\n f += \"case \" + JSON.stringify(arr[i]) + \":\";\n }f += \"return true}return false;\";\n }\n\n // When there are more than three length categories, an outer\n // switch first dispatches on the lengths, to save on comparisons.\n\n if (cats.length > 3) {\n cats.sort(function (a, b) {\n return b.length - a.length;\n });\n f += \"switch(str.length){\";\n for (var i = 0; i < cats.length; ++i) {\n var cat = cats[i];\n f += \"case \" + cat[0].length + \":\";\n compareTo(cat);\n }\n f += \"}\"\n\n // Otherwise, simply generate a flat `switch` statement.\n\n ;\n } else {\n compareTo(words);\n }\n return new Function(\"str\", f);\n}", "title": "" }, { "docid": "87df3541b8736bd26256386c0343aab0", "score": "0.49162027", "text": "function newRules3(ruleString) {\r\n let {born, survive} = parseRulesString(ruleString);\r\n let ruleFuncs = {};\r\n if (born.includes(0)) {\r\n let n, bornSwap, bornInvert, surviveSwap, surviveInvert;\r\n bornInvert = [1, 2, 3, 4, 5, 6, 7, 8].filter(x => !born.includes(x));\r\n surviveInvert = [1, 2, 3, 4, 5, 6, 7, 8].filter(x => !survive.includes(x));\r\n born = surviveInvert.map(x => (8 - x));\r\n // survive = bornInvert.map(x => (8 - x));\r\n if (survive.includes(8)) {\r\n survive = bornInvert.map(x => (8 - x));\r\n ruleFuncs[0] = function(cell) {\r\n let {alive, neighbours} = cell;\r\n return (\r\n (alive && survive.includes(neighbours)) ||\r\n (!alive && born.includes(neighbours))\r\n );\r\n };\r\n ruleFuncs[1] = null;\r\n }\r\n else {\r\n survive = bornInvert.map(x => (8 - x));\r\n ruleFuncs[0] = function(cell) {\r\n let {alive, neighbours} = cell;\r\n return (\r\n (alive && surviveInvert.includes(neighbours)) ||\r\n (!alive && bornInvert.includes(neighbours))\r\n );\r\n };\r\n ruleFuncs[1] = function(cell) {\r\n let {alive, neighbours} = cell;\r\n return (\r\n (alive && survive.includes(neighbours)) ||\r\n (!alive && born.includes(neighbours))\r\n );\r\n };\r\n }\r\n }\r\n else {\r\n ruleFuncs[0] = function(cell) {\r\n let {alive, neighbours} = cell;\r\n return (\r\n (alive && survive.includes(neighbours)) ||\r\n (!alive && born.includes(neighbours))\r\n );\r\n };\r\n ruleFuncs[1] = null;\r\n }\r\n return ruleFuncs;\r\n}", "title": "" }, { "docid": "60a3ac1abeb8bbaae18fa1c5db1c3e5b", "score": "0.49158636", "text": "function prepareRules(dict, actions, caseHelper, tokens, startConditions, opts) {\n var m,\n i,\n k,\n rule,\n action,\n conditions,\n active_conditions,\n rules = dict.rules || [],\n newRules = [],\n macros = {},\n regular_rule_count = 0,\n simple_rule_count = 0;\n\n // Assure all options are camelCased:\n assert(typeof opts.options['case-insensitive'] === 'undefined');\n\n if (!tokens) {\n tokens = {};\n }\n\n // Depending on the location within the regex we need different expansions of the macros:\n // one expansion for when a macro is *inside* a `[...]` and another expansion when a macro\n // is anywhere else in a regex:\n if (dict.macros) {\n macros = prepareMacros(dict.macros, opts);\n }\n\n function tokenNumberReplacement(str, token) {\n return 'return ' + (tokens[token] || '\\'' + token.replace(/'/g, '\\\\\\'') + '\\'');\n }\n\n // Make sure a comment does not contain any embedded '*/' end-of-comment marker\n // as that would break the generated code\n function postprocessComment(str) {\n if (Array.isArray(str)) {\n str = str.join(' ');\n }\n str = str.replace(/\\*\\//g, '*\\\\/'); // destroy any inner `*/` comment terminator sequence.\n return str;\n }\n\n actions.push('switch(yyrulenumber) {');\n\n for (i = 0; i < rules.length; i++) {\n rule = rules[i];\n m = rule[0];\n\n active_conditions = [];\n if (Object.prototype.toString.apply(m) !== '[object Array]') {\n // implicit add to all inclusive start conditions\n for (k in startConditions) {\n if (startConditions[k].inclusive) {\n active_conditions.push(k);\n startConditions[k].rules.push(i);\n }\n }\n } else if (m[0] === '*') {\n // Add to ALL start conditions\n active_conditions.push('*');\n for (k in startConditions) {\n startConditions[k].rules.push(i);\n }\n rule.shift();\n m = rule[0];\n } else {\n // Add to explicit start conditions\n conditions = rule.shift();\n m = rule[0];\n for (k = 0; k < conditions.length; k++) {\n if (!startConditions.hasOwnProperty(conditions[k])) {\n startConditions[conditions[k]] = {\n rules: [],\n inclusive: false\n };\n console.warn('Lexer Warning:', '\"' + conditions[k] + '\" start condition should be defined as %s or %x; assuming %x now.');\n }\n active_conditions.push(conditions[k]);\n startConditions[conditions[k]].rules.push(i);\n }\n }\n\n if (typeof m === 'string') {\n m = expandMacros(m, macros, opts);\n m = new XRegExp('^(?:' + m + ')', opts.options.caseInsensitive ? 'i' : '');\n }\n newRules.push(m);\n if (typeof rule[1] === 'function') {\n rule[1] = String(rule[1]).replace(/^\\s*function \\(\\)\\s?\\{/, '').replace(/\\}\\s*$/, '');\n }\n action = rule[1];\n action = action.replace(/return '((?:\\\\'|[^']+)+)'/g, tokenNumberReplacement);\n action = action.replace(/return \"((?:\\\\\"|[^\"]+)+)\"/g, tokenNumberReplacement);\n\n var code = ['\\n/*! Conditions::'];\n code.push(postprocessComment(active_conditions));\n code.push('*/', '\\n/*! Rule:: ');\n code.push(postprocessComment(rules[i][0]));\n code.push('*/', '\\n');\n\n // When the action is *only* a simple `return TOKEN` statement, then add it to the caseHelpers;\n // otherwise add the additional `break;` at the end.\n //\n // Note: we do NOT analyze the action block any more to see if the *last* line is a simple\n // `return NNN;` statement as there are too many shoddy idioms, e.g.\n //\n // ```\n // %{ if (cond)\n // return TOKEN;\n // %}\n // ```\n //\n // which would then cause havoc when our action code analysis (using regexes or otherwise) was 'too simple'\n // to catch these culprits; hence we resort and stick with the most fundamental approach here:\n // always append `break;` even when it would be obvious to a human that such would be 'unreachable code'.\n var match_nr = /^return[\\s\\r\\n]+((?:'(?:\\\\'|[^']+)+')|(?:\"(?:\\\\\"|[^\"]+)+\")|\\d+)[\\s\\r\\n]*;?$/.exec(action.trim());\n if (match_nr) {\n simple_rule_count++;\n caseHelper.push([].concat(code, i, ':', match_nr[1]).join(' ').replace(/[\\n]/g, '\\n '));\n } else {\n regular_rule_count++;\n actions.push([].concat('case', i, ':', code, action, '\\nbreak;').join(' '));\n }\n }\n actions.push('default:');\n actions.push(' return this.simpleCaseActionClusters[yyrulenumber];');\n actions.push('}');\n\n return {\n rules: newRules,\n macros: macros,\n\n regular_rule_count: regular_rule_count,\n simple_rule_count: simple_rule_count\n };\n }", "title": "" }, { "docid": "a14a37a14f9f76aef121e3a44fbc593b", "score": "0.491363", "text": "function v6_leaf_dfas(opts,rules){var p\n for(p in rules){\n //log('v6_leaf_dfas rule: '+p)\n go(rules[p].expr)}\n return rules\n function go(expr){var dfa\n if(dfa=v6_leaf_dfa(opts,expr))expr.dfa=dfa\n expr.subexprs.map(go)}}", "title": "" }, { "docid": "a2107edbddf80680d16c90252eca72d2", "score": "0.49107614", "text": "function newRules2(ruleString) {\r\n let {born, survive} = parseRulesString(ruleString);\r\n let n;\r\n let ruleFuncs = {};\r\n if (born.includes(0)) {\r\n bNums = '12345678';\r\n sNums = '12345678';\r\n for (n of born) {\r\n bnums = bNums.replace(n.toString(), '');\r\n }\r\n for (n of survive) {\r\n snums = sNums.replace(n.toString(), '');\r\n }\r\n born = [];\r\n for (n of sNums) {\r\n born.push((8 - parseInt(n)));\r\n }\r\n survive = [];\r\n for (n of bNums) {\r\n survive.push((8 - parseInt(n)));\r\n }\r\n if (survive.includes(8)) {\r\n bNums = '12345678';\r\n sNums = '12345678';\r\n for (n of born) {\r\n bnums = bNums.replace(n.toString(), '');\r\n }\r\n for (n of survive) {\r\n snums = sNums.replace(n.toString(), '');\r\n }\r\n born = [];\r\n for (n of sNums) {\r\n born.push((8 - parseInt(n)));\r\n }\r\n survive = [];\r\n for (n of bNums) {\r\n survive.push((8 - parseInt(n)));\r\n }\r\n ruleFuncs[0] = function(cell) {\r\n let {alive, neighbours} = cell;\r\n return (\r\n (alive && survive.includes(neighbours)) ||\r\n (!alive && born.includes(neighbours))\r\n );\r\n }\r\n ruleFuncs[1] = null;\r\n }\r\n else {\r\n return;\r\n }\r\n }\r\n else {\r\n ruleFuncs[0] = function(cell) {\r\n let {alive, neighbours} = cell;\r\n return (\r\n (alive && survive.includes(neighbours)) ||\r\n (!alive && born.includes(neighbours))\r\n );\r\n }\r\n ruleFuncs[1] = null;\r\n }\r\n return ruleFuncs;\r\n}", "title": "" }, { "docid": "6dbb85b381c180cef72b0c244f1570dc", "score": "0.49012747", "text": "visitModel_rules_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "1a98dc4a221badd2451800d39f234fa8", "score": "0.48964766", "text": "function makePredicate(words) {\n if (!(words instanceof Array)) words = words.split(\" \");\n var f = \"\", cats = [];\n out: for (var i = 0; i < words.length; ++i) {\n for (var j = 0; j < cats.length; ++j)\n if (cats[j][0].length == words[i].length) {\n cats[j].push(words[i]);\n continue out;\n }\n cats.push([words[i]]);\n }\n function compareTo(arr) {\n if (arr.length == 1) return f += \"return str === \" + JSON.stringify(arr[0]) + \";\";\n f += \"switch(str){\";\n for (var i = 0; i < arr.length; ++i) f += \"case \" + JSON.stringify(arr[i]) + \":\";\n f += \"return true}return false;\";\n }\n // When there are more than three length categories, an outer\n // switch first dispatches on the lengths, to save on comparisons.\n if (cats.length > 3) {\n cats.sort(function(a, b) {return b.length - a.length;});\n f += \"switch(str.length){\";\n for (var i = 0; i < cats.length; ++i) {\n var cat = cats[i];\n f += \"case \" + cat[0].length + \":\";\n compareTo(cat);\n }\n f += \"}\";\n // Otherwise, simply generate a flat `switch` statement.\n } else {\n compareTo(words);\n }\n return new Function(\"str\", f);\n}", "title": "" }, { "docid": "de44de520163e55cad8afeebb0575e71", "score": "0.48885718", "text": "function eliminateDirectRules(grammar) {\n let out = '<p class=\"intro\">We want to eliminate all direct rules of the form ' + formatProduction(new Production('A', ['B'])) + ' where ' + formatNonterminal('A') + ', ' + formatNonterminal('B') + ' are nonterminals. '\n + 'This is done by constructing a reachability graph for each nonterminal symbol. We then start with an empty rule set and add a new rule for every leaf that is reachable from a nonterminal on this graph.</p>';\n\n let newProds = new Array();\n\n for (nonterminal of grammar.nonterminals) {\n let reachableStrings = new Array(); // @out\n let reachableProds = new Array(); // @out\n\n // implement DFS\n let seen = new Set();\n let toVisit = new Set();\n toVisit.add(nonterminal);\n\n while (toVisit.size > 0) {\n let left = toVisit.values().next().value;\n toVisit.delete(left);\n seen.add(left);\n for (prod of grammar.getProductionsFor(left)) {\n if (prod.right.length === 1 && grammar.isNonterminal(prod.right[0])) {\n let right = prod.right[0];\n if (!seen.has(right)) {\n toVisit.add(right);\n }\n } else {\n let newProd = new Production(nonterminal, prod.right);\n newProds.push(newProd);\n\n reachableStrings.push(prod.right); // @out\n reachableProds.push(newProd); // @out\n }\n }\n }\n\n if (reachableStrings.length === 0) {\n out += '<p>For the nonterminal ' + formatSymbol(nonterminal, true) + ', there are no reachable nodes. Therefore we add no new rules.</p>';\n } else {\n out += '<p>For the nonterminal ' + formatSymbol(nonterminal, true) + ', we can reach the ' + pluralize('leave', reachableStrings.length) + ' ';\n out += formatArray(reachableStrings, str => formatSymbolArray(str, grammar), ', ', ' and ');\n out += '; therefore we add the ' + pluralize('rule', reachableProds.length) + ' ';\n out += formatProductionArray(reachableProds);\n out += ' to our grammar.</p>';\n }\n }\n\n return new Grammar(newProds, grammar.nonterminals.clone(), grammar.terminals.clone(), grammar.start, grammar.longNonterminals, grammar.longTerminals, out);\n}", "title": "" }, { "docid": "5d77c23621083bf8f45749b5aa5324ed", "score": "0.48729023", "text": "function addRules(state, newrules, rules) {\n var idx;\n for (idx in rules) {\n if (rules.hasOwnProperty(idx)) {\n var rule = rules[idx];\n var include = rule.include;\n if (include) {\n if (typeof (include) !== 'string') {\n monarchCommon.throwError(lexer, 'an \\'include\\' attribute must be a string at: ' + state);\n }\n if (include[0] === '@') {\n include = include.substr(1); // peel off starting @\n }\n if (!json.tokenizer[include]) {\n monarchCommon.throwError(lexer, 'include target \\'' + include + '\\' is not defined at: ' + state);\n }\n addRules(state + '.' + include, newrules, json.tokenizer[include]);\n }\n else {\n var newrule = new Rule(state);\n // Set up new rule attributes\n if (Array.isArray(rule) && rule.length >= 1 && rule.length <= 3) {\n newrule.setRegex(lexerMin, rule[0]);\n if (rule.length >= 3) {\n if (typeof (rule[1]) === 'string') {\n newrule.setAction(lexerMin, { token: rule[1], next: rule[2] });\n }\n else if (typeof (rule[1]) === 'object') {\n var rule1 = rule[1];\n rule1.next = rule[2];\n newrule.setAction(lexerMin, rule1);\n }\n else {\n monarchCommon.throwError(lexer, 'a next state as the last element of a rule can only be given if the action is either an object or a string, at: ' + state);\n }\n }\n else {\n newrule.setAction(lexerMin, rule[1]);\n }\n }\n else {\n if (!rule.regex) {\n monarchCommon.throwError(lexer, 'a rule must either be an array, or an object with a \\'regex\\' or \\'include\\' field at: ' + state);\n }\n if (rule.name) {\n newrule.name = string(rule.name);\n }\n if (rule.matchOnlyAtStart) {\n newrule.matchOnlyAtLineStart = bool(rule.matchOnlyAtLineStart);\n }\n newrule.setRegex(lexerMin, rule.regex);\n newrule.setAction(lexerMin, rule.action);\n }\n newrules.push(newrule);\n }\n }\n }\n }", "title": "" }, { "docid": "16aaa690bfc1a9c4004226efcc7ff9cc", "score": "0.4854794", "text": "function formatRules(arr) {\n\t\tvar obj = {};\n\t\tvar rulenum = -1;\n\t\tvar tn = '';\n\t\tfor(var i = 0; i < arr.length; i++) {\n\t\t\tif(arr[i][\"name\"] == \"table_name\") {\n\t\t\t\ttn = arr[i][\"value\"];\n\t\t\t\tobj[tn] = {};\n\t\t\t\trulenum = -1;\n\t\t\t}else if(arr[i][\"name\"] == \"column_name\") {\n\t\t\t\trulenum += 1;\n\t\t\t\tobj[tn][''+rulenum] = {};\n\t\t\t\tobj[tn][''+rulenum]['column_name'] = arr[i][\"value\"];\n\t\t\t}else if(arr[i][\"name\"] == \"can_be_empty\") {\n\t\t\t\tobj[tn][''+rulenum]['can_be_empty'] = arr[i][\"value\"];\n\t\t\t}else if(arr[i][\"name\"] == \"cr_min\") {\n\t\t\t\tobj[tn][''+rulenum]['cr_min'] = arr[i][\"value\"];\n\t\t\t}else if(arr[i][\"name\"] == \"cr_max\") {\n\t\t\t\tobj[tn][''+rulenum]['cr_max'] = arr[i][\"value\"];\n\t\t\t}else if(arr[i][\"name\"] == \"intelligent\") {\n\t\t\t\tobj[tn][''+rulenum]['intelligent'] = arr[i][\"value\"];\n\t\t\t}else if(arr[i][\"name\"] == \"filling_rule\") {\n\t\t\t\tobj[tn][''+rulenum]['filling_rule'] = arr[i][\"value\"];\n\t\t\t}else if(arr[i][\"name\"] == \"cr_regex\") {\n\t\t\t\tobj[tn][''+rulenum]['cr_regex'] = arr[i][\"value\"];\n\t\t\t}else if(arr[i][\"name\"] == \"cr_early\") {\n\t\t\t\tobj[tn][''+rulenum]['cr_early'] = arr[i][\"value\"];\n\t\t\t}else if(arr[i][\"name\"] == \"cr_late\") {\n\t\t\t\tobj[tn][''+rulenum]['cr_late'] = arr[i][\"value\"];\n\t\t\t}else if(arr[i][\"name\"] == \"need_to_check\") {\n\t\t\t\tobj[tn][''+rulenum]['need_to_check'] = arr[i][\"value\"];\n\t\t\t}else if(arr[i][\"name\"] == \"data_type\") {\n\t\t\t\tobj[tn][''+rulenum]['data_type'] = arr[i][\"value\"];\n\t\t\t}\n\t\t}\n\t\treturn obj;\n\t}", "title": "" }, { "docid": "49b1700dfaae457d71c1c882940f761a", "score": "0.48503911", "text": "function generateRegex(rule) {\n // initialize the string\n let str = \"\";\n // if the rule is actually multiple possible rules\n if(rule.indexOf(\"|\") != -1) {\n // split by |\n let subs = rule.split(\" | \");\n // and add a capture group of both rules seperated by an \"or\" operator\n str += `(${generateRegex(subs[0])}|${generateRegex(subs[1])})`;\n // if the rule is not a string literal (doesnt starts with \")\n } else if (!rule.startsWith(\"\\\"\")) {\n // split by space to take all multiple rules\n let subs = rule.split(\" \");\n // loop rules and add them to the string\n for(let sub of subs) str += generateRegex(rules[sub]);\n // and else (it is a string literal)\n } else {\n // take the char from quotes and just add it to the string\n str += rule.substring(1,2);\n }\n // return the string\n return str;\n}", "title": "" }, { "docid": "6b4c2e270598692c6813f87dca5039d2", "score": "0.48378256", "text": "function build_qos_rules() {\n var n;\n var str_new_rule=\"\", result=\"\";\n\n for (n=0; n<apply_qos.length; n++) {\n str_new_rule = parts_arrayToString(apply_qos[n]);\n /* Follow time order to save mac list to nv */\n result = addRule(result, str_new_rule);\n }\n return result;\n}", "title": "" }, { "docid": "c258d9beb8d50e24a83f7711a3596859", "score": "0.48322952", "text": "process (node, result) {\n if (!this.check(node)) {\n return undefined\n }\n\n let parent = this.parentPrefix(node)\n\n let prefixes = this.prefixes.filter(\n prefix => !parent || parent === utils.removeNote(prefix)\n )\n\n let added = []\n for (let prefix of prefixes) {\n if (this.add(node, prefix, added.concat([prefix]), result)) {\n added.push(prefix)\n }\n }\n\n return added\n }", "title": "" }, { "docid": "502cbf077a38af89db34bb87b557151a", "score": "0.48294708", "text": "function buildPrefixLabelParts(schema, record) {\n if (isRegion(record.layer) &&\n isGeonamesOrWhosOnFirst(record.source) &&\n isInUSAOrCAN(record)) {\n return [];\n }\n\n if (isCountry(record.layer) && !_.isEmpty(record.country)) {\n return [];\n }\n\n // support name aliases\n if (Array.isArray(record.name.default)) {\n return record.name.default.slice(0,1);\n }\n\n return [record.name.default];\n\n}", "title": "" }, { "docid": "d3383c667869544deb9737427206f676", "score": "0.48207015", "text": "visitRulePart(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "e3b9dc8c217de1a6922648d249ec4bae", "score": "0.48199177", "text": "function fnHAN(hideallm) {\n var allids = hideallm.split(\",\");\n\n //PN1,CPN2_PN1,CPN3_PN1\n //aPN1 = CPN2_PN1,CPN3_PN1\n for (i = 0; i < allids.length - 1; i++) {\n var chkId;\n chkId = allids[i];\n var vCPN = chkId.substr(0, 2);\n if (vCPN == \"CP\") {\n fnNC(allids[i], \"CP\");\n }\n else if (vCPN == \"PN\") {\n var ChildID = \"\";\n for (j = 0; j < allids.length - 1; j++) {\n var len = chkId.length;\n if (allids[j].substr(allids[j].length - len, len) == chkId && allids[j] != chkId) {\n if (ChildID != \"\")\n ChildID = ChildID + \",\";\n ChildID = ChildID + allids[j];\n }\n }\n if (self[\"a\" + allids[i]] == \"\") {\n self[\"a\" + allids[i]] = ChildID;\n }\n fnNC(allids[i], \"P\");\n }\n }\n}", "title": "" }, { "docid": "50d5cc76f73dd669e721ea06ef11fb70", "score": "0.48186255", "text": "function parse(obj, source) {\n let prop;\n\n for (prop in source) {\n if (level === 0) {\n rootKey = prop;\n }\n\n // if (!obj[prop]) {\n if (obj[prop] === undefined) {\n if (!op.not || !_.contains(op.not, rootKey)) {\n return false;\n } else if (op.or) {\n return true;\n }\n continue;\n }\n\n if (_.isObject(source[prop]) && !_.keys(source[prop])[0].match(/^\\$/)) {\n level += 1;\n if (!parse(obj[prop], source[prop])) {\n level -= 1;\n if (!op.or) {\n return false;\n }\n } else if (op.or) {\n return true;\n }\n } else if (!_areConditionsTrue(obj[prop], source[prop])) {\n if (!op.or) {\n return false;\n }\n } else if (op.or) {\n return true;\n }\n }\n return !op.or;\n }", "title": "" }, { "docid": "49e0b86e7bd6826bf4c6c50e3fa58f41", "score": "0.48141706", "text": "function makePredicate(words) {\n if (!(words instanceof Array)) words = words.split(\" \");\n var f = \"\", cats = [];\n out: for (var i = 0; i < words.length; ++i) {\n for (var j = 0; j < cats.length; ++j)\n if (cats[j][0].length == words[i].length) {\n cats[j].push(words[i]);\n continue out;\n }\n cats.push([words[i]]);\n }\n function quote(word) {\n return JSON.stringify(word).replace(/[\\u2028\\u2029]/g, function(s) {\n switch (s) {\n case \"\\u2028\": return \"\\\\u2028\";\n case \"\\u2029\": return \"\\\\u2029\";\n }\n return s;\n });\n }\n function compareTo(arr) {\n if (arr.length == 1) return f += \"return str === \" + quote(arr[0]) + \";\";\n f += \"switch(str){\";\n for (var i = 0; i < arr.length; ++i) f += \"case \" + quote(arr[i]) + \":\";\n f += \"return true}return false;\";\n }\n // When there are more than three length categories, an outer\n // switch first dispatches on the lengths, to save on comparisons.\n if (cats.length > 3) {\n cats.sort(function(a, b) {return b.length - a.length;});\n f += \"switch(str.length){\";\n for (var i = 0; i < cats.length; ++i) {\n var cat = cats[i];\n f += \"case \" + cat[0].length + \":\";\n compareTo(cat);\n }\n f += \"}\";\n // Otherwise, simply generate a flat `switch` statement.\n } else {\n compareTo(words);\n }\n return new Function(\"str\", f);\n}", "title": "" }, { "docid": "49e0b86e7bd6826bf4c6c50e3fa58f41", "score": "0.48141706", "text": "function makePredicate(words) {\n if (!(words instanceof Array)) words = words.split(\" \");\n var f = \"\", cats = [];\n out: for (var i = 0; i < words.length; ++i) {\n for (var j = 0; j < cats.length; ++j)\n if (cats[j][0].length == words[i].length) {\n cats[j].push(words[i]);\n continue out;\n }\n cats.push([words[i]]);\n }\n function quote(word) {\n return JSON.stringify(word).replace(/[\\u2028\\u2029]/g, function(s) {\n switch (s) {\n case \"\\u2028\": return \"\\\\u2028\";\n case \"\\u2029\": return \"\\\\u2029\";\n }\n return s;\n });\n }\n function compareTo(arr) {\n if (arr.length == 1) return f += \"return str === \" + quote(arr[0]) + \";\";\n f += \"switch(str){\";\n for (var i = 0; i < arr.length; ++i) f += \"case \" + quote(arr[i]) + \":\";\n f += \"return true}return false;\";\n }\n // When there are more than three length categories, an outer\n // switch first dispatches on the lengths, to save on comparisons.\n if (cats.length > 3) {\n cats.sort(function(a, b) {return b.length - a.length;});\n f += \"switch(str.length){\";\n for (var i = 0; i < cats.length; ++i) {\n var cat = cats[i];\n f += \"case \" + cat[0].length + \":\";\n compareTo(cat);\n }\n f += \"}\";\n // Otherwise, simply generate a flat `switch` statement.\n } else {\n compareTo(words);\n }\n return new Function(\"str\", f);\n}", "title": "" }, { "docid": "604b3637d3cf52eac3755f679e838ef0", "score": "0.4804462", "text": "cleanUp()\n {\n // grammar empty\n if (!this._rules.length) \n {\n this.clear();\n }\n\n // to remove duplicate rules, we make use of the toString method and Set data Structure.\n let rule = this._rules.map((cur) => \n {\n return cur.toString();\n });\n rule = new Set(rule);\n rule = Array.from(rule); // convert back to array\n this._rules = rule.map((cur) => \n {\n let temp = cur.split('->');\n // if the RHS is '', we make it EMPTY\n if (!temp[1].length)\n {\n temp[1] = EMPTY;\n }\n return new Rule(temp[0], temp[1]);\n });\n\n // remove variables that doesn't have any production rules, i.e. only keep LHS of all rules\n let variables = rule.map((cur) => \n {\n return cur.split('->')[0];\n });\n this._variables = new Set(variables);\n\n // TODO: remove any lingering terminals, hard to do at this point because it is not clear how \n // to idenitify a terminal\n }", "title": "" }, { "docid": "4e644323b5107f14241865271e019203", "score": "0.47876748", "text": "function Tree (target, tarStart, source, sourStart, rule) {\n this.level = [];\n this.depth = 0;\n this.tree = new Set();\n this.root1 = tarStart;\n this.root2 = sourStart;\n this.root1G = target;\n this.root2G = source;\n this.rule = rule;\n this.invalid = false;\n\n this.start = function(rule) {\n // if this tree is invalid return undefined\n if(this.invalid){return undefined;}\n this.depth = this.level.length // should be 0 for first level\n var results = [];\n if(this.root1.referent == '*' && this.root2.referent != '*') { // <---------------------------------- All these checks need to be smarter\n // -------------------------------------------------------------------------------- we need to traverse a few depths directly here and determine new information vs no new\n //console.log('Found new referent to merge');\n results.push({from:this.root2.uuid,to:this.root1.uuid,what:'referent', depth:this.depth});\n this.tree.add(this.root2.uuid);\n this.tree.add(this.root1.uuid);\n // if source referent is star and it has more relations than this might be new information\n } else if (this.root2.referent == '*') {\n //console.log('Found a general referent, might have something new here');\n if((this.root2.out.length>this.root1.out.length) || rule){\n results.push({from:this.root2.uuid,to:this.root1.uuid,what:'none', depth:this.depth});\n this.tree.add(this.root2.uuid);\n this.tree.add(this.root1.uuid);\n }\n // if both referents are the same, then we need to check if new relations are available\n } else if (this.root1.referent == this.root2.referent) {\n //console.log('Referents the same, need to check relations\n // only if we have more relations going out in the source add it\n // or if we are trying to match a rule (could be exactly the same as the graph we want)\n if((this.root2.out.length>this.root1.out.length) || rule){\n results.push({from:this.root2.uuid,to:this.root1.uuid,what:'none', depth:this.depth});\n this.tree.add(this.root2.uuid);\n this.tree.add(this.root1.uuid);\n } else {\n // check if we have a source out with a different uuid, then proceed as if it's a new connection\n // suspect to do this as the source uuid migth be different everytime we are checking this\n for(let i=0;i<this.root1.out.length;i++){\n for(let j=0;j<this.root2.out.length;j++){\n if(this.root1.out[i] != this.root2.out[j]){\n // this might be a new connection we do not have\n results.push({from:this.root2.uuid,to:this.root1.uuid,what:'none', depth:this.depth});\n this.tree.add(this.root2.uuid);\n this.tree.add(this.root1.uuid);\n } else {\n // they are the same, so don't persue\n this.invalid = true;\n }\n }\n }\n //if no results after this condition, this should be invalid\n if(!results.length>0) {\n this.invalid = true;\n }\n }\n } else {\n this.invalid = true;\n }\n this.level.push(results);\n return this.growR(rule);\n };\n\n this.growR = function(rule){\n if(this.invalid){return undefined;}\n var results = [];\n var expand = this.level[this.depth];\n this.depth += 1;\n for (let i = 0; i < expand.length; i++) {\n var sourCon = this.root2G.find('uuid', expand[i].from).out;\n var tarCon = this.root1G.find('uuid', expand[i].to).out;\n //console.log('if new information is available');\n //console.log(sourCon.length>tarCon.length);\n for (let j = 0; j < tarCon.length; j++) {\n // if we have not seen this already\n if(!this.tree.has(tarCon[j])) {\n // set temp for target relation to compare to\n var temp1 = this.root1G.find('uuid',tarCon[j]);\n for (let k = 0; k < sourCon.length; k++) {\n // if we have not seen this already\n if(!this.tree.has(sourCon[k])){\n // set temp for source relation to compare to\n var temp2 = this.root2G.find('uuid',sourCon[k])\n // if they are the same, merge them\n if (temp1.label == temp2.label) {\n // this logic needs to be looked at <------\n // if new information is available, as in there is more relations in the source\n results.push({from:temp2.uuid,to:temp1.uuid,what:'relation',depth:this.depth, parent:expand[i]})\n this.tree.add(temp1.uuid);\n this.tree.add(temp2.uuid);\n }\n }\n }\n }\n }\n }\n //console.log('checking for results');\n // if we found children that match go ahead and push to level 1/3/5 etc\n if(results.length>0){\n this.level.push(results);\n return this.growC(rule)\n } else {\n //console.log('found no further relations');\n return this.finish(rule);\n }\n };\n\n this.growC = function(rule) {\n //console.log('checking more concepts');\n if(this.invalid){return undefined;}\n var results = [];\n var expand = this.level[this.depth];\n this.depth += 1;\n for (let i = 0; i < expand.length; i++) {\n var sourCon = this.root2G.find('uuid', expand[i].from).arcs;\n var tarCon = this.root1G.find('uuid', expand[i].to).arcs;\n //console.log('going over new concepts', tarCon);\n for (var targetI in tarCon) {\n //console.log(tarCon[targetI]);\n // if we don't have seen this already\n if(!this.tree.has(tarCon[targetI])) {\n // set temp for target relation to compare to\n //console.log('new concept', this.root1G.find('uuid',tarCon[targetI]));\n var temp1 = this.root1G.find('uuid',tarCon[targetI]);\n for (var sourceI in sourCon) {\n // set temp for source relation to compare to\n var temp2 = this.root2G.find('uuid',sourCon[sourceI]);\n if(!this.tree.has(temp2.uuid)){\n\n if(temp1.label == temp2.label) {\n // if they are the same, merge them\n if(temp1.referent == '*' && temp2.referent != '*') {\n //console.log('Found new referent to merge');\n results.push({from:this.root2.uuid,to:this.root1.uuid,what:'referent', depth:this.depth, parent:expand[i]});\n this.tree.add(temp2.uuid);\n this.tree.add(temp1.uuid);\n // if source referent is star and it has more relations than this might be new information\n } else if (temp2.referent == '*') {\n //console.log('Found a general referent, might have something new here');\n results.push({from:temp2.uuid,to:temp1.uuid,what:'none', depth:this.depth, parent:expand[i]});\n this.tree.add(temp2.uuid);\n this.tree.add(temp1.uuid);\n // if both referents are the same, then we need to check if new relations are available\n } else if (temp1.referent == temp2.referent) {\n //console.log('Referents the same, need to check relations');\n // only if we have more relations going out in the source add it\n if(temp2.out.length>temp1.out.length){\n results.push({from:temp2.uuid,to:temp1.uuid,what:'none', depth:this.depth, parent:expand[i]});\n this.tree.add(temp2.uuid);\n this.tree.add(temp1.uuid);\n } else {\n // check if we have a source out with a different uuid, then proceed as if it's a new connection\n // suspect to do this as the source uuid migth be different everytime we are checking this\n for(let i=0;i<temp1.out.length;i++){\n for(let j=0;j<temp2.out.length;j++){\n if(temp1.out[i] != temp2.out[j]){\n // this might be a new connection we do not have\n results.push({from:temp2.uuid,to:temp1.uuid,what:'none', depth:this.depth, parent:expand[i]});\n this.tree.add(temp2.uuid);\n this.tree.add(temp1.uuid);\n } else {\n this.invalid = true;\n }\n }\n }\n }\n } else {\n //console.log('No fit on this concept, handle me depending on root1');\n //console.log(temp1);\n //console.log(temp2);\n this.tree.add(temp2.uuid);\n this.tree.add(temp1.uuid);\n }\n } else {\n //console.log('no match')\n }\n }\n }\n }\n }\n }\n\n //check if results were found\n if(results.length>0){\n //console.log('found new concepts');\n this.level.push(results);\n return this.growR(rule)\n } else {\n //console.log('found no further concepts');\n return this.finish(rule);\n }\n };\n\n this.finish = function(rule) {\n // take tree and turn into one or more join concepts\n //console.log('finishing up');\n // initiate a result array\n var projections = [];\n\n var levels = this.level.length;\n while(this.level.length>0){\n var level = this.level.pop();\n for(let i=0;i<level.length;i++){\n if(!level[i].seen){\n var array = [];\n array.push(level[i]);\n level[i].seen = true;\n if(level[i].parent){\n var parent = level[i].parent;\n for(let j=levels;j>0;j--){\n if(parent.parent){\n array.push(parent);\n parent.seen = true;\n parent = parent.parent;\n } else {\n //should be a root\n array.push(parent);\n parent.seen = true;\n break;\n }\n }\n }\n array = array.reverse();\n projections.push(array);\n }\n }\n }\n\n //if this is a rule, check that source is fully covered with each projection, remove any that are\n // fully covering the source\n // let's try doing it with an approximation, if we have fully covered the source, then we should have\n // the same amount of merges than there is concepts and relations in the source...\n if(rule){\n var sourceTotal = this.root2G.concept.length + this.root2G.relation.length;\n for (let i = 0; i < projections.length; i++) {\n // if the rule is not fully covered, it does not apply\n if( !(projections[i].length>=sourceTotal) ) {\n projections.splice(i,1);\n i--;\n }\n }\n }\n\n return projections;\n };\n\n}", "title": "" }, { "docid": "3e23ba6b4ca29f97af629965bd05a0b3", "score": "0.47868446", "text": "function pureCopy(rules) {\n let pureRules = {};\n pureRules['S'] = rules['S'];\n let banned = [];\n // Only add rules that make forward action or call forward rules\n for(let key in rules) {\n if(is_forward(key, rules)) {\n pureRules[key] = rules[key];\n } else {\n banned.push(key);\n }\n }\n // Remove references of non forward rules in the forward rules\n for(let i=0; i<banned.length; i++) {\n for(let key in pureRules) {\n pureRules[key] = pureRules[key].split(banned[i]).join('');\n }\n }\n return pureRules;\n}", "title": "" }, { "docid": "65d96a50e4326a1eafa61c22184b32ce", "score": "0.47867808", "text": "function buildRuleRegExp( languageNode, contextNode )\n{\n\tvar sRegExp, ruleNode, regExpExprNode, rootNode;\n\tvar keywordListNode, keywordListNameNode, keywordListRegExpNode,xp;\n\t\n\trootNode = languageNode.selectSingleNode(\"/*\");\n\tsRegExp=\"(\";\n\n\tvar ruleList=contextNode.childNodes;\n\t// building regular expression\t\n\tfor (ruleNode=ruleList.nextNode(); ruleNode != null; ruleNode=ruleList.nextNode() )\n\t{\n\t\tif (ruleNode.nodeName == \"#comment\")\n\t\t\tcontinue;\n\t\t\t\n\t\t// apply rule...\n\t\tif (ruleNode.nodeName == \"detect2chars\")\n\t\t{\n\t\t\tvar char0=ruleNode.attributes.getNamedItem(\"char\").value;\n\t\t\tvar char1=ruleNode.attributes.getNamedItem(\"char1\").value;\n\t\t\tsRegExp= sRegExp + stringToRegExp( char0 + char1 ) + \"|\";\n\t\t}\n\t\telse if (ruleNode.nodeName == \"detectchar\")\n\t\t{\n\t\t\tvar char0=ruleNode.attributes.getNamedItem(\"char\").value;\n\t\t\tsRegExp=sRegExp + stringToRegExp( char0 ) + \"|\";\n\t\t}\n\t\telse if (ruleNode.nodeName == \"linecontinue\")\n\t\t{\n\t\t\tsRegExp=sRegExp + \"\\n|\"\n\t\t}\n\t\telse if (ruleNode.nodeName == \"regexp\" )\n\t\t{\n\t\t\tregExpExprNode = ruleNode.attributes.getNamedItem(\"expression\");\n\t\t\tif ( regExpExprNode == null )\n\t\t\t\tthrow \"Regular expression rule missing expression attribute\";\n\t\t\t\t\n\t\t\tsRegExp=sRegExp + regExpExprNode.nodeTypedValue + \"|\";\n\t\t}\n\t\telse if (ruleNode.nodeName == \"keyword\")\n\t\t{\n\t\t\t// finding keywordlist\n\t\t\tkeywordListNameNode = ruleNode.attributes.getNamedItem(\"family\");\n\t\t\tif (keywordListNameNode == null)\n\t\t\t\tthrow \"Keyword rule missing family\";\n\t\t\txp=\"keywordlists/keywordlist[@id=\\\"\"\n\t\t\t\t\t+ keywordListNameNode.nodeTypedValue \n\t\t\t\t\t+ \"\\\"]\";\n\t\t\tkeywordListNode = rootNode.selectSingleNode(xp);\n\t\t\tif (keywordListNode == null)\n\t\t\t\tthrow \"Could not find keywordlist (xp: \"+ xp + \")\";\n\t\t\t\t\n\t\t\tkeywordListRegExpNode = keywordListNode.attributes.getNamedItem(\"regexp\");\n\t\t\tif (keywordListRegExpNode == null)\n\t\t\t\tthrow \"Could not find keywordlist regular expression\";\n\t\t\t\t\n\t\t\t// adding regexp\n\t\t\tsRegExp=sRegExp+keywordListRegExpNode.nodeTypedValue+\"|\";\n\t\t}\n\t}\n\n\tif (sRegExp.length > 1)\n\t\tsRegExp=sRegExp.substring(0,sRegExp.length-1)+\")\";\n\telse\n\t\tsRegExp=\"\";\n\t\n\treturn sRegExp;\t\n}", "title": "" }, { "docid": "2b74ea7a297237cc6865788ca7dffc58", "score": "0.47772002", "text": "function parseRule(raw) {\n\tlet errors = []\n\t\t\n\tlet result = splitIntoProtectedSections(tracerySpec, \"rule\", raw)\n\n\tlet sections = result.sections.map(section => {\n\t\tswitch(section.openSymbol) {\n\t\t\tcase \"#\": \n\t\t\t\treturn parseTag(section.inner)\n\t\t\t\t\n\t\t\tcase \"[\": \n\t\t\t\treturn parseAction(section.inner)\n\t\t\t\t\n\t\t\tcase \"<<\": \n\t\t\t\treturn createNode(\"PROP\", section.inner)\n\t\t\t\t// return parseAction(section.inner)\n\t\t\t\t\n\n\t\t\tcase undefined: \n\t\t\t\treturn createNode(\"TEXT\", section.raw)\n\t\t\t\n\t\t\tdefault: \n\t\t\t\tconsole.warn(\"unknown section type \", section)\n\t\t}\n\t\t\n\n\t})\n\terrors = errors.concat(result.errors)\n\n\tsections = sections.filter(s => (s.type !== Tracery.Type.TEXT) || (s.raw.length > 0))\n\treturn createNode(\"RULE\", raw, {sections:sections}, errors)\n\n\t// Simple rule?\n\t// if (sections.length == 1 && sections[0].type === Tracery.Type.TEXT)\n\t// \treturn sections[0]\n\n}", "title": "" }, { "docid": "b99b308772f6b5b6a2ce93092bfeb644", "score": "0.4758945", "text": "compile() {\n this.prefixes = [];\n\n let k = 0;\n this.prefixes[k] = 0;\n\n for (let q = 1; q < this.pattern.length; q++) {\n while (k > 0 && this.pattern[q] != this.pattern[k]) {\n k = this.prefixes[k - 1];\n }\n\n if (this.pattern[q] == this.pattern[k]) \n k = k + 1;\n\n this.prefixes[q] = k;\n }\n }", "title": "" }, { "docid": "a325f217b10c8d038921e3fa4bfb3ea7", "score": "0.47533625", "text": "function getRules(){return new RuleSet([]);}", "title": "" }, { "docid": "b8ce20053963c7e40f90dd3dfbbf0847", "score": "0.4752996", "text": "constructor(rules) {\n let _rules = rules;\n if (typeof _rules !== 'string') _rules = HttpRules.defaultRules;\n\n // load rules from external files\n if (_rules.startsWith('file://')) {\n const rfile = _rules.substring(7).trim();\n try {\n _rules = fs.readFileSync(rfile).toString();\n } catch (e) {\n throw new EvalError(`Failed to load rules: ${rfile}`);\n }\n }\n\n // force default rules if necessary\n _rules = _rules.replace(/^\\s*include default\\s*$/gm, HttpRules.defaultRules);\n if (_rules.trim().length === 0) _rules = HttpRules.defaultRules;\n\n // expand rule includes\n _rules = _rules.replace(/^\\s*include debug\\s*$/gm, HttpRules.debugRules);\n _rules = _rules.replace(/^\\s*include standard\\s*$/gm, HttpRules.standardRules);\n _rules = _rules.replace(/^\\s*include strict\\s*$/gm, HttpRules.strictRules);\n this.text = _rules;\n\n // parse all rules\n const prs = [];\n for (const rule of this.text.split(/[\\r\\n]/)) {\n const parsed = HttpRules.parseRule(rule);\n if (parsed !== null) prs.push(parsed);\n }\n this.length = prs.length;\n\n // break out rules by verb\n this.allow_http_url = prs.filter((r) => r.verb === 'allow_http_url').length > 0;\n this.copy_session_field = prs.filter((r) => r.verb === 'copy_session_field');\n this.remove = prs.filter((r) => r.verb === 'remove');\n this.remove_if = prs.filter((r) => r.verb === 'remove_if');\n this.remove_if_found = prs.filter((r) => r.verb === 'remove_if_found');\n this.remove_unless = prs.filter((r) => r.verb === 'remove_unless');\n this.remove_unless_found = prs.filter((r) => r.verb === 'remove_unless_found');\n this.replace = prs.filter((r) => r.verb === 'replace');\n this.sample = prs.filter((r) => r.verb === 'sample');\n this.skip_compression = prs.filter((r) => r.verb === 'skip_compression').length > 0;\n this.skip_submission = prs.filter((r) => r.verb === 'skip_submission').length > 0;\n this.stop = prs.filter((r) => r.verb === 'stop');\n this.stop_if = prs.filter((r) => r.verb === 'stop_if');\n this.stop_if_found = prs.filter((r) => r.verb === 'stop_if_found');\n this.stop_unless = prs.filter((r) => r.verb === 'stop_unless');\n this.stop_unless_found = prs.filter((r) => r.verb === 'stop_unless_found');\n\n // validate rules\n if (this.sample.length > 1) throw new EvalError('Multiple sample rules');\n\n // mark immutable properties\n Object.defineProperty(this, 'allow_http_url', {\n configurable: false,\n writable: false,\n });\n Object.defineProperty(this, 'copy_session_field', {\n configurable: false,\n writable: false,\n });\n Object.defineProperty(this, 'length', {\n configurable: false,\n writable: false,\n });\n Object.defineProperty(this, 'remove', {\n configurable: false,\n writable: false,\n });\n Object.defineProperty(this, 'remove_if', {\n configurable: false,\n writable: false,\n });\n Object.defineProperty(this, 'remove_if_found', {\n configurable: false,\n writable: false,\n });\n Object.defineProperty(this, 'remove_unless', {\n configurable: false,\n writable: false,\n });\n Object.defineProperty(this, 'remove_unless_found', {\n configurable: false,\n writable: false,\n });\n Object.defineProperty(this, 'replace', {\n configurable: false,\n writable: false,\n });\n Object.defineProperty(this, 'sample', {\n configurable: false,\n writable: false,\n });\n Object.defineProperty(this, 'skip_compression', {\n configurable: false,\n writable: false,\n });\n Object.defineProperty(this, 'skip_submission', {\n configurable: false,\n writable: false,\n });\n Object.defineProperty(this, 'stop', {\n configurable: false,\n writable: false,\n });\n Object.defineProperty(this, 'stop_if', {\n configurable: false,\n writable: false,\n });\n Object.defineProperty(this, 'stop_if_found', {\n configurable: false,\n writable: false,\n });\n Object.defineProperty(this, 'stop_unless', {\n configurable: false,\n writable: false,\n });\n Object.defineProperty(this, 'stop_unless_found', {\n configurable: false,\n writable: false,\n });\n Object.defineProperty(this, 'text', {\n configurable: false,\n writable: false,\n });\n }", "title": "" }, { "docid": "e5b4474982e983e1168debe38f60334f", "score": "0.47489706", "text": "createRule() {\n\n // check if form is completed\n let sthExists = false;\n for (let i = 0; i < 6; i++) {\n let condType = \"\";\n\n // select type\n switch (i) {\n case 0: {condType = \"count\"; break;}\n case 1: {condType = \"general\"; break;}\n case 2: {condType = \"course\"; break;}\n case 3: {condType = \"komp\"; break;}\n case 4: {condType = \"feedback\"; break;}\n case 5: {condType = \"or\"; break;}\n default: {console.error(\"This definitely should not have happened. Something major seems to have went wrong!\")}\n }\n for (let ii = 0; ii < this.state.ruleConditions[condType + \"Conds\"].length; ii++)\n {\n if (condType === \"or\") {\n for(let iii = 0; iii < 5; iii++) {\n let innerCondType = \"\";\n switch (iii) {\n case 0: {innerCondType = \"count\"; break;}\n case 1: {innerCondType = \"general\"; break;}\n case 2: {innerCondType = \"course\"; break;}\n case 3: {innerCondType = \"komp\"; break;}\n case 4: {innerCondType = \"feedback\"; break;}\n default: {console.error(\"This definitely should not have happened. Something major seems to have went wrong!\")}\n }\n for (let iiii = 0; iiii < this.state.ruleConditions.orConds[ii][innerCondType + \"Conds\"].length; iiii++) {\n sthExists = true;\n if (this.state.ruleConditions.orConds[ii][innerCondType + \"Conds\"][iiii].conditionObject === \"\") {\n alert(\"Complete filling in the form!\");\n return;\n }\n }\n }\n } else {\n sthExists = true;\n if (this.state.ruleConditions[condType + \"Conds\"][ii].conditionObject === \"\") {\n alert(\"Complete filling in the form!\");\n return;\n }\n }\n }\n }\n if (this.state.ruleName === \"\" || !sthExists) {\n alert(\"Complete filling in the form!\");\n return;\n }\n if (this.state.ruleImg === \"\") {\n alert(\"You are missing an image!\");\n return;\n }\n\n // create drools file and export it\n let drool;\n /*var rawFile = new XMLHttpRequest();\n rawFile.open(\"GET\", \"./src/rules.drl\", false);\n rawFile.onreadystatechange = () => {\n if (rawFile.readyState === 4) {\n if (rawFile.status === 200 || rawFile.status == 0) {\n drool = rawFile.responseText;\n } else {\n drool = 'dialect \"mvel\"\\r\\nimport model.Volunteer \\r\\n';\n }\n } else {\n }\n };\n rawFile.send(void);*/\n try {\n require(`${\"./src/rules.drl\"}`);\n fetch(\"./src/rules.drl\")\n .then(r => r.text())\n .then(text => {\n drool = text;\n });\n alert(drool);\n } catch (err) {\n drool = 'dialect \"mvel\"\\r\\nimport model.Volunteer \\r\\n';\n }\n\n drool +=\n 'rule \"' + this.state.ruleName + '\" when volunteer: model.Volunteer(';\n for (let i = 0; i < this.state.ruleConditions.length; i++) {\n if (i !== 0) {\n drool += \"&& \";\n }\n drool +=\n this.state.ruleConditions[i].conditionObject +\n \" == \" +\n this.state.ruleConditions[i].conditionCount;\n }\n drool += ') then System.out.println(\"' + this.state.ruleName + '\"); end';\n\n const element = document.createElement(\"a\");\n const file = new Blob([drool], {\n type: \"text/plain\"\n });\n element.href = URL.createObjectURL(file);\n element.download = \"rules.drl\";\n document.body.appendChild(element);\n element.click();\n\n // just for displaying data\n\n /*let message = \"New rule name: \" + this.state.ruleName + \"\\n\\n\";\n for (let i = 0; i < this.state.ruleConditions.length; i++) {\n message +=\n \" \" +\n (i + 1).toString() +\n \". \" +\n this.state.ruleConditions[i].conditionCount +\n \" \" +\n this.state.ruleConditions[i].conditionObject +\n \"\\n\";\n }\n alert(message);*/\n }", "title": "" }, { "docid": "1cbffd69754638e677835b8f6917eb57", "score": "0.47421893", "text": "function generateRules(rulesData){\n for(i=0; i<rulesData.length; i++){\n $scope.rules.push(JSON.parse(JSON.stringify(ruleObj)));\n choicesArray = rulesData[i].choice;\n $scope.rules[i].choices = \"\";\n for(j=0; j < choicesArray.length; j++){\n $scope.rules[i].choices += getChoiceText(choicesArray[j], choicesArray.length - j);\n if(j == choicesArray.length - 1 && $scope.rules[i].choices == \"\"){\n $scope.rules[i].choices += \"No choices matched\";\n }\n };\n $scope.rules[i].category_count = getVenueCount(rulesData[i].category_level);\n $scope.rules[i].status = rulesData[i].status;\n $scope.rules[i].id = rulesData[i].id;\n $scope.rules[i].persona = rulesData[i].persona;\n $scope.rules[i].choicesArr = rulesData[i].choice;\n $scope.rules[i].category_level = rulesData[i].category_level;\n $scope.rules[i].cat_level_id = Object.getOwnPropertyNames (rulesData[i].category_level)[0]\n }\n }", "title": "" }, { "docid": "409eee4df4204184004725e0814ae4ca", "score": "0.47356603", "text": "function O(){this.rules=new T(k)}", "title": "" }, { "docid": "9803d5fa4aeec28e4cc50651e089ec4a", "score": "0.47326386", "text": "function findTranspilationRules(rules, projectDir) {\n if (!rules) {\n return [];\n }\n\n const matchingRules = [];\n\n // Each entry in `module.rules` is either a rule in and of itself or an object with a `oneOf` property, whose value is\n // an array of rules\n rules.forEach(rule => {\n // if (rule.oneOf) {\n if (isMatchingRule(rule, projectDir)) {\n matchingRules.push(rule);\n } else if (rule.oneOf) {\n const matchingOneOfRules = rule.oneOf.filter(oneOfRule => isMatchingRule(oneOfRule, projectDir));\n matchingRules.push(...matchingOneOfRules);\n // } else if (isMatchingRule(rule, projectDir)) {\n }\n });\n\n return matchingRules;\n}", "title": "" }, { "docid": "ec31275110178aa8cdf0b74701ed5e29", "score": "0.47304675", "text": "function xpathReduce(stack, ahead) {\n var cand = null;\n\n if (stack.length > 0) {\n var top = stack[stack.length-1];\n var ruleset = xpathRules[top.tag.key];\n\n if (ruleset) {\n for (var i = 0; i < ruleset.length; ++i) {\n var rule = ruleset[i];\n var match = xpathMatchStack(stack, rule[1]);\n if (match.length) {\n cand = {\n tag: rule[0],\n rule: rule,\n match: match\n };\n cand.prec = xpathGrammarPrecedence(cand);\n break;\n }\n }\n }\n }\n\n var ret;\n if (cand && (!ahead || cand.prec > ahead.prec ||\n (ahead.tag.left && cand.prec >= ahead.prec))) {\n for (var i = 0; i < cand.match.matchlength; ++i) {\n stack.pop();\n }\n\n xpathLog('reduce ' + cand.tag.label + ' ' + cand.prec +\n ' ahead ' + (ahead ? ahead.tag.label + ' ' + ahead.prec +\n (ahead.tag.left ? ' left' : '')\n : ' none '));\n\n var matchexpr = mapExpr(cand.match, function(m) { return m.expr; });\n xpathLog('going to apply ' + cand.rule[3].toString());\n cand.expr = cand.rule[3].apply(null, matchexpr);\n\n stack.push(cand);\n ret = true;\n\n } else {\n if (ahead) {\n xpathLog('shift ' + ahead.tag.label + ' ' + ahead.prec +\n (ahead.tag.left ? ' left' : '') +\n ' over ' + (cand ? cand.tag.label + ' ' +\n cand.prec : ' none'));\n stack.push(ahead);\n }\n ret = false;\n }\n return ret;\n}", "title": "" }, { "docid": "6cf66f576894cd8228a7041adc64c355", "score": "0.4722725", "text": "function parseFieldForRules(tokens, rules, out, index = 0) {\n const token = tokens[index++];\n /**\n * Finding if we are on the last item. Last item defines\n * the rules for the current node inside the tree\n */\n const isLast = tokens.length === index;\n /**\n * Indexed array have `digits` like `users.0.username`\n */\n const isIndexedArray = /^\\d+$/.test(tokens[index]);\n /**\n * Is upcoming token an array\n */\n const isArray = tokens[index] === '*' || isIndexedArray;\n /**\n * Last item was marked as array, since current token is a `*`\n * or has defined index\n */\n if (token === '*' || /^\\d+$/.test(token)) {\n /**\n * Last item must update rules for each item for the array\n */\n if (isLast) {\n out.each[token].rules = rules;\n return;\n }\n /**\n * Nested arrays\n */\n if (isArray) {\n /**\n * The code after the error works fine. However, in order to support\n * 2d arrays, we need to implement them inside the declarative\n * schema and compiler as well.\n *\n * For now, it's okay to skip this feature and later work on it\n * across all the modules.\n */\n throw new Error('2d arrays are currently not supported');\n // const item = setArray(\n // (out as SchemaNodeArray).each[token].children,\n // token,\n // isIndexedArray ? tokens[index] : '*',\n // )\n // return parseFieldForRules(tokens, rules, item, index)\n }\n /**\n * Otherwise continue recursion\n */\n return parseFieldForRules(tokens, rules, out.each[token].children, index);\n }\n /**\n * Last item in the list of tokens. we must\n * patch the rules here.\n */\n if (isLast) {\n setLiteral(out, token, rules);\n return;\n }\n /**\n * Current item as an array\n */\n if (isArray) {\n const item = setArray(out, token, isIndexedArray ? tokens[index] : '*');\n return parseFieldForRules(tokens, rules, item, index);\n }\n /**\n * Falling back to object\n */\n const item = setObject(out, token);\n return parseFieldForRules(tokens, rules, item.children, index);\n}", "title": "" }, { "docid": "c21db25f8041604852c006f36b0807e6", "score": "0.4715183", "text": "function resetRulesForCombination(rules){\r\n\t\tfor(rule of rules){\r\n\t\t\trule.forCombination = false;\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "f9b186af4c4bde6f46404ea0fa0c9f08", "score": "0.4699099", "text": "getRules(selector, selectorNum) {\n\n // Generate the options for the category dropdown\n var categoryOptions = [\"All\", \"Chicken\",\"Beef\",\"Salad\",\"Soup\",\"Stew\",\"Pasta\",\"Egg\",\"Pork\",\"Fish\",\"Sandwich\",\"Seafood\",\"Baked\",\"Fried\",\"Bread\",\"Pizza\"].map(category => {\n return(<option value={category}/>)\n })\n categoryOptions.push(<option value=\"\" hidden/>)\n\n var i = -1\n // Generate each rule element\n var rules = selector.rules.map((rule) => {\n i++\n\n // Get the rule parameters\n var parameters = rule.parameters\n\n if ((selector.parameters.includes(\"all\") || selector.parameters.length > 1) && parameters) { // If there are multiple selector parameters, add the for (each/all) parameter\n var forSelector = (\n <div class=\"forSelector\">\n <div style={{display: \"inline\"}}>for </div>\n <select value={parameters.for} class=\"forSelectorSelect\" id={i} onChange={(e) => this.changeRuleParameter(e, selectorNum, \"for\")}>\n <option value=\"\" selected disabled hidden></option>\n <option value=\"each\">each</option>\n <option value=\"all\">all</option>\n </select>\n </div>\n )\n } else { // If there is just one selector parameter, don't show the for (each/all) option\n var forSelector = (\n <div style={{display: \"none\"}}></div>\n )\n }\n \n var ruleName;\n if (rule.new) { // If it is a new rule make the rulename a selector\n ruleName = (\n <select class=\"selectSelector\" value={rule.rule} id={i} onChange={(e) => this.changeRuleType(e, selectorNum)}>\n <option value=\"\" selected disabled hidden></option>\n <option value=\"Total\">Total</option>\n <option value=\"Repeats\">Repeats</option>\n <option value=\"Filter\">Filter</option>\n </select>\n )\n } else { // Otherwise just make it the name of the rule type\n ruleName = rule.rule\n }\n\n var actionButton;\n if (rule.new) { // If the rule is new make the rightmost button an add rule button\n actionButton = (\n <span class=\"plusiconrule\" id={i} onClick={(e) => this.addRule(e, selectorNum)}>+</span>\n )\n } else { // Otherwise make it a remove rule button\n actionButton = ( \n <span class=\"xicon\" id={i} onClick={(e) => this.removeSelectorRule(e, selectorNum)}>✕</span>\n )\n }\n\n if (rule.rule == \"Total\") { // If the rule is a \"total\" command\n var category = capitalize(parameters.category)\n return (\n <table class=\"rule\">\n <tr>\n <th class=\"ruleName\" style={{\"background-color\":\"red\"}}>\n {ruleName}\n </th>\n <th class=\"ruleParameters\">\n <select selected={parameters.condition} value={parameters.condition} class=\"ruleCondition\" id={i} onChange={(e) => this.changeRuleParameter(e, selectorNum, \"condition\")}>\n <option value=\"\" selected disabled hidden></option>\n <option value=\"at most\">At most</option>\n <option value=\"exactly\">Exactly</option>\n <option value=\"at least\">At least</option>\n </select>\n <input type=\"number\" min=\"0\" value={parameters.amount} id={i} onChange={(e) => this.changeRuleParameter(e, selectorNum, \"amount\")}></input>\n <input type=\"text\" list=\"categoryOptions\" class=\"catgeoryInput\" value={category} id={i} onChange={(e) => this.changeRuleParameter(e, selectorNum, \"category\")}/>\n <datalist id=\"categoryOptions\" >\n {categoryOptions}\n </datalist>\n <div class=\"mealsText\">meals</div>\n {forSelector}\n {actionButton}\n </th>\n </tr>\n </table>\n )\n } else if (rule.rule == \"Filter\") { // If the rule is a \"filter\" command\n return (\n <table class=\"rule\">\n <tr>\n <th class=\"ruleName\" style={{\"background-color\":\"green\"}}>\n {ruleName}\n </th>\n <th class=\"ruleParameters\">\n <select value={parameters.type} class=\"ruleCondition\" id={i} onChange={(e) => this.changeRuleParameter(e, selectorNum, \"type\")}>\n <option value=\"\" selected disabled hidden></option>\n <option value=\"exclude\">Exclude</option>\n <option value=\"apply\">Apply</option>\n </select>\n <input type=\"text\" class=\"filterInput\" value={parameters.filter} id={i} onChange={(e) => this.changeRuleParameter(e, selectorNum, \"filter\")}/>\n {actionButton}\n </th>\n </tr>\n </table>\n )\n } else if (rule.rule == \"Repeats\") { // If the rule is a \"repeats\" command\n var category = capitalize(parameters.category)\n return (\n <table class=\"rule\">\n <tr>\n <th class=\"ruleName\" style={{\"background-color\":\"blue\"}}>\n {ruleName}\n </th>\n <th class=\"ruleParameters\">\n <div class=\"filterRuleText\">At most</div>\n <input type=\"number\" min=\"0\" value={parameters.amount} id={i} onChange={(e) => this.changeRuleParameter(e, selectorNum, \"amount\")}></input>\n <input type=\"text\" list=\"categoryOptions\" class=\"catgeoryInput\" value={category} id={i} onChange={(e) => this.changeRuleParameter(e, selectorNum, \"category\")}/>\n <datalist id=\"categoryOptions\">\n {categoryOptions}\n </datalist>\n <div class=\"filterRuleText2\">meals in a row</div>\n {actionButton}\n </th>\n </tr>\n </table>\n )\n } else { // Otherwise display a empty new rule\n return (\n <table class=\"rule\">\n <tr>\n <th class=\"ruleName\" style={{\"background-color\":\"#ccc\"}}>\n {ruleName}\n </th>\n <th class=\"ruleParameters\">\n {actionButton}\n </th>\n </tr>\n </table>\n )\n }\n })\n\n return rules\n }", "title": "" }, { "docid": "496f1e132799ef4907d9ca41a2d5ea3c", "score": "0.46989122", "text": "hasAnyRules() {\n return !isEmpty(this.rules);\n }", "title": "" }, { "docid": "8101ff915c14f6d09c3e4cde75c3449c", "score": "0.46882534", "text": "function startsWithNoLookaheadToken(node,forbidFunctionAndClass){node=getLeftMost(node);switch(node.type){// Hack. Remove after https://github.com/eslint/typescript-eslint-parser/issues/331\ncase\"ObjectPattern\":return!forbidFunctionAndClass;case\"FunctionExpression\":case\"ClassExpression\":return forbidFunctionAndClass;case\"ObjectExpression\":return true;case\"MemberExpression\":return startsWithNoLookaheadToken(node.object,forbidFunctionAndClass);case\"TaggedTemplateExpression\":if(node.tag.type===\"FunctionExpression\"){// IIFEs are always already parenthesized\nreturn false;}return startsWithNoLookaheadToken(node.tag,forbidFunctionAndClass);case\"CallExpression\":if(node.callee.type===\"FunctionExpression\"){// IIFEs are always already parenthesized\nreturn false;}return startsWithNoLookaheadToken(node.callee,forbidFunctionAndClass);case\"ConditionalExpression\":return startsWithNoLookaheadToken(node.test,forbidFunctionAndClass);case\"UpdateExpression\":return!node.prefix&&startsWithNoLookaheadToken(node.argument,forbidFunctionAndClass);case\"BindExpression\":return node.object&&startsWithNoLookaheadToken(node.object,forbidFunctionAndClass);case\"SequenceExpression\":return startsWithNoLookaheadToken(node.expressions[0],forbidFunctionAndClass);case\"TSAsExpression\":return startsWithNoLookaheadToken(node.expression,forbidFunctionAndClass);default:return false;}}", "title": "" }, { "docid": "85a87d3f5bb29b1c9eae68eea7258156", "score": "0.46881533", "text": "function ruleslanguage(hljs) {\n return {\n name: 'Oracle Rules Language',\n keywords: {\n keyword:\n 'BILL_PERIOD BILL_START BILL_STOP RS_EFFECTIVE_START RS_EFFECTIVE_STOP RS_JURIS_CODE RS_OPCO_CODE ' +\n 'INTDADDATTRIBUTE|5 INTDADDVMSG|5 INTDBLOCKOP|5 INTDBLOCKOPNA|5 INTDCLOSE|5 INTDCOUNT|5 ' +\n 'INTDCOUNTSTATUSCODE|5 INTDCREATEMASK|5 INTDCREATEDAYMASK|5 INTDCREATEFACTORMASK|5 ' +\n 'INTDCREATEHANDLE|5 INTDCREATEOVERRIDEDAYMASK|5 INTDCREATEOVERRIDEMASK|5 ' +\n 'INTDCREATESTATUSCODEMASK|5 INTDCREATETOUPERIOD|5 INTDDELETE|5 INTDDIPTEST|5 INTDEXPORT|5 ' +\n 'INTDGETERRORCODE|5 INTDGETERRORMESSAGE|5 INTDISEQUAL|5 INTDJOIN|5 INTDLOAD|5 INTDLOADACTUALCUT|5 ' +\n 'INTDLOADDATES|5 INTDLOADHIST|5 INTDLOADLIST|5 INTDLOADLISTDATES|5 INTDLOADLISTENERGY|5 ' +\n 'INTDLOADLISTHIST|5 INTDLOADRELATEDCHANNEL|5 INTDLOADSP|5 INTDLOADSTAGING|5 INTDLOADUOM|5 ' +\n 'INTDLOADUOMDATES|5 INTDLOADUOMHIST|5 INTDLOADVERSION|5 INTDOPEN|5 INTDREADFIRST|5 INTDREADNEXT|5 ' +\n 'INTDRECCOUNT|5 INTDRELEASE|5 INTDREPLACE|5 INTDROLLAVG|5 INTDROLLPEAK|5 INTDSCALAROP|5 INTDSCALE|5 ' +\n 'INTDSETATTRIBUTE|5 INTDSETDSTPARTICIPANT|5 INTDSETSTRING|5 INTDSETVALUE|5 INTDSETVALUESTATUS|5 ' +\n 'INTDSHIFTSTARTTIME|5 INTDSMOOTH|5 INTDSORT|5 INTDSPIKETEST|5 INTDSUBSET|5 INTDTOU|5 ' +\n 'INTDTOURELEASE|5 INTDTOUVALUE|5 INTDUPDATESTATS|5 INTDVALUE|5 STDEV INTDDELETEEX|5 ' +\n 'INTDLOADEXACTUAL|5 INTDLOADEXCUT|5 INTDLOADEXDATES|5 INTDLOADEX|5 INTDLOADEXRELATEDCHANNEL|5 ' +\n 'INTDSAVEEX|5 MVLOAD|5 MVLOADACCT|5 MVLOADACCTDATES|5 MVLOADACCTHIST|5 MVLOADDATES|5 MVLOADHIST|5 ' +\n 'MVLOADLIST|5 MVLOADLISTDATES|5 MVLOADLISTHIST|5 IF FOR NEXT DONE SELECT END CALL ABORT CLEAR CHANNEL FACTOR LIST NUMBER ' +\n 'OVERRIDE SET WEEK DISTRIBUTIONNODE ELSE WHEN THEN OTHERWISE IENUM CSV INCLUDE LEAVE RIDER SAVE DELETE ' +\n 'NOVALUE SECTION WARN SAVE_UPDATE DETERMINANT LABEL REPORT REVENUE EACH ' +\n 'IN FROM TOTAL CHARGE BLOCK AND OR CSV_FILE RATE_CODE AUXILIARY_DEMAND ' +\n 'UIDACCOUNT RS BILL_PERIOD_SELECT HOURS_PER_MONTH INTD_ERROR_STOP SEASON_SCHEDULE_NAME ' +\n 'ACCOUNTFACTOR ARRAYUPPERBOUND CALLSTOREDPROC GETADOCONNECTION GETCONNECT GETDATASOURCE ' +\n 'GETQUALIFIER GETUSERID HASVALUE LISTCOUNT LISTOP LISTUPDATE LISTVALUE PRORATEFACTOR RSPRORATE ' +\n 'SETBINPATH SETDBMONITOR WQ_OPEN BILLINGHOURS DATE DATEFROMFLOAT DATETIMEFROMSTRING ' +\n 'DATETIMETOSTRING DATETOFLOAT DAY DAYDIFF DAYNAME DBDATETIME HOUR MINUTE MONTH MONTHDIFF ' +\n 'MONTHHOURS MONTHNAME ROUNDDATE SAMEWEEKDAYLASTYEAR SECOND WEEKDAY WEEKDIFF YEAR YEARDAY ' +\n 'YEARSTR COMPSUM HISTCOUNT HISTMAX HISTMIN HISTMINNZ HISTVALUE MAXNRANGE MAXRANGE MINRANGE ' +\n 'COMPIKVA COMPKVA COMPKVARFROMKQKW COMPLF IDATTR FLAG LF2KW LF2KWH MAXKW POWERFACTOR ' +\n 'READING2USAGE AVGSEASON MAXSEASON MONTHLYMERGE SEASONVALUE SUMSEASON ACCTREADDATES ' +\n 'ACCTTABLELOAD CONFIGADD CONFIGGET CREATEOBJECT CREATEREPORT EMAILCLIENT EXPBLKMDMUSAGE ' +\n 'EXPMDMUSAGE EXPORT_USAGE FACTORINEFFECT GETUSERSPECIFIEDSTOP INEFFECT ISHOLIDAY RUNRATE ' +\n 'SAVE_PROFILE SETREPORTTITLE USEREXIT WATFORRUNRATE TO TABLE ACOS ASIN ATAN ATAN2 BITAND CEIL ' +\n 'COS COSECANT COSH COTANGENT DIVQUOT DIVREM EXP FABS FLOOR FMOD FREPM FREXPN LOG LOG10 MAX MAXN ' +\n 'MIN MINNZ MODF POW ROUND ROUND2VALUE ROUNDINT SECANT SIN SINH SQROOT TAN TANH FLOAT2STRING ' +\n 'FLOAT2STRINGNC INSTR LEFT LEN LTRIM MID RIGHT RTRIM STRING STRINGNC TOLOWER TOUPPER TRIM ' +\n 'NUMDAYS READ_DATE STAGING',\n built_in:\n 'IDENTIFIER OPTIONS XML_ELEMENT XML_OP XML_ELEMENT_OF DOMDOCCREATE DOMDOCLOADFILE DOMDOCLOADXML ' +\n 'DOMDOCSAVEFILE DOMDOCGETROOT DOMDOCADDPI DOMNODEGETNAME DOMNODEGETTYPE DOMNODEGETVALUE DOMNODEGETCHILDCT ' +\n 'DOMNODEGETFIRSTCHILD DOMNODEGETSIBLING DOMNODECREATECHILDELEMENT DOMNODESETATTRIBUTE ' +\n 'DOMNODEGETCHILDELEMENTCT DOMNODEGETFIRSTCHILDELEMENT DOMNODEGETSIBLINGELEMENT DOMNODEGETATTRIBUTECT ' +\n 'DOMNODEGETATTRIBUTEI DOMNODEGETATTRIBUTEBYNAME DOMNODEGETBYNAME'\n },\n contains: [\n hljs.C_LINE_COMMENT_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n hljs.C_NUMBER_MODE,\n {\n className: 'literal',\n variants: [\n { // looks like #-comment\n begin: '#\\\\s+',\n relevance: 0\n },\n {\n begin: '#[a-zA-Z .]+'\n }\n ]\n }\n ]\n };\n}", "title": "" }, { "docid": "85a87d3f5bb29b1c9eae68eea7258156", "score": "0.46881533", "text": "function ruleslanguage(hljs) {\n return {\n name: 'Oracle Rules Language',\n keywords: {\n keyword:\n 'BILL_PERIOD BILL_START BILL_STOP RS_EFFECTIVE_START RS_EFFECTIVE_STOP RS_JURIS_CODE RS_OPCO_CODE ' +\n 'INTDADDATTRIBUTE|5 INTDADDVMSG|5 INTDBLOCKOP|5 INTDBLOCKOPNA|5 INTDCLOSE|5 INTDCOUNT|5 ' +\n 'INTDCOUNTSTATUSCODE|5 INTDCREATEMASK|5 INTDCREATEDAYMASK|5 INTDCREATEFACTORMASK|5 ' +\n 'INTDCREATEHANDLE|5 INTDCREATEOVERRIDEDAYMASK|5 INTDCREATEOVERRIDEMASK|5 ' +\n 'INTDCREATESTATUSCODEMASK|5 INTDCREATETOUPERIOD|5 INTDDELETE|5 INTDDIPTEST|5 INTDEXPORT|5 ' +\n 'INTDGETERRORCODE|5 INTDGETERRORMESSAGE|5 INTDISEQUAL|5 INTDJOIN|5 INTDLOAD|5 INTDLOADACTUALCUT|5 ' +\n 'INTDLOADDATES|5 INTDLOADHIST|5 INTDLOADLIST|5 INTDLOADLISTDATES|5 INTDLOADLISTENERGY|5 ' +\n 'INTDLOADLISTHIST|5 INTDLOADRELATEDCHANNEL|5 INTDLOADSP|5 INTDLOADSTAGING|5 INTDLOADUOM|5 ' +\n 'INTDLOADUOMDATES|5 INTDLOADUOMHIST|5 INTDLOADVERSION|5 INTDOPEN|5 INTDREADFIRST|5 INTDREADNEXT|5 ' +\n 'INTDRECCOUNT|5 INTDRELEASE|5 INTDREPLACE|5 INTDROLLAVG|5 INTDROLLPEAK|5 INTDSCALAROP|5 INTDSCALE|5 ' +\n 'INTDSETATTRIBUTE|5 INTDSETDSTPARTICIPANT|5 INTDSETSTRING|5 INTDSETVALUE|5 INTDSETVALUESTATUS|5 ' +\n 'INTDSHIFTSTARTTIME|5 INTDSMOOTH|5 INTDSORT|5 INTDSPIKETEST|5 INTDSUBSET|5 INTDTOU|5 ' +\n 'INTDTOURELEASE|5 INTDTOUVALUE|5 INTDUPDATESTATS|5 INTDVALUE|5 STDEV INTDDELETEEX|5 ' +\n 'INTDLOADEXACTUAL|5 INTDLOADEXCUT|5 INTDLOADEXDATES|5 INTDLOADEX|5 INTDLOADEXRELATEDCHANNEL|5 ' +\n 'INTDSAVEEX|5 MVLOAD|5 MVLOADACCT|5 MVLOADACCTDATES|5 MVLOADACCTHIST|5 MVLOADDATES|5 MVLOADHIST|5 ' +\n 'MVLOADLIST|5 MVLOADLISTDATES|5 MVLOADLISTHIST|5 IF FOR NEXT DONE SELECT END CALL ABORT CLEAR CHANNEL FACTOR LIST NUMBER ' +\n 'OVERRIDE SET WEEK DISTRIBUTIONNODE ELSE WHEN THEN OTHERWISE IENUM CSV INCLUDE LEAVE RIDER SAVE DELETE ' +\n 'NOVALUE SECTION WARN SAVE_UPDATE DETERMINANT LABEL REPORT REVENUE EACH ' +\n 'IN FROM TOTAL CHARGE BLOCK AND OR CSV_FILE RATE_CODE AUXILIARY_DEMAND ' +\n 'UIDACCOUNT RS BILL_PERIOD_SELECT HOURS_PER_MONTH INTD_ERROR_STOP SEASON_SCHEDULE_NAME ' +\n 'ACCOUNTFACTOR ARRAYUPPERBOUND CALLSTOREDPROC GETADOCONNECTION GETCONNECT GETDATASOURCE ' +\n 'GETQUALIFIER GETUSERID HASVALUE LISTCOUNT LISTOP LISTUPDATE LISTVALUE PRORATEFACTOR RSPRORATE ' +\n 'SETBINPATH SETDBMONITOR WQ_OPEN BILLINGHOURS DATE DATEFROMFLOAT DATETIMEFROMSTRING ' +\n 'DATETIMETOSTRING DATETOFLOAT DAY DAYDIFF DAYNAME DBDATETIME HOUR MINUTE MONTH MONTHDIFF ' +\n 'MONTHHOURS MONTHNAME ROUNDDATE SAMEWEEKDAYLASTYEAR SECOND WEEKDAY WEEKDIFF YEAR YEARDAY ' +\n 'YEARSTR COMPSUM HISTCOUNT HISTMAX HISTMIN HISTMINNZ HISTVALUE MAXNRANGE MAXRANGE MINRANGE ' +\n 'COMPIKVA COMPKVA COMPKVARFROMKQKW COMPLF IDATTR FLAG LF2KW LF2KWH MAXKW POWERFACTOR ' +\n 'READING2USAGE AVGSEASON MAXSEASON MONTHLYMERGE SEASONVALUE SUMSEASON ACCTREADDATES ' +\n 'ACCTTABLELOAD CONFIGADD CONFIGGET CREATEOBJECT CREATEREPORT EMAILCLIENT EXPBLKMDMUSAGE ' +\n 'EXPMDMUSAGE EXPORT_USAGE FACTORINEFFECT GETUSERSPECIFIEDSTOP INEFFECT ISHOLIDAY RUNRATE ' +\n 'SAVE_PROFILE SETREPORTTITLE USEREXIT WATFORRUNRATE TO TABLE ACOS ASIN ATAN ATAN2 BITAND CEIL ' +\n 'COS COSECANT COSH COTANGENT DIVQUOT DIVREM EXP FABS FLOOR FMOD FREPM FREXPN LOG LOG10 MAX MAXN ' +\n 'MIN MINNZ MODF POW ROUND ROUND2VALUE ROUNDINT SECANT SIN SINH SQROOT TAN TANH FLOAT2STRING ' +\n 'FLOAT2STRINGNC INSTR LEFT LEN LTRIM MID RIGHT RTRIM STRING STRINGNC TOLOWER TOUPPER TRIM ' +\n 'NUMDAYS READ_DATE STAGING',\n built_in:\n 'IDENTIFIER OPTIONS XML_ELEMENT XML_OP XML_ELEMENT_OF DOMDOCCREATE DOMDOCLOADFILE DOMDOCLOADXML ' +\n 'DOMDOCSAVEFILE DOMDOCGETROOT DOMDOCADDPI DOMNODEGETNAME DOMNODEGETTYPE DOMNODEGETVALUE DOMNODEGETCHILDCT ' +\n 'DOMNODEGETFIRSTCHILD DOMNODEGETSIBLING DOMNODECREATECHILDELEMENT DOMNODESETATTRIBUTE ' +\n 'DOMNODEGETCHILDELEMENTCT DOMNODEGETFIRSTCHILDELEMENT DOMNODEGETSIBLINGELEMENT DOMNODEGETATTRIBUTECT ' +\n 'DOMNODEGETATTRIBUTEI DOMNODEGETATTRIBUTEBYNAME DOMNODEGETBYNAME'\n },\n contains: [\n hljs.C_LINE_COMMENT_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n hljs.C_NUMBER_MODE,\n {\n className: 'literal',\n variants: [\n { // looks like #-comment\n begin: '#\\\\s+',\n relevance: 0\n },\n {\n begin: '#[a-zA-Z .]+'\n }\n ]\n }\n ]\n };\n}", "title": "" }, { "docid": "85a87d3f5bb29b1c9eae68eea7258156", "score": "0.46881533", "text": "function ruleslanguage(hljs) {\n return {\n name: 'Oracle Rules Language',\n keywords: {\n keyword:\n 'BILL_PERIOD BILL_START BILL_STOP RS_EFFECTIVE_START RS_EFFECTIVE_STOP RS_JURIS_CODE RS_OPCO_CODE ' +\n 'INTDADDATTRIBUTE|5 INTDADDVMSG|5 INTDBLOCKOP|5 INTDBLOCKOPNA|5 INTDCLOSE|5 INTDCOUNT|5 ' +\n 'INTDCOUNTSTATUSCODE|5 INTDCREATEMASK|5 INTDCREATEDAYMASK|5 INTDCREATEFACTORMASK|5 ' +\n 'INTDCREATEHANDLE|5 INTDCREATEOVERRIDEDAYMASK|5 INTDCREATEOVERRIDEMASK|5 ' +\n 'INTDCREATESTATUSCODEMASK|5 INTDCREATETOUPERIOD|5 INTDDELETE|5 INTDDIPTEST|5 INTDEXPORT|5 ' +\n 'INTDGETERRORCODE|5 INTDGETERRORMESSAGE|5 INTDISEQUAL|5 INTDJOIN|5 INTDLOAD|5 INTDLOADACTUALCUT|5 ' +\n 'INTDLOADDATES|5 INTDLOADHIST|5 INTDLOADLIST|5 INTDLOADLISTDATES|5 INTDLOADLISTENERGY|5 ' +\n 'INTDLOADLISTHIST|5 INTDLOADRELATEDCHANNEL|5 INTDLOADSP|5 INTDLOADSTAGING|5 INTDLOADUOM|5 ' +\n 'INTDLOADUOMDATES|5 INTDLOADUOMHIST|5 INTDLOADVERSION|5 INTDOPEN|5 INTDREADFIRST|5 INTDREADNEXT|5 ' +\n 'INTDRECCOUNT|5 INTDRELEASE|5 INTDREPLACE|5 INTDROLLAVG|5 INTDROLLPEAK|5 INTDSCALAROP|5 INTDSCALE|5 ' +\n 'INTDSETATTRIBUTE|5 INTDSETDSTPARTICIPANT|5 INTDSETSTRING|5 INTDSETVALUE|5 INTDSETVALUESTATUS|5 ' +\n 'INTDSHIFTSTARTTIME|5 INTDSMOOTH|5 INTDSORT|5 INTDSPIKETEST|5 INTDSUBSET|5 INTDTOU|5 ' +\n 'INTDTOURELEASE|5 INTDTOUVALUE|5 INTDUPDATESTATS|5 INTDVALUE|5 STDEV INTDDELETEEX|5 ' +\n 'INTDLOADEXACTUAL|5 INTDLOADEXCUT|5 INTDLOADEXDATES|5 INTDLOADEX|5 INTDLOADEXRELATEDCHANNEL|5 ' +\n 'INTDSAVEEX|5 MVLOAD|5 MVLOADACCT|5 MVLOADACCTDATES|5 MVLOADACCTHIST|5 MVLOADDATES|5 MVLOADHIST|5 ' +\n 'MVLOADLIST|5 MVLOADLISTDATES|5 MVLOADLISTHIST|5 IF FOR NEXT DONE SELECT END CALL ABORT CLEAR CHANNEL FACTOR LIST NUMBER ' +\n 'OVERRIDE SET WEEK DISTRIBUTIONNODE ELSE WHEN THEN OTHERWISE IENUM CSV INCLUDE LEAVE RIDER SAVE DELETE ' +\n 'NOVALUE SECTION WARN SAVE_UPDATE DETERMINANT LABEL REPORT REVENUE EACH ' +\n 'IN FROM TOTAL CHARGE BLOCK AND OR CSV_FILE RATE_CODE AUXILIARY_DEMAND ' +\n 'UIDACCOUNT RS BILL_PERIOD_SELECT HOURS_PER_MONTH INTD_ERROR_STOP SEASON_SCHEDULE_NAME ' +\n 'ACCOUNTFACTOR ARRAYUPPERBOUND CALLSTOREDPROC GETADOCONNECTION GETCONNECT GETDATASOURCE ' +\n 'GETQUALIFIER GETUSERID HASVALUE LISTCOUNT LISTOP LISTUPDATE LISTVALUE PRORATEFACTOR RSPRORATE ' +\n 'SETBINPATH SETDBMONITOR WQ_OPEN BILLINGHOURS DATE DATEFROMFLOAT DATETIMEFROMSTRING ' +\n 'DATETIMETOSTRING DATETOFLOAT DAY DAYDIFF DAYNAME DBDATETIME HOUR MINUTE MONTH MONTHDIFF ' +\n 'MONTHHOURS MONTHNAME ROUNDDATE SAMEWEEKDAYLASTYEAR SECOND WEEKDAY WEEKDIFF YEAR YEARDAY ' +\n 'YEARSTR COMPSUM HISTCOUNT HISTMAX HISTMIN HISTMINNZ HISTVALUE MAXNRANGE MAXRANGE MINRANGE ' +\n 'COMPIKVA COMPKVA COMPKVARFROMKQKW COMPLF IDATTR FLAG LF2KW LF2KWH MAXKW POWERFACTOR ' +\n 'READING2USAGE AVGSEASON MAXSEASON MONTHLYMERGE SEASONVALUE SUMSEASON ACCTREADDATES ' +\n 'ACCTTABLELOAD CONFIGADD CONFIGGET CREATEOBJECT CREATEREPORT EMAILCLIENT EXPBLKMDMUSAGE ' +\n 'EXPMDMUSAGE EXPORT_USAGE FACTORINEFFECT GETUSERSPECIFIEDSTOP INEFFECT ISHOLIDAY RUNRATE ' +\n 'SAVE_PROFILE SETREPORTTITLE USEREXIT WATFORRUNRATE TO TABLE ACOS ASIN ATAN ATAN2 BITAND CEIL ' +\n 'COS COSECANT COSH COTANGENT DIVQUOT DIVREM EXP FABS FLOOR FMOD FREPM FREXPN LOG LOG10 MAX MAXN ' +\n 'MIN MINNZ MODF POW ROUND ROUND2VALUE ROUNDINT SECANT SIN SINH SQROOT TAN TANH FLOAT2STRING ' +\n 'FLOAT2STRINGNC INSTR LEFT LEN LTRIM MID RIGHT RTRIM STRING STRINGNC TOLOWER TOUPPER TRIM ' +\n 'NUMDAYS READ_DATE STAGING',\n built_in:\n 'IDENTIFIER OPTIONS XML_ELEMENT XML_OP XML_ELEMENT_OF DOMDOCCREATE DOMDOCLOADFILE DOMDOCLOADXML ' +\n 'DOMDOCSAVEFILE DOMDOCGETROOT DOMDOCADDPI DOMNODEGETNAME DOMNODEGETTYPE DOMNODEGETVALUE DOMNODEGETCHILDCT ' +\n 'DOMNODEGETFIRSTCHILD DOMNODEGETSIBLING DOMNODECREATECHILDELEMENT DOMNODESETATTRIBUTE ' +\n 'DOMNODEGETCHILDELEMENTCT DOMNODEGETFIRSTCHILDELEMENT DOMNODEGETSIBLINGELEMENT DOMNODEGETATTRIBUTECT ' +\n 'DOMNODEGETATTRIBUTEI DOMNODEGETATTRIBUTEBYNAME DOMNODEGETBYNAME'\n },\n contains: [\n hljs.C_LINE_COMMENT_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n hljs.C_NUMBER_MODE,\n {\n className: 'literal',\n variants: [\n { // looks like #-comment\n begin: '#\\\\s+',\n relevance: 0\n },\n {\n begin: '#[a-zA-Z .]+'\n }\n ]\n }\n ]\n };\n}", "title": "" }, { "docid": "f11817c79537f31763b90f3ea4fc3fe6", "score": "0.4687651", "text": "function _walk (rule, shapeLabelsSeen, howWeGotHere) {\n function _dive (into) {\n // Avoid recursion:\n if (shapeLabelsSeen.indexOf(into) === -1) {\n shapeLabelsSeen.map(function (p) {\n if (uses[p] === undefined)\n uses[p] = [];\n uses[p].push(into);\n });\n var next = Schema.ruleMap[into];\n if (next === undefined) {\n if (looseEnds[into] === undefined)\n looseEnds[into] = { p:[] };\n var p = shapeLabelsSeen[shapeLabelsSeen.length-1];\n if (looseEnds[into][p] === undefined)\n looseEnds[into][p] = [];\n // looseEnds[into][p].push(rule.toString());\n looseEnds[into][p].push(howWeGotHere.concat(rule).map(function (r) { return r.toString(); }).join('/'));\n } else {\n shapeLabelsSeen.push(into);\n _walk(next, shapeLabelsSeen, howWeGotHere.concat([rule]));\n shapeLabelsSeen.pop();\n }\n }\n };\n switch (rule._) {\n case \"AtomicRule\":\n if (rule.valueClass._== \"ShapeReference\")\n _dive(rule.valueClass.label.toString());\n break;\n case \"UnaryRule\":\n _walk(rule.rule, shapeLabelsSeen, howWeGotHere);\n break;\n case \"IncludeRule\":\n _dive(rule.include.toString());\n break;\n case \"EmptyRule\":\n break;\n case \"AndRule\":\n for (var conj = 0; conj < rule.conjoints.length; ++conj)\n _walk(rule.conjoints[conj], shapeLabelsSeen, howWeGotHere);\n break;\n case \"OrRule\":\n for (var disj = 0; disj < rule.disjoints.length; ++disj)\n _walk(rule.disjoints[disj], shapeLabelsSeen, howWeGotHere);\n break;\n default: throw \"what's a \\\"\" + rule._ + \"\\\"?\"\n }\n }", "title": "" }, { "docid": "293e02ad378d98afa0f9dc4c2719a4e2", "score": "0.4680627", "text": "function compile(rules) {\n console.log(`COMPILING ${ Object.keys(rules).length } RULES...`);\n let compiled = rules[0];\n compiled; //?\n\n let rulesSeen = new Set();\n\n do {\n let match = /\\d+/.exec(compiled);\n console.log(match);\n \n if (!match)\n break;\n \n let ruleNum = parseInt(match);\n console.log(ruleNum);\n rulesSeen.add(ruleNum);\n\n let subRule = rules[ruleNum];\n if (subRule.includes('|'))\n subRule = ['(?:',')'].join(subRule);\n \n compiled = \n compiled.slice(0, match.index) +\n subRule +\n compiled.slice(match.index + match[0].length);\n \n console.log(`Rules Seen: ${ rulesSeen.size }`);\n } while (true);\n\n // Remove Spaces\n compiled = compiled.split(' ').join(''); //?\n // Ensure we're checking WHOLE message:\n compiled = `^${ compiled }$`; //?\n return new RegExp(compiled);\n}", "title": "" }, { "docid": "9bd958b47931f8de226a8fc5a4224417", "score": "0.46797323", "text": "group (decl) {\n let rule = decl.parent\n let index = rule.index(decl)\n let { length } = rule.nodes\n let unprefixed = this.unprefixed(decl.prop)\n\n let checker = (step, callback) => {\n index += step\n while (index >= 0 && index < length) {\n let other = rule.nodes[index]\n if (other.type === 'decl') {\n if (step === -1 && other.prop === unprefixed) {\n if (!Browsers.withPrefix(other.value)) {\n break\n }\n }\n\n if (this.unprefixed(other.prop) !== unprefixed) {\n break\n } else if (callback(other) === true) {\n return true\n }\n\n if (step === +1 && other.prop === unprefixed) {\n if (!Browsers.withPrefix(other.value)) {\n break\n }\n }\n }\n\n index += step\n }\n return false\n }\n\n return {\n up (callback) {\n return checker(-1, callback)\n },\n down (callback) {\n return checker(+1, callback)\n }\n }\n }", "title": "" }, { "docid": "d14cbf50a7bc3e65f43d604b694dcb19", "score": "0.46639448", "text": "add(rule, prefix) {\n let prefixeds = this.prefixeds(rule)\n\n if (this.already(rule, prefixeds, prefix)) {\n return\n }\n\n let cloned = this.clone(rule, { selector: prefixeds[this.name][prefix] })\n rule.parent.insertBefore(rule, cloned)\n }", "title": "" }, { "docid": "479eb31dec8c04a77a8a9a185c5a4c10", "score": "0.46611142", "text": "function Rules (options) {\n this.options = options;\n this._keep = [];\n this._remove = [];\n\n this.blankRule = {\n replacement: options.blankReplacement\n };\n\n this.keepReplacement = options.keepReplacement;\n\n this.defaultRule = {\n replacement: options.defaultReplacement\n };\n\n this.array = [];\n for (var key in options.rules) this.array.push(options.rules[key]);\n}", "title": "" }, { "docid": "479eb31dec8c04a77a8a9a185c5a4c10", "score": "0.46611142", "text": "function Rules (options) {\n this.options = options;\n this._keep = [];\n this._remove = [];\n\n this.blankRule = {\n replacement: options.blankReplacement\n };\n\n this.keepReplacement = options.keepReplacement;\n\n this.defaultRule = {\n replacement: options.defaultReplacement\n };\n\n this.array = [];\n for (var key in options.rules) this.array.push(options.rules[key]);\n}", "title": "" } ]
8e21cb66337a6b91b778b55f99b86973
Constructor should define this.numComps, this.defaultColor, this.name
[ { "docid": "8540b37edff0eb9df32f568dc8a23682", "score": "0.0", "text": "function ColorSpace() {\n error('should not call ColorSpace constructor');\n }", "title": "" } ]
[ { "docid": "e9caf0ada2efd89eaa2b071214b88d45", "score": "0.70134425", "text": "constructor(color, name){\n // color is coming from parent class.\n super(color);\n \n this.name = name;\n }", "title": "" }, { "docid": "e85c94031d91e81b99895b5bca89302b", "score": "0.69998497", "text": "constructor(name, color = \"white\") {\n this.name = name\n this.color = color\n }", "title": "" }, { "docid": "a80362316d8b0a136e6c375eda6cfeac", "score": "0.6955719", "text": "constructor(baseColor){\n this.baseColor = color(0);\n this.useBase = false;\n this.compoundColors = [];\n\n if(baseColor !== undefined){\n this.baseColor = baseColor;\n this.useBase = true;\n }\n }", "title": "" }, { "docid": "e6a0e43db8912e815367cea89c1966d2", "score": "0.68835866", "text": "constructor (color, size, name, temp) {\n this.color = color;\n this.size = size;\n this.name = name;\n this.temp = temp;\n }", "title": "" }, { "docid": "00655d749cc9201f8ff0ae4f959a8a37", "score": "0.6833644", "text": "constructor() {\n\n super({color1: 0xf6f6f6, color2: 0x282828})\n }", "title": "" }, { "docid": "49b1bee165676b2915be2de47bf713c1", "score": "0.6831713", "text": "constructor(number, color) {\n this._number = number;\n this._color = color;\n this.used = false;\n this.dealt = false;\n }", "title": "" }, { "docid": "7b28b99b6ddf66b38f054acb5ec9bd2f", "score": "0.66532487", "text": "constructor(name, color, wheels) {\n super(wheels);\n this._name = name;\n this._color = color;\n }", "title": "" }, { "docid": "4a648684ebce4c8594a5f3a5d0ecc783", "score": "0.65939254", "text": "constructor(red, green, blue, alpha = 1) {\n this.red = red;\n this.green = green;\n this.blue = blue;\n this.alpha = alpha;\n }", "title": "" }, { "docid": "995ceca7b7765beacb11747870bbfdd8", "score": "0.6564889", "text": "constructor(color, fuelType) {\n this.color = color;\n this.fuelType = fuelType;\n }", "title": "" }, { "docid": "2490d09add8043580e2272eeca61cc34", "score": "0.65640384", "text": "function Component() {\n\tthis.active = true;\n\tthis.type = 0; \n\t//this.color = \"black\";\n}", "title": "" }, { "docid": "17bf24bfb584c5d6447e5ff5132ba878", "score": "0.6498958", "text": "constructor(name, color) {\n console.log('Se ejecutró el metodo constructor');\n \n // this.atributo = valor;\n this.ojos = 2;\n this.cola = true;\n this.patas = 4;\n this.nombre = name;\n this.color = color;\n }", "title": "" }, { "docid": "7318c15503ea995a3e30114110f66ce9", "score": "0.64731663", "text": "constructor(color, type) \n {\n this.color = color;\n this.type = type;\n }", "title": "" }, { "docid": "5e6443941ad2bc4f45d861b81dd3778c", "score": "0.64681137", "text": "constructor(r=0, g=0, b=0){\n this.r=0;\n this.g=0;\n this.b=0;\n this.setColor(r,g,b)\n }", "title": "" }, { "docid": "3ed8558c63e38747bf316815aa2c6920", "score": "0.6427637", "text": "constructor(width, height,color){\n this.width = width || 1;\n this.height = height || 1;\n this.color = color || 'white';\n }", "title": "" }, { "docid": "3cef23ddf5ea5c5cbabfa0f1820fa89d", "score": "0.6425416", "text": "constructor(width, height,color){\n this.width = width;\n this.height = height;\n this.color = color;\n }", "title": "" }, { "docid": "ca928d2d884ac7a0eda67b42df9f6d09", "score": "0.64178324", "text": "constructor(width, height,color){\n [this.width, this.height, this.color] = [width,height,color];\n }", "title": "" }, { "docid": "c007e0c86c75d487f1c95e4d799beb07", "score": "0.639171", "text": "function colorObj() {\n this.name;\n this.rgb;\n this.hex;\n this.textColor;\n this.taken;\n this.rgba = function (op) {\n\treturn 'rgba('+this.rgb+','+op+')';\n }\n\n\n}", "title": "" }, { "docid": "4d0d909caea2d573f1a0508105e65a22", "score": "0.6377177", "text": "constructor(props) {\n super(props);\n this.state = {\n color : choice(this.props.colors)\n }\n this.genColor = this.genColor.bind(this);\n }", "title": "" }, { "docid": "bd030c8650c8024d5939cee78b16e419", "score": "0.63520575", "text": "function color(name, hex){\n this.name = name || \"color\";\n this.hex = hex || \"#FFF\";\n}", "title": "" }, { "docid": "7b75a1197cd7faf55356fe37e976eca6", "score": "0.6332765", "text": "constructor (options){\n options=options || {};\n this.name=options.name;\n this.color=options.color;\n this.weight=options.weight;\n this.height=options.height;\n this.legs=options.legs;\n }", "title": "" }, { "docid": "f10002ec414c8ab05f6016cab815f607", "score": "0.6329392", "text": "constructor(width=1, height=1,color=\"white\"){\n this.width = width;\n this.height = height;\n this.color = color;\n }", "title": "" }, { "docid": "e452e1652a609fdaecb19a7cbc915554", "score": "0.62832415", "text": "constructor(color, interval, isPenDown, mode, name, points, x) {\n this.color = color;\n this.interval = interval;\n this.isPenDown = isPenDown;\n this.mode = mode;\n this.name = name;\n this.points = points;\n this.x = x;\n }", "title": "" }, { "docid": "60c7e52b1b6cd8e93e124270939dd4ef", "score": "0.62820816", "text": "init() {\n this.colour = new Colour('colors');\n }", "title": "" }, { "docid": "7d6a73a98e1d287de52e9cee1ccf975e", "score": "0.6280577", "text": "constructor(name, cost) {\n this.name = name;\n this.cost = cost;\n\n // Derive from this.cost\n this.colorIdentity = color;\n this.cmc = cmc;\n }", "title": "" }, { "docid": "9d2f5f484e3474aa52f59d387b53bc8c", "score": "0.6230385", "text": "constructor() {\n\t\tthis.options = {\n\t\t\tcolormap: 'greys',\n\t\t\tnshades: 72,\n\t\t\tformat: 'hex',\n\t\t\talpha: 1\n\t\t}\n\t\tthis.colormap = colormap(this.options);\n\t\tthis.options.format = 'rgb';\n\t\tthis.colormapRGB = colormap(this.options);\n\t}", "title": "" }, { "docid": "38cf7caf8627830475b816ad8c5a0638", "score": "0.6208461", "text": "init() {\n\t\tinit(this.id(), this.color());\n\t}", "title": "" }, { "docid": "2e22fffd344ca59a2de8d1b85344fe2f", "score": "0.6203717", "text": "constructor(color) {\n this.color = color\n this.subscriptions = []\n }", "title": "" }, { "docid": "9242b7d7732270e226712e7821550bfa", "score": "0.6185306", "text": "constructor( r, g, b, name ) {\n // this is the property we are adding to the object\n this.r = r; \n this.g = g; \n this.b = b;\n this.name = name;\n this.calcHSL();\n }", "title": "" }, { "docid": "17473550da972b56c94c9997eb60f9b2", "score": "0.6152026", "text": "function Color(hexa, nickname, name, red, green, blue){\n this.hexa = hexa;\n this.nickname = nickname;\n this.name = name;\n this.red = red;\n this.green = green;\n this.blue = blue; \n }", "title": "" }, { "docid": "d6aea15fb89b2c7e534a450d6354f5ad", "score": "0.61379653", "text": "constructor(props) {\n super(props);\n this.state = {\n colorR: 0,\n colorB: 0,\n colorG: 0,\n colorString: \"#000000\",\n reverse: false\n }\n }", "title": "" }, { "docid": "c62e3b4e91c49c273df5e51ef0aaf94e", "score": "0.61059594", "text": "constructor(xC, yC, w, h, n, c1){\n this.xC = Math.abs(xC + w/2);\n this.yC = Math.abs(yC + h/2);\n this.w = w;\n this.h = h;\n this.n = n;\n this.fillColour = c1;\n }", "title": "" }, { "docid": "137dfe2975b73a3333527be433fee733", "score": "0.6090458", "text": "constructor(radius, color){\n this.radius = radius\n this.color = color\n }", "title": "" }, { "docid": "ea802f93ba24dbc8f15615fe508a1b7e", "score": "0.6085806", "text": "constructor(gameName, board, color) {\n this.gameName = gameName;\n this.board = board;\n this.turnPosition = null;\n this.color = color;\n this.name = null;\n this.resources = [5, 5, 5, 5, 6] // Brick, wood, wheat, sheep, stone\n this.victoryPoints = 0;\n }", "title": "" }, { "docid": "a6c44324661ac961ce85164a1871ef18", "score": "0.60849446", "text": "constructor(r, color, ant, vue, yeu ){\n this.race = r;\n this.couleur = color;\n this.bras = 2;\n this.jambe = 2;\n this.tete = 1;\n this.antenne = ant;\n this.vueMetre = vue;\n this.yeux = yeu;\n}", "title": "" }, { "docid": "418dce4ef9f4b93b0c92d4085abd76b1", "score": "0.6072473", "text": "constructor(color,tamano,peso){\n console.log(\"Perro creado\")\n console.log(\"El color es:\"+color)\n }", "title": "" }, { "docid": "a25c99b58879967fe3b3e31d1a356dbc", "score": "0.6054585", "text": "constructor() {\r\n this.toggles = new Object()\r\n this.colorPickers = [] \r\n }", "title": "" }, { "docid": "1f7c9b2be04745d4f2ff6b04d079a8f2", "score": "0.6037659", "text": "constructor(xC, yC, w, h, n, c1){\n //Math.abs is the absolute value - so it can always be positive\n this.xC = Math.abs(xC + w/2);\n this.yC = Math.abs(yC + h/2);\n this.w = w;\n this.h = h;\n this.n = n;\n this.fillcolour = c1;\n }", "title": "" }, { "docid": "f20b113f714f6ae47a7d365f9d004676", "score": "0.60358834", "text": "function Color() {\n // Private variables\n var _rgb = null;\n var _lab = null;\n var _hsl = null;\n var _this = this;\n\n // Public methods\n /**\n * Set the Color's RGB values\n * @param r red value in range 0-1\n * @param g green value in range 0-1\n * @param b blue value in range 0-1\n */\n this.setRgb = function(r, g, b) {\n if (r < 0.0 || r > 1.0 || g < 0.0 || g > 1.0 || b < 0.0 || b > 1.0) {\n console.log(\"r: \", r, \" g: \", g, \" b: \", b);\n throw new Exception(\"Inputted values must be in range 0-1 (inclusive)\"); // TODO: Give erroneous values\n } else {\n _rgb = {\n r: r,\n g: g,\n b: b\n };\n this.rgbToLab(); // Also calculate CIE-Lab and HSL equivalents\n rgbToHsl();\n }\n };\n\n this.setLab = function(l, a, b) {\n if (l < 0.0 || l > 100.0 || a < -128.0 || a > 127.0 || b < -128.0 || b > 127.0) {\n throw new Exception(\"Inputted values outside accepted ranges\"); // TODO: Give erroneous values\n } else {\n _lab = {\n l: l,\n a: a,\n b: b\n };\n this.labToRgb(); // Also calculate RGB and HSL equivalents\n rgbToHsl();\n }\n };\n\n this.setHsl = function(h, s, l) {\n if (h < 0.0 || h > 1.0 || s < 0.0 || s > 1.0 || l < 0.0 || l > 1.0) {\n throw new Exception(\"Inputted values outside accepted ranges\"); // TODO: Give erroneous values\n } else {\n _hsl = {\n h: h,\n s: s,\n l: l\n };\n }\n };\n\n this.getRgb = function() {\n return _rgb;\n };\n\n this.getLab = function() {\n return _lab;\n };\n\n /**\n * Used only in testing\n */\n this.getHsl = function() {\n return _hsl\n };\n\n /**\n * Convert an array of Color objects from the input bits to output bits (e.g. 24-bit to 16-bit color)\n * TODO: Add paramters\n * TODO: Save quantised colours\n *\n * @returns {Array} The converted input Color objects\n */\n this.quantiseRgb = function() {\n return {\n r: Math.round((_rgb.r * 255) / 17) / 15,\n g: Math.round((_rgb.g * 255) / 17) / 15,\n b: Math.round((_rgb.b * 255) / 17) / 15\n }\n };\n\n this.quantiseLab = function() {\n return {\n l: Math.round((_lab.l) / 10) * 10,\n a: Math.round((_lab.a) / 17) * 15,\n b: Math.round((_lab.b) / 17) * 15\n }\n };\n\n this.changeBrightness = function(adjustment) {\n rgbToHsl();\n _hsl.l += 0.1 * adjustment;\n if (_hsl.l < 0) {\n _hsl.l = 0;\n } else if (_hsl.l > 1) {\n _hsl.l = 1;\n }\n hslToRgb();\n };\n\n this.changeContrast = function(adjustment) {\n var C = adjustment * (255/10); // C in range -255 to 255\n var factor = (259 * (C + 255)) / (255 * (259 - C));\n\n var newR = (factor * ((_rgb.r * 255) - 128) + 128) / 255;\n var newG = (factor * ((_rgb.g * 255) - 128) + 128) / 255;\n var newB = (factor * ((_rgb.b * 255) - 128) + 128) / 255;\n\n if (newR < 0.0) {\n newR = 0;\n }\n if (newR > 1.0) {\n newR = 1;\n }\n\n if (newG < 0.0) {\n newG = 0;\n }\n if (newG > 1.0) {\n newG = 1;\n }\n\n if (newB < 0.0) {\n newB = 0;\n }\n if (newB > 1.0) {\n newB = 1;\n }\n\n this.setRgb(newR, newG, newB);\n };\n\n this.changeSaturation = function(adjustment) {\n rgbToHsl();\n _hsl.s += 0.1 * adjustment; // S ranges between 0 and 1\n if (_hsl.s < 0) {\n _hsl.s = 0;\n } else if (_hsl.s > 1) {\n _hsl.s = 1;\n }\n hslToRgb();\n };\n\n this.rgbToLab = function() {\n // First convert sRGB to CIE-XYZ\n // Original formula converts from 0-255 to 0-1 range, but my values are already there\n var varR = _rgbToXyzHelper(_rgb.r) * 100;\n var varG = _rgbToXyzHelper(_rgb.g) * 100;\n var varB = _rgbToXyzHelper(_rgb.b) * 100;\n\n var xyz = {\n X: (varR * 0.4124) + (varG * 0.3576) + (varB * 0.1805),\n Y: (varR * 0.2126) + (varG * 0.7152) + (varB * 0.0722),\n Z: (varR * 0.0193) + (varG * 0.1192) + (varB * 0.9505)\n };\n\n // Then convert CIE-XYZ to CIE-Lab\n var varX = _xyzToLabHelper(xyz.X / 95.047);\n var varY = _xyzToLabHelper(xyz.Y / 100.000);\n var varZ = _xyzToLabHelper(xyz.Z / 108.883);\n\n //this.setLab((116 * varY) - 16, // This seems to be too slow?!?\n // 500 * (varX - varY),\n // 200 * (varY - varZ));\n _lab = {\n l: (116 * varY) - 16,\n a: 500 * (varX - varY),\n b: 200 * (varY - varZ)\n };\n };\n\n this.labToRgb = function() {\n // First convert from CIE-L*a*b* to CIE-XYZ\n var varY = (_lab.l + 16) / 116;\n var varX = _lab.a / 500 + varY;\n var varZ = varY - _lab.b / 200;\n\n var xyz = {\n X: 95.047 * _labToXyzHelper(varX),\n Y: 100.000 * _labToXyzHelper(varY),\n Z: 108.883 * _labToXyzHelper(varZ)\n };\n\n // Then convert from CIE-XYZ to sRGB\n var varX1 = xyz.X / 100;\n var varY1 = xyz.Y / 100;\n var varZ1 = xyz.Z / 100;\n\n var varR = varX1*3.2406 + varY1*-1.5372 + varZ1*-0.4986;\n var varG = varX1*-0.9689 + varY1*1.8758 + varZ1*0.0415;\n var varB = varX1*0.0557 + varY1*-0.2040 + varZ1*1.0570;\n\n // TODO: Clip proportionally, maintaining RGB ratio\n if (varR < 0) {\n varR = 0;\n }\n if (varR > 1) {\n varR = 1;\n }\n if (varG < 0) {\n varG = 0;\n }\n if (varG > 1) {\n varG = 1;\n }\n if (varB < 0) {\n varB = 0;\n }\n if (varB > 1) {\n varB = 1;\n }\n // Original formula then converts to 0-255 range but I keep it in 0-1 range\n _rgb = {\n r: _xyzTosRgbHelper(varR),\n g: _xyzTosRgbHelper(varG),\n b: _xyzTosRgbHelper(varB)\n };\n //this.setRgb(_xyzTosRgbHelper(varR), _xyzTosRgbHelper(varG), _xyzTosRgbHelper(varB));\n };\n\n var rgbToHsl = function() {\n var min = Math.min(_rgb.r, _rgb.g, _rgb.b);\n var max = Math.max(_rgb.r, _rgb.g, _rgb.b);\n var delta = max - min;\n\n var h, s;\n var l = (max + min) / 2;\n\n if (delta == 0) {\n h = 0;\n s = 0;\n } else {\n if (l < 0.5) {\n s = delta / (max + min);\n } else {\n s = delta / (2 - max - min)\n }\n\n var deltaR = (((max - _rgb.r) / 6) + (delta / 2)) / delta;\n var deltaG = (((max - _rgb.g) / 6) + (delta / 2)) / delta;\n var deltaB = (((max - _rgb.b) / 6) + (delta / 2)) / delta;\n\n if (_rgb.r == max) {\n h = deltaB - deltaG;\n } else if (_rgb.g == max) {\n h = (1/3) + deltaR - deltaB;\n } else if (_rgb.b == max) {\n h = (2/3) + deltaG - deltaR;\n }\n\n // Periodic\n if (h < 0) {\n h += 1;\n }\n if (h > 1) {\n h -= 1;\n }\n }\n\n _this.setHsl(h, s, l);\n };\n\n var hslToRgb = function() {\n var v1, v2;\n var r, g, b;\n\n if (_hsl.s == 0) {\n r = _hsl.l;\n g = _hsl.l;\n b = _hsl.l;\n } else {\n if (_hsl.l < 0.5) {\n v2 = _hsl.l * (1 + _hsl.s);\n } else {\n v2 = (_hsl.l + _hsl.s) - (_hsl.s * _hsl.l);\n }\n\n v1 = (2 * _hsl.l) - v2;\n\n r = hslToRgbHelper(v1, v2, _hsl.h + (1/3));\n g = hslToRgbHelper(v1, v2, _hsl.h);\n b = hslToRgbHelper(v1, v2, _hsl.h - (1/3));\n }\n\n if (r > 1) {\n r = 1;\n } else if (r < 0) {\n r = 0;\n }\n if (g > 1) {\n g = 1;\n } else if (g < 0) {\n g = 0;\n }\n if (b > 1) {\n b = 1;\n } else if (b < 0) {\n b = 0;\n }\n _this.setRgb(r, g, b);\n };\n\n // Private methods\n var _rgbToXyzHelper = function(channel) {\n if (channel > 0.04045) {\n channel = Math.pow((channel + 0.055) / 1.055, 2.4)\n } else {\n channel = channel / 12.92\n }\n return channel\n };\n\n var _xyzToLabHelper = function(channel) {\n if (channel > 0.00856) {\n return Math.pow(channel, 1/3);\n } else {\n return (7.787 * channel) + (16/116);\n }\n };\n\n var _labToXyzHelper = function(channel) {\n if (Math.pow(channel, 3) > 0.008856) {\n return Math.pow(channel, 3);\n } else {\n return (channel - 16 / 116) / 7.787;\n }\n };\n\n var _xyzTosRgbHelper = function(channel) {\n if (channel > 0.0031308) {\n return 1.055 * Math.pow(channel, 1/2.4) - 0.055;\n } else {\n return 12.92 * channel;\n }\n };\n\n var hslToRgbHelper = function(v1, v2, vH) {\n if (vH < 0) {\n vH +=1;\n }\n if (vH > 1) {\n vH -= 1;\n }\n\n if ((6 * vH) < 1) {\n return v1 + (v2 - v1) * 6 * vH;\n } else if ((2 * vH) < 1) {\n return v2;\n } else if ((3 * vH) < 2) {\n return v1 + (v2 - v1) * 6 * ((2/3) - vH);\n } else {\n return v1;\n }\n };\n\n this.clone = function() {\n var newColor = new Color();\n newColor.setRgb(_rgb.r, _rgb.g, _rgb.b);\n return newColor;\n };\n}", "title": "" }, { "docid": "2acb64286f2bb235eb3907f622fc3a91", "score": "0.6033025", "text": "function Color(hexa, nickname, name, red, green, blue){\n this.hexa = hexa;\n this.nickname = nickname;\n this.name = name;\n this.red = red;\n this.green = green;\n this.blue = blue; \n }", "title": "" }, { "docid": "164cb9a32da027f52f337b7ab433ef4b", "score": "0.60328615", "text": "function Colorer (cursor, base) {\n this.current = null\n this.cursor = cursor\n this.base = base\n}", "title": "" }, { "docid": "164cb9a32da027f52f337b7ab433ef4b", "score": "0.60328615", "text": "function Colorer (cursor, base) {\n this.current = null\n this.cursor = cursor\n this.base = base\n}", "title": "" }, { "docid": "164cb9a32da027f52f337b7ab433ef4b", "score": "0.60328615", "text": "function Colorer (cursor, base) {\n this.current = null\n this.cursor = cursor\n this.base = base\n}", "title": "" }, { "docid": "514c2510156b055365f8b3079b7fec7f", "score": "0.60243815", "text": "function BlueDiv(color){} // function creates class definition", "title": "" }, { "docid": "6949db74928fd1cbcdd01fe69e09f2a2", "score": "0.5987", "text": "function Color (color) {\n\tthis.color = color;\n\tthis.similar = [];\n\tthis.duplicates = [];\n\tthis.primary = true;\n}", "title": "" }, { "docid": "4da64b5849ba741a1e96a61cd67498c1", "score": "0.5982771", "text": "constructor(name, x,y, r, f, s, fc, sc, sw){\r\n this.name = name;\r\n this.x= x;\r\n this.y=y;\r\n this.r=r;\r\n this.f=f;\r\n this.s=s;\r\n this.fc = fc;\r\n this.sc=sc;\r\n this.sw= sw;\r\n this.count=0;\r\n }", "title": "" }, { "docid": "00c4871af771128b7a65277a4dec1f9b", "score": "0.59675777", "text": "constructor( availableColorsArray, currentColorIndexNumber, domElementClassString ){\n\t\tthis.availableColors = availableColorsArray;\n\t\tthis.domElementClass = domElementClassString;\n\t\tthis.currentColorIndex = currentColorIndexNumber;\n\t\tthis.domElement;\n\t\tthis.domNeighbor = null;\n\t\tthis.handleClick = this.handleClick.bind( this );\n\n\t}", "title": "" }, { "docid": "f6e47ae58e4642cb34ded8feeaadbb1a", "score": "0.5967085", "text": "function Color()\n{\n var colors = {\n\t\"white\":\"#FFFFFF\",\n\t\"silver\":\"#C0C0C0\",\n\t\"gray\":\"#808080\",\n\t\"black\":\"#000000\",\n\t\"red\":\"#FF0000\",\n\t\"maroon\":\"#800000\",\n\t\"yellow\":\"#FFFF00\",\n\t\"lime\":\"#00FF00\",\n\t\"green\":\"#00FF00\",\n\t\"aqua\":\"#00FFFF\",\n\t\"teal\":\"#008080\",\n\t\"blue\":\"#0000FF\",\n\t\"navy\":\"#000080\",\n\t\"purple\":\"#800080\",\n\t\"violet\":\"#8F00FF\",\n\t\"indigo\":\"#4B0082\",\n\t\"orange\":\"#FF7F00\",\n\t\"pink\":\"#F660AB\",\n }\n //In case RGB values entered seperately, in decimal form\n var r = Math.round(arguments[0]);\n var g = Math.round(arguments[1]);\n var b = Math.round(arguments[2]);\n var colorCodePattern = /^#[ABCDEF0-9]{6}$/;\n if(typeof arguments[0]===\"string\" && arguments[0].toLowerCase() in colors)\n {\n\targuments[0] = colors[arguments[0]];\n }\n if(typeof arguments[0]===\"string\" && arguments[0].charAt(0)===\"#\" &&\n arguments[0].length==7 && arguments[0].match(colorCodePattern))\n {\n\tthis.red = hexToDec(arguments[0].substr(1,3).toUpperCase());\n\tthis.green = hexToDec(arguments[0].substr(3,5).toUpperCase());\n\tthis.blue = hexToDec(arguments[0].substr(5).toUpperCase());\n\treturn;\n }\n else if(typeof r===\"number\" && typeof g===\"number\" &&\n\t typeof g===\"number\" && Math.min(r,g,b)>=0 && Math.max(r,g,b)<=255)\n {\n\tthis.red = r;\n\tthis.green = g;\n\tthis.blue = b;\n }\n else { this.red=0; this.green=0; this.blue=0; }\n}", "title": "" }, { "docid": "9d2bbb2234ac4025c6c491c301ebe25a", "score": "0.59663963", "text": "function RGBColor(a) {\r\n this.ok = !1;\r\n \"#\" == a.charAt(0) && (a = a.substr(1, 6));\r\n a = a.replace(/ /g, \"\");\r\n a = a.toLowerCase();\r\n var b = {\r\n aliceblue: \"f0f8ff\",\r\n antiquewhite: \"faebd7\",\r\n aqua: \"00ffff\",\r\n aquamarine: \"7fffd4\",\r\n azure: \"f0ffff\",\r\n beige: \"f5f5dc\",\r\n bisque: \"ffe4c4\",\r\n black: \"000000\",\r\n blanchedalmond: \"ffebcd\",\r\n blue: \"0000ff\",\r\n blueviolet: \"8a2be2\",\r\n brown: \"a52a2a\",\r\n burlywood: \"deb887\",\r\n cadetblue: \"5f9ea0\",\r\n chartreuse: \"7fff00\",\r\n chocolate: \"d2691e\",\r\n coral: \"ff7f50\",\r\n cornflowerblue: \"6495ed\",\r\n cornsilk: \"fff8dc\",\r\n crimson: \"dc143c\",\r\n cyan: \"00ffff\",\r\n darkblue: \"00008b\",\r\n darkcyan: \"008b8b\",\r\n darkgoldenrod: \"b8860b\",\r\n darkgray: \"a9a9a9\",\r\n darkgreen: \"006400\",\r\n darkkhaki: \"bdb76b\",\r\n darkmagenta: \"8b008b\",\r\n darkolivegreen: \"556b2f\",\r\n darkorange: \"ff8c00\",\r\n darkorchid: \"9932cc\",\r\n darkred: \"8b0000\",\r\n darksalmon: \"e9967a\",\r\n darkseagreen: \"8fbc8f\",\r\n darkslateblue: \"483d8b\",\r\n darkslategray: \"2f4f4f\",\r\n darkturquoise: \"00ced1\",\r\n darkviolet: \"9400d3\",\r\n deeppink: \"ff1493\",\r\n deepskyblue: \"00bfff\",\r\n dimgray: \"696969\",\r\n dodgerblue: \"1e90ff\",\r\n feldspar: \"d19275\",\r\n firebrick: \"b22222\",\r\n floralwhite: \"fffaf0\",\r\n forestgreen: \"228b22\",\r\n fuchsia: \"ff00ff\",\r\n gainsboro: \"dcdcdc\",\r\n ghostwhite: \"f8f8ff\",\r\n gold: \"ffd700\",\r\n goldenrod: \"daa520\",\r\n gray: \"808080\",\r\n green: \"008000\",\r\n greenyellow: \"adff2f\",\r\n honeydew: \"f0fff0\",\r\n hotpink: \"ff69b4\",\r\n indianred: \"cd5c5c\",\r\n indigo: \"4b0082\",\r\n ivory: \"fffff0\",\r\n khaki: \"f0e68c\",\r\n lavender: \"e6e6fa\",\r\n lavenderblush: \"fff0f5\",\r\n lawngreen: \"7cfc00\",\r\n lemonchiffon: \"fffacd\",\r\n lightblue: \"add8e6\",\r\n lightcoral: \"f08080\",\r\n lightcyan: \"e0ffff\",\r\n lightgoldenrodyellow: \"fafad2\",\r\n lightgrey: \"d3d3d3\",\r\n lightgreen: \"90ee90\",\r\n lightpink: \"ffb6c1\",\r\n lightsalmon: \"ffa07a\",\r\n lightseagreen: \"20b2aa\",\r\n lightskyblue: \"87cefa\",\r\n lightslateblue: \"8470ff\",\r\n lightslategray: \"778899\",\r\n lightsteelblue: \"b0c4de\",\r\n lightyellow: \"ffffe0\",\r\n lime: \"00ff00\",\r\n limegreen: \"32cd32\",\r\n linen: \"faf0e6\",\r\n magenta: \"ff00ff\",\r\n maroon: \"800000\",\r\n mediumaquamarine: \"66cdaa\",\r\n mediumblue: \"0000cd\",\r\n mediumorchid: \"ba55d3\",\r\n mediumpurple: \"9370d8\",\r\n mediumseagreen: \"3cb371\",\r\n mediumslateblue: \"7b68ee\",\r\n mediumspringgreen: \"00fa9a\",\r\n mediumturquoise: \"48d1cc\",\r\n mediumvioletred: \"c71585\",\r\n midnightblue: \"191970\",\r\n mintcream: \"f5fffa\",\r\n mistyrose: \"ffe4e1\",\r\n moccasin: \"ffe4b5\",\r\n navajowhite: \"ffdead\",\r\n navy: \"000080\",\r\n oldlace: \"fdf5e6\",\r\n olive: \"808000\",\r\n olivedrab: \"6b8e23\",\r\n orange: \"ffa500\",\r\n orangered: \"ff4500\",\r\n orchid: \"da70d6\",\r\n palegoldenrod: \"eee8aa\",\r\n palegreen: \"98fb98\",\r\n paleturquoise: \"afeeee\",\r\n palevioletred: \"d87093\",\r\n papayawhip: \"ffefd5\",\r\n peachpuff: \"ffdab9\",\r\n peru: \"cd853f\",\r\n pink: \"ffc0cb\",\r\n plum: \"dda0dd\",\r\n powderblue: \"b0e0e6\",\r\n purple: \"800080\",\r\n red: \"ff0000\",\r\n rosybrown: \"bc8f8f\",\r\n royalblue: \"4169e1\",\r\n saddlebrown: \"8b4513\",\r\n salmon: \"fa8072\",\r\n sandybrown: \"f4a460\",\r\n seagreen: \"2e8b57\",\r\n seashell: \"fff5ee\",\r\n sienna: \"a0522d\",\r\n silver: \"c0c0c0\",\r\n skyblue: \"87ceeb\",\r\n slateblue: \"6a5acd\",\r\n slategray: \"708090\",\r\n snow: \"fffafa\",\r\n springgreen: \"00ff7f\",\r\n steelblue: \"4682b4\",\r\n tan: \"d2b48c\",\r\n teal: \"008080\",\r\n thistle: \"d8bfd8\",\r\n tomato: \"ff6347\",\r\n turquoise: \"40e0d0\",\r\n violet: \"ee82ee\",\r\n violetred: \"d02090\",\r\n wheat: \"f5deb3\",\r\n white: \"ffffff\",\r\n whitesmoke: \"f5f5f5\",\r\n yellow: \"ffff00\",\r\n yellowgreen: \"9acd32\"\r\n },\r\n c;\r\n for (c in b) a == c && (a = b[c]);\r\n b = [{ re: /^rgb\\((\\d{1,3}),\\s*(\\d{1,3}),\\s*(\\d{1,3})\\)$/, example: [\"rgb(123, 234, 45)\", \"rgb(255,234,245)\"], process: function(a) {\r\n return [parseInt(a[1], 10), parseInt(a[2], 10), parseInt(a[3], 10)] } }, {\r\n re: /^(\\w{2})(\\w{2})(\\w{2})$/,\r\n example: [\"#00ff00\", \"336699\"],\r\n process: function(a) {\r\n return [parseInt(a[1], 16), parseInt(a[2], 16), parseInt(a[3], 16)] }\r\n }, { re: /^(\\w{1})(\\w{1})(\\w{1})$/, example: [\"#fb0\", \"f0f\"], process: function(a) {\r\n return [parseInt(a[1] + a[1], 16), parseInt(a[2] + a[2], 16), parseInt(a[3] + a[3], 16)] } }];\r\n for (c = 0; c < b.length; c++) {\r\n var d = b[c].process,\r\n e = b[c].re.exec(a);\r\n e && (channels = d(e), this.r = channels[0], this.g = channels[1], this.b = channels[2], this.ok = !0) }\r\n this.cleanupRGB = function() {\r\n this.r = 0 > this.r || isNaN(this.r) ? 0 : 255 < this.r ? 255 : this.r;\r\n this.g =\r\n 0 > this.g || isNaN(this.g) ? 0 : 255 < this.g ? 255 : this.g;\r\n this.b = 0 > this.b || isNaN(this.b) ? 0 : 255 < this.b ? 255 : this.b\r\n };\r\n this.cleanupRGB();\r\n this.toRGB = function() {\r\n return \"rgb(\" + this.r + \", \" + this.g + \", \" + this.b + \")\" };\r\n this.toHex = function() {\r\n var a = this.r.toString(16),\r\n b = this.g.toString(16),\r\n c = this.b.toString(16);\r\n 1 == a.length && (a = \"0\" + a);\r\n 1 == b.length && (b = \"0\" + b);\r\n 1 == c.length && (c = \"0\" + c);\r\n return \"#\" + a + b + c };\r\n this.grayChannel = function() {\r\n var a = [0.199, 0.687, 0.114];\r\n return a[0] * this.r + a[1] * this.g + a[2] * this.b };\r\n this.blackWhiteContrast = function() {\r\n return 150 >\r\n this.grayChannel() ? \"white\" : \"black\"\r\n };\r\n this.darken = function(a) {\r\n var b = TradingView.rgbToHsl(this.r, this.g, this.b);\r\n a = TradingView.hslToRgb(b[0], b[1], b[2] - a / 100);\r\n this.r = a[0];\r\n this.g = a[1];\r\n this.b = a[2];\r\n this.cleanupRGB();\r\n return this }\r\n}", "title": "" }, { "docid": "b0dc839dc3f7fa266f8825b237134c68", "score": "0.59655863", "text": "constructor(marq, color, boit){\n\n this.marque = marq;\n this.couleur = color;\n this.boiteVitesse = boit;\n this.modele = \"3\";\n}", "title": "" }, { "docid": "95290460fc32766caa1e13738c55279a", "score": "0.5955671", "text": "constructor(color, gas, owner) {\n\t\tthis.color = color;\n\t\tthis.gas = gas;\n\t\tthis.status = false;\n\t\tthis.owner = owner;\n\t\tthis.showMessage = function () {\n\t\t\tconsole.log(`${this.owner} tiene un coche color ${this.color}`);\n\t\t};\n\t\tthis.toggleStatus = function () {\n\t\t\tthis.status = !this.status;\n\t\t};\n\t}", "title": "" }, { "docid": "c541aae9ccb9803de6dc97b6cc86fb55", "score": "0.5955582", "text": "constructor (color, size, name, temp, liquidType, fillLevel, isFlammable) {\n super(color, size, name, temp);\n this.liquidType = liquidType;\n this.fillLevel = fillLevel;\n this.isFlammable = isFlammable;\n }", "title": "" }, { "docid": "6684e0e832a659b6d2520578ef3f600b", "score": "0.59543246", "text": "constructor(x1, y1, penMode, color1) {\n this.x = x1;\n this.y = y1;\n this.penMode = penMode;\n this.color = color1;\n }", "title": "" }, { "docid": "208ebbc554e357f034fcdf876ed0d2d0", "score": "0.59539217", "text": "function color()\r\n{\r\n this.r = 0;\r\n this.g = 256;\r\n this.b = 128;\r\n}", "title": "" }, { "docid": "208ebbc554e357f034fcdf876ed0d2d0", "score": "0.59539217", "text": "function color()\r\n{\r\n this.r = 0;\r\n this.g = 256;\r\n this.b = 128;\r\n}", "title": "" }, { "docid": "c93f20ffec78e0bd433fcb86803e9868", "score": "0.5947625", "text": "constructor()\n {\n super([\"_delta\", \"toString\", \"toRGB\"]);\n if (new.target === Color)\n {\n throw new ColorizeException(\"Cannot instantiate an abstract class Color.\");\n }\n }", "title": "" }, { "docid": "134607596bebb02e57ce8413f4ad1d3f", "score": "0.5945391", "text": "constructor(x, y, r, col, alpha, string){\r\n this.x=x;\r\n this.y=y;\r\n this.r=r;\r\n this.col = col;\r\n this.moving = false;\r\n this.highlighted = false;\r\n this.fading = false;\r\n this.highlighting = {R: 0, G:0, B:0};\r\n\r\n if(!alpha){\r\n this.alpha = 255;\r\n } else {\r\n this.alpha = alpha;\r\n }\r\n\r\n if(string){\r\n this.string = string;\r\n } else {\r\n this.string = '';\r\n }\r\n }", "title": "" }, { "docid": "af44a7b1f18859d6006ea3128839a15d", "score": "0.59369487", "text": "constructor(name, x,y, r, f, s, fc, sc, sw){\r\n this.name = name;\r\n this.x= x;\r\n this.y=y;\r\n this.r=r;\r\n this.f=f;\r\n this.s=s;\r\n this.fc = fc;\r\n this.sc=sc;\r\n this.sw= sw;\r\n this.count=0;\r\n }", "title": "" }, { "docid": "c5378264aa443c8bca237f8b01db55a1", "score": "0.5925495", "text": "function ColorWheel(){\n\tthis.name = \"Color Wheel\"\n\n\tthis.config = {\n\t\tspeed: {\n\t\t\ttype: 'range',\n\t\t\tname: 'Speed',\n\t\t\tvalue: 250,\n\t\t\tmin: 25,\n\t\t\tmax: 1000,\n\t\t\tstep: 25\n\t\t},\n\n\t\tsaturation: {\n\t\t\ttype: 'range',\n\t\t\tname: 'Color Saturation',\n\t\t\tvalue: 0.7,\n\t\t\tmin: 0,\n\t\t\tmax: 1,\n\t\t\tstep: 0.05\t\t\t\n\t\t},\n\n\t\tlightness: {\n\t\t\ttype: 'range',\n\t\t\tname: 'Lightness',\n\t\t\tvalue: 0.5,\n\t\t\tmin: 0,\n\t\t\tmax: 1,\n\t\t\tstep: 0.01\t\t\t\n\t\t}\n\t}\n}", "title": "" }, { "docid": "c21edd5d860fb6da75461b696b852e1c", "score": "0.59189326", "text": "function cat(name,color) {\n this.name = name;\n this.color = color;\n}", "title": "" }, { "docid": "86af4e38885438be72101e6273428427", "score": "0.5892708", "text": "constructor(x, y, w, color){\r\n this.x = x;\r\n this.y = y;\r\n this.w = w;\r\n this.color = color.copy();\r\n }", "title": "" }, { "docid": "14b374b5c99bb6cdad99ee57e6ae0864", "score": "0.5888391", "text": "constructor(r,g,b, name){\n this.r = r;\n this.g = g;\n this.b = b;\n this.name = name;\n this.calcHsl();\n }", "title": "" }, { "docid": "6ac078d39903ca38941c77e8dd4cb7d4", "score": "0.5875614", "text": "constructor(suit, rank, color, suitClass) {\n\t\t\tthis.suit = suit\n\t\t\tthis.rank = rank\n\t\t\t// this.color = color\n\t\t\t// this.suitClass = suitClass\n\t\t}", "title": "" }, { "docid": "520d5c119aeb34580d146645d780c5f8", "score": "0.58444864", "text": "constructor(color1 = 0, interval1 = 1, displayMode = Line, mode1 = Down) {\n this.color = color1;\n this.interval = interval1;\n this.displayMode = displayMode;\n this.mode = mode1;\n this.resetCounter();\n }", "title": "" }, { "docid": "d4e95d6aabbde0489ab56f3ba6169669", "score": "0.58440953", "text": "constructor(min, max)\n {\n super();\n this.min = min || new THREE.Color(0, 0, 0);\n this.max = max || new THREE.Color(1, 1, 1);\n }", "title": "" }, { "docid": "f3b737e55f6a558fc81ca1f538820fa7", "score": "0.5832936", "text": "function makeRgbColourObject(cName) {\r var myCol = new RGBColor();\r var def = c_layerColourLookup[cName];\r\t\tif (typeof def === 'undefined') {\r\t\t\tdef = c_failsafeRgbColour;\r\t\t}\r myCol.red = def.r;\r myCol.green = def.g;\r myCol.blue = def.b;\r return myCol;\r}", "title": "" }, { "docid": "c55abce1ae89a34bab5640416438a189", "score": "0.58295214", "text": "constructor(id, pxcor, pycor, world, _genUpdate, _declareNonBlackPatch, _decrementPatchLabelCount, _incrementPatchLabelCount, _pcolor = 0.0, _plabel = \"\", _plabelcolor = 9.9) {\n // (Number, Number) => Agent\n this.patchAt = this.patchAt.bind(this);\n this.id = id;\n this.pxcor = pxcor;\n this.pycor = pycor;\n this.world = world;\n this._genUpdate = _genUpdate;\n this._declareNonBlackPatch = _declareNonBlackPatch;\n this._decrementPatchLabelCount = _decrementPatchLabelCount;\n this._incrementPatchLabelCount = _incrementPatchLabelCount;\n this._pcolor = _pcolor;\n this._plabel = _plabel;\n this._plabelcolor = _plabelcolor;\n this._turtles = [];\n this._varManager = this._genVarManager(this.world.patchesOwnNames);\n }", "title": "" }, { "docid": "6c15e07200f9391e767f18988716e3c1", "score": "0.5827898", "text": "constructor(color, cmyk = false) {\n\t\tthis.version = \"1.2.0\"; // major . minor . bug\n\t\tthis.info = { // please, be respectful\n\t\t\tclassname: this.__proto__.constructor.name,\n\t\t\tversion: this._version,\n\t\t\tlibrary: \"ddBasecolor.js\",\n\t\t\towner: \"Design Dude\",\n\t\t\tyear: \"2019\",\n\t\t\tdeveloper: \"Mek van 't Hoff\",\n\t\t\tcontact: \"master.mek@design-dude.nl\"\n\t\t}\n\t\t// create canvas \n\t\tvar canvas, context;\n\t\tcanvas = document.createElement('canvas');\n\t\tcanvas.height = 1;\n\t\tcanvas.width = 1;\n\t\tcontext = canvas.getContext('2d');\n\t\t// fill with any valid web color notation\n\t\tcontext.fillStyle = color;\n\t\tcontext.fillRect(0, 0, 1, 1);\n\t\t// get the data to set private properties\n\t\tthis.r = context.getImageData(0, 0, 1, 1).data[0];\n\t\tthis.g = context.getImageData(0, 0, 1, 1).data[1];\n\t\tthis.b = context.getImageData(0, 0, 1, 1).data[2];\n\t\tthis.a = context.getImageData(0, 0, 1, 1).data[3] / 255;\n\t\tthis.h = 0;\n\t\tthis.s = 0;\n\t\tthis.l = 0;\n\t\tthis._cmyk = cmyk;\n\t\tif(this._cmyk) {\n\t\t\tthis.c = 0;\n\t\t\tthis.m = 0;\n\t\t\tthis.y = 0;\n\t\t\tthis.k = 0;\n\t\t}\n\t\t// calc hsl values from rgb\n\t\tthis._to_hsl();\n\t\tif(this._cmyk) this._to_cmyk();\n\t\t// translate non-existing cmyk input\n\t\tif(typeof(color) === 'string' && color.indexOf('cmyk') === 0) {\n\t\t\tvar n = color.match(/([0-9\\.\\-]+)/g);\n\t\t\tif(n.length === 4 || n.length === 5) {\n\t\t\t\tthis._cmyk = true;\n\t\t\t\tthis.c = n[0] < 0 ? 0 : n[0] > 100 ? 100 : parseFloat(n[0]);\n\t\t\t\tthis.m = n[1] < 0 ? 0 : n[1] > 100 ? 100 : parseFloat(n[1]);\n\t\t\t\tthis.y = n[2] < 0 ? 0 : n[2] > 100 ? 100 : parseFloat(n[2]);\n\t\t\t\tthis.k = n[3] < 0 ? 0 : n[3] > 100 ? 100 : parseFloat(n[3]);\n\t\t\t\tthis.a = 1;\n\t\t\t\tif(n.length === 5 && color.indexOf('cmyka') === 0) this.a = n[4] < 0 ? 0 : n[4] > 1 ? 1 : parseFloat(n[4]);\n\t\t\t\tthis._from_cmyk();\n\t\t\t\tthis._to_hsl();\n\t\t\t}\n\t\t}\n\t\t// save as basecolor\n\t\tthis._basecolor = this.info.classname === 'ddBasecolor' ? this.copy() : false;\n\t}", "title": "" }, { "docid": "0f0fcf666ea295e643bfea8c51e5f909", "score": "0.5820368", "text": "constructor(x, y, dir) {\n this.x = x;\n this.y = y;\n this.dir = dir;\n this.c = color(random(255), random(255), random(255));\n this.type = int(random(2));//randomly selects type of vehicle \n this.speed = 3;\n this.decreasing = 0.5;\n this.accelerating = 1.5;\n this.chanceC;//chance for changing color\n this.chanceD;//chance for slowing down\n this.chanceA;//chance for accelerating\n }", "title": "" }, { "docid": "27cd3008af58c55c653a564552aab9a8", "score": "0.5816362", "text": "constructor(name,component,nodes){\n\t\tthis.name=name;\n\t\tthis.component=component;\n\t}", "title": "" }, { "docid": "35da497dd967fff8d4dd7e50980db3a7", "score": "0.58128077", "text": "constructor(red,green,blue,alpha=255)\n {\n this.r = this.clamp(red);\n this.g = this.clamp(green);\n this.b = this.clamp(blue);\n this.a = this.clamp(alpha);\n }", "title": "" }, { "docid": "7df1d428e200ae4e415d87252806d5ce", "score": "0.5809482", "text": "constructor(model, plot, color) {\n this.model = model;\n this.plot = plot;\n this.color = color;\n }", "title": "" }, { "docid": "2bc170c3a472d8b5cb8ce7484b63746c", "score": "0.5803243", "text": "constructor(x,y,count,font_family,font_size,color){\n\t\tsuper(x,y,count,font_family,font_size,color);\n\t\tthis.count = count;\n\t\tthis.active = false;\n\t}", "title": "" }, { "docid": "3ea55a7055841936be09aae0adcf30ed", "score": "0.5786821", "text": "constructor(name1, pens = [], _ops, xLabel, yLabel, isLegendEnabled = true, isAutoplotting = true, xMin = 0, xMax = 10, yMin = 0, yMax = 10, _setupThis = (function() {}), _updateThis = (function() {})) {\n var toName;\n this.name = name1;\n this._ops = _ops;\n this.xLabel = xLabel;\n this.yLabel = yLabel;\n this.isLegendEnabled = isLegendEnabled;\n this.isAutoplotting = isAutoplotting;\n this.xMin = xMin;\n this.xMax = xMax;\n this.yMin = yMin;\n this.yMax = yMax;\n this._setupThis = _setupThis;\n this._updateThis = _updateThis;\n toName = function(p) {\n return p.name.toUpperCase();\n };\n this._currentPenMaybe = maybe(pens[0]);\n this._originalBounds = [this.xMin, this.xMax, this.yMin, this.yMax];\n this._penMap = pipeline(map(toName), flip(zip)(pens), toObject)(pens);\n this.clear();\n }", "title": "" }, { "docid": "36aa6fdcf227fc107d325a6b40f81dcc", "score": "0.5774185", "text": "constructor(x, y, w, h, color) {\n this.x = x;\n this.y = y; \n this.w = w;\n this.h = h;\n this.color = color;\n }", "title": "" }, { "docid": "27c8723be812cacf12054d530cbf6f4e", "score": "0.5771601", "text": "constructor(options) {\n super(options); //super keyword Car.constructor()\n this.color = options.color;\n }", "title": "" }, { "docid": "1b15659c545800b123956d592a84f1fc", "score": "0.57668203", "text": "function Car(sentColor) {\n this.color = sentColor;\n}", "title": "" }, { "docid": "1b15659c545800b123956d592a84f1fc", "score": "0.57668203", "text": "function Car(sentColor) {\n this.color = sentColor;\n}", "title": "" }, { "docid": "91fe34d63ad657c87f81ff429b372d8e", "score": "0.5765859", "text": "constructor(color) { \r\n if( color !== undefined) {\r\n this.color=color\r\n } else {\r\n this.color = \"#0095DD\";\r\n }\r\n // We choose 2 and -2 to be the starting delta parameters arbitrarily\r\n this.dx = 2\r\n this.dy = -2\r\n this.speed = Math.random() * 2;\r\n }", "title": "" }, { "docid": "1f6a7a6ab87d4e7460d7d714bfa0a847", "score": "0.57628936", "text": "constructor(row_index, col_index, number = undefined) {\n this.row_index = row_index;\n this.col_index = col_index;\n this.color = \"white\";\n this.number = number; // For numbered white squares\n // For the breadth-first search algorithm\n this.status = undefined;\n this.distance = undefined;\n this.predecessor = undefined;\n }", "title": "" }, { "docid": "1e3a923133b973dde13ec452835679e4", "score": "0.5758745", "text": "constructor(width, height,color){\n if(width<0){\n throw new RangeError('Cannot have negative size');\n }\n this.width = width || 1;\n this.height = height || 1;\n this.color = color || 'white';\n }", "title": "" }, { "docid": "7de129a5398023b7518de2416b276048", "score": "0.5749399", "text": "constructor() {\n\n super({primaryColor: 0xd92f31})\n }", "title": "" }, { "docid": "afad8892af3fcdcb7c8a2f2fa4a15d71", "score": "0.5742845", "text": "constructor(props) {\n\t\tsuper(props);\n\t\tthis.combos = [\n\t\t\t[0, 1, 2],\n\t\t\t[3, 4, 5],\n\t\t\t[6, 7, 8],\n\t\t\t[0, 3, 6],\n\t\t\t[1, 4, 7],\n\t\t\t[2, 5, 8],\n\t\t\t[0, 4, 8],\n\t\t\t[2, 4, 6]\n\t\t];\n\t}", "title": "" }, { "docid": "7d58ada8aa686e29e3a97997f5bdb5e6", "score": "0.5742077", "text": "constructor(r, g, b, a = 255) {\n super();\n this.r = r;\n this.g = g;\n this.b = b;\n this.a = a;\n }", "title": "" }, { "docid": "71290d9c21769d14f1cb76140c8e2e6d", "score": "0.5741251", "text": "function bikeConstuctor(name,color,maxSpeed){\n this.name=name\n this.color=color\n this.maxSpeed=maxSpeed\n}", "title": "" }, { "docid": "bbd0cbaddb21e67309ec10f225e6b306", "score": "0.57115185", "text": "constructor (shapeNumber) {\n this.shapeNumber = shapeNumber;\n this.orientation = S;\n this.col = 0; // column: 0-9\n this.row = 0; // row: 0-19\n this.color = colors[shapeNumber];\n this.updateShape();\n }", "title": "" }, { "docid": "905eb9205ff97695a00e07c0470ab314", "score": "0.57084674", "text": "constructor(rBoo, gBoo, bBoo, aBoo) {\n this.m_uid = -1;\n this.m_rBoo = true;\n this.m_gBoo = true;\n this.m_bBoo = true;\n this.m_aBoo = true;\n this.m_uid = RenderColorMask.s_uid++;\n this.m_rBoo = rBoo;\n this.m_gBoo = gBoo;\n this.m_bBoo = bBoo;\n this.m_aBoo = aBoo;\n }", "title": "" }, { "docid": "86437ea909fbc465f7df6828103624aa", "score": "0.5706065", "text": "function Color(r, g, b, a) {\n if (a === void 0) { a = 1; }\n // NaN is treated as 0.\n this.r = Math.min(1, Math.max(0, r || 0));\n this.g = Math.min(1, Math.max(0, g || 0));\n this.b = Math.min(1, Math.max(0, b || 0));\n this.a = Math.min(1, Math.max(0, a || 0));\n }", "title": "" }, { "docid": "86437ea909fbc465f7df6828103624aa", "score": "0.5706065", "text": "function Color(r, g, b, a) {\n if (a === void 0) { a = 1; }\n // NaN is treated as 0.\n this.r = Math.min(1, Math.max(0, r || 0));\n this.g = Math.min(1, Math.max(0, g || 0));\n this.b = Math.min(1, Math.max(0, b || 0));\n this.a = Math.min(1, Math.max(0, a || 0));\n }", "title": "" }, { "docid": "86437ea909fbc465f7df6828103624aa", "score": "0.5706065", "text": "function Color(r, g, b, a) {\n if (a === void 0) { a = 1; }\n // NaN is treated as 0.\n this.r = Math.min(1, Math.max(0, r || 0));\n this.g = Math.min(1, Math.max(0, g || 0));\n this.b = Math.min(1, Math.max(0, b || 0));\n this.a = Math.min(1, Math.max(0, a || 0));\n }", "title": "" }, { "docid": "639df03d7f9bb4d6b442b53d10ddfb86", "score": "0.56908494", "text": "constructor(x,y,w,h,C1){\n this.x = x;\n this.y = y;\n this.w = w;\n this.h = h;\n this.fill = C1;\n }", "title": "" }, { "docid": "84ec34e96c639b08a4c62146f41a3de5", "score": "0.56901973", "text": "function cls (c = 1) {\n _layer.data.fill(c)\n }", "title": "" }, { "docid": "90cee027eb103a4233cfb55b29d15a56", "score": "0.56770045", "text": "constructor(identifier, direction, dropablePieces, capturedPieces, color = undefined, isCPU = false) {\n\t\tthis.identifier = identifier;\n\t\tthis.direction = direction;\n\t\tthis.dropablePieces = dropablePieces;\n\t\tthis.capturedPieces = capturedPieces;\n\t\tthis.color = color;\n\t\tthis.isCPU = isCPU;\n\t}", "title": "" }, { "docid": "386b3742ce7561ea4241a15cb2c9fa1a", "score": "0.56760794", "text": "initColorValues() {\n if (!isNullOrWhiteSpace(this.value)) {\n this.currentRGBColor = parseColor(this.value);\n }\n else {\n this.currentRGBColor = new ColorRGBA64(1, 0, 0, 1);\n }\n this.currentHSVColor = rgbToHSV(this.currentRGBColor);\n this.updateUIValues(false);\n }", "title": "" }, { "docid": "52e8e76ca6935c702524da8159c2c033", "score": "0.5669937", "text": "function Color(r, g, b, a) {\n if (a === void 0) {\n a = 1;\n } // NaN is treated as 0.\n\n\n this.r = Math.min(1, Math.max(0, r || 0));\n this.g = Math.min(1, Math.max(0, g || 0));\n this.b = Math.min(1, Math.max(0, b || 0));\n this.a = Math.min(1, Math.max(0, a || 0));\n }", "title": "" }, { "docid": "52e8e76ca6935c702524da8159c2c033", "score": "0.5669937", "text": "function Color(r, g, b, a) {\n if (a === void 0) {\n a = 1;\n } // NaN is treated as 0.\n\n\n this.r = Math.min(1, Math.max(0, r || 0));\n this.g = Math.min(1, Math.max(0, g || 0));\n this.b = Math.min(1, Math.max(0, b || 0));\n this.a = Math.min(1, Math.max(0, a || 0));\n }", "title": "" }, { "docid": "181754e9f4d5e5d0c5b254140f357354", "score": "0.5669754", "text": "constructor(props) {\n super(props)\n this.state = {\n color: this.props.value\n }\n }", "title": "" }, { "docid": "6f6f263d6806669bbbbd90b47cd5e5bc", "score": "0.566438", "text": "constructor(id, color, position = null, state = \"Alive\") {\n super(id, color, position, state);\n this.description = `Rey ${colores[color]}o ajedrez`;\n this.img = `img/king_${color}.png`;\n }", "title": "" }, { "docid": "a6d74edfe6f7effd273c7c7053077f32", "score": "0.5663977", "text": "function _init() {\n //GRAY\n colorList[0] = {\n minH: 0,\n maxH: 0,\n minS: 0,\n maxS: 0,\n minL: 0,\n maxL: 0\n };\n\n //PASTEL\n colorList[1] = {\n minH: 0,\n maxH: 0,\n minS: 0,\n maxS: 0,\n minL: 0,\n maxL: 0\n };\n\n //READABLE_WHITE\n colorList[2] = {\n minH: 0,\n maxH: 0,\n minS: 0,\n maxS: 0,\n minL: 0,\n maxL: 0\n };\n\n //READABLE_BLACK\n colorList[3] = {\n minH: 0,\n maxH: 0,\n minS: 0,\n maxS: 0,\n minL: 0,\n maxL: 0\n };\n\n //RED\n colorList[4] = {\n minH: 330,\n maxH: 15,\n minS: 50,\n maxS: 100,\n minL: 40,\n maxL: 60\n };\n \n //ORANGE\n colorList[5] = {\n minH: 15,\n maxH: 35,\n minS: 50,\n maxS: 100,\n minL: 40,\n maxL: 60\n };\n\n //YELLOW\n colorList[6] = {\n minH: 35,\n maxH: 60,\n minS: 50,\n maxS: 100,\n minL: 40,\n maxL: 60\n };\n\n //GREEN\n colorList[7] = {\n minH: 60,\n maxH: 140,\n minS: 50,\n maxS: 100,\n minL: 40,\n maxL: 60\n };\n\n //BLUE\n colorList[8] = {\n minH: 140,\n maxH: 245,\n minS: 50,\n maxS: 100,\n minL: 40,\n maxL: 60\n };\n\n //INDIGO\n colorList[9] = {\n minH: 245,\n maxH: 255,\n minS: 50,\n maxS: 100,\n minL: 40,\n maxL: 60\n };\n\n //VIOLET\n colorList[10] = {\n minH: 255,\n maxH: 270,\n minS: 50,\n maxS: 100,\n minL: 40,\n maxL: 60\n };\n\n //PINK\n colorList[11] = {\n minH: 270,\n maxH: 330,\n minS: 50,\n maxS: 100,\n minL: 40,\n maxL: 60\n };\n }", "title": "" }, { "docid": "586e54718e17ce6700d6c66e80c95a50", "score": "0.5663859", "text": "constructor(id, color, position = null, state = \"Alive\") {\n super(id, color, position, state);\n this.description = `Alfil ${colores[color]}o ajedrez`;\n this.img = `img/bishop_${color}.png`;\n }", "title": "" }, { "docid": "09d44bc7b906e5c783d31d34f14c286f", "score": "0.5653954", "text": "function colorierBordure(){\n\n }", "title": "" }, { "docid": "56faa9da159ced82b2bb8fed6c5a8264", "score": "0.56524485", "text": "function Color(rIn,gIn,bIn,aIn){\n\tthis.type = \"Color\";\n\tthis.r = rIn;\n\tthis.g = gIn;\n\tthis.b = bIn;\n\tthis.a = aIn;\n}", "title": "" } ]
042e6fda295ada951802898df0ba793a
Positions returned by coordsChar contain some extra information. xRel is the relative x position of the input coordinates compared to the found position (so xRel > 0 means the coordinates are to the right of the character position, for example). When outside is true, that means the coordinates lie outside the line's vertical range.
[ { "docid": "0b80b5dc359f5d08bd7b5f0ed9799985", "score": "0.0", "text": "function PosWithInfo(line, ch, sticky, outside, xRel) {\n var pos = Pos(line, ch, sticky);\n pos.xRel = xRel;\n if (outside) { pos.outside = true; }\n return pos\n }", "title": "" } ]
[ { "docid": "f1bd116e8697789de8aced346754dc39", "score": "0.6561227", "text": "function PosWithInfo(line, ch, sticky, outside, xRel) {\n var pos = Pos(line, ch, sticky);\n pos.xRel = xRel;\n\n if (outside) {\n pos.outside = true;\n }\n\n return pos;\n } // Compute the character position closest to the given coordinates.", "title": "" }, { "docid": "a39ffa3496b6f123c53e92ea06134a7e", "score": "0.6327442", "text": "function PosWithInfo(line, ch, outside, xRel) {\n var pos = Pos(line, ch);\n pos.xRel = xRel;\n if (outside) pos.outside = true;\n return pos;\n }", "title": "" }, { "docid": "a39ffa3496b6f123c53e92ea06134a7e", "score": "0.6327442", "text": "function PosWithInfo(line, ch, outside, xRel) {\n var pos = Pos(line, ch);\n pos.xRel = xRel;\n if (outside) pos.outside = true;\n return pos;\n }", "title": "" }, { "docid": "a39ffa3496b6f123c53e92ea06134a7e", "score": "0.6327442", "text": "function PosWithInfo(line, ch, outside, xRel) {\n var pos = Pos(line, ch);\n pos.xRel = xRel;\n if (outside) pos.outside = true;\n return pos;\n }", "title": "" }, { "docid": "a39ffa3496b6f123c53e92ea06134a7e", "score": "0.6327442", "text": "function PosWithInfo(line, ch, outside, xRel) {\n var pos = Pos(line, ch);\n pos.xRel = xRel;\n if (outside) pos.outside = true;\n return pos;\n }", "title": "" }, { "docid": "a39ffa3496b6f123c53e92ea06134a7e", "score": "0.6327442", "text": "function PosWithInfo(line, ch, outside, xRel) {\n var pos = Pos(line, ch);\n pos.xRel = xRel;\n if (outside) pos.outside = true;\n return pos;\n }", "title": "" }, { "docid": "a39ffa3496b6f123c53e92ea06134a7e", "score": "0.6327442", "text": "function PosWithInfo(line, ch, outside, xRel) {\n var pos = Pos(line, ch);\n pos.xRel = xRel;\n if (outside) pos.outside = true;\n return pos;\n }", "title": "" }, { "docid": "a39ffa3496b6f123c53e92ea06134a7e", "score": "0.6327442", "text": "function PosWithInfo(line, ch, outside, xRel) {\n var pos = Pos(line, ch);\n pos.xRel = xRel;\n if (outside) pos.outside = true;\n return pos;\n }", "title": "" }, { "docid": "a39ffa3496b6f123c53e92ea06134a7e", "score": "0.6327442", "text": "function PosWithInfo(line, ch, outside, xRel) {\n var pos = Pos(line, ch);\n pos.xRel = xRel;\n if (outside) pos.outside = true;\n return pos;\n }", "title": "" }, { "docid": "a39ffa3496b6f123c53e92ea06134a7e", "score": "0.6327442", "text": "function PosWithInfo(line, ch, outside, xRel) {\n var pos = Pos(line, ch);\n pos.xRel = xRel;\n if (outside) pos.outside = true;\n return pos;\n }", "title": "" }, { "docid": "a39ffa3496b6f123c53e92ea06134a7e", "score": "0.6327442", "text": "function PosWithInfo(line, ch, outside, xRel) {\n var pos = Pos(line, ch);\n pos.xRel = xRel;\n if (outside) pos.outside = true;\n return pos;\n }", "title": "" }, { "docid": "a39ffa3496b6f123c53e92ea06134a7e", "score": "0.6327442", "text": "function PosWithInfo(line, ch, outside, xRel) {\n var pos = Pos(line, ch);\n pos.xRel = xRel;\n if (outside) pos.outside = true;\n return pos;\n }", "title": "" }, { "docid": "a39ffa3496b6f123c53e92ea06134a7e", "score": "0.6327442", "text": "function PosWithInfo(line, ch, outside, xRel) {\n var pos = Pos(line, ch);\n pos.xRel = xRel;\n if (outside) pos.outside = true;\n return pos;\n }", "title": "" }, { "docid": "a39ffa3496b6f123c53e92ea06134a7e", "score": "0.6327442", "text": "function PosWithInfo(line, ch, outside, xRel) {\n var pos = Pos(line, ch);\n pos.xRel = xRel;\n if (outside) pos.outside = true;\n return pos;\n }", "title": "" }, { "docid": "a39ffa3496b6f123c53e92ea06134a7e", "score": "0.6327442", "text": "function PosWithInfo(line, ch, outside, xRel) {\n var pos = Pos(line, ch);\n pos.xRel = xRel;\n if (outside) pos.outside = true;\n return pos;\n }", "title": "" }, { "docid": "ff14fb6b7314439460e9c49e02587391", "score": "0.63207513", "text": "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosMaybeOutside(doc.first, 0, true);\n var lineNo = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineNo > last)\n return PosMaybeOutside(doc.first + doc.size - 1, getLine(doc, last).text.length, true);\n if (x < 0) x = 0;\n\n for (;;) {\n var lineObj = getLine(doc, lineNo);\n var found = coordsCharInner(cm, lineObj, lineNo, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find();\n if (merged && found.ch >= mergedPos.from.ch)\n lineNo = mergedPos.to.line;\n else\n return found;\n }\n }", "title": "" }, { "docid": "ff14fb6b7314439460e9c49e02587391", "score": "0.63207513", "text": "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosMaybeOutside(doc.first, 0, true);\n var lineNo = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineNo > last)\n return PosMaybeOutside(doc.first + doc.size - 1, getLine(doc, last).text.length, true);\n if (x < 0) x = 0;\n\n for (;;) {\n var lineObj = getLine(doc, lineNo);\n var found = coordsCharInner(cm, lineObj, lineNo, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find();\n if (merged && found.ch >= mergedPos.from.ch)\n lineNo = mergedPos.to.line;\n else\n return found;\n }\n }", "title": "" }, { "docid": "8c29cddbd2189a5a4e98b13359f5f84f", "score": "0.63043666", "text": "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0)\n return PosWithInfo(doc.first, 0, true, -1);\n var lineNo = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineNo > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0)\n x = 0;\n for (;;) {\n var lineObj = getLine(doc, lineNo);\n var found = coordsCharInner(cm, lineObj, lineNo, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find();\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineNo = mergedPos.to.line;\n else\n return found;\n }\n }", "title": "" }, { "docid": "f8eba1563382025da4b54cb3c301817d", "score": "0.6300386", "text": "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineNo = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineNo > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n for (;;) {\n var lineObj = getLine(doc, lineNo);\n var found = coordsCharInner(cm, lineObj, lineNo, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find();\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineNo = mergedPos.to.line;\n else\n return found;\n }\n }", "title": "" }, { "docid": "f8eba1563382025da4b54cb3c301817d", "score": "0.6300386", "text": "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineNo = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineNo > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n for (;;) {\n var lineObj = getLine(doc, lineNo);\n var found = coordsCharInner(cm, lineObj, lineNo, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find();\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineNo = mergedPos.to.line;\n else\n return found;\n }\n }", "title": "" }, { "docid": "f8eba1563382025da4b54cb3c301817d", "score": "0.6300386", "text": "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineNo = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineNo > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n for (;;) {\n var lineObj = getLine(doc, lineNo);\n var found = coordsCharInner(cm, lineObj, lineNo, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find();\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineNo = mergedPos.to.line;\n else\n return found;\n }\n }", "title": "" }, { "docid": "600f085627c3ca292ab2dc0eb29fde5a", "score": "0.62871313", "text": "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineN = lineNo(lineObj = mergedPos.to.line);\n else\n return found;\n }\n }", "title": "" }, { "docid": "600f085627c3ca292ab2dc0eb29fde5a", "score": "0.62871313", "text": "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineN = lineNo(lineObj = mergedPos.to.line);\n else\n return found;\n }\n }", "title": "" }, { "docid": "600f085627c3ca292ab2dc0eb29fde5a", "score": "0.62871313", "text": "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineN = lineNo(lineObj = mergedPos.to.line);\n else\n return found;\n }\n }", "title": "" }, { "docid": "600f085627c3ca292ab2dc0eb29fde5a", "score": "0.62871313", "text": "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineN = lineNo(lineObj = mergedPos.to.line);\n else\n return found;\n }\n }", "title": "" }, { "docid": "600f085627c3ca292ab2dc0eb29fde5a", "score": "0.62871313", "text": "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineN = lineNo(lineObj = mergedPos.to.line);\n else\n return found;\n }\n }", "title": "" }, { "docid": "600f085627c3ca292ab2dc0eb29fde5a", "score": "0.62871313", "text": "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineN = lineNo(lineObj = mergedPos.to.line);\n else\n return found;\n }\n }", "title": "" }, { "docid": "600f085627c3ca292ab2dc0eb29fde5a", "score": "0.62871313", "text": "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineN = lineNo(lineObj = mergedPos.to.line);\n else\n return found;\n }\n }", "title": "" }, { "docid": "600f085627c3ca292ab2dc0eb29fde5a", "score": "0.62871313", "text": "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineN = lineNo(lineObj = mergedPos.to.line);\n else\n return found;\n }\n }", "title": "" }, { "docid": "600f085627c3ca292ab2dc0eb29fde5a", "score": "0.62871313", "text": "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineN = lineNo(lineObj = mergedPos.to.line);\n else\n return found;\n }\n }", "title": "" }, { "docid": "600f085627c3ca292ab2dc0eb29fde5a", "score": "0.62871313", "text": "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineN = lineNo(lineObj = mergedPos.to.line);\n else\n return found;\n }\n }", "title": "" }, { "docid": "600f085627c3ca292ab2dc0eb29fde5a", "score": "0.62871313", "text": "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineN = lineNo(lineObj = mergedPos.to.line);\n else\n return found;\n }\n }", "title": "" }, { "docid": "600f085627c3ca292ab2dc0eb29fde5a", "score": "0.62871313", "text": "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineN = lineNo(lineObj = mergedPos.to.line);\n else\n return found;\n }\n }", "title": "" }, { "docid": "600f085627c3ca292ab2dc0eb29fde5a", "score": "0.62871313", "text": "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineN = lineNo(lineObj = mergedPos.to.line);\n else\n return found;\n }\n }", "title": "" }, { "docid": "600f085627c3ca292ab2dc0eb29fde5a", "score": "0.62871313", "text": "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineN = lineNo(lineObj = mergedPos.to.line);\n else\n return found;\n }\n }", "title": "" }, { "docid": "9fcf3e2fb5143578f1af5e703bb34900", "score": "0.6278546", "text": "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineNo = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineNo > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n for (; ;) {\n var lineObj = getLine(doc, lineNo);\n var found = coordsCharInner(cm, lineObj, lineNo, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find();\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineNo = mergedPos.to.line;\n else\n return found;\n }\n }", "title": "" }, { "docid": "f6726943b35a4e4f4390b5ff40d36649", "score": "0.6273238", "text": "function coordsChar(cm, x, y) {\n\t var doc = cm.doc;\n\t y += cm.display.viewOffset;\n\t if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n\t var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n\t if (lineN > last)\n\t return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n\t if (x < 0) x = 0;\n\t\n\t var lineObj = getLine(doc, lineN);\n\t for (;;) {\n\t var found = coordsCharInner(cm, lineObj, lineN, x, y);\n\t var merged = collapsedSpanAtEnd(lineObj);\n\t var mergedPos = merged && merged.find(0, true);\n\t if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n\t lineN = lineNo(lineObj = mergedPos.to.line);\n\t else\n\t return found;\n\t }\n\t }", "title": "" }, { "docid": "f6726943b35a4e4f4390b5ff40d36649", "score": "0.6273238", "text": "function coordsChar(cm, x, y) {\n\t var doc = cm.doc;\n\t y += cm.display.viewOffset;\n\t if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n\t var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n\t if (lineN > last)\n\t return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n\t if (x < 0) x = 0;\n\t\n\t var lineObj = getLine(doc, lineN);\n\t for (;;) {\n\t var found = coordsCharInner(cm, lineObj, lineN, x, y);\n\t var merged = collapsedSpanAtEnd(lineObj);\n\t var mergedPos = merged && merged.find(0, true);\n\t if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n\t lineN = lineNo(lineObj = mergedPos.to.line);\n\t else\n\t return found;\n\t }\n\t }", "title": "" }, { "docid": "c56c385729161fea6464a04d88d5206b", "score": "0.6259662", "text": "function coordsChar(cm, x, y) {\n\t var doc = cm.doc;\n\t y += cm.display.viewOffset;\n\t if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n\t var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n\t if (lineN > last)\n\t return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n\t if (x < 0) x = 0;\n\n\t var lineObj = getLine(doc, lineN);\n\t for (;;) {\n\t var found = coordsCharInner(cm, lineObj, lineN, x, y);\n\t var merged = collapsedSpanAtEnd(lineObj);\n\t var mergedPos = merged && merged.find(0, true);\n\t if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n\t lineN = lineNo(lineObj = mergedPos.to.line);\n\t else\n\t return found;\n\t }\n\t }", "title": "" }, { "docid": "c56c385729161fea6464a04d88d5206b", "score": "0.6259662", "text": "function coordsChar(cm, x, y) {\n\t var doc = cm.doc;\n\t y += cm.display.viewOffset;\n\t if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n\t var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n\t if (lineN > last)\n\t return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n\t if (x < 0) x = 0;\n\n\t var lineObj = getLine(doc, lineN);\n\t for (;;) {\n\t var found = coordsCharInner(cm, lineObj, lineN, x, y);\n\t var merged = collapsedSpanAtEnd(lineObj);\n\t var mergedPos = merged && merged.find(0, true);\n\t if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n\t lineN = lineNo(lineObj = mergedPos.to.line);\n\t else\n\t return found;\n\t }\n\t }", "title": "" }, { "docid": "c56c385729161fea6464a04d88d5206b", "score": "0.6259662", "text": "function coordsChar(cm, x, y) {\n\t var doc = cm.doc;\n\t y += cm.display.viewOffset;\n\t if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n\t var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n\t if (lineN > last)\n\t return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n\t if (x < 0) x = 0;\n\n\t var lineObj = getLine(doc, lineN);\n\t for (;;) {\n\t var found = coordsCharInner(cm, lineObj, lineN, x, y);\n\t var merged = collapsedSpanAtEnd(lineObj);\n\t var mergedPos = merged && merged.find(0, true);\n\t if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n\t lineN = lineNo(lineObj = mergedPos.to.line);\n\t else\n\t return found;\n\t }\n\t }", "title": "" }, { "docid": "c5a27b10971c507199629502fafd5c32", "score": "0.62500674", "text": "function _coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) {\n return PosWithInfo(doc.first, 0, null, true, -1);\n }\n var lineN = _lineAtHeight(doc, y),\n last = doc.first + doc.size - 1;\n if (lineN > last) {\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1);\n }\n if (x < 0) {\n x = 0;\n }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0)) {\n lineN = lineNo(lineObj = mergedPos.to.line);\n } else {\n return found;\n }\n }\n }", "title": "" }, { "docid": "18d2d0636b7d86225bfbb19702a3afc9", "score": "0.6243129", "text": "function PosWithInfo(line, ch, outside, xRel) {\n\t var pos = Pos(line, ch);\n\t pos.xRel = xRel;\n\t if (outside) pos.outside = true;\n\t return pos;\n\t }", "title": "" }, { "docid": "18d2d0636b7d86225bfbb19702a3afc9", "score": "0.6243129", "text": "function PosWithInfo(line, ch, outside, xRel) {\n\t var pos = Pos(line, ch);\n\t pos.xRel = xRel;\n\t if (outside) pos.outside = true;\n\t return pos;\n\t }", "title": "" }, { "docid": "18d2d0636b7d86225bfbb19702a3afc9", "score": "0.6243129", "text": "function PosWithInfo(line, ch, outside, xRel) {\n\t var pos = Pos(line, ch);\n\t pos.xRel = xRel;\n\t if (outside) pos.outside = true;\n\t return pos;\n\t }", "title": "" }, { "docid": "18d2d0636b7d86225bfbb19702a3afc9", "score": "0.6243129", "text": "function PosWithInfo(line, ch, outside, xRel) {\n\t var pos = Pos(line, ch);\n\t pos.xRel = xRel;\n\t if (outside) pos.outside = true;\n\t return pos;\n\t }", "title": "" }, { "docid": "18d2d0636b7d86225bfbb19702a3afc9", "score": "0.6243129", "text": "function PosWithInfo(line, ch, outside, xRel) {\n\t var pos = Pos(line, ch);\n\t pos.xRel = xRel;\n\t if (outside) pos.outside = true;\n\t return pos;\n\t }", "title": "" }, { "docid": "310ead64aa62953367580a3d630faf60", "score": "0.62155676", "text": "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) {\n return PosWithInfo(doc.first, 0, null, -1, -1);\n }\n var lineN = lineAtHeight(doc, y),\n last = doc.first + doc.size - 1;\n if (lineN > last) {\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1);\n }\n if (x < 0) {\n x = 0;\n }\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) {\n return found;\n }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) {\n return rangeEnd;\n }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "title": "" }, { "docid": "5bb5a7519696784ea51eb3716d8ce896", "score": "0.620392", "text": "function PosWithInfo(line, ch, outside, xRel) {\n\t var pos = Pos(line, ch)\n\t pos.xRel = xRel\n\t if (outside) { pos.outside = true }\n\t return pos\n\t}", "title": "" }, { "docid": "b26c934ab067c793464edb455ceec5fb", "score": "0.61999273", "text": "function coordsChar(cm, x, y) {\n\t var doc = cm.doc\n\t y += cm.display.viewOffset\n\t if (y < 0) { return PosWithInfo(doc.first, 0, true, -1) }\n\t var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1\n\t if (lineN > last)\n\t { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1) }\n\t if (x < 0) { x = 0 }\n\n\t var lineObj = getLine(doc, lineN)\n\t for (;;) {\n\t var found = coordsCharInner(cm, lineObj, lineN, x, y)\n\t var merged = collapsedSpanAtEnd(lineObj)\n\t var mergedPos = merged && merged.find(0, true)\n\t if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n\t { lineN = lineNo(lineObj = mergedPos.to.line) }\n\t else\n\t { return found }\n\t }\n\t}", "title": "" }, { "docid": "5b2beb2eeba2330bf486a66da645a7e7", "score": "0.6196621", "text": "function coordsChar(cm, x, y) {\n var doc = cm.doc\n y += cm.display.viewOffset\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0 }\n\n var lineObj = getLine(doc, lineN)\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y)\n var merged = collapsedSpanAtEnd(lineObj)\n var mergedPos = merged && merged.find(0, true)\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n { lineN = lineNo(lineObj = mergedPos.to.line) }\n else\n { return found }\n }\n}", "title": "" }, { "docid": "105d6e0588594f288175625bb3f10b4d", "score": "0.6182796", "text": "function coordsChar(cm, x, y) {\n\t var doc = cm.doc\n\t y += cm.display.viewOffset\n\t if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n\t var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1\n\t if (lineN > last)\n\t { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n\t if (x < 0) { x = 0 }\n\n\t var lineObj = getLine(doc, lineN)\n\t for (;;) {\n\t var found = coordsCharInner(cm, lineObj, lineN, x, y)\n\t var merged = collapsedSpanAtEnd(lineObj)\n\t var mergedPos = merged && merged.find(0, true)\n\t if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n\t { lineN = lineNo(lineObj = mergedPos.to.line) }\n\t else\n\t { return found }\n\t }\n\t}", "title": "" }, { "docid": "a21a57263fd430489d18bfffafc9146b", "score": "0.6182698", "text": "function _coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n\n if (y < 0) {\n return PosWithInfo(doc.first, 0, null, true, -1);\n }\n\n var lineN = _lineAtHeight(doc, y),\n last = doc.first + doc.size - 1;\n\n if (lineN > last) {\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1);\n }\n\n if (x < 0) {\n x = 0;\n }\n\n var lineObj = getLine(doc, lineN);\n\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0)) {\n lineN = lineNo(lineObj = mergedPos.to.line);\n } else {\n return found;\n }\n }\n }", "title": "" }, { "docid": "1abb9ed6de451d47c40e722e3908dc2e", "score": "0.61809635", "text": "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "title": "" }, { "docid": "1abb9ed6de451d47c40e722e3908dc2e", "score": "0.61809635", "text": "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "title": "" }, { "docid": "1abb9ed6de451d47c40e722e3908dc2e", "score": "0.61809635", "text": "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "title": "" }, { "docid": "1abb9ed6de451d47c40e722e3908dc2e", "score": "0.61809635", "text": "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "title": "" }, { "docid": "1abb9ed6de451d47c40e722e3908dc2e", "score": "0.61809635", "text": "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "title": "" }, { "docid": "1abb9ed6de451d47c40e722e3908dc2e", "score": "0.61809635", "text": "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "title": "" }, { "docid": "1abb9ed6de451d47c40e722e3908dc2e", "score": "0.61809635", "text": "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "title": "" }, { "docid": "1abb9ed6de451d47c40e722e3908dc2e", "score": "0.61809635", "text": "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "title": "" }, { "docid": "1abb9ed6de451d47c40e722e3908dc2e", "score": "0.61809635", "text": "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "title": "" }, { "docid": "1abb9ed6de451d47c40e722e3908dc2e", "score": "0.61809635", "text": "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "title": "" }, { "docid": "1abb9ed6de451d47c40e722e3908dc2e", "score": "0.61809635", "text": "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "title": "" }, { "docid": "1abb9ed6de451d47c40e722e3908dc2e", "score": "0.61809635", "text": "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "title": "" }, { "docid": "a1f2e7a6bdb0834eccbb97e1641c0b5d", "score": "0.6166259", "text": "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "title": "" }, { "docid": "a1f2e7a6bdb0834eccbb97e1641c0b5d", "score": "0.6166259", "text": "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "title": "" }, { "docid": "a1f2e7a6bdb0834eccbb97e1641c0b5d", "score": "0.6166259", "text": "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "title": "" }, { "docid": "a1f2e7a6bdb0834eccbb97e1641c0b5d", "score": "0.6166259", "text": "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "title": "" }, { "docid": "a1f2e7a6bdb0834eccbb97e1641c0b5d", "score": "0.6166259", "text": "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "title": "" }, { "docid": "a1f2e7a6bdb0834eccbb97e1641c0b5d", "score": "0.6166259", "text": "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "title": "" }, { "docid": "a1f2e7a6bdb0834eccbb97e1641c0b5d", "score": "0.6166259", "text": "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "title": "" }, { "docid": "b8548dab04b0f128271316e8a01b796a", "score": "0.6145422", "text": "function coordsChar(cm, x, y) {\n\t var doc = cm.doc;\n\t y += cm.display.viewOffset;\n\t if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n\t var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n\t if (lineN > last)\n\t { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n\t if (x < 0) { x = 0; }\n\n\t var lineObj = getLine(doc, lineN);\n\t for (;;) {\n\t var found = coordsCharInner(cm, lineObj, lineN, x, y);\n\t var merged = collapsedSpanAtEnd(lineObj);\n\t var mergedPos = merged && merged.find(0, true);\n\t if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n\t { lineN = lineNo(lineObj = mergedPos.to.line); }\n\t else\n\t { return found }\n\t }\n\t}", "title": "" }, { "docid": "92f7560877d1b6501c7924c720775f5b", "score": "0.61439335", "text": "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n { lineN = lineNo(lineObj = mergedPos.to.line); }\n else\n { return found }\n }\n}", "title": "" }, { "docid": "92f7560877d1b6501c7924c720775f5b", "score": "0.61439335", "text": "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n { lineN = lineNo(lineObj = mergedPos.to.line); }\n else\n { return found }\n }\n}", "title": "" }, { "docid": "92f7560877d1b6501c7924c720775f5b", "score": "0.61439335", "text": "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n { lineN = lineNo(lineObj = mergedPos.to.line); }\n else\n { return found }\n }\n}", "title": "" }, { "docid": "92f7560877d1b6501c7924c720775f5b", "score": "0.61439335", "text": "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n { lineN = lineNo(lineObj = mergedPos.to.line); }\n else\n { return found }\n }\n}", "title": "" }, { "docid": "92f7560877d1b6501c7924c720775f5b", "score": "0.61439335", "text": "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n { lineN = lineNo(lineObj = mergedPos.to.line); }\n else\n { return found }\n }\n}", "title": "" }, { "docid": "92f7560877d1b6501c7924c720775f5b", "score": "0.61439335", "text": "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n { lineN = lineNo(lineObj = mergedPos.to.line); }\n else\n { return found }\n }\n}", "title": "" }, { "docid": "bd861bfd8ce3052ce02943e99f383a5d", "score": "0.60713375", "text": "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n}", "title": "" }, { "docid": "bd861bfd8ce3052ce02943e99f383a5d", "score": "0.60713375", "text": "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n}", "title": "" }, { "docid": "80180f391e0c8e20be5f492b0258fd79", "score": "0.6067026", "text": "function coordsChar(x, y) {\n if (y < 0) y = 0;\n var th = textHeight(), cw = charWidth(), heightPos = displayOffset + Math.floor(y / th);\n var lineNo = lineAtHeight(doc, heightPos);\n if (lineNo >= doc.size) return {line: doc.size - 1, ch: getLine(doc.size - 1).text.length};\n var lineObj = getLine(lineNo), text = lineObj.text;\n var tw = options.lineWrapping, innerOff = tw ? heightPos - heightAtLine(doc, lineNo) : 0;\n if (x <= 0 && innerOff == 0) return {line: lineNo, ch: 0};\n function getX(len) {\n var sp = measureLine(lineObj, len);\n if (tw) {\n var off = Math.round(sp.top / th);\n return Math.max(0, sp.left + (off - innerOff) * scroller.clientWidth);\n }\n return sp.left;\n }\n var from = 0, fromX = 0, to = text.length, toX;\n // Guess a suitable upper bound for our search.\n var estimated = Math.min(to, Math.ceil((x + innerOff * scroller.clientWidth * .9) / cw));\n for (;;) {\n var estX = getX(estimated);\n if (estX <= x && estimated < to) estimated = Math.min(to, Math.ceil(estimated * 1.2));\n else {toX = estX; to = estimated; break;}\n }\n if (x > toX) return {line: lineNo, ch: to};\n // Try to guess a suitable lower bound as well.\n estimated = Math.floor(to * 0.8); estX = getX(estimated);\n if (estX < x) {from = estimated; fromX = estX;}\n // Do a binary search between these bounds.\n for (;;) {\n if (to - from <= 1) return {line: lineNo, ch: (toX - x > x - fromX) ? from : to};\n var middle = Math.ceil((from + to) / 2), middleX = getX(middle);\n if (middleX > x) {to = middle; toX = middleX;}\n else {from = middle; fromX = middleX;}\n }\n }", "title": "" }, { "docid": "efbfabcc0d50cf9d87ae7cbeedd34e83", "score": "0.5911977", "text": "function _cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) {\n preparedMeasure = prepareMeasureForLine(cm, lineObj);\n }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) {\n m.left = m.right;\n } else {\n m.right = m.left;\n }\n return intoCoordSystem(cm, lineObj, m, context);\n }\n var order = getOrder(lineObj, cm.doc.direction),\n ch = pos.ch,\n sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) {\n return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\");\n }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos],\n right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert);\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) {\n val.other = getBidi(ch, other, sticky != \"before\");\n }\n return val;\n }", "title": "" }, { "docid": "3ec305f80c702182c2571b208b6cfff1", "score": "0.5905568", "text": "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "title": "" }, { "docid": "3ec305f80c702182c2571b208b6cfff1", "score": "0.5905568", "text": "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "title": "" }, { "docid": "3ec305f80c702182c2571b208b6cfff1", "score": "0.5905568", "text": "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "title": "" }, { "docid": "3ec305f80c702182c2571b208b6cfff1", "score": "0.5905568", "text": "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "title": "" }, { "docid": "3ec305f80c702182c2571b208b6cfff1", "score": "0.5905568", "text": "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "title": "" }, { "docid": "3ec305f80c702182c2571b208b6cfff1", "score": "0.5905568", "text": "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "title": "" }, { "docid": "3ec305f80c702182c2571b208b6cfff1", "score": "0.5905568", "text": "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "title": "" }, { "docid": "3ec305f80c702182c2571b208b6cfff1", "score": "0.5905568", "text": "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "title": "" }, { "docid": "3ec305f80c702182c2571b208b6cfff1", "score": "0.5905568", "text": "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "title": "" }, { "docid": "3ec305f80c702182c2571b208b6cfff1", "score": "0.5905568", "text": "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "title": "" }, { "docid": "3ec305f80c702182c2571b208b6cfff1", "score": "0.5905568", "text": "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "title": "" }, { "docid": "3ec305f80c702182c2571b208b6cfff1", "score": "0.5905568", "text": "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "title": "" }, { "docid": "3ec305f80c702182c2571b208b6cfff1", "score": "0.5905568", "text": "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "title": "" }, { "docid": "3ec305f80c702182c2571b208b6cfff1", "score": "0.5905568", "text": "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "title": "" }, { "docid": "3ec305f80c702182c2571b208b6cfff1", "score": "0.5905568", "text": "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "title": "" }, { "docid": "3ec305f80c702182c2571b208b6cfff1", "score": "0.5905568", "text": "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "title": "" }, { "docid": "3ec305f80c702182c2571b208b6cfff1", "score": "0.5905568", "text": "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "title": "" }, { "docid": "3ec305f80c702182c2571b208b6cfff1", "score": "0.5905568", "text": "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "title": "" } ]
29a5731e6d576a982a4c998ecbc6406f
get files only for given folder id
[ { "docid": "add4f1e07b5d1d0c3d0dc2d1029e9020", "score": "0.6659671", "text": "getSubTasksWithTaskId(folderId) {\n let realm = new Realm({schema: [TaskSchema, SubTaskSchema, NotesSchema]});\n const files = realm.objects('SUBTASK').filtered('taskId = $0', folderId);\n return files;\n }", "title": "" } ]
[ { "docid": "8868fa3224a120882872664b29dfb193", "score": "0.7237807", "text": "async function getFolderContent(id, userid) {\n var files;\n if (id) {\n files = await db.readDataPromise('file', { parent: id });\n } else {\n //Home directory\n files = await db.readDataPromise('file', { owner: userid, parent: null });\n }\n return files;\n}", "title": "" }, { "docid": "a87d2a89994695ccc4a012f4f08514c6", "score": "0.7111864", "text": "function getFiles(id) {\n user_id = id;\n getActivities(id);\n var request = new XMLHttpRequest();\n // If id is 0, get all user folders instead of files\n var obj = \"obj=\" + id.toString();\n var url = id == 0 ? \"folder_view.php\" : \"file_view.php\";\n request.open(\"POST\", url, true);\n request.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n request.onreadystatechange = function() {\n if (request.readyState == 4 && request.status == 200) {\n var return_data = request.responseText;\n document.getElementById(\"files\").innerHTML = return_data;\n }\n }\n request.send(obj);\n}", "title": "" }, { "docid": "52c77dde4aac23f513536b39cc9dfa88", "score": "0.70978147", "text": "function findFiles(auth, dir) {\n let query = \"?q='\" + dir + \"'+in+parents\"\n let headers = {\n \"Authorization\": \"Bearer \" + auth.credentials.access_token\n }\n\n let url = DRIVE_URL + query\n\n return axios({ url, headers }).then( res => {\n\n if ( !res.data.files ) throw new Error('folder not found')\n\n return res.data.files\n })\n}", "title": "" }, { "docid": "5668e47b3e2eae2e206b17a73d088221", "score": "0.67244583", "text": "function getFolderById(id) {\n\t\treturn this.prepare()\n\t\t\t.then((collection) => new Promise((resolve, reject) => collection.findOne({_id: id, type: 'folder'}, (error, result) => error ? reject(error) : resolve(result)) ));\n\t}", "title": "" }, { "docid": "684f6fcbeed4d35271656ad78565b1b9", "score": "0.6711679", "text": "function get_files(id) {\n return async function(dispatch){\n const res = await ThingiverseApi.getFiles(id)\n dispatch(got_files(res))\n }\n \n}", "title": "" }, { "docid": "34a4ed0e4546d8b5fbfa374593cf11fb", "score": "0.6435116", "text": "async getFiles(currId) {\n let response = await axios.get(\n `${API_URL}/needAssesments/{id}/fileForCurr?currId=${currId}`\n );\n return response.data.Files;\n }", "title": "" }, { "docid": "a10213c69a48600cc9d828756779b5da", "score": "0.6383492", "text": "function _getFileList(folder, callback) {\n var files = [];\n \n klaw(folder)\n .on('data', function(item) {\n if (item.stats.isFile() && isAllowed(item.path))\n files.push(item.path);\n })\n .on('end', function() {\n callback(files);\n });\n}", "title": "" }, { "docid": "3a5c0df8af99d9ad5589afb9992c54b3", "score": "0.62938315", "text": "function getFiles(folder) {\n // Only gets Docs files.\n const files = folder.getFilesByType(MimeType.GOOGLE_DOCS);\n let docIDs = [];\n while (files.hasNext()) {\n let file = files.next();\n docIDs.push(file.getId());\n }\n return docIDs;\n}", "title": "" }, { "docid": "89fb5551f02aba83ac0793dae2dbb48f", "score": "0.6211707", "text": "function findFiles(auth) {\n const service = google.drive('v3')\n const query = `'${DRIVE_ROOT}' in parents`\n service.files.list({\n auth: auth,\n corpus: 'user',\n q: query,\n pageSize: 1000,\n spaces: 'drive'\n }, (err, response) => {\n if (err) {\n rejectGetDriveDocuments(\n 'The API returned an error: ' + err)\n return\n }\n const files = response.files\n if (files.length == 0) {\n rejectGetDriveDocuments('No files found in the root')\n } else {\n _.forEach(files, (child) => {\n if (child.mimeType ===\n 'application/vnd.google-apps.folder') {\n FOLDERS.push({ path: child.name.trim(), id: child.id })\n }\n })\n getFiles(auth, files)\n }\n }\n );\n }", "title": "" }, { "docid": "089a326a6cf0a9bd84c65291dd507524", "score": "0.6210282", "text": "getAllMyFiles (scrpt_id) {\n\t\t\tthis.$axios.get('api/getAllMyFiles/'+scrpt_id).then(res => {\n\t\t\t\tthis.docFileArr = res.data.doc_file;\n\t\t\t\tthis.allFigFiles = res.data.fig_files;\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "0959c3623140ace7cdc47d7e8c583d9e", "score": "0.6174304", "text": "function getImages(folderId, limit, offset) {\n return new Promise(function(resolve, reject) {\n adminAPIClient.folders.get(folderId, generateSearchQueryParams(limit, offset), function (err, data) {\n if (err) { reject(err); }\n resolve(data);\n });\n });\n}", "title": "" }, { "docid": "427f21ca9aef87fa23412281e2379765", "score": "0.6133782", "text": "function listFiles(path) {\n var url = 'https://api.dropboxapi.com/2/files/list_folder';\n if (path === undefined || path === '') {\n path = ''\n }\n var data = {\n \"path\": path,\n \"include_media_info\": false,\n \"include_deleted\": false,\n \"include_has_explicit_shared_members\": false\n };\n return $.ajax({\n method: 'POST',\n url: url,\n data: JSON.stringify(data),\n beforeSend: function(request) {\n request.setRequestHeader(\"Authorization\", 'Bearer ' + access_token);\n request.setRequestHeader(\"Content-Type\", 'application/json; charset=utf-8');\n }\n });\n }", "title": "" }, { "docid": "93233bad00fc7d5c7107cfa02163b99a", "score": "0.60950494", "text": "function getFiles() {\n listFiles(function (err, files) {\n console.log(files);\n getService(function (service) {\n if (files && files.length) {\n files.forEach(function (file) {\n var filename = file.name;\n var dest = fs.createWriteStream(filename);\n var mimeType = mime.lookup(filename);\n if(mimeType) {\n service.files.get({\n fileId: file.id,\n alt: 'media'\n })\n .on('end', function () {\n console.log('Done');\n })\n .on('error', function (err) {\n console.log('Error during download', err);\n })\n .pipe(dest);\n } else {\n service.files.get({\n fileId: file.id,\n mimeType: 'application/*'\n })\n .on('end', function () {\n console.log('Done');\n })\n .on('error', function (err) {\n console.log('Error during download', err);\n })\n .pipe(dest);\n }\n });\n }\n });\n });\n}", "title": "" }, { "docid": "5bf9d875fca4c43896af5a5927a298c5", "score": "0.6069115", "text": "function _getFilesInFolder(dir) {\n var results = [];\n fs.readdirSync(dir).forEach(function(file) {\n file_dir = dir+'/'+file;\n var stat = fs.statSync(file_dir);\n if (stat && stat.isDirectory()) {\n results = results.concat(_getAllFilesFromFolder(file_dir));\n } else results.push(file);\n\n });\n return results;\n}", "title": "" }, { "docid": "7f80f62fab2203d86b570a49fcd24de0", "score": "0.6053638", "text": "function get_file_array_from_google_drive_(folder_object) {\n \n var return_array = [];\n \n var files = folder_object.getFiles();\n \n while (files.hasNext()){\n var file = files.next();\n \n var this_file = {};\n \n this_file.id = file.getId();\n this_file.name = file.getName();\n this_file.url = file.getUrl();\n\n return_array.push(this_file);\n\n }\n\n return return_array;\n}", "title": "" }, { "docid": "716974971e954eccfcade9ef5b731106", "score": "0.60413295", "text": "async function getAllFiles() {\n console.log(path)\n const url = `/api/allFiles?location=${path}`\n const response = await fetch(url)\n const allFiles = await response.json()\n console.log(allFiles)\n generateFileList(allFiles)\n}", "title": "" }, { "docid": "fac4a640e1c6d42667060c8ee9c29200", "score": "0.6040623", "text": "function getFiles(dir) {\n let files = [];\n let readDir = fs.readdirSync(root + dir);\n for (let file of readDir) {\n let path = dir + \"/\" + file;\n if (fs.statSync(root + path).isDirectory()) {\n files.push({ name: file, files: getFiles(path), icon: \"far fa-folder\" });\n } else {\n let mimeType = mime.lookup(file);\n if (!mimeType) continue;\n\n let type = mimeType.replace(/\\/.*/, \"\");\n let typeParam = TYPE_PARAMS[type];\n if (!typeParam) continue;\n\n files.push({\n name: file,\n path: path,\n mimeType: mimeType,\n icon: typeParam.icon,\n onClick: typeParam.onClick\n });\n }\n }\n return files;\n}", "title": "" }, { "docid": "b66c972aa916455b8f9f40f40ef3ed7b", "score": "0.6036105", "text": "function getYearFolders(id) {\n getActivities(id);\n user_id = id;\n var request = new XMLHttpRequest();\n var obj = \"obj=\" + id.toString();\n var url = \"year_folder_view.php\";\n request.open(\"POST\", url, true);\n request.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n request.onreadystatechange = function() {\n if (request.readyState == 4 && request.status == 200) {\n var return_data = request.responseText;\n document.getElementById(\"files\").innerHTML = return_data;\n }\n }\n request.send(obj);\n}", "title": "" }, { "docid": "e3c0c5321e191d4f5c2aa3bfdd8105df", "score": "0.60358554", "text": "function getAllFilePaths() {\n \n //holds all the file paths being tracked by storyteller\n var allFilePaths = [];\n \n //go through each file/dir mapping\n for(var filePath in pathToIdMap) {\n if(pathToIdMap.hasOwnProperty(filePath)) {\n \n //if the file exists in the allFiles collection we know it is a file\n if(allFiles[getIdFromFilePath(filePath)]) {\n allFilePaths.push(filePath); \n }\n }\n }\n \n return allFilePaths;\n}", "title": "" }, { "docid": "b8a37e12ad6d8b35ae41932ca18b6373", "score": "0.60147387", "text": "downloadFiles(param) {\n let auth = this.auth;\n if (typeof param != \"undefined\") {\n console.error(`This function does not take any parameter`);\n return;\n }\n const drive = google.drive({ version: 'v3', auth });\n drive.files.list({\n pageSize: 10,\n fields: 'nextPageToken, files(id, name)',\n }, (err, res) => {\n if (err) return console.log('The API returned an error: ' + err);\n const files = res.data.files;\n if (files.length) {\n files.map((file) => {\n downloadFile(file.id);\n });\n } else {\n console.log('No files found.');\n }\n });\n }", "title": "" }, { "docid": "b6e8426deb9fa28e193d33a484c5c953", "score": "0.5937402", "text": "function findFilesInDir(pathFolder, filter, isDeleteOther){\n var arrResult = [];\n \n if (!fs.existsSync(pathFolder)){\n console.log(\"no dir \", pathFolder);\n return;\n }\n \n var files = fs.readdirSync(pathFolder);\n\n for(var i = 0; i < files.length; i++){\n var filename = path.join(pathFolder, files[i]);\n\n if (filename.indexOf(filter) == (filename.length - filter.length)) {\n arrResult.push(filename);\n }\n else {\n if (isDeleteOther) {\n // Delete file\n if(fs.lstatSync(filename).isDirectory() == false) {\n fs.unlinkSync(filename);\n }\n }\n }\n };\n \n return arrResult;\n}", "title": "" }, { "docid": "48292be8e0c1f2f436120f2979342228", "score": "0.5915968", "text": "function getFiles(dir) {\n\n // get all 'files' in this directory synchronously\n var all = fs.readdirSync(dir);\n\n // process each checking directories and saving files\n return all.map(file => {\n // console.log(file);\n // am I a directory?\n if (fs.statSync(`${dir}/${file}`).isDirectory()) {\n // recursively scan me for my files\n return getFiles(`${dir}/${file}`);\n }\n // could be something else here!!!\n return `${dir}/${file}`; \n });\n\n}", "title": "" }, { "docid": "66a44d0fa63fdd459ca60f65c1cccc57", "score": "0.5910156", "text": "function getFiles(folder, fileList) {\n fileList = fileList || [];\n\n var files = fs.readdirSync(folder);\n //console.log(files);\n\n // recursively gets images in folder and its subfolders\n for (var i in files) {\n if (!files.hasOwnProperty(i)) continue;\n var name = folder + \"/\" + files[i];\n if (fs.statSync(name).isDirectory()) { \n getFiles(name, fileList);\n } else if (name.toUpperCase().endsWith(\".JPG\") || name.toUpperCase().endsWith(\".JPEG\")) {\n fileList.push(name);\n //console.log(name);\n }\n }\n return fileList;\n }", "title": "" }, { "docid": "ef1078e4ddfc9ae6856a385bb5adb2ed", "score": "0.58926433", "text": "listFiles() {\n var filesSetState=this.filesSetState;\n gapi.client.drive.files.list({\n 'pageSize': 1000,\n 'fields': \"nextPageToken, files(id, name)\",\n 'supportsTeamDrives':false,\n 'q':\"mimeType contains 'application/vnd.ms-excel' or mimeType contains 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'\"\n }).then(function(response) {\n filesSetState(response.result.files);\n \n });\n\n this.setState({\n loading:'true'\n })\n }", "title": "" }, { "docid": "3500c5b765443baebad4b60363a420f6", "score": "0.5886025", "text": "getFolderCalendars(folderId, sort, page, pageSize) {\n const params = new Array();\n if (folderId != null) {\n params.push(`folderId=${folderId}`);\n }\n if (sort != null) {\n params.push(`sort=${sort}`);\n }\n if (page != null) {\n params.push(`page=${page}`);\n }\n if (pageSize != null) {\n params.push(`pageSize=${pageSize}`);\n }\n return this.rest.get(`${this.baseUrl}/folder`, ...params);\n }", "title": "" }, { "docid": "4b76282c94325295e872d9884cb5a67a", "score": "0.58825684", "text": "function listFilesInDynamo(folderName, cb, startKey) {\n var params = {\n TableName: 'globalcontenttable',\n KeyConditionExpression: 'folder = :foldname',\n ExpressionAttributeValues: {\n \":foldname\": folderName\n },\n ExclusiveStartKey: startKey,\n }\n\n dynDB.query(params, function (err, data) {\n if (err) {\n return cb(err);\n }\n\n for (item of data.Items) {\n appendFileToList(item.file_key);\n }\n\n if (data.LastEvaluatedKey) {\n // if LastEvaluatedKey is set, it means there are more files\n // to fetch, so we call the listFilesinDynamo recursively\n return listFilesinDynamo(folderName, cb, data.LastEvaluatedKey);\n } else {\n return cb(null);\n }\n })\n}", "title": "" }, { "docid": "a1ff0a9f4a8f99b951050a62d1f65ec4", "score": "0.58743775", "text": "getFolderItems(folderPath) {\r\n return new Promise(function (resolve, reject) {\r\n fs.readdir(folderPath, function (err, items) {\r\n if (err) {\r\n return reject(err);\r\n }\r\n var results = [];\r\n items.forEach(item => {\r\n try {\r\n results.push(new FileInfo_1.FileInfo(path.join(folderPath, item)));\r\n }\r\n catch (err) {\r\n // silently ignore permissions errors\r\n }\r\n });\r\n resolve(results);\r\n });\r\n });\r\n }", "title": "" }, { "docid": "d38f0889c1b252f5aff461dc4589c26c", "score": "0.5820127", "text": "async listFilesWithoutFolders(params = {}) {\n let { extraQ = '' } = params;\n if (extraQ === '') extraQ = 'mimeType != \\'application/vnd.google-apps.folder\\'';\n\n if (!extraQ.includes('mimeType')) extraQ += ' and mimeType != \\'application/vnd.google-apps.folder\\'';\n return this.listFiles({\n ...params,\n extraQ,\n });\n }", "title": "" }, { "docid": "a7564c9af4e4eb6fdaef964730077156", "score": "0.58168095", "text": "function getFiles(auth, files, i = 0) {\n console.log('length: ', files.length)\n console.log('i: ', i)\n console.log('-')\n const service = google.drive('v3');\n if (i < files.length) {\n let promisesNumber = PROMISES\n if (i + PROMISES > files.length) {\n promisesNumber = (i + PROMISES) - files.length\n }\n const slice = files.slice(i, i + promisesNumber)\n let promises = []\n _.forEach(slice, function (file) {\n const query = `'${file.id}' in parents`\n promises.push(new Promise((resolve, reject) => {\n service.files.list({\n auth: auth,\n corpus: 'user',\n q: query,\n pageSize: 1000,\n spaces: 'drive'\n }, (err, response) => {\n if (err) {\n return reject('The API returned an error: ' + err)\n }\n const fileChildren = response.files;\n let foundFolders = []\n if (fileChildren.length > 0) {\n _.forEach(fileChildren, (child) => {\n if (child.mimeType ===\n 'application/vnd.google-apps.folder') {\n if (file.path) {\n child.country = file.country\n child.path = `${file.path}/${child.name}`\n } else {\n child.country = file.name.trim()\n child.path = `${child.country}/${child.name.trim()}`\n }\n foundFolders.push(child)\n FOLDERS.push({ path: child.path, id: child.id })\n } else {\n child.country = file.country\n child.path = file.path\n child.parentId = file.id\n child.fiscalYear = \"\"\n child.type = \"\"\n if (child.path) {\n if (child.path.split('/').length > 1) {\n child.type = file.path.split('/')[1].trim()\n }\n if (child.path.split('/').length > 2) {\n child.fiscalYear = file.path\n .split('/')[2]\n .match(/\\d+-\\d+|\\d+/g)\n if (Array.isArray(child.fiscalYear)) {\n child.fiscalYear = child.fiscalYear.join()\n }\n }\n }\n delete child.kind\n delete child.mimeType\n FILES.push(child)\n }\n })\n }\n resolve(foundFolders)\n }\n );\n }));\n })\n Promise.all(promises).then(function (res) {\n _.forEach(res, (foundFolders) => {\n files = files.concat(foundFolders)\n })\n getFiles(auth, files, i + promisesNumber)\n }, function (res) {\n rejectGetDriveDocuments(res)\n })\n } else {\n fs.writeFile('driveDocuments2.json', JSON.stringify(FILES));\n resolveGetDriveDocuments({ documents: FILES, paths: FOLDERS })\n }\n }", "title": "" }, { "docid": "e2f120d21ed5a20487432546d1f8abc7", "score": "0.57990146", "text": "function getTargetFiles(root, date) {\n \n var student_upload_folder = DocsList.getFolder(root) // Weekly Comments folder ID tag\n \n // this gets the list of subfolders inside the parent uploads folder, ie. folders for each week \n // naming convention: MM/DD [Faculty Surname] - [Listed Topic]\n var upload_subfolders = student_upload_folder.getFolders();\n \n // iterate through weekly folder names\n for (var i = 0; i < upload_subfolders.length; i++) {\n \n var fname = upload_subfolders[i].getName();\n \n var date_regex = new RegExp(\"^\"+date+\".*\")\n \n // search folder names for one that has our target date\n if (date_regex.exec(fname)) {\n \n // when we have a match (there should be only one), get all of the files from that folder\n // these are the students' individual comment docs\n var target_dir = upload_subfolders[i]\n break;\n }\n }\n \n return target_dir.getFiles();\n}", "title": "" }, { "docid": "8d90ccc39b73d9395e29b42d677eeefd", "score": "0.5781643", "text": "function getFiles(dir, files_) {\r\n files_ = files_ || [];\r\n if (typeof files_ === 'undefined') {\r\n files_ = [];\r\n }\r\n\r\n var files = fs.readdirSync(dir);\r\n for (var i in files) {\r\n if (!files.hasOwnProperty(i)) {\r\n continue;\r\n }\r\n\r\n var name = dir + '/' + files[i];\r\n if (fs.statSync(name).isDirectory()) {\r\n getFiles(name, files_);\r\n } else {\r\n files_.push(name);\r\n }\r\n }\r\n return files_;\r\n}", "title": "" }, { "docid": "c5d5e32d90d7c08be8d3b8b9f2d30175", "score": "0.5773993", "text": "function setFileID() {\n // Create a new Deferred object\n var deferred = $.Deferred();\n console.log(\"list files\");\n gapi.client.drive.files.list({\n 'q': '\\'appdata\\' in parents',\n 'maxResults': 10\n }).then(function (response) {\n console.log(\"Files:\");\n appendPre('Files:');\n var files = response.result.items;\n if (files && files.length > 0) {\n for (var i = 0; i < files.length; i++) {\n var file = files[i];\n \n if (file.title == FILENAME) {\n fileId = file.id;\n console.log(\"fileId\" + fileId);\n deferred.resolve();\n }\n }\n } else {\n console.log(\"No files found\");\n appendPre('No files found.');\n deferred.resolve();\n\n\n }\n });\n\n // Return the Deferred's Promise object\n return deferred.promise();\n }", "title": "" }, { "docid": "cd7630547780b1064d760ebc59688673", "score": "0.57521385", "text": "getDocumentFiles(id) {\n return this.promisify(cb => super.getDocumentFiles(id, cb))\n }", "title": "" }, { "docid": "e9cf68e8ad5dd0d0804f6b05dd9e415b", "score": "0.575068", "text": "function getDirFiles(theDirectory){\n return new Promise($.async(function (resolve, reject) {\n try {\n $.fs.readdir(theDirectory, function (err, files) {\n if (err) {\n resolve([])\n }\n resolve(files);\n });\n }\n catch (error) {\n resolve([])\n }\n }));\n\n \n\n \n\n}", "title": "" }, { "docid": "92fc48e8da95a31bb1eadc280503d252", "score": "0.5747603", "text": "async function getFiles(foldername) {\n\n let _foldername = foldername;\n let _path = bashpath + foldername;\n console.log(_path);\n console.log(fs.existsSync(_path));\n if (!fs.existsSync(_path)) {\n try {\n fs.mkdir(_path);\n } catch (error) {\n console.error(\"create folder fail \" + _path);\n }\n\n } else {\n try {\n let fileList = await fs.readdir(_path);\n return fileList;\n } catch (error) {\n console.error(\"no folder\" + _path);\n try {\n fs.mkdir(_path);\n } catch (error) {\n console.error(\"create folder fail \" + _path);\n }\n }\n \n \n }\n\n\n}", "title": "" }, { "docid": "dd33a7307351dbe42ddbc2baf86b9214", "score": "0.5743307", "text": "function folderIds(){\n var folders = DriveApp.getFolders();\n while (folders.hasNext()) {\n var folder = folders.next();\n Logger.log(folder.getName() + ' - ' + folder.getId());\n }\n}", "title": "" }, { "docid": "f20ea00c9e451ceb2624a04aeabdf8f1", "score": "0.57410485", "text": "function searchByPath(dir) {\n\t\t var\tdemo = response;\n\t\t\tvar path = [data.name].concat(dir.split(data.name)[1].split(\"/\").filter(function(e){return e}));\n\t\t\tvar\tflag = 0;\n\n\t\t\tfor(var i=0;i<path.length;i++){\n\t\t\t\tfor(var j in demo){\n\t\t\t\t\tif(demo[j].name === path[i]){\n\t\t\t\t\t\tflag = 1;\n\t\t\t\t\t\tif (demo[j].type === 'folder') {\n\t\t\t\t\t\t demo = demo[j].items;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t demo = demo[j];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tdemo = flag ? demo : [];\n\t\t\treturn demo;\n\t\t}", "title": "" }, { "docid": "38e7b557828e67c87d5fc71711b95b79", "score": "0.5733016", "text": "function filesInDir(dir) {\n return Q.nfcall(fs.readdir, dir).catch(() => []);\n}", "title": "" }, { "docid": "6fef594e77d04a4c0feea891ee166720", "score": "0.57076234", "text": "function getFilesFromFolder(packageName,folder){\n // local imports\n var _=Npm.require(\"underscore\");\n var fs=Npm.require(\"fs\");\n var path=Npm.require(\"path\");\n // helper function, walks recursively inside nested folders and return absolute filenames\n function walk(folder){\n var filenames=[];\n // get relative filenames from folder\n var folderContent=fs.readdirSync(folder);\n // iterate over the folder content to handle nested folders\n _.each(folderContent,function(filename){\n // build absolute filename\n var absoluteFilename=folder+path.sep+filename;\n // get file stats\n var stat=fs.statSync(absoluteFilename);\n if(stat.isDirectory()){\n // directory case => add filenames fetched from recursive call\n filenames=filenames.concat(walk(absoluteFilename));\n }\n else{\n // file case => simply add it\n filenames.push(absoluteFilename);\n }\n });\n return filenames;\n }\n // save current working directory (something like \"/home/user/projects/my-project\")\n var cwd=process.cwd();\n // chdir to our package directory\n process.chdir(\"packages\"+path.sep+packageName);\n // launch initial walk\n var result=walk(folder);\n // restore previous cwd\n process.chdir(cwd);\n return result;\n}", "title": "" }, { "docid": "f054980db81e4ced3d3912a546437097", "score": "0.5695811", "text": "function walk(folder){\n var filenames=[];\n // get relative filenames from folder\n var folderContent=fs.readdirSync(folder);\n // iterate over the folder content to handle nested folders\n _.each(folderContent,function(filename){\n // build absolute filename\n var absoluteFilename=folder+path.sep+filename;\n // get file stats\n var stat=fs.statSync(absoluteFilename);\n if(stat.isDirectory()){\n // directory case => add filenames fetched from recursive call\n filenames=filenames.concat(walk(absoluteFilename));\n }\n else{\n // file case => simply add it\n filenames.push(absoluteFilename);\n }\n });\n return filenames;\n }", "title": "" }, { "docid": "710692815c51f01d9acf1178d84d7b3c", "score": "0.5693189", "text": "function getAllImages(folderId, limit) {\n var offset = 0;\n function getMoreImages() {\n return getImages(folderId, limit, offset).then(function(data) {\n offset += limit;\n if (data.item_collection.total_count > offset) {\n return addImagesToArray(data).then(getMoreImages);\n } else {\n return addImagesToArray(data);\n }\n });\n }\n return getMoreImages(); \n}", "title": "" }, { "docid": "ab65461d03d1b1ebaae2a6102692b5ba", "score": "0.56925595", "text": "function getFiles(dir) {\n return fse.statSync(dir).isDirectory()\n ? Array.prototype.concat(...fse.readdirSync(dir).map(f => getFiles(path.join(dir, f))))\n : dir;\n}", "title": "" }, { "docid": "6d4d4dc996a33e5e31311f7e0aad60e8", "score": "0.5691259", "text": "async function getFolder (ctx, next) {\n const folderId = ctx.params.id || null\n try {\n let folderPromise\n if (folderId) {\n folderPromise = Folder\n .findOne({_id: folderId})\n .select(FOLDER_LIST_SCREEN)\n } else {\n folderPromise = Promise.resolve({\n name: 'root'\n })\n }\n\n const childFoldersPromise = Folder\n .find({parent: folderId})\n .select(FOLDER_LIST_SCREEN)\n\n const filesPromise = File\n .find({folder: folderId})\n .select(FILE_SCREEN)\n\n let [folder, childFolders, files] =\n await Promise.all([folderPromise, childFoldersPromise, filesPromise])\n\n if (folder === null) {\n throw new Error('FolderNotFound')\n }\n\n let ancestors = []\n if (folder.getAncestors) {\n ancestors = await folder.getAncestors({}, '_id name').exec()\n console.log(ancestors)\n folder = folder.toJSON() // It's not root\n }\n\n folder.childFolders = childFolders\n folder.files = files\n folder.ancestors = ancestors\n\n ctx.body = folder\n } catch (e) {\n if (e.name === 'CastError') {\n ctx.throw(400, 'Invalid ID')\n }\n if (e.message === 'UserNotFound') {\n ctx.throw(404, 'User not found')\n }\n log(e)\n throw new Error()\n }\n}", "title": "" }, { "docid": "cb785fd99e3b3dc8ddc5ec03352c7d16", "score": "0.568444", "text": "function readDir_getPaths(folder_path) {\n\treturn new Promise((resolve,reject) => {\n\t\tfs.readdir(folder_path, (err,files) => {\n\t\t\tif (err) {\n\t\t\t\treject(err);\n\t\t\t} else {\n\t\t\t\tresolve(JSON.stringify(files.map(file_name => folder_path + \"/\" + file_name)));\n\t\t\t}\n\t\t})\n\t})\n}", "title": "" }, { "docid": "671fedfa848783ccc582b9a9755e59c4", "score": "0.5683871", "text": "function exploreLocalFoldersFiles(folderPath) {\n const dirents = fs.readdirSync(folderPath, { withFileTypes: true })\n const folderNames = dirents\n .filter(dirent => dirent.isDirectory())\n .map(dirent => dirent.name);\n const fileNames = dirents\n .filter(dirent => !dirent.isDirectory())\n .map(dirent => dirent.name);\n\n const folders = folderNames.map(folderName => {\n return exploreLocalFolder(folderPath, folderName);\n });\n const files = fileNames.map(fileName => {\n return new File(DUMMY_ID, fileName);\n });\n\n return { 'folders': folders, 'files': files };\n}", "title": "" }, { "docid": "eb82334657a2b469cf215ceaecc3e411", "score": "0.5673914", "text": "function searchByPath(dir) {\n\n var path = dir.split('/'),\n demo = response,\n flag = 0;\n console.log(\"patssssh===\", path);\n for (var i = 0; i < path.length; i++) {\n for (var j = 0; j < demo.length; j++) {\n\n if (demo[j].name === path[i]) {\n console.log(\"currentPath\", currentPath);\n var aa = currentPath.split(\"/\");\n var currn_fol = aa[aa.length - 1];\n if (currn_fol == demo[j].name) {\n jQuery(\"#folder_iddd\").val(demo[j].id);\n jQuery(\"#folder_parent_id\").val(demo[j].id);\n }\n //console.log(\"currentfolder_id == \",demo[j].name+\"==\"+demo[j].id);\n flag = 1;\n demo = demo[j].items;\n break;\n }\n }\n }\n\n demo = flag ? demo : [];\n return demo;\n }", "title": "" }, { "docid": "a6a950379f6b47b2cc6f3a48eebed273", "score": "0.564578", "text": "getJavascriptFiles(startPath,filter,callback){\n const self = this;\n if(self.getterIsExtracted()){ // If extraction is successful\n if (!fs.existsSync(startPath)){ // If path does exist\n console.log(\"no dir \",startPath);\n return;\n }\n const files = fs.readdirSync(startPath);\n for(let i = 0; i < files.length; i++){\n const filename=path.join(startPath,files[i]);\n const stat = fs.lstatSync(filename);\n if (stat.isDirectory()){\n this.getJavascriptFiles(filename,filter,callback); //recursive function\n }\n else if (filter.test(filename)) callback(filename);\n }\n\n this.directory.length > 0 && self.setterIsHybrid(true);\n }\n }", "title": "" }, { "docid": "0cc918aa2747203bbb90d29efda347f6", "score": "0.5633874", "text": "function getFilesThatShareTag(caseId, tagger) {\n return File.query()\n .select(\n \"Files.file_name\",\n \"Files.file_d3\",\n \"Files.file_description\",\n \"tag_d3\",\n \"Files.case_id\",\n \"tag\"\n )\n .from(\"Tags\")\n .join(\"Files\")\n .groupBy(\"file_d3\")\n .where(\"tag\", \"=\", tagger)\n .andWhere(\"Files.case_id\", \"=\", caseId)\n .then(response => {\n return response;\n });\n}", "title": "" }, { "docid": "472d0f6482b52b5cf191b3edf0f7f5ef", "score": "0.5614778", "text": "function listFoldersFiles(directory){\n currentDir = directory;\n if (currentDir.name == 'storage'){\n $('#browse_back_btn').prop('disabled','true');\n }else{\n $('#browse_back_btn').removeAttr('disabled');\n }\n $('#filesystem_navigation_list li').empty();\n var dirReader = directory.createReader();\n dirReader.readEntries(fillFileSystemNavList,errorLog);\n}", "title": "" }, { "docid": "ab89daed920d4f46e81b4e2210b6724d", "score": "0.5611184", "text": "async getAllFilesOfLocalDirectoryRecursively(path){\n try{\n const items = await fs.promises.readdir(path).then(async data => {\n let files = [];\n for(let item of data){\n const isItemDir = await fs.promises.stat(`${path}/${item}`).then(stats => {return stats.isDirectory()}).catch(error => {return false;});\n if(isItemDir){\n const filesOfCurrentDir = await this.getAllFilesOfLocalDirectoryRecursively(`${path}/${item}`);\n files = [...files, ...filesOfCurrentDir];\n }else{\n files.push(`${path}/${item}`);\n }\n }\n\n return files;\n }).catch(error => {\n return [];\n });\n\n return items;\n }catch(error){ Logger.log(error); }\n\n return [];\n }", "title": "" }, { "docid": "d8260c46b46bc92c0978db5bd384025e", "score": "0.56090355", "text": "function getFolderContents(folder, objPath, callback) {\n if (progressWindow) {\n progressWindow.webContents.send('message', {command: \"updateFolder\", data: folder});\n\n fs.readdir(folder, (err, files) => {\n if (err) {\n callback(err);\n } else {\n getEachFolderItem(files, 0, folder, objPath, callback);\n }\n });\n } else {\n callback(\"Progress Window is null\");\n }\n}", "title": "" }, { "docid": "dc120635fb1d8feab982a1b7980e81d3", "score": "0.56082714", "text": "function getFiles(srcpath) {\r\n return fs.readdirSync(srcpath);\r\n}", "title": "" }, { "docid": "3a81a5fd6bafb15788a19ec1c5892153", "score": "0.55969214", "text": "function getFiles(dir) {\n return fs.readdirSync(path.join(__dirname, '..', dir))\n .filter(file => file.endsWith('.md') && file !== 'README.md');\n}", "title": "" }, { "docid": "70dc0316491a83bc55d00cfb2d179719", "score": "0.5584699", "text": "async function folderList () {\n return bucket.getFiles({\n // TODO: changing frequency may break this?\n maxResults: 365 * 24 / config.get('archiver.frequency'),\n delimiter: '/',\n }).then((data) => {\n const response = data[2];\n return response.prefixes.map(val => val.replace(/\\//, ''));\n });\n}", "title": "" }, { "docid": "73a63c4a369952210c22b11771253da7", "score": "0.5577251", "text": "function getFiles(path, callback){\n url = '/api/files';\n\n if(path){\n url += '?path=' + path;\n }\n\n $.ajax({\n url: url,\n type: 'GET',\n success: function(files){\n callback(files);\n },\n error: function(err){\n $.bootstrapGrowl('Unable to get files.', {\n type: 'danger',\n align: 'center',\n width: 'auto',\n allow_dismiss: false\n });\n }\n });\n }", "title": "" }, { "docid": "d90aefde96da0e92ad8e16cd3e7b5a1e", "score": "0.557714", "text": "async searchLocalFiles(dirPath, query){\n if(dirPath.toString().trim() === \"*\"){\n dirPath = this.config.basePath;\n }\n\n const isValid = await this.doesLocalPathExists(dirPath);\n if(isValid){\n const isDir = await this.isLocalPathOfDirectory(dirPath);\n if(isDir){\n var files = [];\n if(dirPath.toString().trim() === this.config.basePath){\n // gets full paths, basePath + folder + name\n files = await this.getAllFilesOfLocalDirectoryRecursively(dirPath);\n }else{\n // gets only names\n files = await fs.promises.readdir(dirPath).then(data => {\n return data;\n }).catch(error => {\n return [];\n });\n }\n\n let filteredFiles = [];\n const querySplit = query ? query.toLowerCase().split(\":\") : [null, null];\n const queryType = querySplit[0];\n const queryParam = querySplit[1];\n\n if(query !== null && typeof query === \"string\"){\n if(queryType === \"extension\"){\n filteredFiles = files.filter(file => {\n return path.extname(file).replace(\".\", \"\").toLowerCase() == queryParam;\n });\n }else{\n if(queryType === \"name\"){\n filteredFiles = files.filter(file => {\n let parse = path.parse(file);\n return parse.base.replace(parse.ext, \"\").toLowerCase() == queryParam;\n });\n }else{\n if(queryType === \"name_contains\"){\n filteredFiles = files.filter(file => {\n let parse = path.parse(file);\n return parse.base.replace(parse.ext, \"\").toLowerCase().includes(queryParam);\n });\n }else{ filteredFiles = files; }\n }\n }\n }else{ filteredFiles = files; }\n\n let finalFiles = [];\n for(let file of filteredFiles){\n let fpath = ( dirPath === this.config.basePath ? file : (dirPath+(dirPath === \"\" ? \"\" : \"/\")+file) ); // getAllFilesOfLocalDirectoryRecursively returns full paths\n const fileObj = await this.getLocalFile(fpath); // Get data for each local file.\n if(fileObj !== null){\n finalFiles.push(fileObj);\n }\n }\n\n return finalFiles;\n }\n }\n\n return [];\n }", "title": "" }, { "docid": "5aa36d183ae9c0ab14645d2464282522", "score": "0.55744714", "text": "function downloadFolder(iFolder , iCourse){\n //create the array of files to download\n var aIds = new Array();\n aIds[0] = iFolder;\n \n \n \n //download the files\n ksDownloadFiles([] , aIds , iCourse);\n \n \n}", "title": "" }, { "docid": "9f240174f26722b97933ac929020f686", "score": "0.5568167", "text": "function getFiles(cb) {\n\t\t$.ajax({\n\t\t\turl: '/api/v1/files',\n\t\t\tmethod: 'get',\n\t\t\tdataType: 'json',\n\t\t\tcache: false,\n\t\t\tsuccess: function(data) {\n\t\t\t\tif(data.status !== 'success') {\n\t\t\t\t\t//$('#import_file_modal .error-msg').text(data.message);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif(typeof cb === 'function') cb(data);\n\t\t\t\t}\n\t\t\t},\n\t\t\terror: function(err) {\n\t\t\t\tif(typeof ShopifyApp !== 'undefined') ShopifyApp.flashError(err.message);\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "f135133a6abb09bda4c2770a22055e4a", "score": "0.55583304", "text": "async function getFolders(parent, args, access_token) {\n var {limit, group_id} = args;\n // -- Valores por defecto de los parámetros -- \n var group_id_Parameter = \"&group_id=\" //Valor por defecto cuando se solicita una vista\n if (group_id + \"\" === \"undefined\") {\n var group_id_Parameter = \"\";\n group_id = \"\";\n } //En caso de no solicitar ninguna vista de Documentos\n if (limit + \"\" === \"undefined\") {\n limit = \"20\";\n }\n console.log(`${baseURL}/folders?limit=${limit}${group_id_Parameter}${group_id}`)\n return await fetch(`${baseURL}/folders?limit=${limit}${group_id_Parameter}${group_id}`, {headers: {'Authorization': `bearer ${access_token}`}})\n .then( res => res.text())\n .then( data => buildResponse(data))\n .then( data => setResponse(data, \"get\",[\"folder-list\", 'folder', 'GET', 'Q'], access_token));\n}", "title": "" }, { "docid": "ba13c68e13378783de5e15133c8993cf", "score": "0.5531815", "text": "getFolderSchedules(folderId, sort, page, pageSize) {\n const params = new Array();\n if (folderId != null) {\n params.push(`folderId=${folderId}`);\n }\n if (sort != null) {\n params.push(`sort=${sort}`);\n }\n if (page != null) {\n params.push(`page=${page}`);\n }\n if (pageSize != null) {\n params.push(`pageSize=${pageSize}`);\n }\n return this.rest.get(`${this.baseUrl}/folder`, ...params);\n }", "title": "" }, { "docid": "2e8aa149a55130064e49fa56180cab9b", "score": "0.5528955", "text": "static async getFolder(context, path) {\n const folderPath = EncodeUtil_1.EncodeUtil.decodeUrlPart(context.repositoryPath + path_1.sep + path);\n try {\n await util_1.promisify(fs_1.access)(folderPath, constants_1.F_OK);\n }\n catch (err) {\n return null;\n }\n const folder = await util_1.promisify(fs_1.stat)(folderPath);\n if (!folder.isDirectory()) {\n return null;\n }\n return new DavFolder(folderPath, context, path, folder);\n }", "title": "" }, { "docid": "6ee5ad71246ebef0f31aada4634a353a", "score": "0.55117697", "text": "function selectFolder(elementId)\n{\n var entryid = dhtml.getElementById(elementId).folderentryid;\n var callBackData = new Object;\n callBackData.elementId = elementId;\n dhtml.getElementById(elementId.replace(\"_folder\",\"\")).checked = true;\n webclient.openModalDialog(module, \"selectfolder\", DIALOG_URL+\"task=selectfolder_modal&entryid=\" + entryid, 300, 300, folderCallBack, callBackData);\n}", "title": "" }, { "docid": "e4d7e84654ce9cf21dc482fe3ae5cef7", "score": "0.5499592", "text": "function downloadFiles(auth, param) {\n if (typeof param != \"undefined\") {\n console.error(`This function does not take any parameter`);\n return;\n }\n const drive = google.drive({ version: 'v3', auth });\n drive.files.list({\n pageSize: 10,\n fields: 'nextPageToken, files(id, name)',\n }, (err, res) => {\n if (err) return console.log('The API returned an error: ' + err);\n const files = res.data.files;\n if (files.length) {\n files.map((file) => {\n downloadFile(auth, file.id);\n });\n } else {\n console.log('No files found.');\n }\n });\n}", "title": "" }, { "docid": "4ec5afd7389665ef7512584eb276c0d6", "score": "0.54936486", "text": "static readFolderItems(folderPath, options) {\n return FileSystem._wrapException(() => {\n options = Object.assign(Object.assign({}, READ_FOLDER_DEFAULT_OPTIONS), options);\n const folderEntries = fsx.readdirSync(folderPath, { withFileTypes: true });\n if (options.absolutePaths) {\n return folderEntries.map((folderEntry) => {\n folderEntry.name = nodeJsPath.resolve(folderPath, folderEntry.name);\n return folderEntry;\n });\n }\n else {\n return folderEntries;\n }\n });\n }", "title": "" }, { "docid": "1b6d70063b23b00d088e97102c5a6959", "score": "0.548368", "text": "async function getData(dbx, options) {\n let folderId = ``\n try {\n if (options.path !== ``) {\n const folder = await getFolderId(dbx, options.path)\n folderId = folder.id\n }\n const files = await listFiles(dbx, folderId, options.recursive)\n return files\n } catch (e) {\n console.warn(e.error)\n return []\n }\n}", "title": "" }, { "docid": "7ac722cca50309a43d7ec65c45d7dd66", "score": "0.5477949", "text": "function IdToAllDataFilename(id) {\n return \"allData_\" + id + \".csv\";\n}", "title": "" }, { "docid": "66c122684df526a1104080ce6a9bd921", "score": "0.54717803", "text": "function getFilesInDirectory(path) {\n\treturn fs.readdirSync(path).filter(function (file) {\n\t\treturn !fs.statSync(path+'/'+file).isDirectory();\n\t});\n}", "title": "" }, { "docid": "4c3fe1c347ba450a909ae7fcf8c596a1", "score": "0.5468762", "text": "function get_cur_file_info_by_id(id){\n\tfile_to_operate_id = id;\t\n\telement_to_operate = document.getElementById(id);\n\tswitch(cur_dir_path){\n case 'root':\n\t file_to_operate_name = get_json_by_id(cur_dir_path, file_to_operate_id).type;\n break;\n case 'root/Pictures':\n\t file_to_operate_name = get_json_by_id(cur_dir_path, file_to_operate_id).filename;\n break;\n case 'root/Contacts':\n\t file_to_operate_name = get_json_by_id(cur_dir_path, file_to_operate_id).name;\n break;\n case 'root/Videos':\n\t file_to_operate_name = get_json_by_id(cur_dir_path, file_to_operate_id).name;\n break;\n\t}\n\t//element_to_operate.innerHTML;\t\n}", "title": "" }, { "docid": "4b2b5401aab3838cdac873b08621e943", "score": "0.5457337", "text": "function getFolder(folderPath) {\n\n //Use Creator Resource to get Files\n creatorResource.getFiles(folderPath).then(function (response) {\n $scope.folders = response.data.Folders;\n $scope.files = response.data.Files;\n $scope.currentFolder = response.data.CurrentFolder;\n });\n\n }", "title": "" }, { "docid": "69a26e67b0ac5e445b24c3bff1e37dbc", "score": "0.5452942", "text": "async function getFiles(dir) {\n const dirents = await readdir(dir, { withFileTypes: true });\n const files = await Promise.all(dirents.map((dirent) => {\n const res = resolve(dir, dirent.name);\n return dirent.isDirectory() ? getFiles(res) : res;\n }));\n return Array.prototype.concat(...files);\n}", "title": "" }, { "docid": "48b75fc1784871d8e22612e8db5c30a8", "score": "0.545072", "text": "function FoldersInSpecificFolder(FolderFullPath)\n{\n if(FolderFullPath == \"//\")\n {\n // Return the FolderIterator in Root.\n return getFolder(FolderFullPath);\n }\n else\n {\n // getFolder return the FolderIterator\n var TargetFolders = getFolder(FolderFullPath);\n while (TargetFolders.hasNext())\n {\n var folder = TargetFolders.next();\n return folder.getFolders();\n }\n } \n}", "title": "" }, { "docid": "69de197459142730af3ff574970e1a4e", "score": "0.544675", "text": "function loadFolder(id) {\n d_id_folder = id;\n jQuery('#subfoldertitle').text(\n jQuery('#folder_title_'+id).text()\n );\n jQuery('#subfoldertitle').show();\n jQuery('#folders').hide();\n jQuery('#menu_folder').hide();\n jQuery('#menu_youtube').show();\n jQuery('#folder_resources_'+id).show();\n}", "title": "" }, { "docid": "56bc9fb8e913727ebe06ab959371a02f", "score": "0.544281", "text": "function listFolderChildren() {\n const method = 'GET';\n const endpoint = baseUrl + 'api/v0/google/drive/Mod7SourceDocs';\n xhrCall(method, null, endpoint, listFolderChildrenOk, handlerFail);\n appendFeedback('Retrieving list of files to copy');\n}", "title": "" }, { "docid": "d70c488bcddaa7edf067f47d7d5cf0f0", "score": "0.543353", "text": "function getResultPath(uid) {\n return new Promise((resolve, reject) => {\n fs.readdir('.', (ferr, files) => { // '/' denotes the root folder\n if (ferr) {\n reject(ferr);\n return;\n }\n\n files.forEach((file) => {\n if (file.indexOf(uid) !== -1) {\n resolve(file);\n }\n });\n reject(new Error(`getResultPath() : file not found ${uid}`));\n });\n });\n }", "title": "" }, { "docid": "8fda6c52d21483fd5579bb37a8274cba", "score": "0.5410216", "text": "function findFiles(dir, fileFilter, dirFilter, contentFilter) {\n var results = [];\n try {\n fs.readdirSync(dir).forEach(function(fileName) {\n var file = dir + path.sep + fileName;\n try {\n var stat = fs.statSync(file);\n } catch (e) {\n var stat = false;\n }\n if (stat && stat.isDirectory()) {\n if (typeof dirFilter === 'undefined' || dirFilter.test(fileName)) {\n results = results.concat(findFiles(file, fileFilter, dirFilter, contentFilter));\n }\n } else if (stat && stat.isFile() && fileFilter.test(fileName)) {\n if (typeof contentFilter === 'undefined') {\n results.push(actualPath(file));\n } else {\n var content = fs.readFileSync(file).toString();\n if (contentFilter.test(content)) {\n results.push(actualPath(file));\n }\n }\n }\n });\n } catch (e) {\n // Doesn't matter\n }\n return results;\n}", "title": "" }, { "docid": "52772586494cd83469cf493cd09aa251", "score": "0.54092854", "text": "function GoogleDocsInSpecificFolder(docName, FolderFullPath)\n{\n if(FolderFullPath == \"//\")\n {\n // Read files in Root, getFilesByName return the FileIterator\n var RootDocs = DriveApp.getRootFolder().getFilesByName(docName);\n return RootDocs;\n }\n else\n {\n // getFolder return the FolderIterator\n var TargetFolders = getFolder(FolderFullPath); \n while (TargetFolders.hasNext())\n {\n var folder = TargetFolders.next();\n var docFiles = folder.getFilesByName(docName);\n return docFiles;\n }\n } \n}", "title": "" }, { "docid": "533c39939faac7a833045eaa29d28ea6", "score": "0.54073274", "text": "function loadNoteToFolder(id) {\n // GET FOLDER ARRAY\n\n var foldersArray = getFoldersArray();\n var fragment = document.createDocumentFragment();\n // FIND SELECTED FOLDER \n var folder = foldersArray.find(obj => obj.title == id);\n if (folder.list.length == 0) {\n setTimeout(() => {\n msg.innerHTML = \"You haven't add any note into this folder yet\";\n msg.style.display = \"\";\n }, 500);\n } else {\n msg.style.display = \"none\";\n updateNoteDOM(folder.list, fragment);\n contentList.appendChild(fragment);\n }\n\n\n }", "title": "" }, { "docid": "ab4b6cfec7a6448328f1925c0e2cc16b", "score": "0.5392753", "text": "getFiles() {\n return Resource.find({})\n }", "title": "" }, { "docid": "637a0654f59b4614181ddb73e2a63c6b", "score": "0.5382994", "text": "function convertZip(id){\n\t$url = '/client/dashboard/convertfoldertozip?company_id=' + id;\n\t\t\n\t$.ajax({ \n\t\turl: $url,\n\t\ttype: 'GET',\n\t\tsuccess: function(html) {\t\t\t\t\n\t\t\tvar data = jQuery.parseJSON(html);\n\t\t\tif(data.result == 'success'){\n\t\t\t\t$(\"#loadGif\").hide();\n\t\t\t\t$('#download-documents').modal('hide');\n\t\t\t\twindow.location = \"/Images/sharefile_docs/\"+data.folder+\".zip\";\n\t\t\t\t//deleteDownloadedFiles(\"'\"+data.folder+\"'\");\n\t\t\t}\n\t\t\t\n\t\t}\t\t\t\t\t\n\t});\n}", "title": "" }, { "docid": "04329b71616b5906a7ae13069596402c", "score": "0.53780836", "text": "async function getSharedFiles(shareID) {\n var error, result = await db.readDataPromise('shared', { shareID: shareID })\n return result[0]\n}", "title": "" }, { "docid": "45c17e669248c87c933e450b97ba00bd", "score": "0.5365026", "text": "function getExportedFiles (icon, shotObj)\r\n {\r\n icon.image = icons_folder + \"folder_icon_0.png\";\r\n //\r\n destArray = [];\r\n function FindAllFolders (srcFolderStr, destArray)\r\n { \r\n var fileFolderArray = Folder( srcFolderStr ).getFiles(); \r\n for ( var i = 0; i < fileFolderArray.length; i++ )\r\n { \r\n var fileFoldObj = fileFolderArray[i]; \r\n if ( fileFoldObj instanceof File )\r\n { \r\n destArray.push( Folder(fileFoldObj) ); \r\n }\r\n else\r\n { \r\n destArray.push( Folder(fileFoldObj) ); \r\n FindAllFolders( fileFoldObj.toString(), destArray ); \r\n } \r\n } \r\n return destArray; \r\n }; \r\n var appFolder_Files = FindAllFolders (shotObj['appFolder'],destArray);\r\n var filesToFind = [];\r\n for (obj in appFilesToCheck)\r\n {\r\n cleanName = localize(appFileName_template, shotObj['episodeCode'].replace(\"_\", ''), shotObj['name'], appFilesToCheck[obj]);\r\n filesToFind.push(cleanName);\r\n }\r\n files_found = 0;\r\n if (appFolder_Files.length > 0)\r\n {\r\n for (obj in filesToFind)\r\n {\r\n file_found = false;\r\n for (var i=0; i <appFolder_Files.length ; i++)\r\n {\r\n file_name = appFolder_Files[i].name;\r\n if (file_name.search(filesToFind[obj],\"gi\") != -1)\r\n {\r\n file_found = true;\r\n };\r\n }\r\n if (file_found == true) files_found++;\r\n }\r\n }\r\n if (files_found < 1) icon.image = icons_folder + \"folder_icon_3.png\";\r\n else if (files_found > 2) icon.image = icons_folder + \"folder_icon_4.png\";\r\n else icon.image = icons_folder + \"folder_icon_1.png\";\r\n }", "title": "" }, { "docid": "76778fd2b667ff2c4a61a402af34f162", "score": "0.5356174", "text": "async _listFolder (filePath) {\n const __listFolder = async (_filePath, azureProps) => {\n let elements = []\n let marker\n do {\n const options = { delimiter: '/' }\n // prefix='' works with SAS credentials but breaks with\n // storageAccount credentials => bug in azure?\n if (_filePath !== '') options.prefix = _filePath\n const response = await this._wrapProviderRequest(azureProps.containerURL.listBlobFlatSegment(this._azure.aborter, marker, options), { filePath: _filePath })\n marker = response.marker\n elements = elements.concat(response.segment.blobItems.map(blob => blob.name))\n } while (marker)\n return elements\n }\n\n const azureProps = this._propsForPath(filePath)\n // case 1 we list the root => need to list both public and private containers\n if (Files._isRemoteRoot(filePath)) {\n const res = await Promise.all([__listFolder(filePath, azureProps), __listFolder(Files.publicPrefix, this._propsForPath(Files.publicPrefix))])\n return res[0].concat(res[1])\n }\n // case 2 we list a non root folder => only list one container\n return __listFolder(filePath, azureProps)\n }", "title": "" }, { "docid": "d4619548629eb425fddd5bff8ba833a2", "score": "0.5352115", "text": "function directoryFiles(dir, result = []) {\n fs.readdirSync(dir).forEach(item =>\n fs.statSync(path.join(dir, item)).isDirectory()\n ? directoryFiles(path.join(dir, item), result)\n : result.push(path.join(dir, item))\n );\n return result;\n}", "title": "" }, { "docid": "feed0b37e12d48dacb4148f6e9380741", "score": "0.5351821", "text": "async function getFolderId() {\n var data = await getData();\n var folderId = data.galleries[0].folderid;\n return folderId;\n }", "title": "" }, { "docid": "d56d2b1aa49c2bb39c92e4beb6f8e033", "score": "0.5345058", "text": "function fetchFolders(user){\n const userId = user.id\n fetch(`http://localhost:3000/api/v1/users/${userId}`)\n .then(resp => resp.json())\n .then(user => iterateThroughFolders(user, displayFolder))\n }", "title": "" }, { "docid": "ea0f433dd4151df568daf0139934ebf6", "score": "0.5341644", "text": "function getFiles() {\n const courseName = /*cleanupCourseName(*/ //set course name\n document.getElementsByClassName(\"breadcrumb-item\")[2].textContent.trim() || //try to get course name\n document.getElementsByTagName(\"h1\")[0].innerText || //if no course name, get probably university name\n document.querySelector(\"header#page-header .header-title\").textContent.trim() ||\n \"\";\n /*document.getElementsByClassName(\"breadcrumb-item\")[2].firstElementChild.title ||*/\n // The session key should normally be accessible through window.M.cfg.sesskey,\n // but getting the window object is hard.\n // Instead, we can grab the session key from the logout button.\n // Note that var is used here as this script can be executed multiple times.\n const sesskey = new URL(\n document.querySelector(\"a[href*='login/logout.php']\").href\n ).searchParams.get(\"sesskey\");\n\n const tableBody = document.querySelector(\n \"div[role='main'] > table.generaltable.mod_index > tbody\"\n );\n const SUPPORTED_FILES = new Set([\"File\", \"Folder\", \"URL\", \"Page\", \"קובץ\"]);\n\n const allFiles = tableBody === null\n ? getFilesUnderSections(sesskey, SUPPORTED_FILES)\n : getFilesUnderResources(sesskey, tableBody, SUPPORTED_FILES);\n allFiles.forEach(file => (file.course = courseName));\n chrome.runtime.sendMessage({\n message: \"All Files\",\n files: allFiles\n },\n function (response) {\n console.log(response);\n });\n return allFiles;\n }", "title": "" }, { "docid": "927ff2d8cd8bbbace0f4631c209f612b", "score": "0.5335665", "text": "function getTaskFiles() {\n var tempNotes = vm.fieldNotes;\n var data = [];\n\n tempNotes.forEach(function(el) {\n data = data.concat(el.mediaFiles);\n });\n\n vm.files = data;\n }", "title": "" }, { "docid": "c928d7aa60131b5123316fac31456557", "score": "0.5327886", "text": "function getFiles(dir, files = []) {\n\tfs.readdirSync(dir).forEach(filename => {\n\t\tconst filepath = path.join(dir, filename);\n\n\t\tif (fs.statSync(filepath).isDirectory()) {\n\t\t\tgetFiles(filepath, files);\n\t\t} else {\n\t\t\tfiles.push(path.resolve(filepath));\n\t\t}\n\t});\n\n\treturn files;\n}", "title": "" }, { "docid": "92325a7e1f0a8a0490b6c35955c70136", "score": "0.5323766", "text": "function Refresh_File_List() {\n image_files_in_dir = fs.readdirSync(dir)\n}", "title": "" }, { "docid": "2d84643815220b32f3604c853eca5a66", "score": "0.530348", "text": "function getImageFilesFromDir(dir, callback) {\n var filesToReturn = [];\n function walkDir(currentPath) {\n var files = fs.readdirSync(currentPath);\n for (var i in files) {\n var curFile = path.join(currentPath, files[i]); \n if (fs.statSync(curFile).isFile() && imageFileTypes.indexOf(path.extname(curFile)) != -1) {\n //console.log(dir)\n //console.log(curFile)\n //filesToReturn.push(curFile.replace(dir, ''));\n filesToReturn.push(curFile);\n } else if (fs.statSync(curFile).isDirectory()) {\n walkDir(curFile);\n }\n }\n };\n walkDir(dir);\n //console.log(filesToReturn)\n //console.log(`Returning from getImageFilesFromDir: ${filesToReturn}`);\n return filesToReturn; \n }", "title": "" }, { "docid": "5427e04b1be0787cbc93872b19f965ed", "score": "0.52958727", "text": "static async walkDir(dir) {\n \n var url = dir.replace(/\\/?$/,\"/\")\n \n // iterate on the server vs client (is 400ms vs 4000ms)\n var result = await fetch(url, {\n method: \"OPTIONS\",\n headers: {\n filelist: true\n }\n }).then(r => r.json()).then(r => r.contents.map(ea => ea.name.replace(/^\\.\\//,url)))\n return result\n\n// if(dir.endsWith('/')) { dir = dir.slice(0, -1); }\n// const json = await lively.files.statFile(dir).then(JSON.parse);\n// if(json.type !== 'directory') {\n// throw new Error('Cannot walkDir. Given path is not a directory.')\n// }\n\n// let files = json.contents\n// .filter(entry => entry.type === 'file')\n// .map(entry => dir + '/' + entry.name);\n\n// let folders = json.contents\n// .filter(entry => entry.type === 'directory')\n// .map(entry => dir + '/' + entry.name);\n\n// let subfolderResults = await Promise.all(folders.map(folder => this.walkDir(folder)));\n// subfolderResults.forEach(filesInSubfolder => files.push(...filesInSubfolder));\n\n// return files;\n }", "title": "" }, { "docid": "174546fbb903eaa205ebea9d63285a37", "score": "0.5295202", "text": "async function getFilesInDirectoryAsync(dir, ext) {\n let files = [];\n const filesFromDirectory = await fsReaddir(dir).catch(err => {\n throw new Error(err.message);\n });\n\n for (let file of filesFromDirectory) {\n const filePath = path.join(dir, file);\n const stat = await fsLstat(filePath);\n\n // If we hit a directory, apply our function to that dir. If we hit a file, add it to the array of files.\n if (stat.isDirectory()) {\n const nestedFiles = await getFilesInDirectoryAsync(filePath, ext);\n files = files.concat(nestedFiles);\n } else {\n if (path.extname(file) === ext) {\n files.push(filePath);\n }\n\n }\n };\n\n return files;\n}", "title": "" }, { "docid": "672231764d01ab4d4e1ef0e729c54437", "score": "0.5278706", "text": "function Bp_FolderContent(retType, MainFldr) {\n var ChildFldrs = new Array();\n var ChildFiles = new Array();\n\n //get the children files in the selected folder\n var files = MainFldr.getFiles('*');\n //filter out the files\n for (var i = 0; i < files.length; i++)\n if (files[i] instanceof File)\n ChildFiles[ChildFiles.length] = files[i];\n else\n ChildFldrs[ChildFldrs.length] = files[i];\n\n if (retType)\n return ChildFldrs;\n else\n return ChildFiles;\n}", "title": "" }, { "docid": "dfd85001ce65da23caae167e104b07e9", "score": "0.5270083", "text": "function findFolder( filename )\n{\n // determine the folder from root\n // expected that all links are directories below the rootDir\n let root = advDir.replace( /\\/[^\\/]+$/, \"\" );\n let re = new RegExp( `${root}\\/` );\n let folder = \"zid-\" + filename.replace( re, \"\" ).replace( /\\/[^\\/]+$/, \"\" );\n return folder;\n}", "title": "" }, { "docid": "e8b8b675fdb94b0b81fbba54eee9955a", "score": "0.52624744", "text": "function createFilesHtml(id) {\n currentID = id;\n \n var fileChilds = getChildById(id);\n var filesHtml = '';\n if (fileChilds.length) {\n $('.pty').css('display','')\n for (var i = 0; i < fileChilds.length; i++) {\n filesHtml += `<div custome-id=\"${fileChilds[i].id}\" class=\"file-item\">\n <img src=\"img/folder-b.png\" alt=\"\">\n <span class=\"file-name\">${fileChilds[i].title}</span>\n <input type=\"text\" class=\"ditor\">\n <i></i>\n </div>`\n }\n }else{\n $('.pty').css('display','block')\n }\n return filesHtml;\n\n }", "title": "" }, { "docid": "b8b39242ad2df2bfd01103650a21a716", "score": "0.5240579", "text": "function getFilesFromDir(dir, fileTypes) {\n var filesToReturn = [];\n function walkDir(currentPath) {\n var files = fs.readdirSync(currentPath);\n for (var i in files) {\n var curFile = path.join(currentPath, files[i]); \n if (fs.statSync(curFile).isFile() && fileTypes.indexOf(path.extname(curFile)) != -1) {\n filesToReturn.push(curFile.replace(dir, ''));\n } else if (fs.statSync(curFile).isDirectory()) {\n walkDir(curFile);\n }\n }\n };\n walkDir(dir); \n return filesToReturn;\n}", "title": "" }, { "docid": "9e36cedb6c13a2c6ccad7aab120d2193", "score": "0.5239005", "text": "function readFile(id) {\n return readFileSync(`./images/data-set-${id}.jpg`);\n}", "title": "" }, { "docid": "612eb2d0711b1ecac4113732bf2ce1e4", "score": "0.52376634", "text": "function fetchPhotos(id) {\n\t\t\t// console.log('fetchPhotos',id)\n\t\t\tvar directory = '';\n\t\t\tvar filePath = 'content/spaces/' + directory + '/carousel.php';\n\t\t\tconsole.log('fetchPhotos',id,directory,filePath);\n\t\t\t// Load Stage photos\n\t\t\tif (id === 'thestage') {\n\t\t\t\tdirectory = 'stage';\n\t\t\t\tfilePath = 'content/spaces/' + directory + '/carousel.php';\n\t\t\t\tif (stagePicsInPlace === 0) {\n\t\t\t\t\tloadCarousel(filePath, id);\n\t\t\t\t\tstagePicsInPlace++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Load Hall photos\n\t\t\telse if (id === 'thehall') {\n\t\t\t\tdirectory = 'hall';\n\t\t\t\tfilePath = 'content/spaces/' + directory + '/carousel.php';\n\t\t\t\tif (hallPicsInPlace === 0) {\n\t\t\t\t\tloadCarousel(filePath, id);\n\t\t\t\t\thallPicsInPlace++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Load Gallery photos\n\t\t\telse if (id === 'thegallery') {\n\t\t\t\tdirectory = 'lobby';\n\t\t\t\tfilePath = 'content/spaces/' + directory + '/carousel.php';\n\t\t\t\tif (galleryPicsInPlace === 0) {\n\t\t\t\t\tloadCarousel(filePath, id);\n\t\t\t\t\tgalleryPicsInPlace++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Load Screening room photos\n\t\t\telse if (id === 'thescreeningroom') {\n\t\t\t\tdirectory = 'screening';\n\t\t\t\tfilePath = 'content/spaces/' + directory + '/carousel.php';\n\t\t\t\tif (screeningPicsInPlace === 0) {\n\t\t\t\t\tloadCarousel(filePath, id);\n\t\t\t\t\tscreeningPicsInPlace++;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "fa5a2dd9b2bee413caf8d9690b15fc5d", "score": "0.5237463", "text": "getFilePaths(dirPath){\n return new Promise( (resolve, reject) => {\n this.fspath.paths(dirPath, function(err, paths) {\n if (err) reject(err);\n resolve(paths);\n })\n })\n }", "title": "" }, { "docid": "ce3259e9145dd0b169a2b2deb66c6450", "score": "0.5233121", "text": "function ksDownloadFile(id){\n //create the array of files to download\n var aIds = new Array();\n aIds[0] = id;\n \n //put the loading screen on\n //loadingScreen();\n \n //download the files\n ksDownloadFiles(aIds , [] , 0);\n \n //removeLoadingScreen();\n}", "title": "" } ]
91fec091e4de65a2c724528a35ea00bb
Callback for when everything is done
[ { "docid": "27162f072b734b2273d27770126165f9", "score": "0.0", "text": "function done( status, nativeStatusText, responses, headers ) {\n\t\t\tvar isSuccess, success, error, response, modified,\n\t\t\t\tstatusText = nativeStatusText;\n\n\t\t\t// Ignore repeat invocations\n\t\t\tif ( completed ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcompleted = true;\n\n\t\t\t// Clear timeout if it exists\n\t\t\tif ( timeoutTimer ) {\n\t\t\t\twindow.clearTimeout( timeoutTimer );\n\t\t\t}\n\n\t\t\t// Dereference transport for early garbage collection\n\t\t\t// (no matter how long the jqXHR object will be used)\n\t\t\ttransport = undefined;\n\n\t\t\t// Cache response headers\n\t\t\tresponseHeadersString = headers || \"\";\n\n\t\t\t// Set readyState\n\t\t\tjqXHR.readyState = status > 0 ? 4 : 0;\n\n\t\t\t// Determine if successful\n\t\t\tisSuccess = status >= 200 && status < 300 || status === 304;\n\n\t\t\t// Get response data\n\t\t\tif ( responses ) {\n\t\t\t\tresponse = ajaxHandleResponses( s, jqXHR, responses );\n\t\t\t}\n\n\t\t\t// Use a noop converter for missing script but not if jsonp\n\t\t\tif ( !isSuccess &&\n\t\t\t\tjQuery.inArray( \"script\", s.dataTypes ) > -1 &&\n\t\t\t\tjQuery.inArray( \"json\", s.dataTypes ) < 0 ) {\n\t\t\t\ts.converters[ \"text script\" ] = function() {};\n\t\t\t}\n\n\t\t\t// Convert no matter what (that way responseXXX fields are always set)\n\t\t\tresponse = ajaxConvert( s, response, jqXHR, isSuccess );\n\n\t\t\t// If successful, handle type chaining\n\t\t\tif ( isSuccess ) {\n\n\t\t\t\t// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\n\t\t\t\tif ( s.ifModified ) {\n\t\t\t\t\tmodified = jqXHR.getResponseHeader( \"Last-Modified\" );\n\t\t\t\t\tif ( modified ) {\n\t\t\t\t\t\tjQuery.lastModified[ cacheURL ] = modified;\n\t\t\t\t\t}\n\t\t\t\t\tmodified = jqXHR.getResponseHeader( \"etag\" );\n\t\t\t\t\tif ( modified ) {\n\t\t\t\t\t\tjQuery.etag[ cacheURL ] = modified;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// if no content\n\t\t\t\tif ( status === 204 || s.type === \"HEAD\" ) {\n\t\t\t\t\tstatusText = \"nocontent\";\n\n\t\t\t\t// if not modified\n\t\t\t\t} else if ( status === 304 ) {\n\t\t\t\t\tstatusText = \"notmodified\";\n\n\t\t\t\t// If we have data, let's convert it\n\t\t\t\t} else {\n\t\t\t\t\tstatusText = response.state;\n\t\t\t\t\tsuccess = response.data;\n\t\t\t\t\terror = response.error;\n\t\t\t\t\tisSuccess = !error;\n\t\t\t\t}\n\t\t\t} else {\n\n\t\t\t\t// Extract error from statusText and normalize for non-aborts\n\t\t\t\terror = statusText;\n\t\t\t\tif ( status || !statusText ) {\n\t\t\t\t\tstatusText = \"error\";\n\t\t\t\t\tif ( status < 0 ) {\n\t\t\t\t\t\tstatus = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Set data for the fake xhr object\n\t\t\tjqXHR.status = status;\n\t\t\tjqXHR.statusText = ( nativeStatusText || statusText ) + \"\";\n\n\t\t\t// Success/Error\n\t\t\tif ( isSuccess ) {\n\t\t\t\tdeferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );\n\t\t\t} else {\n\t\t\t\tdeferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );\n\t\t\t}\n\n\t\t\t// Status-dependent callbacks\n\t\t\tjqXHR.statusCode( statusCode );\n\t\t\tstatusCode = undefined;\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( isSuccess ? \"ajaxSuccess\" : \"ajaxError\",\n\t\t\t\t\t[ jqXHR, s, isSuccess ? success : error ] );\n\t\t\t}\n\n\t\t\t// Complete\n\t\t\tcompleteDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( \"ajaxComplete\", [ jqXHR, s ] );\n\n\t\t\t\t// Handle the global AJAX counter\n\t\t\t\tif ( !( --jQuery.active ) ) {\n\t\t\t\t\tjQuery.event.trigger( \"ajaxStop\" );\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" } ]
[ { "docid": "38eb9f8ebf69bead70844bc1805c903e", "score": "0.8006051", "text": "onDone () {}", "title": "" }, { "docid": "ce60cd1c4b9152a056372c50b14bc6b2", "score": "0.7320223", "text": "onEnd() {}", "title": "" }, { "docid": "b049ed07c7ffe24e296145d99c1ff92d", "score": "0.7279291", "text": "finish (callback) {\n callback();\n }", "title": "" }, { "docid": "b43f586b1fd618c14bb78a0bdd69cc95", "score": "0.7245571", "text": "onComplete() {}", "title": "" }, { "docid": "6cf91e5b47881a90ff5e02f6cc3d152c", "score": "0.7129416", "text": "function finished() {\n \n}", "title": "" }, { "docid": "e6a86694e6f97eda9fa53ec2d5c27d04", "score": "0.7021624", "text": "function onFinish() {\n console.log('finished!');\n }", "title": "" }, { "docid": "a7b6b4c71e1feaa55ce68e3973a524b8", "score": "0.70072705", "text": "end() {\n console.log(\"All Done\");\n }", "title": "" }, { "docid": "2049a1119aff191b8482d35f45640455", "score": "0.69267213", "text": "function finish() {\n self.ccm.helper.onFinish( self, results );\n if ( callback ) callback();\n }", "title": "" }, { "docid": "797aeba1810ca98e1eac91ee22fe1803", "score": "0.69180363", "text": "function onAllDone( err ) {\n if( err ) {\n Y.log( `Could not concatenate PDFs: ${JSON.stringify( err )}`, 'warn', NAME );\n return callback( err );\n }\n\n // all done\n eventData = {\n 'status': 'endBatch',\n 'cacheUrl': `/pdf/${cacheFile}`,\n 'cacheFile': cacheFile\n };\n\n if( notUpdate ) {\n eventData.notUpdate = notUpdate;\n }\n\n if( !config.compileOnly ) {\n // if caller uses websocket\n sendUserEvent( {msg: {data: eventData}} );\n }\n\n // if caller waits on the server\n callback( null, cacheFile );\n }", "title": "" }, { "docid": "57687070ab168217def51fc3c31968a5", "score": "0.68776435", "text": "callback() {\n console.log(\"Done!!!!\");\n }", "title": "" }, { "docid": "829bc73cb7cbbccff6da6e21111c328a", "score": "0.68565404", "text": "complete() {}", "title": "" }, { "docid": "2c05917960b6f78f1cff8135c68d4636", "score": "0.6821786", "text": "function onFinish() {\n console.log('finished!');\n}", "title": "" }, { "docid": "7e009c7391f38c00f2f4fa464ebf9635", "score": "0.6803283", "text": "function uploadDone () {}", "title": "" }, { "docid": "9cf5c4cc53f633f386dfd3118e33dfd0", "score": "0.6794406", "text": "function onDownloadComplete()\n{\n console.log(\"onDownloadComplete\");\n\n main();\n}", "title": "" }, { "docid": "27e1a9fc225add502d7091fd6bb4a3c7", "score": "0.67223024", "text": "function done() {\n NProgress.done();\n }", "title": "" }, { "docid": "c56862b043fe833a820736617e42d76c", "score": "0.6712288", "text": "function complete(results) {\n //console.log(results);\n if (win.$yetify !== undef) {\n $yetify.tower.emit(\"results\", results);\n }\n }", "title": "" }, { "docid": "770658b66836055cf98fa76bc274e879", "score": "0.6687316", "text": "function checkDone() {\n if (generalResults != null && contextResults != null) {\n onComplete({\n general: generalResults,\n context: contextResults\n });\n }\n }", "title": "" }, { "docid": "df9d0f2de0611055dfd9e05d8ce25fab", "score": "0.668466", "text": "function done() {\n\t\t\tif (!invoked) {\n\t\t\t\tinvoked = true;\n\n\t\t\t\tcallback.apply(null, arguments);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "4b2fc537594b62b7efdb4bfe4770c8f0", "score": "0.6532316", "text": "function complete() {\n callbackCount++;\n if (callbackCount >= 3) {\n res.render('transactions', context);\n }\n }", "title": "" }, { "docid": "eb6e1b54047b745ed78bc769eb4e3a55", "score": "0.6522281", "text": "function done() {\n self._server = null;\n if (callback) {\n callback.apply(null, arguments);\n }\n }", "title": "" }, { "docid": "eb6e1b54047b745ed78bc769eb4e3a55", "score": "0.6522281", "text": "function done() {\n self._server = null;\n if (callback) {\n callback.apply(null, arguments);\n }\n }", "title": "" }, { "docid": "eb6e1b54047b745ed78bc769eb4e3a55", "score": "0.6522281", "text": "function done() {\n self._server = null;\n if (callback) {\n callback.apply(null, arguments);\n }\n }", "title": "" }, { "docid": "397a51a876144bb80c5290b0d1e5b44b", "score": "0.65217316", "text": "function checkDone() { // called after each async call, executes the call back when the last one finishes\n asyncCallsDone++;\n if (asyncCallsDone >= NUM_ASYNC_CALLS) {\n //console.log(\"Finished constructor for \"+JSON.stringify(self, 3));\n callback();\n }\n }", "title": "" }, { "docid": "d1505b25b26d1ba430f13534b7206f75", "score": "0.6504916", "text": "function complete() {\n callbackCount++;\n if (callbackCount >= 1) {\n // once old resume info is retrieved, then process insert query\n // make sql request to update applicant\n mysql.pool.query(query, input, function(error, results, fields){\n // log any error that occurs with insert request\n if(error){\n console.log(error);\n res.write(JSON.stringify(error));\n res.end();\n }else{\n oldResume = context.info;\n // check if user has folder yet\n var userDir = './uploads/' + req.body.applicantID + '/';\n if (!fs.existsSync(userDir)){\n fs.mkdirSync(userDir);\n }\n // sucess in update, update actual file\n fs.rename('./uploads/' + oldResume.applicantID + '/' + oldResume.fileName,\n './uploads/' + req.body.applicantID + '/' + req.body.fileName, \n function(err) {\n if ( err ) console.log('ERROR: ' + err);\n });\n res.status(200);\n res.end();\n }\n });\n }\n }", "title": "" }, { "docid": "5beb2fb7407521981f784dc441a4df3f", "score": "0.6499987", "text": "function done() {\n model.add_company(company);\n model.add_db_data(company, db_data);\n model.add_quandl_data(company, quandl_data);\n return callback(null);\n }", "title": "" }, { "docid": "83c7c8ee8ac96fea72489fca78b4d24c", "score": "0.64992446", "text": "function done() {\n self._server = null;\n\n if (callback) {\n callback.apply(null, arguments);\n }\n }", "title": "" }, { "docid": "a75d420517132dd0caac2678f5ea1e16", "score": "0.64950526", "text": "async finish() { }", "title": "" }, { "docid": "a75d420517132dd0caac2678f5ea1e16", "score": "0.64950526", "text": "async finish() { }", "title": "" }, { "docid": "a75d420517132dd0caac2678f5ea1e16", "score": "0.64950526", "text": "async finish() { }", "title": "" }, { "docid": "1747b610e11241409f2ea7edf0ef0edb", "score": "0.647667", "text": "function complete() {\n callbackCount++;\n if (callbackCount >= 2) {\n res.render('update-resumes', context);\n }\n }", "title": "" }, { "docid": "aa6b9767188c03fdf1319dd081dda8ff", "score": "0.6473858", "text": "function _allComplete( err, resultList ) {\n session.close();\n callbackFn(err, resultList);\n }", "title": "" }, { "docid": "e26b81d61f1282ae07cd75f5a8abb0c9", "score": "0.64696175", "text": "function finish() {\n cleanup();\n callback(null, self.buffer);\n }", "title": "" }, { "docid": "ff585eec07f6ba7525d259c26e023a08", "score": "0.6468852", "text": "function uploadDone() {\n}", "title": "" }, { "docid": "8de02b3b6ab97e1e8dfb8e9a0a0c21c0", "score": "0.6421611", "text": "function complete () {\n phantom();\n navigate(frame, \"about:blank\");\n status(\"Done. \" + WAIT_FOR + \"new tests.\");\n mode(\"Idle\");\n socket.send({\n status: \"done\",\n batch: currentBatch\n });\n\n currentBatch = null;\n if (batches.length) {\n for (var id in batches) {\n // only need one!\n currentBatch = id;\n tests = batches[id];\n return dequeue();\n }\n }\n }", "title": "" }, { "docid": "ae5f61d385110376a08d06d3a97a90e7", "score": "0.6416216", "text": "function complete(){\r\n callbackCount++;\r\n if(callbackCount >= 2){\r\n res.render('people_certs', context);\r\n }\r\n }", "title": "" }, { "docid": "f6f312645d844116f8eeedbf416b6fb4", "score": "0.63981557", "text": "function complete() {\n callbackCount++;\n if (callbackCount >= 2) {\n res.render('resumes', context);\n }\n }", "title": "" }, { "docid": "01bf2ce4d1fd5c59fa8554c44022633f", "score": "0.63845104", "text": "finish() {}", "title": "" }, { "docid": "90683f49443b052aec0c860ab331a7ba", "score": "0.6379984", "text": "function onDone(){\n numDone ++;\n if (numDone >= fields.length){\n dfd.resolve(list);\n }\n }", "title": "" }, { "docid": "2ba88c3bc27e4ad7acc7c939a76d04c8", "score": "0.63772047", "text": "function checkForCompletion() {\n if (queuedObjects.length === 0) {\n returnCallback(derezObj);\n } \n }", "title": "" }, { "docid": "134d8489bd7b136a8e7eb2d34713fea1", "score": "0.6370571", "text": "onComplete() {console.log(\"Bork bork bork!\")}", "title": "" }, { "docid": "4e11806f763149ba198160ce8d51af38", "score": "0.6370518", "text": "function complete(){\r\n callbackCount++;\r\n if(callbackCount >= 2){\r\n res.render('search', context);\r\n }\r\n }", "title": "" }, { "docid": "b9a65bce35542bb1ec114c12bba13bc7", "score": "0.63697696", "text": "function onDone() {\n\t\t m_promiseCount -= 1;\n\t\t if (!m_promiseCount) {\n\t\t m_idleHandlers.splice(0, m_idleHandlers.length)\n\t\t .forEach(function (handler) {\n\t\t handler();\n\t\t });\n\t\t }\n\t\t }", "title": "" }, { "docid": "ae08ca0ff414661cfbdfb7c6ab5c6b0e", "score": "0.6367389", "text": "handleDoneLoading() { }", "title": "" }, { "docid": "be7d44c05cc7154585da49f9c490bf26", "score": "0.63447887", "text": "function done() {\n\t if (!invoked) {\n\t invoked = true;\n\t\n\t next.apply(null, arguments);\n\t }\n\t }", "title": "" }, { "docid": "f53b37c7b82def595603aee2069d038a", "score": "0.63423425", "text": "onloadend() {}", "title": "" }, { "docid": "1caf6e26e0a1400a1edee9faf8f6bf9f", "score": "0.63396037", "text": "function complete(){\n callbackCount++; \n if(callbackCount >= 1){\n //res.render('restaurant_review', context);\n res.json(context);\n }\n\n }", "title": "" }, { "docid": "6d587dad5b89fc865f6b51778eb03128", "score": "0.6325849", "text": "function done() {\n console.log(\"job's done!\");\n}", "title": "" }, { "docid": "63fc3da27214c490d6928fafbf7973cb", "score": "0.62952244", "text": "done() {\n this.completionCallback && this.completionCallback();\n this.resolve();\n }", "title": "" }, { "docid": "cc63a00571c3722f26ae1ab3386b04f9", "score": "0.62806284", "text": "function complete(){\r\n callbackCount++;\r\n if(callbackCount >= 1){\r\n res.render('course', context);\r\n }\r\n }", "title": "" }, { "docid": "de41c5b1aadfb7bde16f70270585e930", "score": "0.62751645", "text": "function onAllDone( err ) {\n if ( err ) {\n Y.log( 'Could not save dataURI: ' + JSON.stringify( err ), 'warn', NAME );\n return args.callback( err );\n }\n\n Y.log( 'Created media ' + JSON.stringify( result ), 'debug', NAME );\n args.callback( null, result );\n }", "title": "" }, { "docid": "c8195b7d9be3f6e6d27e0ecd9977555a", "score": "0.62723696", "text": "function complete(){\n callbackCount ++;\n if(callbackCount >= 1){\n res.render('employers', context);\n }\n }", "title": "" }, { "docid": "d56c7a4df0053db8523737c565e58638", "score": "0.6267916", "text": "function onFinishedProcessing() {\n console.log('Successfully gone through the list of likes');\n dumpProcessStatus();\n}", "title": "" }, { "docid": "cd75d965799bea321049c8cad8b2d138", "score": "0.6266929", "text": "function mainComplete() {\n console.log('It is all loaded up');\n TowerDefense.manager.init();\n }", "title": "" }, { "docid": "f8690c24e4b8b3573401123f28ba1de6", "score": "0.6238147", "text": "function complete() {\n callbackCount++;\n if (callbackCount >= 1) {\n // once old resume info is retrieved, then process delete query\n // make sql request to delete resume\n mysql.pool.query(query, input, function(error, results, fields){\n // log any error that occurs with insert request\n if(error){\n console.log(error);\n res.write(JSON.stringify(error));\n res.end();\n }else{\n // sucess in delete, remove actual file locations\n var dirname = './uploads/' + context.info.applicantID;\n console.log('Deleting File: ' + dirname + '/' + context.info.fileName);\n fs.unlink(dirname + '/' + context.info.fileName, function(err) {\n if (err){\n console.log('ERROR: ' + err);\n } else{\n res.status(200);\n res.end();\n }\n });\n // check if folder for applicant is empty, delete if so\n fs.readdir(dirname, function(err, files){\n if(err){\n console.log('ERROR: ' + err);\n } else{\n if(!files.length){\n console.log(\"Folder Empty: Deleting \" + dirname);\n fs.rmdirSync(dirname);\n }\n }\n });\n }\n });\n }\n }", "title": "" }, { "docid": "903c9241de99ae6719a55b68c8c4c07c", "score": "0.62327737", "text": "function fileOnEnd() {\n console.log('Data has been drained');\n }", "title": "" }, { "docid": "f7fcf8dce649e310fb455e479e054818", "score": "0.6232135", "text": "complete() {\n\t\tthis.completed = true;\n\t}", "title": "" }, { "docid": "1bd69eb7e8c350a6499053cbeb134998", "score": "0.62235624", "text": "function complete(){\n callbackCount++;\n if (callbackCount >= 2){\n res.render('employersInfo', context);\n }\n }", "title": "" }, { "docid": "596aafd94a8ee798419a87541451bc09", "score": "0.62178123", "text": "function done() {\n\t\t\thandler.call(this, baseEvent);\n\t\t}", "title": "" }, { "docid": "799868e29f4ddae2ebc4e742406cd48a", "score": "0.61970186", "text": "async end() { }", "title": "" }, { "docid": "799868e29f4ddae2ebc4e742406cd48a", "score": "0.61970186", "text": "async end() { }", "title": "" }, { "docid": "799868e29f4ddae2ebc4e742406cd48a", "score": "0.61970186", "text": "async end() { }", "title": "" }, { "docid": "eb0480a2132f0992dc5a6643717adbb1", "score": "0.61767375", "text": "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "title": "" }, { "docid": "f581af25075f7447ccc0972bdff6c499", "score": "0.6172713", "text": "function completeActions(){\n getUser();\n showPDF();\n joinRoom();\n // getCompany();\n}", "title": "" }, { "docid": "0d707b6ae6e5e352ca376bb3247d32b6", "score": "0.6168962", "text": "function doneLoading() { \n loadedCount++;\n if (loadingCount == loadedCount && loadingReady) {\n init();\n } \n }", "title": "" }, { "docid": "5963f75940f800e79e26bd342fc9a3a5", "score": "0.6166037", "text": "finish() {\n console.log(\"finish\");\n }", "title": "" }, { "docid": "40c1b4c9d4991b8f0799a1e1903f06ae", "score": "0.61554086", "text": "function catch_result (result) {\n //im done\n}", "title": "" }, { "docid": "2229d96c3204500b648d96589c405233", "score": "0.61439556", "text": "function onFinishCallback() {\n if (validateAllSteps()) {\n var serverData = getServerData();\n\n //Begin Encoding\n $.post(\"Home/BeginEncoding\", serverData, function (data) {\n //clear the current interval\n window.clearInterval(timerId);\n //reset the timer to the new interval value\n timerId = window.setInterval(refreshData, data.RefreshInterval);\n\n if (data.StatusMessage !== \"\") {\n //Update status message\n statusbar.show(data.StatusMessage, statusMsgInterval);\n }\n\n //Close Wizard On Finish\n closeWizardOnFinish();\n });\n }\n}", "title": "" }, { "docid": "5e4de53d458ba771cc9024509f2d1ade", "score": "0.6140548", "text": "function onAllDone( err ) {\n if ( err ) {\n Y.log( 'Could not save dataURI: ' + JSON.stringify( err ), 'warn', NAME );\n return args.callback( err );\n }\n\n // clean up chart image in temp directory\n //Y.doccirrus.media.cleanTempFiles( { '_tempFiles': [ tempFile ] } );\n\n Y.log( 'Created media ' + JSON.stringify( result ), 'debug', NAME );\n args.callback( null, result );\n }", "title": "" }, { "docid": "a74810328728049d7003f63a4b58956c", "score": "0.61379546", "text": "onComplete() {\n if (this._complete) {\n this._complete.raise();\n }\n }", "title": "" }, { "docid": "8ce9cbe56dcf2090d1e2b41958adfb14", "score": "0.61245763", "text": "function done() {\n echo('\\nOK!');\n }", "title": "" }, { "docid": "fd3dcba80bd2ba94543f51ac75d5595c", "score": "0.6124495", "text": "function onend() {\n cleanup();\n callback();\n\n // Add to list of files.\n if (data.bytesRead) {\n self._files.push({ path: data.path, size: data.bytesRead });\n }\n\n // Check if Kat has ended.\n // TODO\n // console.log('on end', self._ended, self._queue.length);\n if (self._ended) {\n self._end();\n\n } else {\n var next = self._queue.shift();\n\n if (next) {\n self._addCurrentStream(next);\n } else if (self.options.autoEnd && self._openQueue.active === 0) {\n self._end();\n } else {\n delete self._current;\n }\n }\n }", "title": "" }, { "docid": "6288f81586310bb8703c1f9af3dfb2ba", "score": "0.61212635", "text": "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "title": "" }, { "docid": "6288f81586310bb8703c1f9af3dfb2ba", "score": "0.61212635", "text": "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "title": "" }, { "docid": "6288f81586310bb8703c1f9af3dfb2ba", "score": "0.61212635", "text": "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "title": "" }, { "docid": "6288f81586310bb8703c1f9af3dfb2ba", "score": "0.61212635", "text": "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "title": "" }, { "docid": "6288f81586310bb8703c1f9af3dfb2ba", "score": "0.61212635", "text": "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "title": "" }, { "docid": "6288f81586310bb8703c1f9af3dfb2ba", "score": "0.61212635", "text": "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "title": "" }, { "docid": "6288f81586310bb8703c1f9af3dfb2ba", "score": "0.61212635", "text": "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "title": "" }, { "docid": "6288f81586310bb8703c1f9af3dfb2ba", "score": "0.61212635", "text": "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "title": "" }, { "docid": "e90f02810bcef74974ec972722a0594e", "score": "0.61173594", "text": "function done() {\n if (!invoked) {\n invoked = true;\n\n callback.apply(null, arguments);\n }\n }", "title": "" }, { "docid": "e90f02810bcef74974ec972722a0594e", "score": "0.61173594", "text": "function done() {\n if (!invoked) {\n invoked = true;\n\n callback.apply(null, arguments);\n }\n }", "title": "" }, { "docid": "254fce282c9815bd6b376914cb3c2afa", "score": "0.61169", "text": "function finalResult() {\r\n\r\n}", "title": "" }, { "docid": "be4b37b3b087545a804e0c137e5a59d3", "score": "0.61075217", "text": "complete() {\n this.finish(COMPLETED);\n }", "title": "" }, { "docid": "e881dd5f78ac10fc1685209306ab04b2", "score": "0.61045444", "text": "function finish() {\n setTimeout(function () {\n done();\n }, 3000);\n }", "title": "" }, { "docid": "9fa73b24c88df9fe03ab15e6e3b7ba50", "score": "0.60899055", "text": "function completion_callback(allRes, status) {\r\n\t$('#progressbar').css('width', '100%').attr('aria-valuenow', 100).html(testCounter+' tests completed!').removeClass('active').removeClass('progress-bar-striped');\r\n\t\r\n logWrite(\"Tests completed!\");\r\n testCompleteResults += \"</table>\";\r\n console.log(\"Test results: \", allRes, status);\r\n}", "title": "" }, { "docid": "107760bda5750a0d1059af78848829ac", "score": "0.6089203", "text": "function searchComplete() {\n callback(imageSearch.results);\n }", "title": "" }, { "docid": "3f13d6d4a0acd49c4e4b273071fea90d", "score": "0.60683656", "text": "function onDone() {\n m_promiseCount -= 1;\n if (!m_promiseCount) {\n m_idleHandlers.splice(0, m_idleHandlers.length).forEach(function (handler) {\n handler();\n });\n }\n }", "title": "" }, { "docid": "6c543102d0d3901413ffc678fd521799", "score": "0.6066336", "text": "function handleComplete() {\n\tloaded = true;\n\ttoggleLoader(false);\n\tinitMain();\n}", "title": "" }, { "docid": "c824b91e8f16bdf8e25755b7b373550b", "score": "0.6037877", "text": "complete(results, file) {\n // Ensure any final (partial) batch gets emitted\n const batch = tableBatchBuilder.getNormalizedBatch();\n if (batch) {\n asyncQueue.enqueue(batch);\n }\n asyncQueue.close();\n }", "title": "" }, { "docid": "2dec1932d4a3f6b8ef259aa364a921da", "score": "0.602907", "text": "function pollCompleted() {\n\t \tif (accounts && currencies && spaces && nfctags) {\n\t \t\tcb( null )\n\t \t} else {\n\t \t setTimeout(function () { \n\t \t \tpollCompleted()\n\t \t }, 125);\n\t \t}\n\t }", "title": "" }, { "docid": "4609fff86c218990ac61a82ad4356025", "score": "0.6028669", "text": "function done ( ){\n\treadfiles ++ // add one to the file counter\n\n\t// Only do the below when all (2) files are loaded\n\tif (readfiles == 2 ){ // note to self, if doing more files change this number\n\t\t// write the everyone data to the file\n\t\tfilesystem.writeFile ('peopleComplete.txt', everyone.sort(), function (error){ // note the .sort which alphabetically sorts names\n\t\t\t// Handle errors if they occur\n\t\t\tif (error){\n\t\t\t\tconsole.log (\"No noes! Error: \" + error)\n\t\t\t\tthrow error\n\t\t\t}\n\t\t})\n\t}\n}", "title": "" }, { "docid": "5f3d687fc5841cc08aa089c3c5c3aadc", "score": "0.6027893", "text": "function completeConnection() {\n angular.forEach( doneHandlers, function( handler ) {\n /*\n At the point of connection completion we could be in any hub, each doneHandler therefore\n has a hub property which relates back to the original hub which requested it.\n We set the server property on that hub so clients can now talk to the server\n */\n handler.hub.server = createServerProxy( handler.hub, handler.hubName );\n handler.doneFn();\n } );\n doneHandlers.length = 0;\n }", "title": "" }, { "docid": "de0be1158b57724ac992880428593b82", "score": "0.6027517", "text": "function complete () {\n\t\t\tif (isDocumentComplete()) {\n\t\t\t\tcb();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tsetTimeout(complete, 10);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "ac1e7cf2bb18ca6d39e2a05762a247f1", "score": "0.60244393", "text": "function searchComplete() {\n callback(imageSearch.results );\n }", "title": "" }, { "docid": "1c6fbbd4873d71bb07ea4f06d38b75ab", "score": "0.60156226", "text": "function conversionDone(data) {\n Papa.parse(data, {\n complete: function(results, localFile) {\n func(results, localFile, divName, clusterName);\n },\n error: function(err, file) {\n if (divName!==undefined)\n alert(\"could not load \"+fullUrl);\n }\n });\n }", "title": "" }, { "docid": "a3e784bb38f5855b507061f150f06d70", "score": "0.60062134", "text": "function allDone() {\n console.log('building employee list with data:' + employeeList)\n render(employeeList)\n}", "title": "" }, { "docid": "ad1303923e18cf023ed9b09997927790", "score": "0.59909177", "text": "function allDone()\n{\n throw( \"exiting\" );\n}", "title": "" }, { "docid": "694bbf761f66f742a29a6487cf9bcebd", "score": "0.5990236", "text": "function onFinish() {\n console.log('抢购结束!');\n}", "title": "" }, { "docid": "f5fe8df673b2bf76b8963105441762c5", "score": "0.598681", "text": "async complete() {\n const t = await lr(this.localStore, new Fo(this.R), this.documents, this.ro.id), e = this.co(this.documents);\n for (const t of this.queries) await fr(this.localStore, t, e.get(t.name));\n return this.progress.taskState = \"Success\", new Gi(Object.assign({}, this.progress), t);\n }", "title": "" }, { "docid": "61f6db9786f622c330ee12c997ca8082", "score": "0.59845006", "text": "function _onAllCrawled()\n {\n module_callback(urls);\n }", "title": "" }, { "docid": "2b4d4de6d6d83aa10cebd088643412c7", "score": "0.59833527", "text": "onSuccess() {\n this.emit(\"success\");\n this.cleanup();\n }", "title": "" } ]
263c06c4d9c8791bc538c5426fdd4a58
==== FEATURE: ORION CHAT ====
[ { "docid": "ea32035ac4333a4a9c99117a298cf3fb", "score": "0.0", "text": "function orionChatIntegration() {\n $(\"html\").css({\n paddingTop : \"150px\"\n });\n var ad = $(\"#ad\");\n ad.css({\n margin : \"0px\",\n left : \"5px\",\n width : \"900px\",\n textAlign : \"left\",\n height : \"120px\"\n });\n var tbl = \"\";\n tbl += '<table id=\"orionActive\" class=\"wrpd\" style=\"float:right\">';\n tbl += '<thead>';\n tbl += '<tr><th class=\"nfo\">Orion Aktiv</th></tr>';\n tbl += '</thead>';\n tbl += '<tbody>';\n tbl += '</tbody>';\n tbl += '</table>';\n tbl += '<table class=\"wrpd\" id=\"orionChat\">';\n tbl += '<thead>';\n tbl += '<tr><th class=\"nfo\">{0}</th><th id=\"secondHead\" colspan=\"2\" style=\"text-align:right;width:100%\" class=\"nfo\"><a href=\"#\" id=\"refreshChat\">{1}</a></th></tr>'.format(MSG_ORION_CHAT, MSG_REFRESH);\n tbl += '</thead>';\n tbl += '<tbody>';\n tbl += '</tbody>';\n tbl += '<tfoot>';\n tbl += '<tr><td><input type=\"text\" id=\"chatText\" style=\"width:590px\"/><input id=\"ircCopy\" type=\"checkbox\" checked/> {0} <input style=\"width:60px\" type=\"button\" value=\"{1}\" id=\"sendChat\"/></td></tr>'.format(MSG_CHAT_IRC_COPY, MSG_SEND);\n tbl += '</tfoot>';\n tbl += '</table>';\n\n ad.html(tbl);\n\n $(\"#orionChat\").css({\n width : \"716px\",\n borderSpacing : \"0\"\n });\n $(\"#orionChat > tbody, thead tr\").css({\n display : \"block\"\n });\n $(\"#orionChat > tbody\").css({\n height : \"90px\",\n overflowY : \"auto\",\n overflowX : \"hidden\"\n });\n $(\"#sendChat\").click(sendChatEntry);\n $(\"#chatText\").keypress(function (event) {\n if (event.which === 13) {\n sendChatEntry();\n }\n });\n requestChatEntries(false);\n $(\"#refreshChat\").click(function () {\n requestChatEntries(true);\n });\n window.setInterval(function () {\n requestChatEntries(true);\n /* true for polling */\n }, getChatRefreshInterval());\n}", "title": "" } ]
[ { "docid": "e7fc993e758e87dbcbd197d21a67ed97", "score": "0.656805", "text": "function showChatHelp() {\n\tcreateModal('Chat Commands');\n\tif (UI_FontsBtn==\"1\") {\n\t\tbody.append('<strong>Fonts commands</strong><br /><br />');\n\t\thtml='<li><code>[white]</code>, <code>[yellow]</code>, <code>[orange]</code>, <code>[pink]</code>, '\n\t\t + '<code>[red]</code>, <code>[lime]</code>, <code>[green]</code>, <code>[aqua]</code>, '\n\t\t + '<code>[blue]</code>, <code>[violet]</code>, <code>[brown]</code>, <code>[silver]</code>, '\n\t\t + '<code>[black]</code> - begin of colored text</li>'\n\t\t + '<li><code>[bw]</code> - begin of white text on the black background</li>'\n\t\t + '<li><code>[b]</code>, <code>[i]</code>, <code>[u]</code>, <code>[s]</code> - '\n\t\t + 'begin of bold, italic, underlined, striked or underlined text</li>'\n\t\t + '<li><code>[d]</code> - begin of a distinguished text (red on yelllow background)</li>'\n\t\t + '<li><code>[f]</code> - begin of a text with a fire effect</li>'\n\t\t + '<li><code>[sp]</code> - begin of an inline spoiler</li>'\n\t\t + '<li><code>[/]</code> - <b>end of any color, style or spoiler</b></li><br />'\n\t\t + 'If fonts commands don\\'t work, ask script administrator about proper filters installation.';\n\t\t$('<ul />').html(html).appendTo(body);\n\t}\n\tif (UI_UserCommands==\"1\") {\n\t\tarr = {\n\t\t\t'pick':'choosing a random option from a list separated by commas '\n\t\t\t + '(e.g. <i>!pick japan,korea,china</i>)',\n\t\t\t'ask':'asking a question with yes/no type answer '\n\t\t\t + '(e.g. <i>!ask Will this channel be popular?</i>)',\n\t\t\t'q':'displaying random quote (<i>!q</i>)',\n\t\t\t'dice':'rolling dice (<i>!dice</i>)',\n\t\t\t'roll':'rolling 3-digit number (<i>!roll</i>)',\n\t\t\t'time':'displaying current time (<i>!time</i>)',\n\t\t\t'now':'displaying current playing title (<i>!now</i>)',\n\t\t\t'calc':'calculating a math operation '\n\t\t\t + '(all JavaScript Math methods and constants allowed, e.g. <i>!calc Math.PI*10</i>)',\n\t\t\t'skip':'skip current item (<i>!skip</i>)',\n\t\t\t'add':'adding a link to the end of playlist '\n\t\t\t + '(e.g. <i>!add https://www.youtube.com/watch?v=29FFHC2D12Q</i>)',\n\t\t\t'stat': 'displaying user chat statistics in current session (<i>!stat</i>)',\n\t\t\t'memestats': 'displaying number memes used by user in all messages (<i>!memestats</i>)'\n\t\t}\n\t\tif (UI_ChannelDatabase==\"1\") {\n\t\t\tarr['random']='adding random link from database (<i>!random</i>)';\n\t\t}\n\t\tbody.append('<strong>New chat commands</strong><br /><br />');\n\t\tul = $('<ul />').appendTo(body);\n\t\tfor (cmd in arr) {\n\t\t\tul.append('<li><code>!'+cmd+'</code> - '+arr[cmd]+'</li>');\n\t\t}\n\t}\n\tif (UI_ChatSpeak==\"1\") {\n\t\tbody.append('<strong>Voice commands</strong><br /><br />');\n\t\thtml='<li><code>!say</code> - text speaking in english (<i>!say Hello!</i>)</li>'\n\t\t + '<li><code>!mow</code> - text speaking in polish (<i>!mow Chrząszcz brzmi w trzcinie.</i>)';\n\t\t$('<ul />').html(html).appendTo(body);\n\t}\n\tarr = {\n\t\t'me':'showing an action-style message (username does something, e.g. <i>/me is dancing</i>)',\n\t\t'sp':'hiding a message in a hover-to-show spoiler box (e.g. <i>/sp This message is hidden</i>)',\n\t\t'afk':'toggling your AFK (away from keyboard) status (<i>/afk</i>)',\n\t}\n\tbody.append('<br /><strong>Default CyTube commands</strong><br /><br />');\n\tul = $('<ul />').appendTo(body);\n\tfor (cmd in arr) {\n\t\tul.append('<li><code>/'+cmd+'</code> - '+arr[cmd]+'</li>');\n\t}\n}", "title": "" }, { "docid": "53a3eddd56bcd869b585d551f8cba738", "score": "0.6415521", "text": "function addChatTyping(data) {\n //no idea about how to design this.\n }", "title": "" }, { "docid": "bc3f99008b12901a54756f56fc6f9352", "score": "0.63020295", "text": "function aista_create_chat_ui() {\n\n // Creating chat button if we should.\n if ('[[render_button]]' === 'True') {\n const aistaChatBtn = window.document.createElement('button');\n if (ainiroRtl && ainiroRtl === true) {\n aistaChatBtn.dir = 'rtl';\n }\n let btnTxt = '[[button]]';\n if (btnTxt === '') {\n btnTxt = '<i class=\"icofont-chat\"></i>';\n }\n aistaChatBtn.innerHTML = btnTxt;\n aistaChatBtn.ariaLabel = 'Chat with website';\n aistaChatBtn.className = 'aista-chat-btn';\n aistaChatBtn.addEventListener('click', () => aista_show_chat_window());\n window.document.body.appendChild(aistaChatBtn);\n }\n\n // Chat window.\n const aistaChatWnd = window.document.createElement('div');\n if (ainiroRtl && ainiroRtl === true) {\n aistaChatWnd.dir = 'rtl';\n }\n aistaChatWnd.className = 'aista-chat-wnd';\n let html = `\n <div class=\"aista-chat-header\">[[header]]</div>\n <div class=\"aista-chat-msg-container\"></div>\n <button class=\"aista-chat-close-btn\"><i class=\"icofont-close\"></i></button>\n <form class=\"aista-chat-form\">\n <input type=\"text\" placeholder=\"Ask me anything ...\" class=\"aista-chat-prompt\">`;\n\n // Notice, we can't have both speech recognition and submit button.\n if (aistaSpeech) {\n html += `<button type=\"button\" class=\"aista-speech-button\"><i class=\"icofont-microphone\"></i></button>`;\n } else if (ainiro_has_submit_button) {\n html += `<button type=\"submit\" class=\"aista-speech-button\"><i class=\"icofont-location-arrow\"></i></button>`;\n }\n html += '</form>';\n aistaChatWnd.innerHTML = html;\n window.document.body.appendChild(aistaChatWnd);\n\n // Adding event listener to input field to allow for closing it with escape key.\n const aistaChatInpField = document.getElementsByClassName('aista-chat-prompt')[0];\n aistaChatInpField.addEventListener('keydown', (e) => {\n if (e.key === 'Escape') {\n aistaChatWnd.style.display = 'none';\n const btns = window.document.getElementsByClassName('aista-chat-btn');\n if (btns.length > 0) {\n btns[0].style.display = 'block';\n }\n }\n });\n\n // Add an event listener to the close button.\n window.document.getElementsByClassName('aista-chat-close-btn')[0].addEventListener('click', () => {\n aistaChatWnd.style.display = 'none';\n const btns = window.document.getElementsByClassName('aista-chat-btn');\n if (btns.length > 0) {\n btns[0].style.display = 'block';\n }\n });\n\n // Add an event listener to the microphone button.\n if (aistaSpeech) {\n window.document.getElementsByClassName('aista-speech-button')[0].addEventListener('click', () => {\n var recognition = new webkitSpeechRecognition();\n recognition.onresult = function(event) {\n var output = document.getElementsByClassName('aista-chat-prompt')[0];\n output.value = event.results[0][0].transcript;\n output.select();\n output.focus();\n aista_submit_form(true);\n };\n recognition.start();\n });\n }\n\n // Add a submit event handler to the form\n window.document.getElementsByClassName('aista-chat-form')[0].addEventListener('submit', (e) => {\n e.preventDefault();\n aista_submit_form(false);\n });\n\n // Checking if we've got a greeting, and if so, adding it as initial chat message.\n if (aistaChatGreeting && aistaChatGreeting.length > 0) {\n const row = window.document.createElement('div');\n row.innerText = aistaChatGreeting;\n row.className = 'aista-chat-answer cached';\n const msgs = window.document.getElementsByClassName('aista-chat-msg-container')[0];\n msgs.appendChild(row);\n }\n}", "title": "" }, { "docid": "d112f21003caaae8ae6dac459ca1855a", "score": "0.62970495", "text": "function updateChat(texto) {\r\n const chat = document.querySelector(\"#game-chat\");\r\n let p = document.createElement(\"p\");\r\n let text = document.createTextNode(texto);\r\n p.appendChild(text);\r\n chat.appendChild(p);\r\n}", "title": "" }, { "docid": "2e28e3d87198c2fc84b2c87e927321f6", "score": "0.6229758", "text": "function addChat(input, product) {\n const mainDiv = document.getElementById(\"addedText\");\n let userDiv = document.createElement(\"div\");\n userDiv.classList.add(\"user\");\n userDiv.innerHTML = `You: <span class=\"user-response\">${input}</span>`;\n mainDiv.appendChild(userDiv);\n \n let botDiv = document.createElement(\"div\");\n botDiv.classList.add(\"bot\");\n botDiv.innerHTML = `Chatbot: <span class=\"bot-response\">${product}</span>`;\n mainDiv.appendChild(botDiv);\n\n }", "title": "" }, { "docid": "a66808024e28fb403d17f1f47460c5cb", "score": "0.61245304", "text": "function addChatTyping(data) {\n\tlet typingMessage = document.getElementById('typing-message');\n\ttypingMessage.innerText = `${data.userNick} is typing...`\n}", "title": "" }, { "docid": "def1176f5ce486c2a3466b9e7a5d344d", "score": "0.61219203", "text": "function on_chat(color, message, some_int) {return true;}", "title": "" }, { "docid": "270bf5d6784b8ce742036f844a240a89", "score": "0.6120243", "text": "handleChat(text) {\n this.room.broadcast({\n name: this.name,\n type: 'chat',\n text: text\n });\n }", "title": "" }, { "docid": "ef30887c36fd251f2e2e202104c9f468", "score": "0.61157835", "text": "function insertChat(who, text, time = 0){\n var control = \"\";\n var date = formatAMPM(new Date());\n \n if (who == \"me\"){\n \n control = \n '<div class=\"msj macro\">' +\n '<div class=\"avatar\"><img class=\"img-circle\" style=\"width:100%;\" src=\"'+ me.avatar +'\" /></div>' +\n '<div class=\"text text-l\">' +\n '<p>'+ text +'</p>' +\n '<p><small>'+date+'</small></p>' +\n '</div>' +\n '</div>'; \n send(text); \n\n }else{\n control = \n '<div class=\"msj-rta macro\">' +\n '<div class=\"text text-r\">' +\n '<p>'+text+'</p>' +\n '<p><small>'+date+'</small></p>' +\n '</div>' +\n '<div class=\"avatar\" style=\"padding:0px 0px 0px 10px !important\"><img class=\"img-circle\" style=\"width:100%;\" src=\"'+you.avatar+'\" /></div>' \n }\n setTimeout(\n function(){ \n if(who!==\"me\")\n speak(text);\n $(\".chat-text\").append(control);\n $('.chat-text').scrollTop($('.chat-text')[0].scrollHeight);\n\n\n }, time);\n \n \n}", "title": "" }, { "docid": "1d2eb8c93d7be541b0b09bfd4d0ec42b", "score": "0.60967314", "text": "function orchestrateChatbot(event, done) {\n Conversation.getOrElseInsert(event.sender.id, (error, conversation) => {\n if (error) return done(error)\n\n const resourceService = new ResourceService()\n const actionFactory = new ActionFactory(conversation, resourceService)\n done(null, new ChatBot(conversation, actionFactory, resourceService))\n })\n}", "title": "" }, { "docid": "21a33f01213cfc725d5575b477075c7d", "score": "0.6026384", "text": "function addGameChatMessage(str : String){\n\tApplyGlobalChatText(\"\", str);\n\tif(Network.connections.length>0){\n\t\tnetworkView.RPC(\"ApplyGlobalChatText\", RPCMode.Others, \"\", str);\t\n\t}\t\n}", "title": "" }, { "docid": "d5a3fc480a764bc4b5a87313c2f9ba97", "score": "0.600657", "text": "_buildChatEvent(chobj, message) {\n let flags = {};\n let emote_obj = Twitch.ScanEmotes(message, Object.entries(this._self_emotes));\n let chstr = Twitch.FormatChannel(chobj);\n let userstate = this._self_userstate[chstr] || {};\n let msg = message;\n\n /* Construct the parsed flags object */\n flags[\"badge-info\"] = userstate[\"badge-info\"];\n flags[\"badges\"] = userstate[\"badges\"] || [];\n flags[\"color\"] = userstate[\"color\"];\n flags[\"subscriber\"] = userstate[\"subscriber\"];\n flags[\"mod\"] = userstate[\"mod\"];\n flags[\"vip\"] = userstate[\"vip\"] || null;\n flags[\"broadcaster\"] = userstate[\"broadcaster\"] || null;\n flags[\"display-name\"] = userstate[\"display-name\"];\n flags[\"emotes\"] = emote_obj;\n flags[\"id\"] = Util.Random.uuid();\n flags[\"user-id\"] = this._self_userid;\n flags[\"room-id\"] = this._rooms[chobj.channel].id;\n flags[\"tmi-sent-ts\"] = (new Date()).getTime();\n flags[\"turbo\"] = 0;\n flags[\"user-type\"] = \"\";\n flags[\"__synthetic\"] = 1;\n\n /* Construct the formatted flags string */\n let flag_arr = [];\n let addFlag = (n, v) => {\n let val = `${v}`;\n if (typeof(v) === \"undefined\" || v === null) {\n val = \"\";\n }\n flag_arr.push(`${n}=${val}`);\n };\n\n /* Build and add the rest of the flags */\n addFlag(\"badges\", flags[\"badges\"].map((b, r) => `${b}/${r}`).join(\",\"));\n addFlag(\"color\", flags[\"color\"]);\n addFlag(\"display-name\", flags[\"display-name\"]);\n addFlag(\"subscriber\", flags[\"subscriber\"]);\n addFlag(\"mod\", flags[\"mod\"]);\n if (flags[\"vip\"]) {\n addFlag(\"vip\", flags[\"vip\"]);\n }\n if (flags[\"broadcaster\"]) {\n addFlag(\"broadcaster\", flags[\"broadcaster\"]);\n }\n addFlag(\"emotes\", Twitch.FormatEmoteFlag(flags[\"emotes\"]));\n addFlag(\"id\", flags[\"id\"]);\n addFlag(\"user-id\", flags[\"user-id\"]);\n addFlag(\"room-id\", flags[\"room-id\"]);\n addFlag(\"tmi-sent-ts\", flags[\"tmi-sent-ts\"]);\n addFlag(\"turbo\", flags[\"turbo\"]);\n addFlag(\"user-type\", flags[\"user-type\"]);\n addFlag(\"__synthetic\", flags[\"__synthetic\"]);\n addFlag(\"__synthetic\", \"1\");\n let flag_str = flag_arr.join(\";\");\n\n /* Build the raw and parsed objects */\n let user = userstate[\"display-name\"].toLowerCase();\n let useruri = `:${user}!${user}@${user}.tmi.twitch.tv`;\n let channel = Twitch.FormatChannel(chobj);\n /* @<flags> <useruri> PRIVMSG <channel> :<message> */\n let raw_line = `@${flag_str} ${useruri} PRIVMSG ${channel} :`;\n\n /* Handle /me */\n if (msg.startsWith(\"/me \")) {\n msg = msg.substr(\"/me \".length);\n raw_line += \"\\x01ACTION \" + msg + \"\\x01\";\n flags.action = true;\n } else {\n raw_line += msg;\n }\n\n /* Construct and return the event */\n let event = new TwitchChatEvent(raw_line, ({\n cmd: \"PRIVMSG\",\n flags: flags,\n user: Twitch.ParseUser(useruri),\n channel: chobj,\n message: msg,\n synthetic: true /* mark the event as synthetic */\n }));\n\n /* TFC-Specific logic: handle mod antics\n * This logic only applies when the client is running inside the Twitch\n * Filtered Chat. Yes, this violates encapsulation in multiple ways. The\n * intent here is to set event.flags.bits if mod antics are enabled and\n * the message contains cheer antics. This enables fanfare effects on\n * messages containing antics */\n if (this.get(\"HTMLGen\")) {\n let H = this.get(\"HTMLGen\");\n if (typeof(H.hasAntics) === \"function\") {\n if (H.hasAntics(event)) {\n /* genMsgInfo modifies the event in-place */\n H._genMsgInfo(event);\n }\n }\n }\n return event;\n }", "title": "" }, { "docid": "68107879720678ce2910311944fbdc49", "score": "0.5988325", "text": "emojis () {\n const select = this.shadowRoot.querySelector('select')\n select.addEventListener('change', e => {\n const chatDiv = this.chatDiv.querySelector('.messageArea')\n chatDiv.value = `${chatDiv.value}${e.target.value}`\n chatDiv.focus()\n })\n }", "title": "" }, { "docid": "a1e990dcf54ea488a0f74044e481fb60", "score": "0.5969336", "text": "function userChat() {\n\n // Find where the user is inputing text.\n // -------------------------------------------------------------------\n compose_area = document.getElementById('composer');\n\n // Set the user as the sender of the next message.\n // -------------------------------------------------------------------\n nextMessage.sender = \"user\";\n\n // Get the user's input in the compose_area and clear the compose_area.\n // -------------------------------------------------------------------\n nextMessage.message = compose_area.value;\n compose_area.value = \"\";\n \n // We need to convert the user's message to upper case to check if it matches with any prompts using the .toUpperCase() function.\n // -------------------------------------------------------------------\n uppercase = nextMessage.message.toUpperCase();\n\n // validate user input against special keywords\n // -------------------------------------------------------------------\n if (uppercase == \"EASTER EGG\") {\n intervening_msg = [true, \"This is just the tip of the iceberg. More easter eggs inside.\"];\n } else if (uppercase == \"GOTCHA\" || uppercase == \"MICHAEL SCOTT\") {\n intervening_msg = [true, \"<img src='https://media.giphy.com/media/55SfA4BxofRBe/giphy.gif'>\"];\n } else if (uppercase === \"\") {\n invalid_resp_count += 1;\n\n if(invalid_resp_count >= invalid_resp_max) {\n intervening_msg = [true, \"Sorry, this assessment is now closed. Too many invalid responses received.\"];\n } else {\n intervening_msg = [true, \"Yikes! You did not make a response. Please respond to the previous question.\"];\n }\n }\n\n // sendSpecialChat is an array that will override the next thing the bot says with the second value if the first value is true. \n // If the first value is false the bot will say the next thing in the script.\n\n // Send user's message.\n // -------------------------------------------------------------------\n send(nextMessage.sender, nextMessage.message);\n\n // Count 1 more chat that the user has sent.\n // -------------------------------------------------------------------\n userCount += 1;\n\n // Ask the bot for another chat.\n // -------------------------------------------------------------------\n lookForChat()\n}", "title": "" }, { "docid": "5a65952910b7297abfd658e88aae565b", "score": "0.59438837", "text": "function insertChat(who, text, time) {\n var control = \"\";\n var date = formatAMPM(new Date());\n\n if (who == username) {\n\n control = '<li style=\"width:85%\">' +\n '<div class=\"msj macro\">' +\n '<div class=\"text text-l\">' +\n '<p>'+who + \" : \" + text + '</p>' +\n '<p><small>' + date + '</small></p>' +\n '</div>' +\n '</div>' +\n '</li>';\n } else {\n control = '<li style=\"width:85%;\">' +\n '<div class=\"msj-rta macro\">' +\n '<div class=\"text text-r\">' +\n '<p>' +who + \" : \"+text + '</p>' +\n '<p><small>' + date + '</small></p>' +\n '</div>' +\n '<div class=\"avatar\" style=\"padding:0px 0px 0px 10px !important\"></div>' +\n '</li>';\n }\n\n $(\"#chat_elements\").append(control);\n\n}", "title": "" }, { "docid": "d52430ea863e0bacc4b4e7c04589d926", "score": "0.5935367", "text": "function ClsChat() {\n\n // socket.io 訊息與物件儲存 區域\n let socket;\n const setSocket = (obj) => {\n socket = obj;\n }\n\n // world room 用\n let messages = [{\n isMe: 0,\n name: \"系統\",\n msg: \"歡迎加入公開頻道~\",\n time: (new Date).toLocaleDateString(\"zh-TW\") + \" \" + (new Date).toLocaleTimeString(\"zh-TW\").split(\":\").slice(0, 2).join(\":\")\n }, {\n isMe: 0,\n name: \"系統\",\n msg: \"保持頻道開啟,接收新訊息\",\n time: (new Date).toLocaleDateString(\"zh-TW\") + \" \" + (new Date).toLocaleTimeString(\"zh-TW\").split(\":\").slice(0, 2).join(\":\")\n }];\n // world room 用\n const setMessages = (msgObj) => {\n messages.push(msgObj);\n let room = document.querySelector(\"#chat_robot_message\");\n room.innerHTML = data2chatRobotMessage(messages);\n room.scrollTo(0, room.scrollHeight);\n }\n // world room 用\n const worldRoomReconnect = () => {\n if (!chatRobotWindow.classList.contains(\"hide\")) {\n console.log(\"世界頻道 open\");\n socket.emit(\"joinRoom\", { chatroomId: \"world\" });\n }\n }\n\n // 私人聊天室列表\n let chatroomList = [];\n const setChatroomList = (roomListObj) => {\n chatroomList.push(roomListObj);\n }\n const initChatroomList = async () => {\n chatroomList = [];\n const chatList = document.querySelector(\".chat_list\");\n chatList.innerHTML = \"\";\n try {\n let respones = await fetch(serverURL.getChatroom, {\n cache: \"no-cache\",\n headers: {\n Authorization: localStorage.getItem(\"Cycle link token\"),\n }\n })\n let result = await respones.json();\n if (!result.result) {\n chatList.innerHTML = `<div>${result.msg}</div>`\n return;\n }\n\n // console.log(result);\n // console.group(\"chatroom List\");\n result.data.map(item => {\n if (item.fIsMeLastChat) {\n item.fIsReaded = item.fIsMeLastChat\n }\n setChatroomList(item);\n if (!item.fIsReaded) {\n setChatAlert(1);\n }\n // console.log(\"joinRoom: \" + item.fId);\n socket.emit(\"joinRoom\", { chatroomId: item.fId });\n })\n\n // console.groupEnd(\"chatroom List\");\n document.querySelector(\".chat_list\").innerHTML = data2cahtList(chatroomList);\n } catch (ex) {\n console.log(ex);\n chatList.innerHTML = `<div>連線錯誤</div>`;\n }\n }\n const reFlashChatroomList = (chatroomId, isMe = 0) => {\n let index = chatroomList.findIndex((item) => item.fId == chatroomId);\n let pop = chatroomList.splice(index, 1)[0];\n pop.fIsReaded = isMe;\n chatroomList.unshift(pop);\n\n const chatList = document.querySelector(\".chat_list\");\n chatList.innerHTML = \"\";\n\n document.querySelector(\".chat_list\").innerHTML = data2cahtList(chatroomList);\n\n // console.group(\"reFlashChatroomList\");\n // console.log(index);\n // console.log(pop);\n // console.log(chatroomList);\n // console.groupEnd(\"reFlashChatroomList\");\n }\n const setFriendOnline = (chatroomId, isOnline) => {\n try {\n let theChatList = document.querySelector(`#chat-list-${chatroomId} > .chat_list_online`);\n let index = chatroomList.findIndex((item) => item.fId == chatroomId);\n\n if (isOnline) {\n chatroomList[index].isOnline = 1;\n theChatList.innerHTML = \"●\";\n } else {\n chatroomList[index].isOnline = 0;\n theChatList.innerHTML = \"\";\n }\n return true;\n }\n catch (ex) {\n console.log(ex);\n return false;\n }\n }\n\n // 私人聊天室用\n const setMessagesTo = (chatroomId, msgObj) => {\n let roomElement = document.querySelector(`#chatRoomId_${chatroomId}`);\n if (roomElement) {\n let messagesContainer = roomElement.querySelector('.chat_message');\n let prevDate = messagesContainer.dataset.prevDate;\n let msgDate = msgObj.time.split(\" \")[0];\n if (prevDate !== msgDate) {\n messagesContainer.innerHTML += `<div class=\"chat_info_message\">${msgDate}</div>`\n }\n messagesContainer.dataset.prevDate = msgDate;\n\n messagesContainer.innerHTML += data2chatMessages(msgObj);\n messagesContainer.scrollTo(0, messagesContainer.scrollHeight);\n }\n\n // TODO 未讀訊息\n\n }\n\n // 小紅點提醒\n const setChatAlert = (show = 1, chatroomId = \"false\") => {\n let dot = document.querySelector(\".chat_icon_talk_dot\");\n let isChatListHide = [...document.querySelector(\".chat_list_window\").classList].includes(\"hide\");\n let isChatroomOpen = document.querySelector(`#chatRoomId_${chatroomId}`);\n if (show && isChatListHide && !isChatroomOpen) {\n dot.classList.remove(\"hide\");\n } else {\n dot.classList.add(\"hide\");\n }\n }\n\n\n const makeToast = (title, msg) => {\n console.log(\"%c\"+ msg, `color:${title === \"success\" ? 'green' : 'orange'};font-size:16px;`);\n }\n\n // *設定 socket ---------------------------------------------------------------------\n var setupSocket = () => {\n const token = localStorage.getItem('Cycle link token');\n // console.group(\"socket-----------\");\n // console.log(socket);\n if (token && !socket) { // \n const newSocket = io(serverURL.root, {\n query: {\n token: localStorage.getItem('Cycle link token'),\n }\n });\n // console.log(newSocket);\n\n newSocket.on(\"disconnect\", () => {\n // setSocket(null);\n // setTimeout(setupSocket, 3000);\n makeToast(\"error\", \"Socket Disconnected!\");\n socket.removeAllListeners(\"newMessage\");\n });\n\n newSocket.on(\"connect\", () => {\n setSocket(newSocket);\n makeToast(\"success\", \"Socket Connected!\");\n initChatroomList();\n worldRoomReconnect();\n\n socket.on(\"newMessage\", ({ message, userId, userName, time, chatroomId }) => {\n console.log(\"get msg:\" + message + \" ||from: \" + userName + \" ||room: \" + chatroomId);\n let data = {\n isMe: localStorage.getItem(\"Cycle link user data\") == userName ? 1 : 0,\n name: userName,\n msg: message,\n time,\n }\n if (chatroomId === \"world\") {\n setMessages(data);\n } else {\n setChatAlert(1, chatroomId);\n reFlashChatroomList(chatroomId, data.isMe);\n setMessagesTo(chatroomId, data);\n }\n\n })\n // socket.removeAllListeners(\"newMessage\");\n\n socket.on(\"newChatroom\", () => {\n initChatroomList();\n console.log(\"new Chatroom create\");\n })\n\n socket.on(\"friendOnline\", ({ chatroomId, userName }) => {\n if (userName === localStorage.getItem(\"Cycle link user data\")) return;\n\n let timer = setInterval(() => {\n let result = setFriendOnline(chatroomId, true);\n if (result) clearInterval(timer);\n }, 1500);\n console.log(\"friend Online :)\");\n socket.emit(\"FriendOnlineToo\", chatroomId)\n })\n\n socket.on(\"friendOffline\", (chatroomId) => {\n let timer = setInterval(() => {\n let result = setFriendOnline(chatroomId, false);\n if (result) clearInterval(timer);\n }, 1500);\n console.log(\"friend Offline :(\");\n })\n\n socket.on(\"friendOnlineTooYa\", (chatroomId) => {\n let timer = setInterval(() => {\n let result = setFriendOnline(chatroomId, true);\n if (result) clearInterval(timer);\n }, 1500);\n console.log(\"my friend online too :)\");\n })\n\n\n\n });\n\n } else {\n makeToast(\"\", \"Socket can't connect!\");\n }\n // console.groupEnd(\"socket-----------\");\n }\n\n // 發送訊息\n const sendMessage = (message, chatroomId) => {\n if (socket) {\n console.log(`send message to ${chatroomId}`);\n socket.emit(\"chatRoomMessage\", {\n chatroomId,\n message\n })\n }\n }\n\n // 以上設定 socket ---------------------------------------------------------------------\n\n\n\n\n // 置頂\n $(document).ready(function () {\n $(\".upTop\").click(function () {\n $(\"html,body\").animate({\n scrollTop: $(\"body\").offset().top - 120\n }, 900);\n });\n });\n\n\n // *圖片開關\n const chatIconContainer = document.querySelector(\".chat_icon_container\");\n const chatMainIcon = document.querySelector(\".chat_icon_main\");\n const chatAlertDot = document.querySelector(\".chat_icon_talk_dot\");\n const chatIcons = document.querySelectorAll(\".chat_icon\");\n\n chatIconContainer.addEventListener(\"mouseenter\", () => {\n chatMainIcon.classList.add(\"widthAndHeight2Zero\");\n chatAlertDot.classList.add(\"widthAndHeight2Zero\");\n chatIcons.forEach((item) => {\n item.classList.remove(\"widthAndHeight2Zero\");\n });\n });\n\n chatIconContainer.addEventListener(\"mouseleave\", () => {\n chatMainIcon.classList.remove(\"widthAndHeight2Zero\");\n chatAlertDot.classList.remove(\"widthAndHeight2Zero\");\n chatIcons.forEach((item) => {\n item.classList.add(\"widthAndHeight2Zero\");\n });\n });\n\n\n\n // *聊天室列表div-------------------------------------------\n const chatListData = [{\n fId: 0,\n fMemberName: \"哈士奇\"\n },\n {\n fId: 1,\n fMemberName: \"豆柴\"\n },\n {\n fId: 2,\n fMemberName: \"狐狸犬\"\n },\n {\n fId: 3,\n fMemberName: \"米克斯驚喜包\"\n },\n ];\n\n // 聊天列表 文字樣板\n const data2cahtList = (array) => {\n let result = \"\";\n array.map((e) => {\n result += `<li id=\"chat-list-${e.fId}\" data-chatRoom-id=${e.fId} data-member-id=${e.fMemberId} data-title=${e.fMemberName}>\n <span class=\"chat_list_online\">${e.isOnline ? \"●\" : \"\"}</span>\n ${e.fMemberName}\n <span class=\"chat_list_o\">${e.fIsReaded ? \"\" : '<i class=\"far fa-comment-dots\"></i>'}</span>\n </li>`;\n });\n return result;\n };\n\n //點擊 icon 打開\n const chatListWindow = document.querySelector(\".chat_list_window\");\n document.querySelector(\"#chat_friend_icon\").addEventListener(\"click\", () => {\n chatListWindow.classList.toggle(\"hide\");\n setChatAlert(0);\n });\n\n\n // 聊天列表窗關\n document.querySelector(\"#chat_list_window_close\").addEventListener(\"click\", (e) => {\n e.target.parentNode.classList.add(\"hide\");\n });\n\n\n\n\n\n\n // *聊天室div-------------------------------------------\n const cahtMessageData = [{\n isMe: 0,\n msg: \"哈囉~\",\n time: \"16:35\"\n },\n {\n isMe: 0,\n msg: \"你的狗勾好可愛\",\n time: \"16:35\"\n },\n {\n isMe: 0,\n msg: \"可以跟他交朋友嗎 <3\",\n time: \"16:35\"\n },\n {\n isMe: 1,\n msg: \"嘿?\",\n time: \"16:38\"\n },\n {\n isMe: 0,\n msg: \"謝謝\",\n time: \"16:39\"\n },\n ];\n\n // 關聊天室\n function chatRoomClose(e) {\n // console.log(e.target, e.target.classList);\n if ([...e.target.classList].includes(\"chat_window_close\")) {\n e.currentTarget.remove();\n }\n }\n\n // 聊天室發訊息\n const EventSendChatMessage = (e) => {\n if (e.keyCode === 13 && !e.shiftKey) {\n e.preventDefault();\n let room = e.target.dataset ? e.target.dataset.chatroomId || \"world\" : \"world\";\n sendMessage(e.target.value, room);\n // console.log(`send message to ${room}`);\n e.target.value = \"\";\n }\n }\n\n\n //文字樣板 -- 參考 html 中聊天機器人格式\n const data2chatroom = (array, title, chatRoomId) => {\n let prevDate = \"1911/01/01\";\n let msgs = array.map((e) => {\n let date = e.time.split(\" \")[0];\n\n let result = \"\";\n if (prevDate !== date) {\n result += `<div class=\"chat_info_message\">${date}</div>`\n }\n prevDate = date;\n result += data2chatMessages(e);\n return result\n });\n\n let result = `<div id=\"chatRoomId_${chatRoomId}\" class=\"chat_room_window\"><img class=\"chat_window_close\" src=\"./img/times-solid.svg\" alt=\"X\"><div id=\"chat_message_window_title\" class=\"chat_window_title\">${title}</div><div data-prev-date=${prevDate} class=\"chat_message\">`;\n result += msgs.join(\"\");\n result += `</div><div class=\"chat_input\">\n <textarea data-chatRoom-id=${chatRoomId} placeholder=\"想說什麼呢?\" onfocus=\"this.placeholder=''\" onblur=\"this.placeholder='想說什麼呢?'\" row=\"2\"></textarea>\n </div></div>`;\n return result;\n };\n\n const data2chatMessages = (data) => (\n `<div class=${data.isMe ? \"caht_Me\" : \"caht_notMe\"}>${data.msg}<div class=\"caht_arrow2\"></div></div>\n <div class=\"${data.isMe ? \"caht_Me_time\" : \"caht_notMe_time\"}\">${data.time.split(\" \")[1]}</div>`\n )\n\n\n\n //點擊 聊天列表 打開\n const chatContainer = document.querySelector(\".chat_container\");\n document.querySelector(\".chat_list\").addEventListener(\"click\", async (e) => {\n // console.log(e.target, e.target.tagName);\n // 點擊的是否是li\n if (e.target.tagName !== \"LI\") {\n // console.log(e.target);\n return;\n }\n\n //檢查是否已開啟\n if (document.querySelector(`#chatRoomId_${e.target.dataset.chatroomId}`)) {\n return;\n };\n\n // 容器與事件綁定\n const chatRoom = document.createElement(\"div\");\n chatRoom.addEventListener(\"click\", chatRoomClose);\n chatRoom.addEventListener(\"keydown\", EventSendChatMessage);\n\n e.target.querySelector(\".chat_list_o\").innerHTML = \"\";\n\n let response = await fetch(serverURL.getChatmessage + e.target.dataset.chatroomId, {\n method: \"GET\",\n cache: \"no-cache\",\n headers: {\n Authorization: localStorage.getItem(\"Cycle link token\"),\n },\n })\n\n if (!response.ok) {\n chatRoom.innerHTML = data2chatroom(cahtMessageData, e.target.dataset.title, e.target.dataset.chatroomId);\n } else {\n let result = await response.json();\n if (!result.result) {\n chatRoom.innerHTML = data2chatroom([], e.target.dataset.title, e.target.dataset.chatroomId); // {isMe: 0,msg: result.msg,time: \"\"}\n } else {\n let messagesData = result.data.map((item) => ({\n isMe: item.fName === localStorage.getItem(\"Cycle link user data\"),\n msg: item.fContent,\n time: item.fTime\n })\n )\n chatRoom.innerHTML = data2chatroom(messagesData, e.target.dataset.title, e.target.dataset.chatroomId);\n }\n }\n\n chatContainer.appendChild(chatRoom);\n let messagesContainer = chatRoom.querySelector('.chat_message');\n messagesContainer.scrollTo(0, messagesContainer.scrollHeight);\n });\n\n\n\n\n\n // *世界頻道div-------------------------------------------\n const cahtRobotMessageData = [{\n isMe: 0,\n msg: \"哈囉我是客服~\"\n },\n {\n isMe: 0,\n msg: \"你的狗勾好可愛\"\n },\n {\n isMe: 0,\n msg: \"可以跟他交朋友嗎 <3\"\n },\n {\n isMe: 1,\n msg: \"嘿?\"\n },\n {\n isMe: 0,\n msg: \"謝謝\"\n },\n ];\n\n\n //文字樣板 -- \n const data2chatRobotMessage = array => {\n let result = \"\";\n array.map((e) => {\n result += `<div class=${e.isMe ? \"caht_Me\" : \"caht_notMe\"}>${e.isMe ? \"\" : e.name + \": \"}${e.msg}<div class=\"caht_arrow\"></div></div>\n <div class=\"${e.isMe ? \"caht_Me_time\" : \"caht_notMe_time\"}\">${e.time ? e.time.split(\" \")[1] : \"\"}</div>`;\n });\n return result;\n };\n\n\n //點擊 icon 打開 世界頻道與 socket . io\n const chatRobotWindow = document.querySelector(\".chat_robot_room_window\");\n const chatRobotMessage = document.querySelector(\"#chat_robot_message\");\n document.querySelector(\"#chat_robot_icon\").addEventListener(\"click\", () => {\n\n if (chatRobotWindow.classList.contains(\"hide\")) {\n chatRobotMessage.innerHTML = data2chatRobotMessage(messages);\n\n if (socket) {\n console.log(\"世界頻道 open\");\n socket.emit(\"joinRoom\", { chatroomId: \"world\" });\n }\n\n } else {\n if (socket) {\n console.log(\"世界頻道 close\");\n socket.emit(\"leaveRoom\", { chatroomId: \"world\" });\n }\n }\n\n chatRobotWindow.classList.toggle(\"hide\");\n });\n\n // 世界頻道div 發訊息\n document.querySelector(\"#chat_robot_textarea\").addEventListener(\"keydown\", EventSendChatMessage)\n\n\n\n\n // 世界頻道div-------------------------------------------\n document.querySelector(\"#chat_robot_window_close\").addEventListener(\"click\", (e) => {\n e.target.parentNode.classList.add(\"hide\");\n\n if (socket) {\n console.log(\"世界頻道 close\");\n socket.emit(\"leaveRoom\", { chatroomId: \"world\" });\n }\n });\n\n\n\n // 初始化區域\n // socket.io\n if (localStorage.getItem('Cycle link token')) {\n setupSocket();\n }\n\n\n document.addEventListener(\"click\", async (e) => {\n\n if (![...e.target.classList].includes(\"lets-talk\") || !e.target.dataset.userId || !typeof e.target.dataset.userId === \"undefined\") {\n return;\n }\n\n let response = await fetch(serverURL.getChatroom + e.target.dataset.userId, {\n method: \"POST\",\n headers: {\n // *攜帶 http request headers\n Authorization: localStorage.getItem(\"Cycle link token\"), // *這個屬性帶 JWT\n },\n })\n\n if (!response.ok) {\n alert(\"請求連線失敗\");\n return;\n }\n\n try {\n let result = await response.json();\n alert(result.msg);\n console.log(result);\n\n if (result.result) {\n await initChatroomList();\n chatListWindow.classList.remove(\"hide\");\n [...document.querySelectorAll(\".chat_list > li\")].find(item => \n item.dataset.memberId === e.target.dataset.userId\n ).click();\n } else {\n chatListWindow.classList.remove(\"hide\");\n [...document.querySelectorAll(\".chat_list > li\")].find(item => \n item.dataset.memberId === e.target.dataset.userId\n ).click();\n }\n\n } catch (ex) {\n console.log(ex);\n alert(\"回傳錯誤\");\n return;\n }\n\n\n })\n\n\n\n}", "title": "" }, { "docid": "8a3577ea844e13b146e61634dbcd2e12", "score": "0.5919434", "text": "function insertChat(who, text) {\n var time = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n\n var control = \"\";\n var date = formatAMPM(new Date());\n\n if (who == \"me\") {\n\n control = '<li style=\"width:100%\">' + '<div class=\"msj macro\">' + '<div class=\"avatar\"><img class=\"img-circle\" style=\"width:100%;\" src=\"' + me.avatar + '\" /></div>' + '<div class=\"text text-l\">' + '<p>' + text + '</p>' + '<p><small>' + date + '</small></p>' + '</div>' + '</div>' + '</li>';\n } else {\n control = '<li style=\"width:100%;\">' + '<div class=\"msj-rta macro\">' + '<div class=\"text text-r\">' + '<p>' + text + '</p>' + '<p><small>' + date + '</small></p>' + '</div>' + '<div class=\"avatar\" style=\"padding:0px 0px 0px 10px !important\"><img class=\"img-circle\" style=\"width:100%;\" src=\"' + you.avatar + '\" /></div>' + '</li>';\n }\n\n setTimeout(function () {\n $(\"#cont1\").append(control);\n }, time);\n }", "title": "" }, { "docid": "bbc2b08d8e7e249840ed633c76dbbcff", "score": "0.58847326", "text": "function fnTchatInterface() {\n\t$('p[name=infoNomUser]').text(\"Vous êtes connecté en tant que \" + getUserName());\n\t$('#divConnect').css({ \"display\": \"none\"});\n\t$('#divChannel').css({ \"display\": \"block\", \"top\" : \"15%\"});\n\t$('#title').css({'top' : '5%'});\n\t$('#divNomUser').css({ \"display\": \"inline-block\"});\n}", "title": "" }, { "docid": "59232d59bdd333d65ea0423d6feba32b", "score": "0.5884581", "text": "async toChatMessage() {\r\n const data = {\r\n id: this.id,\r\n actorId: this.actor.id,\r\n type: this.type,\r\n name: this.data.name,\r\n img: this.data.img,\r\n damage: this.data.data.damage,\r\n range: this.data.data.range,\r\n weaponType: this.data.data.weaponType,\r\n weight: this.data.data.weight,\r\n notes: this.data.data.notes,\r\n };\r\n \r\n await ChatMessage.create({\r\n user: game.user.id,\r\n speaker: ChatMessage.getSpeaker({user: game.user}),\r\n content: await renderTemplate(\r\n \"systems/numenera/templates/chat/items/weapon.html\", \r\n data,\r\n )\r\n });\r\n }", "title": "" }, { "docid": "543b12f91f64370a4f5704ea366d772f", "score": "0.587265", "text": "function helpFun(p) {\n var help_string1 = \"| !stats [nickname] | !rank [arg] | !rankhelp | !bethelp\";\n var help_string2 = \"| !bb | !swap | !rr | !rrs | !msup | @nickname pm | !discord | !disp\";\n room.sendChat(help_string1, p.id);\n room.sendChat(help_string2, p.id);\n return false;\n}", "title": "" }, { "docid": "dbffafbd672a250eab52e236c6b6f68c", "score": "0.5860301", "text": "function showHelp(sender) {\n let text = \"You can use following commands:\\n/event -> to create event;\\n/registered -> to view count of registered persons;\\n/list -> to list all persons, registered to the event;\\n/add or '+' ->to add you to the event;\\n/remove or '-' -> to remove you from the event.\\nGood luck!\"\n sendTextMessage(sender, text);\n}", "title": "" }, { "docid": "60745a474178d24cebb087e5ea03352d", "score": "0.58480936", "text": "constructor() {\n super(\"Send Chat Message\", 'rosie.core.action.chat.send')\n }", "title": "" }, { "docid": "a5a94da80f7e3a7fbe35addcbfb1609f", "score": "0.5839391", "text": "function chatTemplate(aiOrPerson) {\n return (\n `\n <div class=\"ai-person-container\">\n <div class=\"${aiOrPerson.class}\">\n <p class=\"txt\">${aiOrPerson.text}</p>\n </div>\n <span class=\"${aiOrPerson.class}-date\">${aiOrPerson.date}</span>\n </div>\n `\n );\n }", "title": "" }, { "docid": "3965b1560e85cba60d09b27f02f78d3b", "score": "0.5833525", "text": "function initChatSingle() {\n mySocket.emit('init chat single',{userId: user.user_id,partnerId: $scope.center.id},function(data){});\n }", "title": "" }, { "docid": "10852f963df1d26fcc60d08399f44dc2", "score": "0.5832444", "text": "function sendChatMessage() {\n \n var chatMessageEntered;\n // Version of chat message that has emojis converted into their short form (i.e. smile emoji becomes ':smile:')\n var chatMessageWithEmojisInShortForm;\n\n // Grab username and userId from local storage, as well as the current date/time\n var username = storageFactory.getLocalStorage('userSession').user.userName;\n var userId = storageFactory.getLocalStorage('userSession').user.userId;\n var dateTimeCreated = new Date().toISOString();\n\n // Grab the chat message \n chatMessageEntered = document.getElementById('chatmessage').value;\n \n // Check to see if user typed in /giphy and that it was the very first thing typed\n if (chatMessageEntered.indexOf(\"/giphy \") === 0) {\n // If '/giphy ' was found, then strip out /giphy and pass along what follows to the giphy API to get the random image\n chatMessageEntered = chatMessageEntered.replace(\"/giphy \", \"\");\n getGiphy(chatMessageEntered, username, userId, dateTimeCreated);\n\n } else {\n // If '/giphy ' was not found, then convert unicode emoji to \"colon\" style (i.e. :smile:)\n chatMessageEntered = document.getElementById('chatmessage').value;\n chatMessageWithEmojisInShortForm = emojione.toShort(chatMessageEntered);\n\n // Create chat message object to send\n var chatMessage = {\n\n sender: username,\n userId: userId,\n message: chatMessageWithEmojisInShortForm,\n created: dateTimeCreated,\n chatid: $rootScope.chatid\n };\n\n // Send the chat message out to the socket.io server\n chatFactory.emit('chat message', chatMessage);\n\n // Blank out the chat message form after the message was emitted.\n // Emoji-wysiwyg-editor is the class associated with the content editable div that gets inserted into\n // the element that is tagged with data-emojiable=true\n $('.emoji-wysiwyg-editor').empty();\n\n // Add message to message table in Express API DB\n postChatMessage(chatMessage);\n }\n\n }", "title": "" }, { "docid": "d3f23b256fad6db177ca8c4647da4060", "score": "0.58186686", "text": "function echo(msg) {\n // log msg to the history\n a_said.push('<p>' + msg + '</p>');\n // print in the chat-bot\n // want to log only six dialogues...\n var a_said_length = a_said.length,\n start = Math.max(a_said_length - 6, 0),\n output = '';\n // add dialogues to output\n for ( i=start; i<a_said_length; i++ ) {\n output += a_said[i];\n }\n var chat_echo = document.querySelector('.chat-echo');\n chat_echo.innerHTML = output;\n}", "title": "" }, { "docid": "06e7282cefc473c2b8327753bf945df8", "score": "0.5804822", "text": "function insertChat(who, text, time) {\n if (time === undefined) {\n time = 0;\n }\n var control = \"\";\n var date = formatAMPM(new Date());\n\n if (who == \"me\") {\n control = '<li style=\"width:100%\">' +\n '<div class=\"msj macro\">' +\n '<div class=\"avatar\"><img class=\"img-circle\" style=\"width:100%;\" src=\"' + me.avatar + '\" /></div>' +\n '<div class=\"text text-l\">' +\n '<p>' + text + '</p>' +\n '<p><small>' + date + '</small></p>' +\n '</div>' +\n '</div>' +\n '</li>';\n } else if (who == \"Results\" && text.botresponse == undefined) {\n control +=\n '<li style=\"width:100%;\">' +\n '<div class=\"msj-rta macro\">' + //+ '<i>'\n '<div class=\"text text-r\" style=\"width:100%; float: left;\">' +\n '<table id=\"query_results\" border=\"1\"><tr>';\n if (text[0] == undefined) {\n for (var attributename in text) {\n control += \"<th>\" + attributename + \"</th>\";\n }\n control += '</tr>';\n control += '<tr>';\n for (var attributename in text) {\n control += \"<td>\" + text[attributename] + \"</td>\";\n }\n control += '</tr>';\n\n } else {\n for (var attributename in text[0]) {\n control += \"<th>\" + attributename + \"</th>\";\n }\n for (var key in text) {\n control += '<tr>';\n for (var attributename in text[key]) {\n control += \"<td>\" + text[key][attributename] + \"</td>\";\n }\n control += '</div>' + '</div>' + '</i>' +\n\n '</li>';\n '</tr>';\n }\n }\n control += '</tr>';\n control += '</table>';\n //control += '<tr>'\n //for(var attributename in text) {\n // control += \"<td>\" + text[attributename] + \"</td>\";\n // }\n // control += '</tr>'\n // control += '</table>\n } else if (text[0] != undefined) {\n //control = chat(person, txt);\n control = '<li style=\"width:100%;\">' +\n '<div class=\"msj-rta macro\">' +\n '<div class=\"text text-r\">' +\n '<p>' + text +\n '</p>' +\n '<p><small>' + date + '</small></p>' +\n '</div>' +\n '<div class=\"avatar\" style=\"padding:0px 0px 0px 10px !important\"><img class=\"img-circle\" style=\"width:100%;\" src=\"' + you.avatar + '\" /></div>' +\n '</li>';\n }\n\n\n setTimeout(\n function() {\n $(\"ul\").append(control).scrollTop($(\"ul\").prop('scrollHeight'));\n }, time);\n\n}", "title": "" }, { "docid": "237de088c9e12987592fe9735ebe623f", "score": "0.5793533", "text": "function insertChat(who, text, speaker, time = 0) {\n var control = \"\";\n var date = formatAMPM(new Date());\n\n if (who == \"me\") {\n\n control = '<li style=\"width:100%\" tabindex=\"1\">' +\n '<div class=\"msj macro\">' +\n '<div class=\"text text-l\">' +\n '<p><b>' + speaker + '</b><br>' + text + '</p>' +\n '<p><small>' + date + '</small></p>' +\n '</div>' +\n '</div>' +\n '</li>';\n\n\n } else {\n control = '<li style=\"width:100%;\" tabindex=\"1\">' +\n '<div class=\"msj-rta macro\">' +\n '<div class=\"text text-r\">' +\n '<p><b>' + speaker + '</b><br>' + text + '</p>' +\n '<p><small>' + date + '</small></p>' +\n '</div>' +\n '<div class=\"avatar\" style=\"padding:0px 0px 0px 10px !important\"></div>' +\n '</li>';\n\n //$('#chat_scroll').scrollTop($('#chat_scroll')[0].scrollHeight);\n }\n setTimeout(\n function () {\n $(\"#chat_scroll\").append(control);\n $('#chat_scroll').scrollTop($('#chat_scroll')[0].scrollHeight);\n }, time);\n\n}", "title": "" }, { "docid": "70c9e63c2592634173f8f2d5c7378059", "score": "0.57870656", "text": "function showchatroom(portal){\n // console.log(portal.history);\n\n var history = portal.history;\n $(\".chatbody\").html(\"\");\n $(\".portaltitle\").html(\"\");\n $(\".portaltitle\").append(\"<div class='title'></div>\");\n $('.chatbody').append(\"<div class='text'></div>\");\n $(\".title\").append(\"<h2 class='titleline1'>This is a portal made by the team: <span class='colortitle'> \" + portal.teamname + \"</span></h2><h3 class='titleline2'>within the channel: <span class='colortitle'> \" + portal.channelname + \"</span></h3><h3 class='titleline3'>Its creator: <span class='colortitle'> \" + portal.creator.name + \"</span></h3>\")\n $(\".text\").css({\n \"overflow-y\": \"scroll\",\n \"height\" : \"100%\",\n \"position\" : \"relative\"\n });\n\n history.forEach(function(message){\n // console.log(message);\n var sender = message.sender;\n // console.log(message.message, \"this is the message\");\n var text = message.message.replace(/(<|>)/ig,\"\");\n // var avatar = message.senderavatar;\n // console.log(\"this is the messge\" , message);\n if (message.isfromslack) {\n var avatar = message.senderavatar;\n } else {\n var avatar = \"./portaluser.png\";\n }\n text = emojione.shortnameToImage(text);\n $(\".text\").append(\n \"<div class='avattext'><img src=\" + avatar + \" alt='avatar' class='avatar'>\" + \"<div class='flexnone'><h3>\" + sender + \"</h3><p>\" + text + \"</p></div></div>\");\n });\n $(\".text\").scrollTop($(\".text\").get(0).scrollHeight);\n }", "title": "" }, { "docid": "6e27cb65505f4ab93be89229ba475c1f", "score": "0.5782419", "text": "reactInvitation(){\n this.message.react(inviteEmojis[0]).then(_ =>\n this.message.react(inviteEmojis[1])\n .catch(console.error)\n ).catch(console.error);\n }", "title": "" }, { "docid": "1918d2bee5a58db31a4e4fbb8f6c2ab9", "score": "0.5776135", "text": "sendMessage() {\n // Send message on an adventure\n this.io.emit('chat message', this.message);\n\n // Hang its farewell picture on the wall\n this.addSelfMessage();\n }", "title": "" }, { "docid": "222b1b04391315b63ac9c36bcb763cd2", "score": "0.5774894", "text": "function add_chat( number, text ) {\n if (!text.replace( /\\s+/g, '' )) return true;\n\n var newchat = document.createElement('div');\n newchat.innerHTML = PUBNUB.supplant(\n '<strong>{number}: </strong> {message}', {\n message : safetxt(text),\n number : safetxt(number)\n } );\n chat_out.insertBefore( newchat, chat_out.firstChild );\n}", "title": "" }, { "docid": "5081affccb99544b99c80cf9092ca04d", "score": "0.57724524", "text": "handleCommand(command, args) {\n const SEND = (data, user = this) => user.send(JSON.stringify(data));\n\n switch (command) {\n // command listing\n case '?':\n case 'help':\n if (!args.length) {\n SEND({\n type: 'note',\n text: `</i><b>COMMAND LISTING:</b>\n <ul>\n ${Array.from(HELP_PAGE_MAP.entries()).forEach(([ cmd, data ]) => {\n `<li><code>${cmd}</code> - ${data.string}</li>`\n }).join()}\n </ul>\n <i>`\n });\n } else if (HELP_PAGE_MAP.has(args[0])) {\n SEND({\n type: 'note',\n text: `</i>\n <b><code>${cmd}</code></b> \n <i>`\n });\n } else {\n SEND({\n type: 'note',\n text: `</i><b>ERROR:</b> <i>Unknown command.`\n })\n }\n break;\n\n // member listing\n case 'members':\n case 'ls':\n if (args.length) {\n SEND({\n type: 'note',\n text: `</i><b>ERROR:</b> <i>members requires 0 arguments.`\n });\n } else {\n SEND({\n type: 'note',\n text: `</i>\n <ul>\n ${this.room.members.forEach((member) => {\n `<li>${member}</li>`\n }).join()}\n </ul>\n <i>`\n });\n }\n break;\n\n // private message\n case 'priv':\n case 'pm':\n if (args.length < 2) {\n SEND({\n type: 'note',\n text: `</i><b>ERROR:</b> <i>priv requires at least 2 arguments.`\n });\n } else if (!Array.from(this.room.members.keys()).includes(args[0])) {\n SEND({\n type: 'note',\n text: `</i><b>ERROR:</b> <i>User doesn't exist.`\n });\n } else {\n args[1] = args.slice(1).join(' ');\n\n SEND({\n type: 'chat',\n name: `</b>PM from <b>${this.name}`,\n text: args[1]\n }, this.room.members.get(args[0]));\n \n args[0] = args[0].replace('<', '&lt;').replace('>', '&gt;');\n args[1] = args[1].replace('<', '&lt;').replace('>', '&gt;');\n\n SEND({\n type: 'note',\n text: `</i> You sent to <b>${args[0]}</b>: <i>${args[1]}`\n });\n }\n break;\n\n default:\n SEND({\n type: 'note',\n text: `</i><b>ERROR:</b> <i>unknown command name \"${command}\"`\n });\n break;\n }\n }", "title": "" }, { "docid": "a6866a92b02a2fbdb760b17e4fed0d08", "score": "0.57696307", "text": "function insertChat(who, text, date_msg){\n var control = \"\";\n var date = formatDate(date_msg);\n\n if (who == \"me\" || who == 'я'){\n control = '<li style=\"width:100%;\">' +\n '<div class=\"msj-rta macro\">' +\n '<div class=\"text text-r\">' +\n '<p>'+text+'</p>' +\n '<p><small>'+date+'</small></p>' +\n '</div>' +\n '</li>';\n\n }else{\n control = '<li style=\"width:100%\">' +\n '<div class=\"msj macro\">' +\n '<div class=\"text text-l\">' +\n '<p>'+ text +'</p>' +\n '<p><small>'+date+'</small></p>' +\n '</div>' +\n '</div>' +\n '</li>';\n }\n $(\"#messages\").append(control);\n\n\n}", "title": "" }, { "docid": "656997f05fbe8bfa5ea2dd2945e1af53", "score": "0.575988", "text": "function openPrivateChat(e) {\n document.querySelector('#openChat').innerHTML = \"Vrati se na grupni chat\"\n activeChat = \"chat1v1\"\n user1v1 = e;\n if (e != currentUserPrivateChat) {\n //provjeri da li postoji historija izmedju 2 korisnika\n let msg = { \"posiljaoc\": localStorage.getItem('nick'), \"primalac\": e }\n socket.emit('newConversation', msg)\n privateChat.innerHTML = \"\"\n currentUserPrivateChat = e;\n }\n // sakri grupni, prikazi privatni i podesi vidljivost\n mainChat.style.display = \"none\"\n privateChat.style.display = \"block\"\n privateChat.scrollTop = privateChat.scrollHeight\n}", "title": "" }, { "docid": "2bd463a914e1829f179d43bc98abd73e", "score": "0.57575357", "text": "function insertChat(who, text, time){\n if (time === undefined){\n time = 0;\n }\n var control = \"\";\n var date = formatAMPM(new Date());\n\n if (who == \"me\"){\n control = '<li style=\"width:100%\">' +\n '<div class=\"msj macro\">' +\n '<div class=\"avatar\"><img class=\"img-circle\" style=\"width:100%;\" src=\"'+ me.avatar +'\" /></div>' +\n '<div class=\"text text-l\">' +\n '<p>'+ text +'</p>' +\n '<p><small>'+date+'</small></p>' +\n '</div>' +\n '</div>' +\n '</li>';\n }else{\n control = '<li style=\"width:100%;\">' +\n '<div class=\"msj-rta macro\">' +\n '<div class=\"text text-r\">' +\n '<p>'+text+'</p>' +\n '<p><small>'+date+'</small></p>' +\n '</div>' +\n '<div class=\"avatar\" style=\"padding:0px 0px 0px 10px !important\"><img class=\"img-circle\" style=\"width:100%;\" src=\"'+you.avatar+'\" /></div>' +\n '</li>';\n }\n setTimeout(\n function(){\n $(\"ul\").append(control).scrollTop($(\"ul\").prop('scrollHeight'));\n }, time);\n\n}", "title": "" }, { "docid": "0947da230b03229d408fdff69d17e0d0", "score": "0.5757369", "text": "function showmessage(info){\n var message = info.message;\n var sender = message.sender;\n var text = message.message.replace(/(<|>)/ig,\"\");\n text = emojione.shortnameToImage(text);\n if (message.isfromslack) {\n var avatar = message.senderavatar;\n } else {\n var avatar = \"./portaluser.png\";\n }\n $(\".text\").append(\n \"<div class='avattext'><img src=\"\n + avatar + \n \" alt='avatar' class='avatar'>\" \n + \"<div class='flexnone'><h3>\" \n + sender + \n \"</h3><p>\" \n + text + \n \"</p></div></div>\"\n );\n $(\".text\").scrollTop($(\".text\").get(0).scrollHeight);\n }", "title": "" }, { "docid": "58e26ff44af7bb502f75ff58e10aee3f", "score": "0.5752947", "text": "function talk(origin, text, eventHandlersToAdd, currentQuestionID) {\n var chatBox = createChatBubbleHtmlElement(origin, currentQuestionID);\n //Add text to element.\n chatBox.find(\"p\").html(text);\n //Adding onclick events to autolearnitems now that they are part of the DOM.\n chatBox.addClass(\"chat-bar_TRANSITION\");\n chatBox.removeClass(\"chat-bar_HIDDEN\");\n chatBox.insertBefore($(\"#loader\"));\n if (eventHandlersToAdd) {\n chatBox.find(\".clickable-element\").on(\"click\", function() {\n converse($(this).text());\n });\n }\n setTimeout(function() {\n chatBox.removeClass(\"chat-bar_TRANSITION\");\n }, 100);\n}", "title": "" }, { "docid": "031a71fc702c6bc56f77f1fba6e91a55", "score": "0.5751976", "text": "updateText() {\n if (this.chatmsg.content.trim() == \"\") {\n document.getElementById(\"client_name\").style.display = \"none\";\n document.getElementById(\"client_chat\").style.display = \"none\";\n } else {\n document.getElementById(\"client_name\").style.display = \"block\";\n document.getElementById(\"client_chat\").style.display = \"block\";\n }\n\n if (this.chatmsg.isnew) {\n const shouts = {\n \"1\": \"holdit\",\n \"2\": \"takethat\",\n \"3\": \"objection\"\n };\n\n let shout = shouts[this.chatmsg.objection];\n if (typeof shout !== \"undefined\") {\n document.getElementById(\"client_char\").src = AO_HOST + \"misc/\" + shout + \".gif\";\n this.chatmsg.sound = \"sfx-\" + shout;\n this.shoutTimer = 800;\n } else {\n this.shoutTimer = 0;\n }\n\n this.chatmsg.isnew = false;\n this.chatmsg.startspeaking = true;\n }\n\n if (this.textTimer >= this.shoutTimer) {\n if (this.chatmsg.startspeaking) {\n changeBackground(this.chatmsg.side);\n document.getElementById(\"client_char\").src = AO_HOST + \"characters/\" + escape(this.chatmsg.name) + \"/\" + this.chatmsg.speaking + \".gif\";\n document.getElementById(\"client_name\").style.fontSize = (document.getElementById(\"client_name\").offsetHeight * 0.7) + \"px\";\n document.getElementById(\"client_chat\").style.fontSize = (document.getElementById(\"client_chat\").offsetHeight * 0.25) + \"px\";\n document.getElementById(\"client_name\").innerHTML = \"<p>\" + escapeHtml(this.chatmsg.nameplate) + \"</p>\";\n\n const colors = {\n \"0\": \"#ffffff\",\n \"1\": \"#00ff00\",\n \"2\": \"#ff0000\",\n \"3\": \"#ffaa00\",\n \"4\": \"#0000ff\",\n \"5\": \"#ffff00\",\n \"6\": \"#aa00aa\"\n };\n let stylecolor = \"color: \" + (colors[this.chatmsg.color] || \"#ffffff\");\n document.getElementById(\"client_inner_chat\").style = stylecolor;\n this.chatmsg.startspeaking = false;\n } else {\n if (this.textnow != this.chatmsg.content) {\n if (this.chatmsg.content.charAt(this.textnow.length) != \" \") {\n this.combo = (this.combo + 1) % 2;\n switch (this.combo) {\n case 0:\n this.blip.play();\n break;\n case 1:\n //this.womboblip.play()\n break;\n }\n }\n this.textnow = this.chatmsg.content.substring(0, this.textnow.length + 1);\n document.getElementById(\"client_inner_chat\").innerHTML = this.textnow;\n if (this.textnow == this.chatmsg.content) {\n this.textTimer = 0;\n clearInterval(this.updater);\n document.getElementById(\"client_char\").src = AO_HOST + \"characters/\" + escape(this.chatmsg.name) + \"/\" + this.chatmsg.silent + \".gif\";\n }\n }\n }\n }\n if (!this.sfxplayed && this.chatmsg.snddelay + this.shoutTimer >= this.textTimer) {\n this.sfxaudio.pause();\n this.sfxplayed = 1;\n if (this.chatmsg.sound != \"0\" && this.chatmsg.sound != \"1\") {\n this.sfxaudio.src = AO_HOST + \"sounds/general/\" + escape(this.chatmsg.sound) + \".wav\";\n this.sfxaudio.play();\n }\n }\n this.textTimer = this.textTimer + UPDATE_INTERVAL;\n }", "title": "" }, { "docid": "bf7fdd1311c429d72f34915163c3fd9d", "score": "0.5748068", "text": "function VideoChatUtil(){}", "title": "" }, { "docid": "3d01ef37cee3a551adef52ddb91be4ab", "score": "0.5746187", "text": "function insertChat(who, text, time = 0){\n var control = \"\";\n var date = formatAMPM(new Date());\n \n if (who == \"me\"){\n \n control = '<li style=\"width:100%\">' +\n '<div class=\"msj macro\">' +\n '<div class=\"text text-l\">' +\n '<p>'+ text +'</p>' +\n '<p><small>'+date+'</small></p>' +\n '</div>' +\n '</div>' +\n '</li>'; \n }else{\n control = '<li style=\"width:100%;\">' +\n '<div class=\"msj-rta macro\">' +\n '<div class=\"text text-r\">' +\n '<p>'+text+'</p>' +\n '<p><small>'+date+'</small></p>' +\n '</div>' +\n '<div class=\"avatar\" style=\"padding:0px 0px 0px 10px !important\"></div>' + \n '</li>';\n }\n setTimeout(\n function(){ \n $(\"ul\").append(control);\n\n }, time);\n \n}", "title": "" }, { "docid": "d6cde1b01b7ac3ac33a344d1a9b1d10a", "score": "0.57456404", "text": "function addChatTyping(data) {\n data.typing = true;\n data.msg = \"is typing\";\n addChatMessage(data);\n }", "title": "" }, { "docid": "5b6929bd229f2dd2f47dcca2928cab50", "score": "0.5741607", "text": "function insertChat(who, text, time){\n if (time === undefined){\n time = 0;\n }\n var control = \"\";\n var date = formatAMPM(new Date());\n \n if (who == \"me\"){\n control = '<li style=\"width:100%\">' +\n '<div class=\"msj macro\">' +\n '<div class=\"avatar\"><img class=\"img-circle\" style=\"width:100%;\" src=\"'+ me.avatar +'\" /></div>' +\n '<div class=\"text text-l\">' +\n '<p>'+ text +'</p>' +\n '<p><small>'+date+'</small></p>' +\n '</div>' +\n '</div>' +\n '</li>'; \n }else{\n control = '<li style=\"width:100%;\">' +\n '<div class=\"msj-rta macro\">' +\n '<div class=\"text text-r\">' +\n '<p>'+text+'</p>' +\n '<p><small>'+date+'</small></p>' +\n '</div>' +\n '<div class=\"avatar\" style=\"padding:0px 0px 0px 10px !important\"><img class=\"img-circle\" style=\"width:100%;\" src=\"'+you.avatar+'\" /></div>' + \n '</li>';\n }\n setTimeout(\n function(){ \n $(\"ul\").append(control).scrollTop($(\"ul\").prop('scrollHeight'));\n }, time);\n \n}", "title": "" }, { "docid": "afdf83db884caaba6feffe82547e3f97", "score": "0.5740918", "text": "static chatMessage(speaker, owner, message, item) {\n if (game.settings.get(\"lootsheetnpcffd20\", \"buyChat\")) {\n if (item) {\n message = `<div class=\"ffd20 chat-card item-card\" data-actor-id=\"${owner._id}\" data-item-id=\"${item._id}\">\n <header class=\"card-header flexrow\">\n <img src=\"${item.img}\" title=\"${item.showName}\" width=\"36\" height=\"36\">\n <h3 class=\"item-name\">${item.showName}</h3>\n </header>\n <div class=\"card-content\"><p>${message}</p></div></div>`;\n } else {\n message = `<div class=\"ffd20 chat-card item-card\" data-actor-id=\"${owner._id}\">\n <div class=\"card-content\"><p>${message}</p></div></div>`;\n }\n ChatMessage.create({\n user: game.user._id,\n speaker: {\n actor: speaker,\n alias: speaker.name\n },\n content: message\n });\n }\n }", "title": "" }, { "docid": "792861237f3dc186bc0865bc645c18c9", "score": "0.573318", "text": "function updateChat(data)\r\n{\r\n //limit username size\r\n appendChat(data.user.substr(0, 16) + \": \" + data.msg);\r\n}", "title": "" }, { "docid": "0a9bcdc599fbfbe8f9b15327e1c63d13", "score": "0.5727786", "text": "function addChatTyping (data) {\n\t\tdata.typing = true;\n\t\tdata.message={};\n\t\tdata.message.sujet = 'is typing';\n\t\tdata.message.propriete = '';\n\t\tdata.message.objet = '';\n\t\taddChatMessage(data);\n }", "title": "" }, { "docid": "d46948898e0569590bf71704bf06bb3f", "score": "0.5721218", "text": "function insertChat(who, text, time){\n if (time === undefined){\n time = 0;\n }\n var control = \"\";\n var date = formatAMPM(new Date());\n \n if (who == \"me\"){\n control = '<li style=\"width:100%\">' +\n '<div class=\"msj macro\">' +\n '<div class=\"avatar\"><img class=\"img-circle\" style=\"width:100%;\" src=\"'+ me.avatar +'\" /></div>' +\n '<div class=\"text text-l\">' +\n '<p>'+ text +'</p>' +\n '<p><small>'+date+'</small></p>' +\n '</div>' +\n '</div>' +\n '</li>'; \n }else{\n control = '<li style=\"width:100%;\">' +\n '<div class=\"msj-rta macro\" style =\"background-color: #1b9de8;\">' +\n '<div class=\"text text-r\">' +\n '<p style =\"color: white;\">'+text+'</p>' +\n '<p style =\"color: white;\"><small>'+date+'</small></p>' +\n '</div>' +\n '<div class=\"avatar\" style=\"padding:0px 0px 0px 10px !important\"><img class=\"img-circle\" style=\"width:100%;\" src=\"'+you.avatar+'\" /></div>' + \n '</li>';\n }\n setTimeout(\n function(){ \n $(\".chat\").append(control).scrollTop($(\".chat\").prop('scrollHeight'));\n }, time);\n \n}", "title": "" }, { "docid": "33602906560ff8cb5110e97f0fc714de", "score": "0.5716326", "text": "function addChatTyping(data) {\n data.typing = true;\n data.message = 'is typing';\n target = data.sender;\n addChatMessage(data);\n }", "title": "" }, { "docid": "3ecb3304e3367f2274989ba507f8e329", "score": "0.5714379", "text": "function chat()\n{ \n var textfield = $(\"#textfield\");\n var element = $(\"#chattext\");\n \n if(textfield.val()!=\"\")\n {\n var message = $('<div id=\"chatbubble\" name=\"bubble\"></div>');\t\n message.attr(\"class\", \"chatMessage playerbubble fade-in-element\");\t\t\n message.append(getPlayerName());\n message.append(\" \");\n\n var msgBody = textfield.val();\n msgBody = replace_emotes(msgBody);\n\t\tvar msgBodyDiv = $('<div class=\"playertext\">' + msgBody +'</div>');\n\t\tmessage.append(msgBodyDiv);\n \n textfield.val(\"\");\n \n element.append(message);\n\n\t\tstrToArray(msgBody);\n\t\t\n\t\t//msgCommand = \"the \" + msgBody;\n\t\t//searchCommandWords(msgCommand);\n\t\t\n\t\tscrollToBottom();\n\t\tcutTopOfChat();\n }\n}", "title": "" }, { "docid": "fa5c1b9d47a2ed969df9dd947bb68848", "score": "0.57054555", "text": "function handleLiveChat(userObj,callback) {\n\tvar ret = [];\n\tvar replyText;\n\n\treplyText = 'I\\'m sorry, I cannot do that feature quite yet! I\\'ll let you ' + \n\t 'know when I get smart enough! Feel free to message TritonFind\\'s' + \n\t\t\t\t'creator here:';\n\n\tvar webButton = new formatter.Button('web_url', \"TritonFind Creator\", null, \n\t\t\t\t\t\t'https://www.m.me/100001067662345');\n\n\tret.push(new formatter.ReplyObjButton(userObj.userID, replyText, [webButton]));\n\tcallback(ret);\n}", "title": "" }, { "docid": "3b5c79c1ff55900994f11ae45bb4b0e3", "score": "0.5698526", "text": "function createChatSpecialMessage(msg,user,imgg,now){\n\n\t\tvar li = $(\n\t\t\t'<li class=' + 'revelation' + '>'+\n\t\t\t\t'<p></p>' +\n\t\t\t'</li>');\n\n\t\t// use the 'text' method to escape malicious user input\n\t\tli.find('p').text(msg);\n\t\tchats.append(li);\n\t}", "title": "" }, { "docid": "08892f0648e00c8f6b22764666317798", "score": "0.56969464", "text": "function sendChat (msg){\r\n document.getElementById (\"mod_comm_input\").value = msg;\r\n unsafeWindow.Chat.sendChat ();\r\n}", "title": "" }, { "docid": "08892f0648e00c8f6b22764666317798", "score": "0.56969464", "text": "function sendChat (msg){\r\n document.getElementById (\"mod_comm_input\").value = msg;\r\n unsafeWindow.Chat.sendChat ();\r\n}", "title": "" }, { "docid": "c29af4aad3362f318abdc6304f69ebc5", "score": "0.5692515", "text": "function createChat() {\n let chats_title = prompt(\n \"Enter the name of Chat(Leave black if pressed accidentally)\"\n );\n console.log(chats_title);\n if (chats_title.length > 0) socket.emit(\"create-chat\", chats_title, user);\n setTimeout(function () {\n location.reload();\n }, 1000);\n}", "title": "" }, { "docid": "28632c2b628ad6a4be7572ad8a44ac93", "score": "0.5686405", "text": "function toggleChatOverlay() {\n if ( chatOverlayIsVisible ) {\n document.getElementById( 'chatOverlay' )\n .style.display = 'none';\n document.getElementById( 'viewChatText' )\n .innerHTML = 'Open full chat';\n chatOverlayIsVisible = false;\n } else {\n document.getElementById( 'chatOverlay' )\n .style.display = 'block';\n document.getElementById( 'viewChatText' )\n .innerHTML = 'Close full chat';\n if ( inTutorial || inUserUpload ) {\n document.getElementById( 'chatOverlayInput' )\n .style.display = 'none';\n } else {\n document.getElementById( 'chatOverlayInput' )\n .style.display = 'block';\n document.getElementById( 'writeMessage' )\n .focus();\n }\n chatOverlayIsVisible = true;\n updateChatScroll();\n }\n}", "title": "" }, { "docid": "1376ca947ed42a7d695d10da242f4ba4", "score": "0.56844944", "text": "function appendChat(name, text)\n{\n\tconst chatLine = document.createElement(\"div\");\n\tchatLine.className = \"chatLine\";\n\t\n\tconst playerName = document.createElement(\"span\");\n\tplayerName.className = \"playerName\";\n\tplayerName.innerHTML = name + \":\";\n\t\n\tchatLine.appendChild(playerName);\n\tchatLine.innerHTML += text;\n\t\n\tdocument.getElementById(\"chatLines\").appendChild(chatLine);\n\tdocument.getElementById(\"chatHistory\").scrollTop = document.getElementById(\"chatHistory\").scrollHeight;\n}", "title": "" }, { "docid": "3af4d77014d63c700d96536423872733", "score": "0.5678452", "text": "function updateChat(msg) {\n var data = JSON.parse(msg.data);\n\n if (data.reason == \"duplicate_username\") {\n alert(\"this username is taken!\");\n setUsername();\n return;\n }\n if (data.reason == \"duplicate_channelname\") {\n alert(\"this channelname is taken or forbidden!\");\n addChannel();\n return;\n }\n if (data.reason == \"duplicate_Protectedchannelname\") {\n alert(\"this channelname is taken or forbidden!\");\n addProtectedChannel();\n return;\n }\n if(data.reason == \"authenticate\"){\n authenticate(data.channel);\n }\n\n\n if (data.reason == \"message\") {\n insert(\"chat\", data.userMessage);\n }\n if (data.reason == \"userRefresh\") {\n id(\"userList\").innerHTML = \"\";\n data.userList.forEach(function (user) {\n insert(\"userList\", \"<li>\" + user + \"</li>\");\n });\n return;\n }\n id(\"channellist\").innerHTML = \"\";\n data.channellist.forEach(function (channel) {\n\n var znacznik = document.createElement('button');\n znacznik.onclick = function () {\n joinChannel(channel);\n };\n var t = document.createTextNode(channel);\n znacznik.appendChild(t);\n\n var kontener = id(\"channellist\");\n kontener.appendChild(znacznik);\n });\n\n\n}", "title": "" }, { "docid": "9e5f3deee84982e01e2a75eb42674b3c", "score": "0.56707656", "text": "function setUpChatEvents() {\n socket.on('chat', function (data) {\n partner.emit('chat', {\n message: data.message\n });\n });\n\n socket.on('typing', function (data) {\n partner.emit('is typing', {\n message: data.message\n });\n });\n\n socket.on('clearedtextfield', function () {\n partner.emit('clearedtextfield');\n });\n\n socket.on('stoppedtyping', function (data) {\n partner.emit('stopped', {\n message: data.message\n });\n });\n\n socket.on('disconnect', function () {\n partner.emit('exit', {\n message: 'Your partner has disconnected.'\n });\n });\n }", "title": "" }, { "docid": "36a624a55fbb3790b4bf4363b508a7fb", "score": "0.5669061", "text": "function chatHandler(_x) {\n return _chatHandler.apply(this, arguments);\n } //if the other user is wrting add animation if wrting", "title": "" }, { "docid": "826733adde6e16c7700d9d3872ad6d72", "score": "0.5666269", "text": "chooseChat(chatToActivate, index) {\n this.activeChat = chatToActivate;\n this.activeUser = index;\n this.inputTextMess =\"\";\n }", "title": "" }, { "docid": "0129c7523689997956037a62450b3a7b", "score": "0.56576943", "text": "socketMessage(event) {\n const data = JSON.parse(event.data);\n\n if (data.message && data.message.action === 'speak') {\n this.gameLog.addEvent(data.message);\n\n this.scrollEvenListToBottom();\n }\n }", "title": "" }, { "docid": "9c744f6e6797a18511151e9f9b2d56c5", "score": "0.5650375", "text": "function emit_mock_msg() {\n setTimeout(function () {\n var user = spa.model.people.get_user();\n if (callback_map.updatechat) {\n callback_map.updatechat([{\n dest_id : user.id,\n dest_name : user.name,\n sender_id : 'id_04',\n msg_text : `Hi there ${user.name}! I'm not Wilma.`\n }]);\n } else {\n emit_mock_msg();\n }\n \n }, 8000);\n }", "title": "" }, { "docid": "9c7d7bd676fe90d50f9a19a138927f34", "score": "0.5628323", "text": "function webChat(usr)\n{\n if (!usr)\n return '';\n\n var tmp = usr.chatBuf;\n usr.chatBuf = '';\n return tmp.replace(new RegExp('\\r\\n', 'g'), '<br />');\n}", "title": "" }, { "docid": "0535333810dd7ad0c07c783d01d8e263", "score": "0.5625155", "text": "HandOverLive(text) {\n var content = GetText('./Responses/Human/HandoverText.txt', 'Handover Text'); \n fbRichMessage(sessions[text.sessionId].fbid, content);\n var content = GetText('./Responses/Human/HandoverToLive.txt', 'Handover to Live'); \n fbHandOverMessage(sessions[text.sessionId].fbid, content, 'pass');\n }", "title": "" }, { "docid": "80bd53c67bb52fa7284b431089606523", "score": "0.56147176", "text": "function chat() {\n document.querySelector(\"#uriel621\").setAttribute(\"class\", \"container\");\n chat_area();\n chat_message();\n\n message();\n messages_textarea();\n send_button();\n\n communication();\n}", "title": "" }, { "docid": "8aabe6ea658570c9d57844018e399eaf", "score": "0.56139535", "text": "function addToTranscript(who, text) {\n var transcript = document.getElementById('chat_window');\n transcript.innerHTML += [\n '<div class=\"chat-message from-' + who + '\">',\n '<span>' + text + '</span>',\n '</div>'\n ].join('');\n\n window.scrollTo(0, document.body.scrollHeight);\n}", "title": "" }, { "docid": "00eab65712eb2863536d1d2016852ca7", "score": "0.5613749", "text": "connectedCallback(){\n this.subtitle = 'Are you sure you wish to post the following message to Chatter? This may allow other members of your organisation to see your chat. <b>Ensure you have the consent of '\n this.subtitle += '' + this.recipientName + ' before posting anything publicly. </b>';\n }", "title": "" }, { "docid": "141e3296b2996b9e0bff8c421e3230f5", "score": "0.56040764", "text": "function sendTypingToChat(user){\n return (chatId, isTyping)=>{\n io.emit(`${TYPING}-${chatId}`, {user, isTyping})\n }\n}", "title": "" }, { "docid": "7e109b00b6414c79ad8286980d3f4ee9", "score": "0.5602284", "text": "function handleMessage({username, text, name}){\n let temp, p;\n if(selfUsername == username){\n temp = document.getElementById('self-msg-tmp');\n p = temp.content.cloneNode(true);\n }else{\n temp = document.getElementById('other-msg-tmp');\n p = temp.content.cloneNode(true);\n $('.msg-author',p).text(name);\n $('.msg-logo',p).text(name[0].toUpperCase());\n }\n\n $('.msg-text',p).text(text);\n $('.msg-time',p).text(getTimestamp());\n \n chatsWrapper.appendChild(p);\n chatsWrapper.scrollTo(0,chatsWrapper.scrollHeight);\n \n }", "title": "" }, { "docid": "af8895754c9a3fe42254d94b90d72621", "score": "0.5597696", "text": "function bot(append_to){\n\n // Aggiungo animazione in attesa della timing function\n addAnimation()\n\n setTimeout(function(){\n\n // rimuovo Animazione\n $('.wrapper-chat .contact-chat.animation').remove();\n\n var arr_risposte = [\n \"ciao\",\n \"sono solo un robot scemo\",\n \"dico sempre le stesse cose\",\n \"è inutile che chiedi, tanto sono scemo\",\n \"smettila\",\n \"ora sono stanco\",\n \"buona notte\",\n \"magari domani possiamo parlare con calma\",\n \"sto rientrando solo adesso\",\n \"ci sentiamo!\",\n \"spengo il telefono\",\n \"speriamo\",\n \"non lo so\",\n \"penso di dormire\"\n ];\n\n var randomRisposta = randomGenerator(arr_risposte);\n\n // Clacolo dell'ora di ricezione del messaggio\n var time = new Date();\n var minutes = time.getMinutes();\n console.log( \"0\" + minutes);\n if (minutes < 10) {\n minutes = \"0\" + minutes;\n }\n var hours = time.getHours() + \":\" + minutes;\n\n var source = document.getElementById('msg-risposta-template').innerHTML;\n var template = Handlebars.compile(source);\n\n var context = {\n text: randomRisposta,\n time: hours\n };\n\n // Appendo la risposta con template Handlebars\n var html = template(context);\n\n\n\n // Appendo il messaggio in chat\n $('#chat-window .wrapper-chat.active').append(html);\n\n // inserisco l'ultimo messaggio e l'orario relativo\n //nel template contatto nella lista contatti, dopo controllo lunghezza\n if (randomRisposta.length > 15) {\n var trimmedRisposta = randomRisposta.substring(0, 13) + \"...\";\n console.log(trimmedRisposta);\n $('.active .last-msg').text(trimmedRisposta);\n\n }else{\n\n $('.active .last-msg').text(randomRisposta);\n }\n // Orario ultimo messaggio\n $('.active .time-lastMsg').text(hours);\n }, 2500, );\n\n\n}", "title": "" }, { "docid": "d0e191a817c92edc67c512d977049b2f", "score": "0.5585713", "text": "function initiateChat(p, id, o) {\r\n\tparticipant = p;\r\n\tif (o)\r\n\t\toriginator = o;\r\n\tvar chat = getElement('chat_frame');\r\n\tchat.style.display = '';\r\n\t// alert(\"chat with \"+p);\r\n\tgetElement('chat_mes').focus();\r\n}", "title": "" }, { "docid": "94cce09fdeda9a8d4288aa354c8a3af8", "score": "0.55857086", "text": "function OpenCloseChat() {\n let bot = document.getElementById(\"bot\");\n if (bot_open) {\n bot_open = 0;\n sessionStorage.setItem(\"bot_open\", bot_open);\n bot.style.display = \"none\";\n } else {\n bot_open = 1;\n sessionStorage.setItem(\"bot_open\", bot_open);\n bot.style.display = \"\";\n }\n let text = config.toggle_chat.split(\"|\")[bot_open]\n let help = document.getElementById('help')\n if (help)\n help.innerHTML = text;\n}", "title": "" }, { "docid": "806c39419ccb19826c17a808504a81cd", "score": "0.5584395", "text": "static get COMMAND_LIST() {\n return [\n \"CHAT\", /* (s) Received a message from another user */\n \"PING\", /* Twitch is checking to see if we're still here */\n \"ACK\", /* Twitch acknowledged our capability request */\n \"TOPIC\", /* (s) Received a TOPIC message from Twitch */\n \"NAMES\", /* Received a list of connected users */\n \"JOIN\", /* User joined a channel */\n \"PART\", /* User left a channel */\n \"JOINED\", /* (s) Client joined a channel */\n \"PARTED\", /* (s) Client left a channel */\n \"RECONNECT\", /* Twitch requested a reconnect */\n \"MODE\", /* Twitch set the mode for a user */\n \"PRIVMSG\", /* Received a message */\n \"WHISPER\", /* Received a private message */\n \"USERSTATE\", /* Received user information */\n \"ROOMSTATE\", /* Received room information */\n \"STREAMINFO\", /* (s) Received stream information */\n \"ASSETLOADED\", /* (s) An asset API request resolved */\n \"USERNOTICE\", /* Received user-centric notice */\n \"GLOBALUSERSTATE\", /* Received global client user information */\n \"CLEARCHAT\", /* Moderator cleared the chat */\n \"HOSTTARGET\", /* Streamer is hosting another streamer */\n \"NOTICE\", /* Received a notice (error, warning, etc) from Twitch */\n \"SUB\", /* (s) Someone subscribed */\n \"RESUB\", /* (s) Someone resubscribed */\n \"GIFTSUB\", /* (s) Someone gifted a subscription */\n \"ANONGIFTSUB\", /* (s) Someone gifted a subscription anonymously */\n \"NEWUSER\", /* (s) A brand new user just said hi */\n \"REWARDGIFT\", /* (s) Gift rewards have been shared in chat */\n \"MYSTERYGIFT\", /* (s) Random gift rewards have been shared in chat */\n \"GIFTUPGRADE\", /* (s) Upgraded a giftsub to a real subscription */\n \"PRIMEUPGRADE\", /* (s) Upgraded a prime sub to a tiered subscription */\n \"ANONGIFTUPGRADE\", /* (s) Upgraded an anonymous giftsub */\n \"OTHERUSERNOTICE\", /* (s) Received an unknown USERNOTICE */\n \"RAID\", /* (s) Streamer is raiding or was raided by another streamer */\n \"OPEN\", /* (s) WebSocket opened */\n \"CLOSE\", /* (s) WebSocket closed */\n \"MESSAGE\", /* (s) WebSocket received a message */\n \"ERROR\", /* (s) WebSocket received an error */\n \"OTHER\" /* Received some unknown event */\n ];\n }", "title": "" }, { "docid": "07ed42ddc144b9cedaa2f7e7dc277fa2", "score": "0.5579054", "text": "function addChatTyping(data) {\n data.typing = true;\n data.message = 'is typing';\n addChatMessage(data);\n }", "title": "" }, { "docid": "07ed42ddc144b9cedaa2f7e7dc277fa2", "score": "0.5579054", "text": "function addChatTyping(data) {\n data.typing = true;\n data.message = 'is typing';\n addChatMessage(data);\n }", "title": "" }, { "docid": "07ed42ddc144b9cedaa2f7e7dc277fa2", "score": "0.5579054", "text": "function addChatTyping(data) {\n data.typing = true;\n data.message = 'is typing';\n addChatMessage(data);\n }", "title": "" }, { "docid": "194aa7257acc5bdb55303099c1e474f3", "score": "0.55768496", "text": "connectedCallback () {\n this.getUsername()\n this.display()\n this.emojis()\n this.connect()\n }", "title": "" }, { "docid": "619dbccd3591c2f7eed8452c39e54965", "score": "0.5573353", "text": "function hello()\n{\n\tchatter[chatpoint] = \"> Hello, I am Eliza.\";\n\tchatpoint = 1;\n\treturn write();\n}", "title": "" }, { "docid": "3e1716c2867f3e0e731596a581c5909c", "score": "0.5572411", "text": "function addChatMessage (data, options) {\n\t\t// Don't fade the message in if there is an 'X was typing'\n\t\tvar $typingMessages = getTypingMessages(data);\n\t\toptions = options || {};\n\t\tif ($typingMessages.length !== 0) {\n\t\t\toptions.fade = false;\n\t\t\t$typingMessages.remove();\n }\n\t\t\n\t\t//\tconsole.log(data.message);\n\t\tvar sujet=data.message.sujet;\n\t\tvar propriete=data.message.propriete;\n\t\tvar objet=data.message.objet;\n\t\tvar triplet=sujet+\" \"+propriete+\" \"+objet;\n\t\t//console.log(triplet);\n\t\tif(sujet != 'is typing'){\n\t\t\tvar newStatement = new Statement(sujet, propriete, objet);\n\t\t\tnewStatement.add2Statements();\n } \n\t\t\n\t\tvar $usernameDiv = $('<span class=\"username\"/>')\n\t\t.text(data.username)\n\t\t.css('color', getUsernameColor(data.username));\n\t\tvar $messageBodyDiv = $('<span class=\"messageBody\">')\n\t\t.text(triplet.toString());\n\t\t\n\t\tvar typingClass = data.typing ? 'typing' : '';\n\t\tvar $messageDiv = $('<li class=\"message\"/>')\n\t\t.data('username', data.username)\n\t\t.addClass(typingClass)\n\t\t.append($usernameDiv, $messageBodyDiv);\n\t\t\n\t\taddMessageElement($messageDiv, options);\n }", "title": "" }, { "docid": "e3feee6a58787773836e78797de1bf58", "score": "0.55703086", "text": "function addHumanText(text) {\n const chatContainer = document.createElement(\"div\");\n chatContainer.classList.add(\"chat-container\");\n const chatBox = document.createElement(\"p\");\n chatBox.classList.add(\"voice2text\");\n const chatText = document.createTextNode(text);\n chatBox.appendChild(chatText);\n chatContainer.appendChild(chatBox);\n return chatContainer;\n}", "title": "" }, { "docid": "f6a97c85cd2a0a65b326b74d8c4a427e", "score": "0.55680203", "text": "sendLike() {\n const {id} = this.model.currentChannel;\n const like = String.fromCodePoint(0x1F44D);\n window.connectionHandler.emit('onMessage', id, like);\n this.model.user.addSentMessage(new Message(null, id, like, this.model.user.name, new Date()));\n }", "title": "" }, { "docid": "507c908d7220790251b28f240c60627a", "score": "0.5563694", "text": "function insertChat(who, text, time = 0){\n var control = \"\";\n var date = formatAMPM(new Date());\n\n if (who == \"me\"){\n\n control = '<li style=\"width:100%\">' +\n '<div class=\"msj macro\">' +\n '<div class=\"avatar\"><img class=\"img-circle\" style=\"width:100%;\" src=\"'+ me.avatar +'\" /></div>' +\n '<div class=\"text text-l\">' +\n '<p>'+ text +'</p>' +\n '<p><small>'+date+'</small></p>' +\n '</div>' +\n '</div>' +\n '</li>';\n }else{\n control = '<li style=\"width:100%;\">' +\n '<div class=\"msj-rta macro\">' +\n '<div class=\"text text-r\">' +\n '<p>'+text+'</p>' +\n '<p><small>'+date+'</small></p>' +\n '</div>' +\n '<div class=\"avatar\" style=\"padding:0px 0px 0px 10px !important\"><img class=\"img-circle\" style=\"width:100%;\" src=\"'+you.avatar+'\" /></div>' +\n '</li>';\n }\n setTimeout(\n\t function(){\n\t $(\".chatUl\").append(control);\n\n\t }, time);\n\n}", "title": "" }, { "docid": "dedb2540d762dab879d5acf888c11dbd", "score": "0.555588", "text": "function onChatAreaClick(nick, ident, realname) {\n //alert(\"onChatAreaClick: \"+nick);\n}", "title": "" }, { "docid": "f4ac33cf2fbfd0976582d1801c8dafb4", "score": "0.55520695", "text": "function onChatHandler(target, context, msg, self) {\r\n if (self) { return; } // Ignore messages from the bot\r\n\r\n // Remove whitespace from chat message\r\n const commandName = msg.trim();\r\n\r\n if (commandName === '!covid') {\r\n axios.get('https://covid19.th-stat.com/api/open/today')\r\n .then(function(response) {\r\n client.say(target, \"ติดเชื้อ : \" + response.data.Confirmed.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\") + \"(+\" + response.data.NewConfirmed.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\") + \")\" +\r\n \" หายแล้ว : \" + response.data.Recovered.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\") + \"(+\" +\r\n response.data.NewRecovered.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\") + \")\" + \" รักษา : \" +\r\n response.data.Hospitalized.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\") + \"(+\" +\r\n response.data.NewHospitalized.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\") + \")\" +\r\n \" เสียชีวิต : \" + response.data.Deaths + \"(+\" + response.data.NewDeaths + \")\");\r\n })\r\n .catch(function(error) {\r\n // handle error\r\n console.log(error);\r\n })\r\n .then(function() {\r\n // always executed\r\n });\r\n }\r\n\r\n}", "title": "" }, { "docid": "763bc61a5b43fb33b347220373343343", "score": "0.55503714", "text": "function insertChat(who, text, idUl, time = 0){\n var control = \"\";\n var date = formatAMPM(new Date());\n var loc = $(location).attr('host');\n \n if (who === \"me\"){\n \n control = '<li style=\"width:100%\">' +\n '<div class=\"msj macro\">' +\n '<div class=\"avatar\"><img class=\"img-circle\" style=\"width:100%;\" src=\"http://'+loc+'/gustosculposos/img/avatar.png\" /></div>' +\n '<div class=\"text text-l\">' +\n '<p>'+ text +'</p>' +\n '<p><small>'+date+'</small></p>' +\n '</div>' +\n '</div>' +\n '</li>'; \n }else{\n control = '<li style=\"width:100%;\">' +\n '<div class=\"msj-rta macro\">' +\n '<div class=\"text text-r\">' +\n '<p>'+text+'</p>' +\n '<p><small>'+date+'</small></p>' +\n '</div>' +\n '<div class=\"avatar\" style=\"padding:0px 0px 0px 10px !important\"><img class=\"img-circle\" style=\"width:100%;\" src=\"http://'+loc+'/gustosculposos/img/avatar.png\" /></div>' + \n '</li>';\n }\n setTimeout(\n function(){ \n $(\"#\"+idUl).append(control);\n\n }, time);\n \n}", "title": "" }, { "docid": "974f021fcb74e2956390424a20f98c0a", "score": "0.5549403", "text": "function outputUserMessage(text) {\n const div = document.createElement('div');\n div.classList.add('message');\n div.innerHTML = `\n <img class=\"avatar-md\" src=\"img/avatars/user.png\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"${text.username}\" alt=\"avatar\">\n <div class=\"text-main\">\n\t\t<div class=\"text-group\">\n <span>${text.username}</span>\n\t\t\t<div class=\"text\">\n\t\t\t\t<p>${text.text}</p>\n\t\t\t</div>\n\t\t</div>\n\t\t\t<span style=\"color:gray;font-size:12px;\">${text.time}</span>\n\t</div>`;\n document.getElementById(\"chatContainer\").appendChild(div);\n scrollBottom(\"chatContainer\");\n}", "title": "" }, { "docid": "8cc530127c319b3e22fe9dca8f9876d3", "score": "0.55488193", "text": "function checkTwitchStreamerTokenAndConnect(authData, Token, authDBData) {\n\n authDB.reload();\n twitchChat = new TwitchChatClient(Token, true, chatConnected, authDB, log, io);\n ch = new commandHandler(authDB.data.streamer.username, authDB.data.streamer.channelId, log , twitchChat , Token);\n\n\n //my twitch user id \n var User = 147299544;\n const client_id = 'gp762nuuoqcoxypju8c569th9wz7q5';\n const OAuthToken = 'lx71o93103qho7pc2onpz2ktprnsrp';\n\n var FollowEventsTopic = 'https://api.twitch.tv/helix/users/follows?first=1&to_id=' + `${User}`;\n\n //webhooks = new TwitchWebhooks(OAuthToken , client_id , log);\n //var xyz = webhooks.subscribeFollows( FollowEventsTopic);\n\n\n\n twitchChat.on('CONNECTED', function(data) {\n try {\n\n log.info('ConnectedToChat');\n\n\n } catch (error) {\n log.error('error in mixer chat follow ' + error.message);\n }\n\n });\n\n\n\n\n twitchChat.on('PRIVMSG', function(data) {\n try {\n\n\n\n\n\n //message from twitch chat\n sendMessageToChatWindowTwitch(data, false)\n\n } catch (error) {\n log.error('error in twitch chat ' + error.message);\n }\n\n });\n\n\n\n twitchChat.on('*', function(data) {\n try {\n\n log.info('Got Message From Chat', data);\n\n } catch (error) {\n log.error('error in mixer chat follow ' + error.message);\n }\n\n });\n\n ch.on('CommandData', function(data) {\n\n // io.emit('message', UserName + ' [' + data.user_roles[0] + '] - ' + t);\n if (chatConnectedBot) {\n //send message to twitch as bot \n let twitchChatBot = undefined;\n sendTwitchMessage(data , 'streamer' , twitchChatBot , undefined)\n } else {\n //send message to twitch chat as streamer\n\n sendTwitchMessage(data , 'streamer' , twitchChat , undefined)\n }\n\n });\n\n\n\n }", "title": "" }, { "docid": "5474ba08757e6c847c259f2000f34132", "score": "0.5547298", "text": "function displayUI()\n{\n /*\n * Be sure to remove any old instance of the UI, in case the user reloads the script without refreshing the page\n * (updating.)\n */\n $('#plugbot-ui').remove();\n\n /*\n * Generate the HTML code for the UI.\n */\n $('#chat').prepend('<div id=\"plugbot-ui\"></div>');\n\n /* \n * Determine the color of the menu item based on its state, on or off.\n */\n var cWoot = autowoot ? BUTTON_ON : BUTTON_OFF;\n var cQueue = autoqueue ? BUTTON_ON : BUTTON_OFF;\n var cHideVideo = hideVideo ? BUTTON_ON : BUTTON_OFF;\n var cUserList = userList ? BUTTON_ON : BUTTON_OFF;\n\n /*\n * Draw the UI.\n */\n $('#plugbot-ui').append('<p id=\"plugbot-btn-hidevideo\" style=\"color:' + cHideVideo\n + '\">摺埋條片</p><p id=\"plugbot-btn-skipvideo\" style=\"color:' + BUTTON_OFF + '\">摺埋條片靜音</p>'\n + '<p id=\"plugbot-btn-userlist\" style=\"color:' + cUserList \n + '\">用戶列表(人多會LAG)</p><p><span onclick=\"displayiframe()\">Emoji Icon</span></p><p><a href=\"http://forum1.hkgolden.com/view.aspx?message=4795620\" target=\"iframe1\"><span onclick=\"displayiframe()\">高登Post</span></a></p></span>');\n}", "title": "" }, { "docid": "d073aa78031f55d5462ed436dbdc61a8", "score": "0.5532065", "text": "function Chat () {\n this.update = updateChat;\n this.send = sendChat;\n\tthis.getState = getStateOfChat;\n}", "title": "" }, { "docid": "b8a0ea2727f66c725369bcbc2d82d715", "score": "0.55307704", "text": "function help(user){\n user.write(\"If you send a message it must start with a character or number(no symbols or spaces)\\n\")\n user.write(\"Commands: /w 'user' - whisper user, /username 'name' - change username to name, /clientlist - list of online users, /kick 'user' 'password' - kick user from server\\n\")\n}", "title": "" }, { "docid": "f8e7f97bf174ddc746022500221d7455", "score": "0.5527996", "text": "function outputMessage(message){\n //메세지 이름이랑 접속자랑 같은 경우랑 그렇지 않은 경우 나누어야 함\n if(message.username===username){\n const div = document.createElement('div');\n div.classList.add('clearfix');\n div.innerHTML = `<div class=\"from-me float-right\" id=\"${message.chatting_id}\"><p class=\"meta\"><span>${message.time}</span></p>\n <p class=\"text\" style=\"white-space: pre-line;\">${message.text}</p></div>`;\n document.querySelector('.chat-messages').appendChild(div);\n }else if(message.username=='ChatCord Bot'){\n console.log(\"Go Go 87\");\n }else{\n const div = document.createElement('div');\n div.classList.add('clearfix');\n div.innerHTML = `<div class=\"message float-left\" id=\"${message.chatting_id}\"><p class=\"meta\">${message.username} <span>${message.time}</span></p>\n <p class=\"text\" style=\"white-space: pre-line;\">${message.text}</p></div>`;\n document.querySelector('.chat-messages').appendChild(div);\n }\n}", "title": "" }, { "docid": "6a05670ead768c27d4a1ca2b8d98f34c", "score": "0.5524806", "text": "function displayChat (chat) {\n const li = generateLI(chat)\n li.classList.add(\"chats\", \"list-group-item\")\n $(ul).prepend(li)\n }", "title": "" }, { "docid": "b7b480e6561249aa0660b73ed40fb153", "score": "0.5522686", "text": "function chatSetup(user){\n let input_area = `\n <form id=\"chatForm\" class=\"form-group\">\n <input type=\"text\" placeholder=\"...start chatting...\" name=\"${user.id}\" alt-data=\"${user.name}\" class=\"form-control\">\n <button type=\"submit\" class=\"btn btn-success\">Submit</button> \n </form>\n `\n $('#chatArea').append(input_area);\n }", "title": "" }, { "docid": "67c83b65c4368beb5f03311d3bef3503", "score": "0.55222845", "text": "function onChat(chatRoot) {\n let newChat = yct.chatTemplate.cloneNode(/* deep= */ true);\n newChat.id = \"\";\n newChat.className = \"yct-ac-line\";\n\n let authorName = chatRoot.querySelector('#author-name').innerText;\n let message = chatRoot.querySelector('#message').innerText;\n\n newChat.children[0].src = chatRoot.querySelector('#img').src;\n newChat.children[1].innerHTML = chatRoot.querySelector('#timestamp').innerText;\n newChat.children[2].innerHTML = authorName;\n newChat.children[3].innerHTML = message;\n newChat.onclick = function() {\n newChat.style.textDecoration = \"line-through\";\n };\n\n yct.chatRoot.insertBefore(newChat, yct.chatAnchor);\n if (yct.chatRoot.children.length > MAX_MESSAGES) {\n yct.chatRoot.removeChild(yct.chatRoot.children[0]);\n }\n // Scroll to bottom\n yct.chatRoot.scrollTop = yct.chatRoot.scrollHeight - yct.chatRoot.offsetHeight;\n\n if (!chat.users[authorName]) {\n chat.users[authorName] = new UserChat(authorName);\n }\n chat.users[authorName].addMessage(message);\n\n chat.reflowUpdateCount++;\n if (chat.reflowUpdateCount % REFLOW_TOP_EVERY === 0) {\n let sortableUsers = [];\n let messages = 0;\n let users = 0;\n for (let [name, user] of Object.entries(chat.users)) {\n messages += user.messageCount;\n users++;\n sortableUsers.push([user.score, user])\n }\n let fullHtml = \"\";\n sortableUsers.sort((a, b) => b[0] - a[0])\n sortableUsers.forEach(pair => fullHtml += pair[1].element.outerHTML);\n\n yct.topContainer.innerHTML = fullHtml;\n yct.topTrackerMessages.innerHTML = messages;\n yct.topTrackerUsers.innerHTML = users;\n }\n}", "title": "" }, { "docid": "92f74ad6b685ea698814cb60710c6532", "score": "0.5520946", "text": "function activateChat(){\n\t\tvar chatInput = $('#ChatInput');\t// Input field element\n\t\tvar chatBox = $('#ChatBox');\t\t// Form element\n\t\t\n\t\t// If we are already in chat mode, send the input to server\n\t\tif (chatMode){\n\t\t\tchatMode = false;\n\t\t\tchatBox.hide();\n\t\t\tif (chatInput.val().length > 0){\n\t\t\t\t// Emit chat event to server\n\t\t\t\tsocket.emit(\"chat\", {\n\t\t\t\t\tmsg: chatInput.val()\n\t\t\t\t});\n\t\t\t}\n\t\t\t\n\t\t}else{\n\t\t\tchatMode = true;\n\t\t\t// Show the form\n\t\t\tchatBox.show();\n\t\t\t// Reset the input field\n\t\t\tchatInput.val(\"\");\n\t\t\t// Focus the cursor on the input\n\t\t\tchatInput.focus();\n\t\t}\n\t}", "title": "" }, { "docid": "539d8bca94b2a86e9652fc460f4e6201", "score": "0.5520316", "text": "get chat () {\n return new IconData(0xe0b7,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "539d8bca94b2a86e9652fc460f4e6201", "score": "0.5520316", "text": "get chat () {\n return new IconData(0xe0b7,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "da9ae9eec23d8cf5c250c2066faa559d", "score": "0.5517443", "text": "renderMessage(text, user){\n//et data = this.fetch();\nlet message = '<div class =\"chat\"' + text + '</div>';\n\n\n$('#chats').append(message);\n }", "title": "" }, { "docid": "1520b54f1f6e61eea6bf7dc6940727aa", "score": "0.5516961", "text": "function Window_OmoriQuestMessage() { this.initialize.apply(this, arguments); }", "title": "" }, { "docid": "3397333046779f52e44be377e0ea4010", "score": "0.55168533", "text": "function addChatMessage(data, options) {\n // Don't fade the message in if there is an 'X was typing'\n //var $typingMessages = getTypingMessages(data);\n options = options || {};\n //if ($typingMessages.length !== 0) {\n // options.fade = false;\n //$typingMessages.remove();\n //}\n\n // var $messageDiv = $('<div class=\"message\">');\n var $messageAuthoutDiv = $('<span class=\"username\"/>').text(data.message);\n var $authorDiv = $('<a class=\"message-author\" href=\"#\"> ' + data.username + ' </a> ' + (new Date()).getTime());\n\n\n // var typingClass = data.typing ? 'typing' : '';\n // var $messageDiv = $('<li class=\"message\"/>')\n // .data('username', data.username)\n // .addClass(typingClass)\n // .append($usernameDiv, $messageBodyDiv);\n\n var $chatMessageDiv = $('<div class=\"chat-message left\">')\n .append($authorDiv, $messageAuthoutDiv);\n //.append($authorDiv);\n addMessageElement($chatMessageDiv, options);\n }", "title": "" }, { "docid": "84805532e4923d53b2895e10d835a7d8", "score": "0.5516732", "text": "function handleJoin({name}){\n const temp = document.getElementById('info-msg-tmp');\n const p = temp.content.cloneNode(true);\n $('.msg-text',p).text(`${name} joined the video chat.`);\n $('.msg-time',p).text(getTimestamp());\n \n chatsWrapper.appendChild(p);\n chatsWrapper.scrollTo(0,chatsWrapper.scrollHeight);\n }", "title": "" } ]
87d5865390406b100cdf8f10204a02ba
Receives N CSS class names as arguments, and returns a selector in the format: path('ngimodelobject', [ngimodel, 3]); .ngiscope > .ngidrawer > .ngimodelobject > .ngidrawer > .ngimodel:nthchild(3)
[ { "docid": "0fc7b4263365d3fb30abcb192f231388", "score": "0.64780396", "text": "function path() {\n\tvar sel = '.ngi-scope > .ngi-drawer ';\n\tfor (var i = 0; i < arguments.length; i++) {\n\t\tif (typeof arguments[i] == 'object' && arguments[i].length == 2)\n\t\t\tsel += ' > .' + arguments[i][0] + ':nth-child(' + arguments[i][1] + ')'\n\t\telse\n\t\t\tsel += ' > .' + arguments[i];\n\n\t\tif (i < arguments.length - 1)\n\t\t\tsel += ' > .ngi-drawer'\n\t}\n\treturn sel;\n}", "title": "" } ]
[ { "docid": "f2a04e0c0230f4c9106c7b12c62973a1", "score": "0.5806202", "text": "function querySelectorFunc(selector,classPrototype,methodOrAttributeName,index){null!==selector?\"number\"!=typeof index?addToObjectProps(classPrototype,\"querySelectors\",{attributeName:methodOrAttributeName,querySelector:selector}):console.error(\"ag-Grid: QuerySelector should be on an attribute\"):console.error(\"ag-Grid: QuerySelector selector should not be null\")}", "title": "" }, { "docid": "1c4bda5e05a65fa6c0dc6d802d603d3a", "score": "0.5569191", "text": "generateSelector() {\n /* root element cannot have a selector as it isn't a proper element */\n if (this.isRootElement()) {\n return null;\n }\n const parts = [];\n let root;\n for (root = this; root.parent; root = root.parent) {\n /* .. */\n }\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n for (let cur = this; cur.parent; cur = cur.parent) {\n /* if a unique id is present, use it and short-circuit */\n if (cur.id) {\n const escaped = escapeSelectorComponent(cur.id);\n const matches = root.querySelectorAll(`#${escaped}`);\n if (matches.length === 1) {\n parts.push(`#${escaped}`);\n break;\n }\n }\n const parent = cur.parent;\n const child = parent.childElements;\n const index = child.findIndex((it) => it.unique === cur.unique);\n const numOfType = child.filter((it) => it.is(cur.tagName)).length;\n const solo = numOfType === 1;\n /* if this is the only tagName in this level of siblings nth-child isn't needed */\n if (solo) {\n parts.push(cur.tagName.toLowerCase());\n continue;\n }\n /* this will generate the worst kind of selector but at least it will be accurate (optimizations welcome) */\n parts.push(`${cur.tagName.toLowerCase()}:nth-child(${index + 1})`);\n }\n return parts.reverse().join(\" > \");\n }", "title": "" }, { "docid": "4cfe23bcd94cf0c6b3c0514c2287143c", "score": "0.5374483", "text": "function getElementPathSelector(context) {\n let pathSelector;\n let ctx = context;\n while (ctx.tagName) {\n let index = getIndex(ctx);\n if (ctx.id) {\n // If we reached a parent element with an id, the specificity is high enough\n pathSelector = `${ctx.localName}#${ctx.id}${(pathSelector ? ' > ' + pathSelector : '')}`;\n break;\n }\n else if (ctx.className)\n pathSelector = `${ctx.localName}${getElementClassSelector(ctx)}:nth-of-type(${index})${(pathSelector ? ' > ' + pathSelector : '')}`;\n else\n pathSelector = `${ctx.localName}:nth-of-type(${index})${(pathSelector ? ' > ' + pathSelector : '')}`;\n ctx = ctx.parentNode;\n }\n return `${pathSelector}`;\n}", "title": "" }, { "docid": "42138590462cfe3bd5adaf6eece9649b", "score": "0.53475326", "text": "function generateSelector(el){\n var selector = \"\";\n var tree = $(el).parentsUntil(document);\n\n // generate full selector by traversing DOM from bottom-up\n for (var i = -1; i < tree.length; i++){\n var e = i < 0 ? el : tree[i];\n\n var eCSS = querifyElement(e);\n var query = eCSS.query + (selector.length ? ' > ' : '') + selector;\n\n var matches = $(query);\n\n if (matches.length === 1 && matches[0] === el){\n return query;\n }\n else if (matches.length > 1 && i + 1 < tree.length){\n\n var parentQuery = generateSelector(tree[i + 1]);\n var parentMatches = $(parentQuery).children(eCSS.tag);\n var nthQuery = eCSS.tag + ':nth-of-type(' + (parentMatches.index(el) + 1) + ')' + (selector.length ? ' > ' : '') + selector;\n var parentNthQuery = parentQuery + ' > ' + nthQuery;\n var nthMatches = $(parentNthQuery);\n\n if (nthMatches.length === 1 && nthMatches[0] === el){\n return parentNthQuery;\n }\n else {\n printError(\"----------\")\n return 'ERROR';\n }\n }\n else {\n if (matches.length === 1) printError(\"Matched incorrect element. (matches.length = \" + matches.length + \")\")\n else if (matches.length > 1) printError(\"Multiple matches, but traversed entire tree (algorithm not being specific enough).\")\n else printError(\"Could not find match for tag/id/class selector. (matches.length = \" + matches.length + \")\")\n return 'ERROR';\n }\n }\n\n return selector;\n}", "title": "" }, { "docid": "5b7d8020e72bf8569c542d1102928ed3", "score": "0.5209411", "text": "function single_selector(selector) {\n\n var customClass = 'yp-selected';\n if (body.hasClass(\"yp-control-key-down\") && is_content_selected()) {\n customClass = 'yp-multiple-selected';\n }\n\n // Clean\n selector = left_trim(selector, \"htmlbody \");\n selector = left_trim(selector, \"html \");\n selector = left_trim(selector, \"body \");\n\n var selectorArray = get_selector_array(selector);\n var i = 0;\n var indexOf = 0;\n var selectorPlus = '';\n\n for (i = 0; i < selectorArray.length; i++) {\n\n if (i > 0) {\n selectorPlus += window.separator + selectorArray[i];\n } else {\n selectorPlus += selectorArray[i];\n }\n\n if (iframe.find(selectorPlus).length > 1) {\n\n iframe.find(selectorPlus).each(function () {\n\n if (selectorPlus.substr(selectorPlus.length - 1) != ')') {\n\n if ($(this).parent().length > 0) {\n\n indexOf = 0;\n\n $(this).parent().children().each(function () {\n\n indexOf++;\n\n if ($(this).find(\".\" + customClass).length > 0 || $(this).hasClass((customClass))) {\n\n selectorPlus = selectorPlus + \":nth-child(\" + indexOf + \")\";\n\n }\n\n });\n\n }\n\n }\n\n });\n\n }\n\n }\n\n\n // Clean no-need nth-childs.\n if (selectorPlus.indexOf(\":nth-child\") != -1) {\n\n // Selector Array\n selectorArray = get_selector_array(selectorPlus);\n\n // Each all selector parts\n for (i = 0; i < selectorArray.length; i++) {\n\n // Get previous parts of selector\n var prevAll = get_previous_item(selectorArray, i).join(\" \");\n\n // Gext next parts of selector\n var nextAll = get_next_item(selectorArray, i).join(\" \");\n\n // check the new selector\n var selectorPlusNew = prevAll + window.separator + selectorArray[i].replace(/:nth-child\\((.*?)\\)/i, '') + window.separator + nextAll;\n\n // clean\n selectorPlusNew = space_cleaner(selectorPlusNew);\n\n // Add \" > \" to last part of selector for be sure everything works fine.\n if (iframe.find(selectorPlusNew).length > 1) {\n selectorPlusNew = selectorPlusNew.replace(/(?=[^ ]*$)/i, ' > ');\n }\n\n // Check the selector without nth-child and be sure have only 1 element.\n if (iframe.find(selectorPlusNew).length == 1) {\n selectorArray[i] = selectorArray[i].replace(/:nth-child\\((.*?)\\)/i, '');\n }\n\n }\n\n // Array to spin, and clean selector.\n selectorPlus = space_cleaner(selectorArray.join(\" \"));\n\n }\n\n\n // Add > symbol to last if selector finding more element than one.\n if (iframe.find(selectorPlus).length > 1) {\n selectorPlus = selectorPlus.replace(/(?=[^ ]*$)/i, ' > ');\n }\n\n\n // Ready.\n return space_cleaner(selectorPlus);\n\n }", "title": "" }, { "docid": "fac49e9ce017c49fae19642c9358a77e", "score": "0.51962197", "text": "function matchingSelectorIndex(tNode,selectors,textSelectors){var ngProjectAsAttrVal=getProjectAsAttrValue(tNode);for(var i=0;i<selectors.length;i++){// if a node has the ngProjectAs attribute match it against unparsed selector\n// match a node against a parsed selector only if ngProjectAs attribute is not present\nif(ngProjectAsAttrVal===textSelectors[i]||ngProjectAsAttrVal===null&&isNodeMatchingSelectorList(tNode,selectors[i],/* isProjectionMode */true)){return i+1;// first matching selector \"captures\" a given node\n}}return 0;}", "title": "" }, { "docid": "55737bea9f83409f70d7618b934d5dcc", "score": "0.5126052", "text": "function parseSelector(selector) {\n var sel = selector.trim();\n var tagRegex = new RegExp(TAG, 'y');\n var tag = tagRegex.exec(sel)[0];\n var regex = new RegExp(TOKENS, 'y');\n regex.lastIndex = tagRegex.lastIndex;\n var matches = [];\n var nextSelector = undefined;\n var lastCombinator = undefined;\n var index = -1;\n while (regex.lastIndex < sel.length) {\n var match = regex.exec(sel);\n if (!match && lastCombinator === undefined) {\n throw new Error('Parse error, invalid selector');\n }\n else if (match && combinatorRegex.test(match[0])) {\n var comb = combinatorRegex.exec(match[0])[0];\n lastCombinator = comb;\n index = regex.lastIndex;\n }\n else {\n if (lastCombinator !== undefined) {\n nextSelector = [\n getCombinator(lastCombinator),\n parseSelector(sel.substring(index))\n ];\n break;\n }\n matches.push(match[0]);\n }\n }\n var classList = matches\n .filter(function (s) { return s.startsWith('.'); })\n .map(function (s) { return s.substring(1); });\n var ids = matches.filter(function (s) { return s.startsWith('#'); }).map(function (s) { return s.substring(1); });\n if (ids.length > 1) {\n throw new Error('Invalid selector, only one id is allowed');\n }\n var postprocessRegex = new RegExp(\"(\" + IDENT + \")\" + SPACE + \"(\" + OP + \")?\" + SPACE + \"(\" + VALUE + \")?\");\n var attrs = matches\n .filter(function (s) { return s.startsWith('['); })\n .map(function (s) { return postprocessRegex.exec(s).slice(1, 4); })\n .map(function (_a) {\n var attr = _a[0], op = _a[1], val = _a[2];\n var _b;\n return (_b = {},\n _b[attr] = [getOp(op), val ? parseAttrValue(val) : val],\n _b);\n })\n .reduce(function (acc, curr) { return (__assign({}, acc, curr)); }, {});\n var pseudos = matches\n .filter(function (s) { return s.startsWith(':'); })\n .map(function (s) { return postProcessPseudos(s.substring(1)); });\n return {\n id: ids[0] || '',\n tag: tag,\n classList: classList,\n attributes: attrs,\n nextSelector: nextSelector,\n pseudos: pseudos\n };\n}", "title": "" }, { "docid": "55737bea9f83409f70d7618b934d5dcc", "score": "0.5126052", "text": "function parseSelector(selector) {\n var sel = selector.trim();\n var tagRegex = new RegExp(TAG, 'y');\n var tag = tagRegex.exec(sel)[0];\n var regex = new RegExp(TOKENS, 'y');\n regex.lastIndex = tagRegex.lastIndex;\n var matches = [];\n var nextSelector = undefined;\n var lastCombinator = undefined;\n var index = -1;\n while (regex.lastIndex < sel.length) {\n var match = regex.exec(sel);\n if (!match && lastCombinator === undefined) {\n throw new Error('Parse error, invalid selector');\n }\n else if (match && combinatorRegex.test(match[0])) {\n var comb = combinatorRegex.exec(match[0])[0];\n lastCombinator = comb;\n index = regex.lastIndex;\n }\n else {\n if (lastCombinator !== undefined) {\n nextSelector = [\n getCombinator(lastCombinator),\n parseSelector(sel.substring(index))\n ];\n break;\n }\n matches.push(match[0]);\n }\n }\n var classList = matches\n .filter(function (s) { return s.startsWith('.'); })\n .map(function (s) { return s.substring(1); });\n var ids = matches.filter(function (s) { return s.startsWith('#'); }).map(function (s) { return s.substring(1); });\n if (ids.length > 1) {\n throw new Error('Invalid selector, only one id is allowed');\n }\n var postprocessRegex = new RegExp(\"(\" + IDENT + \")\" + SPACE + \"(\" + OP + \")?\" + SPACE + \"(\" + VALUE + \")?\");\n var attrs = matches\n .filter(function (s) { return s.startsWith('['); })\n .map(function (s) { return postprocessRegex.exec(s).slice(1, 4); })\n .map(function (_a) {\n var attr = _a[0], op = _a[1], val = _a[2];\n var _b;\n return (_b = {},\n _b[attr] = [getOp(op), val ? parseAttrValue(val) : val],\n _b);\n })\n .reduce(function (acc, curr) { return (__assign({}, acc, curr)); }, {});\n var pseudos = matches\n .filter(function (s) { return s.startsWith(':'); })\n .map(function (s) { return postProcessPseudos(s.substring(1)); });\n return {\n id: ids[0] || '',\n tag: tag,\n classList: classList,\n attributes: attrs,\n nextSelector: nextSelector,\n pseudos: pseudos\n };\n}", "title": "" }, { "docid": "00674e0484c07b685d2de98aa2ead54f", "score": "0.5108955", "text": "function parseSelector(selector) {\n var sel = selector.trim();\n var tagRegex = new RegExp(TAG, 'y');\n var tag = tagRegex.exec(sel)[0];\n var regex = new RegExp(TOKENS, 'y');\n regex.lastIndex = tagRegex.lastIndex;\n var matches = [];\n var nextSelector = undefined;\n var lastCombinator = undefined;\n var index = -1;\n while (regex.lastIndex < sel.length) {\n var match = regex.exec(sel);\n if (!match && lastCombinator === undefined) {\n throw new Error('Parse error, invalid selector');\n }\n else if (match && combinatorRegex.test(match[0])) {\n var comb = combinatorRegex.exec(match[0])[0];\n lastCombinator = comb;\n index = regex.lastIndex;\n }\n else {\n if (lastCombinator !== undefined) {\n nextSelector = [getCombinator(lastCombinator), parseSelector(sel.substring(index))];\n break;\n }\n matches.push(match[0]);\n }\n }\n var classList = matches\n .filter(function (s) {\n return s.startsWith('.');\n })\n .map(function (s) {\n return s.substring(1);\n });\n var ids = matches\n .filter(function (s) {\n return s.startsWith('#');\n })\n .map(function (s) {\n return s.substring(1);\n });\n if (ids.length > 1) {\n throw new Error('Invalid selector, only one id is allowed');\n }\n var postprocessRegex = new RegExp(\"(\" + IDENT + \")\" + SPACE + \"(\" + OP + \")?\" + SPACE + \"(\" + VALUE + \")?\");\n var attrs = matches\n .filter(function (s) {\n return s.startsWith('[');\n })\n .map(function (s) {\n return postprocessRegex.exec(s).slice(1, 4);\n })\n .map(function (_a) {\n var attr = _a[0], op = _a[1], val = _a[2];\n var _b;\n return _b = {},\n _b[attr] = [getOp(op), val ? parseAttrValue(val) : val],\n _b;\n })\n .reduce(function (acc, curr) { return (__assign({}, acc, curr)); }, {});\n var pseudos = matches\n .filter(function (s) {\n return s.startsWith(':');\n })\n .map(function (s) {\n return postProcessPseudos(s.substring(1));\n });\n return {\n tag: tag,\n classList: classList,\n nextSelector: nextSelector,\n pseudos: pseudos,\n id: ids[0] || '',\n attributes: attrs,\n };\n }", "title": "" }, { "docid": "9b8c3b7af4765c79c722e016869dcdca", "score": "0.50909275", "text": "async scanSelector() {\n // <tag\n // \t id=\"a'\n // \t class=\"a\"\n // \t class=\"a b\"\n // >\n let match = this.match(/<\\w+\\s*([\\s\\S]*?)>/g, /\\b(?<type>id|class|className)\\s*=\\s*['\"`](.*?)['\"`]/g, /([\\w-]+)/g);\n if (match) {\n if (match.groups.type === 'id') {\n return simple_selector_1.SimpleSelector.create('#' + match.text, match.index);\n }\n else if (match.groups.type === 'class' || match.groups.type === 'className') {\n return simple_selector_1.SimpleSelector.create('.' + match.text, match.index);\n }\n }\n // Syntax `:class.property=...`\n match = this.match(/\\bclass\\.([\\w-]+)/g);\n if (match) {\n return simple_selector_1.SimpleSelector.create('.' + match.text, match.index);\n }\n // Syntax: `:class=${{property: boolean}}`.\n match = this.match(/\\bclass\\s*=\\s*\\$\\{\\s*\\{(.*?)\\}\\s*\\}/g, /(\\w+)\\s*:/g);\n if (match) {\n return simple_selector_1.SimpleSelector.create('.' + match.text, match.index);\n }\n // React syntax:\n // `class={['...']}, '...' part\n // `class={'...'}\n match = this.match(/\\b(?:class|className)\\s*=\\s*\\{((?:\\{[\\s\\S]*?\\}|.)*?)\\}/g, /['\"`](.*?)['\"`]/g, /([\\w-]+)/g);\n if (match) {\n return simple_selector_1.SimpleSelector.create('.' + match.text, match.index);\n }\n // React syntax:\n // `class={[..., {...}]}, {...} part.\n match = this.match(/\\b(?:class|className)\\s*=\\s*\\{((?:\\{[\\s\\S]*?\\}|.)*?)\\}/g, /\\{(.*?)\\}/g, /(\\w+)\\s*:/g);\n if (match) {\n return simple_selector_1.SimpleSelector.create('.' + match.text, match.index);\n }\n // Due to https://github.com/gajus/babel-plugin-react-css-modules and issue #60.\n // `styleName='...'.\n match = this.match(/\\bstyleName\\s*=\\s*['\"`](.*?)['\"`]/g, /([\\w-]+)/g);\n if (match) {\n return this.scanDefaultCSSModule(match.text, match.index);\n }\n // React Module CSS, e.g.\n // `class={style.className}`.\n // `class={style['class-name']}`.\n match = this.match(/\\b(?:class|className)\\s*=\\s*\\{(.*?)\\}/g, /(?<moduleName>\\w+)(?:\\.(\\w+)|\\[\\s*['\"`](\\w+)['\"`]\\s*\\])/);\n if (match) {\n return this.scanCSSModule(match.groups.moduelName, match.text, match.index);\n }\n // jQuery selector, e.g.\n // `$('.abc')`\n match = this.match(/\\$\\((.*?)\\)/g, /['\"`](.*?)['\"`]/g, /(?<identifier>^|\\s|.|#)([\\w-]+)/g);\n if (match) {\n if (match.groups.identifier === '#' || match.groups.identifier === '.') {\n return simple_selector_1.SimpleSelector.create(match.groups.identifier + match.text, match.index);\n }\n else {\n return simple_selector_1.SimpleSelector.create(match.text, match.index);\n }\n }\n return null;\n }", "title": "" }, { "docid": "c9b1012ac5c60995eedf2c5bc9a7c9c8", "score": "0.50314415", "text": "function selector(a,b){var a=a.match(/^(\\W)?(.*)/),b=b||document,c=b[\"getElement\"+(a[1]?\"#\"==a[1]?\"ById\":\"sByClassName\":\"sByTagName\")],d=c.call(b,a[2]),e=[];return null!==d&&(e=d.length||0===d.length?d:[d]),e}", "title": "" }, { "docid": "c9b1012ac5c60995eedf2c5bc9a7c9c8", "score": "0.50314415", "text": "function selector(a,b){var a=a.match(/^(\\W)?(.*)/),b=b||document,c=b[\"getElement\"+(a[1]?\"#\"==a[1]?\"ById\":\"sByClassName\":\"sByTagName\")],d=c.call(b,a[2]),e=[];return null!==d&&(e=d.length||0===d.length?d:[d]),e}", "title": "" }, { "docid": "c9b1012ac5c60995eedf2c5bc9a7c9c8", "score": "0.50314415", "text": "function selector(a,b){var a=a.match(/^(\\W)?(.*)/),b=b||document,c=b[\"getElement\"+(a[1]?\"#\"==a[1]?\"ById\":\"sByClassName\":\"sByTagName\")],d=c.call(b,a[2]),e=[];return null!==d&&(e=d.length||0===d.length?d:[d]),e}", "title": "" }, { "docid": "1ac914440865f4ca23ff3caea5fcfdd2", "score": "0.50195634", "text": "function createCssSelector(tag,attributes){var cssSelector=new CssSelector();cssSelector.setElement(tag);Object.getOwnPropertyNames(attributes).forEach(function(name){var value=attributes[name];cssSelector.addAttribute(name,value);if(name.toLowerCase()==='class'){var classes=value.trim().split(/\\s+/);classes.forEach(function(className){return cssSelector.addClassName(className);});}});return cssSelector;}", "title": "" }, { "docid": "e85ba319548075ac818cfb057daf64b1", "score": "0.50070924", "text": "function selectNthPlaylistElement(n) {\n const tr = $(\"#playlistBody tr\");\n tr.removeAttr(\"class\");\n tr.eq(n).attr(\"class\", \"is-selected\");\n}", "title": "" }, { "docid": "61c80b44e5b2ebad456ca3b14001b748", "score": "0.5006297", "text": "function createCssSelector(elementName, attributes) {\n var cssSelector = new CssSelector();\n var elementNameNoNs = splitNsName(elementName)[1];\n cssSelector.setElement(elementNameNoNs);\n Object.getOwnPropertyNames(attributes).forEach(function (name) {\n var nameNoNs = splitNsName(name)[1];\n var value = attributes[name];\n cssSelector.addAttribute(nameNoNs, value);\n\n if (name.toLowerCase() === 'class') {\n var classes = value.trim().split(/\\s+/);\n classes.forEach(function (className) {\n return cssSelector.addClassName(className);\n });\n }\n });\n return cssSelector;\n}", "title": "" }, { "docid": "dff2d96af7bf60ded7daddba2b011d9e", "score": "0.49661273", "text": "function createCssSelector(elementName, attributes) {\n const cssSelector = new CssSelector();\n const elementNameNoNs = splitNsName(elementName)[1];\n cssSelector.setElement(elementNameNoNs);\n Object.getOwnPropertyNames(attributes).forEach((name) => {\n const nameNoNs = splitNsName(name)[1];\n const value = attributes[name];\n cssSelector.addAttribute(nameNoNs, value);\n if (name.toLowerCase() === 'class') {\n const classes = value.trim().split(/\\s+/);\n classes.forEach(className => cssSelector.addClassName(className));\n }\n });\n return cssSelector;\n}", "title": "" }, { "docid": "dff2d96af7bf60ded7daddba2b011d9e", "score": "0.49661273", "text": "function createCssSelector(elementName, attributes) {\n const cssSelector = new CssSelector();\n const elementNameNoNs = splitNsName(elementName)[1];\n cssSelector.setElement(elementNameNoNs);\n Object.getOwnPropertyNames(attributes).forEach((name) => {\n const nameNoNs = splitNsName(name)[1];\n const value = attributes[name];\n cssSelector.addAttribute(nameNoNs, value);\n if (name.toLowerCase() === 'class') {\n const classes = value.trim().split(/\\s+/);\n classes.forEach(className => cssSelector.addClassName(className));\n }\n });\n return cssSelector;\n}", "title": "" }, { "docid": "019cca21dbfb7ca81a7fb8345475a454", "score": "0.4958741", "text": "function selector(toks, i, n, allowSemi) {\n var s = i;\n // The definition of any above can be summed up as\n // \"any run of token except ('[', ']', '(', ')', ':', ';', '{', '}')\n // or nested runs of parenthesized tokens or square bracketed tokens\".\n // Spaces are significant in the selector.\n // Selector is used as (selector?) so the below looks for (any*) for\n // simplicity.\n var tok;\n // Keeping a stack pointer actually causes this to minify better since\n // \".length\" and \".push\" are a lo of chars.\n var brackets = [], stackLast = -1;\n for (;i < n; ++i) {\n tok = toks[i].charAt(0);\n if (tok === '[' || tok === '(') {\n brackets[++stackLast] = tok;\n } else if ((tok === ']' && brackets[stackLast] === '[') ||\n (tok === ')' && brackets[stackLast] === '(')) {\n --stackLast;\n } else if (tok === '{' || tok === '}' || tok === ';' || tok === '@'\n || (tok === ':' && !allowSemi)) {\n break;\n }\n }\n if (stackLast >= 0) {\n // Returns the bitwise inverse of i+1 to indicate an error in the\n // token stream so that clients can ignore it.\n i = ~(i+1);\n }\n return i;\n }", "title": "" }, { "docid": "019cca21dbfb7ca81a7fb8345475a454", "score": "0.4958741", "text": "function selector(toks, i, n, allowSemi) {\n var s = i;\n // The definition of any above can be summed up as\n // \"any run of token except ('[', ']', '(', ')', ':', ';', '{', '}')\n // or nested runs of parenthesized tokens or square bracketed tokens\".\n // Spaces are significant in the selector.\n // Selector is used as (selector?) so the below looks for (any*) for\n // simplicity.\n var tok;\n // Keeping a stack pointer actually causes this to minify better since\n // \".length\" and \".push\" are a lo of chars.\n var brackets = [], stackLast = -1;\n for (;i < n; ++i) {\n tok = toks[i].charAt(0);\n if (tok === '[' || tok === '(') {\n brackets[++stackLast] = tok;\n } else if ((tok === ']' && brackets[stackLast] === '[') ||\n (tok === ')' && brackets[stackLast] === '(')) {\n --stackLast;\n } else if (tok === '{' || tok === '}' || tok === ';' || tok === '@'\n || (tok === ':' && !allowSemi)) {\n break;\n }\n }\n if (stackLast >= 0) {\n // Returns the bitwise inverse of i+1 to indicate an error in the\n // token stream so that clients can ignore it.\n i = ~(i+1);\n }\n return i;\n }", "title": "" }, { "docid": "019cca21dbfb7ca81a7fb8345475a454", "score": "0.4958741", "text": "function selector(toks, i, n, allowSemi) {\n var s = i;\n // The definition of any above can be summed up as\n // \"any run of token except ('[', ']', '(', ')', ':', ';', '{', '}')\n // or nested runs of parenthesized tokens or square bracketed tokens\".\n // Spaces are significant in the selector.\n // Selector is used as (selector?) so the below looks for (any*) for\n // simplicity.\n var tok;\n // Keeping a stack pointer actually causes this to minify better since\n // \".length\" and \".push\" are a lo of chars.\n var brackets = [], stackLast = -1;\n for (;i < n; ++i) {\n tok = toks[i].charAt(0);\n if (tok === '[' || tok === '(') {\n brackets[++stackLast] = tok;\n } else if ((tok === ']' && brackets[stackLast] === '[') ||\n (tok === ')' && brackets[stackLast] === '(')) {\n --stackLast;\n } else if (tok === '{' || tok === '}' || tok === ';' || tok === '@'\n || (tok === ':' && !allowSemi)) {\n break;\n }\n }\n if (stackLast >= 0) {\n // Returns the bitwise inverse of i+1 to indicate an error in the\n // token stream so that clients can ignore it.\n i = ~(i+1);\n }\n return i;\n }", "title": "" }, { "docid": "95502f57d4278dc148184a75138b2629", "score": "0.49519435", "text": "function getNodeSelector(el, win) {\n var parts = [el.tagName];\n if (el.id) parts.push('#' + el.id);\n if (el.className && el.className.length) parts.push(\".\" + el.className.split(' ').join('.')); // Can't get much more advanced with the current browser\n\n if (!win.document.querySelectorAll || !Array.prototype.indexOf) return parts.join('');\n\n try {\n if (win.document.querySelectorAll(parts.join('')).length === 1) return parts.join('');\n } catch (e) {\n // Sometimes the query selector can be invalid just return it as-is\n return parts.join('');\n } // try to get a more specific selector if this one matches more than one element\n\n\n if (el.parentNode.childNodes.length > 1) {\n var index = Array.prototype.indexOf.call(el.parentNode.childNodes, el) + 1;\n parts.push(\":nth-child(\" + index + \")\");\n }\n\n if (win.document.querySelectorAll(parts.join('')).length === 1) return parts.join(''); // try prepending the parent node selector\n\n if (el.parentNode) return getNodeSelector(el.parentNode, win) + \" > \" + parts.join('');\n return parts.join('');\n}", "title": "" }, { "docid": "f535acb277c9fc23c15914357fb622c5", "score": "0.49400342", "text": "function qwerySelector (cssQuery, context) {}", "title": "" }, { "docid": "25ae561168ddc3eff3dae66fa2cb26d1", "score": "0.49135992", "text": "function getSelector(node, maxLen = 100) {\n let sel = '';\n try {\n while (node && node.nodeType !== 9) {\n const part = node.id\n ? '#' + node.id\n : node.nodeName.toLowerCase() +\n (node.className && node.className.length ? '.' + Array.from(node.classList.values()).join('.') : '');\n if (sel.length + part.length > maxLen - 1) return sel || part;\n sel = sel ? part + '>' + sel : part;\n if (node.id) break;\n node = node.parentNode;\n }\n } catch (err) {}\n return sel;\n}", "title": "" }, { "docid": "6f2774036ac3134f3aeffa320e6c3430", "score": "0.4904961", "text": "function classDirective(name, selector) {\n name = 'ngClass' + name;\n var indexWatchExpression;\n\n return ['$parse', function($parse) {\n return {\n restrict: 'AC',\n link: function(scope, element, attr) {\n var expression = attr[name].trim();\n var isOneTime = (expression.charAt(0) === ':') && (expression.charAt(1) === ':');\n\n var watchInterceptor = isOneTime ? toFlatValue : toClassString;\n var watchExpression = $parse(expression, watchInterceptor);\n var watchAction = isOneTime ? ngClassOneTimeWatchAction : ngClassWatchAction;\n\n var classCounts = element.data('$classCounts');\n var oldModulo = true;\n var oldClassString;\n\n if (!classCounts) {\n // Use createMap() to prevent class assumptions involving property\n // names in Object.prototype\n classCounts = createMap();\n element.data('$classCounts', classCounts);\n }\n\n if (name !== 'ngClass') {\n if (!indexWatchExpression) {\n indexWatchExpression = $parse('$index', function moduloTwo($index) {\n // eslint-disable-next-line no-bitwise\n return $index & 1;\n });\n }\n\n scope.$watch(indexWatchExpression, ngClassIndexWatchAction);\n }\n\n scope.$watch(watchExpression, watchAction, isOneTime);\n\n function addClasses(classString) {\n classString = digestClassCounts(split(classString), 1);\n attr.$addClass(classString);\n }\n\n function removeClasses(classString) {\n classString = digestClassCounts(split(classString), -1);\n attr.$removeClass(classString);\n }\n\n function updateClasses(oldClassString, newClassString) {\n var oldClassArray = split(oldClassString);\n var newClassArray = split(newClassString);\n\n var toRemoveArray = arrayDifference(oldClassArray, newClassArray);\n var toAddArray = arrayDifference(newClassArray, oldClassArray);\n\n var toRemoveString = digestClassCounts(toRemoveArray, -1);\n var toAddString = digestClassCounts(toAddArray, 1);\n\n attr.$addClass(toAddString);\n attr.$removeClass(toRemoveString);\n }\n\n function digestClassCounts(classArray, count) {\n var classesToUpdate = [];\n\n forEach(classArray, function(className) {\n if (count > 0 || classCounts[className]) {\n classCounts[className] = (classCounts[className] || 0) + count;\n if (classCounts[className] === +(count > 0)) {\n classesToUpdate.push(className);\n }\n }\n });\n\n return classesToUpdate.join(' ');\n }\n\n function ngClassIndexWatchAction(newModulo) {\n // This watch-action should run before the `ngClass[OneTime]WatchAction()`, thus it\n // adds/removes `oldClassString`. If the `ngClass` expression has changed as well, the\n // `ngClass[OneTime]WatchAction()` will update the classes.\n if (newModulo === selector) {\n addClasses(oldClassString);\n } else {\n removeClasses(oldClassString);\n }\n\n oldModulo = newModulo;\n }\n\n function ngClassOneTimeWatchAction(newClassValue) {\n var newClassString = toClassString(newClassValue);\n\n if (newClassString !== oldClassString) {\n ngClassWatchAction(newClassString);\n }\n }\n\n function ngClassWatchAction(newClassString) {\n if (oldModulo === selector) {\n updateClasses(oldClassString, newClassString);\n }\n\n oldClassString = newClassString;\n }\n }\n };\n }];\n\n // Helpers\n function arrayDifference(tokens1, tokens2) {\n if (!tokens1 || !tokens1.length) return [];\n if (!tokens2 || !tokens2.length) return tokens1;\n\n var values = [];\n\n outer:\n for (var i = 0; i < tokens1.length; i++) {\n var token = tokens1[i];\n for (var j = 0; j < tokens2.length; j++) {\n if (token === tokens2[j]) continue outer;\n }\n values.push(token);\n }\n\n return values;\n }\n\n function split(classString) {\n return classString && classString.split(' ');\n }\n\n function toClassString(classValue) {\n var classString = classValue;\n\n if (isArray(classValue)) {\n classString = classValue.map(toClassString).join(' ');\n } else if (isObject(classValue)) {\n classString = Object.keys(classValue).\n filter(function(key) { return classValue[key]; }).\n join(' ');\n }\n\n return classString;\n }\n\n function toFlatValue(classValue) {\n var flatValue = classValue;\n\n if (isArray(classValue)) {\n flatValue = classValue.map(toFlatValue);\n } else if (isObject(classValue)) {\n var hasUndefined = false;\n\n flatValue = Object.keys(classValue).filter(function(key) {\n var value = classValue[key];\n\n if (!hasUndefined && isUndefined(value)) {\n hasUndefined = true;\n }\n\n return value;\n });\n\n if (hasUndefined) {\n // Prevent the `oneTimeLiteralWatchInterceptor` from unregistering\n // the watcher, by including at least one `undefined` value.\n flatValue.push(undefined);\n }\n }\n\n return flatValue;\n }\n}", "title": "" }, { "docid": "6f2774036ac3134f3aeffa320e6c3430", "score": "0.4904961", "text": "function classDirective(name, selector) {\n name = 'ngClass' + name;\n var indexWatchExpression;\n\n return ['$parse', function($parse) {\n return {\n restrict: 'AC',\n link: function(scope, element, attr) {\n var expression = attr[name].trim();\n var isOneTime = (expression.charAt(0) === ':') && (expression.charAt(1) === ':');\n\n var watchInterceptor = isOneTime ? toFlatValue : toClassString;\n var watchExpression = $parse(expression, watchInterceptor);\n var watchAction = isOneTime ? ngClassOneTimeWatchAction : ngClassWatchAction;\n\n var classCounts = element.data('$classCounts');\n var oldModulo = true;\n var oldClassString;\n\n if (!classCounts) {\n // Use createMap() to prevent class assumptions involving property\n // names in Object.prototype\n classCounts = createMap();\n element.data('$classCounts', classCounts);\n }\n\n if (name !== 'ngClass') {\n if (!indexWatchExpression) {\n indexWatchExpression = $parse('$index', function moduloTwo($index) {\n // eslint-disable-next-line no-bitwise\n return $index & 1;\n });\n }\n\n scope.$watch(indexWatchExpression, ngClassIndexWatchAction);\n }\n\n scope.$watch(watchExpression, watchAction, isOneTime);\n\n function addClasses(classString) {\n classString = digestClassCounts(split(classString), 1);\n attr.$addClass(classString);\n }\n\n function removeClasses(classString) {\n classString = digestClassCounts(split(classString), -1);\n attr.$removeClass(classString);\n }\n\n function updateClasses(oldClassString, newClassString) {\n var oldClassArray = split(oldClassString);\n var newClassArray = split(newClassString);\n\n var toRemoveArray = arrayDifference(oldClassArray, newClassArray);\n var toAddArray = arrayDifference(newClassArray, oldClassArray);\n\n var toRemoveString = digestClassCounts(toRemoveArray, -1);\n var toAddString = digestClassCounts(toAddArray, 1);\n\n attr.$addClass(toAddString);\n attr.$removeClass(toRemoveString);\n }\n\n function digestClassCounts(classArray, count) {\n var classesToUpdate = [];\n\n forEach(classArray, function(className) {\n if (count > 0 || classCounts[className]) {\n classCounts[className] = (classCounts[className] || 0) + count;\n if (classCounts[className] === +(count > 0)) {\n classesToUpdate.push(className);\n }\n }\n });\n\n return classesToUpdate.join(' ');\n }\n\n function ngClassIndexWatchAction(newModulo) {\n // This watch-action should run before the `ngClass[OneTime]WatchAction()`, thus it\n // adds/removes `oldClassString`. If the `ngClass` expression has changed as well, the\n // `ngClass[OneTime]WatchAction()` will update the classes.\n if (newModulo === selector) {\n addClasses(oldClassString);\n } else {\n removeClasses(oldClassString);\n }\n\n oldModulo = newModulo;\n }\n\n function ngClassOneTimeWatchAction(newClassValue) {\n var newClassString = toClassString(newClassValue);\n\n if (newClassString !== oldClassString) {\n ngClassWatchAction(newClassString);\n }\n }\n\n function ngClassWatchAction(newClassString) {\n if (oldModulo === selector) {\n updateClasses(oldClassString, newClassString);\n }\n\n oldClassString = newClassString;\n }\n }\n };\n }];\n\n // Helpers\n function arrayDifference(tokens1, tokens2) {\n if (!tokens1 || !tokens1.length) return [];\n if (!tokens2 || !tokens2.length) return tokens1;\n\n var values = [];\n\n outer:\n for (var i = 0; i < tokens1.length; i++) {\n var token = tokens1[i];\n for (var j = 0; j < tokens2.length; j++) {\n if (token === tokens2[j]) continue outer;\n }\n values.push(token);\n }\n\n return values;\n }\n\n function split(classString) {\n return classString && classString.split(' ');\n }\n\n function toClassString(classValue) {\n var classString = classValue;\n\n if (isArray(classValue)) {\n classString = classValue.map(toClassString).join(' ');\n } else if (isObject(classValue)) {\n classString = Object.keys(classValue).\n filter(function(key) { return classValue[key]; }).\n join(' ');\n }\n\n return classString;\n }\n\n function toFlatValue(classValue) {\n var flatValue = classValue;\n\n if (isArray(classValue)) {\n flatValue = classValue.map(toFlatValue);\n } else if (isObject(classValue)) {\n var hasUndefined = false;\n\n flatValue = Object.keys(classValue).filter(function(key) {\n var value = classValue[key];\n\n if (!hasUndefined && isUndefined(value)) {\n hasUndefined = true;\n }\n\n return value;\n });\n\n if (hasUndefined) {\n // Prevent the `oneTimeLiteralWatchInterceptor` from unregistering\n // the watcher, by including at least one `undefined` value.\n flatValue.push(undefined);\n }\n }\n\n return flatValue;\n }\n}", "title": "" }, { "docid": "edc44d4bbd92cfbe6bd15e29d3a7ecad", "score": "0.49031302", "text": "function getCssSelector(element, attributes) {\n var e = element;\n var string = \"\";\n\n while(e) {\n\n // if there is an attribute of interest on the node then create a selector\n var attrSelector = checkForAttribute(e, attributes);\n\n if(attrSelector) {\n string = attrSelector + string;\n } else {\n var index = getIndexPosition(e);\n if (index > 1) {\n string = e.tagName + \":nth-child(\" + index + \")\" + string;\n } else {\n string = e.tagName + string;\n }\n }\n\n if (testSelector(element, string)) {\n e = null;\n break;\n }\n\n // if the element has a parent element then continue the loop\n if(e.parentElement &&\n e.parentElement.tagName !== \"BODY\" &&\n e.parentElement.tagName !== \"HTML\") {\n string = \" > \" + string;\n e = e.parentElement;\n } else if (e.parentElement && e.parentElement.tagName === \"BODY\") {\n string = \"BODY > \" + string;\n e = null;\n break;\n } else if (e.parentElement && e.parentElement.tagName === \"HTML\") {\n string = \"HTML > \" + string;\n e = null;\n break;\n } else {\n e = null;\n }\n }\n\n return string.toString();\n}", "title": "" }, { "docid": "7837af223155af35065b386117c79085", "score": "0.4877764", "text": "function css() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var classes = [];\n for (var _a = 0, args_1 = args; _a < args_1.length; _a++) {\n var arg = args_1[_a];\n if (arg) {\n if (typeof arg === 'string') {\n classes.push(arg);\n }\n else if (arg.hasOwnProperty('toString') && typeof arg.toString === 'function') {\n classes.push(arg.toString());\n }\n else {\n // tslint:disable-next-line:no-any\n for (var key in arg) {\n // tslint:disable-next-line:no-any\n if (arg[key]) {\n classes.push(key);\n }\n }\n }\n }\n }\n return classes.join(' ');\n}", "title": "" }, { "docid": "7837af223155af35065b386117c79085", "score": "0.4877764", "text": "function css() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var classes = [];\n for (var _a = 0, args_1 = args; _a < args_1.length; _a++) {\n var arg = args_1[_a];\n if (arg) {\n if (typeof arg === 'string') {\n classes.push(arg);\n }\n else if (arg.hasOwnProperty('toString') && typeof arg.toString === 'function') {\n classes.push(arg.toString());\n }\n else {\n // tslint:disable-next-line:no-any\n for (var key in arg) {\n // tslint:disable-next-line:no-any\n if (arg[key]) {\n classes.push(key);\n }\n }\n }\n }\n }\n return classes.join(' ');\n}", "title": "" }, { "docid": "2699c105dfadf00a6397ed04ef1ed14e", "score": "0.48698694", "text": "function nice_selectors(data, start) {\n\n if (start === true) {\n\n // Nth child\n data = data.replace(/:nth-child\\((.*?)\\)/g, '\\.nth-child\\.$1\\.');\n\n // Not\n data = data.replace(/:not\\((.*?)\\)/g, '\\.notYP$1YP');\n\n // lang\n data = data.replace(/:lang\\((.*?)\\)/g, '\\.langYP$1YP');\n\n // nth-last-child()\n data = data.replace(/:nth-last-child\\((.*?)\\)/g, '\\.nth-last-child\\.$1\\.');\n\n // nth-last-of-type()\n data = data.replace(/:nth-last-of-type\\((.*?)\\)/g, '\\.nth-last-of-type\\.$1\\.');\n\n // nth-of-type()\n data = data.replace(/:nth-of-type\\((.*?)\\)/g, '\\.nth-of-type\\.$1\\.');\n\n } else {\n\n // Nth child\n data = data.replace(/\\.nth-child\\.(.*?)\\./g, ':nth-child($1)');\n\n // Not\n data = data.replace(/\\.notYP(.*?)YP/g, ':not($1)');\n\n // lang\n data = data.replace(/\\.langYP(.*?)YP/g, ':lang($1)');\n\n // nth-last-child()\n data = data.replace(/\\.nth-last-child\\.(.*?)\\./g, ':nth-last-child($1)');\n\n // nth-last-of-type()\n data = data.replace(/\\.nth-last-of-type\\.(.*?)\\./g, ':nth-last-of-type($1)');\n\n // nth-of-type()\n data = data.replace(/\\.nth-of-type\\.(.*?)\\./g, ':nth-of-type($1)');\n\n }\n\n return data;\n\n }", "title": "" }, { "docid": "0a397f52d9dbc96e9ca58a159ec1cc85", "score": "0.4843277", "text": "function xphasclass($s) {\n return strcat(\"//*[contains(concat(' ',@class,' '),' \",$s,\" ')]\");\n}", "title": "" }, { "docid": "4c81ff568815a511fbdcbbe24a4a2f57", "score": "0.4835014", "text": "function classDirective(name, selector) {\n name = 'ngClass' + name;\n var indexWatchExpression;\n\n return ['$parse', function($parse) {\n return {\n restrict: 'AC',\n link: function(scope, element, attr) {\n var classCounts = element.data('$classCounts');\n var oldModulo = true;\n var oldClassString;\n\n if (!classCounts) {\n // Use createMap() to prevent class assumptions involving property\n // names in Object.prototype\n classCounts = createMap();\n element.data('$classCounts', classCounts);\n }\n\n if (name !== 'ngClass') {\n if (!indexWatchExpression) {\n indexWatchExpression = $parse('$index', function moduloTwo($index) {\n // eslint-disable-next-line no-bitwise\n return $index & 1;\n });\n }\n\n scope.$watch(indexWatchExpression, ngClassIndexWatchAction);\n }\n\n scope.$watch($parse(attr[name], toClassString), ngClassWatchAction);\n\n function addClasses(classString) {\n classString = digestClassCounts(split(classString), 1);\n attr.$addClass(classString);\n }\n\n function removeClasses(classString) {\n classString = digestClassCounts(split(classString), -1);\n attr.$removeClass(classString);\n }\n\n function updateClasses(oldClassString, newClassString) {\n var oldClassArray = split(oldClassString);\n var newClassArray = split(newClassString);\n\n var toRemoveArray = arrayDifference(oldClassArray, newClassArray);\n var toAddArray = arrayDifference(newClassArray, oldClassArray);\n\n var toRemoveString = digestClassCounts(toRemoveArray, -1);\n var toAddString = digestClassCounts(toAddArray, 1);\n\n attr.$addClass(toAddString);\n attr.$removeClass(toRemoveString);\n }\n\n function digestClassCounts(classArray, count) {\n var classesToUpdate = [];\n\n forEach(classArray, function(className) {\n if (count > 0 || classCounts[className]) {\n classCounts[className] = (classCounts[className] || 0) + count;\n if (classCounts[className] === +(count > 0)) {\n classesToUpdate.push(className);\n }\n }\n });\n\n return classesToUpdate.join(' ');\n }\n\n function ngClassIndexWatchAction(newModulo) {\n // This watch-action should run before the `ngClassWatchAction()`, thus it\n // adds/removes `oldClassString`. If the `ngClass` expression has changed as well, the\n // `ngClassWatchAction()` will update the classes.\n if (newModulo === selector) {\n addClasses(oldClassString);\n } else {\n removeClasses(oldClassString);\n }\n\n oldModulo = newModulo;\n }\n\n function ngClassWatchAction(newClassString) {\n if (oldModulo === selector) {\n updateClasses(oldClassString, newClassString);\n }\n\n oldClassString = newClassString;\n }\n }\n };\n }];\n\n // Helpers\n function arrayDifference(tokens1, tokens2) {\n if (!tokens1 || !tokens1.length) return [];\n if (!tokens2 || !tokens2.length) return tokens1;\n\n var values = [];\n\n outer:\n for (var i = 0; i < tokens1.length; i++) {\n var token = tokens1[i];\n for (var j = 0; j < tokens2.length; j++) {\n if (token === tokens2[j]) continue outer;\n }\n values.push(token);\n }\n\n return values;\n }\n\n function split(classString) {\n return classString && classString.split(' ');\n }\n\n function toClassString(classValue) {\n if (!classValue) return classValue;\n\n var classString = classValue;\n\n if (isArray(classValue)) {\n classString = classValue.map(toClassString).join(' ');\n } else if (isObject(classValue)) {\n classString = Object.keys(classValue).\n filter(function(key) { return classValue[key]; }).\n join(' ');\n } else if (!isString(classValue)) {\n classString = classValue + '';\n }\n\n return classString;\n }\n}", "title": "" }, { "docid": "4c81ff568815a511fbdcbbe24a4a2f57", "score": "0.4835014", "text": "function classDirective(name, selector) {\n name = 'ngClass' + name;\n var indexWatchExpression;\n\n return ['$parse', function($parse) {\n return {\n restrict: 'AC',\n link: function(scope, element, attr) {\n var classCounts = element.data('$classCounts');\n var oldModulo = true;\n var oldClassString;\n\n if (!classCounts) {\n // Use createMap() to prevent class assumptions involving property\n // names in Object.prototype\n classCounts = createMap();\n element.data('$classCounts', classCounts);\n }\n\n if (name !== 'ngClass') {\n if (!indexWatchExpression) {\n indexWatchExpression = $parse('$index', function moduloTwo($index) {\n // eslint-disable-next-line no-bitwise\n return $index & 1;\n });\n }\n\n scope.$watch(indexWatchExpression, ngClassIndexWatchAction);\n }\n\n scope.$watch($parse(attr[name], toClassString), ngClassWatchAction);\n\n function addClasses(classString) {\n classString = digestClassCounts(split(classString), 1);\n attr.$addClass(classString);\n }\n\n function removeClasses(classString) {\n classString = digestClassCounts(split(classString), -1);\n attr.$removeClass(classString);\n }\n\n function updateClasses(oldClassString, newClassString) {\n var oldClassArray = split(oldClassString);\n var newClassArray = split(newClassString);\n\n var toRemoveArray = arrayDifference(oldClassArray, newClassArray);\n var toAddArray = arrayDifference(newClassArray, oldClassArray);\n\n var toRemoveString = digestClassCounts(toRemoveArray, -1);\n var toAddString = digestClassCounts(toAddArray, 1);\n\n attr.$addClass(toAddString);\n attr.$removeClass(toRemoveString);\n }\n\n function digestClassCounts(classArray, count) {\n var classesToUpdate = [];\n\n forEach(classArray, function(className) {\n if (count > 0 || classCounts[className]) {\n classCounts[className] = (classCounts[className] || 0) + count;\n if (classCounts[className] === +(count > 0)) {\n classesToUpdate.push(className);\n }\n }\n });\n\n return classesToUpdate.join(' ');\n }\n\n function ngClassIndexWatchAction(newModulo) {\n // This watch-action should run before the `ngClassWatchAction()`, thus it\n // adds/removes `oldClassString`. If the `ngClass` expression has changed as well, the\n // `ngClassWatchAction()` will update the classes.\n if (newModulo === selector) {\n addClasses(oldClassString);\n } else {\n removeClasses(oldClassString);\n }\n\n oldModulo = newModulo;\n }\n\n function ngClassWatchAction(newClassString) {\n if (oldModulo === selector) {\n updateClasses(oldClassString, newClassString);\n }\n\n oldClassString = newClassString;\n }\n }\n };\n }];\n\n // Helpers\n function arrayDifference(tokens1, tokens2) {\n if (!tokens1 || !tokens1.length) return [];\n if (!tokens2 || !tokens2.length) return tokens1;\n\n var values = [];\n\n outer:\n for (var i = 0; i < tokens1.length; i++) {\n var token = tokens1[i];\n for (var j = 0; j < tokens2.length; j++) {\n if (token === tokens2[j]) continue outer;\n }\n values.push(token);\n }\n\n return values;\n }\n\n function split(classString) {\n return classString && classString.split(' ');\n }\n\n function toClassString(classValue) {\n if (!classValue) return classValue;\n\n var classString = classValue;\n\n if (isArray(classValue)) {\n classString = classValue.map(toClassString).join(' ');\n } else if (isObject(classValue)) {\n classString = Object.keys(classValue).\n filter(function(key) { return classValue[key]; }).\n join(' ');\n } else if (!isString(classValue)) {\n classString = classValue + '';\n }\n\n return classString;\n }\n}", "title": "" }, { "docid": "dcb0ba89c0abe2555304364bd7769385", "score": "0.4835014", "text": "function classDirective(name, selector) {\n name = 'ngClass' + name;\n var indexWatchExpression;\n\n return ['$parse', function($parse) {\n return {\n restrict: 'AC',\n link: function(scope, element, attr) {\n var classCounts = element.data('$classCounts');\n var oldModulo = true;\n var oldClassString;\n\n if (!classCounts) {\n // Use createMap() to prevent class assumptions involving property\n // names in Object.prototype\n classCounts = createMap();\n element.data('$classCounts', classCounts);\n }\n\n if (name !== 'ngClass') {\n if (!indexWatchExpression) {\n indexWatchExpression = $parse('$index', function moduloTwo($index) {\n // eslint-disable-next-line no-bitwise\n return $index & 1;\n });\n }\n\n scope.$watch(indexWatchExpression, ngClassIndexWatchAction);\n }\n\n scope.$watch($parse(attr[name], toClassString), ngClassWatchAction);\n\n function addClasses(classString) {\n classString = digestClassCounts(split(classString), 1);\n attr.$addClass(classString);\n }\n\n function removeClasses(classString) {\n classString = digestClassCounts(split(classString), -1);\n attr.$removeClass(classString);\n }\n\n function updateClasses(oldClassString, newClassString) {\n var oldClassArray = split(oldClassString);\n var newClassArray = split(newClassString);\n\n var toRemoveArray = arrayDifference(oldClassArray, newClassArray);\n var toAddArray = arrayDifference(newClassArray, oldClassArray);\n\n var toRemoveString = digestClassCounts(toRemoveArray, -1);\n var toAddString = digestClassCounts(toAddArray, 1);\n\n attr.$addClass(toAddString);\n attr.$removeClass(toRemoveString);\n }\n\n function digestClassCounts(classArray, count) {\n var classesToUpdate = [];\n\n forEach(classArray, function(className) {\n if (count > 0 || classCounts[className]) {\n classCounts[className] = (classCounts[className] || 0) + count;\n if (classCounts[className] === +(count > 0)) {\n classesToUpdate.push(className);\n }\n }\n });\n\n return classesToUpdate.join(' ');\n }\n\n function ngClassIndexWatchAction(newModulo) {\n // This watch-action should run before the `ngClassWatchAction()`, thus it\n // adds/removes `oldClassString`. If the `ngClass` expression has changed as well, the\n // `ngClassWatchAction()` will update the classes.\n if (newModulo === selector) {\n addClasses(oldClassString);\n } else {\n removeClasses(oldClassString);\n }\n\n oldModulo = newModulo;\n }\n\n function ngClassWatchAction(newClassString) {\n // When using a one-time binding the newClassString will return\n // the pre-interceptor value until the one-time is complete\n if (!isString(newClassString)) {\n newClassString = toClassString(newClassString);\n }\n\n if (oldModulo === selector) {\n updateClasses(oldClassString, newClassString);\n }\n\n oldClassString = newClassString;\n }\n }\n };\n }];\n\n // Helpers\n function arrayDifference(tokens1, tokens2) {\n if (!tokens1 || !tokens1.length) return [];\n if (!tokens2 || !tokens2.length) return tokens1;\n\n var values = [];\n\n outer:\n for (var i = 0; i < tokens1.length; i++) {\n var token = tokens1[i];\n for (var j = 0; j < tokens2.length; j++) {\n if (token === tokens2[j]) continue outer;\n }\n values.push(token);\n }\n\n return values;\n }\n\n function split(classString) {\n return classString && classString.split(' ');\n }\n\n function toClassString(classValue) {\n var classString = classValue;\n\n if (isArray(classValue)) {\n classString = classValue.map(toClassString).join(' ');\n } else if (isObject(classValue)) {\n classString = Object.keys(classValue).\n filter(function(key) { return classValue[key]; }).\n join(' ');\n }\n\n return classString;\n }\n}", "title": "" }, { "docid": "dcb0ba89c0abe2555304364bd7769385", "score": "0.4835014", "text": "function classDirective(name, selector) {\n name = 'ngClass' + name;\n var indexWatchExpression;\n\n return ['$parse', function($parse) {\n return {\n restrict: 'AC',\n link: function(scope, element, attr) {\n var classCounts = element.data('$classCounts');\n var oldModulo = true;\n var oldClassString;\n\n if (!classCounts) {\n // Use createMap() to prevent class assumptions involving property\n // names in Object.prototype\n classCounts = createMap();\n element.data('$classCounts', classCounts);\n }\n\n if (name !== 'ngClass') {\n if (!indexWatchExpression) {\n indexWatchExpression = $parse('$index', function moduloTwo($index) {\n // eslint-disable-next-line no-bitwise\n return $index & 1;\n });\n }\n\n scope.$watch(indexWatchExpression, ngClassIndexWatchAction);\n }\n\n scope.$watch($parse(attr[name], toClassString), ngClassWatchAction);\n\n function addClasses(classString) {\n classString = digestClassCounts(split(classString), 1);\n attr.$addClass(classString);\n }\n\n function removeClasses(classString) {\n classString = digestClassCounts(split(classString), -1);\n attr.$removeClass(classString);\n }\n\n function updateClasses(oldClassString, newClassString) {\n var oldClassArray = split(oldClassString);\n var newClassArray = split(newClassString);\n\n var toRemoveArray = arrayDifference(oldClassArray, newClassArray);\n var toAddArray = arrayDifference(newClassArray, oldClassArray);\n\n var toRemoveString = digestClassCounts(toRemoveArray, -1);\n var toAddString = digestClassCounts(toAddArray, 1);\n\n attr.$addClass(toAddString);\n attr.$removeClass(toRemoveString);\n }\n\n function digestClassCounts(classArray, count) {\n var classesToUpdate = [];\n\n forEach(classArray, function(className) {\n if (count > 0 || classCounts[className]) {\n classCounts[className] = (classCounts[className] || 0) + count;\n if (classCounts[className] === +(count > 0)) {\n classesToUpdate.push(className);\n }\n }\n });\n\n return classesToUpdate.join(' ');\n }\n\n function ngClassIndexWatchAction(newModulo) {\n // This watch-action should run before the `ngClassWatchAction()`, thus it\n // adds/removes `oldClassString`. If the `ngClass` expression has changed as well, the\n // `ngClassWatchAction()` will update the classes.\n if (newModulo === selector) {\n addClasses(oldClassString);\n } else {\n removeClasses(oldClassString);\n }\n\n oldModulo = newModulo;\n }\n\n function ngClassWatchAction(newClassString) {\n // When using a one-time binding the newClassString will return\n // the pre-interceptor value until the one-time is complete\n if (!isString(newClassString)) {\n newClassString = toClassString(newClassString);\n }\n\n if (oldModulo === selector) {\n updateClasses(oldClassString, newClassString);\n }\n\n oldClassString = newClassString;\n }\n }\n };\n }];\n\n // Helpers\n function arrayDifference(tokens1, tokens2) {\n if (!tokens1 || !tokens1.length) return [];\n if (!tokens2 || !tokens2.length) return tokens1;\n\n var values = [];\n\n outer:\n for (var i = 0; i < tokens1.length; i++) {\n var token = tokens1[i];\n for (var j = 0; j < tokens2.length; j++) {\n if (token === tokens2[j]) continue outer;\n }\n values.push(token);\n }\n\n return values;\n }\n\n function split(classString) {\n return classString && classString.split(' ');\n }\n\n function toClassString(classValue) {\n var classString = classValue;\n\n if (isArray(classValue)) {\n classString = classValue.map(toClassString).join(' ');\n } else if (isObject(classValue)) {\n classString = Object.keys(classValue).\n filter(function(key) { return classValue[key]; }).\n join(' ');\n }\n\n return classString;\n }\n}", "title": "" }, { "docid": "4c81ff568815a511fbdcbbe24a4a2f57", "score": "0.4835014", "text": "function classDirective(name, selector) {\n name = 'ngClass' + name;\n var indexWatchExpression;\n\n return ['$parse', function($parse) {\n return {\n restrict: 'AC',\n link: function(scope, element, attr) {\n var classCounts = element.data('$classCounts');\n var oldModulo = true;\n var oldClassString;\n\n if (!classCounts) {\n // Use createMap() to prevent class assumptions involving property\n // names in Object.prototype\n classCounts = createMap();\n element.data('$classCounts', classCounts);\n }\n\n if (name !== 'ngClass') {\n if (!indexWatchExpression) {\n indexWatchExpression = $parse('$index', function moduloTwo($index) {\n // eslint-disable-next-line no-bitwise\n return $index & 1;\n });\n }\n\n scope.$watch(indexWatchExpression, ngClassIndexWatchAction);\n }\n\n scope.$watch($parse(attr[name], toClassString), ngClassWatchAction);\n\n function addClasses(classString) {\n classString = digestClassCounts(split(classString), 1);\n attr.$addClass(classString);\n }\n\n function removeClasses(classString) {\n classString = digestClassCounts(split(classString), -1);\n attr.$removeClass(classString);\n }\n\n function updateClasses(oldClassString, newClassString) {\n var oldClassArray = split(oldClassString);\n var newClassArray = split(newClassString);\n\n var toRemoveArray = arrayDifference(oldClassArray, newClassArray);\n var toAddArray = arrayDifference(newClassArray, oldClassArray);\n\n var toRemoveString = digestClassCounts(toRemoveArray, -1);\n var toAddString = digestClassCounts(toAddArray, 1);\n\n attr.$addClass(toAddString);\n attr.$removeClass(toRemoveString);\n }\n\n function digestClassCounts(classArray, count) {\n var classesToUpdate = [];\n\n forEach(classArray, function(className) {\n if (count > 0 || classCounts[className]) {\n classCounts[className] = (classCounts[className] || 0) + count;\n if (classCounts[className] === +(count > 0)) {\n classesToUpdate.push(className);\n }\n }\n });\n\n return classesToUpdate.join(' ');\n }\n\n function ngClassIndexWatchAction(newModulo) {\n // This watch-action should run before the `ngClassWatchAction()`, thus it\n // adds/removes `oldClassString`. If the `ngClass` expression has changed as well, the\n // `ngClassWatchAction()` will update the classes.\n if (newModulo === selector) {\n addClasses(oldClassString);\n } else {\n removeClasses(oldClassString);\n }\n\n oldModulo = newModulo;\n }\n\n function ngClassWatchAction(newClassString) {\n if (oldModulo === selector) {\n updateClasses(oldClassString, newClassString);\n }\n\n oldClassString = newClassString;\n }\n }\n };\n }];\n\n // Helpers\n function arrayDifference(tokens1, tokens2) {\n if (!tokens1 || !tokens1.length) return [];\n if (!tokens2 || !tokens2.length) return tokens1;\n\n var values = [];\n\n outer:\n for (var i = 0; i < tokens1.length; i++) {\n var token = tokens1[i];\n for (var j = 0; j < tokens2.length; j++) {\n if (token === tokens2[j]) continue outer;\n }\n values.push(token);\n }\n\n return values;\n }\n\n function split(classString) {\n return classString && classString.split(' ');\n }\n\n function toClassString(classValue) {\n if (!classValue) return classValue;\n\n var classString = classValue;\n\n if (isArray(classValue)) {\n classString = classValue.map(toClassString).join(' ');\n } else if (isObject(classValue)) {\n classString = Object.keys(classValue).\n filter(function(key) { return classValue[key]; }).\n join(' ');\n } else if (!isString(classValue)) {\n classString = classValue + '';\n }\n\n return classString;\n }\n}", "title": "" }, { "docid": "dcb0ba89c0abe2555304364bd7769385", "score": "0.4835014", "text": "function classDirective(name, selector) {\n name = 'ngClass' + name;\n var indexWatchExpression;\n\n return ['$parse', function($parse) {\n return {\n restrict: 'AC',\n link: function(scope, element, attr) {\n var classCounts = element.data('$classCounts');\n var oldModulo = true;\n var oldClassString;\n\n if (!classCounts) {\n // Use createMap() to prevent class assumptions involving property\n // names in Object.prototype\n classCounts = createMap();\n element.data('$classCounts', classCounts);\n }\n\n if (name !== 'ngClass') {\n if (!indexWatchExpression) {\n indexWatchExpression = $parse('$index', function moduloTwo($index) {\n // eslint-disable-next-line no-bitwise\n return $index & 1;\n });\n }\n\n scope.$watch(indexWatchExpression, ngClassIndexWatchAction);\n }\n\n scope.$watch($parse(attr[name], toClassString), ngClassWatchAction);\n\n function addClasses(classString) {\n classString = digestClassCounts(split(classString), 1);\n attr.$addClass(classString);\n }\n\n function removeClasses(classString) {\n classString = digestClassCounts(split(classString), -1);\n attr.$removeClass(classString);\n }\n\n function updateClasses(oldClassString, newClassString) {\n var oldClassArray = split(oldClassString);\n var newClassArray = split(newClassString);\n\n var toRemoveArray = arrayDifference(oldClassArray, newClassArray);\n var toAddArray = arrayDifference(newClassArray, oldClassArray);\n\n var toRemoveString = digestClassCounts(toRemoveArray, -1);\n var toAddString = digestClassCounts(toAddArray, 1);\n\n attr.$addClass(toAddString);\n attr.$removeClass(toRemoveString);\n }\n\n function digestClassCounts(classArray, count) {\n var classesToUpdate = [];\n\n forEach(classArray, function(className) {\n if (count > 0 || classCounts[className]) {\n classCounts[className] = (classCounts[className] || 0) + count;\n if (classCounts[className] === +(count > 0)) {\n classesToUpdate.push(className);\n }\n }\n });\n\n return classesToUpdate.join(' ');\n }\n\n function ngClassIndexWatchAction(newModulo) {\n // This watch-action should run before the `ngClassWatchAction()`, thus it\n // adds/removes `oldClassString`. If the `ngClass` expression has changed as well, the\n // `ngClassWatchAction()` will update the classes.\n if (newModulo === selector) {\n addClasses(oldClassString);\n } else {\n removeClasses(oldClassString);\n }\n\n oldModulo = newModulo;\n }\n\n function ngClassWatchAction(newClassString) {\n // When using a one-time binding the newClassString will return\n // the pre-interceptor value until the one-time is complete\n if (!isString(newClassString)) {\n newClassString = toClassString(newClassString);\n }\n\n if (oldModulo === selector) {\n updateClasses(oldClassString, newClassString);\n }\n\n oldClassString = newClassString;\n }\n }\n };\n }];\n\n // Helpers\n function arrayDifference(tokens1, tokens2) {\n if (!tokens1 || !tokens1.length) return [];\n if (!tokens2 || !tokens2.length) return tokens1;\n\n var values = [];\n\n outer:\n for (var i = 0; i < tokens1.length; i++) {\n var token = tokens1[i];\n for (var j = 0; j < tokens2.length; j++) {\n if (token === tokens2[j]) continue outer;\n }\n values.push(token);\n }\n\n return values;\n }\n\n function split(classString) {\n return classString && classString.split(' ');\n }\n\n function toClassString(classValue) {\n var classString = classValue;\n\n if (isArray(classValue)) {\n classString = classValue.map(toClassString).join(' ');\n } else if (isObject(classValue)) {\n classString = Object.keys(classValue).\n filter(function(key) { return classValue[key]; }).\n join(' ');\n }\n\n return classString;\n }\n}", "title": "" }, { "docid": "71e4b31feabb104b3ba6b062ea73fa18", "score": "0.4834591", "text": "function classDirective(name, selector) {\n\t name = 'ngClass' + name;\n\t var indexWatchExpression;\n\n\t return ['$parse', function($parse) {\n\t return {\n\t restrict: 'AC',\n\t link: function(scope, element, attr) {\n\t var classCounts = element.data('$classCounts');\n\t var oldModulo = true;\n\t var oldClassString;\n\n\t if (!classCounts) {\n\t // Use createMap() to prevent class assumptions involving property\n\t // names in Object.prototype\n\t classCounts = createMap();\n\t element.data('$classCounts', classCounts);\n\t }\n\n\t if (name !== 'ngClass') {\n\t if (!indexWatchExpression) {\n\t indexWatchExpression = $parse('$index', function moduloTwo($index) {\n\t // eslint-disable-next-line no-bitwise\n\t return $index & 1;\n\t });\n\t }\n\n\t scope.$watch(indexWatchExpression, ngClassIndexWatchAction);\n\t }\n\n\t scope.$watch($parse(attr[name], toClassString), ngClassWatchAction);\n\n\t function addClasses(classString) {\n\t classString = digestClassCounts(split(classString), 1);\n\t attr.$addClass(classString);\n\t }\n\n\t function removeClasses(classString) {\n\t classString = digestClassCounts(split(classString), -1);\n\t attr.$removeClass(classString);\n\t }\n\n\t function updateClasses(oldClassString, newClassString) {\n\t var oldClassArray = split(oldClassString);\n\t var newClassArray = split(newClassString);\n\n\t var toRemoveArray = arrayDifference(oldClassArray, newClassArray);\n\t var toAddArray = arrayDifference(newClassArray, oldClassArray);\n\n\t var toRemoveString = digestClassCounts(toRemoveArray, -1);\n\t var toAddString = digestClassCounts(toAddArray, 1);\n\n\t attr.$addClass(toAddString);\n\t attr.$removeClass(toRemoveString);\n\t }\n\n\t function digestClassCounts(classArray, count) {\n\t var classesToUpdate = [];\n\n\t forEach(classArray, function(className) {\n\t if (count > 0 || classCounts[className]) {\n\t classCounts[className] = (classCounts[className] || 0) + count;\n\t if (classCounts[className] === +(count > 0)) {\n\t classesToUpdate.push(className);\n\t }\n\t }\n\t });\n\n\t return classesToUpdate.join(' ');\n\t }\n\n\t function ngClassIndexWatchAction(newModulo) {\n\t // This watch-action should run before the `ngClassWatchAction()`, thus it\n\t // adds/removes `oldClassString`. If the `ngClass` expression has changed as well, the\n\t // `ngClassWatchAction()` will update the classes.\n\t if (newModulo === selector) {\n\t addClasses(oldClassString);\n\t } else {\n\t removeClasses(oldClassString);\n\t }\n\n\t oldModulo = newModulo;\n\t }\n\n\t function ngClassWatchAction(newClassString) {\n\t if (oldModulo === selector) {\n\t updateClasses(oldClassString, newClassString);\n\t }\n\n\t oldClassString = newClassString;\n\t }\n\t }\n\t };\n\t }];\n\n\t // Helpers\n\t function arrayDifference(tokens1, tokens2) {\n\t if (!tokens1 || !tokens1.length) return [];\n\t if (!tokens2 || !tokens2.length) return tokens1;\n\n\t var values = [];\n\n\t outer:\n\t for (var i = 0; i < tokens1.length; i++) {\n\t var token = tokens1[i];\n\t for (var j = 0; j < tokens2.length; j++) {\n\t if (token === tokens2[j]) continue outer;\n\t }\n\t values.push(token);\n\t }\n\n\t return values;\n\t }\n\n\t function split(classString) {\n\t return classString && classString.split(' ');\n\t }\n\n\t function toClassString(classValue) {\n\t var classString = classValue;\n\n\t if (isArray(classValue)) {\n\t classString = classValue.map(toClassString).join(' ');\n\t } else if (isObject(classValue)) {\n\t classString = Object.keys(classValue).\n\t filter(function(key) { return classValue[key]; }).\n\t join(' ');\n\t }\n\n\t return classString;\n\t }\n\t}", "title": "" }, { "docid": "daa21895a02f3c75266f8bad44c16c04", "score": "0.48297137", "text": "function css() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var classes = [];\n for (var _a = 0, args_1 = args; _a < args_1.length; _a++) {\n var arg = args_1[_a];\n if (arg) {\n if (typeof arg === 'string') {\n classes.push(arg);\n }\n else if (arg.hasOwnProperty('toString') && typeof arg.toString === 'function') {\n classes.push(arg.toString());\n }\n else {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n for (var key in arg) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (arg[key]) {\n classes.push(key);\n }\n }\n }\n }\n }\n return classes.join(' ');\n}", "title": "" }, { "docid": "daa21895a02f3c75266f8bad44c16c04", "score": "0.48297137", "text": "function css() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var classes = [];\n for (var _a = 0, args_1 = args; _a < args_1.length; _a++) {\n var arg = args_1[_a];\n if (arg) {\n if (typeof arg === 'string') {\n classes.push(arg);\n }\n else if (arg.hasOwnProperty('toString') && typeof arg.toString === 'function') {\n classes.push(arg.toString());\n }\n else {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n for (var key in arg) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (arg[key]) {\n classes.push(key);\n }\n }\n }\n }\n }\n return classes.join(' ');\n}", "title": "" }, { "docid": "1e4a518d1bc2316f36ebb712eee3b624", "score": "0.4819696", "text": "function css() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n var classes = [];\r\n for (var _a = 0, args_1 = args; _a < args_1.length; _a++) {\r\n var arg = args_1[_a];\r\n if (arg) {\r\n if (typeof arg === 'string') {\r\n classes.push(arg);\r\n }\r\n else if (arg.hasOwnProperty('toString') && typeof arg.toString === 'function') {\r\n classes.push(arg.toString());\r\n }\r\n else {\r\n // tslint:disable-next-line:no-any\r\n for (var key in arg) {\r\n // tslint:disable-next-line:no-any\r\n if (arg[key]) {\r\n classes.push(key);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return classes.join(' ');\r\n}", "title": "" }, { "docid": "53655dbff08449c2b835ac1f940a25f5", "score": "0.4816513", "text": "function n(e,t,o,n){null!==e?\"number\"!=typeof n?r(t,\"querySelectors\",{attributeName:o,querySelector:e}):console.error(\"ag-Grid: QuerySelector should be on an attribute\"):console.error(\"ag-Grid: QuerySelector selector should not be null\")}", "title": "" }, { "docid": "2c025e3b6e120c396655e7dc2c800938", "score": "0.48032984", "text": "function setClasses(obj, givenIndex) {\n let classIndex = 1;\n let eleObjs = obj.filter((ele) => {\n return typeof ele === 'object' && ele !== null;\n });\n\n eleObjs.forEach((ele = {}) => {\n let myIndex = givenIndex ? `${givenIndex}.${classIndex}` : classIndex;\n let attrs = ele.attrs || {};\n if (attrs.class && attrs.class.includes(seperator)) {\n let seperatorClass = attrs.class.split(' ').filter((clsName) => clsName.includes(seperator)).sort().join(' ');\n classObject[`class-${myIndex}`] = seperatorClass;\n classIndex++;\n }\n if (ele.content) {\n setClasses(ele.content, myIndex);\n }\n });\n return eleObjs;\n }", "title": "" }, { "docid": "df07f27801993ab85bfebb73586eb316", "score": "0.47922748", "text": "static get selectors() {\n return (0, _reselectTree.createNestedSelector)({\n ast: _selectors4.default,\n data: _selectors2.default,\n trace: _selectors6.default,\n evm: _selectors8.default,\n solidity: _selectors10.default,\n session: _selectors12.default,\n controller: _selectors14.default\n });\n }", "title": "" }, { "docid": "474ab4ccdd9c57686fbdc840259adb3f", "score": "0.47916296", "text": "function addCssO(c,objetos){\n\tvar i=1;\n\twhile (i<arguments.length){\n\t\tdocument.querySelector(arguments[i]).classList.add(c);\n\t\ti++;\n\t}\n}", "title": "" }, { "docid": "63af5121777560cd28161d4a73283f30", "score": "0.47802085", "text": "function classNames() {\n\tvar classes = '';\n\tvar arg;\n\n\tfor (var i = 0; i < arguments.length; i++) {\n\t\targ = arguments[i];\n\t\tif (!arg) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ('string' === typeof arg || 'number' === typeof arg) {\n\t\t\tclasses += ' ' + arg;\n\t\t} else if (Object.prototype.toString.call(arg) === '[object Array]') {\n\t\t\tclasses += ' ' + classNames.apply(null, arg);\n\t\t} else if ('object' === typeof arg) {\n\t\t\tfor (var key in arg) {\n\t\t\t\tif (!arg.hasOwnProperty(key) || !arg[key]) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tclasses += ' ' + key;\n\t\t\t}\n\t\t}\n\t}\n\treturn classes.substr(1);\n}", "title": "" }, { "docid": "63af5121777560cd28161d4a73283f30", "score": "0.47802085", "text": "function classNames() {\n\tvar classes = '';\n\tvar arg;\n\n\tfor (var i = 0; i < arguments.length; i++) {\n\t\targ = arguments[i];\n\t\tif (!arg) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ('string' === typeof arg || 'number' === typeof arg) {\n\t\t\tclasses += ' ' + arg;\n\t\t} else if (Object.prototype.toString.call(arg) === '[object Array]') {\n\t\t\tclasses += ' ' + classNames.apply(null, arg);\n\t\t} else if ('object' === typeof arg) {\n\t\t\tfor (var key in arg) {\n\t\t\t\tif (!arg.hasOwnProperty(key) || !arg[key]) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tclasses += ' ' + key;\n\t\t\t}\n\t\t}\n\t}\n\treturn classes.substr(1);\n}", "title": "" }, { "docid": "302074d8bec45e2bfddddff011c2eace", "score": "0.47672978", "text": "function SelectDescendants(arg0, arg1)\n{\n\treturn 10;\n}", "title": "" }, { "docid": "de9780ea8001a10e5379544e4df66b2b", "score": "0.47661313", "text": "function classNames() {\n\t\tvar classes = '';\n\t\tvar arg;\n\t\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\targ = arguments[i];\n\t\t\tif (!arg) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\n\t\t\tif ('string' === typeof arg || 'number' === typeof arg) {\n\t\t\t\tclasses += ' ' + arg;\n\t\t\t} else if (Object.prototype.toString.call(arg) === '[object Array]') {\n\t\t\t\tclasses += ' ' + classNames.apply(null, arg);\n\t\t\t} else if ('object' === typeof arg) {\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (!arg.hasOwnProperty(key) || !arg[key]) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tclasses += ' ' + key;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn classes.substr(1);\n\t}", "title": "" }, { "docid": "de9780ea8001a10e5379544e4df66b2b", "score": "0.47661313", "text": "function classNames() {\n\t\tvar classes = '';\n\t\tvar arg;\n\t\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\targ = arguments[i];\n\t\t\tif (!arg) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\n\t\t\tif ('string' === typeof arg || 'number' === typeof arg) {\n\t\t\t\tclasses += ' ' + arg;\n\t\t\t} else if (Object.prototype.toString.call(arg) === '[object Array]') {\n\t\t\t\tclasses += ' ' + classNames.apply(null, arg);\n\t\t\t} else if ('object' === typeof arg) {\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (!arg.hasOwnProperty(key) || !arg[key]) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tclasses += ' ' + key;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn classes.substr(1);\n\t}", "title": "" }, { "docid": "773f394005d1a122c00fa76439b66e00", "score": "0.47573888", "text": "function getSelector(node)\n{\n\tvar name;\n\tvar selector = [];\n\t\n\twhile (node.nodeName !== \"#document\")\n\t{\n\t\tname = node.nodeName;\n\t\t\n\t\t// Only one of these are ever allowed -- so, index is unnecessary\n\t\tif (name!==\"html\" && name!==\"body\" & name!==\"head\")\n\t\t{\n\t\t\tname += \":nth-child(\"+ getNthIndex(node) +\")\";\n\t\t}\n\t\t\n\t\t// Building backwards\n\t\tselector.push(name);\n\t\t\n\t\tnode = node.parentNode;\n\t}\n\t\n\treturn selector.reverse().join(\" > \");\n}", "title": "" }, { "docid": "9f51caaf4b09e48a7c9f7c06a97013ca", "score": "0.47475356", "text": "function getPathItemsInSelection(n, paths){\n if(documents.length < 1) return;\n \n var s = activeDocument.selection;\n \n if (!(s instanceof Array) || s.length < 1) return;\n\n extractPaths(s, n, paths);\n}", "title": "" }, { "docid": "e8353bfaa6437dc1f8555af4dec68e07", "score": "0.47332647", "text": "function getNthParent(obj,levels) {\n let $element = obj;\n for (let i=0;i<levels;i++) {\n $element = $element.parentElement;\n }\n return $element;\n}", "title": "" }, { "docid": "69944d874fc24c6be2b1d221adb034db", "score": "0.4718785", "text": "function classNames() {\n\t\t\tvar classes = '';\n\t\t\tvar arg;\n\n\t\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\t\targ = arguments[i];\n\t\t\t\tif (!arg) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ('string' === typeof arg || 'number' === typeof arg) {\n\t\t\t\t\tclasses += ' ' + arg;\n\t\t\t\t} else if (Object.prototype.toString.call(arg) === '[object Array]') {\n\t\t\t\t\tclasses += ' ' + classNames.apply(null, arg);\n\t\t\t\t} else if ('object' === typeof arg) {\n\t\t\t\t\tfor (var key in arg) {\n\t\t\t\t\t\tif (!arg.hasOwnProperty(key) || !arg[key]) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclasses += ' ' + key;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn classes.substr(1);\n\t\t}", "title": "" }, { "docid": "69944d874fc24c6be2b1d221adb034db", "score": "0.4718785", "text": "function classNames() {\n\t\t\tvar classes = '';\n\t\t\tvar arg;\n\n\t\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\t\targ = arguments[i];\n\t\t\t\tif (!arg) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ('string' === typeof arg || 'number' === typeof arg) {\n\t\t\t\t\tclasses += ' ' + arg;\n\t\t\t\t} else if (Object.prototype.toString.call(arg) === '[object Array]') {\n\t\t\t\t\tclasses += ' ' + classNames.apply(null, arg);\n\t\t\t\t} else if ('object' === typeof arg) {\n\t\t\t\t\tfor (var key in arg) {\n\t\t\t\t\t\tif (!arg.hasOwnProperty(key) || !arg[key]) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclasses += ' ' + key;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn classes.substr(1);\n\t\t}", "title": "" }, { "docid": "83ee430ce1252103b6cb3f9386cce8b6", "score": "0.47133172", "text": "function classNames() {\n\t\tvar classes = '';\n\t\tvar arg;\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\targ = arguments[i];\n\t\t\tif (!arg) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ('string' === typeof arg || 'number' === typeof arg) {\n\t\t\t\tclasses += ' ' + arg;\n\t\t\t} else if (Object.prototype.toString.call(arg) === '[object Array]') {\n\t\t\t\tclasses += ' ' + classNames.apply(null, arg);\n\t\t\t} else if ('object' === typeof arg) {\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (!arg.hasOwnProperty(key) || !arg[key]) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tclasses += ' ' + key;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn classes.substr(1);\n\t}", "title": "" }, { "docid": "83ee430ce1252103b6cb3f9386cce8b6", "score": "0.47133172", "text": "function classNames() {\n\t\tvar classes = '';\n\t\tvar arg;\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\targ = arguments[i];\n\t\t\tif (!arg) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ('string' === typeof arg || 'number' === typeof arg) {\n\t\t\t\tclasses += ' ' + arg;\n\t\t\t} else if (Object.prototype.toString.call(arg) === '[object Array]') {\n\t\t\t\tclasses += ' ' + classNames.apply(null, arg);\n\t\t\t} else if ('object' === typeof arg) {\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (!arg.hasOwnProperty(key) || !arg[key]) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tclasses += ' ' + key;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn classes.substr(1);\n\t}", "title": "" }, { "docid": "4703b9669fd373535d1eb17888a9e9f2", "score": "0.47123563", "text": "function classNames() {\n\t\t\t\tvar classes = '';\n\t\t\t\tvar arg;\n\n\t\t\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\t\t\targ = arguments[i];\n\t\t\t\t\tif (!arg) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ('string' === typeof arg || 'number' === typeof arg) {\n\t\t\t\t\t\tclasses += ' ' + arg;\n\t\t\t\t\t} else if (Object.prototype.toString.call(arg) === '[object Array]') {\n\t\t\t\t\t\tclasses += ' ' + classNames.apply(null, arg);\n\t\t\t\t\t} else if ('object' === typeof arg) {\n\t\t\t\t\t\tfor (var key in arg) {\n\t\t\t\t\t\t\tif (!arg.hasOwnProperty(key) || !arg[key]) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tclasses += ' ' + key;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn classes.substr(1);\n\t\t\t}", "title": "" }, { "docid": "384a057774eee1cdffa491cc1ad2fc36", "score": "0.47049806", "text": "function r(e,t,n,r){null!==e?\"number\"!=typeof r?o(t,\"querySelectors\",{attributeName:n,querySelector:e}):console.error(\"ag-Grid: QuerySelector should be on an attribute\"):console.error(\"ag-Grid: QuerySelector selector should not be null\")}", "title": "" }, { "docid": "62643c201dfb4cc2c54bf81cb31ad1c9", "score": "0.46922448", "text": "function byClassName(nodeSet, cls){\n if(!cls){\n return nodeSet;\n }\n var result = [], ri = -1;\n for(var i = 0, ci; ci = nodeSet[i]; i++){\n if((' '+ci.className+' ').indexOf(cls) != -1){\n result[++ri] = ci;\n }\n }\n return result;\n }", "title": "" }, { "docid": "4b41a357290a59dfc1f9d1293dea22cb", "score": "0.46916023", "text": "function classNames(){for(var e=\"\",t,n=0;n<arguments.length;n++){if(!(t=arguments[n]))continue;if(\"string\"==typeof t||\"number\"==typeof t)e+=\" \"+t;else if(\"[object Array]\"===Object.prototype.toString.call(t))e+=\" \"+classNames.apply(null,t);else if(\"object\"==typeof t)for(var r in t){if(!t.hasOwnProperty(r)||!t[r])continue;e+=\" \"+r}}return e.substr(1)}", "title": "" }, { "docid": "4b41a357290a59dfc1f9d1293dea22cb", "score": "0.46916023", "text": "function classNames(){for(var e=\"\",t,n=0;n<arguments.length;n++){if(!(t=arguments[n]))continue;if(\"string\"==typeof t||\"number\"==typeof t)e+=\" \"+t;else if(\"[object Array]\"===Object.prototype.toString.call(t))e+=\" \"+classNames.apply(null,t);else if(\"object\"==typeof t)for(var r in t){if(!t.hasOwnProperty(r)||!t[r])continue;e+=\" \"+r}}return e.substr(1)}", "title": "" }, { "docid": "4b41a357290a59dfc1f9d1293dea22cb", "score": "0.46916023", "text": "function classNames(){for(var e=\"\",t,n=0;n<arguments.length;n++){if(!(t=arguments[n]))continue;if(\"string\"==typeof t||\"number\"==typeof t)e+=\" \"+t;else if(\"[object Array]\"===Object.prototype.toString.call(t))e+=\" \"+classNames.apply(null,t);else if(\"object\"==typeof t)for(var r in t){if(!t.hasOwnProperty(r)||!t[r])continue;e+=\" \"+r}}return e.substr(1)}", "title": "" }, { "docid": "4b41a357290a59dfc1f9d1293dea22cb", "score": "0.46916023", "text": "function classNames(){for(var e=\"\",t,n=0;n<arguments.length;n++){if(!(t=arguments[n]))continue;if(\"string\"==typeof t||\"number\"==typeof t)e+=\" \"+t;else if(\"[object Array]\"===Object.prototype.toString.call(t))e+=\" \"+classNames.apply(null,t);else if(\"object\"==typeof t)for(var r in t){if(!t.hasOwnProperty(r)||!t[r])continue;e+=\" \"+r}}return e.substr(1)}", "title": "" }, { "docid": "4b41a357290a59dfc1f9d1293dea22cb", "score": "0.46916023", "text": "function classNames(){for(var e=\"\",t,n=0;n<arguments.length;n++){if(!(t=arguments[n]))continue;if(\"string\"==typeof t||\"number\"==typeof t)e+=\" \"+t;else if(\"[object Array]\"===Object.prototype.toString.call(t))e+=\" \"+classNames.apply(null,t);else if(\"object\"==typeof t)for(var r in t){if(!t.hasOwnProperty(r)||!t[r])continue;e+=\" \"+r}}return e.substr(1)}", "title": "" }, { "docid": "fbf0ee8059f68031c08ebb001d2cd438", "score": "0.46893197", "text": "function $DOM(elementHint, elementIndex){\n /* // in case non-css selector gets required \n var first_char = elementHint.match(/^./)[0];\n\tvar rest_chars = elementHint.replace(/^./, ''); */\n \t\n var str_nodes = document.querySelectorAll(elementHint);\n if (elementIndex === undefined) {\n elementIndex = 0;\n }\n\treturn str_nodes[elementIndex];\n}", "title": "" }, { "docid": "ada99277bfc0a9b8f75737086583c61a", "score": "0.46676102", "text": "function d3SelectPage(i) {\n return d3.select(\"#pokemon-info-body\").select(\".page:nth-child(\" + (i+1) + \")\");\n}", "title": "" }, { "docid": "d2b960d98b9e9ad6eec47072d9cb98ad", "score": "0.4664831", "text": "function _selector(name, ancestor) {\n\t\treturn $('.' + BOXPLUS + '-' + name, ancestor);\n\t}", "title": "" }, { "docid": "3302e1970123c072c122a9d7279e2433", "score": "0.46632802", "text": "function classNames () {\n\t\t'use strict';\n\n\t\tvar classes = '';\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif ('string' === argType || 'number' === argType) {\n\t\t\t\tclasses += ' ' + arg;\n\n\t\t\t} else if (Array.isArray(arg)) {\n\t\t\t\tclasses += ' ' + classNames.apply(null, arg);\n\n\t\t\t} else if ('object' === argType) {\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (arg.hasOwnProperty(key) && arg[key]) {\n\t\t\t\t\t\tclasses += ' ' + key;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.substr(1);\n\t}", "title": "" }, { "docid": "e7794ee6c9026a0f5a0ca8381e8303ae", "score": "0.46618855", "text": "function createCssSelector(tag, attributes) {\n var cssSelector = new CssSelector();\n cssSelector.setElement(tag);\n Object.getOwnPropertyNames(attributes).forEach(function (name) {\n var value = attributes[name];\n cssSelector.addAttribute(name, value);\n\n if (name.toLowerCase() === 'class') {\n var classes = value.trim().split(/\\s+/);\n classes.forEach(function (className) {\n return cssSelector.addClassName(className);\n });\n }\n });\n return cssSelector;\n }", "title": "" }, { "docid": "8351edcdec4c710da894a4873e19ec1d", "score": "0.46598902", "text": "function _getByClass(selectorString, parent=document, limit = null){\n return [...parent.getElementsByClassName(selectorString)]\n}", "title": "" }, { "docid": "cec916b7663f240f370cf840e02cdef3", "score": "0.46597323", "text": "function createCssSelector(tag, attributes) {\n var cssSelector = new CssSelector();\n cssSelector.setElement(tag);\n Object.getOwnPropertyNames(attributes).forEach(function (name) {\n var value = attributes[name];\n cssSelector.addAttribute(name, value);\n if (name.toLowerCase() === 'class') {\n var classes = value.trim().split(/\\s+/);\n classes.forEach(function (className) { return cssSelector.addClassName(className); });\n }\n });\n return cssSelector;\n}", "title": "" }, { "docid": "cec916b7663f240f370cf840e02cdef3", "score": "0.46597323", "text": "function createCssSelector(tag, attributes) {\n var cssSelector = new CssSelector();\n cssSelector.setElement(tag);\n Object.getOwnPropertyNames(attributes).forEach(function (name) {\n var value = attributes[name];\n cssSelector.addAttribute(name, value);\n if (name.toLowerCase() === 'class') {\n var classes = value.trim().split(/\\s+/);\n classes.forEach(function (className) { return cssSelector.addClassName(className); });\n }\n });\n return cssSelector;\n}", "title": "" }, { "docid": "cec916b7663f240f370cf840e02cdef3", "score": "0.46597323", "text": "function createCssSelector(tag, attributes) {\n var cssSelector = new CssSelector();\n cssSelector.setElement(tag);\n Object.getOwnPropertyNames(attributes).forEach(function (name) {\n var value = attributes[name];\n cssSelector.addAttribute(name, value);\n if (name.toLowerCase() === 'class') {\n var classes = value.trim().split(/\\s+/);\n classes.forEach(function (className) { return cssSelector.addClassName(className); });\n }\n });\n return cssSelector;\n}", "title": "" }, { "docid": "800c570e0e8092e9bd7b7f1b573ce2db", "score": "0.46523148", "text": "function generateSelector(target) {\n var sel = '';\n target = $(target);\n var targetElement = target.get(0);\n\n var ancestors = target.parents().andSelf();\n ancestors.each(function(i, ancestorElement) {\n ancestor = $(ancestorElement);\n var subsel = ancestorElement.tagName.toLowerCase();;\n\n var id = ancestor.attr('id');\n if (id && id.length > 0) {\n subsel += '#' + id;\n } else {\n var classes = ancestor.attr('class');\n if (classes && classes.length > 0) {\n subsel += '.' + classes.replace(/\\s+/g, '.');\n }\n\n var index = ancestor.index(sel + subsel);\n if ($(sel + subsel).siblings(subsel).length > 0) {\n subsel += ':eq(' + index + ')';\n }\n }\n\n sel += subsel;\n\n if (i < ancestors.length - 1) {\n sel += ' > ';\n }\n });\n\n return sel;\n}", "title": "" }, { "docid": "6c1c3932b89af1f69519d59ef8b88821", "score": "0.46470317", "text": "function classDirective(name,selector){name='ngClass'+name;var indexWatchExpression;return['$parse',function($parse){return{restrict:'AC',link:function link(scope,element,attr){var classCounts=element.data('$classCounts');var oldModulo=true;var oldClassString;if(!classCounts){// Use createMap() to prevent class assumptions involving property\n// names in Object.prototype\nclassCounts=createMap();element.data('$classCounts',classCounts);}if(name!=='ngClass'){if(!indexWatchExpression){indexWatchExpression=$parse('$index',function moduloTwo($index){// eslint-disable-next-line no-bitwise\nreturn $index&1;});}scope.$watch(indexWatchExpression,ngClassIndexWatchAction);}scope.$watch($parse(attr[name],toClassString),ngClassWatchAction);function addClasses(classString){classString=digestClassCounts(split(classString),1);attr.$addClass(classString);}function removeClasses(classString){classString=digestClassCounts(split(classString),-1);attr.$removeClass(classString);}function updateClasses(oldClassString,newClassString){var oldClassArray=split(oldClassString);var newClassArray=split(newClassString);var toRemoveArray=arrayDifference(oldClassArray,newClassArray);var toAddArray=arrayDifference(newClassArray,oldClassArray);var toRemoveString=digestClassCounts(toRemoveArray,-1);var toAddString=digestClassCounts(toAddArray,1);attr.$addClass(toAddString);attr.$removeClass(toRemoveString);}function digestClassCounts(classArray,count){var classesToUpdate=[];forEach(classArray,function(className){if(count>0||classCounts[className]){classCounts[className]=(classCounts[className]||0)+count;if(classCounts[className]===+(count>0)){classesToUpdate.push(className);}}});return classesToUpdate.join(' ');}function ngClassIndexWatchAction(newModulo){// This watch-action should run before the `ngClassWatchAction()`, thus it\n// adds/removes `oldClassString`. If the `ngClass` expression has changed as well, the\n// `ngClassWatchAction()` will update the classes.\nif(newModulo===selector){addClasses(oldClassString);}else{removeClasses(oldClassString);}oldModulo=newModulo;}function ngClassWatchAction(newClassString){// When using a one-time binding the newClassString will return\n// the pre-interceptor value until the one-time is complete\nif(!isString(newClassString)){newClassString=toClassString(newClassString);}if(oldModulo===selector){updateClasses(oldClassString,newClassString);}oldClassString=newClassString;}}};}];// Helpers\nfunction arrayDifference(tokens1,tokens2){if(!tokens1||!tokens1.length)return[];if(!tokens2||!tokens2.length)return tokens1;var values=[];outer:for(var i=0;i<tokens1.length;i++){var token=tokens1[i];for(var j=0;j<tokens2.length;j++){if(token===tokens2[j])continue outer;}values.push(token);}return values;}function split(classString){return classString&&classString.split(' ');}function toClassString(classValue){var classString=classValue;if(isArray(classValue)){classString=classValue.map(toClassString).join(' ');}else if(isObject(classValue)){classString=Object.keys(classValue).filter(function(key){return classValue[key];}).join(' ');}return classString;}}", "title": "" }, { "docid": "7c1f7de4e8339058263fedca80a97a73", "score": "0.46384272", "text": "function createCssSelector(tag, attributes) {\n const cssSelector = new CssSelector();\n cssSelector.setElement(tag);\n Object.getOwnPropertyNames(attributes).forEach((name) => {\n const value = attributes[name];\n cssSelector.addAttribute(name, value);\n if (name.toLowerCase() === 'class') {\n const classes = value.trim().split(/\\s+/);\n classes.forEach(className => cssSelector.addClassName(className));\n }\n });\n return cssSelector;\n}", "title": "" }, { "docid": "7c1f7de4e8339058263fedca80a97a73", "score": "0.46384272", "text": "function createCssSelector(tag, attributes) {\n const cssSelector = new CssSelector();\n cssSelector.setElement(tag);\n Object.getOwnPropertyNames(attributes).forEach((name) => {\n const value = attributes[name];\n cssSelector.addAttribute(name, value);\n if (name.toLowerCase() === 'class') {\n const classes = value.trim().split(/\\s+/);\n classes.forEach(className => cssSelector.addClassName(className));\n }\n });\n return cssSelector;\n}", "title": "" }, { "docid": "f1d328c57a83cd698a2a32ed274c626f", "score": "0.46299303", "text": "function _generic(selectorString,parent = document, limit = null){\n return [...parent.querySelectorAll(selectorString)];\n}", "title": "" }, { "docid": "7af3b37bb899074d3fe4b27a1f6ec5fd", "score": "0.4627008", "text": "function matchingSelectorIndex(tNode, selectors, textSelectors) {\n var ngProjectAsAttrVal = getProjectAsAttrValue(tNode);\n for (var i = 0; i < selectors.length; i++) {\n // if a node has the ngProjectAs attribute match it against unparsed selector\n // match a node against a parsed selector only if ngProjectAs attribute is not present\n if (ngProjectAsAttrVal === textSelectors[i] ||\n ngProjectAsAttrVal === null &&\n isNodeMatchingSelectorList(tNode, selectors[i], /* isProjectionMode */ true)) {\n return i + 1; // first matching selector \"captures\" a given node\n }\n }\n return 0;\n}", "title": "" }, { "docid": "7af3b37bb899074d3fe4b27a1f6ec5fd", "score": "0.4627008", "text": "function matchingSelectorIndex(tNode, selectors, textSelectors) {\n var ngProjectAsAttrVal = getProjectAsAttrValue(tNode);\n for (var i = 0; i < selectors.length; i++) {\n // if a node has the ngProjectAs attribute match it against unparsed selector\n // match a node against a parsed selector only if ngProjectAs attribute is not present\n if (ngProjectAsAttrVal === textSelectors[i] ||\n ngProjectAsAttrVal === null &&\n isNodeMatchingSelectorList(tNode, selectors[i], /* isProjectionMode */ true)) {\n return i + 1; // first matching selector \"captures\" a given node\n }\n }\n return 0;\n}", "title": "" }, { "docid": "96cded1fffc6184622a071af728276b1", "score": "0.4626185", "text": "function C(i) {\n return document.getElementByClassName(i);\n}", "title": "" }, { "docid": "b78fc8089a3d42e0995e18b7da21fe39", "score": "0.4622331", "text": "function selectClass(classtext) {\n var objects = document.getElementsByClassName(classtext);\n return objects;\n}", "title": "" }, { "docid": "2e41b5b7e4c20d43dd8efb0ec51c6413", "score": "0.46171153", "text": "function getClassSelector (elem) {\n\t\tvar eleQuery = '';\n\t\t// account for element being of type node and has no attributes property\n\t\teleQuery += (elem.attributes && elem.attributes.class && elem.attributes.class.value) ? '.'+elem.attributes.class.value.split(' ').join('.') : '';\n\t\treturn (eleQuery !== '') ? elem.tagName + '' + eleQuery : null;\n\t}", "title": "" }, { "docid": "140c8cdf7b19f7cb1500a988ebd379cf", "score": "0.46163964", "text": "function selector(a){\n\ta=a.match(/^(\\W)?(.*)/);var b=document[\"getElement\"+(a[1]?a[1]==\"#\"?\"ById\":\"sByClassName\":\"sByTagName\")](a[2]);\n\tvar ret=[];\tb!=null&&(b.length?ret=b:b.length==0?ret=b:ret=[b]);\treturn ret;\n}", "title": "" }, { "docid": "140c8cdf7b19f7cb1500a988ebd379cf", "score": "0.46163964", "text": "function selector(a){\n\ta=a.match(/^(\\W)?(.*)/);var b=document[\"getElement\"+(a[1]?a[1]==\"#\"?\"ById\":\"sByClassName\":\"sByTagName\")](a[2]);\n\tvar ret=[];\tb!=null&&(b.length?ret=b:b.length==0?ret=b:ret=[b]);\treturn ret;\n}", "title": "" }, { "docid": "140c8cdf7b19f7cb1500a988ebd379cf", "score": "0.46163964", "text": "function selector(a){\n\ta=a.match(/^(\\W)?(.*)/);var b=document[\"getElement\"+(a[1]?a[1]==\"#\"?\"ById\":\"sByClassName\":\"sByTagName\")](a[2]);\n\tvar ret=[];\tb!=null&&(b.length?ret=b:b.length==0?ret=b:ret=[b]);\treturn ret;\n}", "title": "" }, { "docid": "a595fd0d228f73885d3a4a067415b09d", "score": "0.46088344", "text": "function cellSelector(){\n\t\treturn 'tbody>tr>td:nth-child('+(itHeaders+1)+')';\n\t}", "title": "" }, { "docid": "f695e2747f9e962fb8e48b27d4876c10", "score": "0.46012205", "text": "specificHeaderChildElement(index){\n return this.parent.$(`li:nth-child(${index})`)\n }", "title": "" }, { "docid": "1f5ffad805fbcc9cfcc15277b7dd21a8", "score": "0.45980376", "text": "function selectNodes(nodeNames) {\n\n if(typeof(nodeNames) == \"string\") // trap scalar, but expect and support arrays\n nodeNames = [nodeNames];\n\n for(var i=0; i < nodeNames.length; i++){\n s = \"cyPathway.filter('node[name=\\\"\" + nodeNames[i] + \"\\\"]').select()\";\n //console.log(\"markers selectNodes: \" + s);\n JAVASCRIPT_EVAL (s);\n } // for i\n\n} // selectNodes", "title": "" }, { "docid": "15b106ce58e1adfab31488fd7c12579f", "score": "0.4591438", "text": "function getPathSelector( data )\n{\n\tvar selectors = [''];\n\tvar firstEntry = true;\n\t\n\tpathWithoutExtension( data.path )\n\t\t.substr( data.base.length )\n\t\t.split( '/' )\n\t\t.forEach(\n\t\t\tfunction ( rawName )\n\t\t\t{\n\t\t\t\tvar name = unescape( rawName );\n\t\t\t\t\n\t\t\t\tif ( isNotForSelector( name ) )\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvar descendant = isDescendantSelector( name );\n\t\t\t\tvar modifier = isModifier( name );\n\t\t\t\tvar combinator = (\n\t\t\t\t\t(\n\t\t\t\t\t\tmodifier\n\t\t\t\t\t\t|| ( selectors[0].length === 0 )\n\t\t\t\t\t)\n\t\t\t\t\t? ''\n\t\t\t\t\t: ( descendant ? ' ' : ' > ' )\n\t\t\t\t);\n\t\t\t\tvar parts = splitSelectors( name );\n\t\t\t\tvar currentSelectors = selectors.slice();\n\t\t\t\t\n\t\t\t\tfor ( var i = 0, n = parts.length; i < n; i++ )\n\t\t\t\t{\n\t\t\t\t\tvar selector = combinator\n\t\t\t\t\t\t+ (\n\t\t\t\t\t\t\t( descendant || modifier )\n\t\t\t\t\t\t\t? parts[i].substr( 1 )\n\t\t\t\t\t\t\t: parts[i]\n\t\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\tif ( i > 0 )\n\t\t\t\t\t{\n\t\t\t\t\t\tselectors = selectors.concat(\n\t\t\t\t\t\t\tappendToStrings( currentSelectors.slice(), selector )\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\tappendToStrings( selectors, selector );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t\n\treturn selectors.join( ', ' );\n}", "title": "" }, { "docid": "0a398d7e6b8ea0013013fb25df17ef41", "score": "0.45892373", "text": "function o(e,t,n,o){null!==e?\"number\"!=typeof o?i(t,\"querySelectors\",{attributeName:n,querySelector:e}):console.error(\"ag-Grid: QuerySelector should be on an attribute\"):console.error(\"ag-Grid: QuerySelector selector should not be null\")}", "title": "" }, { "docid": "8039ea9573187730a5fb379a2bb4495e", "score": "0.45789248", "text": "function i(e,t,o,i){null!==e?\"number\"!=typeof i?n(t,\"querySelectors\",{attributeName:o,querySelector:e}):console.error(\"ag-Grid: QuerySelector should be on an attribute\"):console.error(\"ag-Grid: QuerySelector selector should not be null\")}", "title": "" }, { "docid": "3a95d8274f7d6991be4aad6d68edaf23", "score": "0.45752588", "text": "function makeSelectors(element, multi, customAttributes, preferLink) {\n\n var selectors = [];\n var item = element;\n var attributes = [\n \"name\",\n \"id\",\n \"type\",\n \"action\",\n \"for\",\n \"src\",\n \"alt\",\n \"data-tl-id\",\n \"data-id\",\n \"aria-label\"\n ];\n\n if (customAttributes && Array.isArray(customAttributes)) {\n attributes = customAttributes;\n }\n\n if (preferLink) {\n item = checkForBetterParent(item);\n }\n\n var anchorSelector = getLinkSelector(item);\n var attrSelector = getUniqueAttributeSelector(item, attributes);\n var cssSelector1 = getCssSelector(item, attributes);\n var cssSelector2 = getCssSelector(item, []);\n var cssSelector3 = getCssSelector(item, [\"id\", \"name\"]);\n\n if(anchorSelector) {\n selectors.push(anchorSelector);\n }\n\n if(attrSelector) {\n selectors.push(attrSelector);\n }\n\n if(cssSelector1 && selectors.indexOf(cssSelector1) < 0) {\n selectors.push(cssSelector1);\n }\n\n if(cssSelector2 && selectors.indexOf(cssSelector2) < 0) {\n selectors.push(cssSelector2);\n }\n\n if(cssSelector3 && selectors.indexOf(cssSelector3) < 0) {\n selectors.push(cssSelector3);\n }\n\n if (!multi) return selectors[0];\n\n return selectors;\n}", "title": "" }, { "docid": "b3093a875c0eb76248940cd1b0c51d5d", "score": "0.4572492", "text": "function matchingSelectorIndex(tNode, selectors, textSelectors) {\n var ngProjectAsAttrVal = getProjectAsAttrValue(tNode);\n for (var i = 0; i < selectors.length; i++) {\n // if a node has the ngProjectAs attribute match it against unparsed selector\n // match a node against a parsed selector only if ngProjectAs attribute is not present\n if (ngProjectAsAttrVal === textSelectors[i] ||\n ngProjectAsAttrVal === null && isNodeMatchingSelectorList(tNode, selectors[i])) {\n return i + 1; // first matching selector \"captures\" a given node\n }\n }\n return 0;\n}", "title": "" }, { "docid": "d79f574e4378e824ed2d00dd54dc4d0f", "score": "0.45696944", "text": "function C(i)\n{\n return document.getElementsByClassName(i)\n}", "title": "" }, { "docid": "e04bb0c9762746625c273a1d48a4a0b5", "score": "0.45656756", "text": "function getClassNames(elem, depth) {\n\tconst classNames = [];\n\twhile(elem && depth--) {\n\t\tfor(const name of elem.classList) {\n\t\t\tclassNames.push(name);\n\t\t}\n\t\telem = elem.parentNode;\n\t}\n\treturn classNames;\n}", "title": "" }, { "docid": "81994fa624aa06d2e39e73c0fe029b4d", "score": "0.4552805", "text": "function selectors (id) {\n return [id, '[' + id + ']', '.' + id];\n }", "title": "" }, { "docid": "80337234acc953d327c8f6f8cea37d4d", "score": "0.44983074", "text": "function i(e, t, o, i) { null !== e ? \"number\" != typeof i ? s(t, \"querySelectors\", { attributeName: o, querySelector: e }) : console.error(\"ag-Grid: QuerySelector should be on an attribute\") : console.error(\"ag-Grid: QuerySelector selector should not be null\") }", "title": "" }, { "docid": "83d6f3cd321cc9f1fd4e0e8ca923d24b", "score": "0.449827", "text": "genClassChain() {\r\n if (this.predicate) {\r\n return '/XCUIElementTypeAny[`' + this.predicate + '`]';\r\n }\r\n const qs = [];\r\n if (this.name) {\r\n qs.push(`name == '${this.name}'`);\r\n }\r\n if (this.namePart) {\r\n qs.push(`name CONTAINS '${this.namePart}'`);\r\n }\r\n if (this.nameRegex) {\r\n qs.push(`name MATCHES '${this.nameRegex}'`);\r\n }\r\n if (this.label) {\r\n qs.push(`label == '${this.label}'`);\r\n }\r\n if (this.labelPart) {\r\n qs.push(`label CONTAINS '${this.labelPart}'`);\r\n }\r\n if (this.value) {\r\n qs.push(`value == '${this.value}'`);\r\n }\r\n if (this.valuePart) {\r\n qs.push(`value CONTAINS ’${this.valuePart}'`);\r\n }\r\n if (this.visible !== null && this.visible !== undefined) {\r\n qs.push(`visible == ${this.visible.toString()}`);\r\n }\r\n if (this.enabled !== null && this.enabled !== undefined) {\r\n qs.push(`enabled == ${this.enabled.toString()}`);\r\n }\r\n const predicate = qs.join(' AND ');\r\n let chain = '/' + (this.className || 'XCUIElementTypeAny');\r\n if (predicate) {\r\n chain = chain + '[`' + predicate + '`]';\r\n }\r\n if (this.index) {\r\n chain = chain + `[${this.index}]`;\r\n }\r\n return chain;\r\n }", "title": "" } ]
1b448437014f5178fe8178c83f8e9246
Component for listing reviews
[ { "docid": "c23b72518c30778aedd87831d4881ba6", "score": "0.7268636", "text": "function ReviewList(props) {\n const { reviews } = props;\n return (\n <ul className=\"review-list\">\n {\n reviews.map((review, i) => {\n return (\n <li key={i}>\n <ReviewListItem review={review}/>\n </li>\n )\n })\n }\n </ul>\n );\n}", "title": "" } ]
[ { "docid": "cd18122da44486b6d10e222086042cff", "score": "0.6896434", "text": "static getAllReviews() {\r\n return new Promise((resolve, reject) => {\r\n fetch(`http://localhost:1337/reviews/`,\r\n { method: 'GET'})\r\n .then(response => response.json())\r\n .then(reviews => {\r\n console.log('reviews by ID:', reviews);\r\n resolve(reviews);\r\n })\r\n .catch(error => {\r\n console.log('Error: ', error);\r\n reject(error);\r\n });\r\n });\r\n }", "title": "" }, { "docid": "5356d71a453b11e2f9acc5f78410be5e", "score": "0.6895804", "text": "function Reviews( idProduct, list ) {\n\tContainer.call(this);\n\n\tthis.id = idProduct;\n\tthis.ArrayObjsReviewAndSubmit = this.makeArrayObjsReviewAndSubmit(list);\n\tthis.className = 'reviews';\n\tthis.htmlCode = '';\n\tthis.reviewsBlockHtmlCode = '';\n}", "title": "" }, { "docid": "e7edc03eeb15b3630fd941ab6cd2da07", "score": "0.6895237", "text": "function showReview() {\n const item = reviews[currentItem];\n img.src = item.img;\n author.textContent = item.author;\n job.textContent = item.job;\n info.textContent = item.text;\n}", "title": "" }, { "docid": "23c6f6b5890786cdd80b74dd1060946e", "score": "0.68563455", "text": "function displayReviews() {\n // use the template already defined in the html to add product reviews\n if ('content' in document.createElement('template')) { // if the html contains a template \n // make a copy of it\n reviews.forEach((review) => {\n displayReview(review);\n });\n } else { // if no template dont display\n console.error('Your browser does not support templates');\n }\n}", "title": "" }, { "docid": "c9d82b3fe1093f84bf6ce469f36601d5", "score": "0.6755952", "text": "function displayReviews(item) {\n const parent = document.querySelector('#reviews'),\n reviewContainer = document.createElement('section');\n\n reviewContainer.innerHTML = `\n <img src=\"${item.imageUrl}\" alt=\"Review by ${item.name}\">\n <h3>${item.name}</h3>\n <h4>${item.profession}<br>${item.place}</h4>\n <p>${item.review}</p>\n `;\n\n parent.appendChild(reviewContainer); \n}", "title": "" }, { "docid": "6ffccb56d23cf8dbd1c8a96a23fa8dfe", "score": "0.6663891", "text": "function Review() {\n return (\n <div className=\"container review\">\n <div className=\"completed-list\">\n List of completed tasks with links to see the work done on those tasks (e.g. notes, code, sent-email)\n </div>\n </div>\n );\n}", "title": "" }, { "docid": "5ee58fc7a4d191d23e806cdb6cd50fe8", "score": "0.6657358", "text": "function review_list(req, res, next) {\n console.log('List of reviews');\n\n Reviews.find({})\n .then(reviews => {\n res.send(reviews);\n })\n .catch(error => next(error));\n}", "title": "" }, { "docid": "9ce6f218106379e66ae3c4791b3c0751", "score": "0.65555674", "text": "function Review({ review }) {\n const {\n rating, date, summary, body, helpfulness, recommend, photos, response, reviewer_name,\n } = review;\n const [helpfulCounter, setHelpCounter] = useState(helpfulness);\n function incrementCounter() {\n setHelpCounter(helpfulCounter + 1);\n }\n const realDate = new Date(date).toDateString().split(\" \").slice(1)\n .join(\" \");\n return (\n <div id=\"review\" className={css.review}>\n <div id=\"rating\">\n <StarRating rating={rating} />\n </div>\n <div id=\"username\" align=\"right\"> </div>\n <div id=\"review-details\" align=\"right\">\n {reviewer_name}\n ,\n { realDate }\n </div>\n <div id=\"review-summary\" align=\"center\">\n <b>\n {summary}\n </b>\n </div>\n <Body text={body} photos={photos} />\n <br />\n <Response response={response} />\n <br />\n <RecommendProduct isRecommend={recommend} />\n <br />\n <Helpful helpfulCounter={helpfulCounter} incrementCounter={incrementCounter} />\n </div>\n );\n}", "title": "" }, { "docid": "68d1ac880b97b0d86ef080278901ea3e", "score": "0.65212053", "text": "async getReviews () {\n\t\tconst reviewIds = this.posts.reduce((reviewIds, post) => {\n\t\t\tif (post.reviewId) {\n\t\t\t\treviewIds.push(post.reviewId);\n\t\t\t}\n\t\t\treturn reviewIds;\n\t\t}, []);\n\t\tif (reviewIds.length === 0) {\n\t\t\tthis.reviews = [];\n\t\t\treturn;\n\t\t}\n\t\tthis.reviews = await this.api.data.reviews.getByIds(reviewIds);\n\t}", "title": "" }, { "docid": "0e4d0fb96d582c571904daacabaf2e19", "score": "0.65196466", "text": "function Review(userName,phoneNumber ,reviewText) {\n this.userName = userName;\n this.phoneNumber=phoneNumber;\n this.reviewText = reviewText;\n Review.allReviews.push(this);\n}", "title": "" }, { "docid": "279e9ede9fa9aaac639e85a2f97ec5d3", "score": "0.65133333", "text": "function rednerReviews(req) {\n console.log(req.param.id);\n const id = req.param.id;\n fetch(`/api/reviews/${id}`)\n .then((res) => res.json())\n .then((review) => {\n console.log(review);\n const mealreview = document.getElementById(\"reviews\");\n console.log(root);\n const ul = document.createElement(\"ul\");\n mealreview.appendChild(ul);\n // For the review ratings & filling the stars\n let starTotal = 5;\n let ratings;\n let sum = 0;\n let starPercentage;\n let starPercentageRounded;\n if (review.length > 1) {\n for (let i = 0; i < review.length; i++) {\n sum += review[i].numberOfStars;\n }\n ratings = sum / review.length;\n starPercentage = (ratings / starTotal) * 41.25;\n starPercentageRounded = `${Math.round(starPercentage)}%`;\n } else {\n ratings = review[0].stars;\n starPercentage = (ratings / starTotal) * 41.25;\n starPercentageRounded = `${Math.round(starPercentage)}%`;\n }\n for (let i = 0; i < review.length; i++) {\n ul.innerHTML = `<div class=\"review\">\n <div class=\"card-body\" id=\"r1\">\n <h4> &#8212; Reviews &#8212; </h4>\n <h4 class=\"card-title\">${review[i].title}</h4>\n <div class=\"stars-outer\">\n <div class=\"stars-inner\" style=\"width: ${starPercentageRounded}\"></div>\n \n <p class=\"card-text\"> ${review[i].description}</p>\n <p class=\"card-text\"> ${new Date(\n review[i].created_date\n ).toLocaleString()}</p>\n </div>\n </div>`;\n }\n });\n}", "title": "" }, { "docid": "e5e817a14f66c57761699d3b2f5b2a41", "score": "0.6505124", "text": "function loadReviews(reviews){\n\tfor (var i=0; i<reviews.length; i++){\n\t\tif (i % 2==0){\n\t\t\tdisplayReview(reviews[i].REVIEW_TITLE,reviews[i].REVIEW_CONTENT,reviews[i].REVIEW_STARS, true);\n\t\t}\n\t\telse{\n\t\t\tdisplayReview(reviews[i].REVIEW_TITLE,reviews[i].REVIEW_CONTENT,reviews[i].REVIEW_STARS, false);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "524279db392eaa0f51fd861ad575bec3", "score": "0.6492585", "text": "getReview(data) {\n return instance.get(backendAddr+'/tutorial/review/'+data)\n }", "title": "" }, { "docid": "1df4141ee48149cf3add65808649db6a", "score": "0.6461938", "text": "function getReviews(id) {\n $.get(\"/api/review/\" + id, function(data) {\n renderReviews(data);\n listenDeleteRev(data);\n })\n }", "title": "" }, { "docid": "dd588fedd02aaa3a7a006748d1688a6c", "score": "0.6446883", "text": "function Reviews() {\n // menggunakan data dummy JSON\n const users = [\n {\n \"id\":1,\n \"name\":\"Rayhan Original\",\n \"image\":\"https://images.pexels.com/photos/220453/pexels-photo-220453.jpeg?cs=srgb&dl=pexels-pixabay-220453.jpg&fm=jpg\",\n \"review\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\",\n },\n {\n \"id\":2,\n \"name\":\"Rayhan 1\",\n \"image\":\"https://images.pexels.com/photos/1080213/pexels-photo-1080213.jpeg?cs=srgb&dl=pexels-jo%C3%A3o-jesus-1080213.jpg&fm=jpg\",\n \"review\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\",\n },\n {\n \"id\":3,\n \"name\":\"Rayhan 2\",\n \"image\":\"https://images.pexels.com/photos/3763188/pexels-photo-3763188.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500\",\n \"review\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\",\n },\n ]\n \n // pada proses iterasi jmapping harus diberikan keyprops agar bisa digubakan untuk melempar ke views lain\n const listReview = users.map((user) => \n <div key={user.id} className=\"Item\">\n <img src={user.image}/>\n <div className=\"User\">\n <h3>{user.name}</h3>\n <p>{user.review}</p>\n </div>\n </div>\n )\n \n return (\n <div className=\"Review-box\">\n <h2>Reviews</h2>\n {listReview} \n </div>\n )\n }", "title": "" }, { "docid": "d4ff43bca51d375bfcff221310cfe852", "score": "0.6425606", "text": "function getReviews(userid) {\n \n fetch(urlGetReviews, {\n method: \"POST\",\n headers: {\n 'Accept': 'application/json',\n 'content-type': 'application/json',\n 'Authorization': ('Bearer ' + JSON.parse(localStorage.token))\n },\n body: JSON.stringify({\n \"idUser\": userid\n })\n }).then(function (res) {\n if (res.ok) {\n resetTokenProfile();\n res.json().then(function (data) {\n console.log(data);\n var numReviews = Object.keys(data.response).length;\n var json = data.response;\n\n // check if any reviews are available\n if (numReviews == 0) {\n var rlist = document.getElementById('reviewsList');\n /* review div */\n var reviewDiv = document.createElement('div');\n reviewDiv.setAttribute('class', 'review card bg-secondary');\n reviewDiv.style = \"margin: 5%;\";\n rlist.appendChild(reviewDiv);\n\n /* Card Body div */\n var cardBodyDiv = document.createElement('div');\n cardBodyDiv.setAttribute('class', 'card-body');\n reviewDiv.appendChild(cardBodyDiv);\n\n /* No reviews available */\n var noneP = document.createElement('p');\n noneP.setAttribute('class', 'card-text');\n document.getElementById(\"sortReviewsDiv\").style.display = \"none\"; // hide sort reviews\n if (otherusername) {\n noneP.innerHTML = otherusername + \" has not been reviewed yet! Add your review?\";\n }\n else {\n noneP.innerHTML = \"No one has reviewed you yet!\";\n }\n\n noneP.style = \"text-align:center;\";\n cardBodyDiv.appendChild(noneP);\n }\n else {\n document.getElementById(\"sortReviewsDiv\").style.display = \"block\"; // show sort reviews\n for (i = 0; i < numReviews; i++) {\n createReviewCard(json[i].idReviews, json[i].Rating, json[i].Review, json[i].byUserName, json[i].DatePosted, json[i].byUserID);\n }\n }\n }.bind(this));\n }\n else {\n alert(\"Error: Getting reviews for this user unsuccessful!\");\n if (res.status == '403') {\n window.location.href = \"./inactive.html\";\n }\n res.json().then(function (data) {\n console.log(data.message);\n }.bind(this));\n }\n }).catch(function (err) {\n alert(\"Error: No internet connection!\");\n console.log(err.message + \": No Internet Connection\");\n });\n}", "title": "" }, { "docid": "c1ca22d942638b6e01c2f2a4c49bea2c", "score": "0.641833", "text": "render () {\n\n const product = this.props.product;\n const nums = ['1','2','3','4','5','6','7','8','9','10'];\n\n return (\n <div>\n <form onSubmit={this.handleSubmit}>\n <label>{product.name}</label>\n <br />\n <label>Rating: {product.averageRating}</label>\n <img src={product.photo} />\n\n <button type='submit' value='ORDER xD' />\n <select onChange={handleQuantityChange} required>\n <option>Choose a Quantity XDDD</option>\n {\n nums.map(n => (<option key={n} value={n}>n</option>))\n }\n </select>\n </form>\n <div>\n {\n this.props.reviews && this.props.reviews.map(review => (\n <div key={product.reviews.id}>\n <label>{product.reviews.title}</label>\n <label>Rating: {reviews.rating}</label>\n <Link to='/user/:userId'>reviews.user.fullname</Link>\n <pre>{product.reviews.content}</pre>\n </div>\n ))\n }\n </div>\n </div>\n )\n }", "title": "" }, { "docid": "eefb4b84f64455590e615964a39fa8c3", "score": "0.6411046", "text": "function getReviews(){\n // Get last three reviews of current shop\n var page = 0;\n ShopService\n .findReviews($scope.shopId, page, $scope.nbLastReviews)\n .then(function(reviews){\n $scope.reviews = reviews;\n if($scope.reviews.length !== 0){\n $scope.shop = $scope.reviews[0].shop;\n }\n }, function(err){\n //console.debug(err);\n //TODO: Manage Error\n });\n }", "title": "" }, { "docid": "76011d3ac73249b01edd835eee471670", "score": "0.6407668", "text": "static fetchReviews() {\n return reviews.length ? reviews: 'ro reviews added yet';\n }", "title": "" }, { "docid": "acc4ff374ba28e40ec0adf7a086b5650", "score": "0.6405991", "text": "componentDidMount() {\n this.props.fetchReviews(this.props.match.params.listingId);\n }", "title": "" }, { "docid": "12370d4abff92bd057fa5753ccb00a4b", "score": "0.6381664", "text": "function getCountReviews () {\n return reviews.length;\n}", "title": "" }, { "docid": "64e9198ab62434444cf97e2c17f92ef0", "score": "0.6349432", "text": "function render() {\n // empty existing posts from view\n $('#reviewTarget').empty();\n\n // pass `allReviews` into the template function\n var reviewsHtml = getAllReviewsHtml(allReviews);\n\n // append reviews to landingpage's html\n $('#reviewTarget').append(reviewsHtml);\n\n function getReviewsHtml(review) {\n return `<hr> <p><b>${review.description}</b> <button type=\"button\" name=\"button\" class=\"deleteBtn btn btn-danger pull-right\" data-id=${review._id}>Delete</button></p>`;\n }\n\n function getAllReviewsHtml(reviews) {\n return reviews.map(review => getReviewsHtml(review)).join(\"\");\n };\n}", "title": "" }, { "docid": "d3c8b399f9e08679ae89dcf768a1e7e6", "score": "0.6349333", "text": "function renderList(){\n\t\n\t//Check if list already has items in it\n\tvar count = $.mainSection.items.length;\n\t\n\t//if true, remove items\n\tif(count > 0){\n\t\t$.mainSection.deleteItemsAt(0, count);\n\t}\n\t\n\t//get reviews from database\n\tReviews = db.selectReviews();\n\tvar nameList = [];\n\t\n\t//add reviews to the list\n\tif(Reviews.length > 0){\n\t\t\n\t\t/**\n\t\t * Bind list elements to the listTemplate\n\t\t */\n\t\tfor (var i = 0; i < Reviews.length; i++) {\n\t\t\tnameList.push(\n\t\t\t\t{\n\t\t\t\t\theader: {text: Reviews[i].header},\n\t\t\t\t\tdescription: {text: Reviews[i].desc} ,\t\n\t\t\t\t\tproperties : {\n\t\t\t\t\t\tcolor: \"black\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t\t\n\t\t$.mainSection.appendItems(nameList);\n\t}\n\telse {\n\t\tconsole.error(\"List Render: No reviews available!\");\n\t}\n}", "title": "" }, { "docid": "6cd69aa1e0c5068ef41908d3d8a0adfb", "score": "0.6344898", "text": "function renderReview(review){\n console.log(review)\n const li = document.createElement('li')\n li.dataset.id = review.id\n\n const p = document.createElement('p')\n\n p.innerText = review.attributes.content\n\n const deleteBtn = document.createElement(\"button\")\n deleteBtn.innerText = \"delete\"\n deleteBtn.addEventListener(\"click\", deleteReview)\n\n const commentForm = document.createElement('form')\n commentForm.innerHTML += `<input type=\"text\" id=\"commentInput\"><input type=\"submit\">`\n commentForm.addEventListener(\"submit\", renderComment)\n \n const commentList = document.createElement('ul')\n review.attributes.comments.forEach(comment => {\n const commentLi = document.createElement('li')\n commentLi.innerText = comment.content\n commentList.appendChild(commentLi)\n })\n\n li.append(p, deleteBtn, commentForm, commentList)\n reviewList.appendChild(li)\n\n reviewForm.reset()\n}", "title": "" }, { "docid": "9371d2b2797d7afa9687ff10cd47c96b", "score": "0.6341763", "text": "function printReviews(reviews, leftColumnNode, rightColumnNode) {\n reviews.forEach(function (review, key) {\n const isEven = key % 2 === 0;\n const node = isEven ? leftColumnNode : rightColumnNode;\n if (key < VISIBLE_REVIEWS_COUNT) {\n node.innerHTML += `<li class=\"review-item\">\n <div class=\"review-header\">\n <img src=\"./img/customerPhotos/` + review.photo + `\"/>\n <span class=\"full-name\">${review.fullName}</span>\n </div>\n <div class=\"review-body\">${review.text}</div>\n </li>`;\n }\n });\n }", "title": "" }, { "docid": "bd3bccc597869fb480592510a8b88566", "score": "0.63347924", "text": "function ReviewDetail(props){\n return(\n <div>\n <br></br>\n <p>{props.review.reviewName} - {props.review.peakName} </p>\n <p>{props.review.review}</p>\n <button onClick={props.openEditReview.bind(null, props.review)}>Edit</button>\n <button onClick={props.deleteReview.bind(null, props.review._id)}>Delete</button>\n </div>\n )\n}", "title": "" }, { "docid": "70f430361aeb480ade584dd6ec89997c", "score": "0.63337266", "text": "function displayReviews() {\n /*\n Using a html template to create the elements rather than document.createElement()\n */\n // if the html content contains a template, use it\n if ('content' in document.createElement('template')) {\n reviews.forEach((review) => { // loop each element in reviews array\n displayReview(review); // call the displayReviews function with the current element \n });\n } else { // if the html does not contain a template, issue a message\n console.error('Your browser does not support templates');\n }\n}", "title": "" }, { "docid": "343af2a987c9f61ae2df93286b647946", "score": "0.6327445", "text": "function fillReviewsHTML(reviews = self.restaurant.reviews) {\n const container = document.getElementById('reviews-container');;\n\n if (!reviews) {\n const noReviews = document.createElement('p');\n noReviews.innerHTML = 'No reviews yet!';\n container.appendChild(noReviews);\n return;\n }\n\n const ul = document.getElementById('reviews-list');\n ul.innerHTML = '';\n reviews.forEach(review => ul.appendChild(createReviewHTML(review)));\n container.appendChild(ul);\n}", "title": "" }, { "docid": "8ea2fb105be41751868e4573bb205be2", "score": "0.631954", "text": "function fillReviewsHTML(reviews = self.restaurant.reviews) {\n const container = document.getElementById('reviews-container');\n const contentContainer = document.createElement('div');\n contentContainer.className = 'reviews-content-container';\n const title = document.createElement('h2');\n title.innerHTML = 'Reviews';\n contentContainer.appendChild(title);\n\n if (!reviews) {\n const noReviews = document.createElement('p');\n noReviews.innerHTML = 'No reviews yet!';\n contentContainer.appendChild(noReviews);\n return;\n }\n const ul = document.createElement('ul');\n ul.id = 'reviews-list';\n\n reviews.forEach(review => {\n ul.appendChild(createReviewHTML(review));\n });\n contentContainer.appendChild(ul);\n\n container.appendChild(contentContainer);\n}", "title": "" }, { "docid": "82521de87821670b848a0b9b251f5f48", "score": "0.627873", "text": "function Reviews({ rating, reviews_count }) {\n return (\n <div className=\"reviews\">\n <img id=\"star-sym\" src=\"https://ghrsea12-fec.s3-us-west-2.amazonaws.com/sample/star.png\" alt=\"\" />\n <span className=\"rating-scored\" id=\"stars\">\n {` ${rating}`}\n </span>\n <span className=\"reviewsCount\" id=\"numReviews\">\n {` (${reviews_count})`}\n </span>\n </div>\n );\n}", "title": "" }, { "docid": "d23609654bb413ad0c422a75cdfac24d", "score": "0.62637347", "text": "componentWillMount() {\n this.getReview()\n }", "title": "" }, { "docid": "374a3757a2de06ac2d8a5ce57ffc513e", "score": "0.6259356", "text": "renderPage() {\n const filter = this.props.reviews.filter(review => review.movieId === this.props.movie._id);\n return (\n <Grid container columns={2}>\n <Grid.Column width={4}>\n <Grid.Column>\n <Card>\n <Card.Content>\n <Card.Header>{this.props.movie.title}</Card.Header>\n <br/>\n <Card.Description>\n <strong>Synopsis:</strong> {this.props.movie.synopsis}\n </Card.Description>\n <br/>\n </Card.Content>\n </Card>\n </Grid.Column>\n </Grid.Column>\n\n <Grid.Column width={10}>\n <AddReview movieId={this.props.movie._id}/>\n <Card fluid>\n <Card.Content>\n <Card.Header>Reviews for {this.props.movie.title}</Card.Header>\n </Card.Content>\n <Card.Content>\n <Feed>\n {filter.map((review, index) => <Review key={index} review={review}/>)}\n </Feed>\n </Card.Content>\n </Card>\n </Grid.Column>\n </Grid>\n );\n }", "title": "" }, { "docid": "9536201ca0d971a3135e1b42e30b6fcb", "score": "0.62179756", "text": "addReview() {\n // Creating elements and adding text from review object\n\n // Main review element\n let revEl = document.createElement(\"article\"); \n revEl.classList.add(\"review\");\n \n // Title\n let titEl = document.createElement(\"h1\"); // Creating Element\n titEl.innerText = this.title; // Importing data from review element\n revEl.appendChild(titEl); // Adding element to parent review element\n\n // Author & Rating\n let namEl = document.createElement(\"h4\"); \n namEl.innerText = `Reviewed ${this.rating} / 5 Nuggets by ${this.name}!`;\n revEl.appendChild(namEl);\n\n // Comments\n let parEl = document.createElement(\"p\");\n parEl.innerText = this.comments;\n revEl.appendChild(parEl);\n\n // Adding review element to the review list\n document.getElementById(\"reviews\").appendChild(revEl);\n }", "title": "" }, { "docid": "6b9e501abebefb5c9646a7400fa10d55", "score": "0.6189718", "text": "function processReviews(data, textStats, XMLHttpRequest){\n var rev = data.reviews;\n for (var i = 0; i < rev.length; i++) {\n var d = new Date(rev[i].time_created * 1000);\n rev[i].date = d.getMonth() + 1 + \"/\" + d.getDate() + \"/\" + d.getFullYear();\n rev[i].bizid = data.id\n }\n $.tmpl(settings.templateName, rev).appendTo($this);\n }", "title": "" }, { "docid": "3e9f4dbbcc89c38a52867ac51861ca7c", "score": "0.61895984", "text": "function showReviews(response) {\n \n $(\"reviews\").innerHTML = \"\";\n for (var i = 0; i < response.length; i++) {\n var newTitle = document.createElement(\"h3\");\n var newScore = document.createElement(\"span\");\n newScore.innerHTML = response[i].score;\n newTitle.innerHTML = response[i].name + \" \";\n newTitle.appendChild(newScore);\n \n var newText = document.createElement(\"p\");\n newText.innerHTML = response[i].text;\n \n $(\"reviews\").appendChild(newTitle);\n $(\"reviews\").appendChild(newText);\n }\n }", "title": "" }, { "docid": "f2de37e6d507e6b370a0cb0320334c5c", "score": "0.6186511", "text": "function makeReviews(data) {\n let avg_rating = 0;\n\n // If no data in table\n if (data.length === 0) {\n $(\".wait-until-load\").css(\"visibility\", \"visible\");\n $(\".spinner-border\").hide();\n $(\"#avg-rating\").text(0);\n return;\n }\n\n // Loop through all the reviews received\n data.forEach((element, index) => {\n avg_rating += element.rating;\n let $div = $(\"<div>\", {\n class: \"single-review text-left d-flex align-items-center\",\n });\n // Call fieldset function to make <fieldset> element\n let fieldset = makeFieldset(index + 1);\n $div.append(fieldset);\n\n let $review_text = $(\"<h6>\");\n $review_text.text(element.rating + \" out of 5, \" + element.review);\n $div.append($review_text);\n\n $(\".reviews\").append($div);\n\n let rating_id = \"#rating\" + element.rating * 2 + \"-\" + (index + 1);\n $(rating_id).attr(\"checked\", true);\n });\n\n $(\".wait-until-load\").css(\"visibility\", \"visible\");\n $(\".spinner-border\").hide();\n\n // Calculate and set avg. rating for the product\n avg_rating = (avg_rating / data.length).toFixed(1);\n $(\"#avg-rating\").text(avg_rating);\n let avg_stars = Math.round(avg_rating * 2);\n $(\"#rating\" + avg_stars).attr(\"checked\", true);\n}", "title": "" }, { "docid": "b204c1320329cb761e218d18221eda37", "score": "0.61752135", "text": "async reviewList() {\n const {appid, openid} = this.ctx.wxuser;\n let {start, stop} = this.ctx.query;\n start = start || 0;\n stop = stop || 64;\n\n const data = await this.service.register.reviewList({start, stop, openid, appid});\n this.ctx.body = {\n success: !!data,\n data,\n };\n }", "title": "" }, { "docid": "82e114a52e4169d50a1d6396f15ca342", "score": "0.6141312", "text": "async function getReviews() {\n const response = await fetch('/data');\n console.log('Fetching data from server.');\n const reviews = await response.json();\n console.log(reviews);\n const reviewsElement = document.getElementById('reviews-container'); //where I would like to post the reviews that are fetched\n console.log(reviewsElement);\n //looping through reviews left\n reviews.forEach((review) => {\n reviewsElement.appendChild(createReviewElement(review));\n });\n}", "title": "" }, { "docid": "f8774a7ae9721633b58462cdd84f5bb6", "score": "0.6140815", "text": "function addReviews(reviews) {\n var template;\n if (reviews.length === 0) {\n $('#getMore').hide();\n $('#foot').append(\"<h6 class='info-block'>Nothing here yet! Add a comment to get the discussion going!</h6>\");\n return;\n }\n else if (reviews.length < 10) {\n $('#foot').hide();\n }\n\n for (var review in reviews) {\n if (!reviews.hasOwnProperty(review))\n continue;\n\n if(reviews[review].voted)\n updateItemsWithPolarity.push({id: reviews[review].id, polarity: reviews[review].voted});\n\n template = fillReviewLevel1Template(reviews[review]);\n\n if (reviews[review].children) {\n for (var child in reviews[review].children) {\n if (!reviews[review].children.hasOwnProperty(child))\n continue;\n\n if (reviews[review].children[child].voted)\n updateItemsWithPolarity.push({id: reviews[review].children[child].id,\n polarity: reviews[review].children[child].voted});\n\n template += fillCommentLevel2Template(comments[comment].children[child]);\n }\n }\n\n $('#reviews').append(template);\n }\n}", "title": "" }, { "docid": "931ed73e517534ae815b0b96db3db247", "score": "0.61380464", "text": "function get_reviews(request, response) {\n /***********************************\n * GET_REVIEWS\n * args: request: The request sent to the server\n * response: The response to be sent back\n * returns: Nothing\n * Desc: This function extracts the course_id from request and sends\n * it to get_reviews_from_db. In the case that get_reviews_from_db\n * returns an error, we will send a 500 error. Otherwise, we put the\n * result into a JSON and send it using response.\n * *********************************/\n let course_id = request.query.course_id;\n \n get_reviews_from_db(course_id, function(error, result) {\n if (error || result == null) {\n response.status(500).json({success: false, data: error});\n } else {\n response.status(200).json(result);\n }\n });\n}", "title": "" }, { "docid": "03adefdf479747c2d22e29dd404c2e2e", "score": "0.6127219", "text": "function retrieveReviews() {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', '/api/reviews');\n xhr.setRequestHeader(\"Content-Type\", \"text/xml\");\n xhr.onreadystatechange = function () {\n if (xhr.readyState == 4) {\n if (xhr.status == 200) {\n var data = xhr.responseText;\n\t\t\t\t\t\t\t\tvar jsonResponse = JSON.parse(data);\n\t\t\t\t\t\t\t\tloadReviews(jsonResponse);\n }\n }\n };\n xhr.send(null);\n}", "title": "" }, { "docid": "7f4d135df0718466eed3444d4924f182", "score": "0.61235803", "text": "render() { \n const { reviews } = this.state;\n const ReviewsList = reviews.map(item => \n <Review \n key={Math.random()} \n data={item}\n icon={this.props.icon}\n />)\n return ( \n <>\n <div className=\"reviews__list\">\n {ReviewsList}\n </div>\n </>\n );\n }", "title": "" }, { "docid": "b68ca6f92c18aa672f5455bf937da56a", "score": "0.6118608", "text": "function populateReviews(reviews) {\n // loop over the data to append every review to the page\n for(review of reviews) {\n // create element to be append to the page\n let post = document.createElement(\"div\")\n post.className = \"reviewContent\";\n post.innerHTML = `<div class=\"innerReviewContent\">\n <h4>by: ${review.user.username} &emsp; rating: ${review.rating}</h4>\n <hr>\n <p>${review.content}</p>\n </div>\n <form action=\"/films/title/${review.film.title}/${review.reviewId}\" method=\"GET\">\n <input type=\"submit\" value=\"Comments\"/>\n </form>`;\n // append to the static div predefined in the HTML page\n document.getElementById(\"filmReviews\").append(post);\n }\n}", "title": "" }, { "docid": "0464b646118c881b317010db874449d3", "score": "0.61176217", "text": "function showReviews(reviewsResponse)\n{\n\treviewsResponse= JSON.parse(reviewsResponse);\n\ttry\n\t{\n\t\tif ( typeof(reviewsResponse.contextResponses[0]['contextElement'])==='undefined' || (typeof(reviewsResponse.contextResponses)==='undefined') )\n\t\t{\n\t\t\tdocument.getElementById(\"pop_content\").innerHTML =\"<h2>No reviews are available.</h2>\";\n\t\t\topenPopUpWindow();\n \t return;\n\t\t}\n\t}catch(error)\n\t{\n\t\tdocument.getElementById(\"pop_content\").innerHTML =\"<h2>No reviews are available.</h2>\";\n\t\t\topenPopUpWindow();\n\t}\n\t//list all reviews\n\treviewsHtml='<div class=\"reviewList\">\\n';\n\tfor (j=0, lim=reviewsResponse['contextResponses'].length; j < lim; j++)\n\t{\n\t\treview= reviewsResponse['contextResponses'][j]['contextElement'];\n\t\tfor (i=0, len= review['attributes'].length; i<len;i++)\n\t\t{\n\t\t\tif(\"reviewBody\" == review['attributes'][i]['name'])\n\t\t\t\treviewBody=review['attributes'][i]['value']\n\t\t\tif(\"ratingValue\" == review['attributes'][i]['name'])\n\t\t\t\tratingValue=review['attributes'][i]['value']\n\t\t}\n\t\treviewsHtml= reviewsHtml+ '<div class=\"reviewElement\">\\n<p>\\n<span class=\"rating_label\">Rating: </span> <span class=\"rating_value\">' +\n\t\t\tratingValue+\n\t\t\t'</span>\\n</p>\\n<p>\\n<span class=\"review_label\">Review text</spam>\\n</p>\\n<p class=\"review\">'+reviewBody+'</p>\\n</div>';\n\t}\n\treviewsHtml= reviewsHtml+'\\n</div>';\n\n\t\n\t//render the reviews\n\tdocument.getElementById(\"pop_content\").innerHTML =reviewsHtml;\n\t\n\topenPopUpWindow();\n\n}", "title": "" }, { "docid": "6057814776c4ec746fab005b0f3c220b", "score": "0.61132145", "text": "async function listReviews(req, res, next){\n const {movieId} = req.params;\n const reviews = await service.listReviews(movieId)\n res.json({data: reviews});\n}", "title": "" }, { "docid": "42048407d51f48ea084237a9d561e61d", "score": "0.6106097", "text": "function fillReviewsHTML(reviews = self.restaurant.reviews, id = self.restaurant.id) {\n\tconst container = document.getElementById('reviews-container');\n\tif (!reviews) {\n\t\tconst noReviews = document.createElement('p');\n\t\tnoReviews.innerHTML = 'No reviews yet!';\n\t\tcontainer.appendChild(noReviews);\n\t\treturn;\n\t}\n\tconst button = document.getElementById('add-comment');\n\tbutton.setAttribute('restaurant-id', id);\n\tbutton.addEventListener('click', submitReview, false);\n\tconst ul = document.getElementById('reviews-list');\n\treviews.forEach(review => {\n\t\tul.appendChild(createReviewHTML(review));\n\t});\n\tcontainer.appendChild(ul);\n}", "title": "" }, { "docid": "e158e42b109aa5c3a0a20e19f6eb472f", "score": "0.6104746", "text": "function createReviewHTML(review) {\n const li = document.createElement('li');\n li.classList.add('card');\n const name = document.createElement('p');\n name.innerHTML = review.name !== '' ? review.name : 'Anonymous';\n li.appendChild(name);\n\n const date = document.createElement('p');\n date.innerHTML = new Date(review.updatedAt).toDateString();\n li.appendChild(date);\n\n const rating = document.createElement('p');\n rating.innerHTML = `Rating: ${review.rating}`;\n li.appendChild(rating);\n\n const comments = document.createElement('p');\n comments.innerHTML = review.comments;\n li.appendChild(comments);\n\n return li;\n}", "title": "" }, { "docid": "84e852f15792b8f4105d5a95fce9c5a0", "score": "0.60959494", "text": "function show(book) {\r\n const item = reviews[book];\r\n img.src = item.img;\r\n author.textContent = item.name;\r\n info.textContent = item.text;\r\n}", "title": "" }, { "docid": "39d495996fbd1d3a2ad6051fb1d2c6c0", "score": "0.60954094", "text": "function getIdReviews() {\n\tfetch(url + \"prodId\", {method:\"GET\"})\n\t.then(function(response){\n\t\tconsole.log(response);\n\t\tresponse.json().then(function(data){\n\t\t\tif (data !== 0) {\n\t\t\t\tproductIdReview = data[0];\n\t\t\t\tgetProductsFromJSONById(data[0]);\n\t\t\t}\n\t\t})\n\t})\n}", "title": "" }, { "docid": "d25279343d574011b412fece1a5e085b", "score": "0.60912174", "text": "function loadReviews() {\n\t\tvar reviewSpace = document.getElementById('reviews');\n\t\treviewSpace.innerHTML = this.responseText;\n\t\t// this goes here as it is the last thing to load\n\t\tdocument.getElementById('singlebook').style.display = 'block';\n\t}", "title": "" }, { "docid": "682eb82237c42364f76317528fa7095e", "score": "0.6076051", "text": "function createReviewHTML(review){\n\tconst li = document.createElement('li');\n\tconst name = document.createElement('p');\n\tname.innerHTML = review.name;\n\tli.appendChild(name);\n\n\tconst date = document.createElement('p');\n\t//const createdDate = new Date(review.createdAt);\n\tdate.innerHTML = new Date(review.createdAt).toLocaleDateString();\n\tli.appendChild(date);\n\n\tconst rating = document.createElement('p');\n\trating.innerHTML = `Rating: ${review.rating}`;\n\tli.appendChild(rating);\n\n\tconst comments = document.createElement('p');\n\tcomments.className = 'review-comments';\n\tcomments.innerHTML = review.comments;\n\tli.appendChild(comments);\n\n\treturn li;\n}", "title": "" }, { "docid": "0a0c91d6e7ffe8e3ef9ce47d13a4bdf0", "score": "0.6057233", "text": "function getReview(req, res) {\n\tdb.Place.Place.findOne({_id: req.params.place_id}, function(err, place) {\n\t\tif (err) throw err;\n\t\tplace.reviews.forEach(function(element) {\n\t\t\tif (element._id == req.params.review_id) {\n\t\t\t\tres.json(element);\n\t\t\t}\n\t\t});\n\t});\n}", "title": "" }, { "docid": "d2291bc276f344b5e1140b7b9bff66c6", "score": "0.60424244", "text": "function Review(props) {\n const { title, review, rating, createAt, avatarUser } = props.review;\n const createReview = new Date(createAt.seconds * 1000);\n\n return (\n <View style={styles.viewReview}>\n <View style={styles.viewImageAvatar}>\n <Avatar\n size=\"large\"\n rounded\n containerStyle={styles.imageAvatarUser}\n source={\n avatarUser\n ? { uri: avatarUser }\n : require(\"../../../assets/img/avatar-default.jpg\")\n }\n />\n </View>\n <View style={styles.viewInfo}>\n <Text style={styles.reviewTitle}>{title}</Text>\n <Text style={styles.reviewText}>{review}</Text>\n <Rating imageSize={15} startingValue={rating} readonly />\n <Text style={styles.reviewDate}>\n {createReview.getDate()}/{createReview.getMonth() + 1}/\n {createReview.getFullYear()} - {createReview.getHours()}:\n {createReview.getMinutes() < 10 ? \"0\" : \"\"}\n {createReview.getMinutes()}\n </Text>\n </View>\n </View>\n );\n}", "title": "" }, { "docid": "7f53f240c28e26767afe08213b953b1e", "score": "0.60164213", "text": "function getProductReviews(req, res, next) {\n getReviews(req, res, next).then((result) => {\n return res.status(200).json({result: result });\n }).catch((err) => {\n next(err);\n });\n}", "title": "" }, { "docid": "fa3adc697036e48b1ae7472b6ef17f01", "score": "0.6016369", "text": "function reviewSuccess(detailreviewresponse) {\n reviewarr = [];\n ProductDetailsScreen.Lblnoreviews.isVisible = false;\n if (detailreviewresponse !== null && detailreviewresponse.opstatus === 0) { \n if(detailreviewresponse.ListOfReviews.length > 0) {\n if (detailreviewresponse.Total > 0) {\n \tProductDetailsScreen.LblTotalReviews.text = \"Total reviews: \" + detailreviewresponse.Total;\n lastPage = Number(detailreviewresponse.TotalPages);\n if (firstPage == 1) {\n ProductDetailsScreen.PreviousButton.isVisible = false;\n } else {\n ProductDetailsScreen.PreviousButton.isVisible = true;\n ProductDetailsScreen.Totalpages.isVisible = true;\n }\n if (lastPage == 1) {\n ProductDetailsScreen.NextButton.isVisible = false;\n ProductDetailsScreen.Totalpages.isVisible = true;\n } else {\n if (firstPage === lastPage) {\n ProductDetailsScreen.NextButton.isVisible = false;\n ProductDetailsScreen.Totalpages.isVisible = true;\n } else if (lastPage === 0) {\n alert(\"Products not found\");\n ProductDetailsScreen.PreviousButton.isVisible = false;\n ProductDetailsScreen.NextButton.isVisible = false;\n ProductDetailsScreen.Totalpages.isVisible = false;\n \t } else {\n ProductDetailsScreen.NextButton.isVisible = true;\n ProductDetailsScreen.Totalpages.isVisible = true;\n }\n } \n }\n for(var i = 0; i < detailreviewresponse.ListOfReviews.length; i++) {\n var customerReview = Math.floor(detailreviewresponse.ListOfReviews[i].Rating);\n if (customerReview > 0 && customerReview <= 1) {\n starImages = \"ratings_star_1.png\";\n } else if (customerReview > 1 && customerReview <= 2){\n starImages = \"ratings_star_2.png\";\n } else if (customerReview > 2 && customerReview <= 3){\n starImages = \"ratings_star_3.png\";\n } else if (customerReview > 3 && customerReview <= 4){\n starImages = \"ratings_star_4.png\";\n } else if (customerReview > 4 ){\n starImages = \"ratings_star_5.png\";\n } else {\n starImages = \"\";\n }\n reviewobj = {\n LblComment: detailreviewresponse.ListOfReviews[i].Title,\n LblSubmittedBy: \"Submitted By: \" + detailreviewresponse.ListOfReviews[i].Name,\n ImgStarRating: starImages,\n LblDetailComment:detailreviewresponse.ListOfReviews[i].Comment\n };\n reviewarr.push(reviewobj);\n }\n if (firstPage == lastPage && firstPage == 1) {\n ProductDetailsScreen.Totalpages.text=\"Page 1\";\n } else {\n ProductDetailsScreen.Totalpages.text=\"Page\" + \" \" + firstPage + \" \" + \"of\" + \" \" + lastPage;\n }\n ProductDetailsScreen.SegmentReview.setData(reviewarr);\n kony.application.dismissLoadingScreen(); \n } else {\n kony.application.dismissLoadingScreen();\n ProductDetailsScreen.LblTotalReviews.text = \"\";\n ProductDetailsScreen.FlexImageUpArrow.isVisible = false;\n ProductDetailsScreen.Lblnoreviews.isVisible = true;\n }\n } else {\n kony.application.dismissLoadingScreen();\n alert(\"Failed ServiceCalls\");\n kony.ui.Alert({message: \"Failed ServiceCalls with opStatus \" + productlistresponse.opstatus,alertType:constants. ALERT_TYPE_ERROR, alertTitle:\"Composite Service\",yesLabel:\"OK\"}, {});\n }\n}", "title": "" }, { "docid": "8622379748ba257f7b4e7dc62661a861", "score": "0.60155535", "text": "render(){\n console.log(this.state.reviews)\n const navigation = this.props.navigation; // declaring the navigation constant\n if(this.state.isLoading){\n return(\n <View\n style={{\n flex: 1,\n flexDirection: 'column',\n justifyContent: 'center',\n alignItems: 'center',\n backgroundColor: '#41393E'\n }}>\n <Text style={{fontSize: 50, fontWeight: 'bold', color: '#C7E8F3'}}> Loading.... </Text>\n </View>\n );\n }else{\n return(\n <SafeAreaView style={ customStyle.container }>\n <Text style={ customStyle.titleText }> My Reviews </Text>\n <FlatList\n data={ this.state.reviews }\n renderItem={({item}) => (\n <View style={ customStyle.ratingTitleText }>\n <Text style={ customStyle.buttonText }>-------------------------------------------------</Text>\n <Text style={ customStyle.buttonText }> { item.review.review_id} </Text>\n <Text style={ customStyle.buttonText }> { item.location.location_name }, { item.location.location_town}</Text>\n <Text style={ customStyle.buttonText }> Overall Rating: { item.review.overall_rating }</Text>\n <Text style={ customStyle.buttonText }> Price Rating: { item.review.price_rating }</Text>\n <Text style={ customStyle.buttonText }> Quality Rating: { item.review.quality_rating }</Text>\n <Text style={ customStyle.buttonText }> Clenliness Rating: { item.review.clenliness_rating }</Text>\n <Text style={ customStyle.buttonText }> Review body: { item.review.review_body }</Text>\n <Text style={ customStyle.buttonText }> Number of likes: { item.review.likes }</Text>\n <Text style={ customStyle.buttonText }> Photo: </Text>\n <Image\n style={customStyle.logo}\n source={{uri: item.location.photo_path}}\n />\n <TouchableOpacity\n style={customStyle.like}\n onPress={() => {\n this.likeAReview()\n this.setState({\n loc_id: item.location.location_id,\n rev_id: item.review.review_id\n })\n }}>\n <Text style={ customStyle.likeFont}> Like!</Text>\n </TouchableOpacity>\n <TouchableOpacity\n style={customStyle.unLike}\n onPress={() => {\n this.unlikeAReview()\n this.setState({\n loc_id: item.location.location_id,\n rev_id: item.review.review_id\n })\n }}>\n <Text style={ customStyle.unlikeFont}> Unlike!</Text>\n </TouchableOpacity>\n <TouchableOpacity\n style={customStyle.button1}\n onPress={() =>{\n this.props.navigation.navigate(\"CameraScreen\", {\n review_id: item.review.review_id,\n location_id: item.location.location_id\n })\n }}>\n <Text style={ customStyle.touchOpacityEditInfo}> Add A Photo!</Text>\n </TouchableOpacity>\n <TouchableOpacity\n style={customStyle.button1}\n onPress={() =>{\n this.props.navigation.navigate(\"ViewPhotos\",{\n location_town: item.location.location_town,\n location_name: item.location.location_name,\n review_id: item.review.review_id,\n location_id: item.location.location_id,\n overall_rating: item.review.overall_rating ,\n price_rating: item.review.price_rating ,\n quality_rating: item.review.quality_rating ,\n clenliness_rating: item.review.clenliness_rating ,\n review_body: item.review.review_body\n })\n }}>\n <Text style={ customStyle.touchOpacityEditInfo}> View Photo for this Review</Text>\n </TouchableOpacity>\n <Text style={ customStyle.buttonText }>-------------------------------------------------</Text>\n <Text style={ customStyle.buttonText }>Not Satisfied? Update this Review!</Text>\n <TextInput\n placeholder=\"Overall Rating\"\n onChangeText={(overall_rating) => this.setState({overall_rating})}\n value={ this.state.overall_rating}\n backgroundColor=\"#C7E8F3\"\n style={{padding:5, borderWidth:1, margin:5, width: '100%'}}\n />\n <TextInput\n placeholder=\"Price Rating\"\n onChangeText={(price_rating) => this.setState({price_rating})}\n value={ this.state.price_rating}\n backgroundColor=\"#C7E8F3\"\n style={{padding:5, borderWidth:1, margin:5, width: '100%'}}\n />\n <TextInput\n placeholder=\"Quality Rating\"\n onChangeText={(quality_rating) => this.setState({quality_rating})}\n value={ this.state.quality_rating}\n backgroundColor=\"#C7E8F3\"\n style={{padding:5, borderWidth:1, margin:5, width: '100%'}}\n />\n <TextInput\n placeholder=\"clenliness Rating\"\n onChangeText={(clenliness_rating) => this.setState({clenliness_rating})}\n value={ this.state.clenliness_rating}\n backgroundColor=\"#C7E8F3\"\n style={{padding:5, borderWidth:1, margin:5 , width: '100%'}}\n />\n <TextInput\n placeholder=\" review_body\"\n onChangeText={(review_body) => this.setState({review_body})}\n value={ this.state.review_body}\n backgroundColor=\"#C7E8F3\"\n style={{padding:5, borderWidth:1, margin:5, width: '100%'}}\n />\n <TouchableOpacity\n style={customStyle.button1}\n onPress={() => {\n this.updateUserReview()\n ToastAndroid.show(\"Review updated\",ToastAndroid.SHORT);\n this.setState({\n loc_id: item.location.location_id,\n rev_id: item.review.review_id\n })\n }}>\n <Text style={customStyle.touchOpacityEditInfo}>Update!</Text>\n </TouchableOpacity>\n <TouchableOpacity\n style={customStyle.button1}\n onPress={() => {\n this.deleteReview()\n this.setState({\n loc_id: item.location.location_id,\n rev_id: item.review.review_id\n })\n }}>\n <Text style={customStyle.touchOpacityEditInfo}>Delete!</Text>\n </TouchableOpacity>\n </View>\n )}\n keyExtractor={(item, index) => index.toString()}\n />\n <TouchableOpacity\n style={customStyle.button1}\n onPress={() =>navigation.navigate('HomeScreen')}>\n <Text style={customStyle.buttonText}>Home</Text>\n </TouchableOpacity>\n <TouchableOpacity\n style={customStyle.button1}\n onPress={() =>navigation.goBack()}>\n <Text style={customStyle.buttonText}>Go Back</Text>\n </TouchableOpacity>\n </SafeAreaView>\n );\n }\n }", "title": "" }, { "docid": "9c1ef7e5abd77572678cb1ea8b5aea51", "score": "0.6010108", "text": "function addReview(review) {\n\t\tvar $container = $('<div class=\"review-container user\">').appendTo($reviewsList);\n\t\t//reviewer\n\t\tvar $reviewerContainer = $('<div class=\"reviewer-container\">').appendTo($container);\n\t\t$('<img class=\"reviewer-img\">').attr('src', review.reviewerSummary.thumbnailHash).appendTo($reviewerContainer);\n\t\tvar $reviewername = $('<div class=\"reviewer-name\">').appendTo($reviewerContainer);\n\t\t$('<a>').attr('href', urls.user + review.reviewerSummary.identifier).text(review.reviewerSummary.identifier).appendTo($reviewername);\n\t\t$('<div class=\"reviewer-rank\">').text(review.reviewerSummary.rank).appendTo($reviewerContainer);\n\t\t//data\n\t\t$detailsContainer = $('<div class=\"review-details-container\">').appendTo($container)\n\t\t//stars and +/-\n\t\tvar $stars = $('<div class=\"review-star-container\">').appendTo($detailsContainer);\n\t\tmakestars($stars, review.score);\n\t\tvar $agreeDisagree = $('<div class=\"agree-disagree-preview-container\">').appendTo($stars);\n\t\tif(review.agreeCount) $('<span class=\"agree-disagree-preview greentext\">').text(review.agreeCount + ' agree').appendTo($agreeDisagree);\n\t\tif(review.disagreeCount) $('<span class=\"agree-disagree-preview redtext\">').text(review.disagreeCount + ' disagree').appendTo($agreeDisagree);\n\t\t\n\t\t//justification\n\t\t$('<div class=\"review-justification\">')\n\t\t\t.html(review.justification.length > dgte.review.previewChars ? \n\t\t\t\t\treview.justification.substring(0, dgte.review.previewChars) + '...' \n\t\t\t\t\t: review.justification).appendTo($detailsContainer);\n\t\t\n\t\tvar $footer = $('<div class=\"review-footer\">').appendTo($container)\n\t\t$('<a>').attr('href', urls.review + review.id).text('Full review and comments').appendTo($footer);\n\t\t$('<div class=\"review-date\">').text(moment(review.time).format('LL')).appendTo($footer);\n\t}", "title": "" }, { "docid": "8168e3d334870728238ebd6222c78b54", "score": "0.60096747", "text": "function viewAllReviews() {\n\t\tvar pagination = $( '#pages' ).first(),\n\t\t\tpages = $( pagination ).find( 'a' ).not( '.next' ),\n\t\t\tlastPage = pages.last(),\n\t\t\tpageCount = 1,\n\t\t\turl = window.location.href.split( /[?#]/ )[ 0 ],\n\t\t\treview_filter = getParameterByName( 'filter' ),\n\t\t\tcontainer = $( '<div class=\"all-reviews_container\" id=\"all-reviews_container\"/>' ),\n\t\t\twrapper = $( '.all-reviews' ).append( container );\n\n\t\t// Only apply if on the first reviews page\n\t\tif ( pagination.children().first().hasClass( 'current' ) ) {\n\t\t\tvar button = $( '<button aria-controls=\"all-reviews_container\" aria-expanded=\"false\" class=\"button reviews-toggle-all\">All reviews</button>' );\n\n\t\t\t// Create a button for this filter\n\t\t\twrapper.prepend( button );\n\n\t\t\tbutton.click( function() {\n\t\t\t\t// If all reviews are shown\n\t\t\t\tif ( button.hasClass( 'reviews-toggle-all--visible' ) ) {\n\t\t\t\t\t// Hide the reviews\n\t\t\t\t\tcontainer.hide();\n\t\t\t\t\t// Removes the current class for navigation\n\t\t\t\t\tremove_current_class();\n\t\t\t\t\t// Fill the Duplicate IP variable with the original reviews\n\t\t\t\t\tnext_prev_objects = $( '.all-reviews > .review' );\n\t\t\t\t\t// Run the Duplicate IP script again\n\t\t\t\t\tcheck_duplicate_IPs();\n\n\t\t\t\t\tbutton\n\t\t\t\t\t\t.text( 'All reviews' )\n\t\t\t\t\t\t.removeClass( 'reviews-toggle-all--visible' )\n\t\t\t\t\t\t.attr( 'aria-expanded', false );\n\t\t\t\t}\n\t\t\t\t// If all reviews are hidden but the button has been pressed\n\t\t\t\telse if ( button.hasClass( 'reviews-toggle-all--toggled' ) ) {\n\t\t\t\t\t// Show the reviews\n\t\t\t\t\tcontainer.show();\n\n\t\t\t\t\t// Removes the current class for navigation\n\t\t\t\t\tremove_current_class();\n\n\t\t\t\t\t// Run the Duplicate IP script again\n\t\t\t\t\tcheck_duplicate_IPs();\n\n\t\t\t\t\tbutton\n\t\t\t\t\t\t.text( 'Fewer reviews' )\n\t\t\t\t\t\t.addClass( 'reviews-toggle-all--visible' )\n\t\t\t\t\t\t.attr( 'aria-expanded', true );\n\t\t\t\t} else {\n\t\t\t\t\tvar i = 1;\n\n\t\t\t\t\t// Update the button attributes accordingly\n\t\t\t\t\tbutton\n\t\t\t\t\t\t.text( 'Fewer reviews' )\n\t\t\t\t\t\t// also add a toggled classes to target\n\t\t\t\t\t\t.addClass( 'reviews-toggle-all--toggled reviews-toggle-all--visible' )\n\t\t\t\t\t\t.attr( 'aria-expanded', true );\n\n\t\t\t\t\t// Looping each review page\n\t\t\t\t\tfor ( pageCount; pageCount < lastPage.text(); pageCount++ ) {\n\t\t\t\t\t\tvar filter = '';\n\n\t\t\t\t\t\tif ( review_filter.length ) {\n\t\t\t\t\t\t\tfilter = \"?filter=\" + review_filter;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Grab the contents of each review page\n\n\t\t\t\t\t\t$.get( url + '/page/' + ( pageCount + 1 ) + filter, function( data ) {\n\t\t\t\t\t\t\tvar reviews = $( data ).find( '.review' );\n\n\t\t\t\t\t\t\t// Append the reviews to the current first page\n\t\t\t\t\t\t\tcontainer.append( reviews );\n\n\t\t\t\t\t\t\t// If the final set of reviews have been grabbed\n\t\t\t\t\t\t\tif ( i === parseInt( lastPage.text() ) - 1 ) {\n\t\t\t\t\t\t\t\t// Fill the Duplicate IP variable with the updated reviews\n\t\t\t\t\t\t\t\tnext_prev_objects = $( '.review' );\n\n\t\t\t\t\t\t\t\t// Run the Duplicate IP script again\n\t\t\t\t\t\t\t\tcheck_duplicate_IPs();\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t} );\n\n\t\t\t// Add some CSS\n\t\t\tstyles += '.reviews-toggle-all {margin-bottom: 2em;padding-right: 2em;position: relative;}.reviews-toggle-all:after {content: \"+\";position: absolute;right: 10px;top: 0;font-family: seriffont-size: 16px;}.reviews-toggle-all--visible:after {content: \"-\";}';\n\t\t}\n\t}", "title": "" }, { "docid": "44d2d9af744dc9d012b9fa8f10a398ea", "score": "0.5995536", "text": "function renderReviewsLegacy() {\n console.log(\"hello\");\n DrewsReviews.deployed().then(function(f) {\n f.reviewIndex.call().then(function(p) {\n var count;\n console.log(count);\n count = p;\n for (var i = 1; i <= count; i++) {\n f.getReview.call(i).then(function(q)\n {\n let node = $(\"<div id='review'>\");\n node.append(\"<div id='poster'><img style='width:150px' src=posters/\" + q[4] + \"></div>\");\n node.append(\"<div id='rightside'><span id='title'>\" + q[0] + \"<img src='images/\" + q[3].toNumber() + \".png'/></span><span id='reviewtext'>\" + q[1] + \"</span></div>\");\n $(\"#reviews\").append(node);\n });\n }\n });\n });\n}", "title": "" }, { "docid": "b247bbaa6fd2169f0071edd13656df78", "score": "0.5981659", "text": "getAllRestaurantReviews({ restaurantId }) {\n return CreateRemoteRequest(`${remoteDbBaseUrl}/reviews/?restaurant_id=${restaurantId}`);\n }", "title": "" }, { "docid": "8995f596cd4608fcf65e182159245a47", "score": "0.5979431", "text": "function GetAllItemReviews(req, res) {\n const { knex } = req.app.locals;\n knex\n .select('*')\n .from('item_reviews')\n .then(data => res.status(200).json(data))\n .catch(error => res.status(500).json(error))\n}", "title": "" }, { "docid": "c938c411e2fc9538edda2a15135dee97", "score": "0.59679884", "text": "getReviews() {\n return this.fs.collection('train-reviews').snapshotChanges();\n }", "title": "" }, { "docid": "f259e5b5ac94ab314a96a013a00b7fab", "score": "0.59634346", "text": "static get STORE_REVIEWS() {\n return 'reviews';\n }", "title": "" }, { "docid": "88934001c9fc433d428e6d9051ce9f64", "score": "0.5960633", "text": "function getUserReview() {\n let ReviewData = localStorage.getItem('reviews');\n let parsedData = JSON.parse(ReviewData);\n if (parsedData !== null) {\n Review.allReviews = parsedData;\n }\n}", "title": "" }, { "docid": "753acf0045239c57eaf5bde770c87e66", "score": "0.59378374", "text": "static getReviews(req, res, next) {\n reviews_model_1.Reviews.find({}).then(rev => {\n res.json({\n status: 'success',\n message: rev\n });\n return next();\n })\n .catch(next);\n }", "title": "" }, { "docid": "18dcf4209d8281f29cbe5a0e1b4e2366", "score": "0.59318256", "text": "static fetchReviewsById(restaurant_id) {\r\n return fetch(`http://localhost:1337/reviews/?restaurant_id=${restaurant_id}`).then((response) => {\r\n return response.json();\r\n }).then(data => {\r\n return data;\r\n })\r\n }", "title": "" }, { "docid": "f13652c07b0e63b1af837c61863437d2", "score": "0.5923336", "text": "function Reviews(props) {\n\n const style = css`\n text-align: center;\n margin: 25px auto;\n padding: 25px;\n display: flex;\n align-items: center;\n justify-content: center;\n min-width: 350px;\n max-width: 33%;\n border-radius: 0.5rem;\n box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);\n background: white;\n\n .review-text-container {\n }\n\n .review-status {\n font-style: italic;\n font-size: larger;\n color: #333;\n }\n\n .review-time {\n font-size: small;\n color: #555;\n }\n\n .review-user {\n font-weight: bold;\n font-size: large;\n display: block;\n }\n `;\n\n if (props.commentId !== 0) {\n return (\n <div className=\"review-container\" css={style}>\n <div className=\"review-text-container\">\n <p><span className=\"review-user\">{props.userName}</span><span className=\"review-time\">{formatTime(props.time)}</span></p>\n {props.status > 4 ? (\n <p className=\"review-status\">Created a new plan</p>\n ) : (\n <p className=\"review-status\">Updated status to {statusText(props.status)}</p>\n )}\n </div>\n </div>\n );\n } else {\n return (\n <div></div>\n );\n }\n\n}", "title": "" }, { "docid": "86aec64a6336950d38ab2511ce9e7937", "score": "0.5909998", "text": "function importRevs(){\n getReviews();\n}", "title": "" }, { "docid": "b38d2c922b33228a76d7db6491efb860", "score": "0.5901667", "text": "function showPerson() {\r\n const item = reviews[currentItem];\r\n img.src = item.img;\r\n author.textContent = item.name;\r\n job.textContent = item.job;\r\n info.textContent = item.text;\r\n\r\n}", "title": "" }, { "docid": "7933bcd3f65d16f08cd4bcd3455381f7", "score": "0.58987397", "text": "componentDidMount() {\n fetch('/api/reviews')\n .then(res => res.json())\n .then(reviews => this.setState({reviews}, () => console.log('Reviews fetched..',\n reviews)));\n }", "title": "" }, { "docid": "05eb06c3e3a4e7c95dfd046f8c4e48a3", "score": "0.5898589", "text": "function renderReviews(doc) {\n\tlet li = document.createElement('div');\n\tlet name = document.createElement('h2');\n\tlet location = document.createElement('em');\n\tlet boutt = document.createElement('p');\n\tlet food = document.createElement('p');\n\tlet reviews = document.createElement('p');\n\tlet ratings = document.createElement('p');\n\tlet authorName = document.createElement('p');\n\tlet email = document.createElement('p');\n\tlet phoneNumber = document.createElement('p');\n\tlet photo = document.createElement('img');\n\tlet cross = document.createElement('p');\n\tlet reviewWrite = document.createElement('b');\n\n\n\n\n\tli.setAttribute('data-id', doc.id);\n\tname.textContent = doc.data().Name;\n\tlocation.textContent =\"Location: \" + doc.data().loaction;\n\tboutt.textContent =\"It is a \" + doc.data().About + \".\";\n\tfood.textContent =\"We had tasted \" + doc.data().Food + \".\";\n\treviews.textContent = doc.data().Reviews;\n\tratings.textContent =\"Ratings: \" + doc.data().Ratings;\n\tauthorName.textContent =\"This is a personal opinion of \" + doc.data().AuthorName + \".\";\n\temail.textContent = doc.data().Email;\n\tphoneNumber.textContent = doc.data().Phone;\n\tphoto.setAttribute('src', doc.data().Photo);\n\tphoto.setAttribute(\"class\", \"testimoPics\");\n\tcross.textContent = 'DELETE';\n\treviewWrite.textContent =\"Review\"; \n\n\n\tli.appendChild(photo);\n\tli.appendChild(name);\n\tli.appendChild(location);\n\tli.appendChild(boutt);\n\tli.appendChild(food);\n\tli.appendChild(reviewWrite);\n\tli.appendChild(reviews);\n\tli.appendChild(ratings);\n\tli.appendChild(authorName);\n\tli.appendChild(email);\n\tli.appendChild(phoneNumber);\n\t\n\tli.appendChild(cross);\n\n\tReviews.appendChild(li);\n\n\t//delete data\n\tcross.addEventListener('click', (e) => {\n\t\te.stopPropagation();\n\t\tlet id = e.target.parentElement.getAttribute('data-id');\n\t\tdb.collection('Reviews').doc(id).delete();\n\t})\n\n}", "title": "" }, { "docid": "f1e9143706654675309b816706ed1525", "score": "0.58967793", "text": "getReviewById(data) {\n return instance.get(backendAddr+'/user/review/'+data)\n }", "title": "" }, { "docid": "a30ba22039e0478ebf53c5c001f76d85", "score": "0.58870304", "text": "async function fetchReviews(url) {\n let response = await fetch(url);\n const data = await response.json();\n const averageRating = getTotalRating(data);\n\n document.getElementById('averageRating').innerHTML = averageRating;\n document.getElementById('averageRatingStars').innerHTML =\n getStars(averageRating);\n document.getElementById('reviews').innerHTML = getHtmlReviews(data);\n}", "title": "" }, { "docid": "1fab2c93f811806d8cf97a2a9d017ebc", "score": "0.5879732", "text": "getReviews() {\n let userId = localStorage.getItem('userId');\n axios.get(`http://localhost:3000/api/Reviewers/${userId}/reviews`).then(response => {\n this.setState({ reviews: response.data }, () => {\n //console.log(this.state);\n })\n }).catch(err => console.log(err));\n }", "title": "" }, { "docid": "ac9fc2e93239c8eca99fa0019a174755", "score": "0.5876121", "text": "function showPerson(){\n\n const item=reviews[currentItem];\n img.src=item.img;\n author.textContent=item.name;\n job.textContent=item.job;\n info.textContent=item.text;\n\n\n\n}", "title": "" }, { "docid": "2de5979dfaeff1ffe42460d54d2ee3d0", "score": "0.5855805", "text": "async addReviews () {\n\t\tthis.approvedReviews = await this.api.data.reviews.getByQuery({\n\t\t\t$and: [\n\t\t\t\t{ approvedAt: { $gte: this.intervalBegin } },\n\t\t\t\t{ approvedAt: { $lt: this.intervalBegin + this.interval } }\n\t\t\t]\n\t\t}, { overrideHintRequired: true });\n\t\tconst allReviews = [...this.reviews, ...this.approvedReviews];\n\t\tallReviews.forEach(review => {\n\t\t\tif (this.stats.reviews.find(r => r.id === review.id)) { return; }\n\t\t\tconst reviewData = {\n\t\t\t\tid: review.id,\n\t\t\t\tteamId: review.teamId,\n\t\t\t\tcreatedAt: review.createdAt\n\t\t\t};\n\t\t\tif (review.approvedAt) {\n\t\t\t\treviewData.approvedAt = review.approvedAt;\n\t\t\t}\n\t\t\tthis.stats.reviews.push(reviewData);\n\t\t});\n\t}", "title": "" }, { "docid": "d7918794d51bdf170c6ed284bea0bff7", "score": "0.5843318", "text": "static get REVIEWS_OBJECT_STORE() {\r\n return 'reviews';\r\n }", "title": "" }, { "docid": "c74c1722c87b1f50eb9bca698f86e2ed", "score": "0.58367634", "text": "function autopopulate(next) {\n this.populate('reviews');\n next();\n}", "title": "" }, { "docid": "b3046984237bb545d65faa62f61cea67", "score": "0.58360815", "text": "displayResataurants() {\n const restaurants = [];\n this.props.restaurantList.forEach((restaurant, i) => {\n restaurants.push(\n <Restaurant \n key={i}\n id={restaurant.id}\n latitude={restaurant.latitude}\n longitude={restaurant.longitude}\n name={restaurant.name} \n formatted_address={restaurant.formatted_address}\n website={restaurant.website}\n reviews={restaurant.reviews}\n reviewsNumber={restaurant.reviews && restaurant.reviews.length}\n getAverageRatings={this.getAverageRatings(restaurant)}\n displayRestaurantDetails={this.displayRestaurantDetails}\n >\n </Restaurant>\n );\n });\n\n if (restaurants.length) {\n return (<div>{restaurants}</div>);\n }\n return (\n <div style={{marginTop: \"200px\", textAlign: \"center\"}}>\n <span>Aucun résultat. Veuillez appliquer un autre filtre.</span>\n </div>\n );\n }", "title": "" }, { "docid": "ead4fbe8ad15212a3e3a6ce51c3eade2", "score": "0.5831235", "text": "function getReviews(place) {//get user reviews about a place\n console.log('getReviews');\n if (place.reviews) {\n $('#reviews').empty();//clear child nodes\n for (var i = 0; i < place.reviews.length; i++) {\n\n ShowPicClass.init(place);\n\n }//end for\n }\n }//getReviews(place) ", "title": "" }, { "docid": "af590e1cdd80482ab3d9ba2f72c5d061", "score": "0.5818229", "text": "static get REVIEWS_URL() {\r\n \r\n return `https://restaurantsserver.herokuapp.com/reviews`;\r\n }", "title": "" }, { "docid": "8f12a218e35a67dd7d5a298993342fc8", "score": "0.5786824", "text": "function details() {\n api.get_details(props.reviewlist.movie.imdbid);\n }", "title": "" }, { "docid": "5a7942e2475b372e3548e4b65b835b59", "score": "0.57855403", "text": "function getUserReviewsList(href) {\n DEBUG && console.log('getUserReviewsList() called for href =', href);\n return fetchPageRequest(href)\n .then(page => {\n let reviews = getUserReviewsSinglePage(page);\n\n try { // Could fail if only 1 review page\n let pageLinkElems = page.getElementsByClassName('pagination-links arrange_unit')[0].getElementsByClassName('arrange_unit');\n let nextLinkElem = pageLinkElems[pageLinkElems.length-1].getElementsByClassName('u-decoration-none')[0];\n\n if (!nextLinkElem) { // Base case, no more review pages\n DEBUG && console.log('getUserReviewsList() BC: no next');\n return reviews;\n } else {\n href = nextLinkElem.href;\n return getUserReviewsList(href).\n then(results => {\n return reviews.concat(results);\n });\n }\n } catch(error) {\n DEBUG && console.log('getUserReviewsList() - error, returning reviews');\n return reviews;\n }\n });\n}", "title": "" }, { "docid": "234e3c37f74724c3f2ad7b69d0dc2db9", "score": "0.57742953", "text": "function displayNytResults(reviewResultsArray) {\n\n let nytReviewHTML = `\n <h3>New York Times book reviews:</h3>\n <ul>`;\n\n // Define lower of two values: either the # of search results, or 5 (to avoid huge list of reviews)\n const numberReviewsToShow = Math.min(reviewResultsArray.length, 5);\n\n for (let i=0 ; i<numberReviewsToShow ; i++) {\n nytReviewHTML += `<li><a href='${reviewResultsArray[i].url}' target=\"_blank\">${reviewResultsArray[i].book_title}</a></li>`\n };\n\n nytReviewHTML += '</ul>';\n\n return nytReviewHTML;\n}", "title": "" }, { "docid": "19780904b401e6df79fbd7591c5149fa", "score": "0.577112", "text": "async function fetchReviews() {\n await fetch('reviews.json')\n .then((response) => {\n if (!response.ok) {\n throw new Error('Network response was NOT ok');\n }\n return response.json();\n })\n .then((data) => {\n reviews = data;\n // Parse the data and create 'review' divs\n document.querySelector('.reviews').innerHTML = data.map(loadReviews).join('');\n })\n .catch((error) => {\n console.error('There has been a problem with your fetch operation: ', error);\n });\n}", "title": "" }, { "docid": "5eb22042173e6d9acb26f8cd047ec3d0", "score": "0.57633823", "text": "render() {\n if (!this.props.current_user.isReady || !this.state.all_tasks) {\n return null;\n }\n\n const back_to_pro_btn = (\n <Button bsStyle=\"primary\" className=\"back-to-product\" onClick={this.handleNavigateToProduct}>\n Back to Pro Edition\n </Button>\n );\n\n const contributor_tasks = _.filter(this.state.all_tasks, {\n type: 'contributor',\n status: 'active'\n });\n\n if (_.isEmpty(contributor_tasks)) {\n return (\n <div>\n <h4>{'Your document queue is empty'}</h4>\n {back_to_pro_btn}\n </div>\n );\n }\n\n if (!this.props.contributor_reviews || !this.props.contributor_reviews.isReady) {\n return null;\n }\n\n const reviews = this.props.contributor_reviews.contributor_reviews_count;\n const month_total = reviews.current_month_total;\n const today_total = reviews.today_total;\n const number_to_review = REQUIRED_REVIEWS_NUM_MONTHLY - month_total;\n let display_start_review = (\n <Link to={'/contributortool?id=' + contributor_tasks[0].id}>\n <Button bsStyle=\"primary\">Review Docs</Button>\n </Link>\n );\n\n if (today_total >= REQUIRED_REVIEWS_NUM_TODAY) {\n display_start_review = (\n <h5>Congratulations! You’ve completed the maximum # of reviewed documents for today!</h5>\n );\n }\n\n let month_total_notification = (\n <div>\n <h5>\n For this month, please review {number_to_review} more documents. Flag documents that have\n issues and provide feedback.\n </h5>\n <h5>Completed this month: {month_total}</h5>\n </div>\n );\n\n if (month_total >= REQUIRED_REVIEWS_NUM_MONTHLY) {\n month_total_notification = (\n <div>\n <h5>Congratulations! You’ve met your monthly minimum document review requirements.</h5>\n </div>\n );\n }\n\n return (\n <div className=\"\">\n {month_total_notification}\n {display_start_review}\n {back_to_pro_btn}\n </div>\n );\n }", "title": "" }, { "docid": "683ae8815a804ad516c6791783eab197", "score": "0.57527304", "text": "function showPerson(){\n let item = reviews[currentItem];\n image.src = item.img;\n author.textContent = item.name;\n job.textContent = item.job;\n info.textContent = item.text;\n}", "title": "" }, { "docid": "e494782fab77cf208b1bf1456a5cbe33", "score": "0.57525396", "text": "function shouldGetReviews(params) {\n if (typeof(params['reviews'].value) == 'undefined')\n return false;\n return (params['reviews'].value == true);\n}", "title": "" }, { "docid": "0e527fcc2a19901efdd9a9413b3deb6b", "score": "0.5750042", "text": "function Home() {\n\nconst [reviews, setReviews] = useState([]);\n\n return (\n \n <div className=\"App\">\n <ModalRoot />\n <Reviews reviews={reviews} setReviews={setReviews}/>\n </div>\n );\n}", "title": "" }, { "docid": "1621c0a8b703833342c9495bcd1fb3d1", "score": "0.57358223", "text": "render() {\n return (\n <div id=\"ratingsReviewsContainer\">\n <div className=\"rrtitle\">Ratings and Reviews</div>\n <div className=\"ratings\">\n <Ratings ratings={this.props.ratings} />\n </div>\n <div className=\"reviews\">\n <ReviewList reviews={this.state.reviews} index={this.state.reviewIndex} />\n </div>\n <div className=\"buttons\">\n <MoreReviewsButton more={this.loadMoreReviews} number={this.state.reviews.length} />\n <Button variant=\"outline-primary\" type=\"button\" className=\"btn btn-outline-primary mx-5\"onClick={this.openModal}>ADD A REVIEW +</Button>\n { this.state.isOpen ? (\n <AddReview\n closeModal={this.closeModal}\n isOpen={this.state.isOpen}\n handleSubmit={this.handleSubmit}\n />\n )\n : null}\n </div>\n </div>\n );\n }", "title": "" }, { "docid": "23d0abf6bfb7e8aa258dadcdce815796", "score": "0.5724984", "text": "function loadReviewPage() {\n let brandName = document.getElementById('review-brand');\n let priceName = document.getElementById('review-price');\n\n let reviewProduct = JSON.parse(sessionStorage.getItem(\"reviewItem\"));\n\n brandName.innerHTML = reviewProduct.brand + \" \" + reviewProduct.model;\n priceName.innerHTML = \"Price: $\" + reviewProduct.price;\n\n //Only executes after getting the reviews as this is async\n getReviews(2).then((reviews) => {\n //creates the DOM for the reviews\n for (let i = 0; i < reviews.length; i++) {\n let review = reviews[i];\n let rating = review.rating;\n\n document.getElementById(\"product-review-label-\" + (i + 1)).innerHTML = review.brandType + \" \" + review.modelType;\n\n let parentStar = document.getElementById(\"single-review-\" + (i + 1));\n //making checked rating stars\n for (let i = 0; i < rating; i++) {\n let star = document.createElement(\"span\");\n star.className = \"fa fa-star checked\";\n parentStar.appendChild(star);\n }\n //making unchecked rating stars\n for (let i = 0; i < 10 - rating; i++) {\n let star = document.createElement(\"span\");\n star.className = \"fa fa-star\";\n parentStar.appendChild(star);\n }\n\n\n let label = document.createElement(\"label\");\n label.for = \"rating\";\n label.className = \"block\";\n label.innerHTML = \"Review\";\n let para = document.createElement(\"p\");\n para.id = \"review-review-\" + i;\n para.innerHTML = \"\\\"\" + review.descr + \"\\\"\" + \" By \" + review.customerUsername;\n para.style = \"margin-bottom: 15%;\";\n\n parentStar.appendChild(label);\n parentStar.appendChild(para);\n }\n })\n}", "title": "" }, { "docid": "ed5cad97f83fc36334c409b0c0a90978", "score": "0.5708629", "text": "updateReviews(r){\n this.setState({reviews: r})\n }", "title": "" }, { "docid": "9870a3ccaf91d3def6f96edbd0c33fdd", "score": "0.5706792", "text": "function displayYelpReviews(clickedMarkerIndex) {\n\n if (clickedMarkerIndex != -1) {\n // auth object to hold OAUTH 1.0 paramters\n var auth = { \n consumerKey: \"xWuLN66vI9E6iIqZZiFaUw\", \n consumerSecret: \"dm_9nosRLIE-7KV7jWNR6hNcXiA\",\n accessToken: \"L4hQysaiwzPBkkmIRZO_3OHRs_zmlL_w\",\n accessTokenSecret: \"v5p1MyECZrslYhjyN4FDjENpsdM\",\n serviceProvider: {\n signaureMethod: \"HMAC-SHA1\"\n }\n };\n // parameters to search based on\n var category = 'parks';\n var accessor = {\n consumerSecret: auth.consumerSecret,\n tokenSecret: auth.accessTokenSecret\n };\n // All the search and oauth parameters are pushed to an array\n var parameters = [];\n parameters.push(['category_filter', category]);\n parameters.push(['location', self.markerList()[clickedMarkerIndex].address()]);\n parameters.push(['cll',self.markerList()[clickedMarkerIndex].latlon2()]);\n parameters.push(['name',self.markerList()[clickedMarkerIndex].name()]);\n parameters.push(['callback', 'cb']);\n parameters.push(['oauth_consumer_key', auth.consumerKey]);\n parameters.push(['oauth_consumer_secret', auth.consumerSecret]);\n parameters.push(['oauth_token', auth.accessToken]);\n parameters.push(['oauth_signature_method', 'HMAC-SHA1']);\n\n var message = { \n 'action': 'http://api.yelp.com/v2/search',\n 'method': 'GET',\n 'parameters': parameters \n };\n\n OAuth.setTimestampAndNonce(message); \n OAuth.SignatureMethod.sign(message, accessor);\n var parameterMap = OAuth.getParameterMap(message.parameters);\n parameterMap.oauth_signature = OAuth.percentEncode(parameterMap.oauth_signature);\n\n var yelpRequest = $.ajax({\n 'url': message.action,\n 'data': parameterMap,\n 'cache': true,\n 'dataType': 'jsonp',\n 'type': 'get',\n 'timeout': 60000});\n\n yelpRequest.done(function(data, textStats, XMLHttpRequest) {\n var articleList = data[\"businesses\"];\n //start with setting empty string to the yelp-links element\n self.yelpReviews.removeAll();\n\n for (var i=0;i < articleList.length; i++) {\n var url = articleList[i].url;\n //yelp_content = yelp_content + '<li><a href=\"'+url+'\">'+articleList[i].name+\" \"+'</a><img src=\"'+articleList[i].rating_img_url+'\"></li>';\n self.yelpReviews.push(new YelpReview(articleList[i].name, url,articleList[i].rating_img_url));\n }\n self.yelpTitle('Yelp Results for ' + self.markerList()[clickedMarkerIndex].name());\n\n });\n\n yelpRequest.fail(function(data, textStats, XMLHttpRequest) {\n console.log('Yelp query did not work');\n console.log(XMLHttpRequest);\n self.yelpTitle('failed to get Yelp reviews');\n self.yelpReviews.removeAll();\n });\n\n } else {\n self.yelpTitle('Click on a Forest Preserve in the list and find relevant Yelp reviews here!');\n self.yelpReviews.removeAll();\n }\n }", "title": "" }, { "docid": "7a60f69749843a1a8f3f7166f50486ae", "score": "0.5705597", "text": "render(){\n\n const {revBody} = this.props.route.params;\n const {locName} = this.props.route.params;\n const {locTown} = this.props.route.params;\n const {overallRating} = this.props.route.params;\n\n return(\n <SafeAreaView style ={styles.container}>\n <ScrollView>\n <Text style = {styles.text}> Current Review: </Text>\n <Text style = {styles.locationText}>Review ID: {this.state.rev_id}{\"\\n\"}{\"\\n\"}{(locName)}, found in {(locTown)}{\"\\n\"}{\"\\n\"}Overall Rating: {(overallRating)}{\"\\n\"}{\"\\n\"}Review:{\"\\n\"}{\"\\n\"}{(revBody)}</Text>\n <Text style ={styles.text}>Overall Rating:</Text>\n <AirbnbRating\n defaultRating={0}\n Count={5}\n Size={5}\n showRating={false}\n onFinishRating={this.overallRating}\n />\n <Text style ={styles.text}>Price Rating:</Text>\n <AirbnbRating\n defaultRating={0}\n Count={5}\n Size={5}\n showRating={false}\n onFinishRating={this.priceRating}\n />\n <Text style ={styles.text}>Quality Rating:</Text>\n <AirbnbRating\n defaultRating={0}\n Count={5}\n Size={5}\n showRating={false}\n onFinishRating={this.qualityRating}\n />\n <Text style ={styles.text}>Clenliness Rating:</Text>\n <AirbnbRating\n defaultRating={0}\n Count={5}\n Size={5}\n showRating={false}\n onFinishRating={this.clenlinessRating}\n />\n <TextInput\n placeholder=\"Review:\"\n onChangeText={(review_body) => this.setState({review_body})}\n value={this.state.review_body}\n style={styles.input}\n />\n <TouchableOpacity\n style = {styles.button}\n onPress={() => {\n this.ReviewValidation()\n }}\n >\n <Text style = {styles.text}>Update Review</Text>\n </TouchableOpacity>\n <TouchableOpacity\n style = {styles.button}\n onPress={() => {\n this.DeleteUserReview()\n }}\n >\n <Text style = {styles.text}>Delete Review</Text>\n </TouchableOpacity>\n </ScrollView>\n </SafeAreaView>\n )\n}", "title": "" }, { "docid": "eaedf3235b57f6746d3dd0cd5bd8e261", "score": "0.5703484", "text": "function getReviews (a, b) {\n let out = '';\n\n for (let i = a; i < b; i++) {\n out += '<section class=\"reviews__container\">';\n out += '<div class=\"reviews__wrapper-1\">';\n out += '<img src=\"image/reviews/' + reviews[i].image + '\" alt=\"' + reviews[i].name + '\" class=\"reviews__img\">';\n out += '<div class=\"reviews__box\">';\n out += '<p class=\"reviews__name\">' + reviews[i].name + '</p>';\n out += '<p class=\"reviews__prof\">' + reviews[i].prof + '</p>';\n\n out += '<div class=\"achievements reviews__achievements\">';\n out += getAssessment( reviews[i].assessment );\n\n out += '<span class=\"reviews__text-1 checkbox\" id=\"rt1\">' + reviews[i].short_text + '</span>';\n out += '</div>';\n out += '</div>';\n out += '</div>';\n\n out += '<div class=\"reviews__wrapper-2\">';\n out += '<span class=\"reviews__text-1 checkbox\" id=\"rt2\">' + reviews[i].short_text + '</span>';\n out += '<article class=\"reviews__text-2\">' + reviews[i].text + '</article>';\n\n out += '<date class=\"reviews__text-1\">' + reviews[i].date + '</date>';\n out += '</div>';\n out += '</section>';\n }\n\n document.getElementById('reviews').insertAdjacentHTML('afterend', out);\n}", "title": "" }, { "docid": "4343ad8cafbdccff3c21d1cbde7f22e0", "score": "0.5703439", "text": "render() {\n const feeling = this.ratingOrSpacer(this.props.rs.feeling);\n const understanding = this.ratingOrSpacer(this.props.rs.understanding);\n const support = this.ratingOrSpacer(this.props.rs.support);\n const comments = this.props.rs.comments;\n return (\n <Card>\n <CardContent>\n <Typography color=\"textSecondary\" variant=\"h5\" component=\"h2\" gutterBottom={true}>\n Review Your Feedback\n </Typography>\n <Typography color=\"textPrimary\" variant=\"body2\" paragraph={true}>\n Feelings: {feeling}\n </Typography>\n <Typography color=\"textPrimary\" variant=\"body2\" paragraph={true}>\n Understanding: {understanding}\n </Typography>\n <Typography color=\"textPrimary\" variant=\"body2\" paragraph={true}>\n Support: {support}\n </Typography>\n <Typography color=\"textPrimary\" variant=\"body2\" paragraph={true}>\n Comments: {comments}\n </Typography>\n </CardContent>\n <CardActions>\n {this.submitButton()}\n </CardActions>\n </Card>\n );\n }", "title": "" }, { "docid": "dbeb01a5f55a2c985fe19611ea35ffc4", "score": "0.5701568", "text": "function PropertyReviews(props) {\n\n\tconst id = props.propertyId\n\tconst [limit, setLimit] = useState(3)\n\tconst [offset, setOffset] = useState(0)\n\t// const [pageCount, setPageCount] = useState(0)\n\t// const [count , setCount] = useState(0)\n\n\t//refactor to use store\n\tuseEffect(() => {\n\t\tprops.dispatch(fetchReviewsByPropertyId(id))\n\t\tprops.dispatch(fetchReviewsWithOffsetAndLimit(offset, limit, id))\n\t\tprops.dispatch(reviewOffsetLimitAndId(offset, limit, id))\n\t}, [offset, id])\n\n\tconst refresh = () => {\n\t\tprops.dispatch(fetchReviewsByPropertyId(id))\n\t\tprops.dispatch(fetchReviewsWithOffsetAndLimit(offset, limit, id))\n\t\tprops.dispatch(reviewOffsetLimitAndId(offset, limit, id))\n\t}\n\n\tconst handleLimitChange = (e) => {\n\t\t// console.log(\"handleChange\",e.target.value)\n\t\tsetLimit(e.target.value)\n\t\t// props.dispatch(fetchReviewsWithOffsetAndLimit(offset, limit, id))\n\t\t// props.dispatch(reviewOffsetLimitAndId(offset, limit, id))\n\t}\n\n\tconst handleLimitSubmit = (e) => {\n\t\te.preventDefault()\n\t\tprops.dispatch(fetchReviewsWithOffsetAndLimit(offset, limit, id))\n\t\tprops.dispatch(reviewOffsetLimitAndId(offset, limit, id))\n\n\t\t// setLimit(e.target.value)\n\n\t}\n\n\t// let limitPerPage = 3\n\n\tconst handlePageClick = (data) => {\n\t\tlet selected = data.selected\n\t\tsetOffset(Math.ceil(selected * limit))\n\t\t// props.dispatch(fetchReviewsWithOffsetAndLimit(offset, limit, id))\n\n\t}\n\n\tlet totalPages = Math.ceil(props.reviewByProperty.length / limit)\n\n\treturn (\n\n\t\t<>\n\t\t\t<div className=\"has-text-centered\">\n\t\t\t\t<form onSubmit={handleLimitSubmit} >\n\t\t\t\t\t<label className=\"column is-12 has-text-weight-semibold subtitle mb-5\">\n\t\t\t\t\t\tReviews per page:\n\t\t\t\t\t\t<br />\n\t\t\t\t\t\t<div className=\"select is-medium is-success\">\n\t\n\t\t\t\t<select onChange={handleLimitChange}>\n\t\t\t\t\t\t\t<option value=\"3\">3</option>\n\t\t\t\t\t\t\t<option value=\"5\">5</option>\n\t\t\t\t\t\t\t<option value=\"10\">10</option>\n\t\t\t\t\t\t</select>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t<br />\n\t\t\t\t\t\t<input className=\"button is-success my-2\" type=\"submit\" value=\"submit\" />\n\t\t\t\t\t</label>\n\t\t\t\t\t\n\t\t\t\t</form>\n\t\t\t\t<br />\n\n\t\t\t\t{!props.auth.isAuthenticated &&\n\t\t\t\t\t<>\n\t\t\t\t\t\t<br /><p> <Link to=\"/login\">Login </Link> or <Link to='/register'>Register</Link> to add a review</p>\n\t\t\t\t\t</>\n\t\t\t\t}\n\t\t\t\t{props.paginationReviews.map((review) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<div key={review.id} >\n\t\t\t\t\t\t\t<Review key={review.id} review={review} refresh={refresh} />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)\n\t\t\t\t})}\n\n<div className=\"\">\n\t<br />\n\t<p className=\"is-large is-capitalized has-text-weight-semibold\">\n\t\t\t\t<ReactPaginate\n\t\t\t\t\tpreviousLabel={'previous'}\n\t\t\t\t\tnextLabel={'next'}\n\t\t\t\t\tbreakLabel={'...'}\n\t\t\t\t\tbreakClassName={'break-me'}\n\t\t\t\t\tpageCount={totalPages}\n\t\t\t\t\t// marginPagesDisplayed={2}\n\t\t\t\t\t// pageRangeDisplayed={5}\n\t\t\t\t\tonPageChange={handlePageClick}\n\t\t\t\t\tcontainerClassName={'pagination'}\n\t\t\t\t\tsubContainerClassName={'pages pagination'}\n\t\t\t\t\tactiveClassName={'active'}\n\t\t\t\t/>\n\t\t\t\t</p>\n</div>\n\n\n\t\t\t\t{/* {console.log(count)} */}\n\t\t\t</div>\n\t\t</>\n\t)\n}", "title": "" }, { "docid": "a1bcbbded9130a803db7bd6327d6bfc0", "score": "0.56979066", "text": "function showPerson(){\n const item = reviews[currentItem];\n author.textContent = item.name;\n job.textContent = item.job;\n info.textContent = item.text;\n img.src = item.img;\n }", "title": "" }, { "docid": "0d7dcff2edbbe2f1435a28d4e179198a", "score": "0.5696453", "text": "function getUserReviews(){\r\n\t\tvar elem = $(this);\r\n\t\tvar id = elem.attr(\"id\");\r\n\t\tvar movieid = id.substr(6);\r\n\t\t//console.log(movieid);\r\n\t\tvar url = \"php/datahandler.php?action=getReviews&id=\" + movieid; \r\n\t\t$.getJSON(url, function(data){\r\n\t\tconsole.log(data);\r\n\t\t$.each(data, function(i, value){\r\n\t\t\t console.log(value);\r\n\t\t\tvar user = value.user;\r\n\t\t\tvar date = value.date;\r\n\t\t\tvar s = date.split(\"-\");\r\n\t\t\tvar mydate = s[2]+ \"-\" + s[1] +\"-\"+s[0];\r\n\t\t\tvar userReview = value.user_review;\r\n\t\t\t\r\n\t\t\t$(\".links\").append(\"<div class='userReviews'>Posted By:\" + user + \" \" + \" on:\" + mydate\r\n\t\t\t\t+ \"<br>\" + userReview + \"<br><br></div>\");\r\n\t\t\t});\t\r\n\t\r\n\t\t});\r\n\t\telem.prop(\"disabled\",true);\r\n\t}//end get user reviews method", "title": "" }, { "docid": "72bd8ae897461b347a15eb05e2104ce8", "score": "0.5687955", "text": "static fetchReviews(restaurant_id) {\r\n return new Promise((resolve, reject) => {\r\n DBHelper.fetchReviewsFromIDB(restaurant_id).then(reviews => {\r\n if(!reviews || reviews.length == 0) {\r\n fetch(`http://localhost:1337/reviews?restaurant_id=${restaurant_id}`).then(response => {\r\n response.json().then(data => {\r\n DBHelper.writeReviewsToIDB(data);\r\n return resolve(data);\r\n });\r\n }).catch(error => {\r\n return reject(error);\r\n });\r\n } else {\r\n fetch(`http://localhost:1337/reviews?restaurant_id=${restaurant_id}`).then(response => {\r\n response.json().then(data => {\r\n DBHelper.writeReviewsToIDB(data);\r\n });\r\n })\r\n return resolve(reviews);\r\n }\r\n }).catch(error => {\r\n return reject(error);\r\n });\r\n });\r\n }", "title": "" } ]
52937d3f697707232a18943a9f46324a
if the dest has an error, then stop piping into it. however, don't suppress the throwing behavior for this.
[ { "docid": "39f5c5776a64f0e27e59f62d1d564031", "score": "0.0", "text": "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);\n }", "title": "" } ]
[ { "docid": "667d2deaba1ef4c20ac5828518eddff1", "score": "0.74918973", "text": "function onerror(er){debug('onerror',er);unpipe();dest.removeListener('error',onerror);if(EE.listenerCount(dest,'error') === 0)dest.emit('error',er);} // This is a brutally ugly hack to make sure that our error handler", "title": "" }, { "docid": "4ed87ba15bfd14fe1dfabf04b7ed4758", "score": "0.7477132", "text": "function onerror(er){debug('onerror',er);unpipe();dest.removeListener('error',onerror);if(EElistenerCount(dest,'error')===0)dest.emit('error',er);}// This is a brutally ugly hack to make sure that our error handler", "title": "" }, { "docid": "4ed87ba15bfd14fe1dfabf04b7ed4758", "score": "0.7477132", "text": "function onerror(er){debug('onerror',er);unpipe();dest.removeListener('error',onerror);if(EElistenerCount(dest,'error')===0)dest.emit('error',er);}// This is a brutally ugly hack to make sure that our error handler", "title": "" }, { "docid": "e49c625b101e97ec5f7fa3d741044e4c", "score": "0.72073966", "text": "function onerror(er){debug('onerror',er);unpipe();dest.removeListener('error',onerror);if(EElistenerCount(dest,'error')===0)dest.emit('error',er);}// Make sure our error handler is attached before userland ones.", "title": "" }, { "docid": "e49c625b101e97ec5f7fa3d741044e4c", "score": "0.72073966", "text": "function onerror(er){debug('onerror',er);unpipe();dest.removeListener('error',onerror);if(EElistenerCount(dest,'error')===0)dest.emit('error',er);}// Make sure our error handler is attached before userland ones.", "title": "" }, { "docid": "e49c625b101e97ec5f7fa3d741044e4c", "score": "0.72073966", "text": "function onerror(er){debug('onerror',er);unpipe();dest.removeListener('error',onerror);if(EElistenerCount(dest,'error')===0)dest.emit('error',er);}// Make sure our error handler is attached before userland ones.", "title": "" }, { "docid": "e49c625b101e97ec5f7fa3d741044e4c", "score": "0.72073966", "text": "function onerror(er){debug('onerror',er);unpipe();dest.removeListener('error',onerror);if(EElistenerCount(dest,'error')===0)dest.emit('error',er);}// Make sure our error handler is attached before userland ones.", "title": "" }, { "docid": "e49c625b101e97ec5f7fa3d741044e4c", "score": "0.72073966", "text": "function onerror(er){debug('onerror',er);unpipe();dest.removeListener('error',onerror);if(EElistenerCount(dest,'error')===0)dest.emit('error',er);}// Make sure our error handler is attached before userland ones.", "title": "" }, { "docid": "2d35814422f8a6733af1589bc809b6f5", "score": "0.7148641", "text": "function onerror(er) {\n\t unpipe();\n\t dest.removeListener('error', onerror);\n\t if (EE.listenerCount(dest, 'error') === 0)\n\t dest.emit('error', er);\n\t }", "title": "" }, { "docid": "2d35814422f8a6733af1589bc809b6f5", "score": "0.7148641", "text": "function onerror(er) {\n\t unpipe();\n\t dest.removeListener('error', onerror);\n\t if (EE.listenerCount(dest, 'error') === 0)\n\t dest.emit('error', er);\n\t }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.7125259", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.7125259", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.7125259", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.7125259", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.7125259", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.7125259", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.7125259", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.7125259", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.7125259", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.7125259", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.7125259", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.7125259", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.7125259", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.7125259", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.7125259", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.7125259", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.7125259", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.7125259", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.7125259", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.7125259", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.7125259", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.7125259", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.7125259", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.7125259", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.7125259", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.7125259", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.7125259", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.7125259", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.7125259", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "387db13532187e6ce2526ef16a4a6652", "score": "0.71068484", "text": "function onerror(er) {\r\n unpipe();\r\n dest.removeListener('error', onerror);\r\n if (EE.listenerCount(dest, 'error') === 0)\r\n dest.emit('error', er);\r\n }", "title": "" }, { "docid": "d3fc4dd7765b677f904b7f203a50f515", "score": "0.7052991", "text": "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0) dest.emit('error', er);\n } // This is a brutally ugly hack to make sure that our error handler", "title": "" }, { "docid": "4c4c8488b7f4f4f69b921d48074699b0", "score": "0.69624096", "text": "function onerror(er) {\n\t debug('onerror', er);\n\t unpipe();\n\t dest.removeListener('error', onerror);\n\t if (EE.listenerCount(dest, 'error') === 0)\n\t dest.emit('error', er);\n\t }", "title": "" }, { "docid": "4c4c8488b7f4f4f69b921d48074699b0", "score": "0.69624096", "text": "function onerror(er) {\n\t debug('onerror', er);\n\t unpipe();\n\t dest.removeListener('error', onerror);\n\t if (EE.listenerCount(dest, 'error') === 0)\n\t dest.emit('error', er);\n\t }", "title": "" }, { "docid": "4c4c8488b7f4f4f69b921d48074699b0", "score": "0.69624096", "text": "function onerror(er) {\n\t debug('onerror', er);\n\t unpipe();\n\t dest.removeListener('error', onerror);\n\t if (EE.listenerCount(dest, 'error') === 0)\n\t dest.emit('error', er);\n\t }", "title": "" }, { "docid": "4c4c8488b7f4f4f69b921d48074699b0", "score": "0.69624096", "text": "function onerror(er) {\n\t debug('onerror', er);\n\t unpipe();\n\t dest.removeListener('error', onerror);\n\t if (EE.listenerCount(dest, 'error') === 0)\n\t dest.emit('error', er);\n\t }", "title": "" }, { "docid": "4c4c8488b7f4f4f69b921d48074699b0", "score": "0.69624096", "text": "function onerror(er) {\n\t debug('onerror', er);\n\t unpipe();\n\t dest.removeListener('error', onerror);\n\t if (EE.listenerCount(dest, 'error') === 0)\n\t dest.emit('error', er);\n\t }", "title": "" }, { "docid": "4c4c8488b7f4f4f69b921d48074699b0", "score": "0.69624096", "text": "function onerror(er) {\n\t debug('onerror', er);\n\t unpipe();\n\t dest.removeListener('error', onerror);\n\t if (EE.listenerCount(dest, 'error') === 0)\n\t dest.emit('error', er);\n\t }", "title": "" }, { "docid": "4c4c8488b7f4f4f69b921d48074699b0", "score": "0.69624096", "text": "function onerror(er) {\n\t debug('onerror', er);\n\t unpipe();\n\t dest.removeListener('error', onerror);\n\t if (EE.listenerCount(dest, 'error') === 0)\n\t dest.emit('error', er);\n\t }", "title": "" }, { "docid": "4c4c8488b7f4f4f69b921d48074699b0", "score": "0.69624096", "text": "function onerror(er) {\n\t debug('onerror', er);\n\t unpipe();\n\t dest.removeListener('error', onerror);\n\t if (EE.listenerCount(dest, 'error') === 0)\n\t dest.emit('error', er);\n\t }", "title": "" }, { "docid": "4c4c8488b7f4f4f69b921d48074699b0", "score": "0.69624096", "text": "function onerror(er) {\n\t debug('onerror', er);\n\t unpipe();\n\t dest.removeListener('error', onerror);\n\t if (EE.listenerCount(dest, 'error') === 0)\n\t dest.emit('error', er);\n\t }", "title": "" }, { "docid": "4c4c8488b7f4f4f69b921d48074699b0", "score": "0.69624096", "text": "function onerror(er) {\n\t debug('onerror', er);\n\t unpipe();\n\t dest.removeListener('error', onerror);\n\t if (EE.listenerCount(dest, 'error') === 0)\n\t dest.emit('error', er);\n\t }", "title": "" }, { "docid": "4c4c8488b7f4f4f69b921d48074699b0", "score": "0.69624096", "text": "function onerror(er) {\n\t debug('onerror', er);\n\t unpipe();\n\t dest.removeListener('error', onerror);\n\t if (EE.listenerCount(dest, 'error') === 0)\n\t dest.emit('error', er);\n\t }", "title": "" }, { "docid": "4c4c8488b7f4f4f69b921d48074699b0", "score": "0.69624096", "text": "function onerror(er) {\n\t debug('onerror', er);\n\t unpipe();\n\t dest.removeListener('error', onerror);\n\t if (EE.listenerCount(dest, 'error') === 0)\n\t dest.emit('error', er);\n\t }", "title": "" }, { "docid": "4c4c8488b7f4f4f69b921d48074699b0", "score": "0.69624096", "text": "function onerror(er) {\n\t debug('onerror', er);\n\t unpipe();\n\t dest.removeListener('error', onerror);\n\t if (EE.listenerCount(dest, 'error') === 0)\n\t dest.emit('error', er);\n\t }", "title": "" }, { "docid": "4c4c8488b7f4f4f69b921d48074699b0", "score": "0.69624096", "text": "function onerror(er) {\n\t debug('onerror', er);\n\t unpipe();\n\t dest.removeListener('error', onerror);\n\t if (EE.listenerCount(dest, 'error') === 0)\n\t dest.emit('error', er);\n\t }", "title": "" }, { "docid": "4c4c8488b7f4f4f69b921d48074699b0", "score": "0.69624096", "text": "function onerror(er) {\n\t debug('onerror', er);\n\t unpipe();\n\t dest.removeListener('error', onerror);\n\t if (EE.listenerCount(dest, 'error') === 0)\n\t dest.emit('error', er);\n\t }", "title": "" }, { "docid": "4c4c8488b7f4f4f69b921d48074699b0", "score": "0.69624096", "text": "function onerror(er) {\n\t debug('onerror', er);\n\t unpipe();\n\t dest.removeListener('error', onerror);\n\t if (EE.listenerCount(dest, 'error') === 0)\n\t dest.emit('error', er);\n\t }", "title": "" }, { "docid": "4c4c8488b7f4f4f69b921d48074699b0", "score": "0.69624096", "text": "function onerror(er) {\n\t debug('onerror', er);\n\t unpipe();\n\t dest.removeListener('error', onerror);\n\t if (EE.listenerCount(dest, 'error') === 0)\n\t dest.emit('error', er);\n\t }", "title": "" }, { "docid": "4c4c8488b7f4f4f69b921d48074699b0", "score": "0.69624096", "text": "function onerror(er) {\n\t debug('onerror', er);\n\t unpipe();\n\t dest.removeListener('error', onerror);\n\t if (EE.listenerCount(dest, 'error') === 0)\n\t dest.emit('error', er);\n\t }", "title": "" }, { "docid": "4c4c8488b7f4f4f69b921d48074699b0", "score": "0.69624096", "text": "function onerror(er) {\n\t debug('onerror', er);\n\t unpipe();\n\t dest.removeListener('error', onerror);\n\t if (EE.listenerCount(dest, 'error') === 0)\n\t dest.emit('error', er);\n\t }", "title": "" }, { "docid": "a2c90b27c236969dd0beb7cb4cbf0210", "score": "0.6947299", "text": "function onerror(er) {\n debug(\"onerror\", er);\n unpipe();\n dest.removeListener(\"error\", onerror);\n if (EElistenerCount(dest, \"error\") === 0)\n dest.emit(\"error\", er);\n }", "title": "" }, { "docid": "2ea3a97bf8f99582c6954834eb6ac35c", "score": "0.69331276", "text": "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "7f3a08450bfce0f445a595f90d3ca599", "score": "0.6923115", "text": "function onerror(er) {\n debug(\"onerror\", er);\n unpipe();\n dest.removeListener(\"error\", onerror);\n if (EElistenerCount(dest, \"error\") === 0) dest.emit(\"error\", er);\n }", "title": "" }, { "docid": "7f3a08450bfce0f445a595f90d3ca599", "score": "0.6923115", "text": "function onerror(er) {\n debug(\"onerror\", er);\n unpipe();\n dest.removeListener(\"error\", onerror);\n if (EElistenerCount(dest, \"error\") === 0) dest.emit(\"error\", er);\n }", "title": "" }, { "docid": "635c9273b0f0faf27fe4ff688cca2f09", "score": "0.6905178", "text": "function onerror(er) {\n\t debug('onerror', er);\n\t unpipe();\n\t dest.removeListener('error', onerror);\n\t if (EElistenerCount(dest, 'error') === 0)\n\t dest.emit('error', er);\n\t }", "title": "" }, { "docid": "635c9273b0f0faf27fe4ff688cca2f09", "score": "0.6905178", "text": "function onerror(er) {\n\t debug('onerror', er);\n\t unpipe();\n\t dest.removeListener('error', onerror);\n\t if (EElistenerCount(dest, 'error') === 0)\n\t dest.emit('error', er);\n\t }", "title": "" }, { "docid": "635c9273b0f0faf27fe4ff688cca2f09", "score": "0.6905178", "text": "function onerror(er) {\n\t debug('onerror', er);\n\t unpipe();\n\t dest.removeListener('error', onerror);\n\t if (EElistenerCount(dest, 'error') === 0)\n\t dest.emit('error', er);\n\t }", "title": "" }, { "docid": "3b65ba7f3af33dd0e20f2d740d271cb9", "score": "0.6902374", "text": "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (listenerCount$1(dest, 'error') === 0) dest.emit('error', er);\n }", "title": "" }, { "docid": "3b65ba7f3af33dd0e20f2d740d271cb9", "score": "0.6902374", "text": "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (listenerCount$1(dest, 'error') === 0) dest.emit('error', er);\n }", "title": "" }, { "docid": "bd2646ab02150d2a7a47de895fbc5170", "score": "0.6883077", "text": "function onerror(er) {\n\t debug('onerror', er);\n\t unpipe();\n\t dest.removeListener('error', onerror);\n\t if (listenerCount$1(dest, 'error') === 0) dest.emit('error', er);\n\t }", "title": "" }, { "docid": "9f309f0aa6ebf21d635a30edfac9e601", "score": "0.6881538", "text": "function onerror(er) {\r\n\t\t\t\t\tdebug(\"onerror\", er);\r\n\t\t\t\t\tunpipe();\r\n\t\t\t\t\tdest.removeListener(\"error\", onerror);\r\n\t\t\t\t\tif (EElistenerCount(dest, \"error\") === 0)\r\n\t\t\t\t\t\tdest.emit(\"error\", er);\r\n\t\t\t\t} // Make sure our error handler is attached before userland ones.", "title": "" }, { "docid": "d18ecf71eb4bf77811ea0e78d3483ef7", "score": "0.68754375", "text": "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);\n }", "title": "" }, { "docid": "2b217cd7c32b27c7d3f63124a677dd93", "score": "0.68735266", "text": "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (listenerCount$1(dest, 'error') === 0) dest.emit('error', er);\n } // Make sure our error handler is attached before userland ones.", "title": "" }, { "docid": "8a38f0816c88819a988e85f73e542c04", "score": "0.68723935", "text": "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (listenerCount$1(dest, 'error') === 0) dest.emit('error', er);\n }", "title": "" }, { "docid": "f65a47fbe0b003e80c1cb22512ed1dcc", "score": "0.68704486", "text": "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);\n }", "title": "" }, { "docid": "f65a47fbe0b003e80c1cb22512ed1dcc", "score": "0.68704486", "text": "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);\n }", "title": "" }, { "docid": "90e2d3182730f2a789f2559b7faa3535", "score": "0.6866843", "text": "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "90e2d3182730f2a789f2559b7faa3535", "score": "0.6866843", "text": "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "90e2d3182730f2a789f2559b7faa3535", "score": "0.6866843", "text": "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "90e2d3182730f2a789f2559b7faa3535", "score": "0.6866843", "text": "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "90e2d3182730f2a789f2559b7faa3535", "score": "0.6866843", "text": "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "90e2d3182730f2a789f2559b7faa3535", "score": "0.6866843", "text": "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "90e2d3182730f2a789f2559b7faa3535", "score": "0.6866843", "text": "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "90e2d3182730f2a789f2559b7faa3535", "score": "0.6866843", "text": "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "90e2d3182730f2a789f2559b7faa3535", "score": "0.6866843", "text": "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "90e2d3182730f2a789f2559b7faa3535", "score": "0.6866843", "text": "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "90e2d3182730f2a789f2559b7faa3535", "score": "0.6866843", "text": "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "90e2d3182730f2a789f2559b7faa3535", "score": "0.6866843", "text": "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "90e2d3182730f2a789f2559b7faa3535", "score": "0.6866843", "text": "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "90e2d3182730f2a789f2559b7faa3535", "score": "0.6866843", "text": "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "90e2d3182730f2a789f2559b7faa3535", "score": "0.6866843", "text": "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "90e2d3182730f2a789f2559b7faa3535", "score": "0.6866843", "text": "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "90e2d3182730f2a789f2559b7faa3535", "score": "0.6866843", "text": "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "90e2d3182730f2a789f2559b7faa3535", "score": "0.6866843", "text": "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "90e2d3182730f2a789f2559b7faa3535", "score": "0.6866843", "text": "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "90e2d3182730f2a789f2559b7faa3535", "score": "0.6866843", "text": "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "90e2d3182730f2a789f2559b7faa3535", "score": "0.6866843", "text": "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "90e2d3182730f2a789f2559b7faa3535", "score": "0.6866843", "text": "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "90e2d3182730f2a789f2559b7faa3535", "score": "0.6866843", "text": "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "90e2d3182730f2a789f2559b7faa3535", "score": "0.6866843", "text": "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "90e2d3182730f2a789f2559b7faa3535", "score": "0.6866843", "text": "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" } ]
863231fbf92ec36fde413e1e6aeab0b9
The maximum is exclusive and the minimum is inclusive
[ { "docid": "1d83e63fdf2c6ff3c273f75d647cb191", "score": "0.0", "text": "function getRandomInt(min, maxExcl) {\n min = Math.ceil(min);\n maxExcl = Math.floor(maxExcl);\n return Math.floor(Math.random() * (maxExcl - min) + min);\n}", "title": "" } ]
[ { "docid": "a9c6de05af084fa4e6fc36c8f8e404ca", "score": "0.7476248", "text": "function value_limit(val, min, max) {\r\nreturn val < min ? false : (val > max ? false : true);\r\n}", "title": "" }, { "docid": "e39a3d3db767a1e5e4bf50d6efd6797a", "score": "0.7349672", "text": "constructor(max = -Infinity, min = Infinity) {\n this._max = max\n this._min = min\n }", "title": "" }, { "docid": "42d526299eff04e050e7057148399de9", "score": "0.7270613", "text": "function restrictToRange(val,min,max) {\r\n\t\tif (val < min) return min;\r\n\t\tif (val > max) return max;\r\n\t\treturn val;\r\n\t}", "title": "" }, { "docid": "b51a6a6621c5509ab5fa045187f23f39", "score": "0.7246017", "text": "function limits(actual, min, max) {\n return (actual < min) ? min : (actual > max) ? max : actual;\n}", "title": "" }, { "docid": "eda1d6196544147f73727a087f8a7f34", "score": "0.72422373", "text": "function ensureRange(value, min, max) {\r\n\t\tvalue = Math.max(value, min)\r\n\t\tvalue = Math.min(value, max)\r\n\r\n\t\treturn value;\r\n\t}", "title": "" }, { "docid": "d4c267d69f14dc55d903268cf1ae09f2", "score": "0.7211015", "text": "function restrictToRange(val,min,max) {\n if (val < min) return min;\n if (val > max) return max;\n return val;\n }", "title": "" }, { "docid": "9875d89dc7f925ebc6d02687bff32c1d", "score": "0.7183766", "text": "function clampValue(min,n,max){return Math.min(Math.max(min,n),max);}", "title": "" }, { "docid": "14a65685adae4e903a50724d336e1153", "score": "0.71754706", "text": "function clamp(num, min, max) {\n return num <= min ? min : num >= max ? max : num;\n }", "title": "" }, { "docid": "5d87155dc3cafe2048b4e0b577b0360e", "score": "0.71712697", "text": "function constrain(value, min, max) {\n return (Math.min(max, Math.max(min, value)));\n }", "title": "" }, { "docid": "3e47424586e67b8f38674bb32174f290", "score": "0.711094", "text": "function range(input,min,max) {\n\t\tif(min > max) { var x = min; min = max; max = x;}\n\t\treturn Math.max(Math.min(input,max),min);\n\t}", "title": "" }, { "docid": "580cc831527e042ad76542de93490cd3", "score": "0.71092224", "text": "constrain (val, min, max){\n if(val < min) {\n val = min;\n }\n else if(val > max) {\n val = max;\n }\n return val;\n }", "title": "" }, { "docid": "7d88bbfa33b1436366dbe0fc9cf1ef72", "score": "0.7086315", "text": "function clamp(num, min, max) {\n return num <= min ? min : num >= max ? max : num;\n }", "title": "" }, { "docid": "7d88bbfa33b1436366dbe0fc9cf1ef72", "score": "0.7086315", "text": "function clamp(num, min, max) {\n return num <= min ? min : num >= max ? max : num;\n }", "title": "" }, { "docid": "db247783acba0ce475a357ce7e0af45c", "score": "0.7019503", "text": "function constraint(value, min, max) {\n return Math.min(Math.max(value, min), max);\n}", "title": "" }, { "docid": "f87eaf7ab4722c6949217223a9a71a05", "score": "0.7013119", "text": "function clamp (v, min, max) { return v < min ? min : v > max ? max : v }", "title": "" }, { "docid": "ddb152e8d0313c1cdfa3614714a48a02", "score": "0.6904794", "text": "function clamp(x, min, max) {\r\n return min < x ? x < max ? x : max : min;\r\n}", "title": "" }, { "docid": "131ae306d5ae26a9b41a79998a499f3c", "score": "0.68968797", "text": "function keepWithin(value, min, max) {\r\n if( value < min ) value = min;\r\n if( value > max ) value = max;\r\n return value;\r\n }", "title": "" }, { "docid": "557cfe2c5a1c91fffc5f79ab24325cb2", "score": "0.6884336", "text": "static range(min, max){\r\n\t\tlet x = 0\r\n\t\tif( min < 0 )\r\n\t\t\tx = (min-10)\r\n\r\n\t\tif(-min > max){\r\n\t\t\twhile(-x > max || -x < (min+1)){\r\n\t\t\t\tx = Math.floor(Math.random()* -min)\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\twhile(x < (min+1) || x > (max-1)){\r\n\t\t\t\tx = Math.floor(Math.random() * max)\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(min < 0){\r\n\t\t\tif(this.choice([true, false]) == true){\r\n\t\t\t\tif(x < max)\r\n\t\t\t\t\treturn x\r\n\t\t\t\telse\r\n\t\t\t\t\treturn -x\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tif(-x < max){\r\n\t\t\t\t\treturn -x\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\treturn x\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn x\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "48cd09771c507d141b52364b866b5dac", "score": "0.6876358", "text": "function minmax(value, min, max) {\n\t\treturn Math.max(min, Math.min(value, max));\n\t}", "title": "" }, { "docid": "eec9e33d9bbd15ded02ddc07c76f29cf", "score": "0.68629444", "text": "function clamp(value, max, min) {\n if (min === void 0) { min = 0; }\n return value < min ? min : value > max ? max : value;\n}", "title": "" }, { "docid": "4b52e107c49afb0572a1b13e1db86cdb", "score": "0.68577456", "text": "function generateIntegerRangeExclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n\n return Math.floor(Math.random() * (max - min) + min);\n //The maximum is exclsuive and the minimum is inclusive\n}", "title": "" }, { "docid": "bd8ae1cb77f95c310ee60d689c635f21", "score": "0.68522674", "text": "setMinMax_() {\n let max = Math.pow(2, this.bits);\n if (this.signed) {\n this.max = max / 2 -1;\n this.min = -max / 2;\n } else {\n this.max = max - 1;\n this.min = 0;\n }\n }", "title": "" }, { "docid": "dcd586969750e7013f8e202a79ea9de3", "score": "0.68507993", "text": "function clamp(x, min, max) {\n return min < x ? x < max ? x : max : min;\n}", "title": "" }, { "docid": "5ff09b68dda945d7a2aa672c9f9b5675", "score": "0.6840268", "text": "function clamp(value, min, max) {\r\n return Math.min(Math.max(value, min), max);\r\n}", "title": "" }, { "docid": "9acafe541c6d9d34fe7ae4cb6cb7ee1b", "score": "0.68352896", "text": "function clamp(n, min, max) { // 300\n if (n < min) return min; // 301\n if (n > max) return max; // 302\n return n; // 303\n } // 304", "title": "" }, { "docid": "150c89e765099b4bd08ba120a13a9a65", "score": "0.68350863", "text": "function keepWithin(value, min, max) {\n if(value < min) value = min;\n if(value > max) value = max;\n return value;\n }", "title": "" }, { "docid": "150c89e765099b4bd08ba120a13a9a65", "score": "0.68350863", "text": "function keepWithin(value, min, max) {\n if(value < min) value = min;\n if(value > max) value = max;\n return value;\n }", "title": "" }, { "docid": "e7cbcf79eb679ac29090240d7b927c80", "score": "0.6825239", "text": "function keepWithin(value, min, max) {\n if(value < min) value = min;\n if(value > max) value = max;\n return value;\n }", "title": "" }, { "docid": "8c72ac04877d4318c08c02b02ddf5673", "score": "0.68189937", "text": "function clamp(val, min, max) {\r\n return val < min ? min : (val > max ? max : val);\r\n}", "title": "" }, { "docid": "4584f3c1ad2da69a1c9aee0f2d21b193", "score": "0.6816012", "text": "function constrain(value, min, max) {\n if (value < min) return min;\n if (value > max) return max;\n return value;\n}", "title": "" }, { "docid": "4f088aed47a466ea872ef6d08dfc3bff", "score": "0.67897546", "text": "function keepWithin(value, min, max) {\n if( value < min ) value = min;\n if( value > max ) value = max;\n return value;\n }", "title": "" }, { "docid": "4f088aed47a466ea872ef6d08dfc3bff", "score": "0.67897546", "text": "function keepWithin(value, min, max) {\n if( value < min ) value = min;\n if( value > max ) value = max;\n return value;\n }", "title": "" }, { "docid": "8e181d207a08eac467e824e418f560d3", "score": "0.67892605", "text": "function clamp(value, min, max) {\r\n return Math.min(Math.max(value, min), max);\r\n}", "title": "" }, { "docid": "f162ae5ce8cf4c35e5e694227e83eaa8", "score": "0.6786143", "text": "function clamp(val, min, max){\n return val < min ? min : (val > max ? max : val);\n }", "title": "" }, { "docid": "910ca0e8d655dee9b0b97a062135208c", "score": "0.6784411", "text": "function keepWithin(value, min, max) {\n\t\tif( value < min ) value = min;\n\t\tif( value > max ) value = max;\n\t\treturn value;\n\t}", "title": "" }, { "docid": "910ca0e8d655dee9b0b97a062135208c", "score": "0.6784411", "text": "function keepWithin(value, min, max) {\n\t\tif( value < min ) value = min;\n\t\tif( value > max ) value = max;\n\t\treturn value;\n\t}", "title": "" }, { "docid": "910ca0e8d655dee9b0b97a062135208c", "score": "0.6784411", "text": "function keepWithin(value, min, max) {\n\t\tif( value < min ) value = min;\n\t\tif( value > max ) value = max;\n\t\treturn value;\n\t}", "title": "" }, { "docid": "dae8ddb1d145946c38f6e959254257f2", "score": "0.6782918", "text": "static clamp(x, min, max){\n return x < min ? min : x > max ? max : x;\n }", "title": "" }, { "docid": "cfa969d0d238774992671a9e400026e9", "score": "0.67575663", "text": "function clampValue(min, n, max) {\n\t return Math.min(Math.max(min, n), max);\n\t}", "title": "" }, { "docid": "b61c2e8d7585f09c9650775fdc2a7c50", "score": "0.67512935", "text": "function clamp(val, min, max) {\n return val > max ? max : val < min ? min : val;\n}", "title": "" }, { "docid": "244c5f30c67d315b1bc1043cc27a1272", "score": "0.6750985", "text": "function clamp(low, hi) {\n return (n) => Math.min(Math.max(low, n), hi);\n}", "title": "" }, { "docid": "988940b48aa98b6f084e9a5ad42995d1", "score": "0.67333746", "text": "function rangeInt(min1,max1,min2,max2){\r\n\treturn Math.max(min1,max1) >= Math.min(min2,max2) &&\r\n\tMath.min(min1,max1) <= Math.max(min2,max2);\r\n}", "title": "" }, { "docid": "c75b20f1c157bf5c91b2feeb1c1a16b9", "score": "0.6733192", "text": "static clamp (value, min, max) {\n if (typeof min === 'undefined') { min = 0 }\n if (typeof max === 'undefined') { max = 1 }\n\n return Math.max(min, Math.min(value, max))\n }", "title": "" }, { "docid": "ac0b0b2898abcc987d64642ab345e8bd", "score": "0.67193866", "text": "function clamp(val, min, max){\n return val < min ? min : (val > max ? max : val);\n}", "title": "" }, { "docid": "a874077fe3168644ce3702e10df386f3", "score": "0.67079943", "text": "function clamp(num, min, max) {\n return Math.min(Math.max(num, min), max);\n}", "title": "" }, { "docid": "1158a29825b2c47359729651136e88a6", "score": "0.6697476", "text": "function clamp(val, min, max){\n\t\treturn Math.max(min, Math.min(max, val));\n\t}", "title": "" }, { "docid": "a5a7a1636a37a74cf3ceec99cd5c4dbd", "score": "0.66971916", "text": "static clamp(value, min = 0, max = 1) {\n return value < min ? min : value > max ? max : value;\n }", "title": "" }, { "docid": "461b150dc2d07119364e39f217543ead", "score": "0.66921633", "text": "function clampRange(range, min, max) {\n var lo = range[0],\n hi = range[1],\n span;\n\n if (hi < lo) {\n span = hi;\n hi = lo;\n lo = span;\n }\n\n span = hi - lo;\n return span >= max - min ? [min, max] : [lo = Math.min(Math.max(lo, min), max - span), lo + span];\n}", "title": "" }, { "docid": "ca1196985299cb1012237f7288d666b5", "score": "0.66918314", "text": "function clamp(number,min,max) {\n if(number >= min && number <= max) return number;\n if(number < min) return min;\n if(number > max) return max;\n}", "title": "" }, { "docid": "39e7ffff19b970835400f497eb145ca0", "score": "0.66902643", "text": "function clampRange(range, min, max) {\n var lo = range[0],\n hi = range[1],\n span;\n\n if (hi < lo) {\n span = hi;\n hi = lo;\n lo = span;\n }\n span = hi - lo;\n\n return span >= (max - min)\n ? [min, max]\n : [\n (lo = Math.min(Math.max(lo, min), max - span)),\n lo + span\n ];\n}", "title": "" }, { "docid": "fdff1c34c87874f2fb843be30abce18f", "score": "0.66827863", "text": "function clamp(a, min, max) {\n if (a < min) return min\n if (a > max) return max\n return a\n}", "title": "" }, { "docid": "76b9d56eada826f5064f265562a0aef2", "score": "0.667788", "text": "function clamp(value, min, max) {\n return Math.min(Math.max(value, min), max);\n}", "title": "" }, { "docid": "76b9d56eada826f5064f265562a0aef2", "score": "0.667788", "text": "function clamp(value, min, max) {\n return Math.min(Math.max(value, min), max);\n}", "title": "" }, { "docid": "76b9d56eada826f5064f265562a0aef2", "score": "0.667788", "text": "function clamp(value, min, max) {\n return Math.min(Math.max(value, min), max);\n}", "title": "" }, { "docid": "0a985e8acf2546d073c5b0cd582133f5", "score": "0.6666972", "text": "function clip(min, value, max) {\n return Math.max(min, Math.min(value, max));\n}", "title": "" }, { "docid": "b4ed9e430d9ea9e4bc64a29c17ad6576", "score": "0.6666548", "text": "setRange(min, max) {\n this.min = min;\n this.max = max;\n }", "title": "" }, { "docid": "56ab5770b8a175f01c9fe166a66afea0", "score": "0.66554683", "text": "function clamp(n, min, max) {\n return Math.max(min, Math.min(n, max));\n}", "title": "" }, { "docid": "3c5b9be6a054501c9a5ddc048fcf2afd", "score": "0.66548294", "text": "function clamp(min,max,val){\n return Math.max(min,Math.min(val,max));\n}", "title": "" }, { "docid": "df42d90bd1963abce55f153426029a8d", "score": "0.6648077", "text": "function clamp(min, max, value) {\n return Math.max(min, Math.min(max, value));\n}", "title": "" }, { "docid": "87b857845077d5e6d6596632b4e87bfc", "score": "0.66373515", "text": "function clamp(val, min, max){\n\treturn Math.max(min, Math.min(max, val));\n}", "title": "" }, { "docid": "87b857845077d5e6d6596632b4e87bfc", "score": "0.66373515", "text": "function clamp(val, min, max){\n\treturn Math.max(min, Math.min(max, val));\n}", "title": "" }, { "docid": "87b857845077d5e6d6596632b4e87bfc", "score": "0.66373515", "text": "function clamp(val, min, max){\n\treturn Math.max(min, Math.min(max, val));\n}", "title": "" }, { "docid": "87b857845077d5e6d6596632b4e87bfc", "score": "0.66373515", "text": "function clamp(val, min, max){\n\treturn Math.max(min, Math.min(max, val));\n}", "title": "" }, { "docid": "b96484c8ce27a550866ea1ef673399ad", "score": "0.66355234", "text": "function clamp(val, min, max) {\n\t\treturn Math.min(Math.max(min, val), max);\n\t}", "title": "" }, { "docid": "ae2a7ad96c3abdeb6dde582204eb7185", "score": "0.6611228", "text": "function clamp(val, min, max) {\n\treturn Math.max(min, Math.min(max, val));\n}", "title": "" }, { "docid": "ef9b9da76bf89c417350cf7de064dbef", "score": "0.659566", "text": "function diffMaxMin(arr) {\n return Math.max(...arr) - Math.min(...arr);\n }", "title": "" }, { "docid": "38bebaf88f122178e2fac9c5bdc8a20b", "score": "0.65928227", "text": "function clamp(val, min, max) {\n return Math.min(Math.max(min, val), max);\n}", "title": "" }, { "docid": "bc4f151d47e03c13f01bd414305f58e9", "score": "0.65897095", "text": "function clamp(val, min, max) {\n return Math.min(Math.max(min, val), max);\n}", "title": "" }, { "docid": "90d867a6856ef94355ab0484d1f7b0f8", "score": "0.65846914", "text": "function clamp(value, min, max) {\n return Math.max(Math.min(value, max), min);\n}", "title": "" }, { "docid": "525dd2943c72741e0b79612300d1dc48", "score": "0.6584382", "text": "static numberClamp(number, min, max) {\n return Math.min(Math.max(number, min), max);\n }", "title": "" }, { "docid": "89d3713ede641d4d97ef595f7e93d57f", "score": "0.65843546", "text": "function randomNumberExclusive(min, max) {\n\n return Math.floor(Math.random() * (max - min)) + min;\n}", "title": "" }, { "docid": "3360ad940c254e031761f1827bbef8b4", "score": "0.65821487", "text": "function clamp(n, min, max) {\n return Math.max(Math.min(n, max), min);\n}", "title": "" }, { "docid": "883f52b94c51f00c3b346e2c09272bf9", "score": "0.65821385", "text": "function betweenMinMax() {\n return userGuess()>=getMin() && userGuess()<=getMax();\n}", "title": "" }, { "docid": "5dd6f4724aed6af1fff64bf8f4357011", "score": "0.6580618", "text": "function clamp(x, min, max) {\n if (x < min) {\n return min;\n }\n if (x > max) {\n return max;\n }\n return x;\n }", "title": "" }, { "docid": "c4cdac388080b75b979ca8996bb524fd", "score": "0.65700746", "text": "function limits(x, y) {\n\treturn (x >= 0 && y >= 0) && (x < N && y < N);\n}", "title": "" }, { "docid": "cec3fd755781c22a7ef60d7478e49978", "score": "0.6568951", "text": "function Range(min : float, max : float) {\n\t\t\tvar rand = Value();\n\t\t\treturn min + (rand * (max - min));\n\t\t}", "title": "" }, { "docid": "ca71d423e59d97e88d8f8ed542b6c93d", "score": "0.65565217", "text": "function between(number, min, max) {\n if (number < min || number > max)\n return false;\n\n return true;\n}", "title": "" }, { "docid": "a1eda136e4480ef6e9ede5d390a5b0c7", "score": "0.655651", "text": "onRange(start, end) {\n return this.compareTo(start) >= 0 && this.compareTo(end) <= 0;\n }", "title": "" }, { "docid": "cea610d1ad89db075e42d5fde44cde8e", "score": "0.6556289", "text": "function clamp(min, max, value)\r\n{\r\n if ( max > min )\r\n return Math.min( max, Math.max(min, value) );\r\n else\r\n return Math.min( min, Math.max(max, value) );\r\n}", "title": "" }, { "docid": "ae83e689f57b5fd73bf568ad2542e414", "score": "0.6555619", "text": "function clamp(n, min, max) {\n return Math.max(min, Math.min(max, n));\n}", "title": "" }, { "docid": "eb18c1f7a2dc1c56625db1b56f43430d", "score": "0.65544355", "text": "function clamp(coor, min, max)\n{\n\tif(coor < min)\n\t\treturn min;\n\telse if (max < coor)\n\t\treturn max;\n\telse\n\t\treturn coor;\n}", "title": "" }, { "docid": "835a22513d7b53ebf80a796cb570b9d6", "score": "0.6549086", "text": "function always () {\n return {\n maximum: Number.MAX_VALUE,\n minimum: Number.MIN_VALUE,\n mask: 0\n }\n}", "title": "" }, { "docid": "241f4404d5a70352e77b33edfa96ef91", "score": "0.6546149", "text": "function _default(range, min, max) {\n let lo = range[0],\n hi = range[1],\n span;\n\n if (hi < lo) {\n span = hi;\n hi = lo;\n lo = span;\n }\n\n span = hi - lo;\n return span >= max - min ? [min, max] : [lo = Math.min(Math.max(lo, min), max - span), lo + span];\n}", "title": "" }, { "docid": "394af5ea4754396e06467779e65fbf05", "score": "0.65455765", "text": "setNumberBoundaries(number, boundaryMin, boundaryMax) {\n return number > boundaryMax ? boundaryMax : number < boundaryMin ? boundaryMin : number;\n }", "title": "" }, { "docid": "14d6a5464d4fb8a4ffaa3a79894b489c", "score": "0.6544111", "text": "function clamp(min, max, val) {\n return Math.min(Math.max(min, +val), max);\n}", "title": "" }, { "docid": "52f8bd4c9f7b494c6899dc59cbde52e6", "score": "0.65369606", "text": "constructor(min, max) {\n super();\n this.min = min;\n this.max = max;\n }", "title": "" }, { "docid": "86984934656a00beb02023e44928c5f2", "score": "0.65354294", "text": "function clamp(number, min, max) {\n if (number < min)\n return min;\n\n if (number > max)\n return max;\n\n return number;\n}", "title": "" }, { "docid": "f56e2cb0ecf09b70232646b4bc9dd2f5", "score": "0.6534198", "text": "function between(x, min, max) {\n return x >= min && x <= max;\n }", "title": "" }, { "docid": "cf8e4039f9d0c256510fee5b0c300939", "score": "0.6527749", "text": "function maxmin(a,b) {\n if (a>b) {\n console.log(a,'is grater than',b);\n } else {\n console.log(b,'is grater than',a);\n }\n}", "title": "" }, { "docid": "89bb563ed5ad4771ad1ba8639ac15742", "score": "0.6526906", "text": "function clamp(min, x, max) {\n return Math.max(min, Math.min(x, max));\n}", "title": "" }, { "docid": "89bb563ed5ad4771ad1ba8639ac15742", "score": "0.6526906", "text": "function clamp(min, x, max) {\n return Math.max(min, Math.min(x, max));\n}", "title": "" }, { "docid": "98fe347dcbc4ad001b714f8cdce10e78", "score": "0.6526832", "text": "function max(x, y) {\n return lte (x, y) ? y : x;\n }", "title": "" }, { "docid": "dcda05819d8d0ee9339f87438ab7fdf8", "score": "0.65230334", "text": "function between(val, min, max) {\n // where between means 'min < val <= max'\n var lowerBound = min,\n upperBound = max;\n if (val > lowerBound && val <= upperBound) {\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "1411a4b6d113246d24ff66b14b221045", "score": "0.6519908", "text": "function clamp(min, x, max) {\n return Math.max(min, Math.min(x, max));\n}", "title": "" }, { "docid": "81f2730528cd325bd26de2e821f7cdc5", "score": "0.6519849", "text": "function exercise8(amount1, amount2, minimum, maximum) {\n return (amount1 > minimum && amount1 < maximum && amount2 > minimum && amount2 < maximum);\n }", "title": "" }, { "docid": "8f1af66005f2065c2399b95da4b925dd", "score": "0.65191406", "text": "function getRandomIntegerExclusive(min, max) {\r\n return Math.floor(Math.random() * (max - min) + min);\r\n}", "title": "" }, { "docid": "0b919abd784ddcb864c5390af09f892e", "score": "0.6517561", "text": "function clamp (x, min, max) {\n if (x < min) {\n return min\n } else if (x > min && x < max) {\n return x\n } else if (x > max) {\n return max\n }\n }", "title": "" }, { "docid": "c85eec5967e426abe627ef0d0604f3e3", "score": "0.65120256", "text": "_assertRange(value) {\n if (Object(_util_TypeCheck__WEBPACK_IMPORTED_MODULE_4__[\"isDefined\"])(this.maxValue) && Object(_util_TypeCheck__WEBPACK_IMPORTED_MODULE_4__[\"isDefined\"])(this.minValue)) {\n Object(_util_Debug__WEBPACK_IMPORTED_MODULE_7__[\"assertRange\"])(value, this._fromType(this.minValue), this._fromType(this.maxValue));\n }\n return value;\n }", "title": "" }, { "docid": "47f7b9b0225bbc0b7bce43367826efcc", "score": "0.6510749", "text": "function clamp(min, n, max) {\n return Math.max(min, Math.min(n, max));\n}", "title": "" }, { "docid": "b573028fb81b4963da2386a75bd33f71", "score": "0.65001917", "text": "function clamp(value: number, min: number, max: number): number {\n if (value < min) {\n return min;\n }\n if (value > max) {\n return max;\n }\n return value;\n}", "title": "" }, { "docid": "24b55972c36d7cc9014cff3ab5511366", "score": "0.6493664", "text": "function between(x, min, max) {\n return x >= min && x <= max;\n}", "title": "" } ]
e6d1f2d798c704726a00fdf0d1f914d5
valida os dados digitados pelo usuario
[ { "docid": "7883024f8efc491a72927a2683bc517f", "score": "0.5929449", "text": "ValidacaoDeDados()\n\t{\t\t\t\n\t\tvar returnValue = true;\n\t\talert (this.cep.length);\n\n\t\t//verificar quantidade de casas no cep\n\t\tif(this.cep.length > 8)\n\t\t{\n\t\t\treturnValue = false;\n\t\t\talert('Cep informado inválido, numero muito grande');\n\n\t\t}\n\t\tif(this.cep.indexOf(\"-\") > -1){\n\t\t\treturnValue = false;\n\t\t\talert('Cep informado inválido, caracter especial encontrado');\n\n\t\t}\n\t\t//verificar quantidade de casas no telefone\n\t\tif(this.telefone.length > 12 || this.celular.length > 12 )\n\t\t{\n\t\t\treturnValue = false;\n\t\t\talert('contato informado inválido, numero muito grande');\n\n\t\t}\n\n\t\t//verificar quantidade de casas no cpf\n\t\tif(this.cpf.length > 11 )\n\t\t{\n\t\t\treturnValue = false;\n\t\t\talert('cpf informado inválido, numero muito grande');\n\n\t\t}\n\n\t\t//verificar quantidade de casas no cnh\n\t\tif(this.cnh.length > 11 )\n\t\t{\n\t\t\treturnValue = false;\n\t\t\talert('cnh informado inválido, numero muito grande');\n\n\t\t}\n\n\t\t//verificar email valido\n\t\tif(this.email.indexOf(\"@\") > -1 || this.email.indexOf(\".\") > -1){\n\n\t\t}else{\n\t\t\treturnValue = false;\n\t\t\talert('email informado inválido, caracter especial nao encontrado');\n\n\t\t}\n\n\t\t//verificar senha valida\n\t\tif(this.senha.indexOf(\"@\") > -1 || this.senha.indexOf(\".\") > -1){\n\n\t\t}else{\n\t\t\treturnValue = false;\n\t\t\talert('senha informado inválido, caracter especial nao encontrado');\n\n\t\t}\n\n\n\t\treturn returnValue;\n\t}", "title": "" } ]
[ { "docid": "45a18d649f676d7bd912b41c7f8ff3a9", "score": "0.6874098", "text": "function validarDNI(campo) {\n var input = campo.value; //input: valor del campo pasado\n var numero //numero del dni pasado\n var letr //letra del dni pasado\n var letra //letras posibles\n var expresion_regular_dni //expresion regular de un dni\n \n expresion_regular_dni = /^\\d{8}[a-zA-Z]$/;\n \n //si cumple la expresion regular\n if(expresion_regular_dni.test (input) == true){\n numero = input.substr(0,input.length-1);\n letr = input.substr(input.length-1,1);\n numero = numero % 23;\n letra='TRWAGMYFPDXBNJZSQVHLCKET';\n letra=letra.substring(numero,numero+1);\n\n //si la letra posible es distinta a la letra real\n if (letra!=letr.toUpperCase()) {\n alert('DNI no valido');\n return false;\n }else{\n return true;\n }\n }else{//si no cumple expresion regular\n alert('DNI no valido');\n return false;\n }\n}", "title": "" }, { "docid": "fd5705a417c90fec9488b734da14c0d6", "score": "0.68128383", "text": "function validarCedula(){\r\n\r\n if (checkIfEmpty(cedula)) return;\r\n // Revisar si solo contiene letras\r\n if (!checkIfOnlynumbers(cedula)) return;\r\n return true;\r\n}", "title": "" }, { "docid": "47b873626a1a934dbc9e5d2bd0dd0835", "score": "0.677077", "text": "function validarNumero(e,punto,id){\n var valor=\"\";\n\t\n\ttecla_codigo = (document.all) ? e.keyCode : e.which;\n\tvalor=document.getElementById(id).value;\n\t\n\t\n\tif(tecla_codigo==8 || tecla_codigo==0)return true;\n\tif (punto==1)\n\t\tpatron =/[0-9\\-.]/;\n\telse\n\t\tpatron =/[0-9\\-]/;\n\t\n\t\t\n\t//validamos que no existan dos puntos o 2 -\n\ttecla_valor = String.fromCharCode(tecla_codigo);\n\t//46 es el valor de \".\"\n\tif (valor.split('.').length>1 && tecla_codigo==46)\t\t\n\t{\n\t\treturn false;\n\t}\n\telse if (valor.split('-').length>1 && tecla_codigo==45)\t\t\n\t{\n\t\t//45 es el valor de \"-\"\n\t\treturn false;\n\t}\n\t\n\t\n\treturn patron.test(tecla_valor);\n\n}", "title": "" }, { "docid": "c5b9f704f4d736f19ceac54558f88d03", "score": "0.6757953", "text": "function isDiaMesValido(data){\n\n if (data.length > 0){\n var dia, mes;\n\n dia = data.charAt(0) + data.charAt(1);\n mes = data.charAt(3) + data.charAt(4);\n \n if (isNaN(dia) || isNaN(mes) || data.charAt(4) == ''){\n alert(\"Entre o dia e o mes no formato dd/MM. Dia e mes devem ter dois digitos. Ex.: 03/08\");\n return (false);\n }else{\n if (dia > 31) {\n alert(\"Dia do mes nao pode ser maior que 31.\");\n return (false);\n }else if (mes > 12){\n alert(\"So exitem 12 meses.\");\n return (false);\n }else if (mes == \"02\"){\n if(dia >= 30){\n alert(\"Fevereiro so vai ate dia 29.\");\n return (false);\n }else if ((dia == \"29\") && ((ano % 4) !== 0)){\n alert(\"Nao estamos num ano bisexto, fevereiro so tem 28 dias.\");\n return (false);\n } \n } // fim do bloco que verifica o mes de fevereiro\n } // fim do segundo bloco de if, caso a data ainda nao esteja invalida\n }// fim do bloco que verifica, a partir do tamanho do objeto, se a data foi digitada\n \n return (true); \n}", "title": "" }, { "docid": "f7a0d772ea7ecbb76bdc50d07cf7f3e3", "score": "0.6669166", "text": "function validar_cedula(valor){\n var RegExPattern = /^([0-9]{7,8})$/; // ####### ó ########\n if (RegExPattern.test(valor)){\n return [true,''];\n }else{ \n var complete = false;\n var msj = 'C&eacute;dula incorrecta!! m&iacute;nimo de 7 a 8 car&aacute;cteres.';\n return [false,msj];\t\n }\n}", "title": "" }, { "docid": "e2f0e43fe1e9273276c8cd83076d42f9", "score": "0.66549134", "text": "function validarNumTarjeta() {\n var numTarjeta = document.getElementById(\"numTarjeta\").value;\n var cadena = document.getElementById(\"numTarjeta\").value.toString;\n var longitud = cadena.length;\n var cifra = null;\n var cifra_cad = null;\n var suma = 0;\n for (var i = 0; i < longitud; i += 2) {\n cifra = parseInt(cadena.charAt(i)) * 2;\n if (cifra > 9) {\n cifra_cad = cifra.toString();\n cifra = parseInt(cifra_cad.charAt(0)) +\n parseInt(cifra_cad.charAt(1));\n }\n suma += cifra;\n }\n for (var i = 1; i < longitud; i += 2) {\n suma += parseInt(cadena.charAt(i));\n }\n\n if (numTarjeta == \"\") {\n document.getElementById(\"errorNumTarjeta\").innerHTML = \"El campo Núm. Tarjeta está vacio\";\n document.getElementById(\"numTarjeta\").style.border = \"2px solid red\";\n }\n if ((suma % 10) != 0) { \n document.getElementById(\"errorNumTarjeta\").innerHTML = \"El número de tarjeta no es válido\";\n document.getElementById(\"numTarjeta\").style.border = \"2px solid red\";\n }\n}", "title": "" }, { "docid": "d6087f336781f3220965a2258e9e6f9f", "score": "0.66274244", "text": "function validarEntrada(ingreso) {\n var chequeo = /^[0-9]+$/.test(ingreso);\n return chequeo\n}", "title": "" }, { "docid": "58f5a1a999bfe33a6a712fa79dd0e5f3", "score": "0.6520764", "text": "function validarDNI() {\n let numero;\n let letr;\n let letra;\n let dni = DNI.value;\n DNI.value = DNI.value.slice(0, 8) + DNI.value.charAt(8).toUpperCase();\n if(DNIv.test (dni) == true){\n numero = dni.substr(0,dni.length-1);\n letr = dni.substr(dni.length-1,1);\n numero = numero % 23;\n letra='TRWAGMYFPDXBNJZSQVHLCKET';\n letra=letra.substring(numero,numero+1);\n if (letra!=letr.toUpperCase()) {\n errorDNI.style.visibility = \"visible\";\n\t document.getElementById(\"DNI\").className = \"form-control is-invalid\";\n campos['DNI'] = false;\n }else{\n \terrorDNI.style.visibility = \"hidden\";\n\t\tdocument.getElementById(\"DNI\").className = \"form-control is-valid\";\n \tcampos['DNI'] = true;\n }\n }else{\n errorDNI.style.visibility = \"visible\";\n\t document.getElementById(\"DNI\").className = \"form-control is-invalid\";\n campos['DNI'] = false;\n }\n}", "title": "" }, { "docid": "c42d788fb82f69d93dd9a348f2a9f17e", "score": "0.6511575", "text": "function validarMovil() {\n \n \n var telefono = document.getElementById(\"telefono\").value;\n \n if(!(/^9|6\\d{8}$/.test(telefono))){\n alert(\"telefono incorrecto\");\n return false \n }\n }", "title": "" }, { "docid": "653553ce97fc34034bd6749de34f7c95", "score": "0.6493187", "text": "function valida_numeros(e){\n tecla = (document.all) ? e.keyCode : e.which;\n //Tecla de retroceso para borrar, siempre la permite\n if (tecla == 8 ){ return true; }\n if (tecla == 9 ){ return true; }\n if (tecla == 0 ){ return true; }\n if (tecla == 13 ){ return true; }\n \n // Patron de entrada, en este caso solo acepta numeros\n patron =/[0-9-.]/;\n tecla_final = String.fromCharCode(tecla);\n return patron.test(tecla_final);\n }", "title": "" }, { "docid": "653553ce97fc34034bd6749de34f7c95", "score": "0.6493187", "text": "function valida_numeros(e){\n tecla = (document.all) ? e.keyCode : e.which;\n //Tecla de retroceso para borrar, siempre la permite\n if (tecla == 8 ){ return true; }\n if (tecla == 9 ){ return true; }\n if (tecla == 0 ){ return true; }\n if (tecla == 13 ){ return true; }\n \n // Patron de entrada, en este caso solo acepta numeros\n patron =/[0-9-.]/;\n tecla_final = String.fromCharCode(tecla);\n return patron.test(tecla_final);\n }", "title": "" }, { "docid": "d37a9e192bf057e023f980a316a0b7ba", "score": "0.6490018", "text": "function validarTelefono(){\r\n\t\tvar valor = $(\"#txtTelefono\").val();\r\n\t\tif(valor!=\"\"){\r\n\t\t\tif(valor.length==9){\r\n\t\t\t\tband = 0;\r\n\t\t\t\tfor(var i = 0; i < valor.length;i++){\r\n\t\t\t\t\taux = valor.charCodeAt(i);\r\n\t\t\t\t\tif(i==0){\r\n\t\t\t\t\t\tif(aux<54 || aux>55){\r\n\t\t\t\t\t\t\tband++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(i>=1 && i<=3){\r\n\t\t\t\t\t\tif(aux<48 || aux>57){\r\n\t\t\t\t\t\t\tband++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(i==4){\r\n\t\t\t\t\t\tif(aux!=45){\r\n\t\t\t\t\t\t\tband++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(i>=5 && i<=8){\r\n\t\t\t\t\t\tif(aux<48 || aux>57){\r\n\t\t\t\t\t\t\tband++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}//termina for\r\n\t\t\t\tif(band==0){\r\n\t\t\t\t\t$(\"#txtTelefono\").attr('class','form-control is-valid');\r\n\t\t\t\t\t$(\"#mensajeTelefono\").replaceWith(\"<div id='mensajeTelefono' class='valid-feedback'><b>Campo completado correctamente </b></di>\");\r\n\t\t\t\t\ttelefono = true;\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\t$(\"#txtTelefono\").attr('class','form-control is-invalid').focus();\r\n\t\t\t\t\t$(\"#mensajeTelefono\").replaceWith(\"<div id='mensajeTelefono' class='invalid-feedback'><b>Por favor, use el formato solicitado (xxxx-xxxx)</b></di>\");\r\n\t\t\t\t\ttelefono = false;\r\n\t\t\t\t}\r\n\t\t\t}//termina if que valida que hayan 9 caracteres\r\n\t\t\telse{\r\n\t\t\t\t$(\"#txtTelefono\").attr('class','form-control is-invalid').focus();\r\n\t\t\t\t$(\"#mensajeTelefono\").replaceWith(\"<div id='mensajeTelefono' class='invalid-feedback'><b>Por favor, Introduzca 9 caracteres con el formato solicitado (xxxx-xxxx)</b></di>\");\r\n\t\t\t\ttelefono = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$(\"#txtTelefono\").attr('class','form-control is-invalid').focus();\r\n\t\t\t$(\"#mensajeTelefono\").replaceWith(\"<div id='mensajeTelefono' class='invalid-feedback'><b>Por favor, rellene este campo (*)</b></di>\");\r\n\t\t\ttelefono = false;\r\n\t\t}\r\n\t}//fin de la funcion para validar el telefono", "title": "" }, { "docid": "cddf08e5fa04d95cfece9ab8a5d9990c", "score": "0.6478947", "text": "function validaTelefono(){\n const REGEX=/^(\\d{9})$/;\n let telefono=document.getElementById(\"telefono\").value;\n return REGEX.test(telefono);\n}", "title": "" }, { "docid": "27f3263b9111a93c7b7ac46145e6b785", "score": "0.64597845", "text": "function validar(formulario) {\n const valor = formulario.campo1.value;\n let puntos = 0;\n if (valor.length == 0){\n alert('Ingresa un número');\n return false;\n } \n if (isNaN(n1=parseFloat(valor))) {\n alert('El valor que ingresaste NO es un número');\n return false;\n }\n if (n1 < 0 || n1 > 9.999) {\n alert('Ingrese un número entre 0 y 9.999');\n return false;\n }\n for( x of valor ){\n if ( x === '.'){\n puntos++;\n }\n if (puntos === 2){\n alert('El valor que ingresaste NO es un número');\n return false;\n }\n }\n return contarCifras(valor); \n}", "title": "" }, { "docid": "df8553043b141112886caf405af462ce", "score": "0.6442911", "text": "function validarCPF(cpf){\n if(cpf.value.length != 11){\n alert(\"CPF tem de ter 11 dígitos\");\n return;\n }\n else if(cpf.value.length == 11){\n for (c = 0; c < cpf.value.length; c++){\n if (!(cpf.value[c] >= '0' && cpf.value[c] <= '9')){\n alert('CPF só pode ter dígitos. Caracter \"' + cpf.value[c] + '\" inválido');\n return;\n };\n };\n };\n\n //validando os digitos do cpf\nfunction calculaDV(num) {\n var resto = 0, \n soma = 0;\n\n for (i = 2; i < 11; i++) {\n soma = soma + ((num % 10) * i);\n num = parseInt(num / 10);\n }\n resto = (soma % 11);\n return (resto > 1) ? (11 -resto) : 0;\n};\n var digitosCPF = cpf.value.slice(-2, cpf.value.length);\n var identCPF = cpf.value.slice(0, 9); \n\n primeiro_digito = calculaDV(identCPF)\n segundo_digito = calculaDV(identCPF * 10 + primeiro_digito)\n\n if (digitosCPF[0] != primeiro_digito || digitosCPF[1] != segundo_digito) {\n alert(\"Digitos verificadores inválidos!\");\n return; \n };\n}", "title": "" }, { "docid": "c5eb4ae38cbadec211af40d3b9471380", "score": "0.6429849", "text": "function validaDNI(){\n const REGEX=/^(\\d{8,8})+[A-Za-z]$/;\n let LETRAS = ['T','R','W','A','G','M','Y','F','P','D','X','B','N','J','Z','S','Q','V','H','L','C','K','E'];\n let dni=document.getElementById(\"dni\").value;\n let esValido=false;\n //Comprobamos que tiene la forma\n if(REGEX.test(dni)){\n //Si tiene la forma verificamos la letra\n esValido=dni.charAt(8).toUpperCase()==LETRAS[parseInt(dni.substring(0,8))%23];\n }\n return esValido;\n}", "title": "" }, { "docid": "5124a0072f5440c930173082860b358e", "score": "0.64290506", "text": "function validarCedula(inCedula)\n{\n var array = inCedula.split(\"\") ;\n var num = array.length;\n var total;\n var digito;\n var mult;\n var decena;\n var end;\n\n if(num == 10)\n {\n total = 0;\n digito = (array[9]*1);\n for( var i = 0; i<(num-1);i++)\n {\n mult = 0;\n if((i%2) != 0)\n {\n total = total + (array[i]*1);\n }\n else\n {\n mult = array[i]*2;\n if( mult > 9)\n {\n total = total + (mult - 9);\n }\n else\n {\n total = total + mult;\n }\n }\n\n }\n decena = total/10;\n decena = Math.floor(decena);\n decena = ( decena + 1 ) * 10;\n end = ( decena - total ) ;\n if((end == 10 && digito == 0)|| end == digito)\n {\n return true;\n }\n else\n {\n return false;\n }\n }\n else\n {\n return false;\n }\n}", "title": "" }, { "docid": "95b58ad8087a1b010a89841008595c84", "score": "0.6405073", "text": "function fDataValida(data){\n var err=0;\n if (data.length != 10) {\n err=1;\n }\n \n dia = data.substring(0, 2); // dia\n barra_1 = data.substring(2, 3); // '/'\n mes = data.substring(3, 5); // mes\n barra_2 = data.substring(5, 6); // '/'\n ano = data.substring(6, 10); // ano\n \n //check de erros b&aacute;sicos\n if (mes<1 || mes>12) err = 1;\n if (barra_1 != '/') err = 1;\n if (dia<1 || dia>31) err = 1;\n if (barra_2 != '/') err = 1;\n if (ano<1900 || ano>2999) err = 1;\n \n // meses com 30 dias\n if (mes==4 || mes==6 || mes==9 || mes==11){\n if (dia==31) err=1;\n }\n \n // tratamento para fevereiro\n if (mes==2){\n var aux=parseInt(ano/4);\n if (isNaN(aux)) {\n err=1;\n }\n \n if (dia>29) err=1;\n if (dia==29 && ((ano/4)!=parseInt(ano/4))) err=1;\n }\n \n if (err==1){\n return false;\n } else {\n return true;\n }\n}", "title": "" }, { "docid": "b9429cff940b087475b363e359300c6a", "score": "0.63913393", "text": "function letras_numeros_blanco(campo,px,py,clase,formu)\r\n{\r\n//alert(\"entro\");\r\n var checkOK = \"ABCDEFGHIJKLMN�OPQRSTUVWXYZ \" + \"abcdefghijklmn�opqrstuvwxyz \" + \"1234567890 \" + \" \";\r\n var checkStr = campo.value;\r\n var allValid = true; \r\n for (i = 0; i < checkStr.length; i++) {\r\n ch = checkStr.charAt(i); \r\n for (j = 0; j < checkOK.length; j++)\r\n if (ch == checkOK.charAt(j))\r\n break;\r\n if (j == checkOK.length) { \r\n allValid = false; \r\n break; \r\n }\r\n }\r\n //en caso de q no sea un caracter valido\r\n if (!allValid) { \r\n\t\t\t\t\tcampo.value=\"\";\r\n\t\t\t\t\t$(\"#cuadro_mensaje\").fadeIn();\r\n\t\t\t\t\t$(formu).creaTip2(\"Campo invalido, ingrese solo caracteres texto o n&uacute;mericos\",\"\",px,py,clase);\r\n \t\t\t\t\t} \r\n}", "title": "" }, { "docid": "36bfc48bd3f5996d002b87b2deb7d6fb", "score": "0.6378559", "text": "function isMesAnoValido(data){\n if (data.length > 0){\n var mes, ano;\n mes = data.charAt(0) + data.charAt(1);\n ano = data.charAt(3) + data.charAt(4) + data.charAt(5) + data.charAt(6);\n \n if (isNaN(mes) || isNaN(ano)){\n alert(\"Entre o mes e ano no formato mm/yyyy. Mes deve ter dois digitos e o ano quatro digitos. Ex.: 08/2013\");\n return (false);\n }else{\n if (mes > 12){\n alert(\"So exitem 12 meses.\");\n return (false);\n }else if ((ano < 1900) || (ano > 9999)) {\n alert (\"O ano deve estar no intervalo entre 1900 e 9999.\");\n return (false);\n } \n } \n }\n \n return (true); \n}", "title": "" }, { "docid": "fb8993d9aedf21af97b0d70d5a9a323c", "score": "0.63643485", "text": "function validarn(e){\n var teclado = (document.all)?e.keyCode:e.which;\n if(teclado == 8) return true;\n var patron = /[0-9\\d .]/;\n var prueba = String.fromCharCode(teclado);\n return patron.test(prueba);\n}", "title": "" }, { "docid": "8f12bf60103e4f6bf1ad33525b0b7e40", "score": "0.6358151", "text": "function validaSomenteInteiros(objeto, event, tammax) {\n if (document.all) // Internet Explorer\n var tecla = event.keyCode;\n else //Outros Browsers\n var tecla = e.which;\n\n if (event.keyCode == 13) {\n event.keyCode = 9;\n return true;\n }\n\n if (tecla >= 48 && tecla <= 57 || tecla == 8 || tecla == 0) {\n var tam;\n var vr = document.getElementById(objeto.id).value;\n vr = vr.toString().replace(\".\", \"\");\n vr = vr.toString().replace(\"/\", \"\");\n vr = vr.toString().replace(\",\", \"\");\n\n if (document.selection.createRange().text != '') {\n document.getElementById(objeto.id).value = '';\n return true;\n }\n\n if (vr.length + 1 <= tammax || tecla == 8 || tecla == 0) {\n return true;\n }\n return false;\n } else return false;\n}", "title": "" }, { "docid": "6c6e1c289831b7b5631a1c29eaa5077a", "score": "0.63535416", "text": "function validarNumeros(e) { // 1\n tecla = (document.all) ? e.keyCode : e.which; // 2\n if (tecla === 8)\n return true; // backspace\n if (tecla === 109)\n return true; // menos\n if (tecla === 110)\n return true; // punto\n if (tecla === 189)\n return true; // guion\n if (e.ctrlKey && tecla === 86) {\n return true\n }\n ; //Ctrl v\n if (e.ctrlKey && tecla === 67) {\n return true\n }\n ; //Ctrl c\n if (e.ctrlKey && tecla === 88) {\n return true\n }\n ; //Ctrl x\n if (tecla >= 96 && tecla <= 105) {\n return true\n } //numpad\n\n patron = /[0-9]/; // patron\n\n te = String.fromCharCode(tecla);\n return patron.test(te); // prueba\n}", "title": "" }, { "docid": "0884a0a1d263aacabeff68b5a1346927", "score": "0.6333626", "text": "function validarDNi() {\r\n\tvar numero\r\n\tvar letr\r\n\tvar letra\r\n\tDNi.value = DNi.value.slice(0,8) + DNi.value.charAt(8).toUpperCase();\r\n\tif(expresiones.dni.test(DNi.value)){\r\n\t numero = DNi.value.substr(0,DNi.value.length-1);\r\n\t letr = DNi.value.substr(DNi.value.length-1,1);\r\n\t numero = numero % 23;\r\n\t letra='TRWAGMYFPDXBNJZSQVHLCKET';\r\n\t letra=letra.substring(numero,numero+1);\r\n\t if (letra!=letr.toUpperCase()) {\r\n\t\tDNi.className = \"form-control is-invalid\";\r\n\t\terrorDNi.show();\r\n\t\tcampos['dni'] = false;\r\n\t }else{\r\n\t\tDNi.className = \"form-control is-valid\";\r\n\t\terrorDNi.hide();\r\n\t\terrorFormulario.hide();\r\n\t\tcampos['dni'] = true;\r\n\t }\r\n\t}else{\r\n\t\tDNi.className = \"form-control is-invalid\";\r\n\t\terrorDNi.show();\r\n\t\tcampos['dni'] = false;\r\n\t}\r\n}", "title": "" }, { "docid": "34747c158cdcc738d2f3d49ac10f5a41", "score": "0.63214725", "text": "function verificarEntrada(entrada){\r\n\t\r\n\tfor (var i = 0; i < entrada.length; i++){\r\n\t\tif(!(entrada[i].match(/[0-9]/g)))\r\n\t\t\treturn false;\r\n\t}\r\n\treturn true;\r\n}", "title": "" }, { "docid": "0a4dd80d848b8c3640a4c955bafc7350", "score": "0.6310582", "text": "function DataParcialOk( Valor )\n{\n var mes, ano;\n\n if( Valor.length == 6 )\n {\n mes = parseInt( Valor.substr( 0, 2 ), 10 );\n ano = parseInt( Valor.substr( 2, 4 ), 10 );\n\n if( mes < 1 || mes > 12 )\n return false;\n\n if( ano < 1901 || ano > 2100 )\n return false;\n\n return true;\n } // length\n return false;\n}", "title": "" }, { "docid": "d257b06e4de1cce8e2c77ba4c64cfb43", "score": "0.6291739", "text": "function validarCuit() {\n var validacion = false;\n var cuit = inputCuit.val();\n\n if (cuit === null || cuit.length === 0 || cuit === \"\") {\n $(\"#errorCuit\").removeClass(\"d-none\").addClass(\"d-flex\").find(\"small\").text(\"Debe insertar un Cuit\");\n $(\"#errorCuit\").fadeIn(\"slow\");\n } else if (!regexNumeros.test(cuit)) {\n\n $(\"#errorCuit\").removeClass(\"d-none\").addClass(\"d-flex\").find(\"small\").text(\"El Cuit debe ser numérico\");\n $(\"#errorCuit\").fadeIn(\"slow\");\n } else if ((cuit.length) != 11) {\n $(\"#errorCuit\").removeClass(\"d-none\").addClass(\"d-flex\").find(\"small\").text(\"El cuit debe tener 11 números\");\n $(\"#errorCuit\").fadeIn(\"slow\");\n } else {\n validacion = true;\n $(\"#errorCuit\").removeClass(\"d-flex\").addClass(\"d-none\");\n\n }\n return validacion;\n\n}", "title": "" }, { "docid": "36000f4369c63b61da21915c62fa0b8d", "score": "0.6275363", "text": "function validarNuevaBitacora(){\r\n\tvar informacionb = document.querySelector(\"#informacionNB\").value;\r\n\r\n\tif(informacionb == \"\"){\r\n\t\talert(\"CAMPOS VACIOS\");\r\n\t\treturn false;\r\n\t}\r\n\t// valido el campo informacion\r\n\tif(informacionb != \"\"){\r\n\t\tvar caracteres = informacionb.length;\r\n\t\tvar expresion = /^[a-zA-Z0-9. ]*$/;\r\n\t\tif(caracteres > 80){\r\n\t\t\tdocument.querySelector(\"label[for=informacionNB]\").innerHTML += \"<br>Escriba menos de 50 caracteres\";\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif(!expresion.test(informacionb)){\r\n\t\t\tdocument.querySelector(\"label[for='informacionNB']\").innerHTML += \"<br>Solo letras y puntos ( . )\";\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "1d17be4e9cfe6ee8607f4d4c082a67af", "score": "0.6275174", "text": "function validarEntero(valor){\n if(!Number.isInteger(valor)){\n alert(\"Número inválido; el valor ingresado no es un ENTERO\")\n return false\n }\n return true\n}", "title": "" }, { "docid": "6fa0e8e59270dc11b75652953bf46556", "score": "0.62732023", "text": "function verificarCamposVaciosLogin() {\n\tvar formLogin = document.getElementById(\"login\");\t\n\tformLogin.j_username.value = formLogin.j_username.value.toUpperCase();\n\tvar usuario = formLogin.j_username.value;\n\twhile (usuario.indexOf(\".\") != -1) {\n\t\tusuario = usuario.replace(\".\", \"\");\n\t}\n\tusuario = usuario.replace(\"-\", \"\");\n\t/*document.getElementById(\"login\").j_username.value=usuario;*/\n\tvar clave = formLogin.j_password.value;\n\tvar rut = usuario.substring(0, usuario.length - 1);\n\tvar digitoVerificador = usuario.substring(usuario.length - 1, usuario.length);\n\t\n\tfor (i = 0; i < rut.length; i++){\n\t\tif (!((rut.charAt(i) >= \"0\") && (rut.charAt(i) <= \"9\"))){\n \t\talert(\"El valor ingresado no corresponde a un RUT v\\u00e1lido\");\n\t\t//document.getElementById(\"msjAlerts\").innerHTML=\"El valor ingresado no corresponde a un RUT v\\u00e1lido\";\n\t\t//mostrarPopUpAlerts();\n \t\treturn false;\n \t } \t \n \t} \t\n\tif(rut>50000000){\n\t\talert(\"El valor ingresado no corresponde a un RUT v\\u00e1lido\");\n\t\t//document.getElementById(\"msjAlerts\").innerHTML=\"El valor ingresado no corresponde a un RUT v\\u00e1lido\";\n\t\t//mostrarPopUpAlerts();\n\t\treturn false;\n\t}\t\n\tif (usuario == \"\" && clave == \"\") {\n\t\talert(\"Debe ingresar un RUT y una Clave para poder ingresar\");\n\t\t//document.getElementById(\"msjAlerts\").innerHTML=\"Debe ingresar un RUT y una Clave para poder ingresar\";\n\t\t//mostrarPopUpAlerts();\n\t\treturn false;\n\t} else if (usuario == \"\") {\n\t\talert(\"Ingrese RUT\");\n\t\t//document.getElementById(\"msjAlerts\").innerHTML=\"Ingrese RUT\";\n\t\t//mostrarPopUpAlerts();\n\t\treturn false;\n\t} else if (clave == \"\") {\n\t\talert(\"Ingrese Clave\");\n\t\t//document.getElementById(\"msjAlerts\").innerHTML=\"Ingrese Clave\";\n\t\t//mostrarPopUpAlerts();\n\t\treturn false;\n\t} else if (digitoVerificador != calcularDigitoVerificadorRUT(rut)) {\n\t\talert(\"Ingrese un RUT v\\u00e1lido\");\n\t\t//document.getElementById(\"msjAlerts\").innerHTML=\"Ingrese un RUT v\\u00e1lido\";\n\t\t//mostrarPopUpAlerts();\n\t\treturn false;\n\t} else {\n\t\tvar errorDiv = document.getElementById(\"errorDiv\");\n\t\tif (errorDiv) {\n\t\t\terrorDiv.style.display = \"none\";\n\t\t}\n\t\t$j.blockUI({\n\t\t\tmessage : $j(\"#modalProcesando\")\n\t\t});\n\t}\n}", "title": "" }, { "docid": "4b281e21f7829d04207a39d52f36b69b", "score": "0.62621796", "text": "function validarAsignacionIntector(){\r\n\tvar cantidadI = document.querySelector(\"#cantidadAI\").value;\r\n\tvar comentariosI = document.querySelector(\"#comentariosAI\").value;\r\n\tif(cantidadI == \"\" || comentariosI == \"\"){\r\n\t\talert(\"CAMPOS VACIOS\");\r\n\t\treturn false;\r\n\t}\r\n\t// valido cantidad\r\n\tif(cantidadI != \"\"){\r\n\t\tvar caracteres = cantidadI.length;\r\n\t\tvar expresion = /^[0-4]*$/;\r\n\t\tif(caracteres > 4){\r\n\t\t\tdocument.querySelector(\"label[for=cantidadAI]\").innerHTML += \"<br>Solo puede asignar 4 Inyectores\";\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif(!expresion.test(cantidadI)){\r\n\t\t\tdocument.querySelector(\"label[for='cantidadAI']\").innerHTML += \"<br>Solo letras y puntos ( . )\";\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t// valido puesto/cargo de contacto hospital\r\n\tif(comentariosI != \"\"){\r\n\t\tvar caracteres = comentariosI.length;\r\n\t\tvar expresion = /^[a-zA-Z. ]*$/;\r\n\t\tif(caracteres > 50){\r\n\t\t\tdocument.querySelector(\"label[for=comentariosAI]\").innerHTML += \"<br>Escriba menos de 50 caracteres\";\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif(!expresion.test(comentariosI)){\r\n\t\t\tdocument.querySelector(\"label[for='comentariosAI']\").innerHTML += \"<br>Solo letras y puntos ( . )\";\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n}", "title": "" }, { "docid": "625d9c967a7e8b7f49f7189dd3963271", "score": "0.6260939", "text": "function numeros(campo,mensaje)\r\n{\r\n//alert(\"entro\");\r\n var checkOK = \"1234567890\";\r\n var checkStr = campo.value;\r\n var allValid = true; \r\n for (i = 0; i < checkStr.length; i++) {\r\n ch = checkStr.charAt(i); \r\n for (j = 0; j < checkOK.length; j++)\r\n if (ch == checkOK.charAt(j))\r\n break;\r\n if (j == checkOK.length) { \r\n allValid = false; \r\n break; \r\n }\r\n }\r\n //en caso de q no sea un caracter valido\r\n if (!allValid) { \r\n\t\t\t\t\tcampo.value=\"\";\r\n\t\t\t\t\t$(\"#cuadro_mensaje\").fadeIn();\r\n\t\t\t\t\t$(mensaje).html(\"Campo invalido, ingrese solo caracteres n&uacute;mericos\");\r\n\t\t\t\t\t//$(formu).creaTip2(\"Campo invalido, ingrese solo caracteres n&uacute;mericos\",\"\",px,py,clase);\r\n \t\t\t\t\t} \r\n}", "title": "" }, { "docid": "bd79fdf37b4d3d48743049499c87f605", "score": "0.6245571", "text": "function validarUsuario(){\r\n usuario.value = usuario.value.charAt(0).toUpperCase() + usuario.value.slice(1);\r\n\tif (expresiones.usuario.test(usuario.value)){\r\n\t\tusuario.className = \"form-control is-valid\";\r\n\t\terrorUsuario.hide();\r\n\t\terrorFormulario.hide();\r\n\t\tcampos['usuario'] = true;\r\n\t} else {\r\n\t\terrorUsuario.show();\r\n\t\tusuario.className = \"form-control is-invalid\";\r\n\t\tcampos['usuario'] = false;\r\n\t}\r\n}", "title": "" }, { "docid": "09c42480f0e034cea3884845ac0e13f9", "score": "0.6240249", "text": "function validarNumeros(e){\n tecla = (document.all) ? e.keyCode : e.which;\n if (tecla === 8)\n {\n return true;\n }\n patron = /[0-9]/;\n tecla_final = String.fromCharCode(tecla);\n return patron.test(tecla_final);\n}", "title": "" }, { "docid": "b19d83f46474346fedb8f90770be2115", "score": "0.62364626", "text": "function cadastrarUsuario() {\n //validar cadastro\n //validar nome (Se está em branco ou já foi cadastrado)\n if (nome.value == \"\") {\n document.getElementById(\"nomeValidar\").innerHTML = `O campo nome está em branco!`\n }\n\n //validar nascimento (Se está em branco)\n if (nascimento.value == \"\") {\n document.getElementById(\"nascimentoValidar\").innerHTML = `O campo data de nascimento está em branco!`\n }\n\n //validar se o campo cpf esta vazio e se esta correto\n\n\n\n if (cpf == \"\") {\n verificarCpf()\n document.getElementById(\"cpfValidar\").innerHTML = `Digite um CPF valido!`\n\n } else if ((cpf !== \"\") && (verificarCpf() == true)) {\n compararCpfs()\n\n }\n\n\n function verificarCpf() {\n\n //pegando o cpf do usuario do html\n let cpfUsuario = cpf.value\n\n //separando o cpf em digitos\n let cpfUsuarioDigitos = cpfUsuario.toString().split('')\n let digitos = cpfUsuarioDigitos.map(Number)\n\n //atribuindo variaveis aos 2 ultimos digitos do cpf\n let digitoVerificador1 = digitos[9]\n let digitoVerificador2 = digitos[10]\n\n //criando a variavel multiplicadora\n let multiplicadorDig1 = 10\n let multiplicadorDig2 = 11\n\n //criando variaveis soma dos dois digitos verificadores\n let somaVerificador1 = 0\n let somaVerificador2 = 0\n\n //verificacao do primeiro digito\n //loop para somar a multiplicacao dos 9 primeiros digit com 10, 9, 8... ate 2\n for (i = 0; i < 9; i++) {\n somaVerificador1 += (digitos[i] * (multiplicadorDig1))\n multiplicadorDig1--\n }\n\n //calculo padrao com a soma encontrada para verificar o primeiro digito\n let restoDigito1 = ((somaVerificador1 * 10) % 11)\n if (restoDigito1 == 10 || restoDigito1 == 11) {\n restoDigito1 = 0\n } else {\n restoDigito1\n }\n\n //verificacao do segundo digito\n //loop para somar a multiplicacao dos 10 primeiros digit com 11, 10, 9, 8... ate 2\n for (i = 0; i < 10; i++) {\n somaVerificador2 += (digitos[i] * multiplicadorDig2)\n multiplicadorDig2--\n }\n\n //calculo padrao com a soma encontrada para verificar o segundo digito\n let restoDigito2 = ((somaVerificador2 * 10) % 11)\n if (restoDigito2 == 10 || restoDigito2 == 11) {\n restoDigito2 = 0\n } else {\n restoDigito2\n }\n\n //resultado usuario\n if (restoDigito1 === digitoVerificador1 && restoDigito2 === digitoVerificador2) {\n return true;\n\n } else {\n return false;\n }\n }\n\n //validar se o cpf já foi cadastrado\n function compararCpfs() {\n\n let listaUsuarios = JSON.parse(localStorage.getItem(\"usuários\"))\n console.log(listaUsuarios)\n\n for (i = 0; i < usuarios.length; i++) {\n\n let numeroCpf = cpf.value\n var validarCpf = listaUsuarios.filter(c => c.cpf.includes(numeroCpf))\n console.log(validarCpf)\n if (validarCpf.length == 1) {\n document.getElementById(\"cpfValidar\").innerHTML = `Esse CPF já foi cadastrado!`\n return false\n }\n }\n\n }\n\n //validar se o e-mail está em branco\n if (email.value == \"\") {\n document.getElementById(\"emailValidar\").innerHTML = `O campo e-mail está em branco!`\n //validar se o e-mail esta escrito corretamente\n } else if (((email !== '') && (validarEmail(email) == false))) {\n document.getElementById(\"emailValidar\").innerHTML = `E-mail invalido!`\n\n } else {\n validarEmail(email)\n }\n\n //validacao da senha\n if (senha.value !== senhaConfirmacao.value) {\n document.getElementById(\"senhaValidar\").innerHTML = `Senhas incompatíveis!`\n }\n\n //função validar expressão do e-mail\n function validarEmail(email) {\n var emailCheck = email.value;\n var filtro = /^[a-z0-9._%+-]+@[a-z0-9.-]+\\.[a-z]{2,4}$/;\n if (filtro.test(emailCheck)) {\n return true;\n } else {\n return false;\n }\n }\n\n //validar bairro (Se está em branco)\n if ((bairro.value == \"\") || (dataBairros.includes(bairro.value) !== true)) {\n document.getElementById(\"bairroValidar\").innerHTML = `O campo bairro não foi selecionado!`\n }\n if (bairro.value == null) {\n document.getElementById(\"bairroValidar\").innerHTML = `O campo bairro não foi selecionado!`\n }\n\n //Fazer a validação das validações para rodar a função construtura e dar push no array\n if ((nome.value !== \"\") && (nascimento.value !== \"\") && (compararCpfs() !== false) && (verificarCpf() == true) && ((email.value !== \"\") && (validarEmail(email) == true)) && (senha.value == senhaConfirmacao.value) && (bairro.value !== \"\") && (dataBairros.includes(bairro.value) == true) && (bairro.value !== null)) {\n\n let novoUsuario = new criaUsuario(nome.value, nascimento.value, cpf.value, email.value, senha.value, bairro.value)\n usuarios.push(novoUsuario)\n alert(\"Usuário cadastrado com sucesso!\")\n localStorage.setItem(\"usuários\", JSON.stringify(usuarios))\n //window.location.href = \"loginUsuario.html\"\n }\n //limpar campos\n document.forms[0].reset();\n\n}", "title": "" }, { "docid": "bfaf8a5b15aca0688ce9e8714b073622", "score": "0.6211185", "text": "function valida_cedula(){\r\n\tcedula = document.fvalida.txtcedula.value; \r\n \tcedula = validarEntero(cedula); \r\n \tdocument.fvalida.txtcedula.value=cedula; \r\n\tif (cedula==\"\"){ \r\n \t document.fvalida.txtcedula.focus(); \r\n\t\r\n \t return 0; \r\n \t}\r\n\tif(document.fvalida.txtcedula.value.length>8){ \r\n \t alert(\"La cedula debe contener hasta 8 digitos\") \r\n \t document.fvalida.txtcedula.focus() \r\n\r\n \t return 0; \r\n \t} \r\n\treturn 1;\r\n}", "title": "" }, { "docid": "8018444d0c69682089b0b8a184d094c6", "score": "0.6205155", "text": "function revisarDigito( dvr)\n\t\t{\t\n\t\t\tdv = dvr + \"\"\t\n\t\t\tif ( dv != '0' && dv != '1' && dv != '2' && dv != '3' && dv != '4' && dv != '5' && dv != '6' && dv != '7' && dv != '8' && dv != '9' && dv != 'k' && dv != 'K')\t\n\t\t\t{\n\t\t\t\talert(\"Debe ingresar un digito verificador valido\");\t\t\t\t\n\t\t\t\treturn false;\t\n\t\t\t}\t\n\t\t\treturn true;\n\t\t}", "title": "" }, { "docid": "e7744ddc10c9627153b331aa08f6b581", "score": "0.62031364", "text": "function AdministrarValidacionesLogin() {\n var dni = document.getElementById(\"txtDni\").value;\n var apellido = document.getElementById(\"txtApellido\").value;\n var minDni = document.getElementById(\"txtDni\").min;\n var maxDni = document.getElementById(\"txtDni\").max;\n AdministrarSpanError(\"spanDni\", ValidarCamposVacios(dni));\n AdministrarSpanError(\"spanDni\", ValidarRangoNumerico(Number(dni), Number(minDni), Number(maxDni)));\n AdministrarSpanError(\"spanApellido\", ValidarCamposVacios(apellido));\n if (VerificarValidacionesLogin()) {\n alert(\"Todo Ok\");\n }\n}", "title": "" }, { "docid": "c8f22ddfa3118158551351c49b45ceee", "score": "0.6198686", "text": "passwordvalidate(input) {\n\t\t// explodir a string em array\n\t\tlet charArr = input.value.split(\"\");\n\n\t\tlet upperCase = 0;\n\t\tlet numbers = 0;\n\n\t\tfor (let i = 0; charArr.length > i; i++) {\n\t\t\tif (charArr[i] === charArr[i].toUpperCase() && isNaN(parseInt(charArr[i]))) {\n\t\t\t\tupperCase++;\n\t\t\t}\n\t\t\telse if (!isNaN(parseInt(charArr[i]))) {\n\t\t\t\tnumbers++;\n\t\t\t}\n\t\t}\n\n\t\tif (upperCase == 0 || numbers == 0) {\n\t\t\tlet errorMessage = \"A senha precisa de um caractere maiúsculo e um número\";\n\t\t\treturn this.printMessage(input, errorMessage);\n\t\t}\n\t\treturn true;\n\t}", "title": "" }, { "docid": "a120622b0063be99b279eeb6f4302d46", "score": "0.6198592", "text": "function validar_registro2(id, opcion) {\n \n var nombre, apellido, sexo, nacimiento, direccion, telefono, correo, cedula, expresion;\n\n nombre = document.getElementById(\"nombre\").value;\n apellido = document.getElementById(\"apellido\").value;\n sexo = document.getElementById(\"sexo\").value;\n nacimiento = document.getElementById(\"nacimiento\").value;\n direccion = document.getElementById(\"direccion\").value;\n telefono = document.getElementById(\"telefono\").value;\n correo = document.getElementById(\"correo\").value;\n cedula = document.getElementById(\"cedula\").value;\n \n \n \n expresion = /\\w+@\\w+\\.+[a-z]/;\n\n if( (nombre === \"\") || (apellido === \"\") || (sexo === \"N\") || (nacimiento === \"\") || \n (direccion === \"N\") || (telefono === \"\") || (correo === \"\") || (cedula === \"\") \n ){\n error(\"Todos los campo son obligatorios!\"); \n return false;\n }\n\n if( nombre.length > 20){\n error(\"El nombre es muy largo!\");\n return false;\n }\n\n var nacimiento1 = nacimiento.split(\"-\");\n var hoy = new Date();\n var anos= hoy.getUTCFullYear() - 18;\n \n \n if(nacimiento1[0] >= anos){\n if(nacimiento1[0] > anos){\n error('No es mayor de edad!');\n return false;\n }\n if(nacimiento1[0] == anos){\n var mes = (hoy.getMonth() + 1);\n if(nacimiento1[1] > mes){\n error('No es mayor de edad!');\n return false;\n }\n \n if(nacimiento1[1] == mes){\n var dia= hoy.getDate();\n if(nacimiento1[2] > dia){\n error('No es mayor de edad!');\n return false;\n }\n \n }\n \n }\n \n }\n\n if( (telefono.length < 14) || (telefono.length > 14) ){\n error(\"El telefono no es numero valido!\");\n return false;\n // (isNaN(telefono)) \n }\n\n if((telefono.slice(0, 5) != '(829)') && (telefono.slice(0, 5) != '(809)') && (telefono.slice(0, 5) != '(849)') ){\n error(\"El telefono no es numero valido!\");\n return false;\n\n }\n\n if(!expresion.test(correo)){\n error(\"El correo no es valido!\");\n return false;\n }\n\n $.ajax({\n type:\"POST\",\n url:\"/administrador/informacion\",\n data: {opcion : opcion},\n async: false,\n success:function(informacion){\n \n for(var n=0; n<informacion.length; n++){\n \n if(id != informacion[n].id){\n if(informacion[n].telefono == telefono){\n error(\"El telefono ingresado, ya se encuentra registrado!\");\n return false;\n }\n\n if(informacion[n].cedula == cedula){\n error(\"La cedula ingresado, ya se encuentra registrado!\");\n return false;\n }\n \n if(informacion[n].correo == correo){\n error(\"El correo ingresado, ya se encuntra registrado!\");\n return false;\n }\n }\n \n }\n \n editar_informacion(id, opcion);\n \n }\n \n }); \n \n}", "title": "" }, { "docid": "fcff05a628257382cd3be93d459a70e1", "score": "0.6186029", "text": "function validarClave() {\n \n \n \n var clave = document.getElementById(\"clave\").value;\n \n if(!(/^\\d\\D{3}\\W\\d/.test(valor))){\n alert(\"clave incorrecta\");\n return false;\n }\n \n return true;\n }", "title": "" }, { "docid": "bceee433290e27d4ac4921b9cbef5b81", "score": "0.61849236", "text": "function valAlfaNumerico(texto) {\r\n\tvar checkOK = \"ABCDEFGHIJKLMNÑOPQRSTUVWXYZÁÉÍÓÚ\" + \"abcdefghijklmnñopqrstuvwxyzáéíóú\" + \"@|.,_/-*#$%()=:;¿?¡! \" + \"0123456789\";\r\n\tvar checkStr = texto;\r\n\tvar allValid = true;\t\r\n\tfor(var i=0; i < checkStr.length; i++) {\r\n\t\tch = checkStr.charAt(i);\r\n\t\tfor (j=0; j<checkOK.length; j++)\r\n\t\t\tif (ch == checkOK.charAt(j)) break;\r\n\t\tif (j == checkOK.length) {\r\n\t\t\tallValid = false;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\treturn allValid;\r\n}", "title": "" }, { "docid": "221580ac45bb0cd9ee743378a16dbb6c", "score": "0.61833763", "text": "function validarCIF(cif)\n{\n var valueCif=cif.substr(1,cif.length-2);\n\n var suma=0;\n\n for(i=1;i<valueCif.length;i=i+2)\n {\n suma=suma+parseInt(valueCif.substr(i,1));\n }\n\n var suma2=0;\n\n for(i=0;i<valueCif.length;i=i+2)\n {\n result=parseInt(valueCif.substr(i,1))*2;\n if(String(result).length==1)\n {\n suma2=suma2+parseInt(result);\n }else{\n suma2=suma2+parseInt(String(result).substr(0,1))+parseInt(String(result).substr(1,1));\n }\n }\n\n suma=suma+suma2;\n\n var unidad=String(suma).substr(1,1)\n unidad=10-parseInt(unidad);\n\n var primerCaracter=cif.substr(0,1).toUpperCase();\n\n if(primerCaracter.match(/^[FJKNPQRSUVW]$/))\n {\n if(String.fromCharCode(64+unidad).toUpperCase()==cif.substr(cif.length-1,1).toUpperCase())\n return true;\n }else if(primerCaracter.match(/^[XYZ]$/)){\n var newcif;\n if(primerCaracter==\"X\")\n newcif=cif.substr(1);\n else if(primerCaracter==\"Y\")\n newcif=\"1\"+cif.substr(1);\n else if(primerCaracter==\"Z\")\n newcif=\"2\"+cif.substr(1);\n return validateDNI(newcif);\n }else if(primerCaracter.match(/^[ABCDEFGHLM]$/)){\n if(unidad==10)\n unidad=0;\n if(cif.substr(cif.length-1,1)==String(unidad))\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "486e3d3b259a9a4eb1dc093e8c2859b0", "score": "0.6179171", "text": "function validarRegistrssoPersonal(){\n\n var cedula = document.querySelector(\"#empleado_cedula\").value; \n\n var nombre = document.querySelector(\"#empleado_nombre\").value;\n\n var apellido = document.querySelector(\"#empleado_nombre\").value;\n\n\n\n /* VALIDAR CEDULA */\n\n if(cedula != \"\"){\n\n var caracteres = cedula.length;\n var expresion = /^[a-zA-Z0-9]*$/;\n\n if(caracteres > 8){\n\n document.querySelector(\"label[for='empleado_cedula']\").innerHTML += \"<br>Escriba por favor menos de 8 caracteres.\";\n\n return false;\n }\n\n if(!expresion.test(cedula)){\n\n document.querySelector(\"label[for='empleado_cedula']\").innerHTML += \"<br>No escriba caracteres especiales.\";\n\n return false;\n\n }\n\n if(usuarioExistente){\n\n document.querySelector(\"label[for='empleado_cedula'] span\").innerHTML = \"<p>Esta cedula ya existe en la base de datos</p>\";\n\n return false;\n }\n\n }\n\n /* VALIDAR empleado_nombre */\n\n if(nombre != \"\"){\n\n var caracteres = nombre.length;\n var expresion = /^[a-zA-Z0-9]*$/;\n\n if(caracteres > 20){\n\n document.querySelector(\"label[for='empleado_nombre']\").innerHTML += \"<br>Escriba por favor menos de 20 caracteres.\";\n\n return false;\n }\n\n if(!expresion.test(nombre)){\n\n document.querySelector(\"label[for='empleado_nombre']\").innerHTML += \"<br>No escriba caracteres especiales.\";\n\n return false;\n\n }\n\n }\n\n /* VALIDAR APELLIDO*/\n\n if(apellido != \"\"){\n\n var caracteres = apellido.length;\n var expresion = /^[a-zA-Z0-9]*$/;\n\n if(caracteres > 20){\n\n document.querySelector(\"label[for='empleado_apellido']\").innerHTML += \"<br>Escriba por favor menos de 20 caracteres.\";\n\n return false;\n }\n\n if(!expresion.test(apellido)){\n\n document.querySelector(\"label[for='empleado_apellido']\").innerHTML += \"<br>Escriba correctamente el apellido.\";\n\n return false;\n\n }\n\n\n }\n\n\n \nreturn true;\n\n}", "title": "" }, { "docid": "fa6d11dd3fbc2b2f092bf85a6d604641", "score": "0.6162574", "text": "function validar_hora(caja){\r\n\t\r\n\tvar hora_ingresada = $('#'+caja).val();//Tomo el valor ingresado por el usuario\r\n\t\r\n\tvar caracteres = hora_ingresada.length;//Cuantos caracteres tiene?\r\n\tvar horas = \"\";//Guardara las horas\r\n\tvar minutos = \"\";//Guardara los minutos\r\n\tvar cual = 1;//Bandera\r\n\tvar o = 1;//Me servira para tomar datos con substring, siempre un valor mas que i\r\n\t//stringObject.substring(start,stop) <-Asi funciona substring\r\n\tfor(i = 0; i < caracteres; i++)\r\n\t{//Un bucle para recorrer la hora ingresada\r\n\t\tletra = hora_ingresada.substring(i, o);//Tomo la letra correspondiente\r\n\t\to++;//Aumento la o para la proxima vuelta\r\n\t\t\r\n\t\tif(isNaN(letra))\r\n\t\t{\r\n\t\t\tcual = 2;//Si no es letra, debe ser : o . y me indica que hasta ahi llegan las horas y vienen los minutos\r\n\t\t}\r\n\t\telse{//Si es un numero debe ser tomado en cuenta\r\n\t\t\tif(cual == 1)\r\n\t\t\t{\r\n\t\t\t\thoras = horas + '' + letra;//Si la bandera es 1 debe guardar horas\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tif(1 < minutos.length)\r\n\t\t\t\t{//Si tiene ya dos digitos\r\n\t\t\t\t\t//No puede seguir\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tminutos = minutos + '' + letra;//Si la bandera es 2 debo guardar minutos\r\n\t\t\t}\r\n\t\t}\r\n\t}//Fin bucle\r\n\t\r\n\tif(horas == \"\")\r\n\t{\r\n\t\thoras = \"00\";//Si no hay horas, lo pongo a cero\r\n\t}\r\n\tif(minutos == \"\")\r\n\t{\r\n\t\tminutos = \"00\";//Si no hay minutos, lo pongo a cero\r\n\t}\r\n\t\r\n\thoras = parseInt(horas);\r\n\t\r\n\tif(59 < minutos)\r\n\t{//Algun chistoso?\r\n\t\thoras++;\r\n\t\t//No tengo tiempo para tonteras\r\n\t\tminutos = '00';\r\n\t}\r\n\t\r\n\tif(minutos.length == 1)\r\n\t{\r\n\t\tminutos = minutos + \"0\";//Si los minutos que resultaron es menor que 10 debo ponerles un cerillo delante \"07\"\r\n\t}\r\n\t\r\n\t$('#'+caja).val(horas + \":\" + minutos);//Asigno la hora resultante al textbox que hizo la peticion\r\n\t\r\n}", "title": "" }, { "docid": "b926afe87bd8d27f8d7a779cec8afc70", "score": "0.6141412", "text": "function soloLetrasNumeros(objLimpiar) {\n var txtTexto = objLimpiar.value;\n var txtResultado = \"\";\n var txtCaracter = \"\";\n for (i = 0; i < txtTexto.length; i++) {\n txtCaracter = txtTexto.charAt(i);\n\n if (\n txtCaracter.toString().charCodeAt(0) != 225 && // a\n txtCaracter.toString().charCodeAt(0) != 233 && // e\n txtCaracter.toString().charCodeAt(0) != 237 && // i\n txtCaracter.toString().charCodeAt(0) != 243 && // o\n txtCaracter.toString().charCodeAt(0) != 250 && // u\n txtCaracter.toString().charCodeAt(0) != 252 && // u + dieresis\n txtCaracter.toString().charCodeAt(0) != 241 && // � (enie)\n txtCaracter.toString().charCodeAt(0) != 193 && // A\n txtCaracter.toString().charCodeAt(0) != 201 && // E\n txtCaracter.toString().charCodeAt(0) != 205 && // I\n txtCaracter.toString().charCodeAt(0) != 211 && // O\n txtCaracter.toString().charCodeAt(0) != 218 && // U\n txtCaracter.toString().charCodeAt(0) != 220 && // U + dieresis\n txtCaracter.toString().charCodeAt(0) != 209 // � (enie mayuscula)\n ) {\n txtResultado += txtCaracter.replace(/[^A-Za-z0-9\\ ]/, \"\"); // solo se permiten letras, numeros, punto(.), slash(/), arroba(@), espacios( ) y tildes\n } else {\n txtResultado += txtCaracter;\n }\n }\n objLimpiar.value = txtResultado;\n}", "title": "" }, { "docid": "ffc742e4795503b376b9eff2f628f31b", "score": "0.6140576", "text": "function numberCheck(password){\nfor(i = 0; i < password.lenght; i++){\n\n if(password.charCodeAt(i) >=48 && password.charCodeAt(i) <=57){\n return true;\n }\n}\nreturn false;\n}", "title": "" }, { "docid": "1ef7f0f444d6f7775bcf91e853dc539e", "score": "0.6138997", "text": "function validar(e) {\n tecla = (document.all)?e.keyCode:e.which;//ascii\n //alert(tecla);\n switch(tecla){\n case 8:\n return true;\n break;\n case 46://punto\n return true;\n break;\n case 43://Mas\n return true;\n break;\n case 45://Menos\n return true;\n break;\n case 44://Coma\n return true;\n break;\n case 0://Suprimir\n return true;\n break;\n \n\n default:\n \n break;\n }\n patron = /\\d/;\n te = String.fromCharCode(tecla);\n \n return patron.test(te);\n \n}", "title": "" }, { "docid": "697d1d8d34a9136796d91af2be35fdb9", "score": "0.61386317", "text": "function valida_difito(rut)\n\t{\n\t\tvar tmpstr=\"\";\n\t\tvar tmprut, i;\n\t\tvar digito = \"\";\n\t\t\n\t\ttmprut = rut.value;\n\t\t\n\t\tif ( tmprut.length >= 9 && tmprut.length <= 10)\n\t\t{\n\t\t\tfor ( i=0; i < tmprut.length; i++ ) \n\t\t\t{\n\t\t\t\tif ( tmprut.charAt(i) != ' ' && tmprut.charAt(i) != '.' && tmprut.charAt(i) != '-' ) \n\t\t\t\t{\n\t\t\t\t\ttmpstr = tmpstr + tmprut.charAt(i); //obtengo el rut sin caracteres... osea: 111111111\n\t\t\t\t}\n\t\t\t}\n\t\t\ttmprut = \"\";\n\t\t\tlargo_rut = tmpstr.length; \t\n\t\t\n\t\t\tfor ( i=0; i < largo_rut-1; i++ )\n\t\t\t{\n\t\t\t\ttmprut = tmprut + tmpstr.charAt(i); //obtengo el rut sin digito verificador\n\t\t\t}\n\t\t\tdigito= tmpstr.charAt(largo_rut-1);\t\t\t//obtengo el digito verificador\n\t\t\n\t\t\tvar dvr = '0';\n\t\t\tsuma = 0;\n\t\t\tmul = 2;\n\n\t\t\tfor (i= tmprut.length - 1 ; i >= 0; i--) \n\t\t\t{\n\t\t\t\tsuma = suma + tmprut.charAt(i) * mul;\n\t\t\t\tif (mul == 7)\n\t\t\t\t\tmul = 2;\n\t\t\t\telse\n\t\t\t\t\tmul++;\n\t\t\t}\n\n\t\t\tres = suma % 11;\n\t\t\tif (res==1)\n\t\t\t{\n\t\t\t\tdvr = 'k';\n\t\t\t}\n\t\t\telse if (res==0) \n\t\t\t{\n\t\t\t\tdvr = '0';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdvi = 11-res;\n\t\t\t\tdvr = dvi + \"\";\n\t\t\t}\n\t\t\tif (dvr != digito.charAt(0).toLowerCase()) \n\t\t\t{\n\t\t\t\talert(\"El RUT ingresado es inválido, ingreselo nuevamente\");\n\t\t\t\trut.value=\"\";\n\t\t\t\trut.focus();\n\t\t\t\treturn false; //El DV no concordo con el RUT.\n\t\t\t}\n\n\t\t\treturn true; //EL DV concordo con el RUT.\n\t\t}\n\t\telse if( tmprut.length = 0 )\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\talert(\"El RUT ingresado es inválido, ingreselo nuevamente\");\n\t\t\trut.value=\"\";\n\t\t\trut.focus();\n\t\t\treturn false;\n\t\t}\n\n\t}", "title": "" }, { "docid": "64e445dbbefe2fe8f91f868b9f4ce9b2", "score": "0.61281985", "text": "function validar(formulario) {\n const valor = formulario.campo1.value;\n let puntos = 0;\n if (valor.length == 0){\n alert('Ingresa un número');\n return false;\n } \n if (isNaN(n1=parseFloat(valor))) {\n alert('El valor que ingresaste NO es un número');\n return false;\n }\n if (n1 < 0 || n1 > 9.999) {\n alert('Ingrese un número entre 0 y 9.999');\n return false;\n }\n for( x of valor ){\n if ( x === '.'){\n puntos++;\n }\n if (puntos === 2){\n alert('El valor que ingresaste NO es un número');\n return false;\n }\n }\n return factorial(valor); \n}", "title": "" }, { "docid": "9e25db1aa32f2303a4b931f49d6eaa50", "score": "0.61156636", "text": "function validacion() {\n if(valUsuario()&&valNombre()&&valApellido()&&valContraseña()&&valContraseña()&&valFecha()&&valSexo()&&valPuesto()&&valCorreo()&&valNivel()){\n validarUsuario();\n }\n }", "title": "" }, { "docid": "9ba265fc9ba65e921c36fe2b3a844bd0", "score": "0.6110936", "text": "function validarContrasenia(cont) {\n if (cont.length > 8 || cont.length < 6) {\n alert(\"Su contraseña debe tener entre 6 y 8 caracteres\");\n return false;\n } \n\n}", "title": "" }, { "docid": "9ba265fc9ba65e921c36fe2b3a844bd0", "score": "0.6110936", "text": "function validarContrasenia(cont) {\n if (cont.length > 8 || cont.length < 6) {\n alert(\"Su contraseña debe tener entre 6 y 8 caracteres\");\n return false;\n } \n\n}", "title": "" }, { "docid": "3d29083d0288e00c3b1010de4734808d", "score": "0.6107169", "text": "function validar(e) {\n tecla = (document.all)?e.keyCode:e.which;//ascii\n //alert(tecla);\n switch(tecla){\n case 8:\n return true;\n break;\n case 46://punto\n return true;\n break;\n case 43://Mas\n return true;\n break;\n case 45://Menos\n return true;\n break;\n case 44://Coma\n return true;\n break;\n case 0://Suprimir\n return true;\n break;\n default:\n break;\n }\n patron = /\\d/;\n te = String.fromCharCode(tecla);\n \n return patron.test(te);\n \n}", "title": "" }, { "docid": "acd2f8af43397b7a821a0b3e1ed0453d", "score": "0.6095669", "text": "function verificaRango(){\n\tvar numero = $(\"#rangoFinal\").val();\n\tvar expresion = /\\d{10}/;\n\t\n\tif(expresion.test(numero)){\n\t\tvar fin = parseInt(numero);\n\t\tvar inicio = parseInt($(\"#rangoInicial\").val());\n\t\tif(fin<=inicio){\n\t\t\talert(\"El rango final debe ser mayor que el rango inicial.\");\t\n\t\t\treturn false;\n\t\t}else{\n\t\t\treturn true;\n\t\t} \t\t\t\t\n\t}else{\n\t\talert(\"El teléfono no debe contener letras.\");\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "cc508cceef47a3dfcd825dcee24accac", "score": "0.60935247", "text": "function validarCaracter(e,punto,id){\n var valor=\"\";\n\t\n\ttecla_codigo = (document.all) ? e.keyCode : e.which;\n\t\n\tvalor=document.getElementById(id).value;\n\n\tif(tecla_codigo==8 || tecla_codigo==0 )return true;\n\t\n\tpatron =/[A-Z, a-z,0-9\\-.éáíóú_.#@ñÑ]/;\n\t\n\tif (punto==0 && tecla_codigo==32) \n\t{\n\t\t\n\t\treturn false;\n\t}\n\t\n\t//validamos que no existan dos puntos o 2 -\n\ttecla_valor = String.fromCharCode(tecla_codigo);\n\t\n\treturn patron.test(tecla_valor);\n\n}", "title": "" }, { "docid": "01cc8feb198a1c0c1f9d9c1b753915d7", "score": "0.60850215", "text": "function valNumericoEntero(texto) {\r\n\tvar checkOK = \"0123456789\";\r\n\tvar checkStr = texto;\r\n\tvar allValid = true;\r\n\tfor(var i=0; i < checkStr.length; i++) {\r\n\t\tch = checkStr.charAt(i);\r\n\t\tfor (var j=0; j<checkOK.length; j++)\r\n\t\t\tif (ch == checkOK.charAt(j)) break;\r\n\t\tif (j == checkOK.length) {\r\n\t\t\tallValid = false;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\treturn allValid;\r\n}", "title": "" }, { "docid": "f02be01d33303b83f06b50e7becdb1be", "score": "0.6080293", "text": "function validarNumerosSi(parametro){\r\n\r\n let letras=\"abcdefghyjklmnñopqrstuvwxyzAABCDFEFGHJIKLÑOPQRSTUVWXYZ,\";\r\n\r\n parametro = parametro.toLowerCase();\r\n for(i=0; i<parametro.length; i++){\r\n if (letras.indexOf(parametro.charAt(i),0)!=-1){\r\n return 1;\r\n }\r\n }\r\n return 0;\r\n}", "title": "" }, { "docid": "30286b04eb347c882e3fe51a913daa00", "score": "0.60779345", "text": "function ValidarNumeros(evt) {\n if (window.event) {//asignamos el valor de la tecla a keynum\n keynum = evt.keyCode; //IE\n } else {\n keynum = evt.which; //FF\n }\n //comprobamos si se encuentra en el rango numérico y que teclas no recibirá.\n if ((keynum > 47 && keynum < 58) || keynum === 8 || keynum === 13 || keynum === 6) {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "22c4350ffddb10b29c44c6449ebd2a23", "score": "0.60762185", "text": "function validarRegistroInyector(){\r\n\tvar nombreI = document.querySelector(\"#nombreI\").value;\r\n\tvar descripcionI = document.querySelector(\"#descripcionI\").value;\r\n\tif(nombreI == \"\" || descripcionI == \"\"){\r\n\t\talert(\"CAMPOS VACIOS\");\r\n\t\treturn false;\r\n\t}\r\n\t// valido el nombre del Inyector\r\n\tif(nombreI != \"\"){\r\n\t\tvar caracteres = nombreI.length;\r\n\t\tvar expresion = /^[a-zA-Z0-9. ]*$/;\r\n\t\tif(caracteres > 25){\r\n\t\t\tdocument.querySelector(\"label[for=nombreI]\").innerHTML += \"<br>Escriba menos de 25 caracteres\";\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif(!expresion.test(nombreI)){\r\n\t\t\tdocument.querySelector(\"label[for='nombreI']\").innerHTML += \"<br>Solo letras y puntos ( . )\";\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t// valido descripcion del inyector\r\n\tif(descripcionI != \"\"){\r\n\t\tvar caracteres = descripcionI.length;\r\n\t\tvar expresion = /^[a-zA-Z. ]*$/;\r\n\t\tif(caracteres > 25){\r\n\t\t\tdocument.querySelector(\"label[for=descripcionI]\").innerHTML += \"<br>Escriba menos de 25 caracteres\";\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif(!expresion.test(descripcionI)){\r\n\t\t\tdocument.querySelector(\"label[for='descripcionI']\").innerHTML += \"<br>Solo letras y puntos ( . )\";\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n}", "title": "" }, { "docid": "c256e6fd2b3fae1b84c2a048063c592e", "score": "0.60744977", "text": "function validaNumeroMovil (argNumero){\n let regex_fono = /^9[0-9]{8}$/;\n \n if (argNumero.match(regex_fono)) {\n return true\n }\n else {\n return false\n }\n}", "title": "" }, { "docid": "b2b951297b6734a1320c147ec698e629", "score": "0.60679126", "text": "function validarNombre(){\r\n\t\tvar valor = $(\"#txtNombre\").val();\r\n\t\tvar valorId = \"\";\r\n\t\tvar contador = 0;\r\n\t\tif(valor!=\"\"){\r\n\t\t\tband = 0;\r\n\r\n\t\t\tfor(var i = 0; i < valor.length; i++){\r\n\t\t\t\taux = valor.charCodeAt(i);\r\n\t\t\t\tif( (aux>=65 && aux<=90) ||(aux>=97 && aux<=122) || aux==209 || aux==241 || aux==32 || aux==225 || aux==233 || aux==237 || aux==243 || aux==250 || aux==193 || aux==201 || aux==205 || aux==218 ){\r\n\t\t\t\t\tband = band;\r\n\t\t\t\t\tif(i==0){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvalorId += valor[i];\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(aux==32){\r\n\t\t\t\t\t\tcontador++;\r\n\t\t\t\t\t\tif(contador<4){\r\n\t\t\t\t\t\t\ti++;\r\n\t\t\t\t\t\t\tvalorId += valor[i];\r\n\t\t\t\t\t\t\ti--;\r\n\t\t\t\t\t\t}\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tband++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(band!=0){\r\n\t\t\t\t$(\"#txtNombre\").attr('class', 'form-control is-invalid').focus();\r\n\t\t\t\t$(\"#mensajeNombre\").replaceWith(\"<div id='mensajeNombre' class='invalid-feedback'><b>Por favor, solo introduzca letras (*)</b></di>\");\r\n\t\t\t\tnombre = false;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tif(valor.length>=5 && valor.length<=50){\r\n\t\t\t\t\t$(\"#txtNombre\").attr('class', 'form-control is-valid');\r\n\t\t\t\t\t$(\"#mensajeNombre\").replaceWith(\"<div id='mensajeNombre' class='valid-feedback'><b>Campo completado correctamente </b></di>\");\r\n\t\t\t\t\tnombre = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar anio = \"19\";\r\n\t\t\t\t\tvalorId += anio;\r\n\t\t\t\t\tvalorId = valorId.toUpperCase();\r\n\t\t\t\t\t$(\"#txtId\").val(valorId);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\t$(\"#txtNombre\").attr('class', 'form-control is-invalid').focus();\r\n\t\t\t\t\t$(\"#mensajeNombre\").replaceWith(\"<div id='mensajeNombre' class='invalid-feedback'><b>Por favor introduzca caracteres en un rango de 5 - 50 (*)</b></di>\");\r\n\t\t\t\t\tnombre = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$(\"#txtNombre\").attr('class', 'form-control is-invalid').focus();\r\n\t\t\t$(\"#mensajeNombre\").replaceWith(\"<div id='mensajeNombre' class='invalid-feedback'><b>Por favor, rellene este campo (*)</b></di>\");\r\n\t\t\tnombre = false;\r\n\t\t}\r\n\t}// Fin de la funcion para validar el Nombre.", "title": "" }, { "docid": "c1982d1a15833480bdf83f79fa333906", "score": "0.6063932", "text": "function comprobarDni(campo,formulario){\n\t//Si el formulario es search\n\tif(formulario == 'search'){\n\t\t\t\t\t//Si la longitud del campo es 0\n\t\t\t\t\tif(campo.value.length==0){\n\t\t\t\t\t\treturn true;\n //Sino si el valor del campo es menor de 9(tamaño maximo de dni)\n\t\t\t\t}else if(campo.value.length<9){\n\t\t\t\t\tif(/[a-z-A-Z]{2,}/.test(campo.value)){//Comprueba que solo haya una letra \n\t\t\t\t\t\talert('Los dni solo tienen una letra mayúscula');\n\t\t\t\t\t\tcampo.focus();\n\t\t\t\t\t\t\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t} else if(/^[0-9]+[a-z]+$/.test(campo.value) || (/^[a-z]+$/.test(campo.value) )){ //Comprueba que tenga una letra mayuscula\n\t\t\t\t\t\talert('Los dni solo tienen una letra mayúscula');\n\t\t\t\t\t\tcampo.focus();\n\t\t\t\t\t\t\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}else{//Sino, devuelve cierto\n\t\t\t\t\t\n\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}else{//Si la longitud es de 9 o mayor\n\t\t\t\t\t\tif(campo.value.trim().length === 0){\n\t\t\t\t\t\t\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(/^[a-z]+$/.test(campo.value)){//Comprueba que la letra DNI sea mayuscula y sino lo es, de un aviso\n\t\t\t\t\t\t\talert('Los Dni se escriben con mayuscula');\n\t\t\t\t\t\t\tcampo.focus();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t//Se mete en una variable una subcadena del valor de campo\n\t\t\t\t\t\t\t numero = campo.value.substr(0,campo.value.length-1);\n\t\t\t\t\t\t\t //Se mete en otra variable una subcadena del valor de campo\n\t\t\t\t\t\t\t let = campo.value.substr(campo.value.length-1,1);\n\t\t\t\t\t\t\t //Se coge el resto de la division de la primera variable entre 23\n\t\t\t\t\t\t\t numero = numero % 23;\n\t\t\t\t\t\t\t //Se forma un array con todas las letras en mayuscula\n\t\t\t\t\t\t\t letra='TRWAGMYFPDXBNJZSQVHLCKET';\n\t\t\t\t\t\t\t //Se hace una cadena con letra \n\t\t\t\t\t\t\t letra=letra.substring(numero,numero+1);\n\t\t\t\t\t\t\t //Si el valor de la variable letra no coincide con la letra mayuscula del campo,se devuelve false y un error.Si coinciden,devuelve true\n\t\t\t\t\t\t\t if (letra!=let) {\n\t\t\t\t\t\t\t\talert('Dni erroneo');\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t}else{\n\t\t\n\t\tif((/^[0-9]*[a-z]+$/.test(campo.value))){//Comprueba que la letra DNI sea mayuscula y sino lo es, de un aviso\n\t\t\t\t\t\t\talert('Los Dni se escriben con mayuscula');\n\t\t\t\t\t\t\tcampo.style.backgroundColor = \"rgba(255, 117, 117, 0.58)\";\n\t\t\t\t\t\t\tcampo.focus();\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t//Se mete en una variable una subcadena del valor de campo\n\t\t\t\t\t\t\t numero = campo.value.substr(0,campo.value.length-1);\n\t\t\t\t\t\t\t //Se mete en otra variable una subcadena del valor de campo\n\t\t\t\t\t\t\t let = campo.value.substr(campo.value.length-1,1);\n\t\t\t\t\t\t\t //Se coge el resto de la division de la primera variable entre 23\n\t\t\t\t\t\t\t numero = numero % 23;\n\t\t\t\t\t\t\t //Se forma un array con todas las letras en mayuscula\n\t\t\t\t\t\t\t letra='TRWAGMYFPDXBNJZSQVHLCKET';\n\t\t\t\t\t\t\t //Se hace una cadena con letra \n\t\t\t\t\t\t\t letra=letra.substring(numero,numero+1);\n\t\t\t\t\t\t\t //Si el valor de la variable letra no coincide con la letra mayuscula del campo,se devuelve false y un error.Si coinciden,devuelve true\n\t\t\t\t\t\t\t if (letra!=let) {\n\t\t\t\t\t\t\t\talert('Dni erroneo');\n\t\t\t\t\t\t\t\tcampo.style.backgroundColor = \"rgba(255, 117, 117, 0.58)\";\n\t\t\t\t\t\t\t\tcampo.focus();\n //Si el valor del campo sin espacios es 0\n\t\t\t\t\t\t\t\tif(campo.value.trim().length == 0){\n\t\t\t\t\t\t\t\tcampo.style.backgroundColor = \"white\";\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tcampo.style.backgroundColor = \"white\";\t\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\t\t\n\t}\n \t\n}", "title": "" }, { "docid": "ffc13294f2668eba178f3fb1588dd80e", "score": "0.6060262", "text": "passwordvalidate(input){\n\n //explodir string em um array \n let charAr = input.value.split(\"\")\n\n let uppercases = 0\n let number = 0\n\n for(let i = 0;charAr.length > i;i++){\n if(charAr[i] === charAr[i].toUpperCase() && isNaN(parseInt(charAr[i]))){\n uppercases++\n }else if(!isNaN(parseInt(charAr[i]))){\n number++\n\n }\n }\n if(uppercases === 0 || number === 0){\n let errormessage = `A senha precisa de um caractere maiusculo e um número`\n\n this.imprimirmessage(input,errormessage)\n\n }\n }", "title": "" }, { "docid": "3fff34118db4e7fa8564cd5cfe9c670d", "score": "0.60572386", "text": "function Tel(t){\r\n\tvar1 = parseInt(t);\r\n\t if ( isNaN(var1)) { \r\n\t alert(\"El numero de telefono ingresado no es valido, por favor solo ingrese números.\");\r\n\t return false;\r\n\t }else{\r\n\t\t largo = t.length;\r\n\t\t if((largo < 6) || (largo > 9)){\r\n\t\t\t alert(\"El numero de telefono debe contener entre 6 y 9 digitos\");\r\n\t\t\t window.document.ModEmpForm.tel_emp.focus();\t\t\r\n\t\t\t window.document.ModEmpForm.tel_emp.select();\r\n\t\t\t return false;\r\n\t\t\t \r\n\t\t }else{\r\n\t\t\t return true;\r\n\t\t }\r\n\t }\r\n\t\r\n}", "title": "" }, { "docid": "5ca3229a9acf51c1f61fae02012f5600", "score": "0.60558766", "text": "function validarNumeros(parametro) {\r\n\tif (!/^([0-9])*$/.test(parametro)) {\r\n\t\treturn false;\r\n\t}else {\r\n\t\treturn true;\r\n\t}\r\n}", "title": "" }, { "docid": "f0ad6c8f3de9e50efa9a65765766f5d4", "score": "0.60535693", "text": "function letras_numeros3(campo)\r\n{\r\n//alert(\"entro\");\r\n var checkOK = \"ABCDEFGHIJKLMNÑOPQRSTUVWXYZÁÉÍÓÚ \" + \"abcdefghijklmnñopqrstuvwxyzaeiou \" + \"1234567890 \" + \"_\";\r\n var checkStr = campo.value;\r\n var allValid = true; \r\n for (i = 0; i < checkStr.length; i++) {\r\n ch = checkStr.charAt(i); \r\n for (j = 0; j < checkOK.length; j++)\r\n if (ch == checkOK.charAt(j))\r\n break;\r\n if (j == checkOK.length) { \r\n allValid = false; \r\n break; \r\n }\r\n }\r\n //en caso de q no sea un caracter valido\r\n if (!allValid) { \r\n\t\t\t\t\tvar cadena=campo.value;\r\n\t\t\t\t\tvar longitud=cadena.length-1;\r\n\t\t\t\t\tvar valor=cadena.substring(0,longitud);\r\n\t\t\t\t\t//alert(valor);\r\n\t\t\t\t\tcampo.value=valor;\r\n \t\t\t\t} \r\n}", "title": "" }, { "docid": "5504ef7a9d3f2aaa68378fcfab836ae7", "score": "0.60430884", "text": "function validar(formulario) {\n if ((formulario.campo1.value.length == 0) || (formulario.campo2.value.length ==0)) {\n alert('Ingresa los datos numéricos');\n return false\n } \n if (isNaN(n1=parseInt(formulario.campo1.value))) {\n alert('El valor que ingresaste en el Campo 1 NO es un número');\n return false;\n }\n if (isNaN(n2=parseInt(formulario.campo2.value))) {\n alert('El valor que ingresaste en el Campo 2 NO es un número');\n return false;\n }\n return ordenar(n1,n2);\n}", "title": "" }, { "docid": "9b2600c0f9c4082b5c9f09379f1e97ef", "score": "0.60389", "text": "function validarDni($dni) {\n\n\t//Variable boolean\n\tvar $isCorrect = true;\n\n\t//Variables letras DNI\n\tvar $letras = ['T', 'R', 'W', 'A', 'G', 'M', 'Y', 'F', 'P', 'D', 'X', 'B', 'N', 'J', 'Z', 'S', 'Q', 'V', 'H', 'L', 'C', 'K', 'E', 'T'];\n\n\t//Validar campos\n\tif($dni.val() == '' || !(/^\\d{8}[A-Z]$/.test($dni.val()))) {\n\t\t\n\t\t$isCorrect = false;\n\t\t\n\t} else {\n\t\n\t\treturn $isCorrect;\n\t\t\n\t}\n\n}", "title": "" }, { "docid": "c02888acb5a218139ca2a20cafb1887e", "score": "0.60378724", "text": "function controllaCAP() {\n if (document.formsignup.cap.value.length!=5) {\n alert(\"Il CAP deve contenere 5 cifre\");\n return false;\n }\n var v=parseInt(document.formsignup.cap.value);\n if (isNaN(v)) {\n alert(\"Il CAP deve essere un numero\");\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "6a63aab135f1c778a07f799d30e82fa1", "score": "0.603436", "text": "function Tel(t){\r\n\tvar1 = parseInt(t);\r\n\t if ( isNaN(var1)) { \r\n\t alert(\"El numero de telefono ingresado no es valido, por favor solo ingrese números.\");\r\n\t return false;\r\n\t }else{\r\n\t\t largo = t.length;\r\n\t\t if((largo < 6) || (largo > 9)){\r\n\t\t\t alert(\"El numero de telefono debe contener entre 6 y 9 digitos\");\r\n\t\t\t window.document.RegTraForm.tel_tra.focus();\t\t\r\n\t\t\t window.document.RegTraForm.tel_tra.select();\r\n\t\t\t return false;\r\n\t\t\t \r\n\t\t }else{\r\n\t\t\t return true;\r\n\t\t }\r\n\t }\r\n\t\r\n}", "title": "" }, { "docid": "adc9e06a6d25b88f18654ab54d500dec", "score": "0.60328776", "text": "function comprobarPuntuacion(campo){\n var exp = /^[0-9]*$/;\n let number = parseInt(campo.value,10);\n\n if(!comprobarExpresionRegular(campo,exp,2)){// si no cumple la expresion regular ( no deberia pasar ya que funciona con input type=\"number\")\n return false;\n \n }else if( number < 0 || number > 10){// si el valor es menor que cero o mayor que 10\n console.log(\"out of limits\");\n document.getElementById(campo.name+\"_limited\").style.visibility =\"visible\";\n campo.style.border = \"2px solid red\";\n return false;\n }\n document.getElementById(campo.name+\"_limited\").style.visibility =\"hidden\";\n campo.style.border = \"2px solid green\";\n return true;\n\n}", "title": "" }, { "docid": "81a0d30e8a3d3bf446c5a17d600ff212", "score": "0.60271657", "text": "function isAcctValid(field, num) {\n return !isNaN($(field).val()) && ($(field).val().length == num || $(field).val() == \"\");\n }", "title": "" }, { "docid": "81a0d30e8a3d3bf446c5a17d600ff212", "score": "0.60271657", "text": "function isAcctValid(field, num) {\n return !isNaN($(field).val()) && ($(field).val().length == num || $(field).val() == \"\");\n }", "title": "" }, { "docid": "3dd8ed42ee5bd7c815d53e03da05ae1f", "score": "0.6025621", "text": "function validar_registro() {\n var nombre = document.getElementById(\"nombre\").value;\n var primerapellido = document.getElementById(\"apellido1\").value;\n var segundoapellido = document.getElementById(\"apellido2\").value;\n var dni = document.getElementById(\"DNI\").value;\n var telefono = document.getElementById(\"telefono\").value;\n var email = document.getElementById(\"email\").value;\n var password = document.getElementById(\"password\").value;\n var password2 = document.getElementById(\"password-confirm\").value;\n var ciudad = document.getElementById(\"ciudad\").value;\n\n\n var valido = true;\n\n if (nombre.length == 0 || parseInt(nombre)) {\n document.getElementById(\"nombreHelp\").style.visibility = \"visible\";\n valido = false;\n }\n\n if (primerapellido.length == 0 || parseInt(primerapellido)) {\n document.getElementById(\"apellido1Help\").style.visibility = \"visible\";\n valido = false;\n }\n\n if (segundoapellido.length == 0 || parseInt(segundoapellido)) {\n document.getElementById(\"apellido2Help\").style.visibility = \"visible\";\n valido = false;\n }\n\n if ((dni.length < 9) || !/^\\d{8}[a-zA-Z]$/.test(dni)) {\n document.getElementById(\"DNIHelp\").style.visibility = \"visible\";\n valido = false;\n }\n\n if (telefono.length == 0 || (telefono.length > 9)) {\n document.getElementById(\"telefonoHelp\").style.visibility = \"visible\";\n valido = false;\n }\n\n if (email.length == 0 || !/^([\\da-z_\\.-]+)@([\\da-z\\.-]+)\\.([a-z\\.]{2,6})$/.test(email)) {\n document.getElementById(\"emailHelp\").style.visibility = \"visible\";\n valido = false;\n }\n\n if ((password.length < 5) || (password.length > 24) || /* entre 8 y 24 caracteres */\n !/[a-zñ]/.test(password) || !/[A-ZÑ]/.test(password) || /* minúscula y mayúscula */\n !/[0-9]/.test(password) || /* dígito numérico obligatorio */\n !/[.,:;-_?¿+@]/.test(password) /* caracteres especiales obligatorio */\n ) {\n document.getElementById(\"passwordHelp\").style.visibility = \"visible\";\n valido = false;\n }\n // La repetición de la contraseña coincide\n if (password != password2) {\n document.getElementById(\"passwod-confirmHelp\").style.visibility = \"visible\";\n valido = false;\n }\n\n\n if (ciudad.length == 0 || parseInt(ciudad)) {\n document.getElementById(\"ciudadHelp\").style.visibility = \"visible\";\n valido = false;\n }\n return valido;\n}", "title": "" }, { "docid": "f0ce85260955bd042de5fa98f0ec5bbb", "score": "0.6025251", "text": "function convertir(){\n //Capturampos el numero que ingreso el usuario\n valor = document.querySelector('#valor').value;\n //Desframectamos el numero \n millar = Math.trunc(valor/1000) % 10;\n centena = Math.trunc(valor/100) % 10;\n decena = Math.trunc(valor/10) % 10;\n unidad = Math.trunc(valor/1) % 10;\n\n if (millar > 3){\n document.querySelector('.result').innerHTML = `El numero no se puede convertir`;\n }\n else {\n switch(unidad) {\n case 1:\n r4 = \"I\";\n break;\n case 2:\n r4 = \"II\";\n break;\n case 3:\n r4 = \"III\";\n break;\n case 4:\n r4 = \"IV\";\n break;\n case 5:\n r4 = \"V\";\n break;\n case 6:\n r4 = \"VI\";\n break;\n case 7:\n r4 = \"VII\";\n break;\n case 8:\n r4 = \"VIII\";\n break;\n case 9:\n r4 = \"IX\";\n break;\n default:\n r4 = \"\";\n }\n\n switch(decena) {\n case 1:\n r3 = \"X\";\n break;\n case 2:\n r3 = \"XX\";\n break;\n case 3:\n r3 = \"XXX\";\n break;\n case 4:\n r3 = \"XL\";\n break;\n case 5:\n r3 = \"L\";\n break;\n case 6:\n r3 = \"LX\";\n break;\n case 7:\n r3 = \"LXX\";\n break;\n case 8:\n r3 = \"LXXX\";\n break;\n case 9:\n r3 = \"XC\";\n break;\n default:\n r3 = \"\";\n }\n\n switch(centena) {\n case 1:\n r2 = \"C\";\n break;\n case 2:\n r2 = \"CC\";\n break;\n case 3:\n r2 = \"CCC\";\n break;\n case 4:\n r2 = \"CD\";\n break;\n case 5:\n r2 = \"D\";\n break;\n case 6:\n r2 = \"DC\";\n break;\n case 7:\n r2 = \"DCC\";\n break;\n case 8:\n r2 = \"DCCC\";\n break;\n case 9:\n r2 = \"CM\";\n break;\n default:\n r2 = \"\";\n }\n\n switch (millar){\n case 1:\n r1 = \"M\";\n break;\n case 2:\n r1 = \"MM\";\n break;\n case 3:\n r1 = \"MMM\";\n break;\n default:\n r1 = \"\";\n }\n\n document.querySelector('.result').innerHTML = `${r1+r2+r3+r4}`;\n }\n\n}", "title": "" }, { "docid": "e9825510f1822b20987313ee5bb08836", "score": "0.6022214", "text": "function comprobarEntero(campo, valormenor, valormayor){\n //Si el valor del campo está vacio, que devuelva cierto\n if(campo.value.length==0){\n return true;\n \n }else\n //Si el valor del campo empieza por uno o mas numeros seguidos de punto o coma y terminan por numero\n if ( /^[0-9]+/.test(campo.value)){ \n \n //Comprueba si el valor del campo tiene decimales y devuelve false y un aviso junto al nombre del campo si los tiene\n if(/^[0-9]*(\\.|,)[0-9]*$/.test(campo.value)){\n alert(\"El campo \"+campo.name+\" no puede contener decimales\");\n return false;\n }else\n //Si el valor del campo es mayor que el valor maximo, devuelve false y un aviso indicando que campo tiene el error\n if(campo.value>valormayor){\n alert(\"El tamaño de \" + campo.name + \" sobrepasa\"); \n return false;\n }else\n //Si el valor del campo es mayor que el valor maximo, devuelve false y un aviso indicando que campo tiene el error\n if(campo.value<valormenor){\n alert(\"El tamaño de \" + campo.name + \" no es lo suficientemente grande\"); \n return false;\n }else \n //Comprueba que el numero sea entero y sino lo es devuelve false y un aviso indicando cual es el campo que tiene el error\n if(/(^[0-9]+)$/.test(campo.value)==false){\n alert('Solo puedes escribir numeros enteros en : '+campo.name);\n return false;\n }else //Si lo anterior no se cumple,devuelve true\n return true;\n }else{//Sino\n alert('Solo puedes escribir numeros');\n return false;\n }\n}", "title": "" }, { "docid": "f8ae60f30f921c5726a01bfc813d00b1", "score": "0.60207754", "text": "function ValidarCampo(){\n\tvar Campo;\n\tvar EvCampo;\n\tvar FeCampo;\n\tvar aux;\n\tvar aux2;\n\t//el campo es numérico\n\tif(obtener_valorM(\"INF_AD_P\",id_fila(),2) == \"Número\"){\n\t\tCampo = \"M\" + id_fila() + \"INF_AD_P3\";\n\t\tOcultarCampo(\"evento_M2INF_AD_P3\", 4);\n\t\taux = ValidarNumero(Campo,0,0.00,999999999.00,',','Introduzca un valor numérico válido ','El valor ingresado no se encuentra dentro del rango ','Aceptar','');\n\n\t}else{\n\t//el campo es fecha\n\t\tif(obtener_valorM(\"INF_AD_P\",id_fila(),2) == \"Fecha\"){\n\t\t\tCampo = \"M\" + id_fila() + \"INF_AD_P3\";\n\t\t\tEvCampo = \"evento_\" + Campo;\n\t\t\tFeCampo = \"imgFec\" + Campo;\n\t\t\tcambiar_nombre(EvCampo,aux2,3);\n\t\t\taux = ValidarFecha(Campo,'DD/MM/YYYY','01/01/1900','31/12/2099','Introduzca fecha válida con el formato ','El valor ingresado no se encuentra dentro del rango ','Aceptar','INF_AD_P');\n\t\t}\t\n\t}\nreturn true;\n}", "title": "" }, { "docid": "50c7f44a3962b298f64d8f9705dbef46", "score": "0.6002694", "text": "function Validafecha(fecha){\n\tvar ret=true;\n\tvar posible=fecha;\n\t// controlar largo de la cadena sea igual a 10\n\tvar recibo= new String(posible);\n\t//recibo = posible;\n\tif(recibo.length!=10){\n\t\talert('LA FECHA NO TIENE DIEZ CARACTERES DE LARGO :');\n\t\tret=false;\n\t\treturn ret;\n\t}\n\t//controlo que los caracteres sean validos\n\tvar tipo='fec';\n\tvar caracteresok = esfechavalida(posible); \t\n\tif (caracteresok!=true){\n\t\t alert('DEBE INGRESAR SOLO NUMEROS Y GUIONES -');\n\t\t ret=false;\n\t\t return ret;\n\t}\n //controlar 3 secuencias numericas entre barras\n\tvar cifras = recibo.split(\"-\");\n\tvar numerocifras=cifras.length;\n\tif(numerocifras!=3){\n\t\t alert('DEBE INGRESAR TRES CIFRAS, SEPARADAS POR GUIONES ANIO - MES - DIA ');\n\t\t ret=false;\n\t\t return ret;\n\t}\n\tvar anio= cifras[0];\tvar mes = cifras[1];\tvar dia = cifras[2];\n\tvar hoy=new Date();\n\t\n\tvar aniohoy = hoy.getFullYear();\n\tvar aniohoy = aniohoy.toString();\n\t\n\tvar meshoy = hoy.getMonth()+1;\n\tif(meshoy<10){\n\t\tvar meshoy = \"0\"+meshoy.toString();\n\t}else{\n\t\tvar meshoy = meshoy.toString();\n\t}\n\t\n\tvar diahoy = hoy.getDate();\n\tif(diahoy<10){\n\t\tvar diahoy = \"0\"+diahoy.toString();\n\t}else{\n\t\tvar diahoy = diahoy.toString();\n\t}\n\tvar hoyes = +aniohoy+\"-\"+meshoy+\"-\"+diahoy;\n\t\n\t//controla el año\n\tif (anio.length!=4){\n\t\t alert('EL AÑO DEBE SER DE 4 NUMEROS');\n\t}else{\n\t\tvar numanio=cifras[0];\n\t\tif((numanio<1901) || (numanio>hoy.getFullYear())){\n\t\t\t alert(\"EL AÑO DEBE SER MAYOR A 1901 Y MENOR O IGUAL AL ACTUAL\");\n\t\t\t ret=false;\n\t\t}\n }\n\t//controlar el mes\n\tif (mes.length!=2){\n\t\t alert('EL MES DEBE SER DE 2 DIGITOS');\n\t}else{\n\t\tvar nummes=cifras[1];\n\t\tif((nummes<1) || (nummes>12)){\n\t\t\t alert('EL MES DEBE ESTAR ENTRE 1 A 12');\n\t\t\t ret=false;\n\t\t}\n\t}\n\t//controlar el dia\n\tif (dia.length!=2){\n\t\t alert('EL DIA DEBE SER DE 2 DIGITOS');\n\t\t ret=false;\n\t}else{\n\t\tvar numdia=cifras[2];\n\t\tif((numdia<1) || (numdia>31)){\n\t\t\t alert('EL DIA DEBE ESTAR ENTRE 1 Y 31');\n\t\t\t ret=false;\n\t\t}\n\t}\n\t//controlar que la fecha sea futura\n\tif(recibo>hoyes){\n\t\talert('LA FECHA DE BUSQUEDA NO DEBE SER A FUTURO');\n\t\tret=false;\n\t}\t\n\t \t \n return ret;\n}", "title": "" }, { "docid": "c7d99762d48a4477dcfbe8f5411e7539", "score": "0.5999992", "text": "function check_digit(e, obj, intsize, deczize) {\n\n var keycode;\n\n if (window.event) keycode = window.event.keyCode;\n else if (e) keycode = e.which;\n else return true;\n var fieldval = (obj.value);\n var dots = fieldval.split(\".\").length;\n\n if (keycode == 46) {\n if (dots > 1) {\n\n return false;\n } else {\n\n return true;\n }\n }\n if (keycode == 8 || keycode == 9 || keycode == 46 || keycode == 13) // back space, tab, delete, enter \n {\n return true;\n }\n if ((keycode >= 32 && keycode <= 45) || keycode == 47 || (keycode >= 58 && keycode <= 127)) {\n return false;\n }\n\n\n\n if (fieldval == \"0\" && keycode == 48)\n return false;\n\n if (fieldval.indexOf(\".\") != -1) {\n if (keycode == 46)\n return false;\n var splitfield = fieldval.split(\".\");\n\n\n\n if (splitfield[1].length >= deczize && keycode != 8 && keycode != 0)\n return false;\n }\n else if (fieldval.length >= intsize && keycode != 46) {\n return false;\n }\n else return true;\n}", "title": "" }, { "docid": "812785d9611d80278de8162012f20b32", "score": "0.5993473", "text": "function logdigit(login) {\n\tif(!isNaN(parseInt(login[0]))) { return false }\n}", "title": "" }, { "docid": "8ba56cc019f70e2c8d16b422ad0a98f4", "score": "0.59877807", "text": "function checkearImporte() {\r\n var formImporte = $(\"#form-importe\");\r\n var importe = $(\"#input-importe\").val();\r\n //No se ha escrito nada\r\n if (importe === undefined) {\r\n campoErroneo(formImporte, \"Introduce el importe\");\r\n } else {\r\n importe = parseInt(importe);\r\n //Solo se han introducido caracteres no númericos\r\n if (isNaN(importe)) {\r\n campoErroneo(formImporte, \"Tienes que introducir un número\");\r\n //Se ha introducido un 0\r\n } else if (importe === 0) {\r\n $(\"#input-importe\").val(importe);\r\n campoErroneo(formImporte, \"El importe tiene que ser distinto de 0\");\r\n } else {\r\n importeBien = true;\r\n //Le vuelvo a poner el valor porque si se escriben numeros y letras, por ejemplo \"127aea\",\r\n //al hacer el parseInt() devuelve el valor de los números\r\n //Así que si se introduce \"127eaea\" en el campo, al checkearImporte\r\n //cambiará el valor a 127\r\n $(\"#input-importe\").val(importe);\r\n campoCorrecto(formImporte);\r\n }\r\n }\r\n}", "title": "" }, { "docid": "4881f5af47bd76c9add7455cd56de772", "score": "0.5987271", "text": "function validarRut(rut) {\n var suma = 0;\n var cuerpoRut = rut.substr(0, rut.length - 1);\n var dv = rut.substr(rut.length - 1).toUpperCase();\n var multiplicador = 2;\n /* suma la multiplicacion de cada numero que compone el rut */\n for (i = cuerpoRut.length - 1; i >= 0; i--) {\n suma = suma + (cuerpoRut.charAt(i) * multiplicador);\n if (multiplicador == 7) {\n multiplicador = 2;\n } else {\n multiplicador++;\n }\n }\n /* divide la suma por 11 y obtiene el resto*/\n var resto = suma % 11;\n var verificadorDv;\n\n if (resto == 1) {\n verificadorDv = 'K';\n } else {\n if (resto == 0) {\n verificadorDv = '0';\n } else {\n verificadorDv = 11 - resto;\n }\n }\n\n if (verificadorDv != dv) { return false; }\n else { return true; }\n }", "title": "" }, { "docid": "376f5b13fa091f8d98d49dcb0ef8ee65", "score": "0.5986901", "text": "function comprobarPuntuacionVacio(campo){\n var exp = /^[0-9]*$/;\n let number = parseInt(campo.value,10);\n\n if(campo.value.length <= 0 ){\n document.getElementById(campo.name+\"_limited\").style.visibility =\"hidden\";\n campo.style.border = \"2px solid green\";\n return true;\n }else if(!comprobarExpresionRegular(campo,exp,2)){\n return false;\n \n }else if( number < 0 || number > 10){\n console.log(\"out of limits\");\n document.getElementById(campo.name+\"_limited\").style.visibility =\"visible\";\n campo.style.border = \"2px solid red\";\n return false;\n }\n document.getElementById(campo.name+\"_limited\").style.visibility =\"hidden\";\n campo.style.border = \"2px solid green\";\n return true;\n\n}", "title": "" }, { "docid": "8fff61af613481ce940f3c15c3c2c146", "score": "0.5985758", "text": "function onlyGoodCharacters() {\n //Get element id\n const idName = this.id;\n // Regex that checks if input has somethong that is not a digit\n const current_value = $(`#${idName}`).val();\n const re = new RegExp(/[\\{\\}\\*\\_\\$\\%\\<\\>\\#\\|\\&\\?\\!\\¡\\¿\\[\\]]+/gi);\n const match = re.exec(current_value);\n // Check match\n if (match != null) {\n // remove user input\n $(`#${idName}`).val(\"\");\n // Put error message\n $(`#${idName}_wi`).text(\"¡Ingresaste uno o más caracteres inválidos!\");\n $(`#${idName}_wi`).show();\n } else {\n // Hide error message\n $(`#${idName}_wi`).text(\"\");\n $(`#${idName}_wi`).hide();\n }\n}", "title": "" }, { "docid": "7a3e4e070389604ce7c134539ffa2173", "score": "0.5985143", "text": "function comprobar1(numDni, LETRAS_DNI) {\n //declaramos la constante resto con la operacion que tiene que realizar\n const RESTO = numDni % 23\n //Analizamos con IF la longitud del dato introducido, que es mayor a 0 y que no esta vacio\n if ((numDni.length === 8) && (numDni > 0) && (numDni != '')){\n //Si esto se cumple mostramos el mensaje correcto\n alert(`Tu número de DNI es: ${numDni} y la letra es: ${LETRAS_DNI[RESTO]}`)\n }else{\n alert(\"Los datos introducidos no son correctos, prueba de nuevo\")\n }\n}", "title": "" }, { "docid": "7f3faf9891ba0879cab6d0399a1ca42e", "score": "0.5969966", "text": "function comprobarTelefono(t) {\n var cntTelefono = t.value;\n var expresionTelefono = /^[0-9]{9}$/;\n\n if(debug){\n console.log (\"comprobar telefono \"+cntTelefono);\n }\n\n if(expresionTelefono.test(cntTelefono)==false){\n t.value = \"Teléfono incorrecto\";\n t.style.color = \"\"+colorError;\n t.style.background = \"\"+fondoError;\n }else{\n t.style.color = \"\"+colorCorrecto;\n t.style.background = \"\"+fondoCorrecto;\n\n }\n\n}", "title": "" }, { "docid": "905d9892044f2d9ab442c5fd0fa6ec02", "score": "0.5967236", "text": "function validarRut(rut) {\r\n var rut = rut.replace(/[^k0-9]/gi, \"\");\r\n\r\n if (rut.length > 0) {\r\n var dv = rut.substr(-1);\r\n var numero = rut.substr(0, rut.length - 1);\r\n var i = 2;\r\n var suma = 0;\r\n\r\n for (var x = numero.length - 1; x >= 0; x--) {\r\n if (i == 8) {\r\n i = 2;\r\n }\r\n\r\n suma += rut[x] * i;\r\n ++i;\r\n }\r\n\r\n var dvr = 11 - (suma % 11);\r\n\r\n if (dvr == 11) {\r\n dvr = 0;\r\n }\r\n\r\n if (dvr == 10) {\r\n dvr = 'K';\r\n }\r\n\r\n if (dvr == dv.toUpperCase()) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n } else {\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "fede48aaffdc9ca99cbef6b36038b4e3", "score": "0.59638315", "text": "function reaisNaoAceitaDecimal(obj, event, tam) {\r\n\r\n\tvar strCheck = '0123456789';\r\n\tvar whichCode;\r\n\tif (event.srcElement)\r\n\t\twhichCode = event.keyCode;\r\n\telse if (event.target)\r\n\t\twhichCode = event.which;\r\n\r\n\tif (whichCode == 8 && !document.all) {\r\n\t\tif (event.preventDefault) { //standart browsers \r\n\t\t\tevent.preventDefault();\r\n\t\t} else { // internet explorer \r\n\t\t\tevent.returnValue = false;\r\n\t\t}\r\n\r\n\t\tvar x;\r\n\t\tif (obj.value.length <= 4) {\r\n\t\t\tx = '0,00';\r\n\t\t} else {\r\n\t\t\t// retira o último caracter e os zeros do fim \r\n\t\t\tx = obj.value.substring(0, obj.value.length - 4) + ',00';\r\n\t\t}\r\n\t\tobj.value = _demask(x, true).formatValor();\r\n\t\treturn false;\r\n\t}\r\n\tif (whichCode == 0)\r\n\t\treturn true;\r\n\tif (whichCode == 9)\r\n\t\treturn true; //tab \r\n\tif (whichCode == 13)\r\n\t\treturn true; //enter \r\n\tif (whichCode == 16)\r\n\t\treturn true; //shift\r\n\tif (whichCode == 17)\r\n\t\treturn true; //control\r\n\tif (whichCode == 27)\r\n\t\treturn true; //esc \r\n\tif (whichCode == 34)\r\n\t\treturn true; //end \r\n\tif (whichCode == 35)\r\n\t\treturn true;//end \r\n\tif (whichCode == 36)\r\n\t\treturn true; //home \r\n\r\n\tif (event.preventDefault) {\r\n\t\tevent.preventDefault()\r\n\t} else {\r\n\t\tevent.returnValue = false\r\n\t}\r\n\tvar key = String.fromCharCode(whichCode);\r\n\tif (strCheck.indexOf(key) == -1)\r\n\t\treturn false;\r\n\tif (obj.value.length >= tam)\r\n\t\treturn false;\r\n\r\n\tif (obj.value.length < 1) {\r\n\t\tobj.value = key + ',00';\r\n\t} else {\r\n\t\tvar valor = obj.value;\r\n\t\t// sem os zeros do fim \r\n\t\tvar x = valor.substring(0, valor.length - 3);\r\n\t\tobj.value = x + key + ',00';\r\n\t}\r\n\r\n\tvar bodeaux = _demask(obj.value, true).formatValor();\r\n\tobj.value = bodeaux;\r\n\r\n\t/* \r\n\t Move o cursor para o final no opera. \r\n\t */\r\n\tif (obj.createTextRange) {\r\n\t\tvar range = obj.createTextRange();\r\n\t\trange.collapse(false);\r\n\t\trange.select();\r\n\t} else if (obj.setSelectionRange) {\r\n\t\tobj.focus();\r\n\t\tvar length = obj.value.length;\r\n\t\tobj.setSelectionRange(length, length);\r\n\t}\r\n\r\n\treturn false;\r\n}", "title": "" }, { "docid": "c77fbe50226a85752692d09268b5a7f3", "score": "0.5962555", "text": "function onlyDigitsAllowed(whatToCheck, lengthAllowed, specialSymbol, specialSymbol1, specialSymbol2, specialSymbol3) {\r\n whatToCheck.onkeydown = function (e) {\r\n if ((e.which >= 48 && e.which <= 57) && (whatToCheck.value.length < lengthAllowed) || e.which == specialSymbol || e.which == specialSymbol1 || e.which == specialSymbol2 || e.which == specialSymbol3 && (whatToCheck.value.length < lengthAllowed) // цифры\r\n || (e.which >= 96 && e.which <= 105) // num lock\r\n || e.which == 8 // backspace\r\n || (e.which >= 37 && e.which <= 40) // стрелки\r\n || (e.which == 46)) // delete \r\n {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }\r\n}", "title": "" }, { "docid": "0724214c06ab592f14b52a71861d0c9d", "score": "0.59553903", "text": "function validarnum(e) {\n\t\t\ttecla = (document.all) ? e.keyCode : e.which;\n\t\t\tif (tecla==8) return true;\n\t\t\tpatron = /\\d/;\n\t\t\tte = String.fromCharCode(tecla);\n\t\t\treturn patron.test(te);\n\t\t}", "title": "" }, { "docid": "dc15d035a86ea449b5fe05b3dd5f2d4b", "score": "0.5951772", "text": "function validarCoders(){\r\n var namecoder= document.getElementById('nombreCoder').value;\r\n namecoder= namecoder.trim();\r\n var patroncar= /[`~!@#$%^&*()_°¬|+\\-=?;:'\",.<>\\{\\}\\[\\]\\\\\\/]/;\r\n var patronnum= /^[0-9,$]*$/;\r\n\r\n var apellidocoderUno= document.getElementById('apellidoCoder1').value;\r\n apellidocoderUno= apellidocoderUno.trim();\r\n \r\n\r\n var apellidocoderDos= document.getElementById('apellidoCoder2').value;\r\n apellidocoderDos= apellidocoderDos.trim();\r\n \r\n\r\n var nacimientocoder= document.getElementById('nacimientoCoder').value;\r\n nacimientocoder= nacimientocoder.trim();\r\n \r\n\r\n var dnicoder= document.getElementById('dniCoder').value;\r\n dnicoder= dnicoder.trim();\r\n var patron = /([12]\\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01]))/;\r\n var patron3= /([a-z]|[A-Z]|[0-9])[0-9]{7}([a-z]|[A-Z]|[0-9])/;\r\n \r\n \r\n if( namecoder.length < 2 || namecoder.length >= 25 || patroncar.test(namecoder) || patronnum.test(namecoder) ){\r\n document.getElementById('mensajenombrecoder').classList.add(\"error\")\r\n document.getElementById('mensajenombrecoder').innerHTML = \"Minimo 2 y maximo 24 caracteres\"\r\n document.getElementById('enviarf').disabled=true;\r\n }\r\n else{\r\n document.getElementById('mensajenombrecoder').classList.remove(\"error\")\r\n document.getElementById('mensajenombrecoder').innerHTML = \" \"\r\n document.getElementById('enviarf').disabled=false;\r\n \r\n }\r\n /// EMPIEZA apellidocoder1\r\n if( apellidocoderUno.length < 2 || apellidocoderUno.length >= 25 || patroncar.test(apellidocoderUno) || patronnum.test(apellidocoderUno) ){\r\n document.getElementById('mensajeapellidocoder1').classList.add(\"error\")\r\n document.getElementById('mensajeapellidocoder1').innerHTML = \"Minimo 2 y maximo 24 caracteres\"\r\n document.getElementById('enviarf').disabled=true;\r\n \r\n }\r\n else{\r\n document.getElementById('mensajeapellidocoder1').classList.remove(\"error\")\r\n document.getElementById('mensajeapellidocoder1').innerHTML = \" \"\r\n document.getElementById('enviarf').disabled=false;\r\n \r\n }\r\n \r\n /// EMPIEZA apellidocoder2\r\n if( apellidocoderDos.length < 2 || apellidocoderDos.length >= 25 || patroncar.test(apellidocoderDos) || patronnum.test(apellidocoderDos) ){\r\n document.getElementById('mensajeapellidocoder2').classList.add(\"error\")\r\n document.getElementById('mensajeapellidocoder2').innerHTML = \"Minimo 2 y maximo 24 caracteres\"\r\n document.getElementById('enviarf').disabled=true;\r\n \r\n }\r\n else{\r\n document.getElementById('mensajeapellidocoder2').classList.remove(\"error\")\r\n document.getElementById('mensajeapellidocoder2').innerHTML = \" \"\r\n document.getElementById('enviarf').disabled=false;\r\n \r\n }\r\n \r\n /// EMPIEZA nacimiento coder \r\n \r\n if(nacimientocoder.length != 10 ||!patron.test(nacimientocoder)){\r\n document.getElementById('mensajenacimientocoder').classList.add(\"error\")\r\n document.getElementById('mensajenacimientocoder').innerHTML = \"Debe tener formato aaaa-mm-dd\"\r\n document.getElementById(\"enviarf\").disabled = true;\r\n \r\n }\r\n else{\r\n document.getElementById('mensajenacimientocoder').classList.remove(\"error\")\r\n document.getElementById('mensajenacimientocoder').innerHTML = \" \"\r\n document.getElementById(\"enviarf\").disabled = false;\r\n \r\n }\r\n /// EMPIEZA dni coder\r\n if(!patron3.test(dnicoder)) {\r\n document.getElementById('mensajednicoder').classList.add(\"error\")\r\n document.getElementById('mensajednicoder').innerHTML = \"Debe contener un DNI o NIE valido\"\r\n document.getElementById('enviarf').disabled=true;\r\n }\r\n else{\r\n document.getElementById('mensajednicoder').classList.remove(\"error\")\r\n document.getElementById('mensajednicoder').innerHTML = \" \"\r\n document.getElementById('enviarf').disabled=false;\r\n } \r\n \r\n }", "title": "" }, { "docid": "55afd6d65f4bdf7f20ca23e2d825d2ef", "score": "0.5950957", "text": "function validate() {\n let inputStr = document.getElementById(\"username\").value;\n \n const myReg = /^([A-Z]|[a-z]|\\d)+\\d$/ //The values inside of the parenthesis and inside of the square brackets means that they are accepted as username values. [A-Z] means all capital letters from A to Z are accepted. [a-z] means all lowercase letters from a to z are accepted. \\d corresponds to any digit from 0-9. The | (or) operator states that any of these values can be accepted. The +\\d means that a number has to be the last value for the username.\n \n if (myReg.test(inputStr)) \n alert(\"Username accepted\");\n else\n alert(\"Username must contain only alphanumeric characters, contain a mininum of two characters, and end with a digit.\");\n }", "title": "" }, { "docid": "ec964dcb3b54b5b01179c53aae983ce7", "score": "0.5947204", "text": "function checkUsername(uname){\n var letter = /^[a-zA-Z]*$/g;\n \n if(uname.value == \"\" || uname.value == null)\n {\n uname.style.border = \"1px solid red\";\n document.getElementById(\"err_username\").innerHTML = \"Error: Missing Information\";\n return false;\n }\n else if(uname.value.length != 8)\n {\n uname.style.border = \"1px solid red\";\n document.getElementById(\"err_username\").innerHTML = \"Error: Incorrect username length\";\n return false;\n }\n else if(!uname.value.substring(0,4).match(letter)){\n uname.style.border = \"1px solid red\";\n document.getElementById(\"err_username\").innerHTML = \"Error: First 4 characters must be letters\";\n return false;\n }\n \n else if(uname.value.substring(0,1) != uname.value.substring(0,1).toUpperCase()){\n uname.style.border = \"1px solid red\";\n document.getElementById(\"err_username\").innerHTML = \"Error: First letter must be capital\";\n return false;\n }\n \n else if(uname.value.substring(1,4) != uname.value.substring(1,4).toLowerCase()){\n uname.style.border = \"1px solid red\";\n document.getElementById(\"err_username\").innerHTML = \"Error: Last 3 letters must be lowercase\";\n return false;\n }\n \n else if(isNaN(uname.value.substring(4,9))){\n uname.style.border = \"1px solid red\";\n document.getElementById(\"err_username\").innerHTML = \"Error: Last 4 character must be numbers\";\n return false;\n }\n else if(parseInt(uname.value.substring(4,5)) != parseInt(0) && parseInt(uname.value.substring(4,5) ) != parseInt(1))\n {\n uname.style.border = \"1px solid red\";\n document.getElementById(\"err_username\").innerHTML = \"Error: First digit must be a 0 or 1\";\n return false;\n }\n else {\n uname.style.border = \"none\";\n document.getElementById(\"err_username\").innerHTML = \"\";\n return true;\n }\n \n}", "title": "" }, { "docid": "8a0cabcc59191647508098dd85d43b5c", "score": "0.5941457", "text": "validaCNPJ( valor ) {\r\n\r\n if (! valor){\r\n return true;\r\n }\r\n // Garante que o valor é uma string\r\n \r\n // Remove caracteres inválidos do valor\r\n valor = this.mantemSomenteNumeros(valor);\r\n\r\n \r\n \r\n // O valor original\r\n let cnpj_original = valor;\r\n \r\n // Captura os primeiros 12 números do CNPJ\r\n let primeiros_numeros_cnpj = valor.substr( 0, 12 );\r\n \r\n // Faz o primeiro cálculo\r\n let primeiro_calculo = this.calc_digitos_posicoes( primeiros_numeros_cnpj, 5 );\r\n \r\n // O segundo cálculo é a mesma coisa do primeiro, porém, começa na posição 6\r\n let segundo_calculo = this.calc_digitos_posicoes( primeiro_calculo, 6 );\r\n \r\n // Concatena o segundo dígito ao CNPJ\r\n let cnpj = segundo_calculo;\r\n \r\n // Verifica se o CNPJ gerado é idêntico ao enviado\r\n if ( cnpj === cnpj_original ) {\r\n return true;\r\n }\r\n \r\n // Retorna falso por padrão\r\n return false;\r\n \r\n }", "title": "" }, { "docid": "4a1da1b73a6425737b024e5fc15972be", "score": "0.59405524", "text": "function validatorreqnumber(i, j = null, k = null) {\r\n if (i.value.length != 0) {\r\n var number = /^[0-9]+$/;\r\n var res = i.value.substring(0, 2);\r\n\r\n if (!i.value.match(number)) {\r\n if (j != null) alert(\"data \" + j + \" tidak valid\");\r\n return false;\r\n } else if (i.value.length == 0) {\r\n if (j != null) alert(\"data \" + j + \" tidak valid\");\r\n return false;\r\n } else return true;\r\n } else {\r\n if (j != null) alert(\"data \" + j + \" tidak boleh kosong\");\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "c77eb52452570e591b174536eb8e2ad7", "score": "0.5937677", "text": "function validarDNI() {\r\n var dni = document.getElementById(\"regDNI\").value;\r\n if (dni === \"\") {\r\n document.getElementById(\"idDNI\").innerHTML = \"Completar el DNI\";\r\n } else {\r\n let validadoDNI = valiNum(dni);\r\n if (validadoDNI !== null) {\r\n document.getElementById(\"idDNI\").innerHTML = \"\";\r\n return true\r\n } else {\r\n document.getElementById(\"idDNI\").innerHTML = \"DNI Invalido\";\r\n }\r\n }\r\n return false\r\n}", "title": "" }, { "docid": "51b6e454ddcfed59724605166917fe74", "score": "0.5934065", "text": "function validarTelefono(campo){\n var input = campo.value; //input: valor del campo pasado\n var patt = new RegExp(/^(\\+34|0034|34)?[6|7|8|9][0-9]{8}$/i); //expresion regular para comprobar un telefono\n\n //si cumple la expresion regular\n if (input.match(patt)){\n return true;\n } else { //si no\n alert('Telefono no válido');\n return false;\n }\n}", "title": "" }, { "docid": "a8bfd022a4c8a9a88aaeeb29eaaddbca", "score": "0.59338677", "text": "function validarDireccion(){\r\n\t\tvar valor = $(\"#txtDireccion\").val();\r\n\t\tif(valor!=\"\"){\r\n\t\t\tband = 0;\r\n\t\t\tfor(var i = 0; i < valor.length;i++){\r\n\t\t\t\taux = valor.charCodeAt(i);\r\n\t\t\t\tif((aux>=65 && aux<=90) || (aux>=97 && aux<=122) || aux==209 || aux==241 || aux==32 || aux==225 || aux==233 || aux==237 || aux==243 ||\r\n\t\t\t\taux==250 || aux==193 || aux==201 || aux==205 || aux==218 || aux==44 || aux==46 || (aux>=48 && aux<=57)){\r\n\t\t\t\t\tband = band;\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tband++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(band!=0){\r\n\t\t\t\t$(\"#txtDireccion\").attr('class','form-control is-invalid').focus();\r\n\t\t\t\t$(\"#mensajeDireccion\").replaceWith(\"<div id='mensajeDireccion' class='invalid-feedback'><b>Por favor, solo introduzca letras, números y caracteres especiales ( . , ) (*)</b></di>\");\r\n\t\t\t\tdireccion = false;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tif(valor.length>=5 && valor.length<=100){\r\n\t\t\t\t\t$(\"#txtDireccion\").attr('class','form-control is-valid');\r\n\t\t\t\t\t$(\"#mensajeDireccion\").replaceWith(\"<div id='mensajeDireccion' class='valid-feedback'> Campo completado correctamente </di>\");\r\n\t\t\t\t\tdireccion = true;\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\t$(\"#txtDireccion\").attr('class','form-control is-invalid').focus();\r\n\t\t\t\t\t$(\"#mensajeDireccion\").replaceWith(\"<div id='mensajeDireccion' class='invalid-feedback'><b>Por favor, Introduzca caracteres en un rango de 5 - 100</b></di>\");\r\n\t\t\t\t\tdireccion = false;\r\n\t\t\t\t}\r\n\t\t\t}\t\t\t\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$(\"#txtDireccion\").attr('class','form-control is-invalid').focus();\r\n\t\t\t$(\"#mensajeDireccion\").replaceWith(\"<div id='mensajeDireccion' class='invalid-feedback'><b>Por favor, rellene este campo (*)</b></di>\");\r\n\t\t\tdireccion = false;\r\n\t\t}\r\n\t}//FIn de la funcion para validar la direccion", "title": "" }, { "docid": "dedde420714a68c7e36ac71c6ebed815", "score": "0.59218377", "text": "function esFechaValida(fecha){\n if (fecha != undefined && fecha.value != \"\" )\n\t{\n \n\t\t//solo limitamos a los primeros diez caracteres de la fecha\n\t\tfecha=fecha.substring(0,10);\n\t\tif (!/^\\d{2}\\/\\d{2}\\/\\d{4}$/.test(fecha))\n\t\t{\n //alert(fecha);\n\t\t return false;\n }\n\t\t\t\t\n var anio = parseInt(fecha.substring(6),10);\n var mes = parseInt(fecha.substring(3,5),10);\n var dia= parseInt(fecha.substring(0,2),10);\n\t\t\n\t\tswitch(mes){\n\t\t\tcase 1:\n\t\t\tcase 3:\n\t\t\tcase 5:\n\t\t\tcase 7:\n\t\t\tcase 8:\n\t\t\tcase 10:\n\t\t\tcase 12:\n\t\t\t\tnumDias=31;\n\t\t\t\tbreak;\n\t\t\tcase 4: case 6: case 9: case 11:\n\t\t\t\tnumDias=30;\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tif (comprobarSiBisisesto(anio)){ numDias=29 }else{ numDias=28};\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t \n\t\t\t\treturn false;\n\t\t}\n \n\t\tif (dia>numDias || dia==0){\n \treturn false;\n\t }\n \t//para terminar\n\t\treturn true;\n\t\n\t}\n}", "title": "" } ]
f9b89232840feb0f221d7927770d98d1
Coerce animation to None if popup is not transparent private static object
[ { "docid": "243c5c1979a06497763299c15689a1a2", "score": "0.75167894", "text": "function CoercePopupAnimation(/*DependencyObject*/ o, /*object*/ value)\r\n {\r\n return o.AllowsTransparency ? value : PopupAnimation.None;\r\n }", "title": "" } ]
[ { "docid": "dd1c862b4572dc7a8f6f1799cafe11ca", "score": "0.62027305", "text": "function swowFramePopup() {\n $('.slider-frame-popup-holder').css({\n 'opacity' : '1',\n 'z-index' : '100'\n });\n }", "title": "" }, { "docid": "5a01f4f00a5782208831af266343c8a0", "score": "0.6154419", "text": "function removeAnimation(element){\r\n\t\t\treturn element.addClass('fp-notransition');\r\n\t\t}", "title": "" }, { "docid": "eab9cc92ab48517b7a5018d832928d39", "score": "0.61507237", "text": "function NoneAnimation(img_container, direction, desc) {\n img_container.css('opacity', 0);\n return {old_image: {opacity: 0},\n new_image: {opacity: 1},\n speed: 0};\n }", "title": "" }, { "docid": "0a0be8d86f9c215d6f0e4fa33eeb2b64", "score": "0.61275804", "text": "function swowMobPopup() {\n $('.slider-mob-popup-holder').css({\n 'opacity' : '1',\n 'z-index' : '100'\n });\n }", "title": "" }, { "docid": "7a8dc54ba66ff5913520049aeda0f963", "score": "0.60900563", "text": "function removeAnimation(element){\n\t\t\treturn element.addClass('fp-notransition');\n\t\t}", "title": "" }, { "docid": "e43a660206dea73f477a55ebe9da20fa", "score": "0.60085386", "text": "function show_animation(){\n\t $('#popup_domination_lightbox_wrapper>.lightbox-main').css(\"opacity\",0);\n\t $('#popup_domination_lightbox_wrapper').show();\n if (popup_domination.show_anim == 'fade') {\n $('#popup_domination_lightbox_wrapper>.lightbox-main').animate({opacity:1},500,center_it);\n } else if (popup_domination.show_anim == 'slide') {\n $('#popup_domination_lightbox_wrapper>.lightbox-main').animate({top: 0 - $('#popup_domination_lightbox_wrapper>.lightbox-main').outerHeight()},0);\n $('#popup_domination_lightbox_wrapper>.lightbox-main').animate({\n opacity: 1,\n top: ($(window).height() - $('.popup-dom-lightbox-wrapper .lightbox-main').outerHeight())/2\n }, \n 500, \n center_it);\n } else {\n $('#popup_domination_lightbox_wrapper>.lightbox-main').css(\"opacity\",1);\n }\n \n\t}", "title": "" }, { "docid": "f9efc8f1c2927e3e4b61b818be9e94c9", "score": "0.596488", "text": "stopAnimation() { }", "title": "" }, { "docid": "8fda39a08d0700f62c534517fe494cd9", "score": "0.59611535", "text": "function swowWebPopup() {\n $('.slider-web-popup-holder').css({\n 'opacity' : '1',\n 'z-index' : '100'\n });\n }", "title": "" }, { "docid": "90c21c4f789ea97f53f8a8ea76f1ae8c", "score": "0.5941604", "text": "function animation() { return true; }", "title": "" }, { "docid": "75953e28f2d23e0a4e871eca4a5b7960", "score": "0.59388226", "text": "toggleWaitOpponentAnim() {\n\n }", "title": "" }, { "docid": "e097982b17e504e60ddfe42d22839f85", "score": "0.58751446", "text": "function show_animation() {\n \n if ($.browser.msie && $.browser.version < 10) {\n //IE.hate++ -=- Using a Javasccript animation fallback.\n $('#popup_domination_lightbox_wrapper >.lightbox-main').css(\"opacity\",0);\n $('#popup_domination_lightbox_wrapper ').show();\n if (popup_domination.show_anim == 'fade') {\n $('#popup_domination_lightbox_wrapper >.lightbox-main').animate({opacity:1},500,center_it);\n } else if (popup_domination.show_anim == 'slide') {\n $('#popup_domination_lightbox_wrapper >.lightbox-main').animate({top: 0 - $('#popup_domination_lightbox_wrapper >.lightbox-main').outerHeight(false)},0);\n $('#popup_domination_lightbox_wrapper >.lightbox-main').animate({\n top: ($(window).height() - $('.popup-dom-lightbox-wrapper .lightbox-main').outerHeight(false))/2,\n opacity:1\n },\n 1500,\n center_it);\n } else if (popup_domination.show_anim == 'slideUp') {\n $('#popup_domination_lightbox_wrapper >.lightbox-main').animate({top: $(window).height() + $('#popup_domination_lightbox_wrapper >.lightbox-main').outerHeight(false)},0);\n $('#popup_domination_lightbox_wrapper >.lightbox-main').animate({\n top: ($(window).height() - $('.popup-dom-lightbox-wrapper .lightbox-main').outerHeight(false))/2,\n opacity:1\n },\n 1500,\n center_it);\n } else if (popup_domination.show_anim == 'slideLeft') { /* Slide TO the left, FROM the right! */\n $('#popup_domination_lightbox_wrapper >.lightbox-main').animate({\n top: 10 + ($(window).height() - $('#popup_domination_lightbox_wrapper >.lightbox-main').outerHeight(false))/2,\n left: $(window).width() + $('#popup_domination_lightbox_wrapper >.lightbox-main').outerWidth(false)\n },0);\n $('#popup_domination_lightbox_wrapper >.lightbox-main').animate({\n left: ($(window).width() - $('.popup-dom-lightbox-wrapper .lightbox-main').outerWidth(false))/2,\n opacity:1\n },\n 1500,\n center_it);\n } else if (popup_domination.show_anim == 'slideRight') {\n $('#popup_domination_lightbox_wrapper >.lightbox-main').animate({\n top: 10 + ($(window).height() - $('#popup_domination_lightbox_wrapper >.lightbox-main').outerHeight(false))/2,\n left: 0 - $('#popup_domination_lightbox_wrapper >.lightbox-main').outerWidth(false)\n },0);\n $('#popup_domination_lightbox_wrapper >.lightbox-main').animate({\n left: ($(window).width() - $('.popup-dom-lightbox-wrapper .lightbox-main').outerWidth(false))/2,\n opacity:1\n },\n 1500,\n center_it);\n } \n else {\n $('#popup_domination_lightbox_wrapper >.lightbox-main').css(\"opacity\",1);\n }\n center_it();\n }\n \n else {\n \n $('#popup_domination_lightbox_wrapper >.lightbox-main').css(\"transition\",\"all 0\");\n var theTransition = \"all\";\n if (popup_domination.show_anim == 'fade') {\n $('#popup_domination_lightbox_wrapper >.lightbox-main').css({\n top: 10 + ($(window).height() - $('#popup_domination_lightbox_wrapper >.lightbox-main').outerHeight(false))/2,\n left: ($(window).width() - $('#popup_domination_lightbox_wrapper >.lightbox-main').outerWidth(false))/2,\n opacity:0\n });\n theTransition = \"opacity\"; \n } else if (popup_domination.show_anim == 'slide') {\n $('#popup_domination_lightbox_wrapper >.lightbox-main').css({\n top: 0 - $(window).height(),\n left: ($(window).width() - $('#popup_domination_lightbox_wrapper >.lightbox-main').outerWidth(false))/2\n });\n theTransition = \"top\";\n } else if (popup_domination.show_anim == 'slideUp') {\n $('#popup_domination_lightbox_wrapper >.lightbox-main').css({\n top: $(window).height(),\n left: ($(window).width() - $('#popup_domination_lightbox_wrapper >.lightbox-main').outerWidth(false))/2\n });\n theTransition = \"top\";\n\n } else if (popup_domination.show_anim == 'slideLeft') { /* Slide TO the left, FROM the right! */\n $('#popup_domination_lightbox_wrapper >.lightbox-main').css({\n top: 10 + ($(window).height() - $('#popup_domination_lightbox_wrapper >.lightbox-main').outerHeight(false))/2,\n left: $(window).width()\n });\n theTransition = \"left\";\n\n } else if (popup_domination.show_anim == 'slideRight') {\n $('#popup_domination_lightbox_wrapper >.lightbox-main').css({\n top: 10 + ($(window).height() - $('#popup_domination_lightbox_wrapper >.lightbox-main').outerHeight(false))/2,\n left: 0 - $(window).width()\n });\n theTransition = \"left\";\n } \n else {\n //catch-all for open immediately or broken/no setting saved.\n $('#popup_domination_lightbox_wrapper >.lightbox-main').css(\"opacity\",1);\n theTransition = \"none\";\n }\n $('#popup_domination_lightbox_wrapper').show();\n center_it(theTransition);\n }\n \n }", "title": "" }, { "docid": "1f7d4b446672d87722cb84b587002be2", "score": "0.58655506", "text": "readyToAnimate(){\n return this.animation === null;\n }", "title": "" }, { "docid": "91219a7124c5fe9dce67effc60f2b9eb", "score": "0.58325404", "text": "function removeAnimation(element){\r\n return element.addClass(NO_TRANSITION);\r\n }", "title": "" }, { "docid": "10c3527b7d715fed22bcea277715bf0c", "score": "0.5828622", "text": "function swowTeamPopup() {\n $('.slider-team-popup-holder').css({\n 'opacity' : '1',\n 'z-index' : '100'\n });\n }", "title": "" }, { "docid": "38a4aaf4aec7cf320c8d665ec4f4ed43", "score": "0.5817836", "text": "function removeAnimation(element){\n return element.addClass(NO_TRANSITION);\n }", "title": "" }, { "docid": "b9125a54bbb055f903ec2472473e1556", "score": "0.57934576", "text": "static Popup() {}", "title": "" }, { "docid": "729b7c24240c840f1007304fc07ccaeb", "score": "0.579173", "text": "function slickSetAnimationDefault(obj, type, animationIn, animatedClass, visibility) {\n visibility = typeof visibility !== 'undefined' ? visibility : false;\n\n slickRemoveAnimation(obj, 'delay');\n slickRemoveAnimation(obj, 'duration');\n\n if (type['opacity'] == 1) {\n obj.addClass(animationIn);\n obj.addClass(animatedClass);\n } else {\n obj.removeClass(animationIn);\n obj.removeClass(animatedClass);\n }\n\n if (visibility) obj.css(type);\n }", "title": "" }, { "docid": "4a48e114fc54dd8a4cfc56587d8b2d51", "score": "0.5790923", "text": "function stopAnimation(){\r\n toCheckStartAnimation = false;\r\n}", "title": "" }, { "docid": "4af7d848cb894579491795577b6b23d5", "score": "0.57888466", "text": "_resetAnimation() {\n // @breaking-change 8.0.0 Combine with _startAnimation.\n this._panelAnimationState = 'void';\n }", "title": "" }, { "docid": "c223cfac9112c546ae0275fe84bccd55", "score": "0.57819915", "text": "function popupAnimate(swither) {\n\t\tif(swither) {\n\t\t\t$('.pcard-motivate').animate({opacity: 'show'}, 600);\n\t\t\t$('.pcard-motivate__inner').animate({opacity: 'show'}, 750);\n\t\t}\n\t\telse {\n\t\t\t$('.pcard-motivate').animate({opacity: 'hide'}, 750);\n\t\t\t$('.pcard-motivate__inner').animate({opacity: 'hide'}, 500);\n\t\t}\n\t}", "title": "" }, { "docid": "41354023e265c86a1e4521208f47f3be", "score": "0.5776419", "text": "function dialogPopOut(container,options){return options.reverseAnimate().then(function(){if(options.contentElement){// When we use a contentElement, we want the element to be the same as before.\n// That means, that we have to clear all the animation properties, like transform.\noptions.clearAnimate();}});}", "title": "" }, { "docid": "e4fe4b94e3645edfafb4d75a050fd9f5", "score": "0.5760348", "text": "get disableAnimation() {\n return this._disableAnimation;\n }", "title": "" }, { "docid": "b87fad1b45d86f6c349102c84bc121ee", "score": "0.57559353", "text": "function controlAnimation(pharaoh){\n if(pharaoh.playingTempAnimation && pharaoh.animation.isDone()){\n pharaoh.setToDefault();\n }\n}", "title": "" }, { "docid": "7de5b89d32be024574e0a92f80bb2ca0", "score": "0.573593", "text": "function noFade_activateFade (lightbox, time) {}", "title": "" }, { "docid": "3fd456cd83762bcaa986c45331a34630", "score": "0.5728473", "text": "extinguish() {\n this._top.pause();\n this._bottom.pause();\n this.alpha = 0;\n }", "title": "" }, { "docid": "4a6fa1ac16c0123588decd6162b7a34e", "score": "0.57280135", "text": "function ISAnimatedObject(){ this.Element =null; this.ParentElement =null; this.Type =\"\"; this.Style =\"WinXPStyle\"; this.Step =0; this.OnCompleted =null; this.Speed =\"Slow\"; this.StepInterval =1; this.CurrentSize =new UnitSize(); this.TargetSize =new UnitSize(); this.CurrentLocation =new OffsetLocation(); this.TargetLocation =new OffsetLocation(); this.AnimateLocation =false; this.AnimateSize =false; this.ShadowMode =true; this.MaxStep =10; this.Duration =1; this.Height =0; this.TimeoutInterval =1; this.IntervalId =null; this.Canceled =false; this._ShadowElement =null; this.Play =function() { this.Canceled =false; wd6a834.m12721(this); }; this.Stop =function() { this.Canceled =true; };}", "title": "" }, { "docid": "5b0aec5ca27d831d6850344c87bbbe33", "score": "0.5715368", "text": "function removeAnimation(element) {\n return element.addClass(NO_TRANSITION);\n }", "title": "" }, { "docid": "5b0aec5ca27d831d6850344c87bbbe33", "score": "0.5715368", "text": "function removeAnimation(element) {\n return element.addClass(NO_TRANSITION);\n }", "title": "" }, { "docid": "07894fd13df35c24933f46323f23f6f4", "score": "0.5705418", "text": "function Animation(){}", "title": "" }, { "docid": "585cfdc637c3982640c0d3f34c990ebd", "score": "0.5704822", "text": "function fadeout() {\n var that = this;\n that.handle = setInterval(function() {\n that.opacity = that.opacity - speed[that.o.speed].step;\n that.popup.style.opacity = that.opacity / 100;\n that.popup.style.filter = 'alpha(opacity='+that.opacity+')';\n if( that.opacity <= 0 ) {\n clearInterval(that.handle);\n }\n }, speed[that.o.speed].timeout);\n }", "title": "" }, { "docid": "d479020d4a9b438d5d989eef4e980594", "score": "0.5701995", "text": "function dispNone() {\n overlay.setAttribute(\"style\", \"display: none\");\n }", "title": "" }, { "docid": "72860b7ffa8af2f5019587244940de59", "score": "0.5683681", "text": "function __showPopup() {\n $(\".popup\").removeClass(\"popup__invisible\");\n }", "title": "" }, { "docid": "082ba911b6bb26e68cc82c27c63c1988", "score": "0.5683355", "text": "function privacypopup() {\r\n privacy_popup.removeClass('hide_opacity');\r\n}", "title": "" }, { "docid": "e6d6f13d605f143030e4d8991771bfb5", "score": "0.56733984", "text": "hideAnimator(){\n this.show = false;\n }", "title": "" }, { "docid": "f035721bc485b9310cca26a64ed011d8", "score": "0.5655511", "text": "function itro_enter_anim()\r\n{\r\n\tif( document.cookie.indexOf(\"popup_cookie\") == -1 || itro_is_preview === true )\r\n\t{\r\n\t\titro_popup.style.visibility = '';\r\n\t\titro_opaco.style.visibility = '';\r\n\t\titro_popup.style.display = 'none';\r\n\t\titro_opaco.style.display = 'none';\r\n\t\tjQuery(\"#itro_opaco\").fadeIn(function()\r\n\t\t{\r\n\t\t\tjQuery(\"#itro_popup\").fadeIn();\r\n\t\t\tif( itro_age_restriction === false )\r\n\t\t\t{\r\n\t\t\t\titro_set_cookie(\"popup_cookie\",\"one_time_popup\", itro_cookie_expiration);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n}", "title": "" }, { "docid": "4a250388f80d99f162e76be61fa5add2", "score": "0.5640266", "text": "function tFrame() {\n //Somehow the opacity skips value = 0 so used less than comparison\n if(objOpacity < 0){\n //Since the opacity will skip 0, this will restore it and remove negative opacity...\n object.style.opacity = 0;\n //Stop the third animation\n clearInterval(third);\n \n }\n else\n {\n objOpacity -= 0.01;\n //Can set opacity but cant get opacity ;-;\n object.style.opacity = objOpacity;\n }\n }", "title": "" }, { "docid": "e90048d7c7c92a4ff6983cd7e04df38d", "score": "0.5630614", "text": "hide_shape(shape) {\n let currentShape = shapes[shape];\n let animation = currentShape.getElementsByClassName('animated')[0];\n animation.style.display = 'none';\n }", "title": "" }, { "docid": "6bef3c87a7d26f6642053a9cd5476632", "score": "0.5601059", "text": "cancelAnimation(){\n delete this.animation;\n this.animation = null;\n }", "title": "" }, { "docid": "64bc95aea2e14b1c4dcf99dcfbbc2f8d", "score": "0.55917823", "text": "noAnimation(on) {\n if (arguments.length === 0) return this._no_animation;\n this._no_animation = on;\n return this;\n }", "title": "" }, { "docid": "3923d29754867ef097a626bb67ee865b", "score": "0.55885816", "text": "function togglePopupMotionOrExit() {\n let overlayPopupMotionOrDiv = document.querySelector(\".popupMotionOrDiv\");\n overlayPopupMotionOrDiv.style.display = \"none\";\n}", "title": "" }, { "docid": "26b82b812a463f4d75a36398b85eb315", "score": "0.55863374", "text": "get animation() {\n return new AnimControl(this);\n }", "title": "" }, { "docid": "032a2f219648758fb8da6f602ca38979", "score": "0.557786", "text": "var isAnimated() {\n return animated;\n }", "title": "" }, { "docid": "08f9bb43ba881b6d9e826338f9ae5a4c", "score": "0.5560424", "text": "function HideAnimation() {\n this.animation = 'zoomOutLeft';\n this.duration = 0.75;\n }", "title": "" }, { "docid": "9a5d4a6d34399c2e647c50f23130c3f0", "score": "0.5553294", "text": "function __hidePopup() {\n $(\".popup\").addClass(\"popup__invisible\");\n }", "title": "" }, { "docid": "4cc857030b01845f7ea552122f3fb03c", "score": "0.5548618", "text": "function showWaitAnimation() {\n var id = 'waitAnimation';\n var popup = getEmptyPopup(id,500);\n\tvar path = document.location.pathname;\n var imagePath = path.substr(0,path.indexOf(\"faces/\")) + \"images/\";\n var wait = document.createElement('img');\n wait.setAttribute('src',imagePath + 'waitSmall.gif');\n var content = document.getElementById(id + ':content');\n content.innerHTML = '';\n content.appendChild(wait);\n\n // center in window\n popup.style.left = getWindowSize().w/2 - content.offsetWidth/2;\n popup.style.top = getWindowSize().h/2 - content.offsetHeight/2;\n}", "title": "" }, { "docid": "5b046a390e1d6b6697603d96dc18f362", "score": "0.55461204", "text": "_setupAnimation() {\n const animationList = ['none', 'fade'];\n this.options.animationType = this.options.animationType.toLowerCase();\n animationList.includes(this.options.animationType) ? '' : (this.options.animationType = 'none');\n\n if (this.options.animationType !== 'none' && !this.options.hover) {\n if (this.options.hover) {\n this.el.style.animationDuration = this.options.animationDuration + 'ms';\n } else {\n this.el.style.transitionDuration = this.options.animationDuration + 'ms';\n }\n this.el.classList.add('anim-' + this.options.animationType);\n }\n }", "title": "" }, { "docid": "70f8d695a6128fef45aef9bc6de6e995", "score": "0.55385256", "text": "function removeAnimation() {\n var string = 'none';\n setAnimation(string);\n //Set text width to the beginning\n attr.el.css({left: 0});\n }", "title": "" }, { "docid": "c594e4b5d8b11ff1d0ab73e982d4970f", "score": "0.5519671", "text": "function dissolveSplashPanel(){\n splashPanel.style.opacity = \"0\";\n splashPanel.style.visibility = \"hidden\";\n\n }", "title": "" }, { "docid": "77de714b89ab2d4adcd7b9f82035abff", "score": "0.54954296", "text": "function howtoStopAnimation() {\n $('#howto-lightbox .arrow-gray').queue(\"fx\", []);\n $('#howto-lightbox .arrow-gray').stop();\n}", "title": "" }, { "docid": "ecdc27497963b4ecdde985374b6c6e42", "score": "0.54864496", "text": "function animateRemoval(){return dialogPopOut(element,options);}", "title": "" }, { "docid": "3277e82d6d79b6b89abae4912cebe488", "score": "0.5481349", "text": "function hideHourGlass(){\r\n\t\tif(wpInterval){\r\n\t\t\tclearTimeout(wpInterval);\r\n\t\t\twpInterval = null;\r\n\t\t}\r\n\t\tesc = oldEsc; oldEsc = null;\r\n\t\thourglassOn = false;\r\n\t\tvar hg = $('hourglass');\r\n\t\tnew Effect.Opacity(hg, {to:0.7, duration:0.1, afterFinish:function(){ hg.hide(); }});\r\n\t}", "title": "" }, { "docid": "a3ebfea53f2afe308f2fdc2512975ccf", "score": "0.54803735", "text": "function TransparentCancelFocusBackdrop() {\n\t\treturn <div onClick={() => game.setFocusCell(null)} className={style.ClearBG} />;\n\t}", "title": "" }, { "docid": "c5f47537b46968e24cad8c89b2958db6", "score": "0.5478456", "text": "function clPopUp() {\n $(\"#pop-up\").removeClass(\"animated fadeInUp\");\n $(\"#pop-up\").removeClass(\"active\");\n $(\"#background-gray-color\").removeClass(\"active\");\n document.getElementById(\"if-title-exist\").style.display = \"none\";\n}", "title": "" }, { "docid": "75e69f5fb1e7700d4a61c8f207417f54", "score": "0.5477082", "text": "get animationClass() {\n if (this.isAnimating) {\n return SPEED_CLASS_MAP[this.speed];\n }\n\n return 'hide';\n }", "title": "" }, { "docid": "2a77dddba5535f0d8e6db456adb808a9", "score": "0.54320574", "text": "async disable() {\n return await new Promise((resolve, reject) => {\n this.dbg.sendCommand('Animation.disable', {}, (error, result) => {\n this.assertError(error, 'Animation.disable');\n resolve();\n });\n });\n }", "title": "" }, { "docid": "24b340fb574d0a4e0b5be48373a5e767", "score": "0.54318714", "text": "function e(){var a,b=document.createElement('fakeelement'),c={animation:'animationend',OAnimation:'oanimationend',MozAnimation:'animationend',WebkitAnimation:'webkitAnimationEnd',\"\":'MSAnimationEnd'};for(a in c)if(b.style[a]!==void 0)return c[a]}", "title": "" }, { "docid": "d9e199a69e3bde915ef86e74f93498ae", "score": "0.54304695", "text": "function o(){e||t.hide(),r(),i&&i.apply(t)}// Resets transitions and removes motion-specific classes", "title": "" }, { "docid": "9594b946cbefc37e9fbfceb6589d6c4d", "score": "0.5428757", "text": "get animation() {\n\t\treturn this.nativeElement ? this.nativeElement.animation : undefined;\n\t}", "title": "" }, { "docid": "9594b946cbefc37e9fbfceb6589d6c4d", "score": "0.5428757", "text": "get animation() {\n\t\treturn this.nativeElement ? this.nativeElement.animation : undefined;\n\t}", "title": "" }, { "docid": "027ecda39cdcdcd33b0e99a677d2503e", "score": "0.542409", "text": "function showPopup(){\n $(\"#popup-content\").html(\"\");\n $(\".mask\").removeClass('hidden');\n $(\".wrapper\").removeClass('hidden');\n $(\"#async-load\").removeClass('hidden');\n}", "title": "" }, { "docid": "b5d470deed7e38deb4d401049b9ad5e5", "score": "0.5409255", "text": "function SlidePopupIn()\n {\n var $slider = $('#ej-plugin-socialslideout');\n if ($slider.is(\".ej-ss-animate-in\"))\n return;\n\n $slider.removeClass(\"ej-ss-animate-close\");\n $slider.removeClass(\"ej-ss-animate-out\");\n $slider.addClass(\"ej-ss-animate-in\");\n $slider.animate({ 'left': '0px', 'opacity': '1' }, 800, function ()\n {\n $slider.removeClass(\"ej-ss-animate-in\");\n });\n }", "title": "" }, { "docid": "9db2bc78bab2199dd0a2a8fbf4240b45", "score": "0.54091954", "text": "function openPopup() {\n $('#overlay').removeClass(\"hidden\");\n}", "title": "" }, { "docid": "f77308de790f2e621b8c45dd7a1cc652", "score": "0.54070646", "text": "function showPopUp(){\n //When cuntion called show moda/pop up and overlay by adding class that has visibility: visible;\n if(POPUP.classList){\n POPUP.classList.add(\"showPopUp\");\n OVERLAY.classList.add(\"showPopUp\");\n //This is for older IE.\n }else{\n POPUP.className += ' ' + \"showPopUp\";\n OVERLAY.className += ' ' + \"showPopUp\";\n }\n //Event listeners for playAgain button and x for close.\n PLAYAGAINMODAL.addEventListener('click', doPlayAgain);\n CLOSEMODAL.addEventListener('click', closePopUp);\n}", "title": "" }, { "docid": "f633cc2d1071f6c958eac08ea21bc47d", "score": "0.54054976", "text": "function fadein() {\n var that = this;\n that.handle = setInterval(function() {\n that.opacity = that.opacity + speed[that.o.speed].step || speed[that.o.speed].step;\n that.popup.style.opacity = that.opacity / 100;\n that.popup.style.filter = 'alpha(opacity='+that.opacity+')';\n if( that.opacity >= 90 ) {\n clearInterval(that.handle);\n that.o.sticky || setTimeout(function() {\n fadeout.apply(that);\n }, that.o.timeout);\n }\n }, speed[that.o.speed].timeout);\n }", "title": "" }, { "docid": "94a0e44b9d53a4e242b512a72fa6bf28", "score": "0.540152", "text": "static EnumMaskPopup() {}", "title": "" }, { "docid": "1514363a1fa97b4f03b2951519d54699", "score": "0.5400346", "text": "function disableAnimation(){\n $(\"#loadingAnimationBorder\").fadeOut(\"slow\");\n}", "title": "" }, { "docid": "ab7882a8e090f2be1a281aefd91da18c", "score": "0.53697044", "text": "function restoreOpacity() {\n $(this).fadeTo(0, 1);\n }", "title": "" }, { "docid": "fc1068716691e6b1f84b0fc60ae994fc", "score": "0.5351017", "text": "isAnimating() {\n return !!this.animation;\n }", "title": "" }, { "docid": "34d5e4f24e94a51adedef402f5b7667d", "score": "0.5349288", "text": "disableTransition() {\n return this.disableCSS()\n }", "title": "" }, { "docid": "76fa6e06142d8c8283f81af8d29a6691", "score": "0.5345783", "text": "function animate_handler(){if(typeof settings.obj.draw=='function')settings.obj.draw();}", "title": "" }, { "docid": "6c42fd043e4af89c261ead9bc6c05960", "score": "0.53447783", "text": "_pauseAnimations(work) {\n this._menu.addClass('no-transition');\n work();\n this._menu[0].offsetHeight; // trigger a reflow, flushing the CSS changes\n this._menu.removeClass('no-transition');\n }", "title": "" }, { "docid": "ba7dc3d2632acd7708648d31174709c0", "score": "0.53423196", "text": "function me(){return pe?fe.exports:(pe=1,fe.exports=function(e,t,i){const n=e=>e&&\"object\"==typeof e&&\"default\"in e?e:{default:e},r=n(e),o=n(i),s=\"backdrop\",a=\"fade\",l=\"show\",c=`mousedown.bs.${s}`,u={className:\"modal-backdrop\",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:\"body\"},h={className:\"string\",clickCallback:\"(function|null)\",isAnimated:\"boolean\",isVisible:\"boolean\",rootElement:\"(element|string)\"};class d extends o.default{constructor(e){super(),this._config=this._getConfig(e),this._isAppended=!1,this._element=null}static get Default(){return u}static get DefaultType(){return h}static get NAME(){return s}show(e){if(!this._config.isVisible)return void t.execute(e);this._append();const i=this._getElement();this._config.isAnimated&&t.reflow(i),i.classList.add(l),this._emulateAnimation((()=>{t.execute(e)}))}hide(e){this._config.isVisible?(this._getElement().classList.remove(l),this._emulateAnimation((()=>{this.dispose(),t.execute(e)}))):t.execute(e)}dispose(){this._isAppended&&(r.default.off(this._element,c),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const e=document.createElement(\"div\");e.className=this._config.className,this._config.isAnimated&&e.classList.add(a),this._element=e}return this._element}_configAfterMerge(e){return e.rootElement=t.getElement(e.rootElement),e}_append(){if(this._isAppended)return;const e=this._getElement();this._config.rootElement.append(e),r.default.on(e,c,(()=>{t.execute(this._config.clickCallback)})),this._isAppended=!0}_emulateAnimation(e){t.executeAfterTransition(e,this._getElement(),this._config.isAnimated)}}return d}(W(),$(),he()))}", "title": "" }, { "docid": "4d7b045719219af8713983ee72af361e", "score": "0.5336681", "text": "reset(callback){return null!==this.__animationController&&this.__animationController.reset(callback),this}", "title": "" }, { "docid": "0c0d5c0341cbf0a9dd55aad8b4422657", "score": "0.53297865", "text": "function fadeGif() {\n loadingGif.style.opacity = 0;\n}", "title": "" }, { "docid": "39a4d3176710860d31c7ac4a30e7e16a", "score": "0.5327508", "text": "function prepareAnimateOptions(options){return isObject(options)?options:{};}", "title": "" }, { "docid": "39a4d3176710860d31c7ac4a30e7e16a", "score": "0.5327508", "text": "function prepareAnimateOptions(options){return isObject(options)?options:{};}", "title": "" }, { "docid": "39a4d3176710860d31c7ac4a30e7e16a", "score": "0.5327508", "text": "function prepareAnimateOptions(options){return isObject(options)?options:{};}", "title": "" }, { "docid": "39a4d3176710860d31c7ac4a30e7e16a", "score": "0.5327508", "text": "function prepareAnimateOptions(options){return isObject(options)?options:{};}", "title": "" }, { "docid": "e417229c907efd98b611011166ad6c76", "score": "0.5315855", "text": "get isTransitionEnabled() {\n return this.onIcon_.style.position == \"absolute\";\n }", "title": "" }, { "docid": "3e9bad214b3ed41f999fe126b0ceebe8", "score": "0.5314121", "text": "function popup_delay() \r\n{ \r\n\tdelay--;\r\n\tif(delay <= 0) \r\n\t{\r\n\t\tclearInterval(interval_id_delay);\r\n\t\titro_enter_anim();\r\n\t}\r\n}", "title": "" }, { "docid": "a5a4780dfdb282b98d022d2efa6f8174", "score": "0.5312559", "text": "function hide_popupwindowbox(){\n\t\t\n\t\tvar container=$('#eventon_popup');\n\t\tvar clear_content = container.attr('clear');\n\t\t\n\t\tif(container.hasClass('active')){\n\t\t\tcontainer.animate({'margin-top':'70px','opacity':0},300).fadeOut().\n\t\t\t\tremoveClass('active')\n\t\t\t\t.delay(300)\n\t\t\t\t.queue(function(n){\n\t\t\t\t\tif(clear_content=='true')\t\t\t\t\t\n\t\t\t\t\t\t$(this).find('.eventon_popup_text').html('');\n\t\t\t\t\t\t\n\t\t\t\t\tn();\n\t\t\t\t})\t\t\t\t\n\t\t\t\t\n\t\t}\n\t}", "title": "" }, { "docid": "9c1b104e6c20b982998c441101f82210", "score": "0.53113186", "text": "function closeEndgamePopup() {\n let endgameBox = document.getElementById(\"endgameBox\")\n let dimmer = document.getElementById(\"dimmer\")\n clickToggler(\"enable\")\n\n\n endgameBox.style.opacity= \"0\";\n dimmer.style.opacity = \"0\"\n\n setTimeout(function() {\n endgameBox.style.display = \"none\";\n \n },200)\n}", "title": "" }, { "docid": "192b6f0877b9c252c5a0b8b54cd29ae0", "score": "0.53054386", "text": "function removeAnimation(element){\n return addClass(element, NO_TRANSITION);\n }", "title": "" }, { "docid": "192b6f0877b9c252c5a0b8b54cd29ae0", "score": "0.53054386", "text": "function removeAnimation(element){\n return addClass(element, NO_TRANSITION);\n }", "title": "" }, { "docid": "c9effcd4e8e0a98139e34ee6906112d7", "score": "0.53053606", "text": "function flashCurtain() {\n\t\t$animationCurtain.css(\"z-index\", 100);\n\t\t$animationCurtain.on(\"animationend webkitAnimationEnd oAnimationEnd\", function() {\n\t\t\t$(this).css(\"z-index\", -1);\n\t\t\t$(this).removeClass(\"disappearAppear\");\n\t\t});\n\t\t$animationCurtain.addClass(\"disappearAppear\");\n\t}", "title": "" }, { "docid": "58c7f429e95e71d91108c93551d44dce", "score": "0.53029877", "text": "function startNoneTransition() {\r\n var currentSlideElement = slideDivs[currentIndex],\r\n previousSlideElement;\r\n\r\n if (previousIndex != -1)\r\n slideDivs[previousIndex].css('visibility', '');\r\n\r\n slideDivs[currentIndex].css('visibility', 'visible');\r\n\r\n setTimeout(function () {\r\n completeTransition();\r\n }, 1);\r\n }", "title": "" }, { "docid": "59041a81b1030436f03c1cfc025b651d", "score": "0.530101", "text": "@action hide() {\n this.overlay.passProps = null\n this.overlay.Component = null\n\n if (this.isModal) {\n this.isModal = false\n\n if (this.hasBlockedScrollEvents) {\n this.hasBlockedScrollEvents = false\n }\n }\n\n if (this.opacityOverlay.isVisible) {\n this.opacityOverlay.isVisible = false\n }\n }", "title": "" }, { "docid": "3a1593402a28489417a7a70ef77898e8", "score": "0.53000355", "text": "setInBackground() {\n this.div.style.zIndex = 0;\n }", "title": "" }, { "docid": "3a1593402a28489417a7a70ef77898e8", "score": "0.53000355", "text": "setInBackground() {\n this.div.style.zIndex = 0;\n }", "title": "" }, { "docid": "af5ae6a49d1f45ea5b9cf88d560b24cf", "score": "0.52974033", "text": "function playAnimation(){\n\tvar animationButtonID = \"startAnimationButton\";\n\t\n\tdisableElement(animationButtonID);\n\tinitiateAnimation();\t\n}", "title": "" }, { "docid": "6ca115deee7b51e728f6c29940e09594", "score": "0.52969843", "text": "get transparent() {\n return this.blend;\n }", "title": "" }, { "docid": "442feb25027226050cc285395635ae46", "score": "0.52961546", "text": "function bouton(){\r\n if($(\"#fondJeu\").is(':animated')){\r\n setTimeout(function () { //pour eviter le stackoverflow\r\n bouton();\r\n }, 50);\r\n } else {\r\n $('#fleche').animate({\r\n opacity: 0\r\n }, 600 );\r\n setTimeout(function () {\r\n $('#fleche').remove();\r\n $(\"#play\").css({zIndex: \"1\"});\r\n $(\"#play\").animate({\r\n opacity: 1\r\n }, 2000);\r\n }, 700);\r\n $(\".ligne\").animate({ //animation de la ligne du titre\r\n width: \"30%\",\r\n height: \"2px\",\r\n opacity: 1\r\n }, 1500 );\r\n };\r\n }", "title": "" }, { "docid": "dbdd0d50954e4a7e25dcfa512a936f0d", "score": "0.5291838", "text": "_clearAnimationClasses() {\n this._hostElement.classList.remove(OPENING_CLASS, CLOSING_CLASS);\n }", "title": "" }, { "docid": "14ca0e99beb3c546d0f56a1c1cfc9f50", "score": "0.5288845", "text": "_clearAnimationClasses() {\n this._hostElement.classList.remove(OPENING_CLASS);\n this._hostElement.classList.remove(CLOSING_CLASS);\n }", "title": "" }, { "docid": "9f80995a5fed61d064d5ec6547fde1c2", "score": "0.5284791", "text": "function closePopUp(){\n\tpopUp.classList.add(\"none\");\n}", "title": "" }, { "docid": "1c178951bd0db6f58ec8b3671eb19382", "score": "0.52841336", "text": "isAnimating() {\n return !!this.animation;\n }", "title": "" }, { "docid": "47b2b1e2b1a6c77717c527820bfed0f8", "score": "0.52831703", "text": "function resetAnimation() {\n setTimeout(function(){\n animation_lock = false;\n }, 3000);\n}", "title": "" }, { "docid": "b4e7541473e6176e842ce0729b801d17", "score": "0.5279325", "text": "function defaultTransition() {\n if (this.newElement) {\n this.newElement.css({ visibility: '' });\n }\n return _liquidFire.Promise.resolve();\n }", "title": "" }, { "docid": "b4e7541473e6176e842ce0729b801d17", "score": "0.5279325", "text": "function defaultTransition() {\n if (this.newElement) {\n this.newElement.css({ visibility: '' });\n }\n return _liquidFire.Promise.resolve();\n }", "title": "" }, { "docid": "49f3fd604e04d08f3985668d144395f6", "score": "0.52760077", "text": "function Transition_noop() {}", "title": "" } ]